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

feat(command/issue): allow issue URL as argument #546

Merged
merged 26 commits into from
Jan 10, 2021
Merged

Conversation

profclems
Copy link
Owner

@profclems profclems commented Jan 9, 2021

Description

This PR enables issue URL to be passed as argument.

The user can now specify an issue by either the ID or URL.

Supports:

  • HOST/OWNER/REPO/issues/ID
  • HOST/GROUP/NAMESPACE/issues/ID
  • HOST/OWNER/REPO/-/issues/ID
  • HOST/GROUP/NAMESPACE/-/issues/ID

eg:

  • glab issue close https://gitlab.com/profclems/glab/issues/277
  • glab issue close 277
  • glab issue close https://gitlab.com/profclems/glab/-/issues/277
  • glab issue close https://salsa.debian.org/GROUP/NAMESPACE/REPO/issues/123

Also adds support for IDs prefixed with '#'

  • glab issue reopen "#277"

Related Issue

None

How Has This Been Tested?

Manually tested on gitlab.com/profclems/glab, private group repo and a few repos on salsa.debian.org

TODO: add unit tests

Screenshots (if appropriate):

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)

@profclems profclems added cmd: issue Related to issues management enhancement New feature or request labels Jan 9, 2021
@profclems
Copy link
Owner Author

I will fix the tests early in the morning... Gotta have some rest

@codecov
Copy link

codecov bot commented Jan 10, 2021

Codecov Report

Merging #546 (c177751) into trunk (54324ab) will decrease coverage by 0.46%.
The diff coverage is 55.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            trunk     #546      +/-   ##
==========================================
- Coverage   60.88%   60.41%   -0.47%     
==========================================
  Files          86       86              
  Lines        5913     5965      +52     
==========================================
+ Hits         3600     3604       +4     
- Misses       1979     2015      +36     
- Partials      334      346      +12     
Impacted Files Coverage Δ
commands/mr/list/mr_list.go 63.77% <42.85%> (-9.85%) ⬇️
commands/issue/list/issue_list.go 64.70% <45.28%> (-20.48%) ⬇️
commands/issue/update/issue_update.go 50.00% <75.00%> (-0.49%) ⬇️
commands/issue/close/issue_close.go 83.33% <100.00%> (-1.29%) ⬇️
commands/issue/delete/issue_delete.go 81.81% <100.00%> (-1.52%) ⬇️
commands/issue/note/issue_note_create.go 93.75% <100.00%> (+4.86%) ⬆️
commands/issue/subscribe/issue_subscribe.go 81.81% <100.00%> (-2.80%) ⬇️
commands/issue/unsubscribe/issue_unsubscribe.go 81.81% <100.00%> (-2.80%) ⬇️
commands/issue/view/issue_view.go 84.61% <100.00%> (+1.00%) ⬆️
commands/mr/mrutils/mrutils.go 74.61% <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 54324ab...c177751. Read the comment docs.

@profclems profclems merged commit 2ff41de into trunk Jan 10, 2021
@profclems profclems deleted the feat-issue-url-arg branch January 10, 2021 01:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cmd: issue Related to issues management enhancement New feature or request size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants