Loading
feat(mr): add --draft flag for pending review comments
Description
Adds a --draft flag to glab mr note create that creates the comment as a pending review comment (API: draft note) instead of publishing it immediately. Pending comments are visible only to the author until the review is published.
Publishing the review lands separately in !3909 (stacked on this branch), so this MR merges on its own.
- Composes with
--file/--line/--old-linediff positions and with--replythread replies (draft notes acceptpositionandin_reply_to_discussion_idnatively). - Mutually exclusive with
--unique(deduplication only scans published notes) and rejected with--resolvable=false: a published draft always creates or continues a resolvable discussion — the draft-notes API'sresolve_discussionfield means "resolve the target thread when this publishes", not "create a non-resolvable note". - Success output prints only the draft note ID (machine-readable): no
#note_anchor exists before the review is published, and the ID is the input to the publish step.
How has this been tested?
Test_cmdCreate_draftsubtests (plain, diff position, reply prefix resolution, both flag conflicts, wrapped API error) using the existinggitlabtestingmocks; fullinternal/commands/mr/notepackage passes.- Live smoke test against a local GDK instance: created pending comments with
--draft(bare and--file/--line), confirmed via the draft-notes API that they stay pending and author-only, and published the review to confirm the created drafts land as discussion notes. make gen-docsregenerateddocs/source/mr/note/create.mdwith no other drift;golangci-lintandmarkdownlint-cli2clean.
Edited by Andrei Zubov