Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4eab3cdb1517ad95547d1307d7080ccf820e89b6
https://github.com/WebKit/WebKit/commit/4eab3cdb1517ad95547d1307d7080ccf820e89b6
Author: Andres Gonzalez <[email protected]>
Date: 2026-04-28 (Tue, 28 Apr 2026)
Changed paths:
M Tools/Scripts/libraries/webkitscmpy/webkitscmpy/remote/git_hub.py
Log Message:
-----------
[git-webkit review] Inline comments sometimes missing from the review text
file
https://bugs.webkit.org/show_bug.cgi?id=313572
Reviewed by Jonathan Bedard.
Problem:
`git-webkit review` relies on the `position` field returned by GitHub's
pull request comments API to place each inline comment in the generated
review text file. GitHub computes `position` against its own view of the
pull request diff, but the diff we fetch via `application/vnd.github.diff`
is computed against the merge base and can have a different hunk layout
(e.g. a hunk that has already landed on main is absent from our diff).
When GitHub's `position` lands outside the range of lines in the diff we
fetched, the count in `insert_diff_comments` never matches and the
comment is silently dropped — it never appears in the review text file.
Solution:
Translate comment locations ourselves using the `line` / `original_line`
field (the new-file line number the comment applies to), which is
unambiguous regardless of which diff was used to compute it. A new
`_line_to_position_map` helper walks the diff we actually fetched,
parses `@@ -a,b +c,d @@` hunk headers, and records the position within
our diff for each new-file line. `_diff_comments` now uses that map to
assign each comment a position that matches the diff being displayed,
falling back to the raw `position` field only when no line number is
reported (preserves behavior for file-level comments and legacy/mock
data used by the existing tests).
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/remote/git_hub.py:
Canonical link: https://commits.webkit.org/312247@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications