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
db2ccdfe
Commit
db2ccdfe
authored
Dec 10, 2019
by
Tristan Read
Committed by
Natalia Tepluhina
Dec 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Surface GitLab issue in error detail page
parent
513557fe
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
74 additions
and
0 deletions
+74
-0
app/assets/javascripts/error_tracking/components/error_details.vue
...s/javascripts/error_tracking/components/error_details.vue
+8
-0
app/serializers/error_tracking/detailed_error_entity.rb
app/serializers/error_tracking/detailed_error_entity.rb
+1
-0
changelogs/unreleased/tr-link-error-to-issue-frontend.yml
changelogs/unreleased/tr-link-error-to-issue-frontend.yml
+5
-0
lib/gitlab/error_tracking/detailed_error.rb
lib/gitlab/error_tracking/detailed_error.rb
+1
-0
lib/sentry/client.rb
lib/sentry/client.rb
+10
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/factories/error_tracking/detailed_error.rb
spec/factories/error_tracking/detailed_error.rb
+1
-0
spec/fixtures/api/schemas/error_tracking/error_detailed.json
spec/fixtures/api/schemas/error_tracking/error_detailed.json
+2
-0
spec/frontend/error_tracking/components/error_details_spec.js
.../frontend/error_tracking/components/error_details_spec.js
+43
-0
No files found.
app/assets/javascripts/error_tracking/components/error_details.vue
View file @
db2ccdfe
...
...
@@ -127,9 +127,11 @@ export default {
<input
name=
"issue[description]"
:value=
"issueDescription"
type=
"hidden"
/>
<gl-form-input
:value=
"csrfToken"
class=
"hidden"
name=
"authenticity_token"
/>
<loading-button
v-if=
"!error.gitlab_issue"
class=
"btn-success"
:label=
"__('Create issue')"
:loading=
"issueCreationInProgress"
data-qa-selector=
"create_issue_button"
@
click=
"createIssue"
/>
</form>
...
...
@@ -140,6 +142,12 @@ export default {
</tooltip-on-truncate>
<h3>
{{
__
(
'
Error details
'
)
}}
</h3>
<ul>
<li
v-if=
"error.gitlab_issue"
>
<span
class=
"bold"
>
{{
__
(
'
GitLab Issue
'
)
}}
:
</span>
<gl-link
:href=
"error.gitlab_issue"
>
<span>
{{
error
.
gitlab_issue
}}
</span>
</gl-link>
</li>
<li>
<span
class=
"bold"
>
{{
__
(
'
Sentry event
'
)
}}
:
</span>
<gl-link
...
...
app/serializers/error_tracking/detailed_error_entity.rb
View file @
db2ccdfe
...
...
@@ -10,6 +10,7 @@ module ErrorTracking
:first_release_short_version
,
:first_seen
,
:frequency
,
:gitlab_issue
,
:id
,
:last_release_last_commit
,
:last_release_short_version
,
...
...
changelogs/unreleased/tr-link-error-to-issue-frontend.yml
0 → 100644
View file @
db2ccdfe
---
title
:
Surface GitLab issue in error detail page
merge_request
:
21019
author
:
type
:
added
lib/gitlab/error_tracking/detailed_error.rb
View file @
db2ccdfe
...
...
@@ -15,6 +15,7 @@ module Gitlab
:first_seen
,
:frequency
,
:gitlab_project
,
:gitlab_issue
,
:id
,
:last_release_last_commit
,
:last_release_short_version
,
...
...
lib/sentry/client.rb
View file @
db2ccdfe
...
...
@@ -233,6 +233,15 @@ module Sentry
stack_trace_entry
.
dig
(
'stacktrace'
,
'frames'
)
end
def
parse_gitlab_issue
(
plugin_issues
)
return
unless
plugin_issues
gitlab_plugin
=
plugin_issues
.
detect
{
|
item
|
item
[
'id'
]
==
'gitlab'
}
return
unless
gitlab_plugin
gitlab_plugin
.
dig
(
'issue'
,
'url'
)
end
def
map_to_detailed_error
(
issue
)
Gitlab
::
ErrorTracking
::
DetailedError
.
new
(
id:
issue
.
fetch
(
'id'
),
...
...
@@ -252,6 +261,7 @@ module Sentry
project_id:
issue
.
dig
(
'project'
,
'id'
),
project_name:
issue
.
dig
(
'project'
,
'name'
),
project_slug:
issue
.
dig
(
'project'
,
'slug'
),
gitlab_issue:
parse_gitlab_issue
(
issue
.
fetch
(
'pluginIssues'
,
nil
)),
first_release_last_commit:
issue
.
dig
(
'firstRelease'
,
'lastCommit'
),
last_release_last_commit:
issue
.
dig
(
'lastRelease'
,
'lastCommit'
),
first_release_short_version:
issue
.
dig
(
'firstRelease'
,
'shortVersion'
),
...
...
locale/gitlab.pot
View file @
db2ccdfe
...
...
@@ -8360,6 +8360,9 @@ msgstr ""
msgid "GitLab Import"
msgstr ""
msgid "GitLab Issue"
msgstr ""
msgid "GitLab Shared Runners execute code of different projects on the same Runner unless you configure GitLab Runner Autoscale with MaxBuilds 1 (which it is on GitLab.com)."
msgstr ""
...
...
spec/factories/error_tracking/detailed_error.rb
View file @
db2ccdfe
...
...
@@ -23,6 +23,7 @@ FactoryBot.define do
[
Time
.
now
.
to_i
,
10
]
]
end
gitlab_issue
{
'http://gitlab.example.com/issues/1'
}
first_release_last_commit
{
'68c914da9'
}
last_release_last_commit
{
'9ad419c86'
}
first_release_short_version
{
'abc123'
}
...
...
spec/fixtures/api/schemas/error_tracking/error_detailed.json
View file @
db2ccdfe
...
...
@@ -13,6 +13,7 @@
"short_id"
,
"status"
,
"frequency"
,
"gitlab_issue"
,
"first_release_last_commit"
,
"last_release_last_commit"
,
"first_release_short_version"
,
...
...
@@ -36,6 +37,7 @@
"short_id"
:
{
"type"
:
"string"
},
"status"
:
{
"type"
:
"string"
},
"frequency"
:
{
"type"
:
"array"
},
"gitlab_issue"
:
{
"type"
:
[
"string"
,
"null"
]
},
"first_release_last_commit"
:
{
"type"
:
[
"string"
,
"null"
]
},
"last_release_last_commit"
:
{
"type"
:
[
"string"
,
"null"
]
},
"first_release_short_version"
:
{
"type"
:
[
"string"
,
"null"
]
},
...
...
spec/frontend/error_tracking/components/error_details_spec.js
View file @
db2ccdfe
...
...
@@ -138,5 +138,48 @@ describe('ErrorDetails', () => {
submitSpy
.
mockRestore
();
});
});
describe
(
'
GitLab issue link
'
,
()
=>
{
const
gitlabIssue
=
'
https://gitlab.example.com/issues/1
'
;
const
findGitLabLink
=
()
=>
wrapper
.
find
(
`[href="
${
gitlabIssue
}
"]`
);
const
findCreateIssueButton
=
()
=>
wrapper
.
find
(
'
[data-qa-selector="create_issue_button"]
'
);
describe
(
'
is present
'
,
()
=>
{
beforeEach
(()
=>
{
store
.
state
.
details
.
loading
=
false
;
store
.
state
.
details
.
error
=
{
id
:
1
,
gitlab_issue
:
gitlabIssue
,
};
mountComponent
();
});
it
(
'
should display the issue link
'
,
()
=>
{
expect
(
findGitLabLink
().
exists
()).
toBe
(
true
);
});
it
(
'
should not display a create issue button
'
,
()
=>
{
expect
(
findCreateIssueButton
().
exists
()).
toBe
(
false
);
});
});
describe
(
'
is not present
'
,
()
=>
{
beforeEach
(()
=>
{
store
.
state
.
details
.
loading
=
false
;
store
.
state
.
details
.
error
=
{
id
:
1
,
gitlab_issue
:
null
,
};
mountComponent
();
});
it
(
'
should not display an issue link
'
,
()
=>
{
expect
(
findGitLabLink
().
exists
()).
toBe
(
false
);
});
it
(
'
should display the create issue button
'
,
()
=>
{
expect
(
findCreateIssueButton
().
exists
()).
toBe
(
true
);
});
});
});
});
});
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