Skip to content

Allow setting feature flag for a single namespace

Fabio Pitino requested to merge support-namespaces-in-features-api into master

What does this MR do and why?

The ChatOps command to set a feature flag for a specific actor doesn't work (internal link) if the target is the full path of a user namespace. It works as expected when a group full path is passed in as option:

  • /chatops run feature set --group=fabiopitino <feature_flag> true does not update anything.
  • /chatops run feature set --group=gitlab-org <feature_flag> true update the FF correctly for the target group.

While it seems to work as expected, because a UserNamespace is not a Group, we allow a namespace to be used as actor in the code, as per our documentation.

# This is accepted
Feature.enabled?(:my_feature_flag, namespace, default_enabled: :yaml)

This MR allows all namespaces to be set via the namespace target actor type. In a follow up MR we will make ChatOps compatible with this new actor type by supporting --namespace= option.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Fabio Pitino

Merge request reports