Add UI to restrict minimum override role

Problem

To change restrict_user_defined_variables and/or pipeline_variables_minimum_override_role we don't have a UI support in the project CI/CD settings. It's only possible to configure these settings via REST API.

With Change default of `restrict_user_defined_variab... (#502382 - closed) we will have new projects created with disabled pipeline variables by default. We need to allow users to modify these settings in a user-friendly way.

Proposal

As we are planning to deprecate restrict_user_defined_variables, we can introduce a UI setting that:

  • when restrict_user_defined_variables: false we display that pipeline_variables_minimum_override_role: :developer
  • when restrict_user_defined_variables: true we display whatever value from pipeline_variables_minimum_override_role.
  • The user can have a selectbox or slider to control the level of restriction: developer, maintainer, owner, no_one.
    • When the setting is changed we send the new value for pipeline_variables_minimum_override_role and automatically enable restrict_user_defined_variables: true if disabled.

Design spec

  • 🔗 Figma link
  • 👉 Design tab
    • Add a new section Minimum role to set pipeline variables with the help text, link to the documentation, and the radio button options. This will allow users to select the minimum role to specify manual variables when running a new pipeline.
    • Add a new section title of Project variables for the below section for better readability.
Edited by Fabio Pitino - PTO until Jan 1