Repository navigation
feat(mr): add inline comments and comment editing - #704
Conversation
There was a problem hiding this comment.
I reviewed the latest push and didn't find any new bugs. The follow-up commit addresses both points from my earlier review. The new edit and delete commands and the required API rollout still make a human look worthwhile.
What was reviewed:
- Comment confirmation now uses
sameCommentAnchor, which compares only the anchor fields the CLI sends. A nil anchor and an empty anchor now count as the same, so a plain conversation comment isn't reported as a failure after it posts. mr diff --jsonnow emitsanchorBaseOidonly when--commitisn't set, and diff_test.go checks that it's absent in--commitmode.- Checked the
edit-comment/delete-commentflow (authenticate first, then the optional--idownership and not-deleted check throughrequireComment) and the anchor flag validation before any API call.
Extended reasoning...
The change adds a new pkg/cmd/mr/comments.go (inline-anchored comments, plus edit-comment and delete-comment subcommands), an anchorBaseOid field in mr diff JSON, and an optional can_edit proto field with a regenerated pb.go. The security-sensitive part is limited to comment mutation by ID. Those calls authenticate first, and the server enforces ownership; the client-side MR check runs only when --id is passed. Commit b89362d fixes both earlier inline findings. Approval isn't given because the change adds new mutating commands that rely on a coordinated API deployment, and the pb.go diff is large.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b89362d. Configure here.
Risk: medium. Dismissed this automation's prior approval because Cursor Bugbot reported 1 unresolved finding that needs human attention. Human review is needed and no reviewers were assigned.
There was a problem hiding this comment.
Note
🤖 Cursor Grok 4.6 responding on behalf of Jacob Gillespie
Risk: medium. Approved. Cursor Bugbot was skipped on the current head and its earlier finding is resolved, so this merge-request comments change stays within the approval threshold.
Sent by Cursor Approval Agent: Pull Request Router and Approver



Merge request reviewers can read inline discussions through the CLI but cannot create inline comments or edit their own comments. Extend
depot mr commentwith MR ID selection and inline line/range anchors, and addmr edit-commentandmr delete-comment. Existing branch-based comments and body/file/stdin input continue to work.Inline comments require the reviewed head and stored base commit IDs so a changed diff is refused rather than receiving a misplaced comment.
mr diff --jsonexposesanchorBaseOidseparately from its comparison base, and comment JSON carries the API's optionalcanEditfield.Rollout: deploy https://github.com/depot/api/pull/7060 before releasing this CLI. Comment mutations use existing API methods.
Validation:
go test ./..., focused MR tests on CI's Go 1.26.10, build, module verification, and golangci-lint passed. A live smoke test created, edited, and deleted comments on a disposable closed MR, posted an inline range, and verified stale head/base rejection; temporary comments were deleted.Created with Codex in T3 Code.
Catch up on this pull request in Depot
Note
Medium Risk
Introduces comment create/edit/delete paths tied to revision OIDs and ownership; mistakes could post stale inline anchors or mutate the wrong comment without the new guards and API checks.
Overview
Extends
depot mr commentso reviewers can post conversation or inline comments on an open MR (by branch or--idwithout a checkout). Inline mode requires--path,--side,--line,--head-oid, and--base-oid(optional line range via--start-line), with local validation before any API call and confirmation that the server echoed the requested anchor.Adds
mr edit-commentandmr delete-commentfor the caller’s own comments, with optional--idto verify the comment belongs to that MR before update/delete.mr diff --jsonnow includesanchorBaseOid(the MR’s stored base OID for anchoring) alongside the comparisonbaseOid, omitted when diffing a specific--commit.Proto/client types gain optional
can_editon merge request comments. The prior minimalcommentimplementation is removed frommr.goin favor of the newcomments.gomodule and tests.Reviewed by Cursor Bugbot for commit b89362d. Bugbot is set up for automated code reviews on this repo. Configure here.