Repository navigation
Point private extension installs at gh auth setup-git - #388
Merged
Merged
Conversation
Git runs without a prompt when it installs or updates an extension. So a private GitHub repository with no credential helper failed with a long "Command failed: git -c …" message that did not say what to do. - `install.js` recognises git auth failures on `github.com` URLs: "could not read Username", "Authentication failed", "Repository not found", "Permission denied (publickey)" and "Invalid username or token". It replaces the message with git's own last line and a hint: "It may be a private repository: run gh auth login, then gh auth setup-git, and try again." An SSH URL is pointed at its `https://` form instead. - The hint covers clone, the early-adopter branch lookup, `ls-remote` and the update-count fetch. So it shows in the Extensions panel's install line, the error toast, and an installed extension's "Could not reach the origin" line. - How cloning runs is unchanged. Other hosts and other failures are rethrown untouched. - `docs/extensions.md` and the README's `gh` requirement line mention `gh auth setup-git`. Validation: - New unit tests in `server/extensions/install.test.js`; full `npm test`: 4,620 passed. - `npm run docs:check`: passed. - An isolated dev board with git's credential helper turned off, installing a real private GitHub repository, showed the hint in the panel and the toast. Made with Agent Wrangler and the PortSwigger/wrangler-squared extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Git runs without a prompt when it installs or updates an extension. So a private GitHub repository with no credential helper failed with a long "Command failed: git -c …" message that did not say what to do.
install.jsrecognises git auth failures ongithub.comURLs: "could not read Username", "Authentication failed", "Repository not found", "Permission denied (publickey)" and "Invalid username or token". It replaces the message with git's own last line and a hint: "It may be a private repository: run gh auth login, then gh auth setup-git, and try again." An SSH URL is pointed at itshttps://form instead.ls-remoteand the update-count fetch. So it shows in the Extensions panel's install line, the error toast, and an installed extension's "Could not reach the origin" line.docs/extensions.mdand the README'sghrequirement line mentiongh auth setup-git.Validation:
server/extensions/install.test.js; fullnpm test: 4,620 passed.npm run docs:check: passed.Made with Agent Wrangler and the PortSwigger/wrangler-squared extension