Skip to content

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:

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

Availability and Testing

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
Edited by Furkan Ayhan

Merge request reports