-
Story
-
Resolution: Unresolved
-
Major
-
None
-
Pipelines 1.18.0
-
8
-
False
-
None
-
False
-
KONFLUX-134 - Cancel PipelineRuns on PR update
-
-
-
Overview
The current pipelinesascode.tekton.dev/cancel-in-progress: "true" feature only allows for standard cancellation of PipelineRuns. To provide greater flexibility and control, this story proposes extending the cancel-in-progress functionality to support additional PipelineRun statuses, specifically:
- Cancelled: Cancels the PipelineRun, marking spawned TaskRuns as canceled, deleting associated Pods, and skipping retries. Pending finally tasks are not executed.
- CancelledRunFinally: Cancels the PipelineRun, marking spawned TaskRuns as canceled, deleting associated Pods, and skipping retries. Finally tasks are executed as usual.
- StoppedRunFinally: Gracefully stops the PipelineRun, allowing spawned TaskRuns to complete, including retries, but no new non-finally tasks are scheduled. Finally tasks are executed afterwards.
Proposed Functionality:
- Annotation Enhancement: Extend the pipelinesascode.tekton.dev/cancel-in-progress annotation to accept additional options:
-
- cancelled
-
- cancelledRunFinally
-
- stoppedRunFinally
- Configuration Support: Ensure these options are properly handled and passed to the status field of the PipelineRun when the annotation is applied.
- Backward Compatibility: Maintain support for the current behavior (cancel-in-progress: "true"), defaulting to the standard cancellation mechanism.
- Graceful Handling: Implement robust handling for each new status type to ensure TaskRuns, Pods, and finally tasks behave according to the defined specifications.
Benefits:
- Provides administrators and users with more granular control over how PipelineRuns are terminated or stopped.
- Supports diverse workflows where different levels of cancellation or stopping are needed.
- Enhances resource optimization and user experience by aligning PipelineRun management with specific project requirements.
Acceptance Criteria:
- Users can specify cancelled, cancelledRunFinally, or stoppedRunFinally as values for the pipelinesascode.tekton.dev/cancel-in-progress annotation.
- PipelineRuns respond appropriately to the selected cancellation type, updating the status field and modifying TaskRun behavior as needed.
- Comprehensive testing ensures compatibility with existing and new behaviors.