Add review comment commands - #1163
Merged
Merged
Conversation
Collaborator
Author
|
This change is part of the following stack:
Change managed by git-spice. |
ed-irl
force-pushed
the
branch-comment-commands
branch
from
June 2, 2026 18:58
75c2b68 to
bed2fb1
Compare
This was referenced Jun 2, 2026
ed-irl
force-pushed
the
branch-comment-commands
branch
from
June 2, 2026 20:17
bed2fb1 to
55e79ed
Compare
ed-irl
force-pushed
the
branch-comment-commands
branch
from
June 2, 2026 22:33
c1b7235 to
631867a
Compare
ed-irl
force-pushed
the
branch-comment-commands
branch
from
June 8, 2026 10:18
cc6ba9a to
a4057f6
Compare
ed-irl
force-pushed
the
branch-comment-commands
branch
from
June 12, 2026 20:07
fa75bd3 to
b8b5295
Compare
ed-irl
force-pushed
the
branch-comment-commands
branch
from
June 13, 2026 13:39
b8b5295 to
6f87470
Compare
ed-irl
force-pushed
the
branch-comment-commands
branch
from
June 15, 2026 09:52
6f87470 to
f6588c8
Compare
ed-irl
force-pushed
the
branch-comment-commands
branch
from
June 19, 2026 01:03
7170265 to
f86efce
Compare
ed-irl
force-pushed
the
branch-comment-commands
branch
from
June 24, 2026 01:32
f86efce to
112367a
Compare
abhinav
added a commit
that referenced
this pull request
Aug 30, 2026
ShamHub review threads record the change head in `ReviewThread.CommitHash`. When that revision differs from the current head, compare the two revisions and mark a right-side thread outdated only when the later patch deletes a line in its inclusive range. Insertions alone do not stale an anchor. File-level and left-side threads retain their stored state because their recorded coordinates do not identify a comparable source range. Explicitly seeded outdated state still takes precedence, and diff or parsing failures propagate to the caller. This builds on the review patch queries from #1162. The user-facing staleness script is included with the commands in #1163. --------- Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
abhinav
force-pushed
the
branch-comment-commands
branch
3 times, most recently
from
August 30, 2026 22:25
8b8bb59 to
31f7350
Compare
abhinav
force-pushed
the
branch-comment-commands
branch
from
September 1, 2026 00:43
b2ea4cb to
7e2fa8c
Compare
This was referenced Sep 1, 2026
Store single-line review comments by branch so branch comment commands can assemble, edit, and submit a review across invocations. Local integer IDs address drafts before the forge assigns review thread and comment IDs. The persisted shape intentionally retains the original single-line anchor contract. File-level and line-range staging remain a separate design decision.
Add `gs branch comment` for posting and managing review feedback. The command group can list remote threads, stage and batch comments into a review, reply to or edit comments, and resolve threads. Forge IDs are opaque values rather than strings. Recover IDs from `ReviewRepository.ListReviewThreads` before reply, edit, or resolution operations.
Exercise `gs branch comment` workflows against ShamHub. The scripts keep command parsing, staged state, diff mapping, and forge operations inside one end-to-end boundary. They cover immediate and staged submission, listing and JSON output, staged editing, and review-thread discovery.
Exercise the user-visible outdated status after a later ShamHub revision deletes one anchored line while preserving another. Cover both the human-readable list and extension-facing JSON output.
Branch comment locations are coordinates in the selected branch postimage. Check single-line anchors against `reviewdiff.Patch` before submission, retain the requested path and line, and submit them on the right side of the review diff. This removes the working-tree mapping and textual side conversion from immediate and staged submission. Staged state remains single-line; file and range staging are deferred to their own contract.
Move review-comment management from gs branch comment to the top-level gs review namespace. Comments and replies now default to local drafts and use --no-draft for immediate posting. Publish sends drafts as one review, while list, edit, resolve, and reopen expose the remaining workflows with numeric draft references. Keep the draft default fixed and retain the existing ID lifecycle. Persistent allocation, deletion, configurable defaults, and staged file or range anchors remain separate review units.
`gs branch comment add` now accepts a file, an inclusive `file:start-end` range, or `--pr` for an unanchored review body. Single-line `file:line` anchors remain supported. `--pr` uses `SubmitReviewRequest.Body`. Because `ListReviewThreads` does not return review bodies, PR-level comments do not appear in `gs branch comment list`.
Accept immediate review comments anchored to a whole file, one line, or an inclusive line range. Parse those forms into a typed review-thread range and check the complete anchor against the selected branch patch before submission. Drop `--pr` because review bodies are not returned by `ListReviewThreads` and overlap ordinary change comments. Staged comments retain their existing single-line syntax until their persistence and lifetime contracts are decided.
`gs branch comment list --json` now includes `scope`, `side`, `range`, `commitSHA`, `resolved`, and `stale` for editor integrations. Resolution and staleness are omitted when a forge returns `nil` for unsupported state. The existing `status` field remains for compatibility.
Compare complete deterministic JSON records for inclusive ranges and file-level threads instead of matching fragments of serialized output. A focused conversion test also preserves omission of resolution, staleness, commit, and timestamp fields when the forge does not expose them.
abhinav
force-pushed
the
branch-comment-commands
branch
from
September 6, 2026 01:50
7e2fa8c to
6a7577e
Compare
This was referenced Sep 6, 2026
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.
Add
gs reviewcommands for posting and managing review feedback.The command group lists remote review threads, posts immediate comments, stages and edits local comments, submits staged comments as one review, edits remote comments, and resolves or unresolves threads.
Staged comments persist by branch until submission. Commands use the optional
ReviewRepositoryinterfaces, recover forge-owned opaque identifiers fromListReviewThreads, and check new comment coordinates againstreviewdiff.Patchbefore submission.