Skip to content

fix(quality): restore 100% python branch coverage on protected main - #223

Merged
seonghobae merged 1 commit into
mainfrom
fix/main-python-coverage
Aug 25, 2026
Merged

fix(quality): restore 100% python branch coverage on protected main#223
seonghobae merged 1 commit into
mainfrom
fix/main-python-coverage

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The chore(delivery): consolidate 31 queued green slices into one landing vehicle (#175) #215 consolidation merge landed scripts/check_coverage.py with two definitions of load_union_branch_totals; the shadowed first copy (lines 43–76) was unreachable, dropping the repository Python branch-coverage gate to 91% and failing the Repository contracts and Python branch coverage required check for every subsequent PR.
  • Removes the duplicate definition, keeping the test-exercised one.
  • Adds targeted tests for the remaining uncovered arcs:
    • happy-path load_union_branch_totals count merging across duplicate instrumented copies (loop-back + aggregation body);
    • blank-only history exhausting the structural-comma reverse scan;
    • escaped-backslash char literal inside the multiline-string scanner.

Verification

  • python3 -m coverage run --branch -m unittest discover -s tests/quality -p 'test_*.py' → all tests pass
  • python3 -m coverage report --fail-under=100TOTAL 100%
  • python3 -m pytest tests/quality -q → 150 passed

Closes the protected-main coverage regression introduced by #215.


Open in Devin Review

The consolidation merge landed check_coverage.py with load_union_branch_totals
defined twice; the shadowed first definition was unreachable dead code that
dropped the Python gate to 91% and blocked every future PR. Remove the
duplicate, keep the test-exercised definition, and add direct tests for the
remaining arcs: valid cross-binary count merging, blank-history reverse-scan
exhaustion, and escaped-backslash char literals inside the multiline-string
scanner.
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 35 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f7a6a4a-97f5-47dc-b300-5d1025c40818

📥 Commits

Reviewing files that changed from the base of the PR and between 7ce87c3 and bc13ce2.

📒 Files selected for processing (2)
  • scripts/check_coverage.py
  • tests/quality/test_check_coverage.py

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.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread scripts/check_coverage.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 Info: load_union_branch_totals is test-only

The remaining load_union_branch_totals is referenced only by tests. The production gate load_totals (check_coverage.py) uses fold_unique_branch_totals instead, so this function does not affect live gating.

(Refers to this code)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@seonghobae
seonghobae enabled auto-merge August 25, 2026 03:01
@opencode-agent
opencode-agent Bot disabled auto-merge August 25, 2026 03:33
@seonghobae
seonghobae merged commit d7038cb into main Aug 25, 2026
25 of 30 checks passed
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.

1 participant