fix(mirror): read the tag list from the source registry - #46
Merged
Conversation
The mirror derived its tags from resolvePublishMatrix, which describes what a release publishes *now*. #38 narrows that function to the default contracts version, so `resolvePublishMatrix('all', 'all')` drops from 11 rows to 7 and `(…, 'v2.1')` returns none at all. Mirroring an older release would then copy 7 of its 11 tags and report success, and asking for v2.1 would fail as an empty matrix. `crane ls` on the source repository answers what actually exists, so the mirror copies what a release really published rather than what current rules would publish. Verified against the live package: v0.2.10 resolves all 11 tags including the four nc2.1 ones, a single variant+contracts filter resolves exactly one, and an unknown version fails. Both steps move into scripts/ci, matching the other CI helpers, so the loop is readable and testable outside a workflow run. Behavior otherwise unchanged: skip-if-current, refuse-on-divergence unless overwrite, digest asserted after every copy. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.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.
Fixes a silent-truncation bug that #38 will trigger, and moves the mirror's logic into
scripts/cialongside the other CI helpers.The bug
The mirror derived its tag list from
resolvePublishMatrix, which describes what a release publishes now. #38 narrows that function to the default contracts version:So once #38 lands, mirroring an older release would copy 7 of its 11 tags and report success, and asking for
v2.1would die as an empty matrix. Silent truncation is the worse half: a mirror that copies fewer tags than exist looks like it worked.The fix
crane lson the source repository answers what actually exists, rather than what current publishing rules would produce. That also removes the mirror's dependency on publish-time logic it has no reason to share.Verified against the live package:
v0.2.10, all, allnc2.1v0.2.10,l3-custom-6,v2.1v9.9.9, all, allAlso
Both steps move to
scripts/ci/resolve-mirror-tags.mjsandscripts/ci/mirror-tags.mjs, matchingprepare-testnode-context.mjsand friends, so the copy loop is readable and runnable outside a workflow.Behavior is otherwise unchanged: skip when the destination already carries the source digest, refuse when it differs unless
overwrite, and assert the digest after every copy. The Hub API is still what answers "does the destination tag exist", since Docker Hub returns 401 for an unknown repository and that is indistinguishable from bad credentials.pnpm lint,pnpm typecheckclean;pnpm test:run245/248 with the 3 pre-existingtoken-bridgeenv failures.