Skip to content

Disallow canceling pipelines (Backend)

Problem

There is no way to prevent users from canceling pipelines.

Proposal

Acceptance Criteria

At the project level, users can switch between these roles being able to cancel pipelines:

  1. Developers and above (Default current behavior)
  2. Maintainers and above
  3. No one

Provide an api endpoint for the front end to use that allows users to switch the role that can cancel. Only the users specified should be able to cancel pipelines via the UI and via CI pipelines which run with the permissions of a specific user.

This feature will only be available with a GitLab Premium license.

  • When this feature is enabled, canceling a single job in the UI will also be disabled

Technical

Add an api endpoint to update ci cd settings to allow users to switch between the 3 possibilities. The engineering work can roughly be split into tasks:

  1. Add an enum column with the relevant role (DEVELOPERS, MAINTAINERS, null or NO_ONE) and ensure that it can be updated via an api. We could start with just a REST Internal api and then open a separate issue to add it to the public apis. !135047 (merged)
  2. Split out cancel_pipeline from update_pipeline !134408 (merged)
  3. Split out cancel_build from update_build. !135587 (merged)
  4. Add the relevant logic to policies to ensure that the new cancel_build ability changes based on roles. !135047 (merged)
  5. Final MR - small cleanup - !135987 (merged)

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited by Allison Browne