Skip to content

fix: glab mr view prompt disabled if NO_PROMPT is set with multiple mr

Daniel Helfand requested to merge gitlab-community/cli:7638 into main

Description

Fixes #7638 (closed)

This pull request changes glab mr review to not prompt a user to enter select a mr if NO_PROMPT environment var is set. This issue occurs when a merge request is opened to multiple branches. The changes in this merge request change the behavior of the command to error out with the following message if this scenario occurs when NO_PROMPT is set:

../cli/bin/glab mr view
you must select a merge request: include a merge request ID number from list below to glab mr view command to resolve issue

!4 (test) by @dhelfand
!3 (test) by @dhelfand

How has this been tested?

I tested this pull request against this repository and targeting the test branch. I also edited unit tests to include new promptEnabled requirement. If there is a good way to test this e2e or via unit tests, please let me know and would love to implement those.

Screenshots (if appropriate):

Screenshot_2024-09-12_at_2.52.27_PM

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap
Edited by Daniel Helfand

Merge request reports

Loading