test: add unit tests for version-check comparison and skip logic#1343
Closed
Montana wants to merge 1 commit into
Closed
test: add unit tests for version-check comparison and skip logic#1343Montana wants to merge 1 commit into
Montana wants to merge 1 commit into
Conversation
Covers `parseVersion`, `isOlderVersion`, and `skipVersionCheck`: prerelease handling, fail-open on unparseable input, and the dev-build, `SRC_SKIP_VERSION_CHECK`, and `version/help/no-arg skip` paths.
Contributor
|
@Montana please follow the guidance of adding this to your original PR |
Montana
added a commit
to Montana/src-cli
that referenced
this pull request
Jul 1, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Covers
parseVersion,isOlderVersion, andskipVersionCheck: prerelease handling, fail-open on unparseable input, and the dev-build,SRC_SKIP_VERSION_CHECK, andversion/help/no-arg skippaths.