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
8c7826e5
Commit
8c7826e5
authored
Feb 03, 2020
by
Olena Horal-Koretska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove REST call and related logic for error details page
Get all data from graphgl endpoint
parent
c6631e6b
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
112 additions
and
205 deletions
+112
-205
app/assets/javascripts/error_tracking/components/error_details.vue
...s/javascripts/error_tracking/components/error_details.vue
+45
-60
app/assets/javascripts/error_tracking/details.js
app/assets/javascripts/error_tracking/details.js
+0
-2
app/assets/javascripts/error_tracking/queries/details.query.graphql
.../javascripts/error_tracking/queries/details.query.graphql
+24
-16
app/assets/javascripts/error_tracking/store/details/actions.js
...ssets/javascripts/error_tracking/store/details/actions.js
+0
-25
app/assets/javascripts/error_tracking/store/details/mutation_types.js
...avascripts/error_tracking/store/details/mutation_types.js
+0
-2
app/assets/javascripts/error_tracking/store/details/mutations.js
...ets/javascripts/error_tracking/store/details/mutations.js
+0
-6
app/assets/javascripts/error_tracking/store/details/state.js
app/assets/javascripts/error_tracking/store/details/state.js
+0
-2
app/helpers/projects/error_tracking_helper.rb
app/helpers/projects/error_tracking_helper.rb
+0
-1
spec/frontend/error_tracking/components/error_details_spec.js
.../frontend/error_tracking/components/error_details_spec.js
+43
-39
spec/frontend/error_tracking/store/details/actions_spec.js
spec/frontend/error_tracking/store/details/actions_spec.js
+0
-47
spec/helpers/projects/error_tracking_helper_spec.rb
spec/helpers/projects/error_tracking_helper_spec.rb
+0
-5
No files found.
app/assets/javascripts/error_tracking/components/error_details.vue
View file @
8c7826e5
...
@@ -54,10 +54,6 @@ export default {
...
@@ -54,10 +54,6 @@ export default {
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
issueDetailsPath
:
{
type
:
String
,
required
:
true
,
},
issueStackTracePath
:
{
issueStackTracePath
:
{
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
...
@@ -72,7 +68,7 @@ export default {
...
@@ -72,7 +68,7 @@ export default {
},
},
},
},
apollo
:
{
apollo
:
{
GQL
error
:
{
error
:
{
query
,
query
,
variables
()
{
variables
()
{
return
{
return
{
...
@@ -81,19 +77,19 @@ export default {
...
@@ -81,19 +77,19 @@ export default {
};
};
},
},
pollInterval
:
2000
,
pollInterval
:
2000
,
update
:
data
=>
data
.
project
.
sentry
D
etailedError
,
update
:
data
=>
data
.
project
.
sentry
Errors
.
d
etailedError
,
error
:
()
=>
createFlash
(
__
(
'
Failed to load error details from Sentry.
'
)),
error
:
()
=>
createFlash
(
__
(
'
Failed to load error details from Sentry.
'
)),
result
(
res
)
{
result
(
res
)
{
if
(
res
.
data
.
project
?.
sentry
D
etailedError
)
{
if
(
res
.
data
.
project
?.
sentry
Errors
?.
d
etailedError
)
{
this
.
$apollo
.
queries
.
GQL
error
.
stopPolling
();
this
.
$apollo
.
queries
.
error
.
stopPolling
();
this
.
setStatus
(
this
.
GQL
error
.
status
);
this
.
setStatus
(
this
.
error
.
status
);
}
}
},
},
},
},
},
},
data
()
{
data
()
{
return
{
return
{
GQL
error
:
null
,
error
:
null
,
issueCreationInProgress
:
false
,
issueCreationInProgress
:
false
,
isAlertVisible
:
false
,
isAlertVisible
:
false
,
closedIssueId
:
null
,
closedIssueId
:
null
,
...
@@ -101,8 +97,6 @@ export default {
...
@@ -101,8 +97,6 @@ export default {
},
},
computed
:
{
computed
:
{
...
mapState
(
'
details
'
,
[
...
mapState
(
'
details
'
,
[
'
error
'
,
'
loading
'
,
'
loadingStacktrace
'
,
'
loadingStacktrace
'
,
'
stacktraceData
'
,
'
stacktraceData
'
,
'
updatingResolveStatus
'
,
'
updatingResolveStatus
'
,
...
@@ -114,28 +108,23 @@ export default {
...
@@ -114,28 +108,23 @@ export default {
return
sprintf
(
return
sprintf
(
__
(
'
Reported %{timeAgo} by %{reportedBy}
'
),
__
(
'
Reported %{timeAgo} by %{reportedBy}
'
),
{
{
reportedBy
:
`<strong>
${
this
.
GQL
error
.
culprit
}
</strong>`
,
reportedBy
:
`<strong>
${
this
.
error
.
culprit
}
</strong>`
,
timeAgo
:
this
.
timeFormatted
(
this
.
stacktraceData
.
date_received
),
timeAgo
:
this
.
timeFormatted
(
this
.
stacktraceData
.
date_received
),
},
},
false
,
false
,
);
);
},
},
firstReleaseLink
()
{
firstReleaseLink
()
{
return
`
${
this
.
error
.
external
_base_url
}
/releases/
${
this
.
GQL
error
.
firstReleaseShortVersion
}
`
;
return
`
${
this
.
error
.
external
BaseUrl
}
/releases/
${
this
.
error
.
firstReleaseShortVersion
}
`
;
},
},
lastReleaseLink
()
{
lastReleaseLink
()
{
return
`
${
this
.
error
.
external_base_url
}
releases/
${
this
.
GQLerror
.
lastReleaseShortVersion
}
`
;
return
`
${
this
.
error
.
externalBaseUrl
}
/releases/
${
this
.
error
.
lastReleaseShortVersion
}
`
;
},
showDetails
()
{
return
Boolean
(
!
this
.
loading
&&
!
this
.
$apollo
.
queries
.
GQLerror
.
loading
&&
this
.
error
&&
this
.
GQLerror
,
);
},
},
showStacktrace
()
{
showStacktrace
()
{
return
Boolean
(
!
this
.
loadingStacktrace
&&
this
.
stacktrace
&&
this
.
stacktrace
.
length
);
return
Boolean
(
this
.
stacktrace
?
.
length
);
},
},
issueTitle
()
{
issueTitle
()
{
return
this
.
GQL
error
.
title
;
return
this
.
error
.
title
;
},
},
issueDescription
()
{
issueDescription
()
{
return
sprintf
(
return
sprintf
(
...
@@ -144,13 +133,13 @@ export default {
...
@@ -144,13 +133,13 @@ export default {
),
),
{
{
description
:
'
# Error Details:
\n
'
,
description
:
'
# Error Details:
\n
'
,
errorUrl
:
`
${
this
.
GQL
error
.
externalUrl
}
\n`
,
errorUrl
:
`
${
this
.
error
.
externalUrl
}
\n`
,
firstSeen
:
`\n
${
this
.
GQL
error
.
firstSeen
}
\n`
,
firstSeen
:
`\n
${
this
.
error
.
firstSeen
}
\n`
,
lastSeen
:
`
${
this
.
GQL
error
.
lastSeen
}
\n`
,
lastSeen
:
`
${
this
.
error
.
lastSeen
}
\n`
,
countLabel
:
n__
(
'
- Event
'
,
'
- Events
'
,
this
.
GQL
error
.
count
),
countLabel
:
n__
(
'
- Event
'
,
'
- Events
'
,
this
.
error
.
count
),
count
:
`
${
this
.
GQL
error
.
count
}
\n`
,
count
:
`
${
this
.
error
.
count
}
\n`
,
userCountLabel
:
n__
(
'
- User
'
,
'
- Users
'
,
this
.
GQL
error
.
userCount
),
userCountLabel
:
n__
(
'
- User
'
,
'
- Users
'
,
this
.
error
.
userCount
),
userCount
:
`
${
this
.
GQL
error
.
userCount
}
\n`
,
userCount
:
`
${
this
.
error
.
userCount
}
\n`
,
},
},
false
,
false
,
);
);
...
@@ -171,12 +160,10 @@ export default {
...
@@ -171,12 +160,10 @@ export default {
},
},
},
},
mounted
()
{
mounted
()
{
this
.
startPollingDetails
(
this
.
issueDetailsPath
);
this
.
startPollingStacktrace
(
this
.
issueStackTracePath
);
this
.
startPollingStacktrace
(
this
.
issueStackTracePath
);
},
},
methods
:
{
methods
:
{
...
mapActions
(
'
details
'
,
[
...
mapActions
(
'
details
'
,
[
'
startPollingDetails
'
,
'
startPollingStacktrace
'
,
'
startPollingStacktrace
'
,
'
updateStatus
'
,
'
updateStatus
'
,
'
setStatus
'
,
'
setStatus
'
,
...
@@ -214,10 +201,10 @@ export default {
...
@@ -214,10 +201,10 @@ export default {
<
template
>
<
template
>
<div>
<div>
<div
v-if=
"$apollo.queries.
GQLerror.loading ||
loading"
class=
"py-3"
>
<div
v-if=
"$apollo.queries.
error.
loading"
class=
"py-3"
>
<gl-loading-icon
:size=
"3"
/>
<gl-loading-icon
:size=
"3"
/>
</div>
</div>
<div
v-else-if=
"
showDetails
"
class=
"error-details"
>
<div
v-else-if=
"
error
"
class=
"error-details"
>
<gl-alert
v-if=
"isAlertVisible"
@
dismiss=
"isAlertVisible = false"
>
<gl-alert
v-if=
"isAlertVisible"
@
dismiss=
"isAlertVisible = false"
>
<gl-sprintf
<gl-sprintf
:message=
"
:message=
"
...
@@ -232,7 +219,7 @@ export default {
...
@@ -232,7 +219,7 @@ export default {
<div
class=
"top-area align-items-center justify-content-between py-3"
>
<div
class=
"top-area align-items-center justify-content-between py-3"
>
<span
v-if=
"!loadingStacktrace && stacktrace"
v-html=
"reported"
></span>
<span
v-if=
"!loadingStacktrace && stacktrace"
v-html=
"reported"
></span>
<div
class=
"d-inline-flex"
>
<div
class=
"d-inline-flex
ml-lg-auto
"
>
<loading-button
<loading-button
:label=
"ignoreBtnLabel"
:label=
"ignoreBtnLabel"
:loading=
"updatingIgnoreStatus"
:loading=
"updatingIgnoreStatus"
...
@@ -247,10 +234,10 @@ export default {
...
@@ -247,10 +234,10 @@ export default {
@
click=
"onResolveStatusUpdate"
@
click=
"onResolveStatusUpdate"
/>
/>
<gl-button
<gl-button
v-if=
"error.gitlab
_issue
"
v-if=
"error.gitlab
IssuePath
"
class=
"ml-2"
class=
"ml-2"
data-qa-selector=
"view_issue_button"
data-qa-selector=
"view_issue_button"
:href=
"error.gitlab
_issue
"
:href=
"error.gitlab
IssuePath
"
variant=
"success"
variant=
"success"
>
>
{{ __('View issue') }}
{{ __('View issue') }}
...
@@ -264,13 +251,13 @@ export default {
...
@@ -264,13 +251,13 @@ export default {
<gl-form-input
class=
"hidden"
name=
"issue[title]"
:value=
"issueTitle"
/>
<gl-form-input
class=
"hidden"
name=
"issue[title]"
:value=
"issueTitle"
/>
<input
name=
"issue[description]"
:value=
"issueDescription"
type=
"hidden"
/>
<input
name=
"issue[description]"
:value=
"issueDescription"
type=
"hidden"
/>
<gl-form-input
<gl-form-input
:value=
"
GQL
error.sentryId"
:value=
"error.sentryId"
class=
"hidden"
class=
"hidden"
name=
"issue[sentry_issue_attributes][sentry_issue_identifier]"
name=
"issue[sentry_issue_attributes][sentry_issue_identifier]"
/>
/>
<gl-form-input
:value=
"csrfToken"
class=
"hidden"
name=
"authenticity_token"
/>
<gl-form-input
:value=
"csrfToken"
class=
"hidden"
name=
"authenticity_token"
/>
<loading-button
<loading-button
v-if=
"!error.gitlab
_issue
"
v-if=
"!error.gitlab
IssuePath
"
class=
"btn-success"
class=
"btn-success"
:label=
"__('Create issue')"
:label=
"__('Create issue')"
:loading=
"issueCreationInProgress"
:loading=
"issueCreationInProgress"
...
@@ -281,8 +268,8 @@ export default {
...
@@ -281,8 +268,8 @@ export default {
</div>
</div>
</div>
</div>
<div>
<div>
<tooltip-on-truncate
:title=
"
GQL
error.title"
truncate-target=
"child"
placement=
"top"
>
<tooltip-on-truncate
:title=
"error.title"
truncate-target=
"child"
placement=
"top"
>
<h2
class=
"text-truncate"
>
{{
GQL
error.title }}
</h2>
<h2
class=
"text-truncate"
>
{{ error.title }}
</h2>
</tooltip-on-truncate>
</tooltip-on-truncate>
<
template
v-if=
"error.tags"
>
<
template
v-if=
"error.tags"
>
<gl-badge
<gl-badge
...
@@ -297,53 +284,51 @@ export default {
...
@@ -297,53 +284,51 @@ export default {
</gl-badge>
</gl-badge>
</
template
>
</
template
>
<ul>
<ul>
<li
v-if=
"
GQL
error.gitlabCommit"
>
<li
v-if=
"error.gitlabCommit"
>
<strong
class=
"bold"
>
{{ __('GitLab commit') }}:
</strong>
<strong
class=
"bold"
>
{{ __('GitLab commit') }}:
</strong>
<gl-link
:href=
"
GQL
error.gitlabCommitPath"
>
<gl-link
:href=
"error.gitlabCommitPath"
>
<span>
{{
GQL
error.gitlabCommit.substr(0, 10) }}
</span>
<span>
{{ error.gitlabCommit.substr(0, 10) }}
</span>
</gl-link>
</gl-link>
</li>
</li>
<li
v-if=
"error.gitlab
_issue
"
>
<li
v-if=
"error.gitlab
IssuePath
"
>
<strong
class=
"bold"
>
{{ __('GitLab Issue') }}:
</strong>
<strong
class=
"bold"
>
{{ __('GitLab Issue') }}:
</strong>
<gl-link
:href=
"error.gitlab
_issue
"
>
<gl-link
:href=
"error.gitlab
IssuePath
"
>
<span>
{{ error.gitlab
_issue
}}
</span>
<span>
{{ error.gitlab
IssuePath
}}
</span>
</gl-link>
</gl-link>
</li>
</li>
<li>
<li>
<strong
class=
"bold"
>
{{ __('Sentry event') }}:
</strong>
<strong
class=
"bold"
>
{{ __('Sentry event') }}:
</strong>
<gl-link
<gl-link
v-track-event=
"trackClickErrorLinkToSentryOptions(
GQL
error.externalUrl)"
v-track-event=
"trackClickErrorLinkToSentryOptions(error.externalUrl)"
class=
"d-inline-flex align-items-center"
class=
"d-inline-flex align-items-center"
:href=
"
GQL
error.externalUrl"
:href=
"error.externalUrl"
target=
"_blank"
target=
"_blank"
>
>
<span
class=
"text-truncate"
>
{{
GQL
error.externalUrl }}
</span>
<span
class=
"text-truncate"
>
{{ error.externalUrl }}
</span>
<icon
name=
"external-link"
class=
"ml-1 flex-shrink-0"
/>
<icon
name=
"external-link"
class=
"ml-1 flex-shrink-0"
/>
</gl-link>
</gl-link>
</li>
</li>
<li
v-if=
"
GQL
error.firstReleaseShortVersion"
>
<li
v-if=
"error.firstReleaseShortVersion"
>
<strong
class=
"bold"
>
{{ __('First seen') }}:
</strong>
<strong
class=
"bold"
>
{{ __('First seen') }}:
</strong>
{{ formatDate(
GQL
error.firstSeen) }}
{{ formatDate(error.firstSeen) }}
<gl-link
:href=
"firstReleaseLink"
target=
"_blank"
>
<gl-link
:href=
"firstReleaseLink"
target=
"_blank"
>
<span>
<span>
{{ __('Release') }}: {{ error.firstReleaseShortVersion.substr(0, 10) }}
</span>
{{ __('Release') }}: {{ GQLerror.firstReleaseShortVersion.substr(0, 10) }}
</span>
</gl-link>
</gl-link>
</li>
</li>
<li
v-if=
"
GQL
error.lastReleaseShortVersion"
>
<li
v-if=
"error.lastReleaseShortVersion"
>
<strong
class=
"bold"
>
{{ __('Last seen') }}:
</strong>
<strong
class=
"bold"
>
{{ __('Last seen') }}:
</strong>
{{ formatDate(
GQL
error.lastSeen) }}
{{ formatDate(error.lastSeen) }}
<gl-link
:href=
"lastReleaseLink"
target=
"_blank"
>
<gl-link
:href=
"lastReleaseLink"
target=
"_blank"
>
<span>
{{ __('Release') }}: {{
GQL
error.lastReleaseShortVersion.substr(0, 10) }}
</span>
<span>
{{ __('Release') }}: {{ error.lastReleaseShortVersion.substr(0, 10) }}
</span>
</gl-link>
</gl-link>
</li>
</li>
<li>
<li>
<strong
class=
"bold"
>
{{ __('Events') }}:
</strong>
<strong
class=
"bold"
>
{{ __('Events') }}:
</strong>
<span>
{{
GQL
error.count }}
</span>
<span>
{{ error.count }}
</span>
</li>
</li>
<li>
<li>
<strong
class=
"bold"
>
{{ __('Users') }}:
</strong>
<strong
class=
"bold"
>
{{ __('Users') }}:
</strong>
<span>
{{
GQL
error.userCount }}
</span>
<span>
{{ error.userCount }}
</span>
</li>
</li>
</ul>
</ul>
...
@@ -351,7 +336,7 @@ export default {
...
@@ -351,7 +336,7 @@ export default {
<gl-loading-icon
:size=
"3"
/>
<gl-loading-icon
:size=
"3"
/>
</div>
</div>
<
template
v-if=
"showStacktrace"
>
<
template
v-
else-
if=
"showStacktrace"
>
<h3
class=
"my-4"
>
{{
__
(
'
Stack trace
'
)
}}
</h3>
<h3
class=
"my-4"
>
{{
__
(
'
Stack trace
'
)
}}
</h3>
<stacktrace
:entries=
"stacktrace"
/>
<stacktrace
:entries=
"stacktrace"
/>
</
template
>
</
template
>
...
...
app/assets/javascripts/error_tracking/details.js
View file @
8c7826e5
...
@@ -26,7 +26,6 @@ export default () => {
...
@@ -26,7 +26,6 @@ export default () => {
issueId
,
issueId
,
projectPath
,
projectPath
,
issueUpdatePath
,
issueUpdatePath
,
issueDetailsPath
,
issueStackTracePath
,
issueStackTracePath
,
projectIssuesPath
,
projectIssuesPath
,
}
=
domEl
.
dataset
;
}
=
domEl
.
dataset
;
...
@@ -36,7 +35,6 @@ export default () => {
...
@@ -36,7 +35,6 @@ export default () => {
issueId
,
issueId
,
projectPath
,
projectPath
,
issueUpdatePath
,
issueUpdatePath
,
issueDetailsPath
,
issueStackTracePath
,
issueStackTracePath
,
projectIssuesPath
,
projectIssuesPath
,
csrfToken
:
csrf
.
token
,
csrfToken
:
csrf
.
token
,
...
...
app/assets/javascripts/error_tracking/queries/details.query.graphql
View file @
8c7826e5
query
errorDetails
(
$fullPath
:
ID
!,
$errorId
:
ID
!)
{
query
errorDetails
(
$fullPath
:
ID
!,
$errorId
:
ID
!)
{
project
(
fullPath
:
$fullPath
)
{
project
(
fullPath
:
$fullPath
)
{
sentryDetailedError
(
id
:
$errorId
)
{
sentryErrors
{
id
detailedError
(
id
:
$errorId
)
{
sentryId
id
title
sentryId
userCount
title
count
userCount
status
count
firstSeen
status
lastSeen
firstSeen
message
lastSeen
culprit
message
externalUrl
culprit
firstReleaseShortVersion
tags
{
lastReleaseShortVersion
level
gitlabCommit
logger
gitlabCommitPath
}
externalUrl
externalBaseUrl
firstReleaseShortVersion
lastReleaseShortVersion
gitlabCommit
gitlabCommitPath
gitlabIssuePath
}
}
}
}
}
}
}
app/assets/javascripts/error_tracking/store/details/actions.js
View file @
8c7826e5
...
@@ -5,36 +5,11 @@ import Poll from '~/lib/utils/poll';
...
@@ -5,36 +5,11 @@ import Poll from '~/lib/utils/poll';
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
let
stackTracePoll
;
let
stackTracePoll
;
let
detailPoll
;
const
stopPolling
=
poll
=>
{
const
stopPolling
=
poll
=>
{
if
(
poll
)
poll
.
stop
();
if
(
poll
)
poll
.
stop
();
};
};
export
function
startPollingDetails
({
commit
},
endpoint
)
{
detailPoll
=
new
Poll
({
resource
:
service
,
method
:
'
getSentryData
'
,
data
:
{
endpoint
},
successCallback
:
({
data
})
=>
{
if
(
!
data
)
{
return
;
}
commit
(
types
.
SET_ERROR
,
data
.
error
);
commit
(
types
.
SET_LOADING
,
false
);
stopPolling
(
detailPoll
);
},
errorCallback
:
()
=>
{
commit
(
types
.
SET_LOADING
,
false
);
createFlash
(
__
(
'
Failed to load error details from Sentry.
'
));
},
});
detailPoll
.
makeRequest
();
}
export
function
startPollingStacktrace
({
commit
},
endpoint
)
{
export
function
startPollingStacktrace
({
commit
},
endpoint
)
{
stackTracePoll
=
new
Poll
({
stackTracePoll
=
new
Poll
({
resource
:
service
,
resource
:
service
,
...
...
app/assets/javascripts/error_tracking/store/details/mutation_types.js
View file @
8c7826e5
export
const
SET_ERROR
=
'
SET_ERRORS
'
;
export
const
SET_LOADING
=
'
SET_LOADING
'
;
export
const
SET_LOADING_STACKTRACE
=
'
SET_LOADING_STACKTRACE
'
;
export
const
SET_LOADING_STACKTRACE
=
'
SET_LOADING_STACKTRACE
'
;
export
const
SET_STACKTRACE_DATA
=
'
SET_STACKTRACE_DATA
'
;
export
const
SET_STACKTRACE_DATA
=
'
SET_STACKTRACE_DATA
'
;
app/assets/javascripts/error_tracking/store/details/mutations.js
View file @
8c7826e5
import
*
as
types
from
'
./mutation_types
'
;
import
*
as
types
from
'
./mutation_types
'
;
export
default
{
export
default
{
[
types
.
SET_ERROR
](
state
,
data
)
{
state
.
error
=
data
;
},
[
types
.
SET_LOADING
](
state
,
loading
)
{
state
.
loading
=
loading
;
},
[
types
.
SET_LOADING_STACKTRACE
](
state
,
data
)
{
[
types
.
SET_LOADING_STACKTRACE
](
state
,
data
)
{
state
.
loadingStacktrace
=
data
;
state
.
loadingStacktrace
=
data
;
},
},
...
...
app/assets/javascripts/error_tracking/store/details/state.js
View file @
8c7826e5
export
default
()
=>
({
export
default
()
=>
({
error
:
{},
stacktraceData
:
{},
stacktraceData
:
{},
loading
:
true
,
loadingStacktrace
:
true
,
loadingStacktrace
:
true
,
updatingResolveStatus
:
false
,
updatingResolveStatus
:
false
,
updatingIgnoreStatus
:
false
,
updatingIgnoreStatus
:
false
,
...
...
app/helpers/projects/error_tracking_helper.rb
View file @
8c7826e5
...
@@ -22,7 +22,6 @@ module Projects::ErrorTrackingHelper
...
@@ -22,7 +22,6 @@ module Projects::ErrorTrackingHelper
{
{
'issue-id'
=>
issue_id
,
'issue-id'
=>
issue_id
,
'project-path'
=>
project
.
full_path
,
'project-path'
=>
project
.
full_path
,
'issue-details-path'
=>
details_project_error_tracking_index_path
(
*
opts
),
'issue-update-path'
=>
update_project_error_tracking_index_path
(
*
opts
),
'issue-update-path'
=>
update_project_error_tracking_index_path
(
*
opts
),
'project-issues-path'
=>
project_issues_path
(
project
),
'project-issues-path'
=>
project_issues_path
(
project
),
'issue-stack-trace-path'
=>
stack_trace_project_error_tracking_index_path
(
*
opts
)
'issue-stack-trace-path'
=>
stack_trace_project_error_tracking_index_path
(
*
opts
)
...
...
spec/frontend/error_tracking/components/error_details_spec.js
View file @
8c7826e5
...
@@ -37,14 +37,13 @@ describe('ErrorDetails', () => {
...
@@ -37,14 +37,13 @@ describe('ErrorDetails', () => {
projectPath
:
'
/root/gitlab-test
'
,
projectPath
:
'
/root/gitlab-test
'
,
listPath
:
'
/error_tracking
'
,
listPath
:
'
/error_tracking
'
,
issueUpdatePath
:
'
/123
'
,
issueUpdatePath
:
'
/123
'
,
issueDetailsPath
:
'
/123/details
'
,
issueStackTracePath
:
'
/stacktrace
'
,
issueStackTracePath
:
'
/stacktrace
'
,
projectIssuesPath
:
'
/test-project/issues/
'
,
projectIssuesPath
:
'
/test-project/issues/
'
,
csrfToken
:
'
fakeToken
'
,
csrfToken
:
'
fakeToken
'
,
},
},
});
});
wrapper
.
setData
({
wrapper
.
setData
({
GQL
error
:
{
error
:
{
id
:
'
gid://gitlab/Gitlab::ErrorTracking::DetailedError/129381
'
,
id
:
'
gid://gitlab/Gitlab::ErrorTracking::DetailedError/129381
'
,
sentryId
:
129381
,
sentryId
:
129381
,
title
:
'
Issue title
'
,
title
:
'
Issue title
'
,
...
@@ -59,7 +58,6 @@ describe('ErrorDetails', () => {
...
@@ -59,7 +58,6 @@ describe('ErrorDetails', () => {
beforeEach
(()
=>
{
beforeEach
(()
=>
{
actions
=
{
actions
=
{
startPollingDetails
:
()
=>
{},
startPollingStacktrace
:
()
=>
{},
startPollingStacktrace
:
()
=>
{},
updateIgnoreStatus
:
jest
.
fn
(),
updateIgnoreStatus
:
jest
.
fn
(),
updateResolveStatus
:
jest
.
fn
().
mockResolvedValue
({
closed_issue_iid
:
1
}),
updateResolveStatus
:
jest
.
fn
().
mockResolvedValue
({
closed_issue_iid
:
1
}),
...
@@ -71,8 +69,6 @@ describe('ErrorDetails', () => {
...
@@ -71,8 +69,6 @@ describe('ErrorDetails', () => {
};
};
const
state
=
{
const
state
=
{
error
:
{},
loading
:
true
,
stacktraceData
:
{},
stacktraceData
:
{},
loadingStacktrace
:
true
,
loadingStacktrace
:
true
,
};
};
...
@@ -93,7 +89,7 @@ describe('ErrorDetails', () => {
...
@@ -93,7 +89,7 @@ describe('ErrorDetails', () => {
$apollo
:
{
$apollo
:
{
query
,
query
,
queries
:
{
queries
:
{
GQL
error
:
{
error
:
{
loading
:
true
,
loading
:
true
,
stopPolling
:
jest
.
fn
(),
stopPolling
:
jest
.
fn
(),
},
},
...
@@ -122,9 +118,7 @@ describe('ErrorDetails', () => {
...
@@ -122,9 +118,7 @@ describe('ErrorDetails', () => {
describe
(
'
Error details
'
,
()
=>
{
describe
(
'
Error details
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
store
.
state
.
details
.
loading
=
false
;
mocks
.
$apollo
.
queries
.
error
.
loading
=
false
;
store
.
state
.
details
.
error
.
id
=
1
;
mocks
.
$apollo
.
queries
.
GQLerror
.
loading
=
false
;
mountComponent
();
mountComponent
();
});
});
...
@@ -138,16 +132,22 @@ describe('ErrorDetails', () => {
...
@@ -138,16 +132,22 @@ describe('ErrorDetails', () => {
describe
(
'
Badges
'
,
()
=>
{
describe
(
'
Badges
'
,
()
=>
{
it
(
'
should show language and error level badges
'
,
()
=>
{
it
(
'
should show language and error level badges
'
,
()
=>
{
store
.
state
.
details
.
error
.
tags
=
{
level
:
'
error
'
,
logger
:
'
ruby
'
};
wrapper
.
setData
({
mountComponent
();
error
:
{
tags
:
{
level
:
'
error
'
,
logger
:
'
ruby
'
},
},
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
findAll
(
GlBadge
).
length
).
toBe
(
2
);
expect
(
wrapper
.
findAll
(
GlBadge
).
length
).
toBe
(
2
);
});
});
});
});
it
(
'
should NOT show the badge if the tag is not present
'
,
()
=>
{
it
(
'
should NOT show the badge if the tag is not present
'
,
()
=>
{
store
.
state
.
details
.
error
.
tags
=
{
level
:
'
error
'
};
wrapper
.
setData
({
mountComponent
();
error
:
{
tags
:
{
level
:
'
error
'
},
},
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
findAll
(
GlBadge
).
length
).
toBe
(
1
);
expect
(
wrapper
.
findAll
(
GlBadge
).
length
).
toBe
(
1
);
});
});
...
@@ -156,8 +156,11 @@ describe('ErrorDetails', () => {
...
@@ -156,8 +156,11 @@ describe('ErrorDetails', () => {
it
.
each
(
Object
.
keys
(
severityLevel
))(
it
.
each
(
Object
.
keys
(
severityLevel
))(
'
should set correct severity level variant for %s badge
'
,
'
should set correct severity level variant for %s badge
'
,
level
=>
{
level
=>
{
store
.
state
.
details
.
error
.
tags
=
{
level
:
severityLevel
[
level
]
};
wrapper
.
setData
({
mountComponent
();
error
:
{
tags
:
{
level
:
severityLevel
[
level
]
},
},
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
find
(
GlBadge
).
attributes
(
'
variant
'
)).
toEqual
(
expect
(
wrapper
.
find
(
GlBadge
).
attributes
(
'
variant
'
)).
toEqual
(
severityLevelVariant
[
severityLevel
[
level
]],
severityLevelVariant
[
severityLevel
[
level
]],
...
@@ -167,8 +170,11 @@ describe('ErrorDetails', () => {
...
@@ -167,8 +170,11 @@ describe('ErrorDetails', () => {
);
);
it
(
'
should fallback for ERROR severityLevelVariant when severityLevel is unknown
'
,
()
=>
{
it
(
'
should fallback for ERROR severityLevelVariant when severityLevel is unknown
'
,
()
=>
{
store
.
state
.
details
.
error
.
tags
=
{
level
:
'
someNewErrorLevel
'
};
wrapper
.
setData
({
mountComponent
();
error
:
{
tags
:
{
level
:
'
someNewErrorLevel
'
},
},
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
find
(
GlBadge
).
attributes
(
'
variant
'
)).
toEqual
(
expect
(
wrapper
.
find
(
GlBadge
).
attributes
(
'
variant
'
)).
toEqual
(
severityLevelVariant
[
severityLevel
.
ERROR
],
severityLevelVariant
[
severityLevel
.
ERROR
],
...
@@ -180,7 +186,6 @@ describe('ErrorDetails', () => {
...
@@ -180,7 +186,6 @@ describe('ErrorDetails', () => {
describe
(
'
Stacktrace
'
,
()
=>
{
describe
(
'
Stacktrace
'
,
()
=>
{
it
(
'
should show stacktrace
'
,
()
=>
{
it
(
'
should show stacktrace
'
,
()
=>
{
store
.
state
.
details
.
loadingStacktrace
=
false
;
store
.
state
.
details
.
loadingStacktrace
=
false
;
mountComponent
();
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
find
(
GlLoadingIcon
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
GlLoadingIcon
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
Stacktrace
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
Stacktrace
).
exists
()).
toBe
(
true
);
...
@@ -190,9 +195,10 @@ describe('ErrorDetails', () => {
...
@@ -190,9 +195,10 @@ describe('ErrorDetails', () => {
it
(
'
should NOT show stacktrace if no entries
'
,
()
=>
{
it
(
'
should NOT show stacktrace if no entries
'
,
()
=>
{
store
.
state
.
details
.
loadingStacktrace
=
false
;
store
.
state
.
details
.
loadingStacktrace
=
false
;
store
.
getters
=
{
'
details/sentryUrl
'
:
()
=>
'
sentry.io
'
,
'
details/stacktrace
'
:
()
=>
[]
};
store
.
getters
=
{
'
details/sentryUrl
'
:
()
=>
'
sentry.io
'
,
'
details/stacktrace
'
:
()
=>
[]
};
mountComponent
();
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
find
(
GlLoadingIcon
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
GlLoadingIcon
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
Stacktrace
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
Stacktrace
).
exists
()).
toBe
(
false
);
});
});
});
});
});
...
@@ -331,19 +337,18 @@ describe('ErrorDetails', () => {
...
@@ -331,19 +337,18 @@ describe('ErrorDetails', () => {
});
});
describe
(
'
GitLab issue link
'
,
()
=>
{
describe
(
'
GitLab issue link
'
,
()
=>
{
const
gitlabIssue
=
'
https://gitlab.example.com/issues/1
'
;
const
gitlabIssue
Path
=
'
https://gitlab.example.com/issues/1
'
;
const
findGitLabLink
=
()
=>
wrapper
.
find
(
`[href="
${
gitlabIssue
}
"]`
);
const
findGitLabLink
=
()
=>
wrapper
.
find
(
`[href="
${
gitlabIssue
Path
}
"]`
);
const
findCreateIssueButton
=
()
=>
wrapper
.
find
(
'
[data-qa-selector="create_issue_button"]
'
);
const
findCreateIssueButton
=
()
=>
wrapper
.
find
(
'
[data-qa-selector="create_issue_button"]
'
);
const
findViewIssueButton
=
()
=>
wrapper
.
find
(
'
[data-qa-selector="view_issue_button"]
'
);
const
findViewIssueButton
=
()
=>
wrapper
.
find
(
'
[data-qa-selector="view_issue_button"]
'
);
describe
(
'
is present
'
,
()
=>
{
describe
(
'
is present
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
store
.
state
.
details
.
loading
=
false
;
wrapper
.
setData
({
store
.
state
.
details
.
error
=
{
error
:
{
id
:
1
,
gitlabIssuePath
,
gitlab_issue
:
gitlabIssue
,
},
};
});
mountComponent
();
});
});
it
(
'
should display the View issue button
'
,
()
=>
{
it
(
'
should display the View issue button
'
,
()
=>
{
...
@@ -361,12 +366,11 @@ describe('ErrorDetails', () => {
...
@@ -361,12 +366,11 @@ describe('ErrorDetails', () => {
describe
(
'
is not present
'
,
()
=>
{
describe
(
'
is not present
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
store
.
state
.
details
.
loading
=
false
;
wrapper
.
setData
({
store
.
state
.
details
.
error
=
{
error
:
{
id
:
1
,
gitlabIssuePath
:
null
,
gitlab_issue
:
null
,
},
};
});
mountComponent
();
});
});
it
(
'
should not display the View issue button
'
,
()
=>
{
it
(
'
should not display the View issue button
'
,
()
=>
{
...
@@ -390,9 +394,9 @@ describe('ErrorDetails', () => {
...
@@ -390,9 +394,9 @@ describe('ErrorDetails', () => {
const
findGitLabCommitLink
=
()
=>
wrapper
.
find
(
`[href$="
${
gitlabCommitPath
}
"]`
);
const
findGitLabCommitLink
=
()
=>
wrapper
.
find
(
`[href$="
${
gitlabCommitPath
}
"]`
);
it
(
'
should display a link
'
,
()
=>
{
it
(
'
should display a link
'
,
()
=>
{
mocks
.
$apollo
.
queries
.
GQL
error
.
loading
=
false
;
mocks
.
$apollo
.
queries
.
error
.
loading
=
false
;
wrapper
.
setData
({
wrapper
.
setData
({
GQL
error
:
{
error
:
{
gitlabCommit
,
gitlabCommit
,
gitlabCommitPath
,
gitlabCommitPath
,
},
},
...
@@ -403,9 +407,9 @@ describe('ErrorDetails', () => {
...
@@ -403,9 +407,9 @@ describe('ErrorDetails', () => {
});
});
it
(
'
should not display a link
'
,
()
=>
{
it
(
'
should not display a link
'
,
()
=>
{
mocks
.
$apollo
.
queries
.
GQL
error
.
loading
=
false
;
mocks
.
$apollo
.
queries
.
error
.
loading
=
false
;
wrapper
.
setData
({
wrapper
.
setData
({
GQL
error
:
{
error
:
{
gitlabCommit
:
null
,
gitlabCommit
:
null
,
},
},
});
});
...
...
spec/frontend/error_tracking/store/details/actions_spec.js
View file @
8c7826e5
...
@@ -26,53 +26,6 @@ describe('Sentry error details store actions', () => {
...
@@ -26,53 +26,6 @@ describe('Sentry error details store actions', () => {
}
}
});
});
describe
(
'
startPollingDetails
'
,
()
=>
{
const
endpoint
=
'
123/details
'
;
it
(
'
should commit SET_ERROR with received response
'
,
done
=>
{
const
payload
=
{
error
:
{
id
:
1
}
};
mockedAdapter
.
onGet
().
reply
(
200
,
payload
);
testAction
(
actions
.
startPollingDetails
,
{
endpoint
},
{},
[
{
type
:
types
.
SET_ERROR
,
payload
:
payload
.
error
},
{
type
:
types
.
SET_LOADING
,
payload
:
false
},
],
[],
()
=>
{
done
();
},
);
});
it
(
'
should show flash on API error
'
,
done
=>
{
mockedAdapter
.
onGet
().
reply
(
400
);
testAction
(
actions
.
startPollingDetails
,
{
endpoint
},
{},
[{
type
:
types
.
SET_LOADING
,
payload
:
false
}],
[],
()
=>
{
expect
(
createFlash
).
toHaveBeenCalledTimes
(
1
);
done
();
},
);
});
it
(
'
should not restart polling when receiving an empty 204 response
'
,
done
=>
{
mockedRestart
=
jest
.
spyOn
(
Poll
.
prototype
,
'
restart
'
);
mockedAdapter
.
onGet
().
reply
(
204
);
testAction
(
actions
.
startPollingDetails
,
{
endpoint
},
{},
[],
[],
()
=>
{
expect
(
mockedRestart
).
toHaveBeenCalledTimes
(
0
);
done
();
});
});
});
describe
(
'
startPollingStacktrace
'
,
()
=>
{
describe
(
'
startPollingStacktrace
'
,
()
=>
{
const
endpoint
=
'
123/stacktrace
'
;
const
endpoint
=
'
123/stacktrace
'
;
it
(
'
should commit SET_ERROR with received response
'
,
done
=>
{
it
(
'
should commit SET_ERROR with received response
'
,
done
=>
{
...
...
spec/helpers/projects/error_tracking_helper_spec.rb
View file @
8c7826e5
...
@@ -83,7 +83,6 @@ describe Projects::ErrorTrackingHelper do
...
@@ -83,7 +83,6 @@ describe Projects::ErrorTrackingHelper do
describe
'#error_details_data'
do
describe
'#error_details_data'
do
let
(
:issue_id
)
{
1234
}
let
(
:issue_id
)
{
1234
}
let
(
:route_params
)
{
[
project
.
owner
,
project
,
issue_id
,
{
format: :json
}]
}
let
(
:route_params
)
{
[
project
.
owner
,
project
,
issue_id
,
{
format: :json
}]
}
let
(
:details_path
)
{
details_namespace_project_error_tracking_index_path
(
*
route_params
)
}
let
(
:project_path
)
{
project
.
full_path
}
let
(
:project_path
)
{
project
.
full_path
}
let
(
:stack_trace_path
)
{
stack_trace_namespace_project_error_tracking_index_path
(
*
route_params
)
}
let
(
:stack_trace_path
)
{
stack_trace_namespace_project_error_tracking_index_path
(
*
route_params
)
}
let
(
:issues_path
)
{
project_issues_path
(
project
)
}
let
(
:issues_path
)
{
project_issues_path
(
project
)
}
...
@@ -98,10 +97,6 @@ describe Projects::ErrorTrackingHelper do
...
@@ -98,10 +97,6 @@ describe Projects::ErrorTrackingHelper do
expect
(
result
[
'project-path'
]).
to
eq
project_path
expect
(
result
[
'project-path'
]).
to
eq
project_path
end
end
it
'returns the correct details path'
do
expect
(
result
[
'issue-details-path'
]).
to
eq
details_path
end
it
'returns the correct stack trace path'
do
it
'returns the correct stack trace path'
do
expect
(
result
[
'issue-stack-trace-path'
]).
to
eq
stack_trace_path
expect
(
result
[
'issue-stack-trace-path'
]).
to
eq
stack_trace_path
end
end
...
...
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