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

feat: allow reuse of glab in other CLI contexts #845

Merged
merged 3 commits into from
Sep 27, 2021

Conversation

addshore
Copy link
Contributor

Description
Moves glinstance into pkg for use by other projects.
Uses OverridableDefault hostname in auth login command.

Related Issue
Resolves #843

How Has This Been Tested?

  • Tested the build which still works.
  • Tested the code change included in the mwcli.

Screenshots (if appropriate):

Usage in the other CLI can be found in https://phabricator.wikimedia.org/T288373#7376987
Code change for the other CLI can be found at https://gitlab.wikimedia.org/releng/cli/-/merge_requests/47

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)

commands/auth/login/login.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 26, 2021

Codecov Report

Merging #845 (d5b819b) into trunk (c608850) will increase coverage by 0.00%.
The diff coverage is 66.66%.

Impacted file tree graph

@@           Coverage Diff           @@
##            trunk     #845   +/-   ##
=======================================
  Coverage   59.41%   59.42%           
=======================================
  Files          93       93           
  Lines        7365     7366    +1     
=======================================
+ Hits         4376     4377    +1     
  Misses       2607     2607           
  Partials      382      382           
Impacted Files Coverage Δ
cmd/glab/main.go 44.76% <ø> (ø)
commands/api/api.go 76.08% <ø> (ø)
commands/auth/status/status.go 91.86% <ø> (ø)
commands/cmdutils/factory.go 0.00% <ø> (ø)
commands/cmdutils/remote_resolver.go 58.33% <ø> (ø)
commands/config/config.go 39.02% <ø> (ø)
commands/project/clone/repo_clone.go 63.57% <ø> (ø)
internal/config/config_type.go 69.45% <ø> (ø)
internal/glrepo/repo.go 85.12% <ø> (ø)
pkg/glinstance/host.go 92.45% <ø> (ø)
... and 1 more

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 c608850...d5b819b. Read the comment docs.

@profclems profclems merged commit ae6568e into profclems:trunk Sep 27, 2021
@addshore addshore deleted the mwcli-modifications branch October 3, 2021 19:42
@addshore
Copy link
Contributor Author

addshore commented Oct 3, 2021

Thanks!
I'll add this to the CLI fully for the next release and upstream any other tweaks that might make sense for this kind of usecase!

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.

Refactor to enable packaging glab inside another golang CLI tool (overriding config location)
2 participants