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
842f5828
Commit
842f5828
authored
Jan 27, 2020
by
Olena Horal-Koretska
Committed by
Mark Florian
Jan 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Indicate Sentry error level in GitLab
parent
4c9209d8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
2 deletions
+56
-2
app/assets/javascripts/error_tracking/components/constants.js
...assets/javascripts/error_tracking/components/constants.js
+15
-0
app/assets/javascripts/error_tracking/components/error_details.vue
...s/javascripts/error_tracking/components/error_details.vue
+12
-2
changelogs/unreleased/39075-error-level-color.yml
changelogs/unreleased/39075-error-level-color.yml
+5
-0
spec/frontend/error_tracking/components/error_details_spec.js
.../frontend/error_tracking/components/error_details_spec.js
+24
-0
No files found.
app/assets/javascripts/error_tracking/components/constants.js
0 → 100644
View file @
842f5828
export
const
severityLevel
=
{
FATAL
:
'
fatal
'
,
ERROR
:
'
error
'
,
WARNING
:
'
warning
'
,
INFO
:
'
info
'
,
DEBUG
:
'
debug
'
,
};
export
const
severityLevelVariant
=
{
[
severityLevel
.
FATAL
]:
'
danger
'
,
[
severityLevel
.
ERROR
]:
'
dark
'
,
[
severityLevel
.
WARNING
]:
'
warning
'
,
[
severityLevel
.
INFO
]:
'
info
'
,
[
severityLevel
.
DEBUG
]:
'
light
'
,
};
app/assets/javascripts/error_tracking/components/error_details.vue
View file @
842f5828
...
...
@@ -11,6 +11,7 @@ import Stacktrace from './stacktrace.vue';
import
TrackEventDirective
from
'
~/vue_shared/directives/track_event
'
;
import
timeagoMixin
from
'
~/vue_shared/mixins/timeago
'
;
import
{
trackClickErrorLinkToSentryOptions
}
from
'
../utils
'
;
import
{
severityLevel
,
severityLevelVariant
}
from
'
./constants
'
;
import
query
from
'
../queries/details.query.graphql
'
;
...
...
@@ -147,6 +148,11 @@ export default {
errorLevel
()
{
return
sprintf
(
__
(
'
level: %{level}
'
),
{
level
:
this
.
error
.
tags
.
level
});
},
errorSeverityVariant
()
{
return
(
severityLevelVariant
[
this
.
error
.
tags
.
level
]
||
severityLevelVariant
[
severityLevel
.
ERROR
]
);
},
},
mounted
()
{
this
.
startPollingDetails
(
this
.
issueDetailsPath
);
...
...
@@ -228,8 +234,12 @@ export default {
<h2
class=
"text-truncate"
>
{{
GQLerror
.
title
}}
</h2>
</tooltip-on-truncate>
<template
v-if=
"error.tags"
>
<gl-badge
v-if=
"error.tags.level"
variant=
"danger"
class=
"rounded-pill mr-2"
>
{{
errorLevel
}}
<gl-badge
v-if=
"error.tags.level"
:variant=
"errorSeverityVariant"
class=
"rounded-pill mr-2"
>
{{
errorLevel
}}
</gl-badge>
<gl-badge
v-if=
"error.tags.logger"
variant=
"light"
class=
"rounded-pill"
>
{{
error
.
tags
.
logger
}}
...
...
changelogs/unreleased/39075-error-level-color.yml
0 → 100644
View file @
842f5828
---
title
:
Indicate Sentry error severity in GitLab
merge_request
:
23346
author
:
type
:
added
spec/frontend/error_tracking/components/error_details_spec.js
View file @
842f5828
...
...
@@ -4,6 +4,7 @@ import { GlLoadingIcon, GlLink, GlBadge, GlFormInput } from '@gitlab/ui';
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
import
Stacktrace
from
'
~/error_tracking/components/stacktrace.vue
'
;
import
ErrorDetails
from
'
~/error_tracking/components/error_details.vue
'
;
import
{
severityLevel
,
severityLevelVariant
}
from
'
~/error_tracking/components/constants
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
...
...
@@ -144,6 +145,29 @@ describe('ErrorDetails', () => {
expect
(
wrapper
.
findAll
(
GlBadge
).
length
).
toBe
(
1
);
});
});
it
.
each
(
Object
.
keys
(
severityLevel
))(
'
should set correct severity level variant for %s badge
'
,
level
=>
{
store
.
state
.
details
.
error
.
tags
=
{
level
:
severityLevel
[
level
]
};
mountComponent
();
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
find
(
GlBadge
).
attributes
(
'
variant
'
)).
toEqual
(
severityLevelVariant
[
severityLevel
[
level
]],
);
});
},
);
it
(
'
should fallback for ERROR severityLevelVariant when severityLevel is unknown
'
,
()
=>
{
store
.
state
.
details
.
error
.
tags
=
{
level
:
'
someNewErrorLevel
'
};
mountComponent
();
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
find
(
GlBadge
).
attributes
(
'
variant
'
)).
toEqual
(
severityLevelVariant
[
severityLevel
.
ERROR
],
);
});
});
});
describe
(
'
Stacktrace
'
,
()
=>
{
...
...
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