You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
When using both on-event and on-target-branch annotations, it's important to note that if an on-cel-expression annotation is also present, the on-cel-expression will take precedence. This means that the conditions specified in on-event and on-target-branch will be ignored.
To avoid confusion, we should warn users in both the user events namespace and the controller logs when they define a PipelineRun that includes both on-cel-expression and either on-event or on-target-branch.
In this example, even though on-event and on-target-branch are specified, the on-cel-expression will take precedence. The PipelineRun will only be triggered if the event is a pull request targeting the main branch and the source branch is feature.
Proposed Solution:
User Events Namespace Warning:
When a PipelineRun is created with both on-cel-expression and on-event/on-target-branch, a warning event should be emitted in the user's namespace. This warning should clearly state that on-cel-expression will override the other annotations.
Example warning message:
Warning: The PipelineRun "example-pipeline" has both `on-cel-expression` and `on-event`/`on-target-branch` annotations. The `on-cel-expression` will take precedence, and the other annotations will be ignored.
Controller Logs Warning:
Similarly, a warning should be logged in the Pipelines-as-Code controller logs to indicate that the user has defined conflicting annotations. This will help administrators and developers debug issues related to PipelineRun matching.
Example log message:
WARN: PipelineRun "example-pipeline" in namespace "user-namespace" has conflicting annotations (`on-cel-expression` and `on-event`/`on-target-branch`). `on-cel-expression` will take precedence.
Why This Matters:
User Awareness: Users may not realize that on-cel-expression overrides other annotations, leading to unexpected behavior in their CI pipelines. A clear warning in their namespace will help them understand why their PipelineRun is not being triggered as expected.
Debugging: Logging this warning in the controller logs will assist administrators in identifying and resolving issues related to PipelineRun configurations.
Next Steps:
Implement the warning mechanism in the Pipelines-as-Code controller to emit events in the user's namespace and log warnings when conflicting annotations are detected.
Update the documentation to explicitly mention this behavior and the warnings that users can expect.
The text was updated successfully, but these errors were encountered:
Description:
When using both
on-event
andon-target-branch
annotations, it's important to note that if anon-cel-expression
annotation is also present, theon-cel-expression
will take precedence. This means that the conditions specified inon-event
andon-target-branch
will be ignored.To avoid confusion, we should warn users in both the user events namespace and the controller logs when they define a PipelineRun that includes both
on-cel-expression
and eitheron-event
oron-target-branch
.Example Scenario:
In this example, even though
on-event
andon-target-branch
are specified, theon-cel-expression
will take precedence. The PipelineRun will only be triggered if the event is a pull request targeting themain
branch and the source branch isfeature
.Proposed Solution:
User Events Namespace Warning:
on-cel-expression
andon-event
/on-target-branch
, a warning event should be emitted in the user's namespace. This warning should clearly state thaton-cel-expression
will override the other annotations.Example warning message:
Controller Logs Warning:
Example log message:
Why This Matters:
on-cel-expression
overrides other annotations, leading to unexpected behavior in their CI pipelines. A clear warning in their namespace will help them understand why their PipelineRun is not being triggered as expected.Next Steps:
The text was updated successfully, but these errors were encountered: