Skip to content

Deprecate required_approval_count parameter

What does this MR do and why?

This MR implements Prevent users from changing Unified approval se... (#388191 - closed) by changing the behavior of the following endpoints:

POST api/v4/projects/:id/protected_environments
PUT api/v4/projects/:id/protected_environments/:name 
POST api/v4/groups/:id/protected_environments
PUT api/v4/groups/:id/protected_environments/:name

This issue is a part of Deprecate and remove Unified approval setting i... (&9662) Breaking change was communicated with the users and is scheduled for 17.0 deprecations rollout.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Enable the feature toggle
     Feature.enable(:deprecate_unified_approval_rules)
  2. Create an access token for the API access (User -> Preferences -> Access Tokens)
  3. Check the api call with required_approval_count parameter set returns 423 unprocessible entity status code
curl --header 'Content-Type: application/json' --request POST \
     --data '{"name": "production", "deploy_access_levels": [{"user_id": 1}], required_approval_count: 1 \
     --header "PRIVATE-TOKEN: <your_access_token>" \
     "https://gdk.test:3443/api/v4/projects/:project_id/protected_environments"
Edited by Andrei Zubov

Merge request reports