Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
28221c76
Commit
28221c76
authored
Mar 23, 2021
by
Miranda Fluharty
Committed by
Miguel Rincon
Mar 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sort issues in full codequality report by severity
unknown, blocker, critical, major, minor, info
parent
f205ce09
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
1 deletion
+38
-1
ee/app/assets/javascripts/codequality_report/store/constants.js
.../assets/javascripts/codequality_report/store/constants.js
+9
-0
ee/app/assets/javascripts/codequality_report/store/mutations.js
.../assets/javascripts/codequality_report/store/mutations.js
+6
-1
ee/changelogs/unreleased/320959-sort-full-codequality-report.yml
...gelogs/unreleased/320959-sort-full-codequality-report.yml
+5
-0
ee/spec/frontend/codequality_report/store/mutations_spec.js
ee/spec/frontend/codequality_report/store/mutations_spec.js
+18
-0
No files found.
ee/app/assets/javascripts/codequality_report/store/constants.js
View file @
28221c76
export
const
VIEW_EVENT_FEATURE_FLAG
=
'
usageDataITestingFullCodeQualityReportTotal
'
;
export
const
VIEW_EVENT_FEATURE_FLAG
=
'
usageDataITestingFullCodeQualityReportTotal
'
;
export
const
VIEW_EVENT_NAME
=
'
i_testing_full_code_quality_report_total
'
;
export
const
VIEW_EVENT_NAME
=
'
i_testing_full_code_quality_report_total
'
;
export
const
SEVERITY_SORT_ORDER
=
{
unknown
:
0
,
blocker
:
1
,
critical
:
2
,
major
:
3
,
minor
:
4
,
info
:
5
,
};
ee/app/assets/javascripts/codequality_report/store/mutations.js
View file @
28221c76
import
{
SEVERITY_SORT_ORDER
}
from
'
./constants
'
;
import
*
as
types
from
'
./mutation_types
'
;
import
*
as
types
from
'
./mutation_types
'
;
export
default
{
export
default
{
...
@@ -14,7 +15,11 @@ export default {
...
@@ -14,7 +15,11 @@ export default {
[
types
.
RECEIVE_REPORT_SUCCESS
](
state
,
allCodequalityIssues
)
{
[
types
.
RECEIVE_REPORT_SUCCESS
](
state
,
allCodequalityIssues
)
{
Object
.
assign
(
state
,
{
Object
.
assign
(
state
,
{
isLoadingCodequality
:
false
,
isLoadingCodequality
:
false
,
allCodequalityIssues
:
Object
.
freeze
(
allCodequalityIssues
),
allCodequalityIssues
:
Object
.
freeze
(
allCodequalityIssues
.
sort
(
(
a
,
b
)
=>
SEVERITY_SORT_ORDER
[
a
.
severity
]
-
SEVERITY_SORT_ORDER
[
b
.
severity
],
),
),
pageInfo
:
Object
.
assign
(
state
.
pageInfo
,
{
pageInfo
:
Object
.
assign
(
state
.
pageInfo
,
{
total
:
allCodequalityIssues
.
length
,
total
:
allCodequalityIssues
.
length
,
}),
}),
...
...
ee/changelogs/unreleased/320959-sort-full-codequality-report.yml
0 → 100644
View file @
28221c76
---
title
:
Sort issues in full codequality report by severity
merge_request
:
56892
author
:
type
:
changed
ee/spec/frontend/codequality_report/store/mutations_spec.js
View file @
28221c76
...
@@ -35,6 +35,24 @@ describe('Codequality report mutations', () => {
...
@@ -35,6 +35,24 @@ describe('Codequality report mutations', () => {
expect
(
state
.
allCodequalityIssues
).
toBe
(
parsedIssues
);
expect
(
state
.
allCodequalityIssues
).
toBe
(
parsedIssues
);
expect
(
state
.
pageInfo
.
total
).
toBe
(
parsedIssues
.
length
);
expect
(
state
.
pageInfo
.
total
).
toBe
(
parsedIssues
.
length
);
});
});
it
(
'
should sort issues by severity
'
,
()
=>
{
mutations
[
types
.
RECEIVE_REPORT_SUCCESS
](
state
,
[
{
severity
:
'
critical
'
},
{
severity
:
'
blocker
'
},
{
severity
:
'
info
'
},
{
severity
:
'
minor
'
},
{
severity
:
'
unknown
'
},
{
severity
:
'
major
'
},
]);
expect
(
state
.
allCodequalityIssues
[
0
].
severity
).
toBe
(
'
unknown
'
);
expect
(
state
.
allCodequalityIssues
[
1
].
severity
).
toBe
(
'
blocker
'
);
expect
(
state
.
allCodequalityIssues
[
2
].
severity
).
toBe
(
'
critical
'
);
expect
(
state
.
allCodequalityIssues
[
3
].
severity
).
toBe
(
'
major
'
);
expect
(
state
.
allCodequalityIssues
[
4
].
severity
).
toBe
(
'
minor
'
);
expect
(
state
.
allCodequalityIssues
[
5
].
severity
).
toBe
(
'
info
'
);
});
});
});
describe
(
'
receive report error
'
,
()
=>
{
describe
(
'
receive report error
'
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment