Protected secret variables UI inconsistent
Summary
The UI for secret/protected variables is inconsistent/buggy when dealing with the same variable names across multiple environments. There are multiple bugs/inconsistencies, they'll be highlighted in bold in the steps to reproduce.
Steps to reproduce
- Create a project w/ a CI file that creates 3 environments. I used
Integration
,Pre-Production
andProduction
- Run the pipeline & wait for it to finish.
- Go to CI/CD Settings -> Secret Variables.
- Create a variable. Select Protected and Select the "Integration" environment.
- The "Environment" dropdown does not populate with the environments created via step 1. The workaround is to create a wildcard for the "Integration" environment.
- Create 2 more variables with the same name/key for the other environments (see screenshots below).
- For any of the above variables, drop down the environment and de-select the currently selected environment.
- The Environments box still shows the de-selected item. (screenshot 1)
- If you drop down the environments again, the selection is not visible (screenshot 1)
-
If you save, you will not get an error, but if you click
reveal values
thensave
again you'll get an error (screenshot 2)
We've seen additional errors when modifying fields other than the environment
, but those seem to be more inconsistent. We've identified that modifying multiple of the variables at once causes more issues.
If you play around with different changes within the secret variables, you will see there is inconsistency in some of the above. Sometimes you'll get an error message, other times it works. It's very confusing and difficult to trust. We've had some users report they lost the updated values because it didn't save when they expected it to.
The real use case we're targeting here is managing AWS credentials depending on the environment you're targeting. It compounds the problem because you'll have 3 variables per environment. The UI behavior makes it difficult to effectively manage these.
Example Project
https://gitlab.com/joe.conrady/ci-variables-test
Feel free to use/modify the above project. It was specifically created for this issue.
Relevant logs and/or screenshots
Output of checks
Happens on GitLab.com
Possible fixes
We've found updating/creating only one entry at a time in the secret variables appears to avoid most of the above problems.