-
Story
-
Resolution: Done
-
Normal
-
None
-
None
-
False
-
None
-
False
-
KONFLUX-134 - Cancel PipelineRuns on PR update
-
-
Story (Required)
As an opeartor trying to reduce the cluster workload and save costs I want an update to a pull request (PR) to gracefully cancel any existing running PipelineRun (PLR) that is still running for that PR.
Background (Required)
A user may submit a PR, and then submit a few revision(s) within a short time frame (i.e. short enough that the previous PLR(s) are still running when PaC instanciate the new PLR).
Any work done on the older(s) PLR has no value, and therefore the older PLRs are consuming resources for no reason.
The PLRs MUST be gracefully cancelled so the `finally` tasks are run and release any resources previous tasks might have created. See the docs.
Out of scope
Merge events are out of scope.
Approach (Required)
Proposal:
- Upon receiving a PR event, generate a UID (e.g. based on the repository URL and PR number).
- Check for any PLR running in the namespace that references that UID.
- Set the status of the PLR(s) to "CancelledRunFinally".
- Do not wait for the PLRs to finish.
- Instanciate the new PLR.
Dependencies
N/A
Acceptance Criteria (Mandatory)
- Feature is implemented
- Tests covering the feature are implemented.
- Feature is documented.
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
- is duplicated by
-
SRVKP-6745 Ability to Cancel In-Progress PipelineRuns to Conserve Resources
- On QA