Validation too strict on duplicate CI variable names
Summary
Creating duplicate named variables in the CI/CD Variables page incorrectly reports a validation error. This didn't used to happen, but this bug was seemingly introduced when we upgraded to 12.5.3-ee (63955893).
I am reliant on the old behavior of this, since it allows me to use the templating feature properly, without having to think of insane key names just to keep them off each others toes.
Steps to reproduce
- Head to the
Project settings > CI/CD Settings > Variables
tab. - Enter a variable, For example: DB_HOST: localhost.
- Set its environment to a new Wildcard (for example
production
) - Enter another variable with the same name as Step 2.
- Set its environment to another new Wildcard that is not the same as Step 3. (for example
staging
). - Click the green "Save variables" button at the bottom of the table.
- Observe the validation error "Variables key (DB_HOST) has already been taken"
This is probably not the most formal way to report this. But when using a large number of variables, the error message is not visible when clicking the green button. And it's not immediately obvious whether the variables are successfully saved or not. Only after scrolling back up it is obvious.
Example Project
(If possible, please create an example project here on GitLab.com that exhibits the problematic behavior, and link to it here in the bug report)
(If you are using an older version of GitLab, this will also determine whether the bug is fixed in a more recent version)
What is the current bug behavior?
A spurious validation error.
What is the expected correct behavior?
I expect the variables to save, as they did in the previous versions of GitLab.
Relevant logs and/or screenshots
Possible fixes
I suggest to revert back to the old behavior.