[build] Recommend latest supported JDK in workload metadata - #12500
Conversation
Select the newest non-preview JDK from the installer feed within the workload's supported range instead of reusing the build JDK version. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4b3f9f46-be20-4288-af69-a4f32ef172a1
There was a problem hiding this comment.
Pull request overview
Updates workload metadata to recommend the newest supported, non-preview JDK release while preserving the compatibility range.
Changes:
- Filters JDK revisions to the supported range.
- Selects the latest eligible release.
- Preserves the existing compatibility range.
|
I don't think we even support the 17, where is the 17 coming from? See also: So, we might recommend 21 in .NET 11 and allow up to 25 -- still need to get it working, though. |
|
I traced the Specifically,
{
"version": "[17.0,22.0)",
"recommendedVersion": "17.0.14"
}The NuGet package identifies source commit Current |
|
/review |
|
✅ Android PR Reviewer completed successfully!
|
There was a problem hiding this comment.
❌ Reject
Findings: 1 error, 0 warnings, 0 suggestions.
The supported-range selection fixes the stale JDK recommendation and all 45 reported checks are green. However, the new filter bypasses existing revision normalization and can fail on a previously accepted feed value; address the inline finding before merge.
Generated by Android PR Reviewer for #12500 · gpt56 · 97.8 AIC · ⌖ 8.79 AIC · ⊞ 25.7K
Comment /review to run again
| { | ||
| return GetByRevisions (doc, element) | ||
| .Where (item => { | ||
| var version = new Version (item.Revision); |
There was a problem hiding this comment.
🤖 ❌ Error handling — OrderByRevision() accepts one-component revisions by appending .0, but this new new Version (item.Revision) parses the original raw value. A supported feed entry such as revision="21" will now throw and abort metadata generation. Preserve the normalized Version in GetByRevisions() and compare that here; please add regression coverage for this accepted input.
Rule: Preserve existing input normalization
There was a problem hiding this comment.
I think this it just saying new Version("21") will throw ArgumentException and to check how it's done in other methods in this file.
Summary
jdk.recommendedVersionfrom the newest non-preview, non-obsolete JDK in the Android installer feedFor the current stable inputs, this changes
recommendedVersionfrom17.0.14to21.0.9while leavingversionat[17.0,22.0). This prevents setup tools that honorrecommendedVersionfrom proposing JDK 17 when JDK 21 is supported and preferred.Testing
dotnet build tools/workload-dependencies/workload-dependencies.csproj -p:DotNetStableTargetFramework=net10.0 -p:MonoOptionsVersion=6.12.0.148 -p:NewtonsoftJsonPackageVersion=13.0.3 --no-restore --nologoJavaSdkVersion=17.0.14andLatestSupportedJavaVersion=21.0.99; verifiedversion: "[17.0,22.0)"andrecommendedVersion: "21.0.9"GenerateWorkloadDependenciesthroughtools/workload-dependencies/WorkloadDependencies.proj; verified packageddata/WorkloadDependencies.jsoncontains the expected JDK metadatarecommendedVersion: "17.0.14"