Skip to content

Conversation

@miroslavpojer
Copy link
Collaborator

@miroslavpojer miroslavpojer commented Jan 31, 2026

Overview

Introduce MoranaApps Jacoco measuring solution.

Release Notes

  • Migrated to MoranaApps jacoco repoct axction
  • Add support for method filtration.

Summary by CodeRabbit

  • New Features
    • Per-module code coverage reporting: independent execution and report files, per-module reporting tasks, and opt-in controls.
  • Documentation
    • Added comprehensive method-filter rules and how-to guide for excluding generated boilerplate from coverage.
  • Chores
    • CI coverage enforcement updated (thresholds raised to 80%); migrated to a newer coverage-reporting action with expanded report options and simplified PR feedback.

✏️ Tip: You can customize this high-level summary in your review settings.

@miroslavpojer miroslavpojer self-assigned this Jan 31, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 31, 2026

Walkthrough

Restructures JaCoCo integration to per-module reporting via two new sbt AutoPlugins, adds JaCoCo Method Filter docs and CI workflow updates, and applies cosmetic comment touches across many Scala sources to trigger coverage evaluation.

Changes

Cohort / File(s) Summary
CI Workflow
.github/workflows/jacoco_report.yml
Replaced madrapps/jacoco-report usage with MoranaApps/jacoco-report, quoted token, raised environment thresholds to 80.0, expanded report path to balta/target/**/jacoco/report/jacoco.xml, added detail/sensitivity and single comment-mode, and removed multi-step post-processing in favor of streamlined reporting.
sbt AutoPlugins
project/JacocoBaseKeysPlugin.scala, project/FilteredJacocoAgentPlugin.scala
Added JacocoBaseKeysPlugin (base keys: jacocoPluginEnabled, jacocoClean, jacocoReport) and FilteredJacocoAgentPlugin (per-module agent injection, per-module exec files & reports, JMF integration, jacocoCleanAll/jacocoReportAll helpers).
Build & Plugins
build.sbt, project/plugins.sbt, .sbtrc
Removed legacy Jacoco wiring and plugin/version constants, enabled FilteredJacocoAgentPlugin for balta, adjusted project plugins list, and added .sbtrc aliases (jacoco, jacocoOn, jacocoOff) for test/report workflows.
JMF Documentation
jmf-rules.txt
Added comprehensive Jacoco Method Filter rules and usage guidance, examples, and global/default filters for Scala-generated boilerplate.
Scala Source Touches
balta/src/main/scala/... (many files; see list)
Inserted non-functional // jacoco-touch: simulate change comments across numerous Scala source files to trigger coverage diffs in CI; no behavioral or API changes.
Miscellaneous
balta/src/main/scala/za/co/absa/db/balta/DBTestSuite.scala
Single-line comment added to simulate coverage touch (part of the source touches cohort).

Sequence Diagram

sequenceDiagram
    participant Test as Test Task
    participant JVM as Forked JVM
    participant Agent as JaCoCo Agent
    participant JMF as JMF (Method Filter)
    participant Exec as Exec File
    participant Reporter as Report Generator

    Test->>JVM: Fork with -javaagent (per-module)
    activate JVM
    JVM->>Agent: Load & attach agent (module-specific)
    activate Agent
    Agent->>JMF: Initialize filter rules
    activate JMF
    JMF-->>Agent: Ready
    deactivate JMF
    JVM->>JVM: Execute tests (instrumented)
    Note over JVM: Coverage data collected
    JVM->>Exec: Write module exec file
    deactivate Agent
    deactivate JVM
    Reporter->>Exec: Read exec file
    Reporter->>JMF: Apply filtering rules
    activate JMF
    JMF-->>Reporter: Filtered coverage data
    deactivate JMF
    Reporter->>Reporter: Generate HTML/XML/CSV reports (per-module)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested labels

enhancement

Suggested reviewers

  • salamonpavel
  • lsulak
  • benedeki

Poem

🐰 I nudged a comment, just a tiny touch,
Agents wake per-module — tools I clutch,
Rules sift the noise, JMF hops through the night,
Reports bloom per-folder, tidy and bright,
Hooray — coverage hops into sight! 🎀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add MoranaApps Jacoco support' clearly and specifically describes the main change in the PR, which is the migration to MoranaApps JaCoCo solution.
Description check ✅ Passed The description includes the Overview and Release Notes sections as required by the template, though Release Notes contain typos and the Related section with issue closure is missing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/migrate-jacoco-code-coverage-to-morana-solution

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@miroslavpojer miroslavpojer changed the title Fake change to see full output of Jacoco Introduce MoranaApps Jacoco measuring solution Jan 31, 2026
@github-actions
Copy link

github-actions bot commented Jan 31, 2026

Note: This is prior Jacoco report action result

JaCoCo 'balta' module code coverage report - scala 2.12.18

Overall Project 67.11% 🍏
File Coverage
ConnectionInfo.scala 100% 🍏
DBQuerySupport.scala 100% 🍏
NamingException.scala 100% 🍏
MapBasedNaming.scala 100% 🍏
QueryResultRow.scala 92.33% 🍏
DBTable.scala 91.28% 🍏
QueryResult.scala 88.66% 🍏
SnakeCaseNaming.scala 87.14% 🍏
LettersCase.scala 85.29% 🍏
NamingConvention.scala 80.77% 🍏
QueryResultRowImplicits.scala 74.27% 🍏
DBFunction.scala 60.68% 🍏
QueryParamValue.scala 59.72% 🍏
DBConnection.scala 55.81% 🍏
ExplicitNamingRequired.scala 55% 🍏
SimpleJsonString.scala 50% 🍏
Params.scala 49.34% 🍏
AsIsNaming.scala 40.63% 🍏
OptionImplicits.scala 31.82% 🍏
MapImplicits.scala 30.43% 🍏
QueryParamType.scala 28.3% 🍏
DBTestSuite.scala 24.2% 🍏
Postgres.scala 15.22% 🍏
PostgresQueryParamValue.scala 0% 🍏

@github-actions
Copy link

github-actions bot commented Jan 31, 2026

JaCoCo Coverage Report

Metric (instruction) Coverage Threshold Status
Overall 46.82% 80.0%
Changed Files 46.82% 80.0%
Report Coverage (O/Ch) Threshold (O/Ch) Status (O/Ch)
Report: balta - scala:2.12.18 46.82% / 44.69% 80.0% / 80.0% ❌/❌
File Path Coverage Threshold Status
AsIsNaming.scala 56.52% 0.0%
ConnectionInfo.scala 54.72% 0.0%
DBConnection.scala 0.0% 0.0%
DBFunction.scala 47.74% 0.0%
DBQuerySupport.scala 100.0% 0.0%
DBTable.scala 86.02% 0.0%
DBTestSuite.scala 13.36% 0.0%
ExplicitNamingRequired.scala 68.75% 0.0%
LettersCase.scala 18.18% 0.0%
MapBasedNaming.scala 67.44% 0.0%
MapImplicits.scala 12.12% 0.0%
NamingConvention.scala 81.48% 0.0%
NamingException.scala 23.68% 0.0%
OptionImplicits.scala 14.86% 0.0%
Params.scala 44.05% 0.0%
Postgres.scala 27.68% 0.0%
PostgresQueryParamValue.scala 0.0% 0.0%
QueryParamType.scala 25.32% 0.0%
QueryParamValue.scala 50.82% 0.0%
QueryResult.scala 18.52% 0.0%
QueryResultRow.scala 90.5% 0.0%
QueryResultRowImplicits.scala 55.11% 0.0%
SimpleJsonString.scala 22.22% 0.0%
SnakeCaseNaming.scala 93.44% 0.0%

@miroslavpojer miroslavpojer changed the title Introduce MoranaApps Jacoco measuring solution Add MoranaApps Jacoco support Feb 1, 2026
@miroslavpojer miroslavpojer marked this pull request as ready for review February 1, 2026 18:43
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🤖 Fix all issues with AI agents
In @.github/workflows/jacoco_report.yml:
- Around line 57-69: Replace the nonexistent action MoranaApps/jacoco-report@v2
with the known public action madrapps/jacoco-report@v1.7.2 (or the specific
version you want) and align the inputs to that action's documented parameters:
use the action's "token" and "files" (instead of "paths") for the report glob,
keep the overall/changed-files coverage inputs that madrapps supports (map your
env.coverage-overall and env.coverage-changed-files accordingly), and remove
unsupported inputs such as "sensitivity", "skip-unchanged" and
"min-coverage-per-changed-file"; alternatively, if MoranaApps/jacoco-report@v2
is a private/internal action, confirm it exists in your environment and document
its supported inputs before keeping it.

In
`@balta/src/main/scala/za/co/absa/db/balta/postgres/classes/SimpleJsonString.scala`:
- Line 18: Remove the test/debug artifact comment "// jacoco-touch: simulate
change" from SimpleJsonString.scala (the file/class SimpleJsonString) so
production code contains no JaCoCo simulation lines; simply delete that comment
and ensure no other test-only markers remain in the SimpleJsonString source
before merging.

In
`@balta/src/main/scala/za/co/absa/db/mag/naming/implementations/SnakeCaseNaming.scala`:
- Line 18: Remove the test artifact comment "// jacoco-touch: simulate change"
from SnakeCaseNaming.scala (and any identical occurrences in other Scala source
files); locate the SnakeCaseNaming implementation (object/class/trait named
SnakeCaseNaming) and delete that non-functional comment line, then run a quick
grep/search across the repo for "jacoco-touch: simulate change" and remove all
matches before merging.

In `@jmf-rules.txt`:
- Around line 118-135: The global patterns using wildcard receiver `*#` are too
broad (e.g., symbols `apply(*)`, `unapply(*)`, `name()`, `groups()`,
`optionalAttributes()`) and will exclude non-boilerplate business methods;
narrow their scope by replacing the global `*#` selector with package-specific
selectors (for example target model or generated packages like
`*.model.*#apply(*)` / `*.model.*#unapply(*)`) or remove them from the globals
section and re-add under PROJECT RULES with appropriate package prefixes so only
intended boilerplate methods are excluded.

In `@project/FilteredJacocoAgentPlugin.scala`:
- Line 73: Remove the duplicate lazy val Jmf = config("jmf").extend(Compile)
definition (it shadows the autoImport Jmf); delete the second definition in
FilteredJacocoAgentPlugin and instead update the original autoImport Jmf
declaration to call config("jmf").extend(Compile) so there is a single,
correctly extended Jmf symbol used throughout.
- Line 36: There are two conflicting definitions of Jmf (val Jmf =
config("jmf").hide and config("jmf").extend(Compile)); remove the duplicate and
make the remaining definition reflect the intended semantics—update the single
Jmf definition (the one currently using .hide) to use
config("jmf").extend(Compile) and delete the other duplicate definition so Jmf
is defined once consistently.
- Line 358: The jacocoReport task uses a hardcoded "java" binary which is
inconsistent with jmfRewrite's resolution from java.home; update jacocoReport to
resolve the JVM binary the same way (e.g., read System.getProperty("java.home")
and construct javaBin or reuse an extracted helper) and replace the literal
"java" in the args Seq with that resolved javaBin so the task works when java is
not on PATH; reference the jacocoReport task and mirror the java resolution
logic used in jmfRewrite (lines building javaBin from java.home).
🧹 Nitpick comments (14)
balta/src/main/scala/za/co/absa/db/mag/naming/implementations/AsIsNaming.scala (1)

18-18: Remove the test artifact comment before merging.

This comment appears to be a testing artifact used to trigger JaCoCo coverage evaluation during development. It adds no functional value and should be cleaned up before the PR is merged.

🧹 Proposed fix to remove the test comment
 package za.co.absa.db.mag.naming.implementations
-// jacoco-touch: simulate change
 
 import za.co.absa.db.mag.naming.LettersCase.AsIs
balta/src/main/scala/za/co/absa/db/balta/classes/inner/ConnectionInfo.scala (1)

18-18: Consider removing the test comment.

This "jacoco-touch" comment appears to be a temporary artifact from testing the JaCoCo integration. If it served only to trigger coverage evaluation during testing, it can be removed before merging.

balta/src/main/scala/za/co/absa/db/balta/classes/DBQuerySupport.scala (1)

18-18: Consider removing the test comment.

This "jacoco-touch" comment appears to be a temporary artifact from testing the JaCoCo integration. If it served only to trigger coverage evaluation during testing, it can be removed before merging.

balta/src/main/scala/za/co/absa/db/balta/implicits/MapImplicits.scala (1)

18-18: Consider removing the test comment.

This "jacoco-touch" comment appears to be a temporary artifact from testing the JaCoCo integration. If it served only to trigger coverage evaluation during testing, it can be removed before merging.

balta/src/main/scala/za/co/absa/db/balta/classes/DBTable.scala (1)

18-18: Consider removing the test comment.

This "jacoco-touch" comment appears to be a temporary artifact from testing the JaCoCo integration. If it served only to trigger coverage evaluation during testing, it can be removed before merging.

balta/src/main/scala/za/co/absa/db/balta/implicits/QueryResultRowImplicits.scala (1)

18-18: Consider removing the test comment.

This "jacoco-touch" comment appears to be a temporary artifact from testing the JaCoCo integration. If it served only to trigger coverage evaluation during testing, it can be removed before merging.

balta/src/main/scala/za/co/absa/db/balta/postgres/implicits/Postgres.scala (1)

18-18: Consider removing the test comment.

This "jacoco-touch" comment appears to be a temporary artifact from testing the JaCoCo integration. If it served only to trigger coverage evaluation during testing, it can be removed before merging.

balta/src/main/scala/za/co/absa/db/balta/classes/DBConnection.scala (1)

18-18: Consider removing the test comment.

This "jacoco-touch" comment appears to be a temporary artifact from testing the JaCoCo integration. If it served only to trigger coverage evaluation during testing, it can be removed before merging.

balta/src/main/scala/za/co/absa/db/balta/classes/DBFunction.scala (1)

18-18: Remove debug artifact comment before merging.

This // jacoco-touch: simulate change comment appears to be a development artifact used to force JaCoCo to process this file. Based on the commit history ("Fake change to see full output of Jacoco"), this should be removed before merging to master to avoid polluting the codebase with non-functional comments.

The AI summary indicates similar comments were added across numerous Scala files—consider removing them all.

.github/workflows/jacoco_report.yml (2)

12-12: coverage-per-changed-file: 0.0 effectively disables per-file threshold checking.

Setting this threshold to 0.0 means individual changed files won't fail the build regardless of their coverage. If this is intentional (e.g., to focus only on aggregate metrics), consider adding a comment explaining the rationale. Otherwise, a meaningful threshold would provide better coverage enforcement.


71-135: Remove commented-out code.

This large block of commented-out workflow steps adds noise and maintenance burden. Since the code is preserved in version control history, it can be recovered if needed. Keeping it commented out suggests the migration may be incomplete or experimental.

If this is intentional for reference during the transition period, consider:

  1. Adding a TODO comment with a target date for removal, or
  2. Removing it entirely and referencing the previous commit in the PR description
♻️ Suggested change
          min-coverage-per-changed-file: ${{ env.coverage-per-changed-file }}
          skip-unchanged: false
-
-      # - name: Add coverage to PR
-      #   if: steps.jacocorun.outcome == 'success'
-      ... (remove all commented lines 71-135)
jmf-rules.txt (1)

141-144: Redundant rules duplicating global definitions.

Lines 141-142 define *$*#apply(*) and *$*#unapply(*) for companion objects, but lines 120-121 already define *#apply(*) and *#unapply(*) which match all classes including companions. The companion-specific rules are redundant unless you narrow the global rules.

project/FilteredJacocoAgentPlugin.scala (2)

105-109: Redundant default for jacocoPluginEnabled.

jacocoPluginEnabled := false is set here in buildSettings (line 106) and again in projectSettings (line 133), but JacocoBaseKeysPlugin already sets the default to false in its projectSettings. Consider removing the redundant assignments.


174-183: Unused variable and duplicate assignment.

  • Line 175: upd is assigned but never used; line 189 re-fetches the same value
  • Line 182: rulesFile duplicates rules from line 174
🧹 Proposed cleanup
-      val rules      = jmfRulesFile.value
-      val upd        = (Jmf / update).value   // hoisted
+      val rules      = jmfRulesFile.value     // used for existence check and CLI arg
       val log        = streams.value.log
       val outRoot    = jmfOutDir.value
       val mainCls    = jmfCliMain.value
       val dryRun     = jmfDryRun.value
       val workDir    = baseDirectory.value
       val classesIn  = (Compile / classDirectory).value
-      val rulesFile  = jmfRulesFile.value
       val enabled    = jacocoPluginEnabled.value

Comment on lines 57 to 69
- name: Check coverage thresholds and add reports in PR comments
id: jacoco
uses: MoranaApps/jacoco-report@v2
with:
paths: ${{ github.workspace }}/balta/target/scala-${{ env.scalaShort }}/jacoco/report/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
token: '${{ secrets.GITHUB_TOKEN }}'
paths: |
balta/target/**/jacoco/report/jacoco.xml
sensitivity: "detail"
comment-mode: 'single'
min-coverage-overall: ${{ env.coverage-overall }}
min-coverage-changed-files: ${{ env.coverage-changed-files }}
title: JaCoCo 'balta' module code coverage report - scala ${{ env.scalaLong }}
update-comment: true
- name: Get the Coverage info
if: steps.jacocorun.outcome == 'success'
run: |
echo "Total 'balta' module coverage ${{ steps.jacoco-balta.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco-balta.outputs.coverage-changed-files }}"
- name: Fail PR if changed files coverage is less than ${{ env.coverage-changed-files }}%
if: steps.jacocorun.outcome == 'success'
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
with:
script: |
const coverageCheckFailed =
Number('${{ steps.jacoco-balta.outputs.coverage-changed-files }}') < Number('${{ env.coverage-changed-files }}')
if (coverageCheckFailed) {
core.setFailed('Changed files coverage is less than ${{ env.coverage-changed-files }}%!');
}
- name: Fail PR if overall files coverage is less than ${{ env.coverage-overall }}%
if: ${{ (steps.jacocorun.outcome == 'success') && (env.check-overall-coverages == 'true') }}
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
with:
script: |
const coverageCheckFailed =
Number('${{ steps.jacoco-balta.outputs.coverage-overall }}') < Number('${{ env.coverage-overall }}');
if (coverageCheckFailed) {
core.setFailed('Overall coverage is less than ${{ env.coverage-overall }}%!');
}
- name: Edit JaCoCo comments on build failure
if: steps.jacocorun.outcome != 'success'
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
with:
script: |
const issue_number = context.issue.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
const jacocoReportRegExp = /^### JaCoCo .* code coverage report .*/;
min-coverage-per-changed-file: ${{ env.coverage-per-changed-file }}
skip-unchanged: false
Copy link

@coderabbitai coderabbitai bot Feb 1, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

MoranaApps/jacoco-report GitHub action v2 documentation

💡 Result:

I couldn’t find any public GitHub Action repository or release at MoranaApps/jacoco-report (or a published @v2 major version for it). The widely used action with this name is madrapps/jacoco-report, whose latest published release is v1.7.2 and whose documentation is on the GitHub Marketplace page. [1]

madrapps/jacoco-report documentation (latest: v1.7.2)

What it does: Posts a JaCoCo coverage report as a PR comment (and/or workflow summary), with optional minimum coverage thresholds. [1]

Typical usage

- name: Add coverage to PR
  uses: madrapps/jacoco-report@v1.7.2
  with:
    paths: ${{ github.workspace }}/**/build/reports/jacoco/**/testCoverage.xml
    token: ${{ secrets.GITHUB_TOKEN }}
    min-coverage-overall: 80
    min-coverage-changed-files: 80
    update-comment: true
    title: Code Coverage

[1]

Inputs (high-level)

  • paths (required): comma-separated JaCoCo XML report paths (supports glob). [1]
  • token (required): token used to comment on PRs. [1]
  • min-coverage-overall, min-coverage-changed-files (optional). [1]
  • Also supports: update-comment, comment-type (pr_comment / summary / both), pr-number, title, skip-if-no-changes, pass-emoji, fail-emoji, continue-on-error, debug-mode. [1]

Outputs

  • coverage-overall
  • coverage-changed-files [1]

If you meant a different repo (e.g., a fork under MoranaApps) paste its GitHub URL and I’ll pull the exact v2 docs for that specific action.

Source:
[1] GitHub Marketplace – “JaCoCo Report” action documentation (Madrapps)


🏁 Script executed:

# Search for MoranaApps references in the codebase
rg -i "moranaapps" --type yaml --type yml

# Also check git history for this workflow file if available
git log --oneline .github/workflows/jacoco_report.yml | head -20

Repository: AbsaOSS/balta

Length of output: 185


🏁 Script executed:

# Search for MoranaApps more broadly
rg "MoranaApps" --type-list | head -5
rg "MoranaApps"

# Also check the full workflow file to understand context
cat -n .github/workflows/jacoco_report.yml | head -80

Repository: AbsaOSS/balta

Length of output: 4317


Action MoranaApps/jacoco-report@v2 does not exist on GitHub Marketplace and will cause workflow failure.

The action referenced on line 59 cannot be found publicly. The known JaCoCo reporting action is madrapps/jacoco-report (latest v1.7.2). Additionally, the parameters used (sensitivity, comment-mode, skip-unchanged, min-coverage-per-changed-file) do not match any documented inputs for available JaCoCo actions. Either correct the action name to a valid existing action and align the parameters, or confirm this is a private action available in your environment. The commented-out code (lines 71–80) suggests the previous implementation used madrapps/jacoco-report.

🤖 Prompt for AI Agents
In @.github/workflows/jacoco_report.yml around lines 57 - 69, Replace the
nonexistent action MoranaApps/jacoco-report@v2 with the known public action
madrapps/jacoco-report@v1.7.2 (or the specific version you want) and align the
inputs to that action's documented parameters: use the action's "token" and
"files" (instead of "paths") for the report glob, keep the overall/changed-files
coverage inputs that madrapps supports (map your env.coverage-overall and
env.coverage-changed-files accordingly), and remove unsupported inputs such as
"sensitivity", "skip-unchanged" and "min-coverage-per-changed-file";
alternatively, if MoranaApps/jacoco-report@v2 is a private/internal action,
confirm it exists in your environment and document its supported inputs before
keeping it.

Copy link
Collaborator Author

@miroslavpojer miroslavpojer Feb 1, 2026

Choose a reason for hiding this comment

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

v2 changed to sha.

Copy link

Choose a reason for hiding this comment

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

@miroslavpojer, I see you've moved from @v2 to the specific SHA @54bfe284d1119dc917dddba80517c54c5bcf3627. However, this doesn't address the underlying concern—MoranaApps/jacoco-report doesn't appear to exist as a public GitHub Action.

Is this a private, internal, or forked action that your organization has access to? If so, that's perfectly fine, and the workflow should work as long as your GitHub Actions runner can access it.

The parameters you're using (sensitivity, comment-mode, min-coverage-per-changed-file, skip-unchanged) also differ from the standard madrapps/jacoco-report action, which further suggests this is a custom implementation.

If this action is accessible in your environment and the workflow runs successfully in your CI, then you're all set. Otherwise, you may need to verify the action's availability or consider using the public madrapps/jacoco-report action instead.

*/

package za.co.absa.db.balta.postgres.classes
// jacoco-touch: simulate change
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove test artifact before merging.

This comment was added solely to trigger JaCoCo coverage evaluation ("simulate change") and serves no functional purpose in the production codebase. Test and debugging artifacts should be removed before merging to master.

🧹 Proposed fix
 package za.co.absa.db.balta.postgres.classes
-// jacoco-touch: simulate change
 
🤖 Prompt for AI Agents
In
`@balta/src/main/scala/za/co/absa/db/balta/postgres/classes/SimpleJsonString.scala`
at line 18, Remove the test/debug artifact comment "// jacoco-touch: simulate
change" from SimpleJsonString.scala (the file/class SimpleJsonString) so
production code contains no JaCoCo simulation lines; simply delete that comment
and ensure no other test-only markers remain in the SimpleJsonString source
before merging.

*/

package za.co.absa.db.mag.naming.implementations
// jacoco-touch: simulate change
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove the test artifact comment before merging.

This non-functional comment appears to be a test artifact from the initial JaCoCo integration testing (as mentioned in the PR's "Fake change to see full output of Jacoco" commit). Test artifacts like this should not be committed to the production codebase.

🧹 Proposed fix to remove the test comment
 package za.co.absa.db.mag.naming.implementations
-// jacoco-touch: simulate change
 
 import za.co.absa.db.mag.naming.LettersCase.LowerCase

According to the enriched summary, similar // jacoco-touch: simulate change comments were added across multiple Scala source files. Please ensure all such test artifacts are removed across the entire codebase before merging.

🤖 Prompt for AI Agents
In
`@balta/src/main/scala/za/co/absa/db/mag/naming/implementations/SnakeCaseNaming.scala`
at line 18, Remove the test artifact comment "// jacoco-touch: simulate change"
from SnakeCaseNaming.scala (and any identical occurrences in other Scala source
files); locate the SnakeCaseNaming implementation (object/class/trait named
SnakeCaseNaming) and delete that non-functional comment line, then run a quick
grep/search across the repo for "jacoco-touch: simulate change" and remove all
matches before merging.

Comment on lines +118 to +135
*#canEqual(*) id:case-canequal
*#equals(*) id:case-equals
*#apply(*) id:case-apply
*#unapply(*) id:case-unapply
*#hashCode(*) id:case-hashcode
*#copy(*) id:case-copy
*#copy$default$*(*) id:case-copy-defaults
*#productElement() id:case-prod-element
*#productArity() id:case-prod-arity
*#productPrefix() id:case-prod-prefix
*#productIterator() id:case-prod-iterator
*#tupled() id:case-tupled
*#curried() id:case-curried
*#toString() id:case-tostring
*#name() id:case-name
*#groups() id:case-groups
*#optionalAttributes() id:case-optionalAttributes

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Global rules may be overly aggressive and could hide real business logic.

Several rules use *# (all classes) which contradicts the documentation's own warning at line 74 about keeping "package scope narrow":

  • *#apply(*) and *#unapply(*) (lines 120-121) will exclude coverage for all apply/unapply methods, including custom factory logic
  • *#name(), *#groups(), *#optionalAttributes() (lines 132-134) are very generic names that could match non-boilerplate methods

Consider scoping these to specific packages (e.g., *.model.*#apply(*)) or removing them from globals and adding them under PROJECT RULES with appropriate package prefixes.

🤖 Prompt for AI Agents
In `@jmf-rules.txt` around lines 118 - 135, The global patterns using wildcard
receiver `*#` are too broad (e.g., symbols `apply(*)`, `unapply(*)`, `name()`,
`groups()`, `optionalAttributes()`) and will exclude non-boilerplate business
methods; narrow their scope by replacing the global `*#` selector with
package-specific selectors (for example target model or generated packages like
`*.model.*#apply(*)` / `*.model.*#unapply(*)`) or remove them from the globals
section and re-add under PROJECT RULES with appropriate package prefixes so only
intended boilerplate methods are excluded.

val jacocoSetUserDirToBuildRoot = settingKey[Boolean]("Mimic non-forked runs by setting -Duser.dir to the build root for forked tests")

val jmfCoreVersion = settingKey[String]("JMF core library version")
val Jmf = config("jmf").hide
Copy link

@coderabbitai coderabbitai bot Feb 1, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Duplicate Jmf configuration definition with conflicting semantics.

Jmf is defined here with .hide, but is redefined at line 73 as config("jmf").extend(Compile). The outer definition at line 73 will shadow this one in the plugin's scope, making the .hide variant effectively unused.

Remove one of the definitions and ensure consistent semantics throughout.

🔧 Proposed fix: Remove the duplicate definition

Remove line 73 and update line 36 to use the desired semantics:

-    val Jmf                = config("jmf").hide
+    val Jmf                = config("jmf").extend(Compile)

Then remove line 73:

-  lazy val Jmf = config("jmf").extend(Compile)
🤖 Prompt for AI Agents
In `@project/FilteredJacocoAgentPlugin.scala` at line 36, There are two
conflicting definitions of Jmf (val Jmf = config("jmf").hide and
config("jmf").extend(Compile)); remove the duplicate and make the remaining
definition reflect the intended semantics—update the single Jmf definition (the
one currently using .hide) to use config("jmf").extend(Compile) and delete the
other duplicate definition so Jmf is defined once consistently.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will be fixed in another issue.

Copy link

Choose a reason for hiding this comment

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

@miroslavpojer, understood! Would you like me to create a GitHub issue to track the duplicate Jmf configuration definition fix?

}
}

lazy val Jmf = config("jmf").extend(Compile)
Copy link

@coderabbitai coderabbitai bot Feb 1, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Remove duplicate Jmf configuration.

This line redefines Jmf which was already defined at line 36 in autoImport. This definition shadows the autoImport version and creates confusion about which one is used where.

🔧 Proposed fix
-  lazy val Jmf = config("jmf").extend(Compile)
-

And update line 36 to use .extend(Compile) if that semantic is needed:

-    val Jmf                = config("jmf").hide
+    val Jmf                = config("jmf").extend(Compile)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
lazy val Jmf = config("jmf").extend(Compile)
🤖 Prompt for AI Agents
In `@project/FilteredJacocoAgentPlugin.scala` at line 73, Remove the duplicate
lazy val Jmf = config("jmf").extend(Compile) definition (it shadows the
autoImport Jmf); delete the second definition in FilteredJacocoAgentPlugin and
instead update the original autoImport Jmf declaration to call
config("jmf").extend(Compile) so there is a single, correctly extended Jmf
symbol used throughout.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will be fixed in another issue.

Copy link

Choose a reason for hiding this comment

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

@miroslavpojer, understood! Would you like me to create a GitHub issue to track this duplicate Jmf configuration fix?

reportDir
} else {
// repeat flags per path
val args = Seq("java","-jar", cli.getAbsolutePath, "report", execFile.getAbsolutePath) ++
Copy link

@coderabbitai coderabbitai bot Feb 1, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent Java binary resolution.

jacocoReport uses hardcoded "java" while jmfRewrite (lines 195-198) properly resolves the Java binary from java.home. If java is not on PATH, this task will fail.

🔧 Proposed fix: Use consistent Java binary resolution

Extract the javaBin resolution to a helper or inline it here:

+      val javaBin = {
+        val h = sys.props.get("java.home").getOrElse("")
+        if (h.nonEmpty) new java.io.File(new java.io.File(h, "bin"), "java").getAbsolutePath else "java"
+      }
       // repeat flags per path
-      val args = Seq("java","-jar", cli.getAbsolutePath, "report", execFile.getAbsolutePath) ++
+      val args = Seq(javaBin, "-jar", cli.getAbsolutePath, "report", execFile.getAbsolutePath) ++
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
val args = Seq("java","-jar", cli.getAbsolutePath, "report", execFile.getAbsolutePath) ++
val javaBin = {
val h = sys.props.get("java.home").getOrElse("")
if (h.nonEmpty) new java.io.File(new java.io.File(h, "bin"), "java").getAbsolutePath else "java"
}
// repeat flags per path
val args = Seq(javaBin, "-jar", cli.getAbsolutePath, "report", execFile.getAbsolutePath) ++
🤖 Prompt for AI Agents
In `@project/FilteredJacocoAgentPlugin.scala` at line 358, The jacocoReport task
uses a hardcoded "java" binary which is inconsistent with jmfRewrite's
resolution from java.home; update jacocoReport to resolve the JVM binary the
same way (e.g., read System.getProperty("java.home") and construct javaBin or
reuse an extracted helper) and replace the literal "java" in the args Seq with
that resolved javaBin so the task works when java is not on PATH; reference the
jacocoReport task and mirror the java resolution logic used in jmfRewrite (lines
building javaBin from java.home).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will be fixed in another issue.

Copy link

Choose a reason for hiding this comment

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

@miroslavpojer, understood! Would you like me to create a GitHub issue to track this Java binary resolution inconsistency for the follow-up fix?

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/jacoco_report.yml:
- Around line 10-12: The workflow currently sets coverage-overall: 80.0 and
coverage-changed-files: 80.0 but leaves coverage-per-changed-file: 0.0 which
effectively disables per-file enforcement; update coverage-per-changed-file to
80.0 to match the other gates (or explicitly confirm intent and document why it
should remain 0.0). Locate the keys coverage-overall, coverage-changed-files and
coverage-per-changed-file in the jacoco_report.yml and make the change or add a
comment explaining the intended exception.

Comment on lines +10 to +12
coverage-overall: 80.0
coverage-changed-files: 80.0
coverage-per-changed-file: 0.0
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/jacoco_report.yml | head -80

Repository: AbsaOSS/balta

Length of output: 3278


🏁 Script executed:

# Search for references to coverage thresholds
rg "coverage-per-changed-file|per-file|per_file_coverage" -i --type yaml --type md --type txt

Repository: AbsaOSS/balta

Length of output: 39


🏁 Script executed:

# Check git history for this file to understand context
git log --oneline .github/workflows/jacoco_report.yml | head -20

Repository: AbsaOSS/balta

Length of output: 143


🏁 Script executed:

# Get the commit details for the change
git show c83994c --stat

Repository: AbsaOSS/balta

Length of output: 5486


🏁 Script executed:

# Search for README or documentation files
fd -t f "README|CONTRIBUTING|docs" -i | grep -E "\.(md|txt)$" | head -10

Repository: AbsaOSS/balta

Length of output: 66


🏁 Script executed:

cat README.md | grep -i -A 5 -B 5 "coverage\|jacoco"

Repository: AbsaOSS/balta

Length of output: 717


🌐 Web query:

MoranaApps jacoco-report action min-coverage-per-changed-file 0.0 behavior

💡 Result:

I couldn’t find any public docs/source for MoranaApps/jacoco-report that mention an input named min-coverage-per-changed-file (web search only turns up the upstream madrapps/jacoco-report, whose documented thresholds are overall and “all changed files combined”, not “per changed file”).[1]

Given how coverage thresholds are typically implemented, if min-coverage-per-changed-file exists in the MoranaApps fork and is compared as:

  • fail if fileCoverage < minCoveragePerChangedFile

then setting min-coverage-per-changed-file: 0.0 effectively disables the per-file gate, because coverage percentages normally can’t be negative, so every file will satisfy coverage >= 0.0. Other gates (e.g., overall coverage / combined changed-files coverage) would still apply if configured.

If you paste the action link (or the action.yml inputs section / the exact version tag you’re using), I can confirm the exact behavior from the fork’s actual implementation.

Source: [1]


🏁 Script executed:

# Fetch the action.yml from the specific commit
curl -s https://raw.githubusercontent.com/MoranaApps/jacoco-report/54bfe284d1119dc917dddba80517c54c5bcf3627/action.yml | head -100

Repository: AbsaOSS/balta

Length of output: 3342


🏁 Script executed:

# Also search the repo for any related issues or discussions
rg "coverage-per-changed-file|per.file.*coverage" -i --type md

Repository: AbsaOSS/balta

Length of output: 39


Clarify intent: min-coverage-per-changed-file: 0.0 disables per-file coverage enforcement.

The min-coverage-per-changed-file parameter is supported by the MoranaApps action and setting it to 0.0 effectively disables the per-file coverage gate (any coverage ≥ 0.0 passes). All other thresholds are set to 80.0, so confirm whether this disparity is intentional or should be 80.0 to enforce per-file coverage consistently.

🤖 Prompt for AI Agents
In @.github/workflows/jacoco_report.yml around lines 10 - 12, The workflow
currently sets coverage-overall: 80.0 and coverage-changed-files: 80.0 but
leaves coverage-per-changed-file: 0.0 which effectively disables per-file
enforcement; update coverage-per-changed-file to 80.0 to match the other gates
(or explicitly confirm intent and document why it should remain 0.0). Locate the
keys coverage-overall, coverage-changed-files and coverage-per-changed-file in
the jacoco_report.yml and make the change or add a comment explaining the
intended exception.

*/

package za.co.absa.db.balta.classes
// jacoco-touch: simulate change
Copy link
Collaborator

Choose a reason for hiding this comment

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

will you revert all of these?

Copy link
Collaborator

@lsulak lsulak left a comment

Choose a reason for hiding this comment

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

Ok my review is finished, pretty much what we have elsewhere, thank you. Concerned about the code docs / comments there though, I would't prefer them to stay in master

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