Skip to content

sg: redesign checks functionality

Administrator requested to merge mrn/refactor-checks into main

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 like check.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. Old sg 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 in setup.
  • 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

Merge request reports

Loading