Skip to content

fix: keep the Kotlin plugin extension, which CodeQL's extractor depends on - #523

Merged
zantvoort merged 4 commits into
mainfrom
codeql-dokka-skip
Aug 22, 2026
Merged

fix: keep the Kotlin plugin extension, which CodeQL's extractor depends on#523
zantvoort merged 4 commits into
mainfrom
codeql-dokka-skip

Conversation

@zantvoort

@zantvoort zantvoort commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

CodeQL's java-kotlin analysis has failed on every run since #521, on main and on every PR. This restores it, and records why the change that broke it cannot simply be redone.

The failure

CodeQL default setup autobuilds with mvnw clean package -Dmaven.javadoc.skip -DskipTests ... and the reactor dies two modules from the end:

[31/34] Storm Ktor          kotlin:2.3.10
[32/34] Storm Kotlin Test   kotlin:2.0.21:kapt (default-kapt)   <-- fails
The provided plugin com.github.codeql.KotlinExtractorComponentRegistrar is not compatible with this version of compiler.
java.lang.AbstractMethodError: Receiver class com.github.codeql.KotlinExtractorComponentRegistrar does not define or
inherit an implementation of the resolved method 'abstract void registerProjectComponents(...)' of interface
org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar.

CodeQL injects its extractor into each Kotlin compilation as a compiler plugin. Not the CodeQL version, which is 2.26.3 in the last green run and in every failing one, and not the reactor order, which is identical. Mixed Kotlin versions are not inherently the problem either: kotlin:2.0.21 at [27/34] and kotlin:2.3.10 at [31/34] both extract fine in the failing run.

Which half

#521's build tidy-up did two things, and the culprit is the one that looked most obviously safe.

<extensions>true</extensions> on kotlin-maven-plugin contributes the plugin's lifecycle mapping, which synthesises default-compile and default-kapt executions beside the declared ones. Removing it stopped the reactor compiling everything twice, which is why I removed it. It also changes what CodeQL's extractor binds against, and the analysis fails on a later module.

Isolated in #524: Dokka 2.2.0 with the extension left in place analyses green. So Dokka is innocent and stays at 2.2.0, keeping the metadata fix for the two modules Dokka 2.0 cannot read. The extension flag comes back, and now carries a comment saying it is load-bearing, because the duplicate compilation it causes reads as an obvious cleanup and is not one.

An earlier attempt here assumed the opposite and made Dokka honour maven.javadoc.skip so the scan would not run it. CI showed Dokka skip parameter is true so no dokka output will be produced and failed identically: the mojo returns early but its plugin realm loads anyway, so it never tested the hypothesis. That commit is in the history; the wiring it added is kept below on its own merits.

What this leaves

Restored:

  • <extensions>true</extensions> on the three modules that had it, with the reason recorded

Kept from the tidy-up:

  • Dokka 2.2.0 in the Ktor modules, proven not to affect the extractor
  • Dokka's source root named explicitly, so a module with no src/main/java stops reporting a missing directory on every build
  • Dokka honours maven.javadoc.skip, so a build that asked for no documentation gets none, which is right on its own terms and takes documentation generation out of the security scan

Releases and docs.yml do not set that property, so the javadoc jar Maven Central requires is unaffected; verified locally that the default build still produces it with all its API pages.

The configuration here is byte-identical to #524, which CodeQL analysed green.

…deQL

CodeQL's java-kotlin analysis has failed on every build since Dokka moved
to 2.2.0 in the Ktor modules. Its autobuild runs

  mvnw clean package -Dmaven.javadoc.skip -DskipTests ...

and the reactor reaches storm-ktor, where Dokka 2.2.0 loads a Kotlin 2.2
analysis into the Maven JVM, and then storm-kotlin-test, whose kapt runs
on Kotlin 2.0.21. CodeQL's extractor is injected into that compilation as
a compiler plugin and is now bound against the wrong generation:

  The provided plugin com.github.codeql.KotlinExtractorComponentRegistrar
  is not compatible with this version of compiler.
  java.lang.AbstractMethodError: ... does not define or inherit an
  implementation of the resolved method registerProjectComponents ...

The green build before it ran Dokka 2.0.0 at the same point, in the same
order, under the same CodeQL, and the same kapt succeeded.

Dokka is this project's javadoc, so it now honours the switch that says a
build wants none. The scan asked for no documentation and gets none, which
keeps a documentation engine's Kotlin out of the JVM that is compiling
Kotlin. Releases and the docs workflow do not set the property, so they
still produce the javadoc jar Maven Central requires.

Only the two Ktor modules opt in, since they are the only ones whose Dokka
runs a different Kotlin generation than the reactor compiles with.
…with

The tidy-up in the previous change broke CodeQL's java-kotlin analysis on
every build since, and skipping Dokka's output was not enough: the mojo
returns early but its plugin realm is still loaded, and the failure
reproduced unchanged. Rather than leave the analysis red while narrowing
which half of that tidy-up is responsible, both halves go back.

The Ktor modules return to Dokka 2.0.0, the generation the rest of the
framework runs, and the three modules that declared the Kotlin plugin as
a build extension declare it that way again. Both carry a comment saying
what they cost and why they stay: Dokka 2.0 reports metadata errors it
cannot read for a Kotlin 2.3 module, and the extension synthesises
duplicate compile and kapt executions.

What stays from the tidy-up is what cannot affect the extractor: Dokka's
source root is still named explicitly, so a module with no src/main/java
does not report a missing directory, and Dokka now honours
maven.javadoc.skip, so a build that asks for no documentation gets none.
@zantvoort zantvoort changed the title fix: skip Dokka when the build asks for no javadoc, which unbreaks CodeQL fix: restore the build configuration CodeQL's Kotlin extractor works with Aug 22, 2026
@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…ds on

Isolating the two halves of the reverted tidy-up shows Dokka is innocent:
Dokka 2.2.0 with the extension left in place analyses green. So the
extension flag comes back and Dokka 2.2.0 stays, keeping the metadata fix
for the two modules Dokka 2.0 cannot read.

The flag now says why it cannot be removed, since the duplicate compile
and kapt executions it synthesises look like an obvious cleanup and are
not one.
@zantvoort zantvoort changed the title fix: restore the build configuration CodeQL's Kotlin extractor works with fix: keep the Kotlin plugin extension, which CodeQL's extractor depends on Aug 22, 2026
@zantvoort
zantvoort merged commit 0ff7274 into main Aug 22, 2026
8 checks passed
@zantvoort
zantvoort deleted the codeql-dokka-skip branch August 22, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant