Commit 59e851de authored by Illya Klymov's avatar Illya Klymov

Merge branch '213983-use-version-instead-of-shortversion-for-sentry' into 'master'

Sentry release link must use "version" key instead "shortversion"

Closes #213983

See merge request gitlab-org/gitlab!35623
parents fd44fee0 97363ce7
......@@ -120,10 +120,10 @@ export default {
]),
...mapGetters('details', ['stacktrace']),
firstReleaseLink() {
return `${this.error.externalBaseUrl}/releases/${this.error.firstReleaseShortVersion}`;
return `${this.error.externalBaseUrl}/releases/${this.error.firstReleaseVersion}`;
},
lastReleaseLink() {
return `${this.error.externalBaseUrl}/releases/${this.error.lastReleaseShortVersion}`;
return `${this.error.externalBaseUrl}/releases/${this.error.lastReleaseVersion}`;
},
showStacktrace() {
return Boolean(this.stacktrace?.length);
......@@ -400,18 +400,18 @@ export default {
<icon name="external-link" class="ml-1 flex-shrink-0" />
</gl-link>
</li>
<li v-if="error.firstReleaseShortVersion">
<li v-if="error.firstReleaseVersion">
<strong class="bold">{{ __('First seen') }}:</strong>
<time-ago-tooltip :time="error.firstSeen" />
<gl-link :href="firstReleaseLink" target="_blank">
<span>{{ __('Release') }}: {{ error.firstReleaseShortVersion.substr(0, 10) }}</span>
<span>{{ __('Release') }}: {{ error.firstReleaseVersion }}</span>
</gl-link>
</li>
<li v-if="error.lastReleaseShortVersion">
<li v-if="error.lastReleaseVersion">
<strong class="bold">{{ __('Last seen') }}:</strong>
<time-ago-tooltip :time="error.lastSeen" />
<gl-link :href="lastReleaseLink" target="_blank">
<span>{{ __('Release') }}: {{ error.lastReleaseShortVersion.substr(0, 10) }}</span>
<span>{{ __('Release') }}: {{ error.lastReleaseVersion }}</span>
</gl-link>
</li>
<li>
......
......@@ -18,8 +18,8 @@ query errorDetails($fullPath: ID!, $errorId: ID!) {
}
externalUrl
externalBaseUrl
firstReleaseShortVersion
lastReleaseShortVersion
firstReleaseVersion
lastReleaseVersion
gitlabCommit
gitlabCommitPath
gitlabIssuePath
......
......@@ -76,8 +76,14 @@ module Types
description: 'Commit the error was last seen'
field :first_release_short_version, GraphQL::STRING_TYPE,
null: true,
description: 'Release version the error was first seen'
description: 'Release short version the error was first seen'
field :last_release_short_version, GraphQL::STRING_TYPE,
null: true,
description: 'Release short version the error was last seen'
field :first_release_version, GraphQL::STRING_TYPE,
null: true,
description: 'Release version the error was first seen'
field :last_release_version, GraphQL::STRING_TYPE,
null: true,
description: 'Release version the error was last seen'
field :gitlab_commit, GraphQL::STRING_TYPE,
......
---
title: Use full version instead of short version for Sentry Error Release links.
merge_request: 35623
author:
type: fixed
......@@ -11470,10 +11470,15 @@ type SentryDetailedError {
firstReleaseLastCommit: String
"""
Release version the error was first seen
Release short version the error was first seen
"""
firstReleaseShortVersion: String
"""
Release version the error was first seen
"""
firstReleaseVersion: String
"""
Timestamp when the error was first seen
"""
......@@ -11510,10 +11515,15 @@ type SentryDetailedError {
lastReleaseLastCommit: String
"""
Release version the error was last seen
Release short version the error was last seen
"""
lastReleaseShortVersion: String
"""
Release version the error was last seen
"""
lastReleaseVersion: String
"""
Timestamp when the error was last seen
"""
......
......@@ -33672,6 +33672,20 @@
},
{
"name": "firstReleaseShortVersion",
"description": "Release short version the error was first seen",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "firstReleaseVersion",
"description": "Release version the error was first seen",
"args": [
......@@ -33804,6 +33818,20 @@
},
{
"name": "lastReleaseShortVersion",
"description": "Release short version the error was last seen",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "lastReleaseVersion",
"description": "Release version the error was last seen",
"args": [
......@@ -1680,7 +1680,8 @@ A Sentry error.
| `externalBaseUrl` | String! | External Base URL of the Sentry Instance |
| `externalUrl` | String! | External URL of the error |
| `firstReleaseLastCommit` | String | Commit the error was first seen |
| `firstReleaseShortVersion` | String | Release version the error was first seen |
| `firstReleaseShortVersion` | String | Release short version the error was first seen |
| `firstReleaseVersion` | String | Release version the error was first seen |
| `firstSeen` | Time! | Timestamp when the error was first seen |
| `frequency` | SentryErrorFrequency! => Array | Last 24hr stats of the error |
| `gitlabCommit` | String | GitLab commit SHA attributed to the Error based on the release version |
......@@ -1688,7 +1689,8 @@ A Sentry error.
| `gitlabIssuePath` | String | URL of GitLab Issue |
| `id` | ID! | ID (global ID) of the error |
| `lastReleaseLastCommit` | String | Commit the error was last seen |
| `lastReleaseShortVersion` | String | Release version the error was last seen |
| `lastReleaseShortVersion` | String | Release short version the error was last seen |
| `lastReleaseVersion` | String | Release version the error was last seen |
| `lastSeen` | Time! | Timestamp when the error was last seen |
| `message` | String | Sentry metadata message of the error |
| `sentryId` | String! | ID (Sentry ID) of the error |
......
......@@ -22,6 +22,7 @@ module Gitlab
:id,
:last_release_last_commit,
:last_release_short_version,
:last_release_version,
:last_seen,
:message,
:project_id,
......
......@@ -168,7 +168,8 @@ module Sentry
first_release_short_version: issue.dig('firstRelease', 'shortVersion'),
first_release_version: issue.dig('firstRelease', 'version'),
last_release_last_commit: issue.dig('lastRelease', 'lastCommit'),
last_release_short_version: issue.dig('lastRelease', 'shortVersion')
last_release_short_version: issue.dig('lastRelease', 'shortVersion'),
last_release_version: issue.dig('lastRelease', 'version')
})
end
......
......@@ -42,7 +42,30 @@
"isBookmarked": false,
"isPublic": false,
"isSubscribed": true,
"lastRelease": null,
"lastRelease": {
"dateReleased": null,
"commitCount": 1,
"url": null,
"data": {},
"lastDeploy": {},
"deployCount": 3,
"dateCreated": "2020-06-29T08:10:45.909Z",
"lastEvent": "2020-06-30T09:47:19.651Z",
"version": "17642328ead24b51867165985996d04b29321448",
"firstEvent": "2020-06-29T09:13:36.696Z",
"lastCommit": {},
"shortVersion": "27de6b42eb4",
"authors": [],
"owner": null,
"newGroups": 208,
"ref": null,
"projects": [
{
"name": "Pump Station",
"slug": "pump-station"
}
]
},
"lastSeen": "2018-11-06T21:19:55Z",
"level": "error",
"logger": null,
......
......@@ -31,6 +31,8 @@ RSpec.describe GitlabSchema.types['SentryDetailedError'] do
lastReleaseLastCommit
firstReleaseShortVersion
lastReleaseShortVersion
firstReleaseVersion
lastReleaseVersion
gitlabIssuePath
gitlabCommit
gitlabCommitPath
......
......@@ -234,6 +234,7 @@ RSpec.describe Sentry::Client::Issue do
:first_release_short_version | [:firstRelease, :shortVersion]
:last_release_short_version | [:lastRelease, :shortVersion]
:first_release_version | [:firstRelease, :version]
:last_release_version | [:lastRelease, :version]
end
with_them do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment