Skip to content

Force gh-aw extension upgrade resolution to github.com in mixed GHE contexts#32486

Closed
Copilot wants to merge 3 commits into
mainfrom
copilot/gh-aw-extension-upgrade-issue
Closed

Force gh-aw extension upgrade resolution to github.com in mixed GHE contexts#32486
Copilot wants to merge 3 commits into
mainfrom
copilot/gh-aw-extension-upgrade-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

In GHE-authenticated environments, gh aw could report extension state as current while still running an older gh-aw version because upgrade/release resolution followed the active enterprise host context. This change makes extension update resolution deterministic against the canonical upstream source and surfaces host context in user-facing output.

  • Canonical host resolution for extension operations

    • Routed all self-upgrade subprocesses (gh extension upgrade/remove/install) through a single helper that enforces GH_HOST=github.com.
    • Prevents false “already up to date” outcomes caused by enterprise-host lookup when the extension origin is github/gh-aw.
  • Canonical host resolution for release discovery

    • Configured the go-gh REST client used by getLatestRelease(...) with Host: github.com.
    • Ensures latest-version checks are evaluated against upstream releases, not ambient auth host.
  • Clear host context in upgrade UX

    • Added explicit source-host context in upgrade messaging (check/up-to-date/upgrade paths).
    • Reduced ambiguity during mixed-host troubleshooting.
  • Targeted test coverage for env override behavior

    • Added/extended unit tests for host env override semantics and command construction (withEnvOverride, githubExtensionCommand).
func githubExtensionCommand(args ...string) *exec.Cmd {
	cmd := exec.Command("gh", args...)
	cmd.Env = withEnvOverride(os.Environ(), "GH_HOST", "github.com")
	return cmd
}

Copilot AI and others added 2 commits May 15, 2026 22:01
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix gh aw extension upgrade reporting issue Force gh-aw extension upgrade resolution to github.com in mixed GHE contexts May 15, 2026
Copilot AI requested a review from pelikhan May 15, 2026 22:06
@github-actions github-actions Bot mentioned this pull request May 16, 2026
@pelikhan pelikhan closed this May 16, 2026
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.

gh aw extension upgrade on GHE falsely reports "already up to date"

2 participants