Skip to content

Commit 0539434

Browse files
authored
ci: use MAINTAINERS as reviewer assignment fallback (#2875)
1 parent ddbe308 commit 0539434

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/assign-reviews.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,27 @@ jobs:
122122

123123
For each PR that truly has NO reviewers:
124124
1) Read git blame for changed files to identify recent, active contributors.
125-
2) From those candidates, ONLY consider maintainers repository collaborators with write access or higher. Verify via the GitHub API before
126-
requesting review:
125+
2) From those blame-derived candidates, ONLY consider maintainers who are repository collaborators with write access or higher. Verify that
126+
with the GitHub API before requesting review:
127127
- Preferred: GET /repos/{owner}/{repo}/collaborators (no permission filter). Filter client-side using either:
128128
role_name in ["write", "maintain", "admin"] OR permissions.push || permissions.admin. Note: paginate if > 30 collaborators.
129129
- Alternative: GET /repos/{owner}/{repo}/collaborators/{username}/permission and accept if permission in {push, maintain, admin}.
130-
3) If multiple maintainers qualify, avoid assigning too many reviews to any single one.
131-
4) Request review from exactly one maintainer and add this message:
130+
3) If one or more blame-derived maintainers qualify, request review from exactly one of them. Prefer the maintainer with the lowest current
131+
review load. Add this message:
132132

133133
[Automatic Post]: I have assigned {reviewer} as a reviewer based on git blame information.
134134
Thanks in advance for the help!
135135

136+
4) If no blame-derived maintainer qualifies, read the MAINTAINERS file in the repository root. Parse usernames from lines starting with
137+
"- @username" and treat that file as the canonical list of active maintainers.
138+
5) From that MAINTAINERS list, keep only users who still have write access or higher via the GitHub API, exclude the PR author, and request
139+
review from exactly one of them, again preferring the maintainer with the lowest current review load. Add this message:
140+
141+
[Automatic Post]: I have assigned {reviewer} as a reviewer based on the repository MAINTAINERS file.
142+
Thanks in advance for the help!
143+
144+
6) If neither path yields a qualified maintainer, do not request review from anyone and do not fall back to a broader collaborator pool.
145+
136146
LLM_MODEL: litellm_proxy/claude-sonnet-4-5-20250929
137147
LLM_BASE_URL: https://llm-proxy.app.all-hands.dev
138148
steps:

0 commit comments

Comments
 (0)