Inconsistent behavior for comment.diff_hunk on pull_request_review_comment and pull_request_review_thread
#207708
Replies: 3 comments 1 reply
|
If it's not a bug, I would like to understand what triggers a |
|
From what I understand, It can be empty when GitHub can't provide the original diff context for that comment, for example when the underlying diff has changed, the comment is no longer directly associated with the current patch, or the event is generated from a thread state change rather than the original comment creation. So I wouldn't rely on |
|
Helloooo @psudo-dev, Yeahhhh, that's definitely weird behavior !!!! What ur describing:
This does sound like a bug because:
Suggestions:
Bottom line: Good catch on this inconsistency !!!! Best, |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
π·οΈ Discussion Type
Bug
π¬ Feature/Topic Area
Webhooks
Body
Context
When you make a review comment on a line, the
pull_request_review_commentevent payload includes adiff_hunkfield with the relevant diff context, which is the expected behavior.When comments are marked as
resolvedorunresolved, apull_request_review_threadevent is triggered. Itsthreadobject contains acommentsarray β the same comment objects that were previously dispatched viapull_request_review_comment.The Problem
The expected behavior would be for a
diff_hunkto always contain the diff context for any inline comment.But some inline comments come with an empty string in the
diff_hunkfield instead of the actual diff content. This happens across bothpull_request_review_commentand thecommentsarray insidepull_request_review_threadβ some comment events arrive with a populateddiff_hunkand others arrive with an empty string, even though all of them are comments made on a specific line of code.All reactions