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 { ...@@ -120,10 +120,10 @@ export default {
]), ]),
...mapGetters('details', ['stacktrace']), ...mapGetters('details', ['stacktrace']),
firstReleaseLink() { firstReleaseLink() {
return `${this.error.externalBaseUrl}/releases/${this.error.firstReleaseShortVersion}`; return `${this.error.externalBaseUrl}/releases/${this.error.firstReleaseVersion}`;
}, },
lastReleaseLink() { lastReleaseLink() {
return `${this.error.externalBaseUrl}/releases/${this.error.lastReleaseShortVersion}`; return `${this.error.externalBaseUrl}/releases/${this.error.lastReleaseVersion}`;
}, },
showStacktrace() { showStacktrace() {
return Boolean(this.stacktrace?.length); return Boolean(this.stacktrace?.length);
...@@ -400,18 +400,18 @@ export default { ...@@ -400,18 +400,18 @@ export default {
<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="error.firstReleaseShortVersion"> <li v-if="error.firstReleaseVersion">
<strong class="bold">{{ __('First seen') }}:</strong> <strong class="bold">{{ __('First seen') }}:</strong>
<time-ago-tooltip :time="error.firstSeen" /> <time-ago-tooltip :time="error.firstSeen" />
<gl-link :href="firstReleaseLink" target="_blank"> <gl-link :href="firstReleaseLink" target="_blank">
<span>{{ __('Release') }}: {{ error.firstReleaseShortVersion.substr(0, 10) }}</span> <span>{{ __('Release') }}: {{ error.firstReleaseVersion }}</span>
</gl-link> </gl-link>
</li> </li>
<li v-if="error.lastReleaseShortVersion"> <li v-if="error.lastReleaseVersion">
<strong class="bold">{{ __('Last seen') }}:</strong> <strong class="bold">{{ __('Last seen') }}:</strong>
<time-ago-tooltip :time="error.lastSeen" /> <time-ago-tooltip :time="error.lastSeen" />
<gl-link :href="lastReleaseLink" target="_blank"> <gl-link :href="lastReleaseLink" target="_blank">
<span>{{ __('Release') }}: {{ error.lastReleaseShortVersion.substr(0, 10) }}</span> <span>{{ __('Release') }}: {{ error.lastReleaseVersion }}</span>
</gl-link> </gl-link>
</li> </li>
<li> <li>
......
...@@ -18,8 +18,8 @@ query errorDetails($fullPath: ID!, $errorId: ID!) { ...@@ -18,8 +18,8 @@ query errorDetails($fullPath: ID!, $errorId: ID!) {
} }
externalUrl externalUrl
externalBaseUrl externalBaseUrl
firstReleaseShortVersion firstReleaseVersion
lastReleaseShortVersion lastReleaseVersion
gitlabCommit gitlabCommit
gitlabCommitPath gitlabCommitPath
gitlabIssuePath gitlabIssuePath
......
...@@ -76,8 +76,14 @@ module Types ...@@ -76,8 +76,14 @@ module Types
description: 'Commit the error was last seen' description: 'Commit the error was last seen'
field :first_release_short_version, GraphQL::STRING_TYPE, field :first_release_short_version, GraphQL::STRING_TYPE,
null: true, 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, 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, null: true,
description: 'Release version the error was last seen' description: 'Release version the error was last seen'
field :gitlab_commit, GraphQL::STRING_TYPE, 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 { ...@@ -11470,10 +11470,15 @@ type SentryDetailedError {
firstReleaseLastCommit: String firstReleaseLastCommit: String
""" """
Release version the error was first seen Release short version the error was first seen
""" """
firstReleaseShortVersion: String firstReleaseShortVersion: String
"""
Release version the error was first seen
"""
firstReleaseVersion: String
""" """
Timestamp when the error was first seen Timestamp when the error was first seen
""" """
...@@ -11510,10 +11515,15 @@ type SentryDetailedError { ...@@ -11510,10 +11515,15 @@ type SentryDetailedError {
lastReleaseLastCommit: String lastReleaseLastCommit: String
""" """
Release version the error was last seen Release short version the error was last seen
""" """
lastReleaseShortVersion: String lastReleaseShortVersion: String
"""
Release version the error was last seen
"""
lastReleaseVersion: String
""" """
Timestamp when the error was last seen Timestamp when the error was last seen
""" """
......
...@@ -33672,6 +33672,20 @@ ...@@ -33672,6 +33672,20 @@
}, },
{ {
"name": "firstReleaseShortVersion", "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", "description": "Release version the error was first seen",
"args": [ "args": [
...@@ -33804,6 +33818,20 @@ ...@@ -33804,6 +33818,20 @@
}, },
{ {
"name": "lastReleaseShortVersion", "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", "description": "Release version the error was last seen",
"args": [ "args": [
...@@ -1680,7 +1680,8 @@ A Sentry error. ...@@ -1680,7 +1680,8 @@ A Sentry error.
| `externalBaseUrl` | String! | External Base URL of the Sentry Instance | | `externalBaseUrl` | String! | External Base URL of the Sentry Instance |
| `externalUrl` | String! | External URL of the error | | `externalUrl` | String! | External URL of the error |
| `firstReleaseLastCommit` | String | Commit the error was first seen | | `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 | | `firstSeen` | Time! | Timestamp when the error was first seen |
| `frequency` | SentryErrorFrequency! => Array | Last 24hr stats of the error | | `frequency` | SentryErrorFrequency! => Array | Last 24hr stats of the error |
| `gitlabCommit` | String | GitLab commit SHA attributed to the Error based on the release version | | `gitlabCommit` | String | GitLab commit SHA attributed to the Error based on the release version |
...@@ -1688,7 +1689,8 @@ A Sentry error. ...@@ -1688,7 +1689,8 @@ A Sentry error.
| `gitlabIssuePath` | String | URL of GitLab Issue | | `gitlabIssuePath` | String | URL of GitLab Issue |
| `id` | ID! | ID (global ID) of the error | | `id` | ID! | ID (global ID) of the error |
| `lastReleaseLastCommit` | String | Commit the error was last seen | | `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 | | `lastSeen` | Time! | Timestamp when the error was last seen |
| `message` | String | Sentry metadata message of the error | | `message` | String | Sentry metadata message of the error |
| `sentryId` | String! | ID (Sentry ID) of the error | | `sentryId` | String! | ID (Sentry ID) of the error |
......
...@@ -22,6 +22,7 @@ module Gitlab ...@@ -22,6 +22,7 @@ module Gitlab
:id, :id,
:last_release_last_commit, :last_release_last_commit,
:last_release_short_version, :last_release_short_version,
:last_release_version,
:last_seen, :last_seen,
:message, :message,
:project_id, :project_id,
......
...@@ -168,7 +168,8 @@ module Sentry ...@@ -168,7 +168,8 @@ module Sentry
first_release_short_version: issue.dig('firstRelease', 'shortVersion'), first_release_short_version: issue.dig('firstRelease', 'shortVersion'),
first_release_version: issue.dig('firstRelease', 'version'), first_release_version: issue.dig('firstRelease', 'version'),
last_release_last_commit: issue.dig('lastRelease', 'lastCommit'), 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 end
......
...@@ -42,7 +42,30 @@ ...@@ -42,7 +42,30 @@
"isBookmarked": false, "isBookmarked": false,
"isPublic": false, "isPublic": false,
"isSubscribed": true, "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", "lastSeen": "2018-11-06T21:19:55Z",
"level": "error", "level": "error",
"logger": null, "logger": null,
......
...@@ -31,6 +31,8 @@ RSpec.describe GitlabSchema.types['SentryDetailedError'] do ...@@ -31,6 +31,8 @@ RSpec.describe GitlabSchema.types['SentryDetailedError'] do
lastReleaseLastCommit lastReleaseLastCommit
firstReleaseShortVersion firstReleaseShortVersion
lastReleaseShortVersion lastReleaseShortVersion
firstReleaseVersion
lastReleaseVersion
gitlabIssuePath gitlabIssuePath
gitlabCommit gitlabCommit
gitlabCommitPath gitlabCommitPath
......
...@@ -234,6 +234,7 @@ RSpec.describe Sentry::Client::Issue do ...@@ -234,6 +234,7 @@ RSpec.describe Sentry::Client::Issue do
:first_release_short_version | [:firstRelease, :shortVersion] :first_release_short_version | [:firstRelease, :shortVersion]
:last_release_short_version | [:lastRelease, :shortVersion] :last_release_short_version | [:lastRelease, :shortVersion]
:first_release_version | [:firstRelease, :version] :first_release_version | [:firstRelease, :version]
:last_release_version | [:lastRelease, :version]
end end
with_them do 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