X Tutup
Skip to content

Pin extensions#5272

Merged
vilmibm merged 15 commits intocli:trunkfrom
meiji163:pin-ext
Mar 29, 2022
Merged

Pin extensions#5272
vilmibm merged 15 commits intocli:trunkfrom
meiji163:pin-ext

Conversation

@meiji163
Copy link
Copy Markdown
Contributor

@meiji163 meiji163 commented Mar 2, 2022

Implements pinning extensions to release tag or commitish. Fixes #5067
Usage is same as specified by @vilmibm

$ gh extension install dlvhdr/gh-prs --pin v2.0.1
✓ Installed extension dlvhdr/gh-prs
✓ Pinned extension at v2.0.1
$ gh extension install mattn/gh-ost
<git noise>
✓ Installed extension mattn/gh-ost --pin 6e6f935
✓ Pinned extension at 6e6f935
$ gh extension list
gh ost               mattn/gh-ost                  6e6f935
gh prs               dlvhdr/gh-prs                 v2.0.1

For binary extensions the pin must be a release tag. It was simplest to add a Pinned field to the manifest.yml.
For git extensions the pin can be any commit ref; the extension is then pinned to the commit SHA. Implemented as a "pin file" in the extension's installation directory.

Right now upgrade --force will not override the pin.

Todo

  • install
  • list
  • upgrade
  • --force
  • tests

@meiji163 meiji163 marked this pull request as ready for review March 4, 2022 15:39
@meiji163 meiji163 requested a review from a team as a code owner March 4, 2022 15:39
@meiji163 meiji163 requested review from samcoe and removed request for a team March 4, 2022 15:39
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Mar 4, 2022
@meiji163
Copy link
Copy Markdown
Contributor Author

meiji163 commented Mar 4, 2022

comments/suggestions on this before I write tests? @vilmibm @mislav

@samcoe samcoe requested a review from vilmibm March 7, 2022 07:22
@vilmibm
Copy link
Copy Markdown
Contributor

vilmibm commented Mar 7, 2022

@meiji163 hi! thanks for this!

this is looking good to me both in terms of code and feature. I'm okay with punting on --force for now -- a remove and a re-install is sufficient and we can augment it in a future PR if desired.

@meiji163 meiji163 changed the title WIP: Pin extensions Pin extensions Mar 8, 2022
@vilmibm
Copy link
Copy Markdown
Contributor

vilmibm commented Mar 15, 2022

I whiffed on re-reviewing this before today so it won't make it into this release, but this will go out in the next one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gh extensions: pin to comittish

3 participants

X Tutup