feat(mr note create): add --reply flag and refactor to options struct

Follow-up to !3099 (merged).

What

  1. Refactor glab mr note create to follow the project's Commands convention: move CLI state into an unexported createOptions struct with an io field from the factory, and split the cobra RunE into complete / validate / run methods.

    Addresses review feedback from !3099 (merged)#note_3240051394.

  2. Add --reply flag to glab mr note create for replying to an existing discussion thread. The value is a full discussion ID or a unique prefix of at least 8 characters, resolved via mrutils.ResolveDiscussionID.

    --reply and --unique are mutually exclusive: --unique scans top-level discussion notes for duplicates, which doesn't make sense when targeting a specific thread.

Usage

# Reply by full discussion ID
glab mr note create 123 --reply abc12345deadbeef1234567890abcdef12345678 -m "I agree!"

# Reply by prefix (8+ chars)
glab mr note create 123 --reply abc12345 -m "thanks"

Commits

  1. refactor(mr note create): use options struct with complete/validate/run
  2. feat(mr note create): add --reply flag

Manual testing

# Build from branch
git checkout tv/2026-04/mr-note-reply && make build

# Post a reply to an existing discussion (use 8+ char prefix of the discussion ID)
./bin/glab mr note create 3155 --reply 0c56c3d2 -m "test reply" -R gitlab-org/cli

Merge request reports

Loading