| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Before running a command, src does a best-effort check of the running version against the version recommended by the configured instance (/.api/src-cli/version) and prints a single stderr warning when behind. Fail-open, 3s timeout, stderr only so --json is unaffected. Skips version/help/no-arg, dev builds, and SRC_SKIP_VERSION_CHECK. Compares major/minor/patch only. Adds unit tests. Closes sourcegraph#930. Supersedes sourcegraph#1339, sourcegraph#1343.
| Back | FazBrowse Home | New Git URL |
Hey @burmudar,
This is superseded by my last PR. I've consolidated the implementation, the main() wiring, and these tests into a single PR that builds. Splitting the tests out on their own was my mistake; on its own that branch didn't compile. I've run the go checks locally (build and tests on 1.26.4) and they pass without error.
What's in it:
One design note worth flagging: the check runs before flag parsing, so -endpoint and -config passed as flags aren't picked up by the early config read. The endpoint resolves from SRC_ENDPOINT, the config file, or the default. I kept it there to preserve the fail-open behavior, but happy to move the call after config resolution if you'd rather flags be honored.
I'll close #1339 and #1343 as superseded. PTAL when you have a chance.
Cheers,
Michael