Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

feat mr: remove prefix in ID of MR just like Issue #790

Merged
merged 1 commit into from
Jul 14, 2021

Conversation

atusy
Copy link
Contributor

@atusy atusy commented Jul 13, 2021

This change

  • improves consistency of APIs.
  • is copied from:
    issueIID, err = strconv.Atoi(strings.TrimPrefix(arg, "#"))
  • makes pipes easier
    • e.g., glab mr list | fzf | grep -oE "^\S+" | glab mr view
    • this is what atusy/gh-fzf internally does

Description

This change adds support for a prefix in MR ID like below.

glab mr view \!1

Related Issue

Resolves #789

How Has This Been Tested?

Run below on manjaro linux.

glab repo clone gitlab-org/gitlab-foss -- --depth 1
glab mr view "\!1"

Screenshots (if appropriate):

image

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)

This change

- improves consistency of APIs.
- is copied from: https://github.com/profclems/glab/blob/0232a0c0791374ef5c1fa2072582a7127126b078/commands/issue/issueutils/utils.go#L106
- makes pipes easier
    - e.g., `glab mr list | fzf | grep -oE "^\S+" | glab mr view`
    - this is what atusy/ghf internally does

Finishes profclems#789
@codecov
Copy link

codecov bot commented Jul 14, 2021

Codecov Report

Merging #790 (5ec0110) into trunk (0232a0c) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##            trunk     #790   +/-   ##
=======================================
  Coverage   59.41%   59.41%           
=======================================
  Files          93       93           
  Lines        7341     7341           
=======================================
  Hits         4362     4362           
  Misses       2599     2599           
  Partials      380      380           
Impacted Files Coverage Δ
commands/mr/mrutils/mrutils.go 66.46% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0232a0c...5ec0110. Read the comment docs.

Copy link
Collaborator

@zemzale zemzale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Since this function is used for MRsFromArgs too, there ain't gonna be a problem with providing multiple MRs too

Copy link
Owner

@profclems profclems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@atusy, thanks a lot for working on this.

@profclems profclems merged commit f7c7d6e into profclems:trunk Jul 14, 2021
@atusy
Copy link
Contributor Author

atusy commented Jul 14, 2021

@profclems @zemzale Thank you, too!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Let glab mr support prefix in MR ID
3 participants