Skip to content

feat(github): gate review reminders on implementation lines added - #545

Closed
vinnyjth wants to merge 4 commits into
mainfrom
feat/implementation-lines
Closed

vinnyjth wants to merge 4 commits into
mainfrom
feat/implementation-lines

Conversation

@vinnyjth

Copy link
Copy Markdown
Member

Why

The stale-review reminder in the Slack digest only lists PRs under 200 lines added, and it measures that with GitHub's raw additions. That total counts test files, snapshots, docs and lockfiles, so a PR like apollos-cluster#4678 with 118 lines of implementation and 191 lines of tests never gets a reminder, while Linear's review page shows the implementation-only number for the same PR.

Across the eight repos bug-board tracks, 389 of 2,064 recent PRs (open, or merged in the last 30 days) fail the raw gate but pass an implementation-only gate. None move the other way.

Solution

  • implementation_lines.py (new): is_implementation_path classifies a path by directory name and filename pattern, and count_implementation_additions sums per-file additions across implementation files. When GitHub truncates the file list (more than 100 files) or returns none, it falls back to the PR's total additions, so a PR is never under-counted.
  • github.py: the existing PR query also requests files(first: 100) { path additions }. No extra request per PR, and the page cost stays at 1 rate-limit point per 20 PRs. get_prs_waiting_for_review_by_reviewer gates on REVIEW_REMINDER_MAX_IMPLEMENTATION_ADDITIONS (200) and stamps each qualifying PR with implementation_additions.
  • jobs.py: the digest header names the rule and what it excludes, and each PR line shows its implementation line count.

Excluded from the count: test, fixture and mock directories and filename patterns (__tests__, *.test.*, *.tests.*, *.spec.*, test_*.py, *_test.go), snapshots, docs (*.md, *.mdx, *.rst, docs/), agent guidance (.cursor/, .claude/), lockfiles, generated code, Storybook stories, localization files, and binary assets.

Not in this PR: per-repo overrides through .gitattributes review categories (the convention Linear's review UI reads). The default classifier handles every path pattern seen in the current data, so overrides can follow when a repo needs one. Dashboard pages do not show PR sizes, so the Slack digest is the only reporting surface that changes.

To Test

  • python -m unittest discover -s tests -p 'test_*.py': 219 tests pass. ruff check, ruff format --check and mypy are clean.
  • Mutation checks, each failing exactly one new test: gate the reminder on raw additions instead of the implementation count; drop the tests directory rule; drop the count from the digest line.
  • Live dry run of jobs.post_stale() against live GitHub with Slack delivery intercepted and Linear stale issues stubbed to empty, once on main and once on this branch. Before: 21 PRs across 7 reviewers. After: 34 PR lines for the same 7 reviewers, with 9 PRs newly surfaced. Retrieval took 30s to 37s on the branch across three runs and 40s on main, so the extra field did not slow the job.

Proof

Real digest text from both runs, rendered locally in Slack style. Highlighted lines are the PRs the raw count hid.

Slack digest before and after

Which PRs qualify under each rule, per repo, for every non-draft PR open or merged since 2026-08-18.

Impact by repository

What the classifier removes, by category.

Excluded categories

The PRs the reminder starts surfacing. 36 of the 389 are Dependabot bumps whose bulk is a package-lock.json; the table shows the human-authored ones.

Newly qualifying PRs

Open decision

Dependabot lockfile bumps now count as tiny PRs, so they get a reminder when a review request has waited more than 24 hours. If that is unwanted noise, skipping bot authors in the reminder is a one-line follow-up.

Posted by Claude Code on behalf of @vinnyjth

🤖 Generated with Claude Code

vinnyjth and others added 4 commits September 17, 2026 13:47
Count only additions to implementation files when deciding which open PRs
qualify for the stale review reminder. Tests, snapshots, fixtures, docs,
lockfiles, generated code, localization files and assets no longer count
toward the 200-line limit. The Slack digest names the new rule and shows
each PR's implementation line count.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ng docstrings

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 17, 2026 18:00

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@redreceipt
redreceipt temporarily deployed to bug-board-feat-implemen-vzt3nc September 17, 2026 18:01 Inactive
@redreceipt

Copy link
Copy Markdown
Member

@vinnyjth all this does is add more PRs to the list of PRs that are not getting reviewed, how does that help? Seems like it just piles on

@redreceipt redreceipt closed this Sep 21, 2026
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.

3 participants