Skip to content

Update on-cel-expression values for tekton pipelines to limit unnecessary builds#241

Merged
fontivan merged 1 commit intorh-ecosystem-edge:mainfrom
fontivan:sskeard/update-on-cel-expression
May 5, 2025
Merged

Update on-cel-expression values for tekton pipelines to limit unnecessary builds#241
fontivan merged 1 commit intorh-ecosystem-edge:mainfrom
fontivan:sskeard/update-on-cel-expression

Conversation

@fontivan
Copy link
Copy Markdown
Member

@fontivan fontivan commented May 2, 2025

  • The Konflux build should only run if something that would affect the build was modified

Summary by CodeRabbit

  • Chores
    • Refined pipeline triggers to run only when relevant files or directories are changed in pull requests or push events to the main branch, reducing unnecessary pipeline executions.

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented May 2, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fontivan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented May 2, 2025

Walkthrough

The changes update the trigger conditions for two Tekton pipeline YAML files. Both files now use more granular CEL expressions to ensure that pipeline runs are only started when specific files or directories are changed. This refinement applies to both pull request and push events targeting the "main" branch, limiting pipeline executions to relevant modifications and avoiding unnecessary runs.

Changes

File(s) Change Summary
.tekton/recert-4-20-pull-request.yaml Refined the pull request trigger condition to require changes in specific files or directories, using .pathChanged() in CEL.
.tekton/recert-4-20-push.yaml Updated the push trigger condition to activate only when specified files or directories are changed, using .pathChanged() in CEL.

Suggested labels

lgtm, approved

Suggested reviewers

  • mresvanis

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@openshift-ci openshift-ci bot added the approved label May 2, 2025
@openshift-ci openshift-ci bot requested review from omertuc and tsorya May 2, 2025 17:43
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
.tekton/recert-4-20-push.yaml (1)

12-13: Remove trailing whitespace on CEL expression lines.
YAMLlint flags trailing spaces on these lines, which can lead to lint errors. Please trim the end-of-line spaces.

-      event == "push" &&  
+      event == "push" &&
-      target_branch == "main" &&  
+      target_branch == "main" &&
...
-        '.konflux/Dockerfile'.pathChanged() ||  
+        '.konflux/Dockerfile'.pathChanged() ||

Also applies to: 29-29

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 12-12: trailing spaces

(trailing-spaces)


[error] 13-13: trailing spaces

(trailing-spaces)

.tekton/recert-4-20-pull-request.yaml (1)

12-13: Remove trailing whitespace on CEL expression lines.
YAMLlint reports trailing spaces here. Trimming these will clear lint errors and keep the YAML clean.

-      event == "pull_request" &&  
+      event == "pull_request" &&
-      target_branch == "main" &&  
+      target_branch == "main" &&
...
-        '.konflux/Dockerfile'.pathChanged() ||  
+        '.konflux/Dockerfile'.pathChanged() ||

Also applies to: 29-29

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 12-12: trailing spaces

(trailing-spaces)


[error] 13-13: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 487db72 and 0defc30.

📒 Files selected for processing (2)
  • .tekton/recert-4-20-pull-request.yaml (1 hunks)
  • .tekton/recert-4-20-push.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.tekton/recert-4-20-push.yaml

[error] 12-12: trailing spaces

(trailing-spaces)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 29-29: trailing spaces

(trailing-spaces)

.tekton/recert-4-20-pull-request.yaml

[error] 12-12: trailing spaces

(trailing-spaces)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 29-29: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Red Hat Konflux / recert-4-20-on-pull-request
  • GitHub Check: build
🔇 Additional comments (2)
.tekton/recert-4-20-push.yaml (1)

11-32: Approve refined push-trigger conditions.
The new on-cel-expression accurately scopes the push pipeline to relevant file changes on main, reducing unnecessary builds. Ensure consistency with the pull-request trigger configuration.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 12-12: trailing spaces

(trailing-spaces)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 29-29: trailing spaces

(trailing-spaces)

.tekton/recert-4-20-pull-request.yaml (1)

11-32: Approve refined pull-request-trigger conditions.
This update aligns the PR pipeline with the push configuration, ensuring both only fire on meaningful changes. Good to merge once the globs are corrected.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 12-12: trailing spaces

(trailing-spaces)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 29-29: trailing spaces

(trailing-spaces)

Comment on lines +15 to +31
'.tekton/build-pipeline.yaml'.pathChanged() ||
'etcddump/***'.pathChanged() ||
'hack/***'.pathChanged() ||
'ouger/***'.pathChanged() ||
'src/***'.pathChanged() ||
'vendor/***'.pathChanged() ||
'build.rs'.pathChanged() ||
'Cargo.lock'.pathChanged() ||
'Cargo.toml'.pathChanged() ||
'ownership.sh'.pathChanged() ||
'reproto'.pathChanged() ||
'run_seed'.pathChanged() ||
'vendor.sh'.pathChanged() ||
'.tekton/recert-4-20-push.yaml'.pathChanged() ||
'.konflux/Dockerfile'.pathChanged() ||
'.konflux/lock-build/***'.pathChanged() ||
'.konflux/lock-runtime/***'.pathChanged()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

⚠️ Potential issue

Correct wildcard syntax in .pathChanged() patterns.
The patterns currently use triple asterisks (***), which may not be recognized by Tekton’s glob matching. Standard recursive globs use double asterisks (**). If unsupported, these conditions will never evaluate to true, defeating the purpose of fine-grained triggers.

Apply this diff to fix the patterns:

-        'etcddump/***'.pathChanged() ||
+        'etcddump/**'.pathChanged() ||
-        'hack/***'.pathChanged() ||
+        'hack/**'.pathChanged() ||
-        'ouger/***'.pathChanged() ||
+        'ouger/**'.pathChanged() ||
-        'src/***'.pathChanged() ||
+        'src/**'.pathChanged() ||
-        'vendor/***'.pathChanged() ||
+        'vendor/**'.pathChanged() ||
-        '.konflux/lock-build/***'.pathChanged() ||
+        '.konflux/lock-build/**'.pathChanged() ||
-        '.konflux/lock-runtime/***'.pathChanged()
+        '.konflux/lock-runtime/**'.pathChanged()
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'.tekton/build-pipeline.yaml'.pathChanged() ||
'etcddump/***'.pathChanged() ||
'hack/***'.pathChanged() ||
'ouger/***'.pathChanged() ||
'src/***'.pathChanged() ||
'vendor/***'.pathChanged() ||
'build.rs'.pathChanged() ||
'Cargo.lock'.pathChanged() ||
'Cargo.toml'.pathChanged() ||
'ownership.sh'.pathChanged() ||
'reproto'.pathChanged() ||
'run_seed'.pathChanged() ||
'vendor.sh'.pathChanged() ||
'.tekton/recert-4-20-push.yaml'.pathChanged() ||
'.konflux/Dockerfile'.pathChanged() ||
'.konflux/lock-build/***'.pathChanged() ||
'.konflux/lock-runtime/***'.pathChanged()
'.tekton/build-pipeline.yaml'.pathChanged() ||
'etcddump/**'.pathChanged() ||
'hack/**'.pathChanged() ||
'ouger/**'.pathChanged() ||
'src/**'.pathChanged() ||
'vendor/**'.pathChanged() ||
'build.rs'.pathChanged() ||
'Cargo.lock'.pathChanged() ||
'Cargo.toml'.pathChanged() ||
'ownership.sh'.pathChanged() ||
'reproto'.pathChanged() ||
'run_seed'.pathChanged() ||
'vendor.sh'.pathChanged() ||
'.tekton/recert-4-20-push.yaml'.pathChanged() ||
'.konflux/Dockerfile'.pathChanged() ||
'.konflux/lock-build/**'.pathChanged() ||
'.konflux/lock-runtime/**'.pathChanged()
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 29-29: trailing spaces

(trailing-spaces)

Comment on lines +15 to +31
'.tekton/build-pipeline.yaml'.pathChanged() ||
'etcddump/***'.pathChanged() ||
'hack/***'.pathChanged() ||
'ouger/***'.pathChanged() ||
'src/***'.pathChanged() ||
'vendor/***'.pathChanged() ||
'build.rs'.pathChanged() ||
'Cargo.lock'.pathChanged() ||
'Cargo.toml'.pathChanged() ||
'ownership.sh'.pathChanged() ||
'reproto'.pathChanged() ||
'run_seed'.pathChanged() ||
'vendor.sh'.pathChanged() ||
'.tekton/recert-4-20-pull-request.yaml'.pathChanged() ||
'.konflux/Dockerfile'.pathChanged() ||
'.konflux/lock-build/***'.pathChanged() ||
'.konflux/lock-runtime/***'.pathChanged()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

⚠️ Potential issue

Fix wildcard patterns in .pathChanged() calls.
The use of *** may not match any files. Tekton’s globbing expects ** for recursive matching. Incorrect patterns can silently disable triggers for those directories.

-        'etcddump/***'.pathChanged() ||
+        'etcddump/**'.pathChanged() ||
-        'hack/***'.pathChanged() ||
+        'hack/**'.pathChanged() ||
-        'ouger/***'.pathChanged() ||
+        'ouger/**'.pathChanged() ||
-        'src/***'.pathChanged() ||
+        'src/**'.pathChanged() ||
-        'vendor/***'.pathChanged() ||
+        'vendor/**'.pathChanged() ||
-        '.konflux/lock-build/***'.pathChanged() ||
+        '.konflux/lock-build/**'.pathChanged() ||
-        '.konflux/lock-runtime/***'.pathChanged()
+        '.konflux/lock-runtime/**'.pathChanged()
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'.tekton/build-pipeline.yaml'.pathChanged() ||
'etcddump/***'.pathChanged() ||
'hack/***'.pathChanged() ||
'ouger/***'.pathChanged() ||
'src/***'.pathChanged() ||
'vendor/***'.pathChanged() ||
'build.rs'.pathChanged() ||
'Cargo.lock'.pathChanged() ||
'Cargo.toml'.pathChanged() ||
'ownership.sh'.pathChanged() ||
'reproto'.pathChanged() ||
'run_seed'.pathChanged() ||
'vendor.sh'.pathChanged() ||
'.tekton/recert-4-20-pull-request.yaml'.pathChanged() ||
'.konflux/Dockerfile'.pathChanged() ||
'.konflux/lock-build/***'.pathChanged() ||
'.konflux/lock-runtime/***'.pathChanged()
'.tekton/build-pipeline.yaml'.pathChanged() ||
'etcddump/**'.pathChanged() ||
'hack/**'.pathChanged() ||
'ouger/**'.pathChanged() ||
'src/**'.pathChanged() ||
'vendor/**'.pathChanged() ||
'build.rs'.pathChanged() ||
'Cargo.lock'.pathChanged() ||
'Cargo.toml'.pathChanged() ||
'ownership.sh'.pathChanged() ||
'reproto'.pathChanged() ||
'run_seed'.pathChanged() ||
'vendor.sh'.pathChanged() ||
'.tekton/recert-4-20-pull-request.yaml'.pathChanged() ||
'.konflux/Dockerfile'.pathChanged() ||
'.konflux/lock-build/**'.pathChanged() ||
'.konflux/lock-runtime/**'.pathChanged()
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 29-29: trailing spaces

(trailing-spaces)

@fontivan
Copy link
Copy Markdown
Member Author

fontivan commented May 2, 2025

/cc @rauhersu

@openshift-ci openshift-ci bot requested a review from rauhersu May 2, 2025 17:53
@fontivan fontivan merged commit 41c3788 into rh-ecosystem-edge:main May 5, 2025
2 of 4 checks passed
@fontivan fontivan deleted the sskeard/update-on-cel-expression branch May 5, 2025 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant