Skip to content

testserver: switch release lookup to the CockroachDB release catalog - #194

Merged
rafiss merged 2 commits into
masterfrom
rail/release-catalog
Sep 25, 2026
Merged

rafiss merged 2 commits into
masterfrom
rail/release-catalog

Conversation

@rail

@rail rail commented Sep 25, 2026

Copy link
Copy Markdown
Member

getLatestStableVersionInfo used to fetch the docs repo's releases.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:

  • New URL, new top-level shape ({schema_version, releases} instead of a
    bare list), and the release-name field is now called version instead
    of release_name.
  • 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 download's HTTP status is now checked, and an unexpected
    schema_version now produces an error, neither of which the old code
    did.
  • Version-picking behavior (skip unparseable names/withdrawn/prerelease,
    keep the highest remaining version) is unchanged.
  • Added unit tests for the parsing/selection logic (none existed before)
    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 testserver test 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's
darwin-arm64 binary, reproducible on master).

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.
@cockroach-teamcity

Copy link
Copy Markdown
Member

This change is Reviewable

@rail
rail requested a review from rafiss September 25, 2026 01:39
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.

@rafiss rafiss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@rafiss
rafiss merged commit 55cb2c2 into master Sep 25, 2026
3 checks passed
@rafiss
rafiss deleted the rail/release-catalog branch September 25, 2026 21:38
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.

3 participants