Improve filtering of generated code in the coverage reports#670
Merged
Conversation
armiol
approved these changes
May 28, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the JaCoCo coverage filtering logic in buildSrc to better exclude proto-/generated sources from coverage reports, including Kotlin sources generated by protoc-gen-kotlin.
Changes:
- Extend coverage filtering to consider Kotlin source roots and Kotlin-generated class naming (
.kt,.proto.kt, synthetic*Ktclasses). - Simplify generated-class discovery by deriving class FQNs from source-relative paths (
File.classNamesIn), and apply those when excluding compiled outputs. - Add focused unit tests for the new source-file-to-class-name mapping logic; update agent skill docs for version bump commit subjects.
Reviewed changes
Copilot reviewed 2 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| buildSrc/src/test/kotlin/io/spine/gradle/report/coverage/FileExtensionsTest.kt | Adds tests for deriving JVM class FQNs from .java, .kt, and .proto.kt sources. |
| buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/PathMarker.kt | Removes Java-specific path markers and renames output marker to MAIN_OUTPUT_FOLDER. |
| buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/JacocoConfig.kt | Collects both Java and Kotlin main source directories for filtering/source reporting. |
| buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/FileExtensions.kt | Introduces classNamesIn, updates compiled-class parsing marker, and adjusts docs/constants. |
| buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/FileExtension.kt | Adds KOTLIN_SOURCE file extension. |
| buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/CodebaseFilter.kt | Switches generated class name discovery to the new classNamesIn approach. |
| buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvmCompiler.kt | Bumps Core JVM Compiler snapshot version constants. |
| .agents/skills/bump-version/SKILL.md | Clarifies commit-subject backtick handling and adds a shell-safe example. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…-not-escape-backticks
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.
This PR brings the changes to
buildSrcrecently adopted in Validation for filtering of proto-generated code from test coverage reports.Other notable changes