Commit 6fafb9b4 authored by Sean Arnold's avatar Sean Arnold

Use join for finding SentryIssues

- Also add index to sentry_issue_identifier
- Rename fetch to perform in error tracking services
parent e9c06d39
......@@ -7,7 +7,7 @@ module ErrorTracking
return unauthorized if unauthorized
begin
response = fetch
response = perform
rescue Sentry::Client::Error => e
return error(e.message, :bad_request)
rescue Sentry::Client::MissingKeysError => e
......@@ -22,7 +22,7 @@ module ErrorTracking
private
def fetch
def perform
raise NotImplementedError,
"#{self.class} does not implement #{__method__}"
end
......
......@@ -4,7 +4,7 @@ module ErrorTracking
class IssueDetailsService < ErrorTracking::BaseService
private
def fetch
def perform
project_error_tracking_setting.issue_details(issue_id: params[:issue_id])
end
......
......@@ -4,7 +4,7 @@ module ErrorTracking
class IssueLatestEventService < ErrorTracking::BaseService
private
def fetch
def perform
project_error_tracking_setting.issue_latest_event(issue_id: params[:issue_id])
end
......
......@@ -12,7 +12,7 @@ module ErrorTracking
private
def fetch
def perform
project_error_tracking_setting.list_sentry_issues(
issue_status: issue_status,
limit: limit,
......
......@@ -12,7 +12,7 @@ module ErrorTracking
private
def fetch
def perform
project_error_tracking_setting.list_sentry_projects
end
......
......@@ -37,16 +37,4 @@ describe SentryIssue do
it { is_expected.to eq(sentry_issue) }
end
describe 'scopes' do
describe 'for_identifier' do
let!(:sentry_issue) { create(:sentry_issue) }
let(:identifier) { sentry_issue.sentry_issue_identifier }
let!(:second_sentry_issue) { create(:sentry_issue) }
subject { described_class.for_identifier(identifier) }
it { is_expected.to eq(sentry_issue) }
end
end
end
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