-
Notifications
You must be signed in to change notification settings - Fork 26
[#582] Migrate to Kover 0.9.x #615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThe changes update the Kover code coverage plugin version and refactor its configuration across multiple modules and CI/CD workflows. Gradle tasks for coverage reports are switched from standard to custom variants, with corresponding updates to documentation and artifact paths. Enhanced filtering and variant-specific setup are introduced for coverage reporting. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant CI/CD Workflow
participant Gradle
participant Kover Plugin
Developer->>CI/CD Workflow: Push code / Open PR
CI/CD Workflow->>Gradle: Run ./gradlew koverHtmlReportCustom (or koverXmlReportCustom)
Gradle->>Kover Plugin: Generate coverage report (custom variant, enhanced filters)
Kover Plugin-->>Gradle: Coverage report (custom path)
Gradle-->>CI/CD Workflow: Report artifact
CI/CD Workflow-->>Developer: Display/report results
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
bdda502
to
a4b8aa5
Compare
a4b8aa5
to
04ce18f
Compare
Kover report for template-compose:🧛 Template - Compose Unit Tests Code Coverage:
|
File | Coverage |
---|
Modified Files Not Found In Coverage Report:
Dangerfile
README.md
README.md
README.md
README.md
bitrise.yml
build.gradle.kts
build.gradle.kts
build.gradle.kts
build.gradle.kts
build.gradle.kts
build.gradle.kts
codemagic.yaml
codemagic.yaml
deploy_staging_and_production_to_firebase_app_distribution.yml
libs.versions.toml
libs.versions.toml
review_pull_request.yml
review_pull_request.yml
run_detekt_and_unit_tests.yml
run_detekt_and_unit_tests.yml
Codebase cunningly covered by count Shroud 🧛
Generated by 🚫 Danger
04ce18f
to
047cfaa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🔭 Outside diff range comments (1)
sample-compose/app/build.gradle.kts (1)
174-199
: Fix compile-time type mismatch inclasses()
call
classes()
expects a varargString
. Passing aList<String>
causes a type error and the build will fail.excludes { androidGeneratedClasses() - classes(excludedFiles) + classes(*excludedFiles.toTypedArray()) }
♻️ Duplicate comments (4)
template-compose/README.md (1)
40-42
: Duplicate of the comment ondeprecated/template-xml/README.md
– same path update applies here.sample-compose/README.md (1)
40-42
: Duplicate of the comment ondeprecated/template-xml/README.md
– same path update applies here.deprecated/sample-xml/README.md (1)
40-42
: Duplicate of the comment ondeprecated/template-xml/README.md
– same path update applies here.sample-compose/data/build.gradle.kts (1)
69-75
: Same observation as in template-compose/data – consider centralising the “custom” variantSee the comment on
template-compose/data
.
Duplicated config is easy to forget when the variant list or naming scheme evolves.
🧹 Nitpick comments (7)
deprecated/template-xml/README.md (1)
40-42
: Update the report path to prevent confusionThe custom variant’s HTML report lands at
app/build/reports/kover/html/custom/index.html
(and XML at…/xml/reportCustom.xml
).
The note below still points to the old root dir. Consider amending:-Report is located at: `app/build/reports/kover/` +Report is located at: `app/build/reports/kover/html/custom/`This also quiets MD014 (“dollar signs without output”) if you drop the leading
$
in the command..cicdtemplate/.github/workflows/run_detekt_and_unit_tests.yml (1)
60-66
: Consider narrowing the artifact upload pathThe archive step uploads
app/build/reports/kover/
, which will now containhtml
+xml
sub-folders for all variants.
If you only need the custom report you can trim the path to e.g.app/build/reports/kover/custom/
to save artefact size.template-compose/domain/build.gradle.kts (1)
18-25
: Avoid repeating identical Kover blocks in every moduleEvery _compose module now contains virtually identical:
kover { currentProject { createVariant("custom") { add("jvm") } } }Consider moving this into:
- A Gradle convention plugin, or
- A
subprojects { ... }
orallprojects { ... }
block in the rootbuild.gradle.kts
.That eliminates duplication and guarantees the variant name stays consistent everywhere.
.cicdtemplate/.codemagic/codemagic.yaml (1)
18-20
: Consider passing Gradle CI flags for stability/performance
./gradlew koverHtmlReportCustom
is fine, but in hosted CI the daemon cache is frequently cold and parallel workers are disabled.
Appending--no-daemon --stacktrace --warning-mode=all
tends to save memory and gives actionable diagnostics when the build fails.- script: ./gradlew koverHtmlReportCustom + script: ./gradlew koverHtmlReportCustom --no-daemon --stacktrace --warning-mode=all.github/workflows/run_detekt_and_unit_tests.yml (1)
47-50
: Same flags as Codemagic: prefer explicit Gradle optionsAdding
--no-daemon --stacktrace
keeps the memory footprint low on the runner and provides richer logs.- run: ./gradlew koverHtmlReportCustom + run: ./gradlew koverHtmlReportCustom --no-daemon --stacktracetemplate-compose/data/build.gradle.kts (1)
65-72
: Avoid per-module duplication; extract the “custom” Kover variant to a convention pluginEvery Android/JVM module now repeats the same
kover { currentProject { createVariant("custom") { … } } }
snippet.
Moving this block to a shared Gradle convention plugin (e.g.build-logic/kover-conventions.gradle.kts
) keeps the rule DRY and guarantees that future variant tweaks stay in a single place.No functional change required for this PR, but worth considering before the pattern spreads to more modules.
template-compose/app/build.gradle.kts (1)
163-200
: Great filter list, but consider externalising to avoid divergence across modulesThe exclusion list is long and identical to what other modules need. Place it in:
gradle/kover/filters.gradle.kts
and reuse:
kover { currentProject { … } reports { filters { from(rootProject.file("gradle/kover/filters.gradle.kts")) } } }
This keeps the list synchronised and shortens each module build script.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (21)
.cicdtemplate/.bitrise/bitrise.yml
(2 hunks).cicdtemplate/.codemagic/codemagic.yaml
(1 hunks).cicdtemplate/.github/workflows/deploy_staging_and_production_to_firebase_app_distribution.yml
(1 hunks).cicdtemplate/.github/workflows/review_pull_request.yml
(1 hunks).cicdtemplate/.github/workflows/run_detekt_and_unit_tests.yml
(1 hunks).github/workflows/review_pull_request.yml
(1 hunks).github/workflows/run_detekt_and_unit_tests.yml
(2 hunks)Dangerfile
(2 hunks)codemagic.yaml
(1 hunks)deprecated/sample-xml/README.md
(1 hunks)deprecated/template-xml/README.md
(1 hunks)sample-compose/README.md
(1 hunks)sample-compose/app/build.gradle.kts
(2 hunks)sample-compose/data/build.gradle.kts
(1 hunks)sample-compose/domain/build.gradle.kts
(1 hunks)sample-compose/gradle/libs.versions.toml
(1 hunks)template-compose/README.md
(1 hunks)template-compose/app/build.gradle.kts
(2 hunks)template-compose/data/build.gradle.kts
(1 hunks)template-compose/domain/build.gradle.kts
(1 hunks)template-compose/gradle/libs.versions.toml
(1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
template-compose/README.md
41-41: Dollar signs used before commands without showing output
(MD014, commands-show-output)
sample-compose/README.md
41-41: Dollar signs used before commands without showing output
(MD014, commands-show-output)
deprecated/template-xml/README.md
41-41: Dollar signs used before commands without showing output
(MD014, commands-show-output)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Review pull request
🔇 Additional comments (11)
template-compose/gradle/libs.versions.toml (1)
24-24
: Verify Kover 0.9.1 ↔ Kotlin 2.1.10 compatibility before merging
kover = "0.9.1"
is a sizeable jump from 0.7.x. Kover 0.9.x has historically lagged a little behind bleeding-edge Kotlin versions.
Please confirm locally (or on CI) that:
- All Kotlin tasks complete with
-Xcontext-receivers
& K2 enabled (Kotlin 2.1.10 here).- Coverage is generated without the “IC error: incompatible data version” warning.
If you hit either issue, pinning Kover 0.9.0-RC 4 (first build with K2 support) or upgrading to the just-released 0.9.2 may be required.
.cicdtemplate/.github/workflows/run_detekt_and_unit_tests.yml (1)
57-59
: Verify thatkoverHtmlReportCustom
exists at the root project levelThe job now invokes
./gradlew koverHtmlReportCustom
, but that task will only be present if every module and the root project define the"custom"
variant (or the root aggregates them viakoverMergedReportCustom
).
Please double-check that:
- All modules participating in the merge expose the
"custom"
variant.- The root project applies either
kover
orkover-merge
and also creates the"custom"
variant, otherwise this step will fail in CI.sample-compose/gradle/libs.versions.toml (1)
24-24
: Confirm Kover 0.9.1 compatibility with Kotlin 2.1.10 & AGP 8.8.2Kover 0.9.1 was released before Kotlin 2.1.x and very recent AGP versions. Although it generally works, there have been sporadic ABI mismatches in minor releases.
Run the full Gradle build locally (includingkoverXmlReportCustom
) to ensure noNoSuchMethodError
orClassNotFoundException
is thrown..cicdtemplate/.github/workflows/review_pull_request.yml (1)
43-45
: Same task-name risk here as in the unit-test workflow
koverXmlReportCustom
will be absent if any module or the root forgets to define the"custom"
variant. Ensure the task is resolvable, otherwise the PR-review workflow will fail early.codemagic.yaml (1)
19-22
: Codemagic step mirrors the same custom-task assumptionIf
koverHtmlReportCustom
is missing (root project not configured, typo in variant name, etc.) the whole workflow will halt. Double-check before merging..cicdtemplate/.github/workflows/deploy_staging_and_production_to_firebase_app_distribution.yml (1)
50-52
: Consistency check: HTML report won’t generate XML expected elsewhere
koverHtmlReportCustom
produces only HTML; any later tooling that expectsreportCustom.xml
(e.g. local scripts or Danger when run outside PRs) will have nothing to parse.
If XML is also required, append the XML task or switch to the aggregatedkoverReportCustom
.- run: ./gradlew koverHtmlReportCustom + run: ./gradlew koverHtmlReportCustom koverXmlReportCustomsample-compose/domain/build.gradle.kts (1)
19-25
:jvm
variant addition looks correctFor a pure JVM module the
jvm
coverage variant is the recommended way in Kover ≥ 0.8; the block is concise and needs no changes..cicdtemplate/.bitrise/bitrise.yml (2)
52-56
: Double-check howandroid-unit-test@1
handles thearguments
fieldThe step usually autogenerates tasks like
:app:testDebugUnitTest
based onvariant
.
By overridingarguments
with onlykoverHtmlReportCustom
the step’s internal task inference might be bypassed; success relies on the Kover task’s own dependency chain.Please verify that the step still runs your unit tests (look for
:app:testDebugUnitTest
in the Bitrise log). If not, prepend the explicit test task:- arguments: "testDebugUnitTest koverHtmlReportCustom"
64-67
: Report path may not match where the aggregated report is generated
koverHtmlReportCustom
for the root project places the HTML underbuild/reports/kover/htmlCustom/…
(root-level), not underapp/build/…
unless the task is scoped to:app:
.Because the step calls the task via
arguments
(without a module prefix), the report will likely live at the root.
Confirm the actual output directory and adjustdeploy_path
if necessary to avoid uploading an empty artifact.sample-compose/app/build.gradle.kts (2)
160-163
: Includingdata
anddomain
modules in coverage looks goodThe additional
kover
configuration correctly aggregates coverage from the core modules.
165-170
: Add missing koverXmlReportCustom invocation to CI workflowsOur scan only found the HTML report task in codemagic.yaml; you’ll also need to invoke the XML report for the new “custom” variant. For example:
- codemagic.yaml:21
Suggested update:
- script: ./gradlew koverHtmlReportCustom + # generate both HTML and XML reports for the custom variant + script: ./gradlew koverHtmlReportCustom koverXmlReportCustomLikely an incorrect or invalid review comment.
047cfaa
to
8941fa3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
template-compose/README.md (1)
40-42
: Remove leading “$” to satisfy markdown-lint MD014The linter flags
$
prompts because the README doesn’t show sample output.
Dropping the prompt keeps the snippet copy-paste-friendly and silences MD014.-``` -$ ./gradlew koverHtmlReportCustom -``` +```bash +./gradlew koverHtmlReportCustom +```deprecated/sample-xml/README.md (1)
32-42
: Minor: drop the leading “$” prompt symbol for markdown-lint compliance
markdownlint
(MD014) flags commands that start with$
when no output is shown.
Either include the expected output or remove the prompt symbol:-$ ./gradlew koverHtmlReportCustom +./gradlew koverHtmlReportCustom(The same applies to the other Gradle commands above.)
deprecated/template-xml/README.md (1)
40-42
: Minor: markdownlint MD014 warning
markdownlint
flags lines that start commands with a leading$
when no output is shown.
The rest of the README already uses that style, so you can safely ignore—or remove all leading$
prompts for copy-paste friendliness.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (21)
.cicdtemplate/.bitrise/bitrise.yml
(2 hunks).cicdtemplate/.codemagic/codemagic.yaml
(1 hunks).cicdtemplate/.github/workflows/deploy_staging_and_production_to_firebase_app_distribution.yml
(1 hunks).cicdtemplate/.github/workflows/review_pull_request.yml
(1 hunks).cicdtemplate/.github/workflows/run_detekt_and_unit_tests.yml
(1 hunks).github/workflows/review_pull_request.yml
(1 hunks).github/workflows/run_detekt_and_unit_tests.yml
(2 hunks)Dangerfile
(2 hunks)codemagic.yaml
(1 hunks)deprecated/sample-xml/README.md
(1 hunks)deprecated/template-xml/README.md
(1 hunks)sample-compose/README.md
(1 hunks)sample-compose/app/build.gradle.kts
(1 hunks)sample-compose/data/build.gradle.kts
(1 hunks)sample-compose/domain/build.gradle.kts
(1 hunks)sample-compose/gradle/libs.versions.toml
(1 hunks)template-compose/README.md
(1 hunks)template-compose/app/build.gradle.kts
(1 hunks)template-compose/data/build.gradle.kts
(1 hunks)template-compose/domain/build.gradle.kts
(1 hunks)template-compose/gradle/libs.versions.toml
(1 hunks)
✅ Files skipped from review due to trivial changes (4)
- Dangerfile
- .cicdtemplate/.github/workflows/review_pull_request.yml
- codemagic.yaml
- .cicdtemplate/.github/workflows/deploy_staging_and_production_to_firebase_app_distribution.yml
🚧 Files skipped from review as they are similar to previous changes (13)
- template-compose/domain/build.gradle.kts
- template-compose/gradle/libs.versions.toml
- .cicdtemplate/.github/workflows/run_detekt_and_unit_tests.yml
- sample-compose/data/build.gradle.kts
- .cicdtemplate/.codemagic/codemagic.yaml
- template-compose/data/build.gradle.kts
- .github/workflows/run_detekt_and_unit_tests.yml
- .github/workflows/review_pull_request.yml
- sample-compose/gradle/libs.versions.toml
- .cicdtemplate/.bitrise/bitrise.yml
- template-compose/app/build.gradle.kts
- sample-compose/app/build.gradle.kts
- sample-compose/domain/build.gradle.kts
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
deprecated/sample-xml/README.md
41-41: Dollar signs used before commands without showing output
(MD014, commands-show-output)
deprecated/template-xml/README.md
41-41: Dollar signs used before commands without showing output
(MD014, commands-show-output)
sample-compose/README.md
41-41: Dollar signs used before commands without showing output
(MD014, commands-show-output)
template-compose/README.md
41-41: Dollar signs used before commands without showing output
(MD014, commands-show-output)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Review pull request
- GitHub Check: Verify newproject script
- GitHub Check: Run Detekt and unit tests
🔇 Additional comments (5)
template-compose/README.md (1)
41-45
: Confirm output directory is still accurateAfter migrating to a custom variant, Kover’s default output folder usually changes to
build/reports/kover/htmlCustom
(root‐level) instead ofapp/build/reports/kover/
.
Leaving the old path may mislead readers.-Report is located at: `app/build/reports/kover/` +Report is located at: `build/reports/kover/htmlCustom/`sample-compose/README.md (2)
41-42
: Command name change looks correctThe switch to
koverHtmlReportCustom
aligns with the new custom variant introduced by the Kover 0.9 migration.
44-45
: Verify and update the coverage report pathWith Kover ≥ 0.8, the HTML output for a custom variant is generated under
<module>/build/reports/kover/htmlCustom/
(or…/kover/<variant>/
).
The current doc still points toapp/build/reports/kover/
, which may mislead newcomers.-Report is located at: `app/build/reports/kover/` +Report is located at: `app/build/reports/kover/htmlCustom/`Please run the task once and confirm the actual path before merging.
deprecated/sample-xml/README.md (1)
41-45
: Verify report path — the task name changed but the location may have shifted
koverHtmlReportCustom
usually writes tobuild/reports/kover/html/custom/
(note the extrahtml/custom
segment).
Please double-check the generated directory after running the task; if it differs, update the doc accordingly:-Report is located at: `app/build/reports/kover/` +Report is located at: `app/build/reports/kover/html/custom/`deprecated/template-xml/README.md (1)
40-45
: Double-check the report location – path may now include thecustom
variantThe Kover task name has changed from
koverHtmlReport
tokoverHtmlReportCustom
, but the documented output path is stillapp/build/reports/kover/
.
Starting from Kover 0.8+, each report variant is written to<buildDir>/reports/kover/<variant>/…
(e.g.app/build/reports/kover/custom/html
).
To avoid confusion for newcomers, please verify the actual location and update the README accordingly.
Solves #582
What happened 👀
Insight 📝
custom
to merge reports from all modules with necessary flavors.Proof Of Work 📹
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Documentation