Commit ae042c87 authored by Nick Thomas's avatar Nick Thomas

Merge branch '194164-add-missing-fields-for-sentry-error-details-graphql' into 'master'

Resolve "Add missing fields for Sentry error details GraphQL"

See merge request gitlab-org/gitlab!23483
parents a2580ca6 cd8c04cd
......@@ -11,77 +11,87 @@ module Types
field :id, GraphQL::ID_TYPE,
null: false,
description: "ID (global ID) of the error"
description: 'ID (global ID) of the error'
field :sentry_id, GraphQL::STRING_TYPE,
method: :id,
null: false,
description: "ID (Sentry ID) of the error"
description: 'ID (Sentry ID) of the error'
field :title, GraphQL::STRING_TYPE,
null: false,
description: "Title of the error"
description: 'Title of the error'
field :type, GraphQL::STRING_TYPE,
null: false,
description: "Type of the error"
description: 'Type of the error'
field :user_count, GraphQL::INT_TYPE,
null: false,
description: "Count of users affected by the error"
description: 'Count of users affected by the error'
field :count, GraphQL::INT_TYPE,
null: false,
description: "Count of occurrences"
description: 'Count of occurrences'
field :first_seen, Types::TimeType,
null: false,
description: "Timestamp when the error was first seen"
description: 'Timestamp when the error was first seen'
field :last_seen, Types::TimeType,
null: false,
description: "Timestamp when the error was last seen"
description: 'Timestamp when the error was last seen'
field :message, GraphQL::STRING_TYPE,
null: true,
description: "Sentry metadata message of the error"
description: 'Sentry metadata message of the error'
field :culprit, GraphQL::STRING_TYPE,
null: false,
description: "Culprit of the error"
description: 'Culprit of the error'
field :external_base_url, GraphQL::STRING_TYPE,
null: false,
description: 'External Base URL of the Sentry Instance'
field :external_url, GraphQL::STRING_TYPE,
null: false,
description: "External URL of the error"
description: 'External URL of the error'
field :sentry_project_id, GraphQL::ID_TYPE,
method: :project_id,
null: false,
description: "ID of the project (Sentry project)"
description: 'ID of the project (Sentry project)'
field :sentry_project_name, GraphQL::STRING_TYPE,
method: :project_name,
null: false,
description: "Name of the project affected by the error"
description: 'Name of the project affected by the error'
field :sentry_project_slug, GraphQL::STRING_TYPE,
method: :project_slug,
null: false,
description: "Slug of the project affected by the error"
description: 'Slug of the project affected by the error'
field :short_id, GraphQL::STRING_TYPE,
null: false,
description: "Short ID (Sentry ID) of the error"
description: 'Short ID (Sentry ID) of the error'
field :status, Types::ErrorTracking::SentryErrorStatusEnum,
null: false,
description: "Status of the error"
description: 'Status of the error'
field :frequency, [Types::ErrorTracking::SentryErrorFrequencyType],
null: false,
description: "Last 24hr stats of the error"
description: 'Last 24hr stats of the error'
field :first_release_last_commit, GraphQL::STRING_TYPE,
null: true,
description: "Commit the error was first seen"
description: 'Commit the error was first seen'
field :last_release_last_commit, GraphQL::STRING_TYPE,
null: true,
description: "Commit the error was last seen"
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 version the error was first seen'
field :last_release_short_version, GraphQL::STRING_TYPE,
null: true,
description: "Release version the error was last seen"
description: 'Release version the error was last seen'
field :gitlab_commit, GraphQL::STRING_TYPE,
null: true,
description: "GitLab commit SHA attributed to the Error based on the release version"
description: 'GitLab commit SHA attributed to the Error based on the release version'
field :gitlab_commit_path, GraphQL::STRING_TYPE,
null: true,
description: "Path to the GitLab page for the GitLab commit attributed to the error"
description: 'Path to the GitLab page for the GitLab commit attributed to the error'
field :gitlab_issue_path, GraphQL::STRING_TYPE,
method: :gitlab_issue,
null: true,
description: 'URL of GitLab Issue'
field :tags, Types::ErrorTracking::SentryErrorTagsType,
null: false,
description: 'Tags associated with the Sentry Error'
def first_seen
DateTime.parse(object.first_seen)
......
# frozen_string_literal: true
module Types
module ErrorTracking
# rubocop: disable Graphql/AuthorizeTypes
class SentryErrorTagsType < ::Types::BaseObject
graphql_name 'SentryErrorTags'
description 'State of a Sentry error'
field :level, GraphQL::STRING_TYPE,
null: true,
description: "Severity level of the Sentry Error"
field :logger, GraphQL::STRING_TYPE,
null: true,
description: "Logger of the Sentry Error"
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
---
title: Add tags, external_base_url, gitlab_issue to Sentry Detailed Error graphql
merge_request: 23483
author:
type: added
......@@ -6065,6 +6065,11 @@ type SentryDetailedError {
"""
culprit: String!
"""
External Base URL of the Sentry Instance
"""
externalBaseUrl: String!
"""
External URL of the error
"""
......@@ -6100,6 +6105,11 @@ type SentryDetailedError {
"""
gitlabCommitPath: String
"""
URL of GitLab Issue
"""
gitlabIssuePath: String
"""
ID (global ID) of the error
"""
......@@ -6155,6 +6165,11 @@ type SentryDetailedError {
"""
status: SentryErrorStatus!
"""
Tags associated with the Sentry Error
"""
tags: SentryErrorTags!
"""
Title of the error
"""
......@@ -6208,6 +6223,21 @@ enum SentryErrorStatus {
UNRESOLVED
}
"""
State of a Sentry error
"""
type SentryErrorTags {
"""
Severity level of the Sentry Error
"""
level: String
"""
Logger of the Sentry Error
"""
logger: String
}
"""
Represents a snippet entry
"""
......
......@@ -16746,6 +16746,24 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "externalBaseUrl",
"description": "External Base URL of the Sentry Instance",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "externalUrl",
"description": "External URL of the error",
......@@ -16864,6 +16882,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "gitlabIssuePath",
"description": "URL of GitLab Issue",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "id",
"description": "ID (global ID) of the error",
......@@ -17050,6 +17082,24 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "tags",
"description": "Tags associated with the Sentry Error",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "SentryErrorTags",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "title",
"description": "Title of the error",
......@@ -17196,6 +17246,47 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "SentryErrorTags",
"description": "State of a Sentry error",
"fields": [
{
"name": "level",
"description": "Severity level of the Sentry Error",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "logger",
"description": "Logger of the Sentry Error",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [
],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "GrafanaIntegration",
......
......@@ -923,6 +923,7 @@ Autogenerated return type of RemoveAwardEmoji
| --- | ---- | ---------- |
| `count` | Int! | Count of occurrences |
| `culprit` | String! | Culprit of the 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 |
......@@ -930,6 +931,7 @@ Autogenerated return type of RemoveAwardEmoji
| `frequency` | SentryErrorFrequency! => Array | Last 24hr stats of the error |
| `gitlabCommit` | String | GitLab commit SHA attributed to the Error based on the release version |
| `gitlabCommitPath` | String | Path to the GitLab page for the GitLab commit attributed to the 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 |
......@@ -941,6 +943,7 @@ Autogenerated return type of RemoveAwardEmoji
| `sentryProjectSlug` | String! | Slug of the project affected by the error |
| `shortId` | String! | Short ID (Sentry ID) of the error |
| `status` | SentryErrorStatus! | Status of the error |
| `tags` | SentryErrorTags! | Tags associated with the Sentry Error |
| `title` | String! | Title of the error |
| `type` | String! | Type of the error |
| `userCount` | Int! | Count of users affected by the error |
......@@ -952,6 +955,15 @@ Autogenerated return type of RemoveAwardEmoji
| `count` | Int! | Count of errors received since the previously recorded time |
| `time` | Time! | Time the error frequency stats were recorded |
## SentryErrorTags
State of a Sentry error
| Name | Type | Description |
| --- | ---- | ---------- |
| `level` | String | Severity level of the Sentry Error |
| `logger` | String | Logger of the Sentry Error |
## Snippet
Represents a snippet entry
......
......@@ -20,6 +20,7 @@ describe GitlabSchema.types['SentryDetailedError'] do
message
culprit
externalUrl
externalBaseUrl
sentryProjectId
sentryProjectName
sentryProjectSlug
......@@ -30,8 +31,10 @@ describe GitlabSchema.types['SentryDetailedError'] do
lastReleaseLastCommit
firstReleaseShortVersion
lastReleaseShortVersion
gitlabIssuePath
gitlabCommit
gitlabCommitPath
tags
]
is_expected.to have_graphql_fields(*expected_fields)
......
......@@ -57,6 +57,10 @@ describe 'getting a detailed sentry error' do
expect(error_data['firstSeen']).to eql sentry_detailed_error.first_seen
expect(error_data['lastSeen']).to eql sentry_detailed_error.last_seen
expect(error_data['gitlabCommit']).to be nil
expect(error_data['externalBaseUrl']).to eq sentry_detailed_error.external_base_url
expect(error_data['gitlabIssuePath']).to eq sentry_detailed_error.gitlab_issue
expect(error_data['tags']['logger']).to eq sentry_detailed_error.tags[:logger]
expect(error_data['tags']['level']).to eq sentry_detailed_error.tags[:level]
end
it 'is expected to return the frequency correctly' 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