Skip to content

Ability to specify a different default plugins repository #952

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adongy opened this issue May 22, 2021 · 6 comments
Closed

Ability to specify a different default plugins repository #952

adongy opened this issue May 22, 2021 · 6 comments

Comments

@adongy
Copy link

adongy commented May 22, 2021

Is your feature request related to a problem? Please describe.

Imagine a workplace where plugins should be internalized to assume full control before being usable. Users should only install these vetted plugins. Currently, users have to specify a custom plugin URL for each of these plugins.

Describe the solution you'd like
I'd like to be able to change the default repository URL for plugins, currently located in

asdf/lib/utils.bash

Lines 35 to 37 in 0a3865d

asdf_repository_url() {
printf "https://github.com/asdf-vm/asdf-plugins.git\\n"
}

Describe similar asdf features and why they are not sufficient

The plugin list may list plugins that are actually not allowed.

Additional context

It could be a setting in the .asdfrc.

Thanks,

@jthegedus
Copy link
Contributor

Currently, users have to specify a custom plugin URL for each of these plugins

This is preferred behaviour as it is explicit and users are informed that plugins are merely git repos and not magic of asdf.

I think this should be a setting. .asdfrc is the place to have it.

I would like to note that the plugin repo format is subject to change which would require updates to external plugin repos.

@adongy
Copy link
Author

adongy commented May 25, 2021

Yes I believe .asdfrc is a good place for it.

The repository URL could be printed alongside the current logs to ease debug and avoid people reporting issues when using a custom repository.

asdf/lib/utils.bash

Lines 393 to 410 in 3237167

initialize_or_update_repository() {
local repository_url
local repository_path
repository_url=$(asdf_repository_url)
repository_path=$(asdf_data_dir)/repository
if [ ! -d "$repository_path" ]; then
printf "initializing plugin repository..."
git clone "$repository_url" "$repository_path"
elif repository_needs_update; then
printf "updating plugin repository..."
(cd "$repository_path" && git fetch && git reset --hard origin/master)
fi
mkdir -p "$(asdf_data_dir)/tmp"
touch "$(asdf_data_dir)/tmp/repo-updated"
}

As to the repo format, that would mean format update need to be documented so that plugin repository operators can update the format accordingly.

@jthegedus
Copy link
Contributor

The repository URL could be printed alongside the current logs to ease debug and avoid people reporting issues when using a custom repository

Yes, that is a good suggestion.

As to the repo format, that would mean format update need to be documented so that plugin repository operators can update the format accordingly

Yes, we should document it when we get to a stable release. Adding this as a configurable option would mean we are essentially expanding an API scope. We are using semver and on version 0.x.x, which means our feature-set and API are not yet set in stone.

@jthegedus
Copy link
Contributor

jthegedus commented Jun 2, 2021

After thinking about this more I don't think the idea of custom plugins repo is a good idea.

Currently, users have to specify a custom plugin URL for each of these plugins

This is the preferred user flow. The plugin repo only saves users typing/copy-pasting the <git-url> portion of the command, which isn't enough of a reason to add this IMO. If it's for discoverability, there are many other solutions to just sharing URLs amongst projects/teams.

asdf plugin add <name> <git-url> is preffered because:

  • it always works
  • doesn't require syncing a remote plugin repo
  • doesn't require us to create a new API (via the concrete plugin repo spec)
  • requires users know that plugins are just Git repos and not special asdf sauce
  • makes users aware of the source of the plugin code (most plugins are not created or maintained by the asdf core team)

asdf plugin add <name> is good because:

  • saves on typing?
  • EDIT: discoverability

If I have misunderstood the benefits of the short-name plugin repo, please share. Each day I sour more on the plugin repo.

@jthegedus
Copy link
Contributor

jthegedus commented Jul 29, 2021

I am closing this as asdf plugin add <name> <git-url> achieves the same result.

We're going to explore plugin search of remote VCS (GitHub/GitLab/BitBucket) which would supplant this request as we could allow people to define the list of remotes for internal/private VCS platforms.

@Stratus3D
Copy link
Member

Agree with @jthegedus. I understand how not having this feature make be an inconvenience but I think it isn't worth adding another feature to asdf to support this since the only thing it really does it allow the user to skip specifying the repo URL. I personally think asdf plugin <name> <url> is the only API we should provide.

I also don't think the plugin repository has been worth the contributor time that has been put into it. A simple GitHub or Google search for asdf-<plugin name> will usually turn up all public plugins with the name.

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

No branches or pull requests

3 participants