Warn users when Sourcegraph is out of date
Created by: slimsag
Update: See https://github.com/sourcegraph/sourcegraph/pull/10843#pullrequestreview-424888826 for a description of the behavior.
Previous (now outdated) issue description
Sourcegraph instances that are offline (firewalled-off, configured not to, etc.) do not get update notifications because they cannot reach Sourcegraph.com to check for updates.
From paying customers, we see around 25%+ are running a version of Sourcegraph older than 4 months. data
This is bad for a few reasons:
- Users on these instances (even if the instance was able to contact Sourcegraph.com) do not know the instance is out of date, since we only display update-available notifications to site admins. This means that large numbers of our users may not know that Sourcegraph has improved and they are just using a really old version.
- Because users aren't aware Sourcegraph is severely outdated, site admins managing these instances are not encouraged by their users to update it (example).
We should progressively warn site admins and users when Sourcegraph is out of date, even if the instance cannot reach Sourcegraph.com. It should be possible and easy to derive this information from the version strings that are baked into Sourcegraph's frontend Go binaries at build time and display this information via global site-wide alerts.
How it would work:
- We know Sourcegraph releases a new version on the 20th of each month, per our documented release policy.
- If we release, say, Sourcegraph 3.16 and include "date of release" metadata in it then we can easily say the following:
| Time since date of release | Instance is offline? | shown to | dismissable? | alert message |
|---|---|---|---|---|
| 1 month | yes | admins only | yes | "Sourcegraph is 1 month out of date" |
| 2 months | yes | admins only | yes | "Sourcegraph is 2 months out of date" |
| 3 months | yes | admins only | no | "Sourcegraph is 3 months out of date, at 4 months users will be warned Sourcegraph is out of date" |
| 4 months | yes or no | all users | by non-admins only | "Sourcegraph is 4+ months out of date, for the latest features and bug fixes ask your site administrator to upgrade." |
| 5 months | yes or no | all users | by non-admins only | "Sourcegraph is 5+ months out of date, for the latest features and bug fixes ask your site administrator to upgrade." |
| 6+ months | yes or no | all users | no | "Sourcegraph is 6+ months out of date, for the latest features and bug fixes ask your site administrator to upgrade." |
cc @dadlerj does the above behavior look good to you?