Show site alert for deprecation of older GitLab versions
Created by: courier-new
Closes https://github.com/sourcegraph/sourcegraph/issues/40106.
Adds a new site alert message for site admins only if we detect Sourcegraph is connected to at least one GitLab code host running a version earlier than 12.0.
Helpfully, the internal/extsvc/versions
package was already doing essentially exactly what we wanted here: it pings each code host once a day and persists the versions detected to redis. These are normally just sent as telemetry pings. For the site alert, we can just read from the versions and check that any for a GitLab code host are >= 12.0.0.
Test plan
I don't have a GitLab instance on a version < 12.0 to test on, but I tested with a constraint of 16.0 and the banner appeared for my connected instance on 15.3.0-pre. There aren't many site alert tests, and given this message will only be present for the next version of Sourcegraph, I didn't think it was necessarily worth the investment to set up a full test suite for this alert.