Commit 19ef40af authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'qa-shl-fix-feature-enabled' into 'master'

Ensure feature exists before checking attributes

See merge request gitlab-org/gitlab!50956
parents d17fdd22 def79d6b
...@@ -32,7 +32,7 @@ module QA ...@@ -32,7 +32,7 @@ module QA
def enabled?(key, **scopes) def enabled?(key, **scopes)
feature = JSON.parse(get_features).find { |flag| flag['name'] == key.to_s } 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 end
private private
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment