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

Extend Cancel-In-Progress Feature to Support Different PipelineRun Statuses

XMLWordPrintable

      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:

      1. Cancelled: Cancels the PipelineRun, marking spawned TaskRuns as canceled, deleting associated Pods, and skipping retries. Pending finally tasks are not executed.
      1. CancelledRunFinally: Cancels the PipelineRun, marking spawned TaskRuns as canceled, deleting associated Pods, and skipping retries. Finally tasks are executed as usual.
      1. 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:

      1. Annotation Enhancement: Extend the pipelinesascode.tekton.dev/cancel-in-progress annotation to accept additional options:
        • cancelled
        • cancelledRunFinally
        • stoppedRunFinally
      1. Configuration Support: Ensure these options are properly handled and passed to the status field of the PipelineRun when the annotation is applied.
      1. Backward Compatibility: Maintain support for the current behavior (cancel-in-progress: "true"), defaulting to the standard cancellation mechanism.
      1. 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:

      1. Users can specify cancelled, cancelledRunFinally, or stoppedRunFinally as values for the pipelinesascode.tekton.dev/cancel-in-progress annotation.
      1. PipelineRuns respond appropriately to the selected cancellation type, updating the status field and modifying TaskRun behavior as needed.
      1. Comprehensive testing ensures compatibility with existing and new behaviors.

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

                Created:
                Updated: