Comments (3)
I'm intrigued by the idea. A few questions jump to mind:
- Can you point to some of the users that are running into this issue?
- What opportunities would a user have to set this?
gh config set
? A prompt or flag ongh auth login
? - Presumably if there were no "default" host we would use our existing behaviour?
- Are there any gotchas you can think of, like installing of extensions?
Thanks!
from go-gh.
Links, some more relevant than others:
from go-gh.
- Can you point to some of the users that are running into this issue?
With v1.0.3
release of GitHub Copilot in the CLI, GitHub tenancy users are being advised to set GH_HOST
or use --hostname
for all usage because Copilot licensing is tied to the GitHub tenant.
Beyond that, I can only theorize GitHub Enterprise Server users with GitHub.com accounts using features like gh api
are impacted.
- What opportunities would a user have to set this?
gh config set
? A prompt or flag ongh auth login
?
I think introducing a new gh auth
command to select which existing authenticated host should be used for the default and adding a new field to the host configuration indicating the default.
Originally, I was considering gh config set
but the problem is keeping this in sync with authenticated hosts. Then when you logout of that authenticated host, gh
should revert to the native default host logic.
- Presumably if there were no "default" host we would use our existing behaviour?
Yes!
- Are there any gotchas you can think of, like installing of extensions?
This is a really good question and I actually wondered about this exact case! Reviewing the gh ext install
manual, it's clear this doesn't follow the same patterns we see in other commands with [HOST/]OWNER/REPO
format: 🤔
USAGE
gh extension install <repository> [flags]
FLAGS
--force force upgrade extension, or ignore if latest already installed
--pin string pin extension to a release tag or commit ref
INHERITED FLAGS
--help Show help for command
EXAMPLES
$ gh extension install owner/gh-extension
$ gh extension install https://git.example.com/owner/gh-extension
$ gh extension install .
Looking for commands that leverage RepoHost()
, I think anything that doesn't show up here is likely a good candidate of being impacted:
$ grep -rl "RepoHost()" pkg/cmd | sort | uniq
pkg/cmd/cache/delete/delete.go
pkg/cmd/cache/shared/shared.go
pkg/cmd/extension/command.go
pkg/cmd/extension/http.go
pkg/cmd/extension/manager.go
pkg/cmd/factory/default_test.go
pkg/cmd/issue/close/close.go
pkg/cmd/issue/create/create.go
pkg/cmd/issue/delete/delete.go
pkg/cmd/issue/develop/develop.go
pkg/cmd/issue/list/http.go
pkg/cmd/issue/list/list.go
pkg/cmd/issue/lock/lock.go
pkg/cmd/issue/pin/pin.go
pkg/cmd/issue/reopen/reopen.go
pkg/cmd/issue/shared/lookup.go
pkg/cmd/issue/status/status.go
pkg/cmd/issue/transfer/transfer.go
pkg/cmd/issue/unpin/unpin.go
pkg/cmd/issue/view/http.go
pkg/cmd/label/create.go
pkg/cmd/label/delete.go
pkg/cmd/label/http.go
pkg/cmd/pr/checkout/checkout.go
pkg/cmd/pr/checkout/checkout_test.go
pkg/cmd/pr/checks/checks.go
pkg/cmd/pr/close/close_test.go
pkg/cmd/pr/create/create.go
pkg/cmd/pr/diff/diff.go
pkg/cmd/pr/list/http.go
pkg/cmd/pr/merge/http.go
pkg/cmd/pr/shared/commentable.go
pkg/cmd/pr/shared/editable.go
pkg/cmd/pr/shared/editable_http.go
pkg/cmd/pr/shared/finder.go
pkg/cmd/pr/shared/params_test.go
pkg/cmd/pr/shared/templates.go
pkg/cmd/pr/status/http.go
pkg/cmd/pr/status/status.go
pkg/cmd/release/create/http.go
pkg/cmd/release/delete/delete.go
pkg/cmd/release/edit/http.go
pkg/cmd/release/list/http.go
pkg/cmd/release/shared/fetch.go
pkg/cmd/repo/archive/http.go
pkg/cmd/repo/clone/clone.go
pkg/cmd/repo/create/create.go
pkg/cmd/repo/credits/credits.go
pkg/cmd/repo/delete/http.go
pkg/cmd/repo/deploy-key/add/http.go
pkg/cmd/repo/deploy-key/delete/http.go
pkg/cmd/repo/deploy-key/list/http.go
pkg/cmd/repo/edit/edit.go
pkg/cmd/repo/fork/fork.go
pkg/cmd/repo/garden/http.go
pkg/cmd/repo/rename/rename.go
pkg/cmd/repo/setdefault/setdefault.go
pkg/cmd/repo/sync/http.go
pkg/cmd/repo/sync/sync.go
pkg/cmd/repo/unarchive/http.go
pkg/cmd/repo/view/http.go
pkg/cmd/ruleset/check/check.go
pkg/cmd/ruleset/shared/http.go
pkg/cmd/ruleset/view/http.go
pkg/cmd/run/cancel/cancel.go
pkg/cmd/run/delete/delete.go
pkg/cmd/run/rerun/rerun.go
pkg/cmd/run/shared/artifacts.go
pkg/cmd/run/shared/shared.go
pkg/cmd/run/view/view.go
pkg/cmd/secret/list/list.go
pkg/cmd/secret/set/http.go
pkg/cmd/secret/set/set.go
pkg/cmd/variable/list/list.go
pkg/cmd/variable/set/http.go
pkg/cmd/variable/set/set.go
pkg/cmd/workflow/disable/disable.go
pkg/cmd/workflow/enable/enable.go
pkg/cmd/workflow/run/run.go
pkg/cmd/workflow/shared/shared.go
from go-gh.
Related Issues (20)
- Support for stdin and stderr in term package
- GQLCLient should return GQLError for query and mutation methods
- Add a GraphQL Mutation with an `input` object to examples HOT 1
- Add pagination examples
- jsonpretty should not add new lines if not indenting
- TokenForHost "authentication token not found" message could be more informative HOT 3
- Feature Request: Add support to call the `gh` command interactively HOT 3
- RestClient no longer returns an HTTPError HOT 2
- Expose `ghLookupPath` or a better way to run `gh` HOT 3
- Issue while using from remote connection HOT 6
- `asciisanitizer.Sanitizer` mishandled the `�` unicode character HOT 1
- Add the ability to introduce repository specific configurations for gh-cli and its extensions HOT 2
- Create CODEOWNERS file ensuring the cli/code-reviewers are assigned to PRs
- CVE Vulnerability CVE-2023-3978 in dependency HOT 1
- hyperlink truncated at end of row isn't closed correctly HOT 2
- Use retryable HTTP client (for 50x) errors
- Rest client support for endpoint not returning a JSON HOT 3
- AlecAivazis/survey is archived HOT 3
- Support passing httptest URLs in api.ClientOptions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-gh.