Skip to content

Tighten coverage gates (require CI to pass; measure mapper logic) - #184

Merged
AndreasIgel merged 2 commits into
java-helpers:mainfrom
AndreasIgel:feature/162-tighten-coverage-gates
Jul 20, 2026
Merged

AndreasIgel merged 2 commits into
java-helpers:mainfrom
AndreasIgel:feature/162-tighten-coverage-gates

Conversation

@AndreasIgel

@AndreasIgel AndreasIgel commented Jul 15, 2026 •

Copy link
Copy Markdown
Collaborator

Upstream counterpart of fork PR AndreasIgel#9. Head branch: AndreasIgel/simple-builders-fork:feature/162-tighten-coverage-gates → base java-helpers/simple-builders:main.

Summary

Makes the coverage signal honest and enforced.

Fixes #162

  • codecov.yml: require_ci_to_pass: false → true, so a passing coverage status can't be reported when the CI build/tests failed.
  • Coverage exclusions: dropped the broad **/*Mapper* wildcard (it hid real code-generation logic — measured RoasterMapper ~69%, JavaLangMapper ~93%). Kept genuine boilerplate excluded (DTO model package, exception packages via **/exceptions/**, generated sources). sonar.coverage.exclusions (root pom.xml) and the JaCoCo excludes (processor/pom.xml) are kept in sync.

The 80% project target is retained: measured processor coverage stays ~93% with the mappers now included, so there's ample headroom without loosening.

Validation

  • mvn -Pmetrics clean verify passes; processor overall instruction coverage 93.2% with RoasterMapper/JavaLangMapper now present in the JaCoCo report and RoasterMapperException still excluded.
  • codecov.yml is valid YAML.

Note (out of scope, flagged for follow-up): under local Maven 3.6.3 the core module's tests report "Tests run: 0" (core doesn't pin maven-surefire-plugin like processor does), so core shows 0% locally. This looks like an old default-surefire/JUnit5 discovery issue; happy to open a separate issue/PR to pin surefire in core.

Existing red checks (build, dependency-review) are the fork's missing SONAR_TOKEN/CODECOV_TOKEN and disabled Dependency graph — unrelated.

Maintainer TODOs

  • Confirm the Codecov integration/status is configured for the repo (it already posts PR comments, so this is a verification step). With require_ci_to_pass: true, Codecov only reports a passing status once CI actually passes — if you gate merges on the Codecov status, make sure it is added to branch protection.

- codecov.yml: require_ci_to_pass: true so a green coverage status can't
  mask a failed CI build/tests.
- Drop the broad **/*Mapper* wildcard from sonar.coverage.exclusions and
  the JaCoCo excludes so real mapper logic (RoasterMapper ~69%,
  JavaLangMapper ~93%) is measured; keep excluding DTO model, exception
  packages and generated sources. Sonar and JaCoCo kept in sync.

Processor line coverage remains ~93% (well above the 80% project target).

Refs java-helpers#162

Co-Authored-By: Andreas Igel <andreas.igel@computacenter.com>
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@AndreasIgel
AndreasIgel merged commit 568ebc7 into java-helpers:main Jul 20, 2026
5 checks passed
@devin-ai-integration
devin-ai-integration Bot deleted the feature/162-tighten-coverage-gates branch August 16, 2026 21:10
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.

Tighten coverage gates: require CI to pass and stop excluding mapper logic from coverage

1 participant