-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Suggested command for creating an extension when an extension doesn't have a binary for the current architecture creates an unclear, blank issue #9600
Comments
I'm willing to pick up this change, if the maintainers are happy to accept it 😊 |
Thanks for raising this concern, @timrogers, definitely an opportunity to improve extension authors and users interactions! At first, I was wondering whether there were other situations we could land in this such as the repo not existing, however I see we have that covered: cli/pkg/cmd/extension/manager.go Lines 212 to 238 in 3cbaffe
$ gh ext install andyfeller/gh-doesnotexist
X Could not find extension 'andyfeller/gh-doesnotexist' on host github.com The only other scenario being an error with the build process that fails to upload the specific OS + architecture, but realizing that likely warrants asking the extension author to do something regardless. What might this look like? 🤔
With all of that said, I think this makes sense and can hold off further feedback for a PR. |
… doesn't have a binary for your platform When installing an extension, the CLI must to select the correct binary to download for the machine (see the [`installBin` function](https://github.com/cli/cli/blob/78c1d00eccac1b2ae82ac0bfeea3e2292c98056a/pkg/cmd/extension/manager.go#L240)). By default, the CLI will download a binary matching the current machine's architecture. If a suitable binary isn't available, the CLI [outputs an error](https://github.com/cli/cli/blob/78c1d00eccac1b2ae82ac0bfeea3e2292c98056a/pkg/cmd/extension/manager.go#L278), directing the user to create an issue on the extension's repository: ```go if asset == nil { return fmt.Errorf( "%[1]s unsupported for %[2]s. Open an issue: `gh issue create -R %[3]s/%[1]s -t'Support %[2]s'`", repo.RepoName(), platform, repo.RepoOwner()) } ``` The issue this creates isn't very clear or helpful. It isn't obvious where it is coming from, or what you need to do. This improves the suggested command, adding a better title to the issue and an explanatory body. To test this, try installing my `timrogers/gh-extension-without-binary` extension, which only has an esoteric `linux-ppc64` binary 😸: ```bash gh extension install timrogers/gh-extension-without-binary ``` You'll get a nice output like this: ``` gh-extension-without-binary unsupported for darwin-arm64. Open an issue: `gh issue create -R timrogers/gh-extension-without-binary --title "Add support for the darwin-arm64 architecture" --body "This extension does not support the darwin-arm64 architecture. I tried to install it on a darwin-arm64 machine, and it failed due to the lack of an available binary. Would you be able to update the extension's build and release process to include the relevant binary? For more details, see <https://docs.github.com/en/github-cli/github-cli/creating-github-cli-extensions>."` ``` ...which produces an issue like timrogers/gh-extension-without-binary#4. I have tested the resulting command on macOS and Windows, so I am confident that it has *at least reasonable* cross-platform support. Fixes cli#9600.
When installing an extension, the CLI must to select the correct binary to download for the machine (see the
installBin
function).By default, the CLI will download a binary matching the current machine's architecture.
If a suitable binary isn't available, the CLI outputs an error, directing the user to create an issue on the extension's repository:
The issue this creates isn't very clear or helpful. It isn't obvious where it is coming from, or what you need to do.
I would propose that we create that issue with a body, e.g.:
Related to #9592.
The text was updated successfully, but these errors were encountered: