You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GitKind extensions are not treated as pinned correctly #10228
This looks like it is pinned correctly. However...running gh ext list doesn't show it in blue (indicating pinned), and...
➜ gh ext upgrade gh-sonar --dry-run
[sonar]: would have upgraded from 81a4ce86 to 9977d8e5
✓ Successfully checked extension upgrades
Whereas a pinned extension would say:
➜ gh ext upgrade gh-sarif --dry-run
[sarif]: pinned extensions can not be upgraded
✓ Successfully checked extension upgrades
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 SHA When I execute gh ext upgrade <EXT> --dry-run Thengh states pinned extensions can not be upgraded
Given I installed a pinned, script-based GitHub CLI extension using gh ext install --pin SHA When I execute gh ext list Then I see the extension sha is coloured cyan
In the following example, the version for gh-eco is colored cyan because it is a pinned extension:
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 execute gh ext upgrade <EXT> --dry-run Thengh states pinned extensions can not be upgraded
Separately, I think the message provided by gh ext upgrade isn'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`.
This occurs because checking whether a GitKind extension 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).
Given I installed a pinned, script-based GitHub CLI extension using gh ext install --pin SHA When I execute gh ext list Then I see the extension sha is coloured blue (or whatever my terminal colouring is set to for that)
~~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? ~~
Activity
andyfeller commentedon 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 SHAWhen I execute
gh ext upgrade <EXT> --dry-runThen
ghstatespinned 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`.williammartin commentedon 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
This was introduced in #7493 and has been broken since. The previous commit correctly represents the pinned ext in
ext list.williammartin commentedon Jan 13, 2025
I would also expect:
Given 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 blue (or whatever my terminal colouring is set to for that)
esvarez commentedon Jan 14, 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