Update project settings on projects API
What does this MR do and why?
This change adds two new configuration options for the REST API:
-
protect_merge_request_pipelines- Originally introduced in: !188008 (merged) -
ci_display_pipeline_variables- Originally introduced in: !200232 (merged)
For customers who rely on automation of project settings, this is a convenient way to set both of these boolean options.
References
Screenshots or screen recordings
How to set up and validate locally
- Create a project.
- Confirm in Settings → CI/CD Settings → Variables that
Allow merge request pipelines to access protected variables and runnersis enabled by default.Display pipeline variablesis not enabled. - Trigger an API call using the PUT (Edit) API for a project.
- Example:
curl --request PUT --header "PRIVATE-TOKEN: <token>" --url "http://gdk.local:3000/api/v4/projects/:id" --data "protect_merge_request_pipelines=false" - Both
protect_merge_request_pipelinesandci_display_pipeline_variablesshould be settable as true or false, which will then update the GitLab UI to reflect the state on the project.
- Example:
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.