Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit 30e3f84

Browse files
committed
return true when pull request commenting is enabled and a comment already exists
Trello: https://trello.com/c/npDQ4rN3/103-record-response-from-sending-commit-status-instead-of-adding-comment-when-both-commit-status-and-comment-are-on fixes: #57 (diff) GithubPullRequests were mistakenly returning a false success code in the common case where a comment is already present on the pull request being updated. We should return a success instead.
1 parent 5c2bd01 commit 30e3f84

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/cc/services/github_pull_requests.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def add_comment
110110
end
111111
else
112112
@response = {
113-
ok: false,
113+
ok: true,
114114
message: "Comment already present"
115115
}
116116
end

test/github_pull_requests_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def test_pull_request_comment_already_present
177177
state: "success",
178178
})
179179

180-
assert_equal({ ok: false, message: "Comment already present" }, response)
180+
assert_equal({ ok: true, message: "Comment already present" }, response)
181181
end
182182

183183
def test_pull_request_unknown_state

0 commit comments

Comments
 (0)