Uploaded image for project: 'OpenShift Pipelines'
  1. OpenShift Pipelines
  2. SRVKP-9118

Custom Params do not work in on-cel-expression

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • Pipelines as Code
    • None
    • False
    • Hide

      None

      Show
      None
    • False

      Custom Params cannot be used in on-cel expressions with errors that appear to be bugs

      Given a Repository CR with a custom param like below:

      spec:
        params:
        - name: test_params
          value: "true"
      

      The following on-cel-expressions do not work:

      Using event_type == "push" && {{test_params == true}} results in the following error:

      CEL expression evaluation error: expression "event_type == \"push\" && true == true" check failed: ERROR: <input>:1:1: undeclared reference to 'event_type' (in container '')  | event_type == "push" && true == true  | ^
      

      Removing the curly braces from the custom-param results in a different error:

      CEL expression evaluation error: expression "event_type == \"push\" && test_params == true" check failed: ERROR: <input>:1:1: undeclared reference to 'event_type' (in container '')  | event_type == "push" && test_params == true  | ^ ERROR: <input>:1:25: undeclared reference to 'test_params' (in container '')  | event_type == "push" && test_params == true  | ........................^
      

      However if I remove the reference to event_type, using just the on-cel expression {{test_params == true}} then the pipelinerun is matched as expected...

      Workaround

      Prerequisites (if any, like setup, operators/versions):

      Steps to Reproduce

       # <steps>

       

      Actual results:

      Expected results:

      Reproducibility (Always/Intermittent/Only Once):

      Acceptance criteria: 

       

      Definition of Done:

      Build Details:

      Additional info (Such as Logs, Screenshots, etc):

       

       *

              Unassigned Unassigned
              rh-ee-athorp Andrew Thorp
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: