Commit 1779781b authored by Stan Hu's avatar Stan Hu

Merge branch 'mo-sort-codequality-severity' into 'master'

Sort code quality degradations by severity

See merge request gitlab-org/gitlab!62710
parents cf3015c4 500a50d0
......@@ -26,7 +26,7 @@ module EE
description: 'Code Quality degradations reported on the pipeline.'
def code_quality_reports
pipeline.codequality_reports.all_degradations.presence
pipeline.codequality_reports.sort_degradations!.values.presence
end
end
end
......
......@@ -51,6 +51,14 @@ RSpec.describe 'Query.project(fullPath).pipeline(iid).codeQualityReports' do
expect(degradation['line']).not_to be_nil
end
end
it 'returns all the queried fields ordered by severity', :aggregate_failures do
post_graphql(query, current_user: current_user)
codequality_severities = codequality_degradations.map { |degradation| degradation['severity'] }
expect(codequality_severities).to eq(%w[MAJOR MAJOR MINOR])
end
end
context 'when user is not a member of the project' do
......
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