Repository navigation
GitKind extensions are not treated as pinned correctly #10228
Description
Activity
- addedgh-extensionrelating to the gh extension commandrelating to the gh extension command
on Jan 13, 2025 Thanks for opening this issue, @williammartin! ❤
If I'm following along, then I assume the acceptance criteria for this bug report is:
Given I installed a pinned, script-based GitHub CLI extension using
gh ext install --pin SHA
When I executegh ext upgrade <EXT> --dry-run
Thenghstatespinned extensions can not be upgradedSeparately, I think the message provided by
gh ext upgradeisn't actionable enough and wonder how we incorporate an additional message to help the user:➜ gh ext upgrade gh-sarif --dry-run [sarif]: pinned extensions can not be upgraded ✓ Successfully checked extension upgrades To upgrade pinned extensions, run `gh ext install <ext> --force`.- addedmore-info-neededMore info needed from user/contributorMore info needed from user/contributor
on Jan 13, 2025 This occurs because checking whether a
GitKindextension is pinned tries to check the existence of a file in the git repo, but the path concatenation is incorrect, because it concatenates the executable path (rather than the dir containing the executable).cli/pkg/cmd/extension/extension.go
Line 166 in 41e99b9
pinPath := filepath.Join(e.Path(), fmt.Sprintf(".pin-%s", e.CurrentVersion())) This was introduced in #7493 and has been broken since. The previous commit correctly represents the pinned ext in
ext list.Reacted by AzeemI would also expect:
Given I installed a pinned, script-based GitHub CLI extension using
gh ext install --pin SHA
When I executegh ext list
Then I see the extension sha is coloured blue (or whatever my terminal colouring is set to for that)- addedpriority-3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetichelp wantedContributions welcomeContributions welcomeand removedmore-info-neededMore info needed from user/contributorMore info needed from user/contributor
on Jan 13, 2025 ~~Hello, I want to start contributing to open-source projects. This seems to be a good point to begin with. Where can I find the guide to contribute to the project? ~~
I already saw it in the readme
Reacted by William Martin
Describe the bug
This looks like it is pinned correctly. However...running
gh ext listdoesn't show it in blue (indicating pinned), and...Whereas a pinned extension would say:
Separately, upgrading doesn't work at all, but that's another issue (to be created)
Acceptance Criteria
Given I installed a pinned, script-based GitHub CLI extension using
gh ext install --pin SHAWhen I execute
gh ext upgrade <EXT> --dry-runThen
ghstatespinned extensions can not be upgradedGiven I installed a pinned, script-based GitHub CLI extension using
gh ext install --pin SHAWhen I execute
gh ext listThen I see the extension sha is coloured cyan
In the following example, the version for
gh-ecois colored cyan because it is a pinned extension: