fix: force extension upgrade for pinned gh-aw installs#27679
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/898d3fb1-b027-479b-ae46-75cacc956ea8 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ Smoke CI completed successfully! |
There was a problem hiding this comment.
Pull request overview
Fixes gh-aw self-upgrade when the extension was installed with a pinned version by forcing gh extension upgrade to upgrade in-place.
Changes:
- Switch automatic extension upgrade and rename+retry path to call
gh extension upgrade github/gh-aw --forcevia a shared helper. - Add a unit test asserting the exact extension-upgrade CLI args used.
- Update the upgrade test workflow comment to reflect the
--forcebehavior.
Show a summary per file
| File | Description |
|---|---|
| pkg/cli/update_extension_check.go | Uses centralized extensionUpgradeArgs() (includes --force) for both initial and retry upgrade commands. |
| pkg/cli/update_extension_check_test.go | Adds a unit test to lock in the expected upgrade command arguments. |
| .github/workflows/upgrade-test.yml | Updates workflow documentation comment to match runtime invocation (--force). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 1
| // --force is required so pinned installs (e.g. `gh extension install ... --pin`) | ||
| // can be upgraded in-place. | ||
| func extensionUpgradeArgs() []string { | ||
| return []string{"extension", "upgrade", "github/gh-aw", "--force"} |
There was a problem hiding this comment.
Since --force is required for pinned installs (as noted here), the Windows manual-upgrade guidance printed on lock errors (gh extension upgrade gh-aw) will still fail for pinned installs. Please update that user-facing command to include --force (and ideally keep the suggested command consistent with extensionUpgradeArgs).
|
🤖 Smoke CI check — workflow run #24746370800 has been triggered for this pull request. |
🧪 Test Quality Sentinel ReportTest Quality Score: 70/100
Test Classification Details
Analysis Notes
Why edge-case score is 0: The function under test is a pure constant-returning function with no error paths; 0 edge-case tests is correct for this shape of code and is not a quality concern. Build tag: ✅ Language SupportTests analyzed:
Verdict
📖 Understanding Test ClassificationsDesign Tests (High Value) verify what the system does:
Implementation Tests (Low Value) verify how the system does it:
Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators. References: §24746373706
|
Summary
Fixes the self-upgrade flow when gh-aw was installed as a pinned extension version.
Changes
gh extension upgrade github/gh-aw --forceduring automatic extension upgradeValidation
go test -v -run "TestExtensionUpgradeArgs|TestNeedsRenameWorkaround|TestIsWindowsLockError" ./pkg/cli/make agent-finish(fails due to pre-existing repository-wide gosec findings in unrelated files)parallel_validationCode Review: success; CodeQL scan timed out per tool message