Add environment_scope filter to ci-variables API
What does this MR do?
Related to: #9912 (closed)
When there are two variables with the same key
but different environment_scope
, problems may happen when updating and deleting them.
In this MR, we are adding filter[environment_scope]
parameter to these ci_variables API endpoints:
- GET /projects/:id/variables/:key
- PUT /projects/:id/variables/:key
- DELETE /projects/:id/variables/:key
We've discussed a lot in the issue, and tried to come up with a non-breaking change. This change is still a breaking change, because we start returning 409 Conflict
when the action is dangerous. However, that's the ~bug we are trying to fix here.
This fix is behind a feature flag ci_variables_api_filter_environment_scope
. (Disabled by default)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team