When adding a plugin that is already added but has a different remote, not action are taken until ASDF_PLUGIN_MANAGER_ADD_CLEAN is true. Maybe a warning should be issued if plugins remote URLs are different.
Steps to reproduce
From a container with asdf and asdf-plugin-manager installed (source available)
node@79423a9cc918:/demo$ asdf plugin-add sops https://github.com/sylvainmetayer/asdf-sops-evil
node@79423a9cc918:/demo$ asdf install sops latest
redirect url: https://github.com/getsops/sops/releases/tag/v3.8.1
sops 3.8.1 installation was successful!
node@79423a9cc918:/demo$ cd plugin-manager/
# Evil sops version, not valid Git remote. This should be fixed by using .plugin-versions and official git remote
node@79423a9cc918:/demo/plugin-manager$ sops
Vous pensiez utiliser sops ?
Dommage, vous venez de faire fuire toutes vos clés SSH vers un serveur mailveillant ! 😈
node@79423a9cc918:/demo/plugin-manager$ asdf global asdf-plugin-manager 1.3.1
node@79423a9cc918:/demo/plugin-manager$ asdf-plugin-manager version
1.3.1
# We can see below that currently installed version is not valid
node@79423a9cc918:/demo/plugin-manager$ asdf-plugin-manager export
asdf-plugin-manager https://github.com/asdf-community/asdf-plugin-manager.git 54ac342
nodejs https://github.com/asdf-vm/asdf-nodejs.git c5b7c40
sops https://github.com/sylvainmetayer/asdf-sops-evil b7bb9cd
node@79423a9cc918:/demo/plugin-manager$ bat .plugin-versions
# shortened output
1 # plugin-name git-url git-ref (hash, tag, or branch)
2 sops https://github.com/feniix/asdf-sops master
# I expected that any of "add-all / update-all / add sops / update sops" commands would fix the git remote, or at least
# show a warning
node@79423a9cc918:/demo/plugin-manager$ asdf-plugin-manager add-all
[INFO] Adding: sops https://github.com/feniix/asdf-sops master
Plugin named sops already added
error: pathspec 'master' did not match any file(s) known to git
node@79423a9cc918:/demo/plugin-manager$ asdf-plugin-manager add sops
[INFO] Adding: sops https://github.com/feniix/asdf-sops master
Plugin named sops already added
error: pathspec 'master' did not match any file(s) known to git
node@79423a9cc918:/demo/plugin-manager$ asdf-plugin-manager update-all
[INFO] Updating: sops https://github.com/feniix/asdf-sops master to HEAD
Location of sops plugin: /home/node/.asdf/plugins/sops
Updating sops to main
Already on 'main'
Your branch is up to date with 'origin/main'.
[INFO] The plugin "sops" with git-ref "master" is already up-to-date.
node@79423a9cc918:/demo/plugin-manager$ asdf-plugin-manager export
asdf-plugin-manager https://github.com/asdf-community/asdf-plugin-manager.git 54ac342
nodejs https://github.com/asdf-vm/asdf-nodejs.git c5b7c40
sops https://github.com/sylvainmetayer/asdf-sops-evil b7bb9cd
node@79423a9cc918:/demo/plugin-manager$ asdf-plugin-manager update sops
[INFO] Updating: sops https://github.com/feniix/asdf-sops master to HEAD
Location of sops plugin: /home/node/.asdf/plugins/sops
Updating sops to main
Already on 'main'
Your branch is up to date with 'origin/main'.
[INFO] The plugin "sops" with git-ref "master" is already up-to-date.
# With this variable, the plugin is uninstalled before. This ensure the new remote is installed.
node@79423a9cc918:/demo/plugin-manager$ export ASDF_PLUGIN_MANAGER_ADD_CLEAN=true
# However, this does not seems to work with the "update" option
node@79423a9cc918:/demo/plugin-manager$ asdf-plugin-manager update sops
[INFO] Updating: sops https://github.com/feniix/asdf-sops master to HEAD
Location of sops plugin: /home/node/.asdf/plugins/sops
Updating sops to main
Already on 'main'
Your branch is up to date with 'origin/main'.
[INFO] The plugin "sops" with git-ref "master" is already up-to-date.
node@79423a9cc918:/demo/plugin-manager$ asdf-plugin-manager export
asdf-plugin-manager https://github.com/asdf-community/asdf-plugin-manager.git 54ac342
nodejs https://github.com/asdf-vm/asdf-nodejs.git c5b7c40
sops https://github.com/sylvainmetayer/asdf-sops-evil b7bb9cd
node@79423a9cc918:/demo/plugin-manager$ asdf-plugin-manager add sops
[INFO] Adding: sops https://github.com/feniix/asdf-sops master
[INFO] Removing: sops
[INFO] Done.
node@79423a9cc918:/demo/plugin-manager$ asdf install sops latest
Downloading sops from https://github.com/getsops/sops/releases/download/v3.8.1/sops-v3.8.1.linux.amd64
asdf: Warn: You have configured asdf to preserve downloaded files (with always_keep_download=yes or --keep-download). But
asdf: Warn: the current plugin (sops) does not support that. Downloaded files will not be preserved.
# Valid SOPS version
node@79423a9cc918:/demo/plugin-manager$ sops
Error: no file specified
Expected behavior
When using different remote URLs for a plugin, a warning should be issued. If the ASDF_PLUGIN_MANAGER_ADD_CLEAN variable is present, the plugin is (except for the update command) uninstalled and reinstalled with the correct git remote.
Screenshots
N/A
Additional context
Thanks a lot for asdf that I use on a daily basis and for this plugin ! I'm preparing a talk on asdf and want to speak about this plugin, that solve an issue we have in our team and ensure consistency in our plugins URLs/tags accross team members.
My demo use case is maybe an edge case as we often use "official" plugins, but I was surprised that no warning would be issued.
Describe the bug
When adding a plugin that is already added but has a different remote, not action are taken until
ASDF_PLUGIN_MANAGER_ADD_CLEAN
is true. Maybe a warning should be issued if plugins remote URLs are different.Steps to reproduce
From a container with asdf and asdf-plugin-manager installed (source available)
Expected behavior
When using different remote URLs for a plugin, a warning should be issued. If the
ASDF_PLUGIN_MANAGER_ADD_CLEAN
variable is present, the plugin is (except for theupdate
command) uninstalled and reinstalled with the correct git remote.Screenshots
N/A
Additional context
Thanks a lot for asdf that I use on a daily basis and for this plugin ! I'm preparing a talk on asdf and want to speak about this plugin, that solve an issue we have in our team and ensure consistency in our plugins URLs/tags accross team members.
My demo use case is maybe an edge case as we often use "official" plugins, but I was surprised that no warning would be issued.