Skip to content

Count Linked Entries, Not Links, Against the Open-Findings Total in pr_review.py - #2622

Merged
ptr727 merged 2 commits into
developfrom
feature/auto-2569
Oct 9, 2026
Merged

ptr727 merged 2 commits into
developfrom
feature/auto-2569

Conversation

@ptr727

@ptr727 ptr727 commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

Where a round's count-first (N) open findings section supplies the stated total, pr_review.py's digest measured the FINDINGS WITH NO THREAD shortfall as that total minus the distinct thread ids the open sections link. An extra back-reference on one entry therefore cancelled an entry the section lists with no link, and the block did not print.

  • The comparison now subtracts the entries the count-first section lists with a link, read from read_overview's per-section linked-entry count through a new total_section_entries helper, rather than the distinct ids those entries link.
  • It counts that section only, since its count is the total, so an Open (N) section's linked entries no longer cancel a shortfall in it. That section's unlinked entries are still counted through unlinked_open_entries.
  • The block's wording reads "its open section listing N with a link" to match.
  • The module docstring and the scripts/README.md paragraph on read_overview now say entries are counted rather than links.
  • A test feeds both constructed shapes from the issue, the back-reference inline on an entry and on its own indented line under one. Reverting the fix fails the inline shape. The indented shape was already read as no entry's link, and the test keeps it so a reader change cannot let it through.

The local strict review also found that unthreaded_entries still reads every link of an entry, which can overstate the block for a back-reference to an unread thread. That predates this change and is filed as #2621.

Closes on promotion: #2569

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the unthreaded-finding count for open review sections: entries with recognized thread links are counted, even when multiple entries link to the same thread or an earlier review thread.

ptr727 and others added 2 commits October 8, 2026 21:51
…r_review.py

Where a round's count-first open-findings section supplies the stated
total, the FINDINGS WITH NO THREAD shortfall is now measured against the
entries that section lists with a link rather than the distinct thread
ids those entries link, so a back-reference beside an entry's own link
no longer cancels an entry the section lists with no link.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The inline shape is the one counting links let through, while the
indented shape was already read as no entry's link, so the docstring
now says the second subtest guards the reader rather than the fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 9, 2026 05:12
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 893b4173-75c2-41c5-ab6b-06906f09ce87
📥 Commits

Reviewing files that changed from the base of the PR and between 9099131 and f7ff3ce.

📒 Files selected for processing (3)
  • scripts/README.md
  • scripts/pr_review.py
  • tests/test_pr_review.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The digest now measures findings without threads in count-first open-findings sections using the number of linked entries. Documentation and tests reflect this count, including entries with back-references to earlier threads.

Changes

Open Findings Thread Counts

Layer / File(s) Summary
Count linked entries for the findings shortfall
scripts/pr_review.py, scripts/README.md, tests/test_pr_review.py
The digest counts linked entries in TOTAL sections instead of distinct thread IDs. Its message and documentation describe entries with links. Tests cover inline and indented back-references to earlier threads.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to f7ff3

The change addresses the reported shortfall-counting behavior, with tests for both back-reference forms. No material merge risk is identified in the supplied context.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and specifically describes the main change: counting linked entries instead of distinct links against the open-findings total in pr_review.py.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (1 skipped: 1 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codecov

codecov Bot commented Oct 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.33%. Comparing base (9099131) to head (f7ff3ce).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2622      +/-   ##
===========================================
+ Coverage    59.30%   59.33%   +0.02%     
===========================================
  Files           16       16              
  Lines         8274     8280       +6     
===========================================
+ Hits          4907     4913       +6     
  Misses        3367     3367              
Flag Coverage Δ
python-3.13 59.33% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI 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.

🟢 Approval recommended

No blocking issues were identified; only a minor prose-style nit remains.

0 open findings

What changed in this PR

Updates pr_review.py to count linked entries rather than distinct links when calculating open-finding shortfalls.

Changes:

  • Adds entry-based accounting and regression coverage.
  • Updates output wording and documentation.
  • Includes a minor prose-style nit in the new test docstring.
File Description
tests/​test_pr_review.py Covers inline and indented back-reference shapes.
scripts/​README.md Documents entry-based counting.
scripts/​pr_review.py Counts linked entries for shortfall calculation.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ptr727

ptr727 commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

Answering the Copilot round on f7ff3ce, whose headline says "only a minor prose-style nit remains" in the new test docstring while the round counts 0 open findings and opens no thread.

Declined as a style preference, since the round does not say what the nit is and nothing on the head contradicts a repository rule:

  • python3 scripts/prose_lint.py --diff "$(git merge-base refs/remotes/origin/develop HEAD)", with and without --check sentence-length, exits 0 over all three changed files.
  • The docstring's multi-paragraph shape, closing quotes on their own line, matches the 161 other such closings in tests/test_pr_review.py.

The digest passing a clean-verdict round whose headline names a finding is already tracked as #2567.

@ptr727

ptr727 commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
✅ 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.

@ptr727
ptr727 merged commit 52e85b3 into develop Oct 9, 2026
14 checks passed
@ptr727
ptr727 deleted the feature/auto-2569 branch October 9, 2026 05:28
ptr727 added a commit that referenced this pull request Oct 9, 2026
…gs Total in pr_review.py (#2623)

## Summary

Promotes develop to main, carrying one change:

- #2622 counts the entries a count-first open-findings section lists
with a link, rather than the thread ids those entries link, when
`pr_review.py` measures the `FINDINGS WITH NO THREAD` shortfall, so a
back-reference on one entry no longer cancels an unlinked entry.

Fixes #2569

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

2 participants