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

list_issues_service.rb « error_tracking « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2e8c401b8efad3a3eab1ef222038e6e5150d8c98 (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
# frozen_string_literal: true

module ErrorTracking
  class ListIssuesService < ErrorTracking::BaseService
    DEFAULT_ISSUE_STATUS = 'unresolved'
    DEFAULT_LIMIT = 20

    def external_url
      project_error_tracking_setting&.sentry_external_url
    end

    private

    def fetch
      project_error_tracking_setting.list_sentry_issues(issue_status: issue_status, limit: limit)
    end

    def parse_response(response)
      { issues: response[:issues] }
    end

    def issue_status
      params[:issue_status] || DEFAULT_ISSUE_STATUS
    end

    def limit
      params[:limit] || DEFAULT_LIMIT
    end
  end
end