Repository navigation
ci: fail the publish job when the Tier 2 image is not public - #5523
Merged
Merged
Conversation
ci/tier2_image.py opens with "The package must be PUBLIC: anonymous probes and Docker pulls need no credentials, including on forks", but nothing ever checked it. publish() only printed "ensure the GHCR package visibility is public" and moved on, and select_image() treats every probe error as "no image" and silently uses stock Ubuntu. A newly published org package is private by default, so the invariant was never satisfied: prebaked=false appears in every run, including the pool era, and each Linux Tier 2 job re-downloads its package set from archive.ubuntu.com. Add a verify command that probes the identity tag anonymously and fails with the setting to change and the reason, and run it in the publish job after publish. The probe is one request with a 5 s timeout, so the cost is nil and a future regression cannot hide for another cycle. Note: merging this before the package is public turns master pushes red on purpose. Flip the visibility first.
The ci/ self-test gate fails any test that prints a ResourceWarning (#2235), and verify() turned a private-package HTTPError into a SystemExit without closing the response it held. Close it first and read the status before, so the failure message and the gate both stay correct.
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.
Short answer: nothing stops it. Oversight, confirmed in the code.
ci/tier2_image.pyopens with:…and the image is nothing but
ubuntu:26.04plus 85 Ubuntu packages (rust/tools/linux-validate/apt-packages.txt) and six bootstrap packages (git ca-certificates curl sudo zstd eatmydata), all installed from the public Ubuntu archive. No OBS source, no credentials, no private toolchain. The Dockerfile and both package lists are already in this public repo, so the image leaks nothing that isn't already public.What actually went wrong
publish()only printedPublished {tag}; ensure the GHCR package visibility is publicand carried on.select_image()treats every probe error as "no image" and silently returns stock Ubuntu.So the flip was never done, nothing failed, and
prebaked=falsehas appeared on every run since the image was introduced — including the whole pool era.This PR
Adds
ci/tier2_image.py verify, which probes the identity tag anonymously and fails with the exact setting to change:and runs it in the
tier2-imagepublish job immediately after publish — one HTTP request with the module's existing 5 s timeout.Also drops the now-redundant "ensure the visibility is public" print, since the next step enforces it.
Merge order matters
Flip the package to public before merging this, otherwise master pushes go red by design. That red is the point: the failure mode we're removing is a silent one that survived months.
Tests
New cases:
verifyexits non-zero for 401/403/404 with the settings URL in the message, exits non-zero when the tag is missing, passes on an anonymous read; and the publish job runsverifyafterpublish.