Skip to content

Allow `filter`-parameter when updating group-level CI variables via API

What does this MR do and why?

This is a new attempt to resolve Add environment_scope filter to group ci-variab... (#340185 - closed). The first attempt in Draft: Fix and clarify `filter`-parameter usage... (!136475 - closed) was a bit broader, but would technically have introduced breaking changes to the API – which we can never do, not even in major releases.

Please see the MR description there for a more thorough problem statement.

This new MR:

  • Adds the possibility to use filter[environment_scope] when updating a group-level CI variable via API to specify which exact scoped variable should be updated
  • Retains the current behavior that not specifying a (valid) scope will just update a "random" (there is some kind of pattern to it, it's not fully random) variable and the request succeeds
  • Adds tests, especially for the latter cases, to ensure we don't accidentally "break" this in the future
  • Adds missing documentation about this new filter[environment_scope] functionality for updating group-level CI variables via API, as well as for the (already existing) filter[environment_scope] functionality when reading or deleting group-level CI variables via API

How to set up and validate locally

See the corresponding section from former MR – everything there is still true, execpt for this example: # Update "test" variable without specifying scope, get error. Giving an error here would be a breaking change, so in this MR the request for that example is still working exactly as with the current code.

Merge request reports