Skip to content

Add `group_inheritance_type` to deploy access levels and approval rules

What does this MR do and why?

This adds the recently added group_inheritance_type attribute to the protected environment deploy access levels and approval rules API

Screenshots or screen recordings

POST .../api/v4/groups/628/protected_environments

{
	"name": "staging",
	"deploy_access_levels": [
		{
			"access_level": 40,
			"access_level_description": "myorg",
			"user_id": null,
			"group_id": 628,
			"group_inheritance_type": 1
		}
	],
	"required_approval_count": 0,
	"approval_rules": []
}

How to set up and validate locally

  1. Update a protected environment with a group_inheritance_type
curl --request POST \
  --url 'http://<GITLAB_URL>/api/v4/groups/<GROUP_ID>/protected_environments' \
  --header 'Authorization: Bearer <AUTH_TOKEN>' \
  --header 'Content-Type: application/json' \
  --data '{
	"name": "staging", 
  "deploy_access_levels": 
	 [
		 { "group_id":<GROUP_ID>, "group_inheritance_type": 1 }
	 ]
}'
  1. See result has new group_inheritance_type flag set

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 #353309 (closed)

Edited by Allen Cook

Merge request reports

Loading