Skip to content

feat: warn when src-cli is older than the instance's recommended version#1338

Open
Montana wants to merge 1 commit into
sourcegraph:mainfrom
Montana:patch-1
Open

feat: warn when src-cli is older than the instance's recommended version#1338
Montana wants to merge 1 commit into
sourcegraph:mainfrom
Montana:patch-1

Conversation

@Montana

@Montana Montana commented Jun 30, 2026

Copy link
Copy Markdown

Before running any command, src now does a best-effort check of the running version against the version recommended by the configured Sourcegraph instance (the existing /.api/src-cli/version endpoint) and prints a single warning to stderr when it is behind.

The check is fail-open:

  • Missing config, network errors, an unreachable instance, or an unparseable
    version all result in no warning.
  • A 3s timeout ensures it never noticeably delays the command.
  • It writes to stderr, so --json output is unaffected.
  • It skips version/help/no-arg invocations, dev builds, and any run with
    SRC_SKIP_VERSION_CHECK set.
  • Comparison is limited to major/minor/patch, so prereleases do not produce
    spurious warnings.

Closes #930

@burmudar

burmudar commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@Montana thanks for your contribution!

I think there are some missing parts here. None of the methods added here are used anywhere?

@burmudar

burmudar commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@Montana as mentioned in your other PR. Please add your tests and functionality to this PR.

I will close the other two PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn on any command if not on latest version

2 participants