-
Bug
-
Resolution: Done
-
Major
-
None
-
False
-
-
False
-
The pipelinesascode.tekton.dev/cancel-in-progress: "true" annotation has been enhanced to include automatic cancellation of PipelineRuns when commits are added to an existing Merge Request in Gitlab
-
-
-
2
-
Pipelines Sprint TekShift 23, Pipelines Sprint Tekshift 25
Description of problem:
https://pipelinesascode.com/docs/guide/running/#cancelling
The cancel-in-progrees feature introduced with PAC 0.30.0 is not properly working on Gitlab pull request.
Steps to Reproduce
- Apply the following annotation to a tekton PipelineRun:apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
build.appstudio.openshift.io/repo: https://gitlab.cee.redhat.com/aap-konflux/config/ansible-automation-platform-operator-bundle-container/-/tree/\{\{revision}}
build.appstudio.redhat.com/commit_sha: "revision"
build.appstudio.redhat.com/pull_request_number: "pull_request_number"
build.appstudio.redhat.com/target_branch: "target_branch"
pipelinesascode.tekton.dev/cancel-in-progress: "true"
There are concurrent tekton pipelines running for the same pull request.
Expected results:
The expected result is that all the previous tekton pipelines should be canceled and only the last one should be up and running.
Reproducibility (Always):
Apply to PipelineRuns the following annotation:
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
build.appstudio.openshift.io/repo: https://gitlab.cee.redhat.com/aap-konflux/config/ansible-automation-platform-operator-bundle-container/-/tree/\{\{revision}}
build.appstudio.redhat.com/commit_sha: "revision"
build.appstudio.redhat.com/pull_request_number: "pull_request_number"
build.appstudio.redhat.com/target_branch: "target_branch"
pipelinesascode.tekton.dev/cancel-in-progress: "true"
And trigger more than one PR.
Acceptance criteria:
- The old pipelines must be canceled properly
- Only one running PR per pull request
Build Details: See slack thread
Additional info (Such as Logs, Screenshots, etc):
Slack thread: https://redhat-internal.slack.com/archives/C02CTEB3MMF/p1739439605456799