Skip to content
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

Notify users of core or plugin updates #725

Open
jsejcksn opened this issue May 13, 2020 · 11 comments
Open

Notify users of core or plugin updates #725

jsejcksn opened this issue May 13, 2020 · 11 comments
Assignees

Comments

@jsejcksn
Copy link
Contributor

Is your feature request related to a problem? Please describe:
I have encountered multiple installation failures due to an outdated plugin, with no information as to why.

Describe the solution you'd like:
I'd like for a plugin update check to be performed when running asdf commands which utilize the plugin, and to be notified if there is an update available for the plugin. For example: asdf list all [plugin], asdf install [plugin] [version], etc.

This could be implemented with a TTL cache so that there aren't repeated network requests performed within a given window of time.

If it is decided that this feature request is ultimately the responsibility of each plugin, then this is a request to provide a framework for plugin authors to easily implement the feature.

Describe similar asdf features and why they are not sufficient:
There are no similar features to compare.

Describe workarounds you've considered:
Manually check if there is a plugin update and install it.

Additional context
asdf-community/asdf-deno#7

@jthegedus
Copy link
Contributor

jthegedus commented May 14, 2020

I like this feature request.

Since the plugins are git repos, I believe this logic could easily live in the core. TTL cache is a great idea.

We could use git ls-remote to check the repo head or tags to see if new versions exist without having to perform a checkout. (I think we should have another discussion elsewhere around encouraging versioning of plugins via git tags)

I think mimicking the npm style of notification would be ideal here. It's loud, clean and familiar:

   ╭────────────────────────────────────────────────────────────────╮
   │                                                                │
   │      New patch version of npm available! 6.13.4 → 6.13.7       │
   │   Changelog: https://github.com/npm/cli/releases/tag/v6.13.7   │
   │               Run npm install -g npm to update!                │
   │                                                                │
   ╰────────────────────────────────────────────────────────────────╯

Edit: or Flutter

  ╔════════════════════════════════════════════════════════════════════════════╗
  ║ A new version of Flutter is available!                                     ║
  ║                                                                            ║
  ║ To update to the latest version, run "flutter upgrade".                    ║
  ╚════════════════════════════════════════════════════════════════════════════╝

For reference: asdf plugin update code

@jsejcksn
Copy link
Contributor Author

I suppose asdf should also report updates about itself 😄

@jthegedus
Copy link
Contributor

Yes it should, and I imagine the code for this would be the same just with the repo URL being targeted as the only difference

@jthegedus
Copy link
Contributor

I'm confident this will be the same code so renaming this Issue to cover the core asdf tool as well.

@jthegedus jthegedus self-assigned this May 15, 2020
@jthegedus jthegedus changed the title Support notifying of plugin updates Notify users of core or plugin updates May 15, 2020
@yuvmel
Copy link

yuvmel commented May 21, 2020

Thanks for raising this! I use "brew" to have asdf core updated, but missed some native (i.e. w/o crontab...) solution for plugins - a notification (specifically in the npm style above) would still serve as great help, e.g. in context of halcyon/asdf-java#12 (comment)

@jthegedus
Copy link
Contributor

jthegedus commented May 21, 2020

Yes, there's currently no solution for auto-updating the plugins. I have some ideas around this aside from just the message.

@jsejcksn
Copy link
Contributor Author

I have some ideas around this aside from just the message.

@jthegedus I know it's been a while since this topic had activity, so you might need to reference some notes or jog your memory, but do you have any details to share?

@jthegedus jthegedus added this to the v0.9.0 milestone Sep 8, 2020
@jthegedus
Copy link
Contributor

@jsejcksn Those ideas were more around how we handle sourcing plugins in general and plugin versioning.

For reference, here's the Issue requesting plugin versions #166

I'll start work on this soon(TM)

@HashNuke
Copy link
Member

HashNuke commented Oct 7, 2020

Since we rely on master branches for plugins (atleast from what I remember), informing the user about plugin update would mean that:

  • Almost commit pushed to master branch of the plugin would be considered an update and the user would be informed that the plugin has an update.
  • And we wouldn't want to slow down running any local command by making a remote request.

I agree with @jthegedus.

  • Versioning of plugins #166 is good for plugins (caveat: increases maintainer's work)
  • We could do have something common to check for all updates (like how homebrew does). Maybe bake it into asdf info

@jthegedus
Copy link
Contributor

Since we rely on master branches for plugins (atleast from what I remember)

On asdf plugin add <name> the default branch of the remote is used. It's only on asdf plugin update [<name>|--all] that master is assumed, but #800 resolves that issue.

Updates to tags is on my radar, with the general idea to be if a tag ref is in use for a plugin, only update to newer tag refs.

we wouldn't want to slow down running any local command by making a remote request

I was thinking a similar solution to ZSH whereby it is on initial asdf load in the shell that we check the core and all plugins the user has installed. asdf info is another idea whereby we should probably print the plugin ref as well 🤔

@Stratus3D
Copy link
Member

Stratus3D commented Nov 22, 2021

@jthegedus what do you think about removing this from the v0.9.0 milestone? I'd like to get v0.9.0 tagged soon and this is the only remaining ticket.

@jthegedus jthegedus removed this from the v0.9.0 milestone Dec 2, 2021
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

5 participants