sg: redesign checks functionality
Created by: mrnugget
This does multiple things to fix https://github.com/sourcegraph/sourcegraph/issues/31043
- Move Sourcegraph-independent check functionality into
internal/check
(including helpers likecheck.Version
,check.Any
, etc.) - Remove the previous
run.Check
and removes the distinction between built-in and config checks - Remove all checks from
sg.config.yaml
. Oldsg
versions will run into "WARNING: check not found" messages, so it's kinda backwards-compatible - Moves all Sourcegraph and sg-related check code into a single file,
checks.go
- Adds a helper to safely get a check by name
- Fixes #31039 (closed) by checking that Docker is running, but only in
sg doctor
, not insetup
. - Changes output of
sg doctor
to be more readable - Move some functionality into
usershell
so the code is in a leaf package
Test plan
- Run
go run . doctor
locally with Redis/Postgres/Docker on and off - Run
go run . setup
locally with Redis/Postgres/Docker on and off