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

[tkn pac cel]: unclear error messages when body/headers are missing or incomplete

XMLWordPrintable

    • Ranked Issues

      Description of problem:

      When running `tkn pac cel` Without any arguments or with only headers/body, the command fails with misleading error messages. Instead of clearly informing that both -b (body) and -H (headers) are required, it displays low-level messages such as 'auto-detection failed', 'unexpected end of JSON input', or 'unknown X-Gitlab-Event'. This makes it hard to understand what is actually missing from the command.

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

      tkn-pac 0.39.2

      Steps to Reproduce

      Install the latest Tkn PAC CLI (0.39.2)

      pac tkn pac cel

      pac tkn pac cel -H gitlab-headers.txt

      pac tkn pac cel -b gitlab-payload.json

      Actual results:

      ➜  pac tkn pac cel
      Error: auto-detection failed: unable to detect provider from headers or payload
      
      ➜  pac tkn pac cel -H gitlab-headers.txt
      Error: unexpected end of JSON input
      
      ➜  pac tkn pac cel -b gitlab-payload.json
      Error: unknown X-Gitlab-Event 

      Expected results:

      Error: body (-b) and headers (-H) are required to evaluate CEL expressions

              rh-ee-akpant Akshay Pant
              rhn-support-sselvan Sri Vignesh Selvan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: