gln/out-of-diff-comment-anchoring-zrxz - #413
Merged
Merged
Conversation
Comments anchored to lines outside the diff hunks are rejected by every public GitHub API path (422 "Line could not be resolved" on REST review batches, standalone comments and GraphQL thread creation — verified by probing), while GitHub's web UI anchors them exactly via an internal endpoint. Pulldash therefore must keep snapping to the nearest diff line, but the moved-comment note now links the original lines at the target commit so readers can navigate to where the comment belongs.
…ange permalinks GitHub's API rejects out-of-diff line anchors in every path, so instead of snapping those comments to the nearest diff line they now go out as standalone file-level review comments (subject_type: file). The body carries a hidden marker with the real position (line/start_line/side) plus a blob permalink that GitHub renders as an embedded code snippet. In pulldash, the marker re-anchors the comment (and its replies) to the exact range while that commit is being viewed, so it reads as a comment made on the chosen code. Drafts on out-of-diff lines skip the doomed pending-review sync, and the group marker for multi-commit sessions always lands on a line comment.
If the GraphQL review submitted but a standalone file-level comment post failed, the error was swallowed and clearReviewState wiped the still -unposted draft. The posting now runs as a single post-submit step (also reached by the dedup branches on retry), strips each pending comment as it lands, and throws before the refetch so drafts survive retries. The pending-review recovery loop only matches line comments, since file-level ones cannot exist in a pending review.
File-level comments (out-of-diff lines) rendered with L=null and no code context. The position marker now carries the anchor commit, and the thread synthesizes an all-context hunk from the file content at that commit (base version for LEFT-side markers) covering exactly the marked range, so the overview shows the referenced range with syntax highlighting like a normal diff comment. The header link targets the real line, and the blob permalink (only there for GitHub's embedded snippet) is stripped from pulldash's rendered body.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
7118a273feat: render out-of-diff threads with real code context in the overviewFile-level comments (out-of-diff lines) rendered with L=null and no code
context. The position marker now carries the anchor commit, and the
thread synthesizes an all-context hunk from the file content at that
commit (base version for LEFT-side markers) covering exactly the marked
range, so the overview shows the referenced range with syntax
highlighting like a normal diff comment. The header link targets the
real line, and the blob permalink (only there for GitHub's embedded
snippet) is stripped from pulldash's rendered body.
38517fcafix: keep out-of-diff drafts on failed standalone postsIf the GraphQL review submitted but a standalone file-level comment post
failed, the error was swallowed and clearReviewState wiped the still
-unposted draft. The posting now runs as a single post-submit step (also
reached by the dedup branches on retry), strips each pending comment as
it lands, and throws before the refetch so drafts survive retries. The
pending-review recovery loop only matches line comments, since
file-level ones cannot exist in a pending review.
e4a3adcffeat: submit out-of-diff comments as file-level comments with exact-range permalinksGitHub's API rejects out-of-diff line anchors in every path, so instead
of snapping those comments to the nearest diff line they now go out as
standalone file-level review comments (subject_type: file). The body
carries a hidden marker with the real position (line/start_line/side)
plus a blob permalink that GitHub renders as an embedded code snippet.
In pulldash, the marker re-anchors the comment (and its replies) to the
exact range while that commit is being viewed, so it reads as a comment
made on the chosen code. Drafts on out-of-diff lines skip the doomed
pending-review sync, and the group marker for multi-commit sessions
always lands on a line comment.
1ccca9f0fix: link exact lines in moved-comment notesComments anchored to lines outside the diff hunks are rejected by every
public GitHub API path (422 "Line could not be resolved" on REST review
batches, standalone comments and GraphQL thread creation — verified by
probing), while GitHub's web UI anchors them exactly via an internal
endpoint. Pulldash therefore must keep snapping to the nearest diff
line, but the moved-comment note now links the original lines at the
target commit so readers can navigate to where the comment belongs.