asdf icon indicating copy to clipboard operation
asdf copied to clipboard

feat: Add versioning to plugin add command

Open theoretick opened this issue 3 years ago • 9 comments

Summary

Allows user to specify version along with URL when adding plugin to lock to a specific version instead of always relying on HEAD.

❯ git clone https://github.com/theoretick/asdf.git ~/.asdf --branch support-plugin-versions
Cloning into '/Users/theoretick/.asdf'...
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 5913 (delta 0), reused 1 (delta 0), pack-reused 5905
Receiving objects: 100% (5913/5913), 1.10 MiB | 12.68 MiB/s, done.
Resolving deltas: 100% (3400/3400), done.

❯ source ~/.asdf/asdf.sh

❯ asdf plugin add java https://github.com/halcyon/asdf-java.git

❯ asdf plugin add java https://github.com/halcyon/asdf-java.git travis-fix

❯ asdf plugin list
java
java-travis-fix

❯

Other Information

Relates to https://github.com/asdf-vm/asdf/pull/234

theoretick avatar Apr 05 '21 16:04 theoretick

@jthegedus would you have a chance to look over this change soon or would there be another review I could pass this one to?

theoretick avatar Apr 13 '21 15:04 theoretick

@jthegedus sorry for the bump, would you be the best person to review this one or would there be another team member who could look over this change?

theoretick avatar May 12 '21 16:05 theoretick

Sorry mate. I'll be reviewing this the next few days. Trying to get on top of the existing PRs so we can move forward on new changes at greater speed.

Appreciate the work you have contributed.

jthegedus avatar May 20 '21 01:05 jthegedus

Is that something you have time to look at @theoretick ?

@jthegedus sorry for the delay but done with db90b80. I don't love the solution but please let me know what you think!

theoretick avatar Aug 08 '21 21:08 theoretick

This is looking good so far.

I would like this change to also include what happens when asdf plugin update [<name> | --all] is called on a ref that is a tag. Currently it will ditch the tag and go back to the HEAD of the default branch.

Is that something you have time to look at @theoretick ?

@jthegedus So I attempted this with 58de320 but it seems this approach is at odds with https://github.com/asdf-vm/asdf/pull/800 given https://github.com/asdf-vm/asdf/blob/95f2cdf72c074d72efdb293ae238ef11dbd8a773/test/plugin_update_command.bats#L59 explicitly updates detached HEADs to the default branch 🤔. I'm not sure how best to resolve this change in behavior. Do you have any suggestions?

theoretick avatar Aug 21 '21 16:08 theoretick

This feature is super crucial to have minimal security measurements. Otherwise any plugin could be malformed and introduce a security breach.

aabouzaid avatar Feb 14 '23 04:02 aabouzaid