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

Auto Update #170

Closed
5 tasks
mhanberg opened this issue Aug 11, 2023 · 3 comments · Fixed by #169
Closed
5 tasks

Auto Update #170

mhanberg opened this issue Aug 11, 2023 · 3 comments · Fixed by #169
Assignees
Labels
enhancement New feature or request

Comments

@mhanberg
Copy link
Collaborator

mhanberg commented Aug 11, 2023

Description

In order to not have to implement this functionality inside every editor extension, I want Next LS itself to be able to check the GitHub API to see if there is a new release, then prompt the user to install it.

If the user says yes, Next LS will download it, make it executable, and put it in the right place. Then tell the user to restart their editor to use it.

I believe that this will work, even if you copy the new binary into the same place as the existing binary, as the current instance of the server will be kept in memory and working (I think).

Questions

  • Which HTTP library do we use? I would say we should just use httpc, but Burrito already installs Req, so i figure it isn't too bad to also use that.

Acceptance Criteria

  • the above description is satisfied
  • the user is not impacted if they do not have an internet connection
  • We only check once/few times a day for a new release. Might need to create a global (meaning, in ~/.cache/elixir-tools/nextls database that all instances can read from and basically just keep a timestamp in there of the last check.
  • Tested in Neovim and Visual Studio Code
  • can disable if you manage nextls with a different package manager
@mhanberg mhanberg added enhancement New feature or request good first issue Good for newcomers labels Aug 11, 2023
@mhanberg mhanberg self-assigned this Aug 15, 2023
@camilleryr
Copy link

I see you already assigned yourself this card, but if you haven't already started working on it I would be happy to jump in and help! The only thing that doesn't seem readily apparent would be how to know which binary to download for the new version. Off the top of my head I was thinking you could cross reference the check sum of the current version with its checksums.txt file and ensure you download the same version of the executable.

Let me know if you are still looking for someone to work on this - but if you have it covered I will try and find another way to contribute!

@mhanberg
Copy link
Collaborator Author

@camilleryr hello!

Yes, I am indeed working on this.

I'll tag you in an issue you can start on if you'd like!

@camilleryr
Copy link

@camilleryr hello!

Yes, I am indeed working on this.

I'll tag you in an issue you can start on if you'd like!

Sounds great! Ive been enjoying using NextLS and look forward to pitching in!

@mhanberg mhanberg removed the good first issue Good for newcomers label Aug 17, 2023
mhanberg added a commit that referenced this issue Aug 20, 2023
Auto update is opt-in via an environment variable.

This env var will only be set by the editor extensions if it's
being started from the default location, so that if you
are installing NextLS via a package manager, it won't try to update
itself.

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