pipelines-as-code
pipelines-as-code copied to clipboard
Enhance CEL expression to accept any branch
This change helps PAC users to provide refs/heads/* to target_branch and source_branch
Screencast from 2024-02-16 22-24-36.webm
Signed-off-by: Savita Ashture [email protected]
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).
/test
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 64.48%. Comparing base (
16596b4) to head (c0f1403).
Additional details and impacted files
@@ Coverage Diff @@
## main #1593 +/- ##
==========================================
+ Coverage 64.41% 64.48% +0.07%
==========================================
Files 143 143
Lines 11091 11108 +17
==========================================
+ Hits 7144 7163 +19
+ Misses 3421 3420 -1
+ Partials 526 525 -1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
/test
/test
/test linters
@savitaashture i am not confident the way we are doing is the right way, if we start trying to figure out what the CEL expressions (which is a turing complete language) the user mean with substrings and pattern match it will become a problem with way we don't know (the CEL spec is quite versatile)...
we need an alternative way to address the issue properly, something like allowing annotations target AND cel expression in the future, so the user can communicate that intent properly.
happy to discuss this later on in our weekly meeting.......
@savitaashture i am not confident the way we are doing is the right way, if we start trying to figure out what the CEL expressions (which is a turing complete language) the user mean with substrings and pattern match it will become a problem with way we don't know (the CEL spec is quite versatile)...
we need an alternative way to address the issue properly, something like allowing annotations target AND cel expression in the future, so the user can communicate that intent properly.
happy to discuss this later on in our weekly meeting.......
Yes Lets discuss this in pac call even i m not quite happy because we have lot of cases and scenarios user can provide using cel
Discussion points from PAC call:
- Lets keep the existing CEL functionality as it is
- Lets not add branch matching support for globe pattern as CEL is a language and handling all those globe pattern will lead to complexity
- Introduce
pipelinesascode.tekton.dev/on-source-branchannotation to handle source branch match from annotation - No globe pattern for branch supported from CEL expressions lets add a documentation for the same
Closing this PR and opening new one with on-source-branch annotation