Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe PR sets a global Java toolchain in the test conventions to languageVersion 26 and vendor Azul, expands the generated per-JDK Test tasks to include JDK 26 (adding Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle`:
- Line 81: The shared convention is enabling testJdk26 via the loop that
registers JDK test tasks (e.g., the block iterating [21,26].each { majorVersion
-> ... } that creates testJdk26), which causes modules that explicitly target a
fixed JDK (such as jdk-recent-unit-tests) to inherit it; update those module
build scripts that enforce a single recent JDK target to disable the inherited
testJdk26 by adding onlyIf { false } to the testJdk26 task registration (i.e.,
locate the testJdk26 TaskProvider or task configuration in the module and append
onlyIf { false } so the task is skipped).
In `@gradle/libs.versions.toml`:
- Line 5: The dependency version for the 'wala' entry in
gradle/libs.versions.toml is set to a non-existent "1.7.0"; change the value of
the wala key to a valid release such as "1.6.12" (or "1.6.13-SNAPSHOT" if you
need a snapshot) so the build can resolve the artifact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: c259de33-1ec9-4637-89bf-8ea5334055fe
📒 Files selected for processing (3)
buildSrc/src/main/groovy/nullaway.java-test-conventions.gradlegradle/libs.versions.tomljdk-recent-unit-tests/build.gradle
|
|
||
| // Tasks for testing on other JDK versions; see https://jakewharton.com/build-on-latest-java-test-through-lowest-java/ | ||
| [21].each { majorVersion -> | ||
| [21,26].each { majorVersion -> |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Read-only verification: check toolchain resolver + CI JDK 26 setup.
set -euo pipefail
echo "== settings.gradle* files =="
fd -i 'settings.gradle*' -x sed -n '1,220p' {}
echo
echo "== Toolchain-related config in Gradle files/properties =="
rg -n -C3 --iglob '*.gradle' --iglob '*.gradle.kts' --iglob 'gradle.properties' \
'foojay|toolchainManagement|javaRepositories|javaToolchains|org\.gradle\.java\.installations|auto-download'
echo
echo "== CI workflow Java setup (looking for 26) =="
rg -n -C3 --iglob '*.yml' --iglob '*.yaml' \
'actions/setup-java|java-version|distribution|temurin|zulu|26'Repository: uber/NullAway
Length of output: 5555
🏁 Script executed:
# Check if any modules disable testJdk26 using onlyIf
rg -n 'testJdk26' --iglob '*.gradle' --iglob '*.gradle.kts' -A 3Repository: uber/NullAway
Length of output: 39
🌐 Web query:
Foojay resolver Gradle plugin version 1.0.0 Java 26 support toolchain
💡 Result:
The Foojay resolver Gradle plugin version 1.0.0, released on May 19, 2025, supports Java toolchains via the Foojay Disco API. Java 26 reached general availability on March 17, 2026. The plugin resolves toolchains using the major Java version specified in the toolchain, querying the Disco API for matching distributions. No sources indicate limitations preventing Java 26 support; the plugin dynamically fetches available JDKs from the API, which tracks all OpenJDK builds including recent releases like Java 26. The plugin requires Gradle 7.6+ and Java 17+ to run. Usage example in settings.gradle.kts: plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" } java { toolchain { languageVersion.set(JavaLanguageVersion.of(26)) } }
Citations:
- 1: https://plugins.gradle.org/plugin/org.gradle.toolchains.foojay-resolver/1.0.0
- 2: https://mvnrepository.com/artifact/org.gradle.toolchains/foojay-resolver/1.0.0
- 3: https://github.com/gradle/foojay-toolchains
- 4: https://plugins.gradle.org/plugin/org.gradle.toolchains.foojay-resolver
- 5: https://github.com/gradle/foojay-toolchains/blob/4b5f91e9/CHANGELOG.md
- 6: https://openjdk.org/projects/jdk/26
- 7: https://www.javaalmanac.io/jdk/26/
🏁 Script executed:
# Search for onlyIf { false } pattern on test tasks to understand skip pattern
rg -n 'onlyIf\s*\{\s*false\s*\}' --iglob '*.gradle' --iglob '*.gradle.kts' -B 2Repository: uber/NullAway
Length of output: 1468
🏁 Script executed:
# Check if any modules have JDK version constraints that would exclude JDK 26
rg -n 'sourceCompatibility|targetCompatibility|languageVersion' --iglob '*.gradle' --iglob '*.gradle.kts' | grep -E '(21|22|23|24|25)' | head -20Repository: uber/NullAway
Length of output: 1973
🏁 Script executed:
# Check jdk-recent-unit-tests full build.gradle to understand its testing strategy
cat -n jdk-recent-unit-tests/build.gradle | head -80Repository: uber/NullAway
Length of output: 2802
🏁 Script executed:
# Search for any conditional logic or patterns that might auto-skip newer JDK tests
rg -n 'testJdk' buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle -A 5 -B 2Repository: uber/NullAway
Length of output: 829
Add explicit testJdk26 disable to modules with fixed JDK targets, like jdk-recent-unit-tests.
Foojay resolver 1.0.0 properly provisions Java 26 toolchains via the Disco API; the shared convention's addition of testJdk26 won't cause CI hard-failures. However, jdk-recent-unit-tests explicitly targets JDK 25 and disables testJdk17 and testJdk21 to enforce this (per its comment "we only run on the recent JDK version specified above"). This module now inherits testJdk26 from the shared convention but does not disable it, breaking its module-specific JDK targeting. Add onlyIf { false } to testJdk26 in affected modules using fixed JDK versions.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle` at line 81,
The shared convention is enabling testJdk26 via the loop that registers JDK test
tasks (e.g., the block iterating [21,26].each { majorVersion -> ... } that
creates testJdk26), which causes modules that explicitly target a fixed JDK
(such as jdk-recent-unit-tests) to inherit it; update those module build scripts
that enforce a single recent JDK target to disable the inherited testJdk26 by
adding onlyIf { false } to the testJdk26 task registration (i.e., locate the
testJdk26 TaskProvider or task configuration in the module and append onlyIf {
false } so the task is skipped).
There was a problem hiding this comment.
We should run jdk-recent-unit-tests on JDK 25 and newer. I'll clarify the comment to indicate this
There was a problem hiding this comment.
@msridhar, thanks for the clarification! That makes sense — jdk-recent-unit-tests is intended to run on JDK 25 and newer, so inheriting testJdk26 from the shared convention is exactly the right behavior. My concern was incorrect. Appreciate you updating the comment to make this intent clear.
✏️ Learnings added
Learnt from: msridhar
Repo: uber/NullAway PR: 1526
File: buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle:0-0
Timestamp: 2026-04-13T19:39:37.891Z
Learning: In the NullAway repo, the `jdk-recent-unit-tests` module is intentionally run on JDK 25 AND all newer JDK versions (e.g., JDK 26). It should NOT disable newer JDK test tasks like `testJdk26` inherited from the shared `nullaway.java-test-conventions.gradle` convention. The module's purpose is to test on the latest/recent JDKs (25+), not exclusively on JDK 25.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
🧠 Learnings used
Learnt from: msridhar
Repo: uber/NullAway PR: 1245
File: guava-recent-unit-tests/src/test/java/com/uber/nullaway/guava/NullAwayGuavaParametricNullnessTests.java:101-102
Timestamp: 2025-08-14T18:50:06.159Z
Learning: In NullAway JSpecify tests, when JDK version requirements exist due to bytecode annotation reading capabilities, prefer failing tests over skipping them on unsupported versions to ensure CI catches regressions and enforces proper JDK version usage for developers.
Learnt from: msridhar
Repo: uber/NullAway PR: 1243
File: jdk-annotations/astubx-generator/build.gradle:22-22
Timestamp: 2025-10-09T19:59:16.543Z
Learning: When disabling testJdk17 tasks for modules requiring JDK 21, use `onlyIf { false }` to skip the task:
```gradle
tasks.named("testJdk17").configure {
onlyIf { false }
}
```
Do not use `doFirst { throw new GradleException(...) }` as it will cause CI failures when the task is executed.
Learnt from: CR
Repo: uber/NullAway PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-08T19:11:30.754Z
Learning: Run tests for the main NullAway module using `./gradlew :nullaway:test`; use `--tests` flag to run specific test classes or methods
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle (1)
90-93:⚠️ Potential issue | 🟠 MajorExplicitly set vendor to AZUL in
launcherForto prevent non-Azul JDK resolution.The
launcherForcall with onlylanguageVersionallows Gradle to select any vendor matching the version, bypassing the Azul constraint. According to Gradle toolchain specifications, vendor defaults to "any" if not explicitly set inside thelauncherForblock and is not inherited from the project'sjava.toolchainconfiguration.🔧 Proposed fix
- javaLauncher = javaToolchains.launcherFor { - languageVersion = JavaLanguageVersion.of(majorVersion) - } + javaLauncher = javaToolchains.launcherFor { + languageVersion = JavaLanguageVersion.of(majorVersion) + vendor = JvmVendorSpec.AZUL + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle` around lines 90 - 93, The toolchain launcher currently only sets languageVersion in the javaToolchains.launcherFor block (in the test task registered as "testJdk$majorVersion" that assigns javaLauncher), which allows any vendor; update the launcherFor block to explicitly set the vendor to Azul by adding vendor = JvmVendorSpec.AZUL inside javaToolchains.launcherFor so Gradle resolves an Azul JDK rather than any vendor.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle`:
- Around line 90-93: The toolchain launcher currently only sets languageVersion
in the javaToolchains.launcherFor block (in the test task registered as
"testJdk$majorVersion" that assigns javaLauncher), which allows any vendor;
update the launcherFor block to explicitly set the vendor to Azul by adding
vendor = JvmVendorSpec.AZUL inside javaToolchains.launcherFor so Gradle resolves
an Azul JDK rather than any vendor.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 53da8dec-8c7b-4815-8c7f-dd241fb100b7
📒 Files selected for processing (1)
buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1526 +/- ##
=========================================
Coverage 88.48% 88.48%
Complexity 2843 2843
=========================================
Files 103 103
Lines 9489 9489
Branches 1905 1905
=========================================
Hits 8396 8396
Misses 531 531
Partials 562 562 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Partially addresses #1525. We update WALA to get JDK 26 support.
Summary by CodeRabbit
New Features
Chores