Skip to content

feat(tooling): auto-assign reviewers to PRs based on custom ranking#2467

Draft
Carsons-Eels wants to merge 1 commit intoethereum:forks/amsterdamfrom
Carsons-Eels:auto_review_assignment
Draft

feat(tooling): auto-assign reviewers to PRs based on custom ranking#2467
Carsons-Eels wants to merge 1 commit intoethereum:forks/amsterdamfrom
Carsons-Eels:auto_review_assignment

Conversation

@Carsons-Eels
Copy link
Copy Markdown
Contributor

@Carsons-Eels Carsons-Eels commented Mar 10, 2026

🗒️ Description

Add automated reviewer assignment for PRs using a weighted scoring system that considers workload, file familiarity, review recency, PR complexity, and OOO status.

Components:

  • .github/scripts/assign_reviewer.py — shared Python script that scores candidates and selects a reviewer
  • .github/workflows/assign-reviewer.yaml — auto-assigns a reviewer when a non-draft PR is opened or marked ready
  • .github/team.yml — team roster with GitHub usernames and emails
  • .claude/commands/reassign-reviewer.md — Claude Code skill for manual re-assignment after fixes

Selection factors (weighted):

  • Workload (0.25) — fewer open reviews = higher score
  • File familiarity (0.20 most / 0.15 least) — balances expertise with knowledge distribution
  • Review recency (0.20) — rotates in people who haven't reviewed recently
  • PR complexity match (0.10) — matches experience level to PR difficulty
  • OOO/vacation — hard exclude via Google Calendar integration
  • Authorship conflict — hard exclude (initial: all branch authors; re-review: only authors who pushed since last review)

Requires repo secrets: STEEL_OOO_URL and STEEL_OOO_KEY for the OOO calendar endpoint.

🔗 Related Issues or PRs

✅ Checklist

  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • All: Ran fast tox checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    uvx tox -e static
  • Deploy google code script to pull OOO status of team members
  • Include open PRs in the workload calculation
  • Review weights

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@Carsons-Eels Carsons-Eels added C-feat Category: an improvement or new feature E-easy Experience: easy, good for newcomers P-low A-tooling Area: Improvements or changes to auxiliary tooling such as uv, ruff, mypy, ... labels Mar 10, 2026
@Carsons-Eels Carsons-Eels added this to the Post-WELD Refactoring milestone Mar 10, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.24%. Comparing base (26c98b9) to head (35e8bda).

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #2467   +/-   ##
================================================
  Coverage            86.24%   86.24%           
================================================
  Files                  599      599           
  Lines                36984    36984           
  Branches              3795     3795           
================================================
  Hits                 31895    31895           
  Misses                4525     4525           
  Partials               564      564           
Flag Coverage Δ
unittests 86.24% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Contributor

@SamWilsn SamWilsn left a comment

Choose a reason for hiding this comment

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

This is... a lot of tooling complexity. Could we maybe start with something simpler and see how that goes?

Maybe just "request the two members of STEEL1 with the fewest assigned pull requests"? The chance of hitting two OoO people is probably low enough, and we can avoid hardcoding a list of reviewers that way.

Unless we've determined we need all of these criteria, I'd prefer to start minimal and grow as necessary.

Footnotes

  1. gh api /orgs/ethereum/teams/steel/members --jq '.[].login'
    

name: Auto-assign reviewer

on:
pull_request:
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.

I think using pull_request_target would be appropriate for this workflow. That way any pull request will get assigned, not just ones made by people with write permission.

Would have to double check for any security concerns, but I think it's okay to use here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll update this.

@Carsons-Eels
Copy link
Copy Markdown
Contributor Author

This is... a lot of tooling complexity. Could we maybe start with something simpler and see how that goes?

Yeah... I went a little overboard haha. I can simplify it, sure.

Maybe just "request the two members of STEEL1 with the fewest assigned pull requests"? The chance of hitting two OoO people is probably low enough, and we can avoid hardcoding a list of reviewers that way.

That was my more ambitious idea, and would require me setting up some stuff in google to allow the script access anyway, which could turn into a headache to maintain. I'll cut it out for now and reconsider if the remaining factors really add value.

@danceratopz danceratopz force-pushed the auto_review_assignment branch from eba6895 to 9b63de8 Compare March 31, 2026 22:40
@Carsons-Eels Carsons-Eels force-pushed the auto_review_assignment branch from 9b63de8 to 35e8bda Compare April 1, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tooling Area: Improvements or changes to auxiliary tooling such as uv, ruff, mypy, ... C-feat Category: an improvement or new feature E-easy Experience: easy, good for newcomers P-low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants