Repository navigation
core: let serveModule pins win over version queries - #14284
Merged
Merged
Conversation
A generated client pairs a version query with the commit its lock resolved, so a newer matching tag must not stop it from loading. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
marked this pull request as ready for review
September 22, 2026 20:11
vito
approved these changes
Sep 23, 2026
This was referenced Oct 20, 2026
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.
Problem
Query.serveModulere-resolves a module address before serving it. When that address carries a full-commitrefPinand a version query such as@v1, the two can disagree once the target repository publishes a newer tag:@v1now resolves to a different commit than the pinned SHA.A generated client embeds the exact commit its lock resolved, paired with that version query. If serving re-resolves
@v1to the newer tag instead of honoring the pin, the client is served a different module than the one it was generated against — a newer matching tag stops the client from loading the commit it expects.Fix
serveModulenow loads the full-SHArefPindirectly, even when the version query has since moved to resolve to a different tag. The pinned commit wins.Query.moduleSourceand[[dependencies]]resolution are unchanged: they still enforce the existing rule that a pin and a version query must agree.Test
TestServeModulePinnedVersionQuery(core/integration/module_serve_test.go) reproduces the divergence — a pinned commit paired with a version query that a newer tag has moved. It was verified failing before the fix and passing after. The same test keeps a regression check thatmoduleSourcestill enforces the old agreement rule.Fixes: #13625
📄 Understanding this change