Commit a34ae2ff authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'sy-alert-assignee-feature-flag' into 'master'

Hide N+1 query behind intended feature flag

See merge request gitlab-org/gitlab!33445
parents 7c065e6b d2486ae4
......@@ -88,6 +88,12 @@ module Types
[Types::UserType],
null: true,
description: 'Assignees of the alert'
def assignees
return User.none unless Feature.enabled?(:alert_assignee, object.project)
object.assignees
end
end
end
end
......@@ -137,5 +137,18 @@ describe 'getting Alert Management Alerts' do
end
end
end
context 'with alert_assignee flag disabled' do
before do
stub_feature_flags(alert_assignee: false)
project.add_developer(current_user)
post_graphql(query, current_user: current_user)
end
it 'excludes assignees' do
expect(alerts.first['assignees']).to be_empty
end
end
end
end
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