-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: annotation for matching PipelineRun on paths #1823
feat: annotation for matching PipelineRun on paths #1823
Conversation
461f054
to
7077b35
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1823 +/- ##
==========================================
- Coverage 65.31% 65.28% -0.04%
==========================================
Files 177 177
Lines 13647 13674 +27
==========================================
+ Hits 8914 8927 +13
- Misses 4134 4143 +9
- Partials 599 604 +5 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
504d84b
to
8702392
Compare
8702392
to
88a70ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just one question.
88a70ce
to
eff66b3
Compare
I have added the |
@chmouel I've used following annotation and in my PR
|
Yeah since a yaml file has changed and you ask to be ignored when that's the case , ignore would take precedence there |
I think this case should be covered in docs as well, otherwise /LGTM. |
@zakisk it's seem to be already covered, or do you have any suggestions to phrase this differently? |
If files of all extensions have been changed on an event specified in both annotations, @chmouel nice to have added this, you can rephrase if I missed something. |
eff66b3
to
82ea98d
Compare
@zakisk sounds good, i think it duplicate with the paragraph written before but maybe i am too much neck down into it and to me what seems obvious may not appear like that for people who read this for the first time. I have rephrased that whole section please have a look. |
Introduce easier-to-use annotations for matching PipelineRuns by file path changes: - `on-path-changed`: Matches PipelineRun if specified paths have changes. - `on-path-changed-ignore`: Matches PipelineRun if specified paths **do not** have changes. Examples: 1. `on-path-changed: ["pkg/*", "cli/*"]` matches if files in `pkg` or `cli` changed. 2. `on-path-changed-ignore: ["docs/**"]` matches if no changes occurred in the `docs` directory. Annotations can be combined for more specific use cases: - `on-path-changed: ["docs/**"]` - `on-path-changed-ignore: ["docs/generated/**"]` This setup triggers a PipelineRun when there are changes in the `docs` directory, except for files under `docs/generated`. Enhanced annotation options also support: - Targeting specific events (`on-target-event`: e.g., `pull_request`, `push`). - Matching specific branches (`on-target-branch`: e.g., `main`). This improves usability over existing CEL-based configuration and makes defining file-based triggers more intuitive. **Jira**: https://issues.redhat.com/browse/SRVKP-6464 Signed-off-by: Chmouel Boudjnah <[email protected]>
82ea98d
to
ac9c222
Compare
Introduce easier-to-use annotations for matching PipelineRuns by file
path changes:
on-path-change
: Matches PipelineRun if specified paths havechanged.
on-path-change-ignore
: Matches PipelineRun if specified paths donot have changed.
Examples:
on-path-change: ["pkg/*", "cli/*"]
matches if files inpkg
orcli
changed.on-path-change-ignore: ["docs/**"]
matches if no changes occurredin the
docs
directory.Annotations can be combined for more specific use cases:
on-path-change: ["docs/**"]
on-path-change-ignore: ["docs/generated/**"]
This setup triggers a PipelineRun when there are changes in the
docs
directory, except for files under
docs/generated
.Enhanced annotation options also support:
on-target-event
: e.g.,pull_request
,push
).on-target-branch
: e.g.,main
).This improves usability over existing CEL-based configuration and makes
defining file-based triggers more intuitive.
Jira: https://issues.redhat.com/browse/SRVKP-6464
Signed-off-by: Chmouel Boudjnah [email protected]
pac-path-change-annotation-matcher.mp4
Changes
Submitter Checklist
📝 Please ensure your commit message is clear and informative. For guidance on crafting effective commit messages, refer to the How to write a git commit message guide. We prefer the commit message to be included in the PR body itself rather than a link to an external website (ie: Jira ticket).
♽ Before submitting a PR, run make test lint to avoid unnecessary CI processing. For an even more efficient workflow, consider installing pre-commit and running pre-commit install in the root of this repository.
✨ We use linters to maintain clean and consistent code. Please ensure you've run make lint before submitting a PR. Some linters offer a --fix mode, which can be executed with the command make fix-linters (ensure markdownlint and golangci-lint tools are installed first).
📖 If you're introducing a user-facing feature or changing existing behavior, please ensure it's properly documented.
🧪 While 100% coverage isn't a requirement, we encourage unit tests for any code changes where possible.
🎁 If feasible, please check if an end-to-end test can be added. See README for more details.
🔎 If there's any flakiness in the CI tests, don't necessarily ignore it. It's better to address the issue before merging, or provide a valid reason to bypass it if fixing isn't possible (e.g., token rate limitations).