Skip to content

Sync dependency versions and TestKit coverage into buildSrc#681

Merged
alexander-yevsyukov merged 5 commits into
masterfrom
dependencies-and-coverage
Jun 6, 2026
Merged

Sync dependency versions and TestKit coverage into buildSrc#681
alexander-yevsyukov merged 5 commits into
masterfrom
dependencies-and-coverage

Conversation

@alexander-yevsyukov
Copy link
Copy Markdown
Contributor

@alexander-yevsyukov alexander-yevsyukov commented Jun 6, 2026

Ports the buildSrc changes made downstream back into the canonical config repository, in two parts.

From base-libraries

  • Dependency version bumps across buildSrc/.../dependency/** (build, kotlinx, lib, local, test). Notably the Error Prone Gradle plugin 4.1.05.1.0 (with its renamed enabled option adapted in Linters.kt), Guava 33.5.0-jre33.6.0-jre, plus Kotlin, Protobuf, and the sibling Spine snapshots. All move forward; none regress.
  • Mirror the bumped plugin/Guava/Kotlin versions in buildSrc/build.gradle.kts.
  • Complete the JaCoCo → Kover migration by removing the now-dead JaCoCo coverage pipeline: CodebaseFilter, FileExtension, FileExtensions, FileFilter, JacocoConfig, PathMarker, TaskName (and the orphaned FileExtensionsTest). These were referenced only by each other; the surviving class-FQN logic lives privately in KoverConfig.

From tool-base

  • Feed Gradle TestKit worker-JVM coverage into the Kover rollup: KoverConfig now merges per-module .exec data as additionalBinaryReports (both per subproject and at the root), and a new gradle/testing/TestKitCoverage.kt attaches the JaCoCo agent to TestKit workers. Without this, plugin code exercised out-of-process through GradleRunner (most notably Plugin<Settings> implementations) is not credited to coverage.

TestKitCoverage hardening (from review)

The TestKit-coverage helper ported from tool-base had several edge cases around when the shared exec directory (build/jacoco-testkit) is wiped vs. when the worker .exec files are present. The final enableTestKitCoverage() resolves all of them:

  • Exec data is flushed out-of-process, after the task action. The JaCoCo agent dumps the .exec on worker-daemon shutdown — after the Test action completes and before the Kover report runs — so the directory cannot be a reliable Test task output. This constraint drives the three points below.
  • Wipe in a guarded doFirst, not a dependsOn clean task. A clean task wired via dependsOn runs even when Test is up-to-date or cache-restored, deleting the .exec files without regenerating them, so a follow-up koverXmlReport/check would drop all TestKit coverage. A doFirst action runs only when the task truly executes.
  • One-shot wipe guard for multi-task modules. When a module declares more than one TestKit Test task, only the first to execute clears the directory (guarded by an AtomicBoolean); the workers append to a single per-module exec file, so the remaining tasks accumulate into it instead of erasing one another.
  • Coverage-enabled Test tasks are non-cacheable (outputs.cacheIf { false }). Since the exec dir cannot be a declared output, a build-cache hit would skip execution and restore no exec files. Marking the task non-cacheable means a cache hit can no longer drop coverage; up-to-date (non-cache) runs stay correct, as the previous run's files persist and the guarded doFirst never deletes them on a skip.

Net effect: TestKit worker coverage is preserved across all three execution states — fresh run, up-to-date skip, and build-cache hit — and accumulates correctly across multiple Test tasks in one module.

Note: this helper originated in tool-base, where it can be integration-tested against real Plugin<Settings>/TestKit modules; config has no such module, so the fixes above were validated by compilation, buildSrc tests, and reasoning about Gradle execution semantics. The same fixes should flow back to tool-base's copy on its next buildSrc re-sync so the two do not drift.

Scope notes for reviewers

  • All changes are under buildSrc/.
  • Deliberately excluded per-repo / non-config-owned artifacts that appeared in the downstream branches: their version.gradle.kts, dependencies.md, docs/dependencies/**, library src/**, .agents/.claude/.codex, and tool-base's module build scripts / plugin-testlib code.
  • tool-base's KoverConfig is a strict superset of config's, so the merge added the TestKit logic without losing anything.
  • Kover is pinned at 0.9.8 in both repos (so additionalBinaryReports is available); config's JaCoCo 0.8.15 ≥ tool-base's 0.8.14.

Verification

  • ./gradlew :buildSrc:compileKotlin → BUILD SUCCESSFUL (JDK 17).
  • ./gradlew :buildSrc:test → BUILD SUCCESSFUL.
  • ./gradlew detekt → BUILD SUCCESSFUL.
  • Pre-PR reviewers spine-code-review, kotlin-engineer, dependency-audit all APPROVE.
  • The full ConfigTester / buildDependants integration run (which checks out and builds downstream repos against local config) is network-heavy and left to CI.

🤖 Generated with Claude Code

Port the `buildSrc` changes made downstream back into the canonical
`config` repository.

From `base-libraries`:
 - Bump external, build, kotlinx, local, and test dependency versions
   (incl. Error Prone Gradle plugin -> 5.1.0 with its renamed `enabled`
   option adapted in `Linters.kt`, Guava, Kotlin, Protobuf, and the
   sibling Spine snapshots).
 - Mirror the bumped plugin/Guava/Kotlin versions in `buildSrc/build.gradle.kts`.
 - Complete the JaCoCo -> Kover migration by removing the now-dead
   JaCoCo coverage pipeline (`CodebaseFilter`, `FileExtension`,
   `FileExtensions`, `FileFilter`, `JacocoConfig`, `PathMarker`,
   `TaskName`); these were referenced only by each other.

From `tool-base`:
 - Feed Gradle TestKit worker-JVM coverage into the Kover rollup:
   `KoverConfig` now merges per-module `.exec` data as
   `additionalBinaryReports`, and a new `gradle/testing/TestKitCoverage.kt`
   attaches the JaCoCo agent to TestKit workers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30b5033502

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The JaCoCo->Kover migration deleted `FileExtensions.kt`, which provided
the `File.classNamesIn(...)` extension. The class-FQN derivation it tested
now lives as the private `File.fqnsRelativeTo(...)` inside `KoverConfig`.
The orphaned test left `:buildSrc:compileTestKotlin` unable to compile;
remove it to match the migration (the source `base-libraries` branch
carries no such test).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 87d96819a2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread buildSrc/src/main/kotlin/io/spine/gradle/testing/TestKitCoverage.kt Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR syncs downstream buildSrc/ changes back into the canonical config repo: it updates the shared dependency/version catalog, removes the deprecated JaCoCo aggregation pipeline, and extends Kover aggregation to include Gradle TestKit worker JVM coverage data.

Changes:

  • Bump a broad set of dependency and plugin versions (including Error Prone Gradle plugin, Guava, Kotlin, Protobuf, and multiple Spine snapshots) and mirror key versions in buildSrc/build.gradle.kts.
  • Complete the JaCoCo → Kover migration by removing the old JaCoCo aggregation/filtering implementation and its tests/utilities.
  • Add TestKit worker coverage support: new enableTestKitCoverage() helper and Kover aggregation updated to merge TestKit-produced .exec data via additionalBinaryReports.

Reviewed changes

Copilot reviewed 53 out of 62 changed files in this pull request and generated no comments.

Show a summary per file
File Description
buildSrc/src/test/kotlin/io/spine/gradle/report/coverage/FileExtensionsTest.kt Removes tests for deprecated JaCoCo helper extensions.
buildSrc/src/main/kotlin/io/spine/gradle/testing/TestKitCoverage.kt Adds helper to attach JaCoCo agent to TestKit worker JVMs and emit .exec data.
buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/TaskName.kt Removes deprecated JaCoCo task-name catalog.
buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/PathMarker.kt Removes deprecated JaCoCo path marker enum.
buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/KoverConfig.kt Extends Kover aggregation to merge TestKit worker .exec data into reports.
buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/JacocoConfig.kt Removes deprecated JaCoCo root-report aggregation pipeline.
buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/FileFilter.kt Removes deprecated JaCoCo-era generated/human file filtering utility.
buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/FileExtensions.kt Removes deprecated file parsing/class-name inference helpers for JaCoCo pipeline.
buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/FileExtension.kt Removes deprecated file-extension enum used by the JaCoCo pipeline.
buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/CodebaseFilter.kt Removes deprecated compiled-class filtering for JaCoCo aggregation.
buildSrc/src/main/kotlin/io/spine/gradle/java/Linters.kt Adapts Error Prone plugin API change (isEnabledenabled).
buildSrc/src/main/kotlin/io/spine/dependency/test/Truth.kt Bumps Truth version.
buildSrc/src/main/kotlin/io/spine/dependency/test/KotlinCompileTesting.kt Bumps Kotlin compile testing fork version.
buildSrc/src/main/kotlin/io/spine/dependency/test/JUnit.kt Bumps JUnit BOM version and legacy JUnit 4 version.
buildSrc/src/main/kotlin/io/spine/dependency/test/Jacoco.kt Bumps JaCoCo version used across tooling.
buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt Bumps Validation snapshot version.
buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt Bumps ToolBase snapshot versions.
buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvmCompiler.kt Bumps CoreJvmCompiler snapshot versions.
buildSrc/src/main/kotlin/io/spine/dependency/local/Compiler.kt Bumps fallback snapshot versions for Compiler.
buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt Bumps Base snapshot versions.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Slf4J.kt Bumps SLF4J version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Roaster.kt Bumps Roaster version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Protobuf.kt Bumps Protobuf and protobuf-gradle-plugin versions.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Plexus.kt Bumps plexus-utils version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/PalantirJavaFormat.kt Bumps palantir-java-format version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Okio.kt Bumps Okio version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Netty.kt Bumps Netty version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Log4j2.kt Bumps Log4j2 version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinSemver.kt Bumps kotlin-semver version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinPoet.kt Bumps KotlinPoet version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Kotlin.kt Bumps Kotlin runtime/embedded versions and JetBrains annotations version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/JetBrainsAnnotations.kt Bumps JetBrains annotations version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/JavaDiffUtils.kt Bumps java-diff-utils version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Jackson.kt Bumps Jackson BOM and annotations version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/J2ObjC.kt Bumps j2objc-annotations version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/HttpClient.kt Bumps google-http-java-client version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Guava.kt Bumps Guava version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Gson.kt Bumps Gson version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/GrpcKotlin.kt Bumps grpc-kotlin version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Grpc.kt Bumps gRPC BOM version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Flogger.kt Bumps Flogger version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Firebase.kt Bumps firebase-admin version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/CommonsLogging.kt Bumps commons-logging version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/CommonsCodec.kt Bumps commons-codec version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/CommonsCli.kt Bumps commons-cli version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Clikt.kt Bumps Clikt version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Caffeine.kt Bumps Caffeine version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Auto.kt Bumps AutoValue version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Asm.kt Bumps ASM version.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Aedile.kt Bumps Aedile version.
buildSrc/src/main/kotlin/io/spine/dependency/kotlinx/Serialization.kt Updates copyright header (and related kotlinx versions elsewhere in the PR).
buildSrc/src/main/kotlin/io/spine/dependency/kotlinx/DateTime.kt Bumps kotlinx-datetime version.
buildSrc/src/main/kotlin/io/spine/dependency/kotlinx/Coroutines.kt Updates copyright header (and related version catalog alignment).
buildSrc/src/main/kotlin/io/spine/dependency/kotlinx/AtomicFu.kt Updates copyright header (and related version catalog alignment).
buildSrc/src/main/kotlin/io/spine/dependency/build/Pmd.kt Bumps PMD version.
buildSrc/src/main/kotlin/io/spine/dependency/build/PluginPublishPlugin.kt Bumps Gradle plugin-publish plugin version.
buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt Bumps KSP version.
buildSrc/src/main/kotlin/io/spine/dependency/build/GradleDoctor.kt Bumps Gradle Doctor version.
buildSrc/src/main/kotlin/io/spine/dependency/build/ErrorProne.kt Bumps Error Prone Gradle plugin version.
buildSrc/src/main/kotlin/io/spine/dependency/build/CheckerFramework.kt Bumps Checker Framework version.
buildSrc/src/main/kotlin/io/spine/dependency/build/AnimalSniffer.kt Bumps Animal Sniffer version.
buildSrc/build.gradle.kts Mirrors key version bumps (Kotlin embedded, Guava, Error Prone plugin, Protobuf plugin) into buildSrc buildscript.

Previously `enableTestKitCoverage` wiped the shared `build/jacoco-testkit`
directory in every `Test` task's `doFirst`. Because the TestKit workers
append to a single per-module exec file and `KoverConfig` only scans the
directory later, a module with more than one TestKit `Test` task kept only
the coverage of the last task to run — each task erased its predecessors.

Move the cleanup into a dedicated `cleanTestKitCoverage` `Delete` task that
every `Test` task depends on, so the directory is wiped exactly once per
build invocation and the sequentially-run tasks accumulate into the same
exec file.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2bab826d53

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread buildSrc/src/main/kotlin/io/spine/gradle/testing/TestKitCoverage.kt Outdated
The previous `cleanTestKitCoverage` `Delete` task ran via `dependsOn` even
when the `Test` task was up-to-date or restored from cache. A follow-up
`koverXmlReport`/`check` run would then delete `build/jacoco-testkit`
without the skipped `Test` task regenerating the `.exec` files, so the
Kover report dropped all TestKit worker coverage.

Move the wipe back into the `Test` task's `doFirst` — which runs only when
the task actually executes — guarded by a one-shot `AtomicBoolean` so that,
with several TestKit `Test` tasks in one module, only the first to run
clears the shared directory and the rest accumulate into the same appended
exec file. This addresses both the up-to-date/cached-skip erasure and the
multi-task erasure.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a659078c6a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread buildSrc/src/main/kotlin/io/spine/gradle/testing/TestKitCoverage.kt
The worker `.exec` data is flushed out-of-process on worker-daemon
shutdown, after the `Test` task action completes, so it cannot be declared
as a task output and captured by the build cache. Left cacheable, a cache
hit (e.g. `clean check --build-cache`) would skip execution and restore no
exec files, so `KoverConfig` would scan an empty directory and drop all
TestKit worker coverage.

Mark the coverage-enabled `Test` tasks non-cacheable via `outputs.cacheIf
{ false }`. A cache hit can no longer drop coverage because the task is not
served from the cache; up-to-date (non-cache) runs remain safe, since the
previous run's files persist and the guarded `doFirst` never deletes them
on a skip.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b32f33bd66

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread buildSrc/src/main/kotlin/io/spine/dependency/test/JUnit.kt
Comment thread buildSrc/src/main/kotlin/io/spine/dependency/test/Jacoco.kt
@alexander-yevsyukov alexander-yevsyukov merged commit 5dbd6d9 into master Jun 6, 2026
2 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the dependencies-and-coverage branch June 6, 2026 20:21
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.

3 participants