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

[tkn pac cel] CEL syntax errors exit with code 0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • QA
    • Ranked Issues

      Description of problem:

      When using tkn pac cel with an invalid CEL expression, the command correctly prints a CEL parse error, but still exits with status code 0

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

      tkn-pac 0.39.2

      Steps to Reproduce

      Valid Header and JSON body.

      echo 'event =' | tkn pac cel -p gitlab \
        -b testdata/cel/gitlab-mr-main-body.json \
        -H testdata/cel/gitlab-mr-headers-plain.txt 
      echo 'event == "pull_request" ||' | tkn pac cel -p gitlab \
        -b testdata/cel/gitlab-mr-main-body.json \
        -H testdata/cel/gitlab-mr-headers-plain.txt 

      Actual results:

      failed to parse expression "event =": ERROR: <input>:1:7: Syntax error:
      token recognition error at: '='
       | event =
       | ......^
       

      Errors with an exit code of 0.

      Expected results:

      Should error with an exit code of 1.

       *

              Unassigned Unassigned
              rhn-support-sselvan Sri Vignesh Selvan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: