Bring ability to scope environment variables to environments to Core
Problem to solve
Environment variables are currently part of core, however, limiting this feature to EE not only limits the usability of auto devops secrets https://gitlab.com/gitlab-org/gitlab-ce/issues/49056, it also affects replica scaling in auto devops, and the ability to make use of different variables for testing vs prod.
Additionally, we're seeing contributions related to this feature than may be less than ideal workarounds for the fact that Core does not have this feature by creating separate variables with the environment name prefixed to them. (ex: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/25687 ). For example, we've made it possible for people to do environment scoping anyway by using naming conventions in Auto DevOps so we may as well make it simpler by using our existing features here if we just move it to core.
We have already introduced the hacky workaround to Auto DevOps for:
Finally, once Configure Auto DevOps deployed applications with secrets that aren't committed to the repo
https://gitlab.com/gitlab-org/gitlab-ce/issues/49056 ships, EE users will be able to scope k8s secrets to particular environments, however, CE users will not as CE does not offer the ability to scope variables to environments. This was addressed via https://gitlab.com/gitlab-org/gitlab-ce/issues/46954
In conclusion, we believe this feature is key to the workflow of both individual developers and enterprise developers for the following reasons:
- As a best practice we don't want to use the same set of credentials for different environments
- Testing new features that require new variables before bringing them to prod
CE users will be able to work around this by creating multiple entries of the same variable per each environment, which is less than ideal.
Port the ability to scope variables to environments to CE.
What does success look like, and how can we measure that?
CE user will be able to scope environment variables just as EE user are able to