Repository navigation
testserver: switch release lookup to the CockroachDB release catalog - #194
Merged
Merged
Conversation
getLatestStableVersionInfo used to fetch the docs repo's releases.yml (a bare list of releases) to determine the latest stable CockroachDB version to download. Point it at the CockroachDB release catalog at https://binaries.cockroachdb.com/releases/v1/releases.yaml instead, which is now the source of truth. The catalog's top level is a {schema_version, releases} document rather than a bare list, and its release entries use `version` where the old data used `release_name`. Reject any schema_version other than 1, and check the HTTP status of the download, which the old code did not do. The catalog never contains cloud-only builds, so the cloud_only filtering is removed; the exported Release.CloudOnly field stays, deprecated and always false, so code that uses it still builds. The version-picking logic (skip unparseable names, withdrawn releases, and prereleases; keep the highest remaining version) is unchanged, and is now covered by a table-driven test using a local HTTP server.
Member
binaries_test.go is an in-package test (package testserver), because it tests an unexported function. With it, go vet reports the testserver package under the test-variant header "# [github.com/cockroachdb/cockroach-go/v2/testserver]", which the vet step's filter did not list. The findings under it are the same shadowed err declarations the step already ignores, so only the header was left, and it failed the step. Filter that header too, like the other two. It drops only the header line, so any other vet finding still fails the step.
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.
getLatestStableVersionInfoused to fetch the docs repo'sreleases.yml(a bare list) to pick the latest stable CockroachDB version to download
for tests. This switches it to the CockroachDB release catalog at
https://binaries.cockroachdb.com/releases/v1/releases.yaml, which is now
the source of truth; the docs copy will stop being maintained.
Changes:
{schema_version, releases}instead of abare list), and the release-name field is now called
versioninsteadof
release_name.cloud_onlyfiltering is removed. The exported
Release.CloudOnlyfield stays,deprecated and always false, so code that uses it still builds.
schema_versionnow produces an error, neither of which the old codedid.
keep the highest remaining version) is unchanged.
using a local HTTP fixture server.
Verified against live data that this picks a newer version (v26.3.2) than
the old docs-based lookup would (v26.3.1), because the docs copy is
missing several recent releases. Ran the full
testservertest suite,including tests that download real CockroachDB binaries and start real
clusters; all pass except one pre-existing, unrelated failure
(
TestRunServer/InsecureCustomVersion, a 404 for an old version'sdarwin-arm64 binary, reproducible on
master).