diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-27 03:09:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-27 03:09:34 +0300 |
commit | 5a80b10a845c1df6d73804090265a3da67c6acc4 (patch) | |
tree | a0cc9c6a4e5307c37b1b7ad51c186d7351a8b788 /lib/feature.rb | |
parent | a8324cd026394f672b0ae482aef0f5007fe1db8e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/feature.rb')
-rw-r--r-- | lib/feature.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/feature.rb b/lib/feature.rb index 7c926b25587..ad243719096 100644 --- a/lib/feature.rb +++ b/lib/feature.rb @@ -57,7 +57,7 @@ class Feature # use `default_enabled: true` to default the flag to being `enabled` # unless set explicitly. The default is `disabled` # TODO: remove the `default_enabled:` and read it from the `defintion_yaml` - # check: https://gitlab.com/gitlab-org/gitlab/-/issues/30228 + # check: https://gitlab.com/gitlab-org/gitlab/-/issues/271275 def enabled?(key, thing = nil, type: :development, default_enabled: false) if check_feature_flags_definition? if thing && !thing.respond_to?(:flipper_id) @@ -65,11 +65,11 @@ class Feature "The thing '#{thing.class.name}' for feature flag '#{key}' needs to include `FeatureGate` or implement `flipper_id`" end - Feature::Definition.valid_usage!(key, type: type, default_enabled: default_enabled) + Feature::Definition.valid_usage!(key, type: type, default_enabled: :yaml) end - # If `default_enabled: :yaml` we fetch the value from the YAML definition instead. - default_enabled = Feature::Definition.default_enabled?(key) if default_enabled == :yaml + # TODO: Remove rubocop disable comment once `default_enabled` argument is removed https://gitlab.com/gitlab-org/gitlab/-/issues/271275 + default_enabled = Feature::Definition.default_enabled?(key) # rubocop:disable Lint/ShadowedArgument # During setup the database does not exist yet. So we haven't stored a value # for the feature yet and return the default. |