Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sentry_detailed_error_type.rb « error_tracking « types « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: af6d8818d9097030477815504629129cfd70266e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# frozen_string_literal: true

module Types
  module ErrorTracking
    class SentryDetailedErrorType < ::Types::BaseObject
      graphql_name 'SentryDetailedError'

      present_using SentryDetailedErrorPresenter

      authorize :read_sentry_issue

      field :id, GraphQL::ID_TYPE,
            null: false,
            description: "ID (global ID) of the error"
      field :sentry_id, GraphQL::STRING_TYPE,
            method: :id,
            null: false,
            description: "ID (Sentry ID) of the error"
      field :title, GraphQL::STRING_TYPE,
            null: false,
            description: "Title of the error"
      field :type, GraphQL::STRING_TYPE,
            null: false,
            description: "Type of the error"
      field :user_count, GraphQL::INT_TYPE,
            null: false,
            description: "Count of users affected by the error"
      field :count, GraphQL::INT_TYPE,
            null: false,
            description: "Count of occurrences"
      field :first_seen, Types::TimeType,
            null: false,
            description: "Timestamp when the error was first seen"
      field :last_seen, Types::TimeType,
            null: false,
            description: "Timestamp when the error was last seen"
      field :message, GraphQL::STRING_TYPE,
            null: true,
            description: "Sentry metadata message of the error"
      field :culprit, GraphQL::STRING_TYPE,
            null: false,
            description: "Culprit of the error"
      field :external_url, GraphQL::STRING_TYPE,
            null: false,
            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)"
      field :sentry_project_name, GraphQL::STRING_TYPE,
            method: :project_name,
            null: false,
            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"
      field :short_id, GraphQL::STRING_TYPE,
            null: false,
            description: "Short ID (Sentry ID) of the error"
      field :status, Types::ErrorTracking::SentryErrorStatusEnum,
            null: false,
            description: "Status of the error"
      field :frequency, [Types::ErrorTracking::SentryErrorFrequencyType],
            null: false,
            description: "Last 24hr stats of the error"
      field :first_release_last_commit, GraphQL::STRING_TYPE,
            null: true,
            description: "Commit the error was first seen"
      field :last_release_last_commit, GraphQL::STRING_TYPE,
            null: true,
            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"
      field :last_release_short_version, GraphQL::STRING_TYPE,
            null: true,
            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"
      field :gitlab_commit_path, GraphQL::STRING_TYPE,
            null: true,
            description: "Path to the GitLab page for the GitLab commit attributed to the error"

      def first_seen
        DateTime.parse(object.first_seen)
      end

      def last_seen
        DateTime.parse(object.last_seen)
      end

      def project_id
        Gitlab::GlobalId.build(model_name: 'Project', id: object.project_id).to_s
      end
    end
  end
end