Open
Conversation
Add JDK 25 to CI test matrices (sbt and Maven jobs), a minimized25 test project, and version parsing coverage to confirm the compiler plugin works correctly on JDK 25. Closes sourcegraph#857
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.
Add JDK 25 to CI test matrices (sbt and Maven jobs), a minimized25 test project, and version parsing coverage to confirm the compiler plugin works correctly on JDK 25.
Closes #857
Test plan
Environment
What was changed
build.sbtminimized25sbt project targeting JDK 25.github/workflows/ci.yml25to Java version matrix in bothtestandmavenCI jobstests/unit/src/test/scala/tests/JavaVersionSuite.scala"25.0.1"tests/buildTools/src/test/scala/tests/GradleBuildToolSuite.scala25toallJavalistTest 1: Compiler plugin compiles under JDK 25
The
minimized25sbt project usesjavaToolchainVersion := "25"and shares the same Java sources as all otherminimized*projects (tests/minimized/src/main/java). It injectssemanticdb-javacas a javac plugin via the agent and verifies it can compile real Java sources and emit SemanticDB output under JDK 25.Command:
Result:
Warnings observed were pre-existing and unrelated to JDK 25:
sun.misc.Unsafe::arrayBaseOffsetdeprecation from protobuf (affects all JDK versions)source value 8 is obsoletefrom javac-source 8flag (affects all JDK versions)Test 2: Version string parsing
JavaVersionparses the JVM version string fromSystem.getProperty("java.version")to determine the major version. JDK 25 uses the format"25.0.x"(no1.prefix), which is the same modern format introduced in JDK 9.Command:
sbt "unit/testOnly tests.JavaVersionSuite"Result:
Test 3: End-to-end indexing pipeline on JDK 25
This is the most comprehensive test. It exercises the full pipeline:
semanticdb-javacinjected as a javac plugintarget/semanticdb-targetroot/scip-java index-semanticdbreads the SemanticDB files and producesindex.scipStep 1 — Build and publish the CLI locally:
Step 2 — Compile
examples/maven-examplewith the plugin:Result:
Step 3 — Convert SemanticDB to SCIP:
$SCIP_JAVA_CLI index-semanticdb target/semanticdb-targetrootStep 4 — Verify output:
Result:
index.scipwas produced with non-zero size, confirming the full pipeline works on JDK 25.CI coverage
The CI matrix in
.github/workflows/ci.ymlnow runs against[8, 11, 17, 21, 25]for both thetestjob (sbt) and themavenjob, ensuring JDK 25 is validated on every future PR automatically.Why no code changes were needed in the core
The
semanticdb-javacplugin uses only stable, long-lived APIs:com.sun.source.util.Plugin— the standard compiler plugin interface, stable since Java 8com.sun.source.util.TaskListener/TaskEvent.Kind.ANALYZE— hooks into the javac analysis phase, unchanged across versionsjavax.lang.model.*— the standard Java language model API, stable since Java 6The
--add-exportsflags already present for Java 17+ (jdk.compiler/com.sun.tools.javac.*=ALL-UNNAMED) continue to apply and work correctly on JDK 25.The
roundToNearestStableRelease()method inJavaVersion.javaalready handles versions beyond 17 via areturn versionfallthrough — no explicit JDK 25 constant is required.