summaryrefslogtreecommitdiff
path: root/lib/sentry
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sentry')
-rw-r--r--lib/sentry/client.rb62
1 files changed, 31 insertions, 31 deletions
diff --git a/lib/sentry/client.rb b/lib/sentry/client.rb
index 49ec196b103..2a0836cae96 100644
--- a/lib/sentry/client.rb
+++ b/lib/sentry/client.rb
@@ -29,9 +29,9 @@ module Sentry
def request_params
{
headers: {
- 'Authorization' => "Bearer #{@token}"
+ "Authorization" => "Bearer #{@token}",
},
- follow_redirects: false
+ follow_redirects: false,
}
end
@@ -44,7 +44,7 @@ module Sentry
def get_issues(issue_status:, limit:)
http_get(issues_api_url, query: {
query: "is:#{issue_status}",
- limit: limit
+ limit: limit,
})
end
@@ -62,14 +62,14 @@ module Sentry
def projects_api_url
projects_url = URI(@url)
- projects_url.path = '/api/0/projects/'
+ projects_url.path = "/api/0/projects/"
projects_url
end
def issues_api_url
- issues_url = URI(@url + '/issues/')
- issues_url.path.squeeze!('/')
+ issues_url = URI(@url + "/issues/")
+ issues_url.path.squeeze!("/")
issues_url
end
@@ -87,53 +87,53 @@ module Sentry
issues_url = ErrorTracking::ProjectErrorTrackingSetting.extract_sentry_external_url(issues_url)
uri = URI(issues_url)
- uri.path.squeeze!('/')
+ uri.path.squeeze!("/")
uri.to_s
end
def map_to_error(issue)
- id = issue.fetch('id')
- project = issue.fetch('project')
+ id = issue.fetch("id")
+ project = issue.fetch("project")
- count = issue.fetch('count', nil)
+ count = issue.fetch("count", nil)
- frequency = issue.dig('stats', '24h')
- message = issue.dig('metadata', 'value')
+ frequency = issue.dig("stats", "24h")
+ message = issue.dig("metadata", "value")
external_url = issue_url(id)
Gitlab::ErrorTracking::Error.new(
id: id,
- first_seen: issue.fetch('firstSeen', nil),
- last_seen: issue.fetch('lastSeen', nil),
- title: issue.fetch('title', nil),
- type: issue.fetch('type', nil),
- user_count: issue.fetch('userCount', nil),
+ first_seen: issue.fetch("firstSeen", nil),
+ last_seen: issue.fetch("lastSeen", nil),
+ title: issue.fetch("title", nil),
+ type: issue.fetch("type", nil),
+ user_count: issue.fetch("userCount", nil),
count: count,
message: message,
- culprit: issue.fetch('culprit', nil),
+ culprit: issue.fetch("culprit", nil),
external_url: external_url,
- short_id: issue.fetch('shortId', nil),
- status: issue.fetch('status', nil),
+ short_id: issue.fetch("shortId", nil),
+ status: issue.fetch("status", nil),
frequency: frequency,
- project_id: project.fetch('id'),
- project_name: project.fetch('name', nil),
- project_slug: project.fetch('slug', nil)
+ project_id: project.fetch("id"),
+ project_name: project.fetch("name", nil),
+ project_slug: project.fetch("slug", nil)
)
end
def map_to_project(project)
- organization = project.fetch('organization')
+ organization = project.fetch("organization")
Gitlab::ErrorTracking::Project.new(
- id: project.fetch('id'),
- name: project.fetch('name'),
- slug: project.fetch('slug'),
- status: project.dig('status'),
- organization_name: organization.fetch('name'),
- organization_id: organization.fetch('id'),
- organization_slug: organization.fetch('slug')
+ id: project.fetch("id"),
+ name: project.fetch("name"),
+ slug: project.fetch("slug"),
+ status: project.dig("status"),
+ organization_name: organization.fetch("name"),
+ organization_id: organization.fetch("id"),
+ organization_slug: organization.fetch("slug")
)
end
end