Match a distribution whose candidate carries a vendor build - #1225
Merged
Conversation
SDKMAN candidates now read `17.0.20+1.1-zulu`, and the build lands in the qualifier that the distribution is matched against, so no candidate for the requested distribution survives the filter and the recipe stops upgrading. Only a build is tolerated ahead of the distribution rather than anything at all: a variant such as `.crac-zulu` is a distinct distribution, and a plain request should keep on not selecting it.
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.
UpdateSdkManTesthas four failures onmain, which fail every open PR. They are not caused by any of them.What happened
The automated candidate refresh (
[Auto] SDKMAN! Java candidates as of 2026-08-24T1031, 4d52274) changed identifiers to carry the vendor build:38 of the 92 candidates now have one, across
-zulu,-msand-librca.Why it breaks distribution matching
VersionComparator.RELEASE_PATTERNcaptures the qualifier as(?<qualifier>[-.+].*?$), so it begins at the first-,.or+. The recipe passes the distribution toLatestReleaseas the metadata pattern, andcheckVersionrequires the whole qualifier to match it:-zulu17.0.20-zulu-zulu17.0.20+1.1-zulu+1.1-zuluEvery candidate for the requested distribution is filtered out, no ideal candidate is found, and the recipe makes no change — which is what the four tests report.
Fix
Tolerate a build ahead of the distribution when matching:
Deliberately narrow rather than
.*. A distribution variant is also part of the qualifier —.crac-zuluis a different distribution from-zulu, andzuluNonCracexists to assert that a plain request does not select the CRaC build..*-zuluwould match it and quietly break that guarantee;(\+[^-]*)?-zulucannot, because a variant does not begin with+.The same pattern is used for the downgrade check, so both sides of the comparison agree on what the distribution is.
Tests
distributionIsStillMatchedWhenTheCandidateCarriesAVendorBuildcovers an.sdkmanrcthat already pins a build, andzuluNonCracgains an explicitdoesNotContain(".crac")so the narrowness above is asserted rather than assumed.Reverting only the main source fails five tests including the two above; with the fix,
UpdateSdkManTestis 18/18 and the full suite is green.Worth noting separately
An fx candidate now reads
11.0.32-fx+1.1-librca, where the build sits after the variant. A request whose distribution is.fx-librcastill will not match it, since the build is not adjacent to the distribution in that layout. No test covers that shape today and none of the current failures involve it, so it is left alone here rather than guessed at.