Skip to content

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

Clement Sam requested to merge feat-issue-url-arg into trunk

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)

Merge request reports