Skip to content

fix(versioncheck): reject op-stack service-build tags in isStableTag - #7

Merged
tazhate merged 1 commit into
masterfrom
fix/versioncheck-unstable-tag-filter
Jun 14, 2026
Merged

fix(versioncheck): reject op-stack service-build tags in isStableTag#7
tazhate merged 1 commit into
masterfrom
fix/versioncheck-unstable-tag-filter

Conversation

@tazhate

@tazhate tazhate commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

isStableTag in cmd/versioncheck/main.go used a substring denylist of pre-release keywords. op-stack repos publish service/CI builds whose suffixes were not in that list, so versioncheck picked junk tags as "latest" and would write them into versions_gen.go.

This replaces the brittle keyword 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 (^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

Tag Before After
v1.101511.1-cdfpl.1 stable (selected) unstable (skipped)
v1.101605.0-synctest.0 stable (selected) unstable (skipped)
v1.101308.2-overrides.1 stable (selected) unstable (skipped)
v1.2.3-rc.1 unstable unstable
v28.0 stable stable
v1.101411.2 stable stable
GreatVoyage-v4.8.1 stable stable
mainnet-v1.8.0 stable stable
1.37.2 / 10.6.2 stable stable

Test plan

  • Added 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-existing TestControllers failure (missing bin/k8s envtest binary, unrelated to this change).

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
tazhate force-pushed the fix/versioncheck-unstable-tag-filter branch from 7b6f6c1 to c617a90 Compare May 28, 2026 17:22
@tazhate
tazhate merged commit f72254c into master Jun 14, 2026
0 of 9 checks passed
@tazhate
tazhate deleted the fix/versioncheck-unstable-tag-filter branch June 14, 2026 07:18
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.

1 participant