Repository navigation
fix(ci): read java_vendor before overwriting java_distribution - #4255
Merged
Merged
Conversation
The per-row post-processing overwrote `v.java_distribution` with its
string `.value` and only then read `.vendor` from it, so `v.java_vendor`
was always `undefined`. That empty value flowed into
`jdkTestVendor=${{ matrix.java_vendor }}` in main.yml, leaving the Gradle
test toolchain unconstrained by vendor.
Destructure `value` and `vendor` before the overwrite so the read no
longer depends on statement order. The later `java_distribution === 'oracle'`
checks still see the string value.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4255 +/- ##
============================================
- Coverage 70.46% 70.43% -0.04%
+ Complexity 5306 5301 -5
============================================
Files 244 244
Lines 21962 21962
Branches 3688 3688
============================================
- Hits 15476 15469 -7
- Misses 4840 4843 +3
- Partials 1646 1650 +4 🚀 New features to boost your workflow:
|
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.
Why
In the matrix generator, per-row post-processing overwrote
v.java_distributionwith its string.valueand only afterwards read.vendorfrom it:So
v.java_vendorwas alwaysundefined. It feedsjdkTestVendor=${{ matrix.java_vendor }}inmain.yml, which sets the Gradle test toolchain vendor (JvmVendorSpec.matching(...)inbuild-logic/basics/src/main/kotlin/configureToolchain.kt). An empty value left the test JDK unconstrained by vendor.What
Destructure
valueandvendorbefore the overwrite, so the read no longer depends on statement order:The later
v.java_distribution === ""oracle""checks run after this block and rely onv.java_distributionalready being the string value, which the fix preserves.main.ymlprovisions the matching-vendor JDK viaactions/setup-javawithdistribution: ${{ matrix.java_distribution }}, so pinning the vendor in the toolchain spec resolves against an already-installed JDK and does not needorg.gradle.java.installations.auto-download.The same bug and the same destructuring fix were applied in apache/jmeter""s
.github/workflows/matrix.js.How to verify
npm ci --prefix .github/workflowsMATRIX_JOBS=8 node .github/workflows/matrix.mjsjava_vendor— one of amazon, bellsoft, microsoft, oracle, eclipse, azul — and none isundefined.🤖 Generated with Claude Code