Skip to content

Resolve "Allow to delete deployments via API"

Allen Cook requested to merge 336746-allow-to-delete-deployments-via-api into master

What does this MR do and why?

Allows a user to delete deployments they own via DELETE command on the deployments API

curl --request "DELETE" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/deployments/1"

This is behind the :delete_deployments_api feature flag

Screenshots or screen recordings

Expected response { "message": "202 Accepted" }

How to set up and validate locally

  1. Enable the feature flag :delete_deployments_api - i.e. Feature.enable(:delete_deployments_api)
  2. Create a deployment and note the deployment ID (as well as the project ID)
  3. Delete the deployment via curl (or your favorite REST client) curl --request "DELETE" --header "PRIVATE-TOKEN: <your_access_token>" "https://<GITLAB_HOST>/api/v4/projects/<PROJECT_ID>/deployments/<DEPLOYMENT_ID>"

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #336746 (closed)

Edited by Allen Cook

Merge request reports

Loading