Improve error messages for protect environment setting
What does this MR do and why?
This MR fixes #368353 (closed). We now use serverside error messages if present, and provide a better error message for the case when the environment is already protected.
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.
- Make sure you are running an EE version of gitlab locally
- Navigate to
Project -> Operate -> Environments
and make sure you have at least one environment there - Navigate to
Settings -> CI/CD
And find a protected environment expando there. - Duplicate the browser tab with the settings.
- Open the
Protected environments
expando, select an environment to protect and select users allowed to deploy. DON'T PRESS PROTECT yet - Repeat the previous step on a duplicated browser tab. This time PRESS PROTECT button to save the changes.
- Return to the other settings tab and PRESS PROTECT button there there. You should see the error message saying that this environment is already protected.
Edited by Andrei Zubov