Skip to content

Prioritize already-reviewed PRs in review candidates#986

Open
elianguitarra wants to merge 1 commit into
ramimbo:mainfrom
elianguitarra:codex/review-candidate-reviewed-priority-936
Open

Prioritize already-reviewed PRs in review candidates#986
elianguitarra wants to merge 1 commit into
ramimbo:mainfrom
elianguitarra:codex/review-candidate-reviewed-priority-936

Conversation

@elianguitarra
Copy link
Copy Markdown

@elianguitarra elianguitarra commented Jun 6, 2026

Summary

  • classify PRs already reviewed by the requested reviewer on the current head before workflow/mergeability buckets
  • prevents the review-bounty candidate scanner from re-suggesting a reviewer’s own current-head review when the PR is still missing the standard quality check
  • adds regression coverage for a current-head reviewer approval with missing standard CI

Bounty

Bounty #936

Validation

  • .venv\Scripts\python.exe -m pytest tests\test_review_bounty_candidates.py -> 12 passed
  • .venv\Scripts\python.exe -m ruff check scripts\review_bounty_candidates.py tests\test_review_bounty_candidates.py -> All checks passed
  • .venv\Scripts\python.exe -m ruff format --check scripts\review_bounty_candidates.py tests\test_review_bounty_candidates.py -> 2 files already formatted
  • git diff --check -> clean
  • Live smoke: scripts\review_bounty_candidates.py --repo ramimbo/mergework --reviewer elianguitarra --format json now classifies PR Share queue duplicate-scope formatting #982 as already_reviewed_current_head_by_reviewer even though its standard quality check is missing

Scope notes

Focused scanner maintainability fix only; no app runtime, ledger, wallet, treasury, payout, admin-token, bridge, exchange, off-ramp, or cash-out behavior changes.

Summary by CodeRabbit

  • Improvements
    • Optimized pull request review state classification to prioritize already-reviewed submissions earlier in the evaluation process, improving candidate prioritization.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 6, 2026

Complex PR? Review this PR in Change Stack to move by importance, not file order.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: aad46c18-071e-4425-b3a0-0526fc0e4d7c

📥 Commits

Reviewing files that changed from the base of the PR and between 8bdd282 and 68fd0c8.

📒 Files selected for processing (2)
  • scripts/review_bounty_candidates.py
  • tests/test_review_bounty_candidates.py

📝 Walkthrough

Walkthrough

The PR reorders the PR classification decision chain in _classify_pr by moving the "already reviewed current head by reviewer" check earlier, immediately after the self-authored check. The duplicate later check is removed. Test fixture and expectations are updated to include a new PR case that exercises this early classification path.

Changes

Classification decision priority reordering

Layer / File(s) Summary
Classification decision chain reordering
scripts/review_bounty_candidates.py
The already_reviewed_current_head_by_reviewer check is added early in the _classify_pr decision chain after the self_authored case, and the duplicate later check is removed, so PRs already reviewed by the current reviewer on the current head are classified earlier, regardless of subsequent conditions.
Test fixture and expectations update
tests/test_review_bounty_candidates.py
A new test PR (number 10) with no standard CI checks but already approved by the reviewer on the current head is added to the fixture, and expected state mapping and JSON output assertions are updated to reflect the new PR and its classification.

Possibly related PRs

  • ramimbo/mergework#743: Introduced the already_reviewed_current_head_by_reviewer classification logic that this PR reorders within the decision chain.
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: prioritizing already-reviewed PRs in the review candidate classification logic.
Description check ✅ Passed The description covers the summary, bounty reference, and comprehensive validation results, but lacks the structured template sections for Evidence and Test Evidence checkboxes.
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.
Mergework Public Artifact Hygiene ✅ Passed PR modifies only review candidate classification logic. No investment, price, cash-out, payout claims, or private security details found in code or tests.
Bounty Pr Focus ✅ Passed Two focused file changes: scripts/review_bounty_candidates.py moves already_reviewed check earlier (+3/-3 lines); tests/test_review_bounty_candidates.py adds test PR #10 case (+12/-1). No scope creep.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@NiXouuuu NiXouuuu left a comment

Choose a reason for hiding this comment

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

Approved current head.

I inspected scripts/review_bounty_candidates.py and tests/test_review_bounty_candidates.py. The change is a focused classification-priority fix: a PR already reviewed by the requested reviewer on the current head is now classified before workflow/quality buckets, so the scanner stops re-suggesting that reviewer?s own current-head review when the standard quality signal is missing.

Validation performed on this exact head:

  • uv run --python 3.12 --extra dev python -m pytest tests/test_review_bounty_candidates.py -q -> 12 passed.
  • uv run --python 3.12 --extra dev ruff check scripts/review_bounty_candidates.py tests/test_review_bounty_candidates.py -> passed.
  • uv run --python 3.12 --extra dev ruff format --check scripts/review_bounty_candidates.py tests/test_review_bounty_candidates.py -> 2 files already formatted.
  • uv run --python 3.12 --extra dev python -m mypy scripts/review_bounty_candidates.py -> success.
  • git diff --check origin/main...HEAD -> clean.
  • git merge-tree --write-tree origin/main HEAD -> clean tree 5417cca61da35b55149c8a90c1a8e78fc1dacb29.

Live smoke evidence from the PR branch:

  • scripts/review_bounty_candidates.py --repo ramimbo/mergework --reviewer NiXouuuu --format json classifies PR #1035 as already_reviewed_current_head_by_reviewer even though standard_quality_check is missing.
  • scripts/review_bounty_candidates.py --repo ramimbo/mergework --reviewer elianguitarra --format json classifies PR #982 as already_reviewed_current_head_by_reviewer with the same missing quality signal.

GitHub state checked before review: open, non-draft, mergeable, CodeRabbit success, and no human reviews. mergeStateStatus is UNSTABLE because the standard quality check is missing, so maintainers should still wait for hosted status if that gate is expected before merge.

Scope boundaries: read-only review of the review-candidate scanner/test change only. No app runtime, ledger, wallet, treasury/proposal execution, payout execution, admin-token APIs, private data, credentials, bridge/exchange/off-ramp/cash-out behavior, or MRWK price/value behavior was used.

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