summaryrefslogtreecommitdiff
path: root/app/graphql/types/error_tracking
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-31 21:08:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-31 21:08:52 +0000
commitd5d3c03598df712550acf0c6463a61c6e7dcc19e (patch)
treed0fdf0f9cd6df46aea6ed16b6556f44055efb642 /app/graphql/types/error_tracking
parent0434f38ef1dce4fe640fe1e4542235746ceb943c (diff)
downloadgitlab-ce-d5d3c03598df712550acf0c6463a61c6e7dcc19e.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/graphql/types/error_tracking')
-rw-r--r--app/graphql/types/error_tracking/sentry_error_collection_type.rb4
-rw-r--r--app/graphql/types/error_tracking/sentry_error_stack_trace_context_type.rb29
-rw-r--r--app/graphql/types/error_tracking/sentry_error_stack_trace_entry_type.rb48
-rw-r--r--app/graphql/types/error_tracking/sentry_error_stack_trace_type.rb22
4 files changed, 103 insertions, 0 deletions
diff --git a/app/graphql/types/error_tracking/sentry_error_collection_type.rb b/app/graphql/types/error_tracking/sentry_error_collection_type.rb
index 2e1b75ac84c..121146133cb 100644
--- a/app/graphql/types/error_tracking/sentry_error_collection_type.rb
+++ b/app/graphql/types/error_tracking/sentry_error_collection_type.rb
@@ -28,6 +28,10 @@ module Types
null: true,
description: 'Detailed version of a Sentry error on the project',
resolver: Resolvers::ErrorTracking::SentryDetailedErrorResolver
+ field :error_stack_trace, Types::ErrorTracking::SentryErrorStackTraceType,
+ null: true,
+ description: 'Stack Trace of Sentry Error',
+ resolver: Resolvers::ErrorTracking::SentryErrorStackTraceResolver
field :external_url,
GraphQL::STRING_TYPE,
null: true,
diff --git a/app/graphql/types/error_tracking/sentry_error_stack_trace_context_type.rb b/app/graphql/types/error_tracking/sentry_error_stack_trace_context_type.rb
new file mode 100644
index 00000000000..e6d02c948d5
--- /dev/null
+++ b/app/graphql/types/error_tracking/sentry_error_stack_trace_context_type.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+module Types
+ module ErrorTracking
+ # rubocop: disable Graphql/AuthorizeTypes
+ class SentryErrorStackTraceContextType < ::Types::BaseObject
+ graphql_name 'SentryErrorStackTraceContext'
+ description 'An object context for a Sentry error stack trace'
+
+ field :line,
+ GraphQL::INT_TYPE,
+ null: false,
+ description: 'Line number of the context'
+ field :code,
+ GraphQL::STRING_TYPE,
+ null: false,
+ description: 'Code number of the context'
+
+ def line
+ object[0]
+ end
+
+ def code
+ object[1]
+ end
+ end
+ # rubocop: enable Graphql/AuthorizeTypes
+ end
+end
diff --git a/app/graphql/types/error_tracking/sentry_error_stack_trace_entry_type.rb b/app/graphql/types/error_tracking/sentry_error_stack_trace_entry_type.rb
new file mode 100644
index 00000000000..0747e41e9fb
--- /dev/null
+++ b/app/graphql/types/error_tracking/sentry_error_stack_trace_entry_type.rb
@@ -0,0 +1,48 @@
+# frozen_string_literal: true
+
+module Types
+ module ErrorTracking
+ # rubocop: disable Graphql/AuthorizeTypes
+ class SentryErrorStackTraceEntryType < ::Types::BaseObject
+ graphql_name 'SentryErrorStackTraceEntry'
+ description 'An object containing a stack trace entry for a Sentry error.'
+
+ field :function, GraphQL::STRING_TYPE,
+ null: true,
+ description: 'Function in which the Sentry error occurred'
+ field :col, GraphQL::STRING_TYPE,
+ null: true,
+ description: 'Function in which the Sentry error occurred'
+ field :line, GraphQL::STRING_TYPE,
+ null: true,
+ description: 'Function in which the Sentry error occurred'
+ field :file_name, GraphQL::STRING_TYPE,
+ null: true,
+ description: 'File in which the Sentry error occurred'
+ field :trace_context, [Types::ErrorTracking::SentryErrorStackTraceContextType],
+ null: true,
+ description: 'Context of the Sentry error'
+
+ def function
+ object['function']
+ end
+
+ def col
+ object['colNo']
+ end
+
+ def line
+ object['lineNo']
+ end
+
+ def file_name
+ object['filename']
+ end
+
+ def trace_context
+ object['context']
+ end
+ end
+ # rubocop: enable Graphql/AuthorizeTypes
+ end
+end
diff --git a/app/graphql/types/error_tracking/sentry_error_stack_trace_type.rb b/app/graphql/types/error_tracking/sentry_error_stack_trace_type.rb
new file mode 100644
index 00000000000..0e6105d1ff2
--- /dev/null
+++ b/app/graphql/types/error_tracking/sentry_error_stack_trace_type.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+module Types
+ module ErrorTracking
+ class SentryErrorStackTraceType < ::Types::BaseObject
+ graphql_name 'SentryErrorStackTrace'
+ description 'An object containing a stack trace entry for a Sentry error.'
+
+ authorize :read_sentry_issue
+
+ field :issue_id, GraphQL::STRING_TYPE,
+ null: false,
+ description: 'ID of the Sentry error'
+ field :date_received, GraphQL::STRING_TYPE,
+ null: false,
+ description: 'Time the stack trace was received by Sentry'
+ field :stack_trace_entries, [Types::ErrorTracking::SentryErrorStackTraceEntryType],
+ null: false,
+ description: 'Stack trace entries for the Sentry error'
+ end
+ end
+end