-
Feature
-
Resolution: Unresolved
-
Major
-
None
-
None
-
False
-
None
-
False
-
-
-
Problem Statement
Currently, in Tekton triggers, CEL expressions are used to define conditions for triggering builds based on events and changes in specific branches or paths. However, there is a limitation in handling scenarios where changes are made to both ignored paths and other paths in the same commit.
For example, consider the following CEL expression:
event == "push" && !".github/**".pathChanged()
This expression correctly prevents triggering a build when changes are made solely to files under the .github directory (Scenario 1), and it triggers a build when changes are made to other paths (Scenario 2). However, it fails to trigger a build when changes are made to both ignored paths (e.g., .github/{}) and other paths (Scenario 3).
Proposed Solution
To address this limitation and improve the flexibility of defining build triggers, I'd like a new function called pathIgnore() in CEL expressions. For example,
event == "push" && ".github/**".pathIgnore()
The pathIgnore() function would allow users to specify paths that should be ignored when evaluating whether to trigger a build. If changes are made only to ignored paths, the build would not be triggered. However, if changes are made to other paths in addition to ignored paths, the build should be triggered.
Benefits:
- Provides more granular control over build triggers by allowing users to ignore specific paths.
- Avoids false negatives in trigger evaluation when changes are made to both ignored paths and other paths in the same commit.
- Enhances the flexibility and usability of CEL expressions in defining build trigger conditions.
- is related to
-
SRVKP-6464 add an annotation to match a PipelineRun on a path change
- To Do