src CLI tool & GraphQL API stability: High-value low-effort work
Created by: slimsag
There are some problems with the src
CLI tool that we could resolve that are low-effort and would give our users large gains. Specifically:
-
It is currently impossible to know which version of the
src
tool is needed for your Sourcegraph version. The latest version of the tool works in the latest version of Sourcegraph, but aside from that you are on your own to figure out which version ofsrc
corresponds to which version of Sourcegraph. -
The
src
tool is broken often due to changes in our GraphQL API. CI on thesrc
tool only runs when people send PRs to it, so we don't notice these breakages. We only guarantee GraphQL API stability on a single version of Sourcegraph.. but this is a signal that what we're doing today doesn't work (if we can't keep our own tool up to date with GraphQL API changes, how on earth would a customer do so?)
Solutions:
-
When we build the Sourcegraph release docker images, have our CI identify what the latest version on https://github.com/sourcegraph/src-cli/releases is. Then have the app redirect requests to e.g. https://sourcegraph.example.com/src-cli/src_darwin_amd64 to the github releases download. This way, it is always easily possible to grab a version of
src
compatible with your Sourcegraph version. Then we can update the src-cli README to reflect this. -
Keep ourselves honest about GraphQL changes: We don't do enough today. We are supposed to document breaking changes here between releases, but many slip through the cracks. This is more important for customers than it is for the
src
tool (which just acts as a test bed for keeping us honest). The way we can do this is by running thesrc-cli
test suite as part of CI in this repo (i.e. clone that repo, runsrc
tests against this Sourcegraph instance the same way we do e2e tests).