-
-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Context
PR #293 added the mr:diff, mr:files, mr:status, and mr:logs commands. All of them require mr-iid as a positional argument. In practice, most issues have only one open MR, making the argument redundant noise.
Proposed behaviour
- Zero MRs — exit with a clear error message.
- One open MR — use it automatically (no argument needed).
- Multiple open MRs — in interactive mode, present a choice prompt (same pattern as
issue:checkoutbranch selection); in non-interactive mode, list the available IIDs and exit with an error asking the user to specify one.
Implementation notes
MrCommandBase::initialize()already resolves the issue NID and has access to$this->clientand aGitLabClient. It can callListMergeRequestsActionto fetch open MRs whenmr-iidis not supplied.mr-iidmust stayInputArgument::OPTIONAL(Symfony disallows a required argument after an optionalnid), so the runtime validation ininitialize()is the right place to add the auto-selection logic.- The interactive prompt should use
ChoiceQuestionon$mr->iid — $mr->title, consistent with theissue:checkoutpattern.
Follow-up to
PR #293
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels