-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
-
False
-
-
False
-
-
Description of problem:
When referencing a nested attribute from the event body in an on-cel annotation in PaC, fields which have a zero value become invalid/missing keys if referenced. e.g. event.PullRequestLabels is an empty when the pull request has no labels, so body.pull_request.labels causes the CEL expression fail execution.
Workaround
Nested attributes like this have to be accessed with (has(body.pull_request.labels) && body.pull_request.labels...).
Prerequisites (if any, like setup, operators/versions):
Steps to Reproduce
- Author a pipelinerun with an on-cel expression which references `body.pull_request.labels`
- Create a pull request with this pipelinerun which does not include any labels
Actual results:
The pipelinerun fails to start with an error like CEL expression evaluation error: expression }}-- {{failed to evaluate: no such key: pull_request
Expected results:
The pipelinerun does not start (if the on-cel does not match) but does not have any errors
Reproducibility (Always/Intermittent/Only Once): always
Acceptance criteria:
- the on-cel expression does not fail to evaluate when a referenced field is present but empty in the event.
Definition of Done:
- acceptance criteria is met
- unit tests are written
- KONFLUX-9908 is updated accordingly
Build Details:
Additional info (Such as Logs, Screenshots, etc):
*
- is cloned by
-
SRVKP-8617 body.pull_request is missing on /retest comment
-
- To Do
-