-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Show host name in repo creation prompts #8664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@rajhawaldar : thank you for opening this PR and contributing to the GH CLI! ❤️ I built this branch locally for testing purposes, however it doesn't do exactly what I'd think based on the issue and my testing setup: cli/cli ‹show-host-name-in-repo-creation›$ make
go build -trimpath -ldflags "-X github.com/cli/cli/v2/internal/build.Date=2024-02-06 -X github.com/cli/cli/v2/internal/build.Version=v2.43.1-9-gf6dd5c4c " -o bin/gh ./cmd/gh
andyfeller@Andys-MacBook-Pro:cli/cli ‹show-host-name-in-repo-creation›$ ./bin/gh repo create
? What would you like to do? [Use arrows to move, type to filter]
> Create a new repository on github.com from scratch
Create a new repository on github.com from a template repository
Push an existing local repository to GitHub
cli/cli ‹show-host-name-in-repo-creation›$ gh auth switch
? What account do you want to switch to? andyfeller (ghe.io) - active
✓ Switched active account for ghe.io to andyfeller
cli/cli ‹show-host-name-in-repo-creation›$ gh auth status
github.com
✓ Logged in to github.com account andyfeller_volcano (keyring)
- Active account: true
- Git operations protocol: https
- Token: ************************************
✓ Logged in to github.com account andyfeller (keyring)
- Active account: false
- Git operations protocol: https
- Token: ************************************
ghe.io
✓ Logged in to ghe.io account andyfeller (keyring)
- Active account: true
- Git operations protocol: https
- Token: ************************************
cli/cli ‹show-host-name-in-repo-creation›$ ./bin/gh repo create
? What would you like to do? [Use arrows to move, type to filter]
> Create a new repository on github.com from scratch
Create a new repository on github.com from a template repository
Push an existing local repository to GitHubSince I switched hosts, I would have expected this to show $ GH_HOST=ghe.io ./bin/gh repo create
? What would you like to do? [Use arrows to move, type to filter]
> Create a new repository on ghe.io from scratch
Create a new repository on ghe.io from a template repository
Push an existing local repository to GitHub |
| "Create a new repository on GitHub from a template repository", | ||
| "Create a new repository on " + hostname + " from scratch", | ||
| "Create a new repository on " + hostname + " from a template repository", | ||
| "Push an existing local repository to GitHub", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "Push an existing local repository to GitHub", | |
| "Push an existing local repository to " + hostname, |
Additionally, this will break tests, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which tests? All tests seem to be passing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, let me rephrase that:
"Making this change will require making additional changes in tests"
cli/pkg/cmd/repo/create/create_test.go
Line 411 in 334592c
| return prompter.IndexFor(options, "Push an existing local repository to GitHub") |
cli/pkg/cmd/repo/create/create_test.go
Line 477 in 334592c
| return prompter.IndexFor(options, "Push an existing local repository to GitHub") |
|
@williammartin : would like your 👀 on this too given the multi-host angle and behavior when on GitHub.com and GHES. |
|
@andyfeller, |
| { | ||
| name: "interactive create from scratch with gitignore and license", | ||
| opts: &CreateOptions{Interactive: true}, | ||
| name: "interactive create from scratch with gitignore and license", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rajhawaldar : any concerns about extending the tests to include a version of this test that overrides GH_HOST like what is done in other tests to ensure a host other than github.com results?
|
Gentle nudge on this @rajhawaldar. Is this still something you're interested in working on? |
Sorry, I got caught up in some personal work. I will not be able to continue on this for sometime. Please feel free to take this forward. Again sorry for not updating the thread. |
|
Absolutely no problem @rajhawaldar, totally understand. I'm going to close this and then anyone else who would like to pick it up can, or you can open it up again in the future. Thanks for your efforts regardless! |
Fixes: #8430