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.Checkand removes the distinction between built-in and config checks - Remove all checks from
sg.config.yaml. Oldsgversions 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 doctorto be more readable - Move some functionality into
usershellso the code is in a leaf package
Test plan
- Run
go run . doctorlocally with Redis/Postgres/Docker on and off - Run
go run . setuplocally with Redis/Postgres/Docker on and off