Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use sentry not raven #286

Merged
merged 2 commits into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -491,4 +491,4 @@ DEPENDENCIES
uglifier (>= 1.3.0)

BUNDLED WITH
2.1.4
2.2.24
2 changes: 1 addition & 1 deletion app/controllers/incoming_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def verify_signature(payload)

return if Rack::Utils.secure_compare(signature, request.env['HTTP_X_HUB_SIGNATURE'])

Raven.capture_message('Invalid webhook signature')
Sentry.capture_message('Invalid webhook signature')
halt 500, 'invalid signature'
end
end
4 changes: 2 additions & 2 deletions app/lib/github_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ def initialize(payload, type)
# Ignore events which are triggered by the bot
return if payload.dig('sender', 'id').to_i == 53_702_691

Raven.capture_message("Got github event for pr #{payload['number']}", extra: { payload: payload })
Sentry.capture_message("Got github event for pr #{payload['number']}", extra: { payload: payload })

@processor = GithubEvent::PullRequest.new(payload) if Repository.notably? payload['repository']['name']
when *known_but_ignoreable_events
true
else
Raven.capture_message("Unknown Hook Received: #{type}", extra: payload)
Sentry.capture_message("Unknown Hook Received: #{type}", extra: payload)
end
end
end
4 changes: 2 additions & 2 deletions app/lib/travis_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TravisEvent
# the next steps. If not kick off a Sentry error.

def initialize(payload)
Raven.capture_message('Unknown Travis Event Received', extra: payload)
Sentry.capture_message('Unknown Travis Event Received', extra: payload)
# case payload['type']
# when 'push'
# TravisEvent::Push.new(payload)
Expand All @@ -23,7 +23,7 @@ def initialize(payload)
# when 'api'
# TravisEvent::Push.new(payload)
# else
# Raven.capture_message("Unknown Hook Received: #{payload['type']}", extra: payload)
# Sentry.capture_message("Unknown Hook Received: #{payload['type']}", extra: payload)
# end
end
end
14 changes: 7 additions & 7 deletions app/models/pull_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def self.update_with_github(gh_pull_request)
statuses = Github.client.combined_status(repo_id, gh_pull_request['head']['sha'])
statuses['state']
rescue StandardError => e
Raven.capture_message('validate status', extra: { trace: e.backtrace, error: e.inspect, github_data: gh_pull_request.to_h })
Sentry.capture_message('validate status', extra: { trace: e.backtrace, error: e.inspect, github_data: gh_pull_request.to_h })
nil
end
pull_request.number = gh_pull_request['number']
Expand Down Expand Up @@ -91,7 +91,7 @@ def ensure_label_is_attached(label)

response = Github.client.add_labels_to_an_issue(gh_repository_id, number, [label.name])

Raven.capture_message('Attached a label to an issue', extra: { label: label, repo: repository.github_url, title: title })
Sentry.capture_message('Attached a label to an issue', extra: { label: label, repo: repository.github_url, title: title })
response
end

Expand All @@ -101,7 +101,7 @@ def ensure_label_is_attached(label)
def ensure_label_is_detached(label)
response = Github.client.remove_label(gh_repository_id, number, label.name)

Raven.capture_message('Detached a label from an issue', extra: { label: label, repo: repository.github_url, title: title })
Sentry.capture_message('Detached a label from an issue', extra: { label: label, repo: repository.github_url, title: title })
response
rescue Octokit::NotFound
true
Expand Down Expand Up @@ -138,7 +138,7 @@ def add_comment(text)
nil
end

Raven.capture_message('Added a comment', extra: { text: text, repo: repository.github_url, title: title, request: req })
Sentry.capture_message('Added a comment', extra: { text: text, repo: repository.github_url, title: title, request: req })
Github.client.add_comment(gh_repository_id, number, text)
end

Expand Down Expand Up @@ -228,14 +228,14 @@ def validate_status
update(eligible_for_ci_comment: true)
when 'pending'
RefreshPullRequestWorker.perform_in(5.minutes.from_now, repository.name, number)
Raven.capture_message('pending PR status', extra: { state: state, status: status, repo: repository.github_url, title: title })
Sentry.capture_message('pending PR status', extra: { state: state, status: status, repo: repository.github_url, title: title })
true
when nil
# it's not really clear if the status is ever nil. if so, we should log it to decide if we need to act here
Raven.capture_message('nil PR status', extra: { state: state, status: status, repo: repository.github_url, title: title })
Sentry.capture_message('nil PR status', extra: { state: state, status: status, repo: repository.github_url, title: title })
return false
else
Raven.capture_message('Unknown PR state /o\\', extra: { state: state, status: status, repo: repository.github_url, title: title })
Sentry.capture_message('Unknown PR state /o\\', extra: { state: state, status: status, repo: repository.github_url, title: title })
end

true
Expand Down
16 changes: 8 additions & 8 deletions app/models/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ def ensure_label_exists(label)
rescue Octokit::NotFound
Github.client.add_label(github_id, label.name, label.color)

Raven.capture_message('Attached a label to an repository',
extra: { label_color: label.color,
label_name: label.name,
repo: github_id })
Sentry.capture_message('Attached a label to an repository',
extra: { label_color: label.color,
label_name: label.name,
repo: github_id })
end

##
Expand All @@ -63,10 +63,10 @@ def ensure_label_exists(label)
def ensure_label_missing(label)
Github.client.delete_label!(github_id, label.name)

Raven.capture_message('Detached a label from an repository',
extra: { label_color: label.color,
label_name: label.name,
repo: github_id })
Sentry.capture_message('Detached a label from an repository',
extra: { label_color: label.color,
label_name: label.name,
repo: github_id })
rescue Octokit::NotFound
true
end
Expand Down
2 changes: 1 addition & 1 deletion app/workers/validate_pull_request_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def self.perform_async(id)
# use tally. the arrays can contain strings and ints. we cannot call sort on heterogenous arrays
# see also https://twitter.com/BastelsBlog/status/1311421975827546112
if (job.args.tally.to_a - this_args).empty? && (job.item['class'] == name)
Raven.capture_message('Duplicate Job, discarding', extra: { id: id, worker: name })
Sentry.capture_message('Duplicate Job, discarding', extra: { id: id, worker: name })
return false
end
end
Expand Down