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

Automatically check for new releases #738

Closed
jeremystretch opened this issue Dec 9, 2016 · 10 comments · Fixed by #4001 or #4366
Closed

Automatically check for new releases #738

jeremystretch opened this issue Dec 9, 2016 · 10 comments · Fixed by #4001 or #4366
Labels
status: accepted This issue has been accepted for implementation

Comments

@jeremystretch
Copy link
Member

NetBox should periodically check for a new release and inform the user if one exists. PR #737 was submitted to introduce this feature, but I'd like to see a more efficient approach. This will require implementing a database model to store temporary configuration information. We'll also need to introduce a permanent configuration variable which allows a user to disable this feature.

@aoyawale
Copy link

can the link be changed to where it gets the new releases? our servers do not have internet connection and I was thinking I can put it in a webserver or our gitlab server.

@bellwood
Copy link
Contributor

Could we use a browser cookie to store the running version and release date, compare against github and provide notice?

This way you only call to github if the cookie doesn't exist and then it doesn't check again until the cookie expires and you don't need to touch PG.

For those who are running offline versions simply offer "its been X days since your version was released, please check for an update" after the cookie expires and the option to permanently suppress that message.

Detecting a user offline is easy and if you want something drop in, JS and is only ~9kb minified:
https://github.com/hubspot/offline

@cimnine
Copy link
Contributor

cimnine commented Aug 24, 2017

Information about the latest release is conveniently provided by Github through it's API:
https://developer.github.com/v3/repos/releases/#get-the-latest-release

@lae
Copy link
Contributor

lae commented Sep 11, 2017

I don't think this should be implemented using the GitHub API as it restricts the usage of forks, whether offline or online, and that may or may not be hosted on GitHub (e.g. gitlab as mentioned above).

An implementation that periodically checks a git repo with something like:

git ls-remote --tags https://github.com/digitalocean/netbox.git

would work I think (with a sort/etc to determine latest version), allowing the repo URI to be configured, but not sure if this fits stretch's idea of an efficient approach.

@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label Jan 26, 2018
@MarcHagen
Copy link
Contributor

Small footer label? It's a nice issue to figure out.
image

@kobayashi
Copy link
Contributor

I think the easiest way is to retrieve from github when opening the page and set label like @MarcHagen shows above.

Just access to the following to get latest release information through github api.
https://api.github.com/repos/netbox-community/netbox/releases/latest

@LBegnaud
Copy link

I like the idea of supporting forks and thus using the git remote settings, but that doesn't solve the problem of people who download the release zip and follow the docs for updating. Also @kobayashi it was mentioned that netbox team doesn't want an external call on every page load, so it needs to perhaps be a self-contained logic that looks for a git remote, then defaults to this github repo if none found. Then separately have a config option to determine if the background refresh runs or not, and if so then do what Jeremy is suggesting with updating a new db table with the data.

@DanSheps
Copy link
Member

DanSheps commented Oct 10, 2019

Just access to the following to get latest release information through github api.
https://api.github.com/repos/netbox-community/netbox/releases/latest

To address @LBegnaud's concern, introduce a new variable that allows you to re-target to the forked repo.

Something like: REPO="netbox-community/netbox"

Throw it into the javascript instead of the python code to solve issues with it potentially slowing down execution and have a new endpoint for both the UI and the API that returns the status.

@kobayashi
Copy link
Contributor

Oh overlooked, thanks to the comment.

@LBegnaud
Copy link

small downside to updating the DB via javascript is that you have to be logged in to do the update check, but i suppose that's not a huge deal and you can still display the cached data before login.

jeremystretch added a commit that referenced this issue Mar 4, 2020
…w-releases

Fixes: #738: Automatically check for new versions
jeremystretch added a commit that referenced this issue Mar 18, 2020
jeremystretch added a commit that referenced this issue Mar 18, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation
Projects
None yet
9 participants