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
Show 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
...
@@ -21,6 +21,7 @@ module ErrorTracking
:project_slug
,
:project_slug
,
:short_id
,
:short_id
,
:status
,
:status
,
:tags
,
:title
,
:title
,
:type
,
:type
,
:user_count
: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
...
@@ -26,6 +26,7 @@ module Gitlab
:project_slug
,
:project_slug
,
:short_id
,
:short_id
,
:status
,
:status
,
:tags
,
:title
,
:title
,
:type
,
:type
,
:user_count
:user_count
...
...
lib/sentry/client/issue.rb
View file @
7fed2d7a
...
@@ -36,6 +36,7 @@ module Sentry
...
@@ -36,6 +36,7 @@ module Sentry
id:
issue
.
fetch
(
'id'
),
id:
issue
.
fetch
(
'id'
),
first_seen:
issue
.
fetch
(
'firstSeen'
,
nil
),
first_seen:
issue
.
fetch
(
'firstSeen'
,
nil
),
last_seen:
issue
.
fetch
(
'lastSeen'
,
nil
),
last_seen:
issue
.
fetch
(
'lastSeen'
,
nil
),
tags:
extract_tags
(
issue
),
title:
issue
.
fetch
(
'title'
,
nil
),
title:
issue
.
fetch
(
'title'
,
nil
),
type:
issue
.
fetch
(
'type'
,
nil
),
type:
issue
.
fetch
(
'type'
,
nil
),
user_count:
issue
.
fetch
(
'userCount'
,
nil
),
user_count:
issue
.
fetch
(
'userCount'
,
nil
),
...
@@ -57,6 +58,13 @@ module Sentry
...
@@ -57,6 +58,13 @@ module Sentry
last_release_short_version:
issue
.
dig
(
'lastRelease'
,
'shortVersion'
)
last_release_short_version:
issue
.
dig
(
'lastRelease'
,
'shortVersion'
)
)
)
end
end
def
extract_tags
(
issue
)
{
level:
issue
.
fetch
(
'level'
,
nil
),
logger:
issue
.
fetch
(
'logger'
,
nil
)
}
end
end
end
end
end
end
end
spec/factories/error_tracking/detailed_error.rb
View file @
7fed2d7a
...
@@ -18,6 +18,12 @@ FactoryBot.define do
...
@@ -18,6 +18,12 @@ FactoryBot.define do
project_slug
{
'project_name'
}
project_slug
{
'project_name'
}
short_id
{
'ID'
}
short_id
{
'ID'
}
status
{
'unresolved'
}
status
{
'unresolved'
}
tags
do
{
level:
'error'
,
logger:
'rails'
}
end
frequency
do
frequency
do
[
[
[
Time
.
now
.
to_i
,
10
]
[
Time
.
now
.
to_i
,
10
]
...
...
spec/fixtures/api/schemas/error_tracking/error_detailed.json
View file @
7fed2d7a
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
"external_base_url"
,
"external_base_url"
,
"last_seen"
,
"last_seen"
,
"message"
,
"message"
,
"tags"
,
"type"
,
"type"
,
"title"
,
"title"
,
"project_id"
,
"project_id"
,
...
@@ -20,23 +21,38 @@
...
@@ -20,23 +21,38 @@
"last_release_short_version"
"last_release_short_version"
],
],
"properties"
:
{
"properties"
:
{
"id"
:
{
"type"
:
"string"
},
"id"
:
{
"type"
:
"string"
},
"first_seen"
:
{
"type"
:
"string"
,
"format"
:
"date-time"
},
"first_seen"
:
{
"type"
:
"string"
,
"format"
:
"date-time"
},
"last_seen"
:
{
"type"
:
"string"
,
"format"
:
"date-time"
},
"last_seen"
:
{
"type"
:
"string"
,
"format"
:
"date-time"
},
"type"
:
{
"type"
:
"string"
},
"type"
:
{
"type"
:
"string"
},
"message"
:
{
"type"
:
"string"
},
"message"
:
{
"type"
:
"string"
},
"culprit"
:
{
"type"
:
"string"
},
"culprit"
:
{
"type"
:
"string"
},
"count"
:
{
"type"
:
"integer"
},
"count"
:
{
"type"
:
"integer"
},
"external_url"
:
{
"type"
:
"string"
},
"external_url"
:
{
"type"
:
"string"
},
"external_base_url"
:
{
"type"
:
"string"
},
"external_base_url"
:
{
"type"
:
"string"
},
"user_count"
:
{
"type"
:
"integer"
},
"user_count"
:
{
"type"
:
"integer"
},
"title"
:
{
"type"
:
"string"
},
"tags"
:
{
"project_id"
:
{
"type"
:
"string"
},
"type"
:
"object"
,
"project_name"
:
{
"type"
:
"string"
},
"required"
:
[
"project_slug"
:
{
"type"
:
"string"
},
"level"
,
"short_id"
:
{
"type"
:
"string"
},
"logger"
"status"
:
{
"type"
:
"string"
},
],
"frequency"
:
{
"type"
:
"array"
},
"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"
]
},
"gitlab_issue"
:
{
"type"
:
[
"string"
,
"null"
]
},
"first_release_last_commit"
:
{
"type"
:
[
"string"
,
"null"
]
},
"first_release_last_commit"
:
{
"type"
:
[
"string"
,
"null"
]
},
"last_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
...
@@ -74,6 +74,10 @@ describe Sentry::Client::Issue do
it
'has a correct GitLab issue url'
do
it
'has a correct GitLab issue url'
do
expect
(
subject
.
gitlab_issue
).
to
eq
(
'https://gitlab.com/gitlab-org/gitlab/issues/1'
)
expect
(
subject
.
gitlab_issue
).
to
eq
(
'https://gitlab.com/gitlab-org/gitlab/issues/1'
)
end
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
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