diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 09:08:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 09:08:42 +0000 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /qa/qa/runtime/feature.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) | |
download | gitlab-ce-b76ae638462ab0f673e5915986070518dd3f9ad3.tar.gz |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'qa/qa/runtime/feature.rb')
-rw-r--r-- | qa/qa/runtime/feature.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/qa/qa/runtime/feature.rb b/qa/qa/runtime/feature.rb index dd7f9cf898c..7011f46542b 100644 --- a/qa/qa/runtime/feature.rb +++ b/qa/qa/runtime/feature.rb @@ -32,7 +32,7 @@ module QA def enabled?(key, **scopes) feature = JSON.parse(get_features).find { |flag| flag['name'] == key.to_s } - feature && (feature['state'] == 'on' || feature['state'] == 'conditional' && scopes.present? && enabled_scope?(feature['gates'], scopes)) + feature && (feature['state'] == 'on' || feature['state'] == 'conditional' && scopes.present? && enabled_scope?(feature['gates'], **scopes)) end private @@ -43,7 +43,7 @@ module QA raise AuthorizationError, "Administrator access is required to enable/disable feature flags. #{e.message}" end - def enabled_scope?(gates, scopes) + def enabled_scope?(gates, **scopes) scopes.each do |key, value| case key when :project, :group, :user @@ -71,16 +71,16 @@ module QA # scopes: Any scope (user, project, group) to restrict the change to def set_and_verify(key, enable:, **scopes) msg = "#{enable ? 'En' : 'Dis'}abling feature: #{key}" - msg += " for scope \"#{scopes_to_s(scopes)}\"" if scopes.present? + msg += " for scope \"#{scopes_to_s(**scopes)}\"" if scopes.present? QA::Runtime::Logger.info(msg) Support::Retrier.retry_on_exception(sleep_interval: 2) do - set_feature(key, enable, scopes) + set_feature(key, enable, **scopes) is_enabled = nil QA::Support::Waiter.wait_until(sleep_interval: 1) do - is_enabled = enabled?(key, scopes) + is_enabled = enabled?(key, **scopes) is_enabled == enable || !enable && scopes.present? end |