Resolve the latest release image to a published version - #7786
Open
CharlieTLe wants to merge 1 commit into
Open
Conversation
integration/util.go derived the "latest release" image straight from the VERSION file. That holds on master, where VERSION is the last GA, but not on a release branch: VERSION is bumped to the version being prepared (e.g. 1.22.0-rc.0) long before the deploy job publishes that tag, and the integration job is a dependency of deploy. So the query fuzz leg would pull an image that does not exist yet. Resolve a pre-release version to the release preceding it instead, and add CORTEX_LATEST_RELEASE_IMAGE as an escape hatch for the cases the version math cannot cover (a major pre-release). The preload step in test-build-deploy.yml mirrors the same rule. Signed-off-by: Charlie Le <charlie_le@apple.com>
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.
What this fixes
getLatestReleaseImage()inintegration/util.goderives the "latest release" imagestraight from the
VERSIONfile, and.github/workflows/test-build-deploy.ymlmirrors itas
docker pull quay.io/cortexproject/cortex:v$(cat testdata/VERSION).That holds on
master, whereVERSIONis the last GA and its image exists. It does nothold on a release branch:
VERSIONis bumped to the version being prepared (e.g.1.22.0-rc.0) long before anything publishes that tag, and thedeployjob that wouldpublish it has
needs: [build, test, lint, integration]. So theintegration_query_fuzzleg would try to pull an image that does not exist yet, and
release-1.22would be redfrom the moment
VERSIONgains its-rc.0suffix.This mechanism landed in #7737 (2026-07-30), after v1.21.1, so it has never been through
a release.
The fix
Resolve a pre-release version to the release preceding it, which is always already
published by then:
VERSION1.21.1v1.21.1(master's steady state — the last GA)1.22.0-rc.0v1.21.0(the previous minor always shipped a.0)1.22.2-rc.1v1.22.1(the preceding patch of the same minor)Using the previous minor's
.0rather than its newest patch keeps this derivable fromVERSIONalone, and the difference is immaterial for a backward-compatibility fuzz test.A major pre-release (
2.0.0-rc.0) is not derivable, so that case errors with a messagepointing at
CORTEX_LATEST_RELEASE_IMAGE, a new env override that short-circuits theresolution entirely.
The preload step in
test-build-deploy.ymlmirrors the same rule, including the override.Known gap
This does not cover the GA tag build. On the
v1.22.0tag push,VERSIONis1.22.0with no suffix, so it resolves to
v1.22.0— whichdeployhas not published yet at thepoint
integrationruns. That is the same bug class and it will bite once, on the GA tag.CORTEX_LATEST_RELEASE_IMAGEis the lever for that run. Raising it here rather thansilently widening the change.
Verification
latestReleaseVersion()has a table test covering all rows above plus the error cases;getLatestReleaseImage()is tested end to end against a scratch checkout whoseVERSIONcontains1.22.0-rc.0.go vetpasses with every integration build tag set.