Commit abc1e3e5 authored by Olena Horal-Koretska's avatar Olena Horal-Koretska Committed by Phil Hughes

Link to GitLab commit in error detail page

Add link to commit if available
parent 9cd82c24
...@@ -235,18 +235,23 @@ export default { ...@@ -235,18 +235,23 @@ export default {
>{{ error.tags.logger }} >{{ error.tags.logger }}
</gl-badge> </gl-badge>
</template> </template>
<h3>{{ __('Error details') }}</h3>
<ul> <ul>
<li v-if="GQLerror.gitlabCommit">
<strong class="bold">{{ __('GitLab commit') }}:</strong>
<gl-link :href="GQLerror.gitlabCommitPath">
<span>{{ GQLerror.gitlabCommit.substr(0, 10) }}</span>
</gl-link>
</li>
<li v-if="error.gitlab_issue"> <li v-if="error.gitlab_issue">
<span class="bold">{{ __('GitLab Issue') }}:</span> <strong class="bold">{{ __('GitLab Issue') }}:</strong>
<gl-link :href="error.gitlab_issue"> <gl-link :href="error.gitlab_issue">
<span>{{ error.gitlab_issue }}</span> <span>{{ error.gitlab_issue }}</span>
</gl-link> </gl-link>
</li> </li>
<li> <li>
<span class="bold">{{ __('Sentry event') }}:</span> <strong class="bold">{{ __('Sentry event') }}:</strong>
<gl-link <gl-link
class="d-inline-flex align-items-center"
v-track-event="trackClickErrorLinkToSentryOptions(GQLerror.externalUrl)" v-track-event="trackClickErrorLinkToSentryOptions(GQLerror.externalUrl)"
:href="GQLerror.externalUrl" :href="GQLerror.externalUrl"
target="_blank" target="_blank"
...@@ -256,25 +261,25 @@ export default { ...@@ -256,25 +261,25 @@ export default {
</gl-link> </gl-link>
</li> </li>
<li v-if="GQLerror.firstReleaseShortVersion"> <li v-if="GQLerror.firstReleaseShortVersion">
<span class="bold">{{ __('First seen') }}:</span> <strong class="bold">{{ __('First seen') }}:</strong>
{{ formatDate(GQLerror.firstSeen) }} {{ formatDate(GQLerror.firstSeen) }}
<gl-link :href="firstReleaseLink" target="_blank"> <gl-link :href="firstReleaseLink" target="_blank">
<span>{{ __('Release') }}: {{ GQLerror.firstReleaseShortVersion }}</span> <span>{{ __('Release') }}: {{ GQLerror.firstReleaseShortVersion.substr(0, 10) }}</span>
</gl-link> </gl-link>
</li> </li>
<li v-if="GQLerror.lastReleaseShortVersion"> <li v-if="GQLerror.lastReleaseShortVersion">
<span class="bold">{{ __('Last seen') }}:</span> <strong class="bold">{{ __('Last seen') }}:</strong>
{{ formatDate(GQLerror.lastSeen) }} {{ formatDate(GQLerror.lastSeen) }}
<gl-link :href="lastReleaseLink" target="_blank"> <gl-link :href="lastReleaseLink" target="_blank">
<span>{{ __('Release') }}: {{ GQLerror.lastReleaseShortVersion }}</span> <span>{{ __('Release') }}: {{ GQLerror.lastReleaseShortVersion.substr(0, 10) }}</span>
</gl-link> </gl-link>
</li> </li>
<li> <li>
<span class="bold">{{ __('Events') }}:</span> <strong class="bold">{{ __('Events') }}:</strong>
<span>{{ GQLerror.count }}</span> <span>{{ GQLerror.count }}</span>
</li> </li>
<li> <li>
<span class="bold">{{ __('Users') }}:</span> <strong class="bold">{{ __('Users') }}:</strong>
<span>{{ GQLerror.userCount }}</span> <span>{{ GQLerror.userCount }}</span>
</li> </li>
</ul> </ul>
......
...@@ -13,6 +13,8 @@ query errorDetails($fullPath: ID!, $errorId: ID!) { ...@@ -13,6 +13,8 @@ query errorDetails($fullPath: ID!, $errorId: ID!) {
externalUrl externalUrl
firstReleaseShortVersion firstReleaseShortVersion
lastReleaseShortVersion lastReleaseShortVersion
gitlabCommit
gitlabCommitPath
} }
} }
} }
---
title: Link to GitLab commit in Sentry error details page
merge_request: 22431
author:
type: added
...@@ -7313,9 +7313,6 @@ msgstr "" ...@@ -7313,9 +7313,6 @@ msgstr ""
msgid "Error deleting project. Check logs for error details." msgid "Error deleting project. Check logs for error details."
msgstr "" msgstr ""
msgid "Error details"
msgstr ""
msgid "Error fetching diverging counts for branches. Please try again." msgid "Error fetching diverging counts for branches. Please try again."
msgstr "" msgstr ""
...@@ -8879,6 +8876,9 @@ msgstr "" ...@@ -8879,6 +8876,9 @@ msgstr ""
msgid "GitLab allows you to continue using your license even if you exceed the number of seats you purchased. You will be required to pay for these seats when you renew your license." msgid "GitLab allows you to continue using your license even if you exceed the number of seats you purchased. You will be required to pay for these seats when you renew your license."
msgstr "" msgstr ""
msgid "GitLab commit"
msgstr ""
msgid "GitLab for Slack" msgid "GitLab for Slack"
msgstr "" msgstr ""
......
...@@ -246,5 +246,37 @@ describe('ErrorDetails', () => { ...@@ -246,5 +246,37 @@ describe('ErrorDetails', () => {
}); });
}); });
}); });
describe('GitLab commit link', () => {
const gitlabCommit = '7975be0116940bf2ad4321f79d02a55c5f7779aa';
const gitlabCommitPath =
'/gitlab-org/gitlab-test/commit/7975be0116940bf2ad4321f79d02a55c5f7779aa';
const findGitLabCommitLink = () => wrapper.find(`[href$="${gitlabCommitPath}"]`);
it('should display a link', () => {
mocks.$apollo.queries.GQLerror.loading = false;
wrapper.setData({
GQLerror: {
gitlabCommit,
gitlabCommitPath,
},
});
return wrapper.vm.$nextTick().then(() => {
expect(findGitLabCommitLink().exists()).toBe(true);
});
});
it('should display a link', () => {
mocks.$apollo.queries.GQLerror.loading = false;
wrapper.setData({
GQLerror: {
gitlabCommit: null,
},
});
return wrapper.vm.$nextTick().then(() => {
expect(findGitLabCommitLink().exists()).toBe(false);
});
});
});
}); });
}); });
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