Skip to content

Commit

Permalink
Ignore failed pull request comments
Browse files Browse the repository at this point in the history
The diff output of the local git version and Github is not always consistent
especially in areas where file renames happened,  Github tends to recognize
these better, leading to messages we can't post because they diff position is
non-existent on Github.
  • Loading branch information
jhass committed Sep 6, 2015
1 parent e5920ca commit db32f62
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/pronto/formatter/github_pull_request_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ def create_comment(client, sha, body, path, position)
comments = client.pull_comments(sha)
existing = comments.any? { |c| comment == c }
client.create_pull_comment(comment) unless existing
rescue Octokit::UnprocessableEntity
# The diff output of the local git version and Github is not always
# consistent, especially in areas where file renames happened, Github
# tends to recognize these better, leading to messages we can't post
# because they diff position is non-existent on Github.
# Ignore such occasions and continue posting other messages.
end
end
end
Expand Down

0 comments on commit db32f62

Please sign in to comment.