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-line diff positions and with --reply thread replies (draft notes accept position and in_reply_to_discussion_id natively).
  • 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's resolve_discussion field 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_draft subtests (plain, diff position, reply prefix resolution, both flag conflicts, wrapped API error) using the existing gitlabtesting mocks; full internal/commands/mr/note package 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-docs regenerated docs/source/mr/note/create.md with no other drift; golangci-lint and markdownlint-cli2 clean.
Edited by Andrei Zubov

Merge request reports

Loading
Loading