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

PipelineRun with invalid spec are not reported as failed on Pull Request

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • Hide
      The handling of invalid PipelineRun specifications has been improved. Now, if a PipelineRun fails due to an invalid or unrecognized field, the failure will be correctly surfaced in the Pull Request, making it clear to the user without requiring manual inspection of cluster events.
      Show
      The handling of invalid PipelineRun specifications has been improved. Now, if a PipelineRun fails due to an invalid or unrecognized field, the failure will be correctly surfaced in the Pull Request, making it clear to the user without requiring manual inspection of cluster events.

      We have a PipelineRun that hasq an invalid tekton spec, but it is not reported as failed on the Pull Request as comment of the PullRequest as it shoudl.

      This is causing confusion as the PipelineRun since the user is not aware of the
      failure and don't necessary goes to the events namespace to check the
      errors.

      for example i have this pipelinerun:

      ---
      apiVersion: tekton.dev/v1
      kind: PipelineRun
      metadata: 
        name: toremove
        annotations: 
          pipelinesascode.tekton.dev/on-event: "[pull_request]"
          pipelinesascode.tekton.dev/on-target-branch: "[main]"
          pipelinesascode.tekton.dev/max-keep-runs: "5"
      spec: 
        params: 
          # The variable with brackets are special to Pipelines as Code
          # They will automatically be expanded with the events from Github.
          - name: repo_url
            value: "{{ repo_url }}"
          - name: revision
            value: "{{ revision }}"
        pipelinespeec: 
          # Customize this task if you like, or just do a taskRef
          # to one of the hub task.
          - name: noop-task
            displayName: Task with no effect
            taskSpec: 
              steps: 
                - name: noop-task
                  image: registry.access.redhat.com/ubi9/ubi-micro
                  script: |
                    exit 0
      

      the pipelinespeec word is invalid, and error out from the tekton controller.

      % k apply -f .tekton/toremove.yaml
      Error from server (BadRequest): error when creating ".tekton/toremove.yaml": admission webhook "webhook.pipeline.tekton.dev" denied the request: mutation failed: cannot decode incoming new object: json: unknown field "pipelinespeec"
      

      but it doesn't show as error in the pull request but shows in the events namespace:

      <unknown>   Warning   RepositoryPipelineRun   repository/scratch-my-back                           There was an error starting the PipelineRun toremove-, creating pipelinerun toremove- in namespace scratch-my-back has failed....
      

      The yaml validation error (not from controller but yaml template has an extra space for example) is properly reported....

              Unassigned Unassigned
              cboudjna@redhat.com Chmouel Boudjnah
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: