diff --git a/app/models/pull_request.rb b/app/models/pull_request.rb index ce75359d..7469cd9c 100644 --- a/app/models/pull_request.rb +++ b/app/models/pull_request.rb @@ -96,11 +96,15 @@ def ensure_label_is_detached(label) ## # Add a comment with the given text def add_comment(text) + # TODO: why can request be nil and what is request req = begin request rescue StandardError nil end + # Only attach a comment if eligible_for_comment is true (The first iteration after the mergeable state changed to false) + return unless eligible_for_comment + Raven.capture_message('Added a comment', extra: { text: text, repo: repository.github_url,