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
7fed2d7a
Commit
7fed2d7a
authored
Dec 20, 2019
by
Sean Arnold
Committed by
Lin Jen-Shin
Dec 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tags to detailed error response
- Fetched from Sentry API
parent
f44d48a0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
9 deletions
+50
-9
app/serializers/error_tracking/detailed_error_entity.rb
app/serializers/error_tracking/detailed_error_entity.rb
+1
-0
changelogs/unreleased/119031-add-tags-to-sentry-error-api-rest.yml
...s/unreleased/119031-add-tags-to-sentry-error-api-rest.yml
+5
-0
lib/gitlab/error_tracking/detailed_error.rb
lib/gitlab/error_tracking/detailed_error.rb
+1
-0
lib/sentry/client/issue.rb
lib/sentry/client/issue.rb
+8
-0
spec/factories/error_tracking/detailed_error.rb
spec/factories/error_tracking/detailed_error.rb
+6
-0
spec/fixtures/api/schemas/error_tracking/error_detailed.json
spec/fixtures/api/schemas/error_tracking/error_detailed.json
+25
-9
spec/lib/sentry/client/issue_spec.rb
spec/lib/sentry/client/issue_spec.rb
+4
-0
No files found.
app/serializers/error_tracking/detailed_error_entity.rb
View file @
7fed2d7a
...
...
@@ -21,6 +21,7 @@ module ErrorTracking
:project_slug
,
:short_id
,
:status
,
:tags
,
:title
,
:type
,
:user_count
...
...
changelogs/unreleased/119031-add-tags-to-sentry-error-api-rest.yml
0 → 100644
View file @
7fed2d7a
---
title
:
Add tags to sentry detailed error response
merge_request
:
22068
author
:
type
:
added
lib/gitlab/error_tracking/detailed_error.rb
View file @
7fed2d7a
...
...
@@ -26,6 +26,7 @@ module Gitlab
:project_slug
,
:short_id
,
:status
,
:tags
,
:title
,
:type
,
:user_count
...
...
lib/sentry/client/issue.rb
View file @
7fed2d7a
...
...
@@ -36,6 +36,7 @@ module Sentry
id:
issue
.
fetch
(
'id'
),
first_seen:
issue
.
fetch
(
'firstSeen'
,
nil
),
last_seen:
issue
.
fetch
(
'lastSeen'
,
nil
),
tags:
extract_tags
(
issue
),
title:
issue
.
fetch
(
'title'
,
nil
),
type:
issue
.
fetch
(
'type'
,
nil
),
user_count:
issue
.
fetch
(
'userCount'
,
nil
),
...
...
@@ -57,6 +58,13 @@ module Sentry
last_release_short_version:
issue
.
dig
(
'lastRelease'
,
'shortVersion'
)
)
end
def
extract_tags
(
issue
)
{
level:
issue
.
fetch
(
'level'
,
nil
),
logger:
issue
.
fetch
(
'logger'
,
nil
)
}
end
end
end
end
spec/factories/error_tracking/detailed_error.rb
View file @
7fed2d7a
...
...
@@ -18,6 +18,12 @@ FactoryBot.define do
project_slug
{
'project_name'
}
short_id
{
'ID'
}
status
{
'unresolved'
}
tags
do
{
level:
'error'
,
logger:
'rails'
}
end
frequency
do
[
[
Time
.
now
.
to_i
,
10
]
...
...
spec/fixtures/api/schemas/error_tracking/error_detailed.json
View file @
7fed2d7a
...
...
@@ -5,6 +5,7 @@
"external_base_url"
,
"last_seen"
,
"message"
,
"tags"
,
"type"
,
"title"
,
"project_id"
,
...
...
@@ -20,23 +21,38 @@
"last_release_short_version"
],
"properties"
:
{
"id"
:
{
"type"
:
"string"
},
"id"
:
{
"type"
:
"string"
},
"first_seen"
:
{
"type"
:
"string"
,
"format"
:
"date-time"
},
"last_seen"
:
{
"type"
:
"string"
,
"format"
:
"date-time"
},
"type"
:
{
"type"
:
"string"
},
"message"
:
{
"type"
:
"string"
},
"culprit"
:
{
"type"
:
"string"
},
"count"
:
{
"type"
:
"integer"
},
"count"
:
{
"type"
:
"integer"
},
"external_url"
:
{
"type"
:
"string"
},
"external_base_url"
:
{
"type"
:
"string"
},
"user_count"
:
{
"type"
:
"integer"
},
"title"
:
{
"type"
:
"string"
},
"project_id"
:
{
"type"
:
"string"
},
"project_name"
:
{
"type"
:
"string"
},
"project_slug"
:
{
"type"
:
"string"
},
"short_id"
:
{
"type"
:
"string"
},
"status"
:
{
"type"
:
"string"
},
"frequency"
:
{
"type"
:
"array"
},
"tags"
:
{
"type"
:
"object"
,
"required"
:
[
"level"
,
"logger"
],
"properties"
:
{
"level"
:
{
"type"
:
"string"
},
"logger"
:
{
"type"
:
"string"
}
}
},
"title"
:
{
"type"
:
"string"
},
"project_id"
:
{
"type"
:
"string"
},
"project_name"
:
{
"type"
:
"string"
},
"project_slug"
:
{
"type"
:
"string"
},
"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"
]
},
...
...
spec/lib/sentry/client/issue_spec.rb
View file @
7fed2d7a
...
...
@@ -74,6 +74,10 @@ describe Sentry::Client::Issue do
it
'has a correct GitLab issue url'
do
expect
(
subject
.
gitlab_issue
).
to
eq
(
'https://gitlab.com/gitlab-org/gitlab/issues/1'
)
end
it
'has the correct tags'
do
expect
(
subject
.
tags
).
to
eq
({
level:
issue_sample_response
[
'level'
],
logger:
issue_sample_response
[
'logger'
]
})
end
end
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