Skip to content

fix(coverage): make JaCoCo production gate non-vacuous - #164

Draft
seonghobae wants to merge 12 commits into
developfrom
fix/nonvacuous-jacoco-coverage
Draft

fix(coverage): make JaCoCo production gate non-vacuous#164
seonghobae wants to merge 12 commits into
developfrom
fix/nonvacuous-jacoco-coverage

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Fix issue #162: protected mightyETL's durable-job JaCoCo gate can analyze zero production classes and still report every zero-missed threshold as satisfied. This direct-develop slice makes production class selection explicit, adds a non-empty bundle invariant, preserves the zero-missed thresholds, and adds the tests needed to close the real deficits exposed once coverage stopped being vacuous.

Exact current identity

  • protected/live base: develop@622e5e6c3d534f230c390f10e3832efadfc01825;
  • branch: fix/nonvacuous-jacoco-coverage;
  • fail-first head: ba174ac98128da254358a5f8dccdfcf8eee93496;
  • exact current source head: 2838fbc0735cc5d5d70b254f2eaa793dc995dcd2;
  • current synthetic merge preview: 2436723db8fdf898be939fed7b406e8d6133f7e9;
  • GitHub mergeability: true;
  • Draft: true;
  • formal reviews: none;
  • unresolved review threads: zero;
  • current diff is exactly seven files: etl-service/pom.xml, four coverage/behavior tests, coverage doctoring, and CHANGELOG.md.

Every check/review from a predecessor head or base is historical and does not transfer after movement.

RCA

Protected etl-service/pom.xml reused dotted class-name patterns at plugin level:

<includes>
  <include>com.xtrmetl.etl.job.*</include>
  <include>com.xtrmetl.etl.controller.EtlJobController*</include>
</includes>

JaCoCo agent instrumentation accepts class-name patterns, while Maven report/check apply file filters over compiled class files. Reusing one dotted selector across incompatible goal semantics left report/check with an empty production bundle. A second control failure made that dangerous: no rule required the analyzed bundle to contain even one class, so MISSEDCOUNT <= 0 was vacuously satisfied.

Protected/direct-develop integration evidence repeatedly reproduced the defect as:

Analyzed bundle 'etl-service' with 0 classes
All coverage checks have been met.

That is a quality-control false green, not 100% coverage.

TDD / remediation history

RED — configuration boundary

Fail-first head ba174ac98128da254358a5f8dccdfcf8eee93496 added JaCoCoCoverageConfigurationTest before changing the POM. The test requires:

  • no incompatible shared plugin-level selector;
  • report/check class-file filters for com/xtrmetl/etl/job/*.class and com/xtrmetl/etl/controller/EtlJobController*.class;
  • a BUNDLE CLASS / TOTALCOUNT / minimum 1 non-vacuity rule;
  • the intended production classes to exist at test runtime.

The protected POM violated the first three while the target classes were real, establishing fail-first evidence at the actual gate configuration rather than an absent fixture.

GREEN configuration exposes real coverage work

The selected production change:

  • removes the plugin-level include shared across incompatible goals;
  • allows normal agent instrumentation;
  • gives report/check their own class-file path filters;
  • keeps exact zero missed INSTRUCTION, LINE, METHOD and BRANCH thresholds;
  • adds BUNDLE CLASS / TOTALCOUNT >= 1 so an empty selection fails closed.

Once the eight real production classes became visible to JaCoCo, missing branches were treated as genuine test deficits rather than weakening the selector or thresholds. Subsequent bounded test commits cover the defensive and policy branches required by the existing production contract. The branch also contains docs/doctoring/jacoco-nonvacuous-coverage.md and a CHANGELOG.md entry documenting evidence semantics and rollback.

Current hosted proof

All exposed workflows associated with exact source head 2838fbc0735cc5d5d70b254f2eaa793dc995dcd2 are terminal-success:

  • CI 31342365406: success;
  • Dependency Review 31342365405: success;
  • CycloneDX SBOM 31342365408: success;
  • SAST Semgrep 31342365420: success;
  • Security Scan 31342365407: success.

CI macOS checked out GitHub synthetic merge 2436723db8fdf898be939fed7b406e8d6133f7e9 (Merge 2838fbc... into 622e5e6...). On that integration tree:

Analyzed bundle 'etl-service' with 8 classes
...
Analyzed bundle 'etl-service' with 8 classes
All coverage checks have been met.

The full reactor completed successfully; the ETL module ran 281 tests, CDC ran 106 tests, and gateway tests also passed. The selected eight production classes therefore satisfy the unchanged zero-missed instruction/line/method/branch rules while the explicit non-empty bundle rule proves the gate is no longer vacuous.

This is strong causal A/B evidence at the coverage boundary: the protected selector produces zero analyzed classes, while this candidate analyzes eight real classes under the same product codebase and zero-missed acceptance rules. It is still synthetic-merge compatibility/coverage evidence, not accepted literal-source evidence, because the current protected PR workflow checked out refs/pull/164/merge rather than literal source head.

Evidence / review boundary

Current formal review submissions are empty and current unresolved inline review threads are zero. No status, check, comment, model output, or synthetic merge is treated as qualifying independent approval.

The remaining merge blockers are therefore control/evidence boundaries rather than an unaddressed coverage defect:

  • accepted literal-source execution/security evidence remains dependent on the integrated exact-source control path (ci: schedule NVIDIA OpenCode maintenance agent #121 and its read-only central scanner dependency);
  • qualifying independent non-author formal approval is absent where mightyETL/CWL governance requires it;
  • any head/base movement invalidates the current checks/review facts and requires fresh evidence.

Do not weaken the class selection, remove the non-empty rule, lower thresholds, add exclusions, or claim the current protected zero-class gate is acceptable merely because other PRs are green.

Acceptance

Keep Draft until the unchanged exact source head has accepted source-identity evidence, every applicable current quality/security/dependency/SBOM gate remains green, zero valid unresolved review findings, and qualifying independent approval where required. After protected integration, rerun protected-develop acceptance and close #162 only when the integrated quality gate itself proves a non-empty production class set before reporting 100% coverage.

Summary by CodeRabbit

  • 버그 수정

    • 잘못된 JSON 입력과 유효하지 않은 식별자를 보다 정확히 거부하도록 검증을 강화했습니다.
    • 필수 암호화 기능을 사용할 수 없는 환경에서 명확한 오류를 반환합니다.
    • 유효하지 않은 데이터 처리 시 불필요한 저장 작업이 수행되지 않습니다.
  • 품질 개선

    • JaCoCo 커버리지 검사가 실제 프로덕션 클래스를 대상으로 수행되도록 개선했습니다.
    • 빈 분석 결과가 100% 커버리지로 잘못 통과하지 않도록 검증을 강화했습니다.
    • 관련 커버리지 정책과 검증 기준을 문서화했습니다.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 12ea00dc-9cb8-4451-b515-427f17fe0690

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

JaCoCo 설정이 실제 production class 파일을 선택하고 빈 BUNDLE을 실패시키도록 변경되었습니다. 관련 문서와 정책 테스트가 추가되었습니다. ETL 서비스 테스트는 해시 제공자, 입력 경계, Jackson 방어적 분기를 검증합니다.

Changes

JaCoCo 비공허 커버리지

Layer / File(s) Summary
JaCoCo 정책과 검증 기준
docs/doctoring/jacoco-nonvacuous-coverage.md, etl-service/src/test/java/com/xtrmetl/etl/job/EtlJobCoveragePolicyTest.java
비공허한 production class 선택과 class 파일 패턴을 문서화합니다. BUNDLE의 최소 클래스 수와 zero-missed 조건을 검증합니다.
JaCoCo Maven 설정 적용
etl-service/pom.xml, etl-service/src/test/java/com/xtrmetl/etl/documentation/JaCoCoCoverageConfigurationTest.java, CHANGELOG.md
공유 plugin include를 제거합니다. report/check에 명시적 .class 패턴을 적용합니다. BUNDLE에 최소 1개 클래스 조건을 추가합니다. 설정 검증과 변경 기록을 추가합니다.

ETL 서비스 경계 검증

Layer / File(s) Summary
입력 및 해시 제공자 경계
etl-service/src/test/java/com/xtrmetl/etl/job/EtlJobServiceBoundaryTest.java
SHA-256 제공자 부재와 잘못된 payload 및 식별자를 검증합니다.
Jackson 방어적 분기
etl-service/src/test/java/com/xtrmetl/etl/job/EtlJobServiceDefensiveBranchTest.java
null 트리와 Java null 배열 요소를 거부하는 동작을 검증합니다. 잠금 및 JDBC 영속화 호출도 검증합니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 JaCoCo 프로덕션 커버리지 게이트를 비공허하게 수정한 핵심 변경을 정확하고 간결하게 설명합니다.
Linked Issues check ✅ Passed [#162] 실제 클래스 파일 필터, 비어 있지 않은 BUNDLE 조건, 정확한 zero-missed 기준과 관련 검증 테스트를 구현했습니다.
Out of Scope Changes check ✅ Passed 추가된 문서, changelog, 설정 변경 및 테스트는 JaCoCo 게이트 수정과 필요한 프로덕션 분기 커버리지 확보에 관련됩니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/nonvacuous-jacoco-coverage

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.

Copy link
Copy Markdown
Collaborator Author

Fresh exact-head RCA for e9cec632d0b2336040a3e86363dc0348e0cab059: CI run 31315768638 is failed on all three hosted OS jobs, while Dependency Review/SBOM/SAST/Security are green. macOS job 93250645482 reaches the real ETL test boundary and fails first in EtlJobCoveragePolicyTest.etlModuleEnforcesCompleteInstructionAndBranchCoverageForTheDurableJobSlice (278 ETL tests, 1 failure). The failure is not JaCoCo runtime/report evidence yet: Surefire aborts the reactor before report-durable-job-coverage / check-durable-job-coverage execute.

The exact current source mismatch is deterministic: etl-service/pom.xml now correctly scopes report/check with class-file filters com/xtrmetl/etl/job/*.class and com/xtrmetl/etl/controller/EtlJobController*.class, plus CLASS/TOTALCOUNT >= 1; however existing EtlJobCoveragePolicyTest still asserts the superseded dotted plugin-level strings <include>com.xtrmetl.etl.job.*</include> and <include>com.xtrmetl.etl.controller.EtlJobController*</include>. JaCoCoCoverageConfigurationTest itself is green (3/3), so the current first failing boundary is the stale pre-existing policy test, not evidence that the replacement filter is empty.

Smallest safe next remedy on this already-active branch: update the older policy test test-first relative to its new contract so it asserts the separated report/check class-file filters and non-vacuity invariant rather than the removed dotted plugin-level filter, then rerun CI. Do not weaken/remove zero-missed thresholds or delete the older policy test. Acceptance still requires the subsequent hosted log to reach JaCoCo report/check, show a nonzero analyzed production bundle, and enforce exact zero missed instruction/line/method/branch. Current workflows use PR merge revisions unless literal-source checkout controls prove otherwise, so any future green remains synthetic-only evidence unless source identity is explicitly proven.

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Collaborator Author

Fresh follow-through on unchanged exact head f8fa8504f0cceb2f072befda09eef3d13169b5b4: the earlier stale-policy-test blocker is now gone. CI run 31317634945 reaches the actual JaCoCo enforcement boundary on all three hosted OS jobs. On macOS job 93255339808, the full ETL suite is green (278 tests, zero failures/errors/skips), JaCoCoCoverageConfigurationTest is green (3/3), and EtlJobCoveragePolicyTest is green (1/1). JaCoCo then reports Analyzed bundle 'etl-service' with 8 classes and fails closed on real residual coverage debt: 7 missed instructions, 2 missed lines, and 2 missed branches against zero-maximum thresholds; no missed-method violation is reported. Dependency Review, CycloneDX SBOM, SAST Semgrep, and Security Scan are all green for this source head.

This materially changes the RCA: configuration non-vacuity is now proven and the current first failing boundary is genuine production-path coverage, not filter syntax or a stale test. Do not weaken the bundle selection or thresholds. The next branch-local remedy should use the generated JaCoCo report (or equivalent exact class/line evidence) to add the smallest realistic tests for those residual branches/lines, then rerun the same gate. Current CI still checks the PR synthetic merge (e47a02b739f866836ee2f27b3962e109ebdd9980, merge of f8fa8504... into develop@622e5e6...), so a future green is strong merged-tree evidence but does not become literal-source acceptance until the exact-head checkout control integrates.

Copy link
Copy Markdown
Collaborator Author

Fresh exact-head follow-through for f8fa8504f0cceb2f072befda09eef3d13169b5b4 on unchanged develop@622e5e6c3d534f230c390f10e3832efadfc01825: the stale EtlJobCoveragePolicyTest blocker has been corrected and CI run 31317634945 now reaches the actual JaCoCo report/check boundary on all hosted jobs. macOS job 93255339808 runs 278 ETL tests with 0 failures / 0 errors / 0 skips, then reports Analyzed bundle 'etl-service' with 8 classes for both report and check. This proves the non-vacuity/configuration repair is effective; the previous zero-class false-green failure mode is gone on this candidate.

The same job then fails the strict BUNDLE gate on real uncovered production code: 7 missed instructions, 2 missed lines, and 2 missed branches (the method counter does not fail). Therefore this is a valid product-test deficit, not infrastructure, selector, or threshold noise. Dependency Review 31317634939, SBOM 31317634927, SAST 31317634934, and Security Scan 31317634952 are green, but CI remains failed and no formal review/approval exists.

RCA classification for the next source step: (1) execute_now for the active branch owner = identify the exact JaCoCo-uncovered lines/branches and add realistic production-boundary tests; (2) possible only if proven dead/unreachable = narrowly refactor/remove dead production paths with regression tests; (3) reject lowering the zero-missed limits, shrinking the intended class selection, adding exclusions, or restoring the vacuous filter. Re-run the exact same CI boundary after the smallest test-first repair and require the unchanged selected 8-class bundle to reach zero missed instruction/line/method/branch counters.

This loop is not mutating the source ref because fix/nonvacuous-jacoco-coverage moved repeatedly under another writer during the invocation; branch-local writer lease remains frozen here. This comment is dated coordination evidence only and does not promote the failed candidate to accepted coverage proof.

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
etl-service/src/test/java/com/xtrmetl/etl/documentation/JaCoCoCoverageConfigurationTest.java (1)

52-74: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

동일한 BUNDLE 규칙에서 zero-missed 제한을 구조적으로 검증하십시오.

현재 테스트는 CLASS TOTALCOUNT >= 1BUNDLE 규칙의 <limits> 아래에서 확인합니다. INSTRUCTION, LINE, METHOD, BRANCHMISSEDCOUNT <= 0 제한은 이 규칙과 연결하지 않습니다. 제한이 다른 실행 또는 다른 규칙으로 이동하면 현재 정책 테스트는 통과할 수 있습니다.

수정 예시
         assertTrue(
                 foundNonEmptyGuard,
                 "Coverage must fail closed when the selected production bundle contains zero classes"
         );
+        for (String counter : Set.of("INSTRUCTION", "LINE", "METHOD", "BRANCH")) {
+            assertTrue(
+                    directChildren(limits, "limit").stream().anyMatch(limit ->
+                            counter.equals(directChildText(limit, "counter"))
+                                    && "MISSEDCOUNT".equals(directChildText(limit, "value"))
+                                    && "0".equals(directChildText(limit, "maximum"))
+                    ),
+                    "Coverage must require zero missed " + counter + " entries in the BUNDLE rule"
+            );
+        }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@etl-service/src/test/java/com/xtrmetl/etl/documentation/JaCoCoCoverageConfigurationTest.java`
around lines 52 - 74, Update
coverageCheckRequiresAtLeastOneAnalyzedProductionClass so it structurally
verifies the zero-missed limits for INSTRUCTION, LINE, METHOD, and BRANCH within
the same BUNDLE rule and its limits collection, alongside the existing CLASS
TOTALCOUNT minimum check. Assert each expected counter has MISSEDCOUNT with a
maximum of 0, ensuring all required limits are attached to this rule.
docs/doctoring/jacoco-nonvacuous-coverage.md (1)

25-34: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

문서에 참조 검증 결과를 추가하십시오. etl-service/pom.xml이 존재하며, 나열된 JaCoCo URL 7개가 모두 접근 가능합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/doctoring/jacoco-nonvacuous-coverage.md` around lines 25 - 34, Update
the documentation section covering etl-service/pom.xml and the JaCoCo references
to add verification results: confirm that etl-service/pom.xml exists and that
all seven listed JaCoCo URLs are accessible.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/doctoring/jacoco-nonvacuous-coverage.md`:
- Around line 25-34: Update the documentation section covering
etl-service/pom.xml and the JaCoCo references to add verification results:
confirm that etl-service/pom.xml exists and that all seven listed JaCoCo URLs
are accessible.

In
`@etl-service/src/test/java/com/xtrmetl/etl/documentation/JaCoCoCoverageConfigurationTest.java`:
- Around line 52-74: Update
coverageCheckRequiresAtLeastOneAnalyzedProductionClass so it structurally
verifies the zero-missed limits for INSTRUCTION, LINE, METHOD, and BRANCH within
the same BUNDLE rule and its limits collection, alongside the existing CLASS
TOTALCOUNT minimum check. Assert each expected counter has MISSEDCOUNT with a
maximum of 0, ensuring all required limits are attached to this rule.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8496c5f7-8197-41da-9819-e7fe3e364992

📥 Commits

Reviewing files that changed from the base of the PR and between 942d164 and e72ba50.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • docs/doctoring/jacoco-nonvacuous-coverage.md
  • etl-service/pom.xml
  • etl-service/src/test/java/com/xtrmetl/etl/documentation/JaCoCoCoverageConfigurationTest.java
  • etl-service/src/test/java/com/xtrmetl/etl/job/EtlJobCoveragePolicyTest.java
  • etl-service/src/test/java/com/xtrmetl/etl/job/EtlJobServiceBoundaryTest.java
  • etl-service/src/test/java/com/xtrmetl/etl/job/EtlJobServiceDefensiveBranchTest.java

@opencode-agent opencode-agent Bot added area: ci-cd CI, GitHub Actions, checks, release, or supply chain priority: medium Normal-priority or P2 work status: draft Draft pull request type: bug Defect or incorrect behavior labels Aug 22, 2026
@seonghobae seonghobae added maintenance type: test Test coverage, fixtures, fuzzing, or validation labels Sep 7, 2026 — with ChatGPT Codex Connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci-cd CI, GitHub Actions, checks, release, or supply chain maintenance priority: medium Normal-priority or P2 work status: draft Draft pull request type: bug Defect or incorrect behavior type: test Test coverage, fixtures, fuzzing, or validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Quality gate] Make JaCoCo fail closed when production class selection is empty

1 participant