fix(versioncheck): reject op-stack service-build tags in isStableTag - #7
Merged
Merged
Conversation
isStableTag relied on a keyword denylist of pre-release suffixes, which let op-stack service builds slip through and be chosen as "latest": v1.101511.1-cdfpl.1, v1.101605.0-synctest.0, v1.101308.2-overrides.1. Replace the brittle substring denylist with a structural check: after stripping the policy TagPrefix and any known network prefix (mainnet-/testnet-/GreatVoyage-/scroll-/plume-/ARROWHEAD-), the tag must match a clean dotted-numeric semver (optional leading "v") with no "-<suffix>" component. Floating tags (latest/nightly/main/...) and any build/pre-release suffix are now rejected uniformly. Add TestIsStableTag covering stable (v28.0, v1.101411.2, GreatVoyage-v4.8.1, mainnet-v1.8.0, 1.37.2, 10.6.2) and unstable cases (cdfpl/synctest/overrides/rc/beta/debug/fork/untagged/floating). Also anchor the bare "versioncheck" .gitignore pattern to "/versioncheck" so it no longer swallows the cmd/versioncheck package's new test file. Context: investigated why versioncheck picked junk op-stack tags, traced the suffix shapes against the existing denylist in cmd/versioncheck, and tested the regex against real tag samples plus the registry semver tests. Caught the new test file being silently gitignored by an unanchored binary pattern while verifying the commit. Spent ~30min reproducing the bad-tag selection and validating backward compat with existing tests.
tazhate
force-pushed
the
fix/versioncheck-unstable-tag-filter
branch
from
May 28, 2026 17:22
7b6f6c1 to
c617a90
Compare
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.
Summary
isStableTagincmd/versioncheck/main.goused a substring denylist of pre-release keywords. op-stack repos publish service/CI builds whose suffixes were not in that list, soversioncheckpicked junk tags as "latest" and would write them intoversions_gen.go.This replaces the brittle keyword denylist with a structural check: after stripping the policy
TagPrefixand any known network prefix (mainnet-,testnet-,GreatVoyage-,scroll-,plume-,ARROWHEAD-), the tag must match a clean dotted-numeric semver (^v?[0-9]+(\.[0-9]+)*$) with no-<suffix>. Any pre-release/build suffix or floating tag is now rejected uniformly, including future suffixes we have not seen yet.Before / After
v1.101511.1-cdfpl.1v1.101605.0-synctest.0v1.101308.2-overrides.1v1.2.3-rc.1v28.0v1.101411.2GreatVoyage-v4.8.1mainnet-v1.8.01.37.2/10.6.2Test plan
TestIsStableTag(cmd/versioncheck/main_test.go) covering stable and unstable cases above.go build ./...— green.go test ./cmd/versioncheck/ ./internal/registry/— 26 passing.go test ./cmd/... ./internal/...— green except the pre-existingTestControllersfailure (missingbin/k8senvtest binary, unrelated to this change).