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

PAC unable to cancel PipelineRun when generateName field is used as PipelineRun name

XMLWordPrintable

    • Pipelines Sprint Crookshank 25, Pipelines Sprint Crookshank 26

      Story (Required)

      When PAC's cancel-in-progress annotation is used to cancel PipelineRuns on PR update or push, user may use generateName filed as PipelineRun name but PAC unable to filter PipelineRun using generateName field as it always has "-" (hyphen) suffix and kubernetes labels must be beginning and ending with alphanumeric value so an error is happening:

       

      {"level":"error","ts":"2025-03-21T11:18:25.292Z","logger":"pipelinesascode","caller":"events/emit.go:46","msg":"error cancelling in progress pipelineRuns: failed to list pipelineRuns : unable to parse requirement: values[0][pipelinesascode.tekton.dev/original-prname]: Invalid value: \"pr-test-\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')","commit":"c08fdf4","provider":"gitlab","event-id":"","event-sha":"1e3d948b2a23310a1e2738aa54b6623bc51b0cf7","event-type":"Merge Request","namespace":"test","stacktrace":"github.com/openshift-pipelines/pipelines-as-code/pkg/events.(*EventEmitter).EmitMessage\n\tgithub.com/openshift-pipelines/pipelines-as-code/pkg/events/emit.go:46\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/pipelineascode.(*PacRun).Run.func1\n\tgithub.com/openshift-pipelines/pipelines-as-code/pkg/pipelineascode/pipelineascode.go:128"}
       

      Background (Required)

      <Describes the context or background related to this story>

      Out of scope

      <Defines what is not included in this story>

      Approach (Required)

      <Description of the general technical path on how to achieve the goal of the story. Include details like json schema, class definitions>

      Dependencies

      <Describes what this story depends on. Dependent Stories and EPICs should be linked to the story.>

      Acceptance Criteria (Mandatory)

      <Describe edge cases to consider when implementing the story and defining tests>

      <Provides a required and minimum list of acceptance tests for this story. More is expected as the engineer implements this story>

      INVEST Checklist

      Dependencies identified

      Blockers noted and expected delivery timelines set

      Design is implementable

      Acceptance criteria agreed upon

      Story estimated

      Legend

      Unknown

      Verified

      Unsatisfied

      Done Checklist

      • Code is completed, reviewed, documented and checked in
      • Unit and integration test automation have been delivered and running cleanly in continuous integration/staging/canary environment
      • Continuous Delivery pipeline(s) is able to proceed with new code included
      • Customer facing documentation, API docs etc. are produced/updated, reviewed and published
      • Acceptance criteria are met

              rh-ee-zashaikh Zaki Shaikh
              rh-ee-zashaikh Zaki Shaikh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: