Skip to content

Read the Metrics Report's Reviewed Heads From the Gate's One Filter - #4458

Merged
ptr727 merged 1 commit into
developfrom
burndown/metrics-reviewed-heads-set
Nov 25, 2026
Merged

ptr727 merged 1 commit into
developfrom
burndown/metrics-reviewed-heads-set

Conversation

@ptr727

@ptr727 ptr727 commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Summary

scripts/backlog_metrics.py review_pr built each bot's set of reviewed heads with its own copy of the filter pr_review_rounds.reviewed_heads owns: the reviewer's own reviews, refusals excluded, a commit present. The gate returned only a count, so the report could not reach it. This is the one restatement the 2026-11-05 scope update on #3880 left open.

  • pr_review_rounds.reviewed_oids(nodes) now holds that filter and returns the set of commits.
  • reviewed_heads returns that set's size, so the merge gate's round count is unchanged.
  • The metrics report reads the same set through reviewed_oids, with the gate's own reviewer_nodes selecting the reviews.

scripts/pr_review_rounds.py stays under its 700-line ceiling in tests/test_pr_review_size.py (699 lines), which is not raised, and the file is not split.

Tests

  • New case test_reviewed_heads_are_the_gates_one_definition in tests/test_backlog_metrics.py. It holds a counted review, a refusal, and a review naming no commit, and checks the report's rounds against the gate's count. It then replaces the shared reader and checks both readings move together. Run against the old local filter, it fails.
  • tests/test_backlog_metrics.py, tests/test_pr_review.py, tests/test_pr_review_size.py, tests/test_pr_review_policy.py, tests/test_pr_merge.py, and tests/test_cli_usage.py pass locally (893 tests). ruff format --check, ruff check, and mypy over the configured tree are clean.

Issue State

This pull request does not close #3880. The issue's 2026-11-05 comment also names side_asks, now in scripts/pr_review_hold.py, which still repeats the trusted-and-shown comment filter that trusted_comments in scripts/pr_review_rounds.py owns. The later scope update names only the reviewed-heads restatement, so whether that site is still owed is left open on #3880 rather than closed by this change.

🤖 Generated with Claude Code

`backlog_metrics.py` `review_pr` built each bot's set of reviewed heads
with its own copy of the filter `pr_review_rounds.reviewed_heads` owns:
the reviewer's own reviews, refusals excluded, a commit present. The
gate returned only a count, so the report could not reach it.

`pr_review_rounds.reviewed_oids` now holds that filter and returns the
set. `reviewed_heads` returns its size, so the merge gate's round count
is unchanged, and the report reads the same set.

A new case in `tests/test_backlog_metrics.py` holds a counted review, a
refusal, and a review naming no commit, and checks the report's rounds
against the gate's count. It then replaces the shared reader and checks
both readings move together. Run against the old local filter, it fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings November 25, 2026 23:05
@ptr727

ptr727 commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head ec74ad02cf68895b83bc673864826dbed4addde8, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

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

Next included review available in 16 minutes.

Check out review usage here.

View limit details

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

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e9cf79a and ec74ad0.

Files selected for processing: 3

  • scripts/backlog_metrics.py
  • scripts/pr_review_rounds.py
  • tests/test_backlog_metrics.py
  • 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

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

The reviewed changes centralize reviewed-head filtering and add regression coverage for key review cases, with no active correctness issues identified.

No open issues 🎉

What changed in this PR

This PR centralizes reviewed-head filtering in the review gate so backlog metrics and gate round counts use the same definition.

Changes:

  • Adds reviewed_oids() and makes reviewed_heads() return its set size.
  • Updates backlog metrics to consume the shared reviewed-commit set.
  • Adds regression coverage for refusals, commit-less reviews, and shared-reader behavior.
  • Includes a minor docstring wording issue in the new helper.
File Description
tests/​test_backlog_metrics.py Adds regression coverage verifying that backlog metrics and gate counts remain synchronized across review filtering cases.
scripts/​pr_review_rounds.py Defines the shared reviewed-commit filter and delegates gate counting to it.
scripts/​backlog_metrics.py Reads reviewed commit heads through the gate's shared helper.

Review effort: Lite

@codecov

codecov Bot commented Nov 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.62%. Comparing base (b38e084) to head (ec74ad0).
⚠️ Report is 349 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4458      +/-   ##
===========================================
- Coverage    81.60%   79.62%   -1.99%     
===========================================
  Files           26       47      +21     
  Lines         9070    16399    +7329     
===========================================
+ Hits          7402    13058    +5656     
- Misses        1668     3341    +1673     
Flag Coverage Δ
python-3.13 79.62% <100.00%> (-1.99%) ⬇️

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.

@ptr727

ptr727 commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

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

@ptr727
ptr727 merged commit 7e2dc8a into develop Nov 25, 2026
15 checks passed
@ptr727
ptr727 deleted the burndown/metrics-reviewed-heads-set branch November 25, 2026 23:21
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