Skip to content

Fix extension install error message showing raw struct instead of owner/repo#12836

Merged
williammartin merged 2 commits intotrunkfrom
copilot/fix-gh-review-lab-error-message
Mar 5, 2026
Merged

Fix extension install error message showing raw struct instead of owner/repo#12836
williammartin merged 2 commits intotrunkfrom
copilot/fix-gh-review-lab-error-message

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

When an extension has no usable release artifact or script, the error message printed the raw Go struct representation (&{github gh-review-lab }) instead of the formatted owner/repo name.

Changes

  • pkg/cmd/extension/manager.go: Replace bare repo with ghrepo.FullName(repo) in the "not installable" error message
  • pkg/cmd/extension/manager_test.go: Add TestManager_Install_not_installable to assert the error message uses the owner/repo format

Before:

extension is not installable: no usable release artifact or script found in &{github gh-review-lab }

After:

extension is not installable: no usable release artifact or script found in github/gh-review-lab

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/cli/gh-extension-precompile/contents/
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (http block)
  • https://api.github.com/repos/github/gh-review-lab/releases/latest
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

When installing the gh-review-lab extension using gh extension install github/gh-review-lab, an error message is shown: extension is not installable: no usable release artifact or script found in &{github gh-review-lab http://github.com|github.com}. The final string in the error (&amp;{github gh-review-lab <http://github.com|github.com>}) appears to be a formatting artifact, possibly due to improper handling of Go formatting or HTML escaping.

Task:

  • Investigate the code path that surfaces this error, particularly how the extension repository object is rendered in the error message.
  • Remove or properly format the artifact so that the error message clearly shows the intended repository name/link.
  • Ensure there are no HTML escapes (such as &amp;) and that repository details are clearly presented.
  • Add a test or example that demonstrates the correct behavior.

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix error message formatting for gh-review-lab extension Fix extension install error message showing raw struct instead of owner/repo Mar 4, 2026
@williammartin williammartin marked this pull request as ready for review March 4, 2026 16:37
@williammartin williammartin requested a review from a team as a code owner March 4, 2026 16:37
@williammartin williammartin requested review from BagToad and Copilot March 4, 2026 16:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where the extension "not installable" error message displayed the raw Go struct representation of a repository object (e.g., &{github gh-review-lab }) instead of the human-readable owner/repo format.

Changes:

  • Fix the %s format verb in the error string by replacing the bare repo argument with ghrepo.FullName(repo), which serializes to "OWNER/REPO".
  • Add TestManager_Install_not_installable to assert the corrected error format.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/cmd/extension/manager.go Uses ghrepo.FullName(repo) in the "not installable" error message instead of the raw repo struct
pkg/cmd/extension/manager_test.go Adds a test that confirms the error message uses the owner/repo format when no binary or script is found

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@williammartin williammartin merged commit ff8873d into trunk Mar 5, 2026
35 checks passed
@williammartin williammartin deleted the copilot/fix-gh-review-lab-error-message branch March 5, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants