[PR #267] [MERGED] feat(assign-reviewers): route by expertise with shared history caching #270

Closed
opened 2026-10-26 22:37:56 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/github-workflows/pull/267
Author: @mattmillerai
Created: 9/8/2026
Status: ✅ Merged
Merged: 9/8/2026
Merged by: @mattmillerai

Base: main ← Head: matt/intelligent-pr-assignment


📝 Commits (2)

  • 4681eef fix(assign-reviewers): route owners by relevant review experience
  • d1a219a feat(assign-reviewers): reuse scheduled review history snapshots

📊 Changes

6 files changed (+759 additions, -109 deletions)

View changed files

➕ .github/assign-reviewers/README.md (+17 -0)
➕ .github/assign-reviewers/tests/assignment.test.cjs (+275 -0)
📝 .github/workflows/assign-reviewers.yml (+318 -79)
➕ .github/workflows/test-assign-reviewers.yml (+27 -0)
📝 README.md (+1 -1)
📝 docs/callers/assign-reviewers.md (+121 -29)

📄 Description

ELI5

Assign PRs to people who know the changed code. The workflow now uses previous human approvals alongside the ownership map, adds another person only when they cover different code, and can reuse a shared review-history snapshot instead of downloading that history for every PR.

Motivation

The existing selector collapses every matching path rule into one pool and then ranks people by open assignment count. For code outside the map, it uses a general fallback pool without looking for relevant review experience. A small change in one area can therefore influence who owns a much larger change elsewhere, while a two-person request can notify two people with the same coverage. Recent human approvals provide a direct, auditable source of routing evidence for unmapped files.

Provenance

  • Authored by: interactive session
  • Verified: node --test .github/assign-reviewers/tests/*.test.cjs: 64 passed; python3 -m unittest discover -s .github/refresh-reviewers/tests -p 'test_*.py': 48 passed; actionlint .github/workflows/assign-reviewers.yml .github/workflows/test-assign-reviewers.yml: passed; python3 .github/workflow-pins/check_workflow_pins.py: passed; python3 .github/agents-md-integrity/check_agents_md.py --root .: passed with existing advisory warnings about length and ownership; git diff --check: passed.

Summary

  • Keep the author allowlist, exclusions, configured ownership rules and assignee-based routing.
  • Read routing configuration from the PR base SHA. Discover additional expertise through final human approvals on up to 50 recently updated merged PRs from the last 90 days on the same base branch. Exact-file evidence needs one approval; directory inference needs two separate PRs.
  • Select additional file coverage first. Use approval strength and repository-local workload to break relevance ties, with optional cap steering. Unknown load stays unknown.
  • Interpret num_reviewers as a maximum. Remove random growth-pool substitution; use one explicitly described fallback owner when no path evidence exists.
  • Serialize runs, respect live manual assignments and review requests, skip stale or incomplete diffs, verify assignability, and report the confirmed API result.
  • Log selection evidence in an Actions summary and add regression tests that execute the shipped inline script.
  • Add generate_history mode using the same collector: a scheduled/manual default-branch job publishes a neutral JSON manifest as a two-day Actions artifact. history_workflow opts PR routing into snapshots no older than 12 hours. Missing, stale, invalid, or inaccessible artifacts use live history.
  • Validate the producing workflow, event, repository, branch, run ID, schema and timestamps. Parse one bounded JSON ZIP member in memory. Current routing policy and workload remain live; refresh failures never publish partial snapshots.

Rollout and limits

Existing live-only callers need only the usual reviewed SHA bump; the workflow remains self-contained. Cached routing adds a scheduled/manual job calling the same reusable with generate_history: true and sets history_workflow on the PR job. The caller guide includes complete six-hour schedule wiring and initial manual seeding instructions. The App needs Actions read permission for artifact access. Author allowlist scoping remains in place. Review history is a bounded sample and directory proximity is a heuristic; explicit path rules remain the maintained ownership authority. History failures discard partial evidence and use the configured map. No caller rollout or live assignment was performed as part of local validation.

Test plan

  • Confirm the assignment/cache test job passes in CI.
  • Adopt the reviewed SHA and schedule in an opted-in caller, run the initial refresh on its default branch, and verify the artifact and cache-hit log on a qualifying PR.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/github-workflows/pull/267 **Author:** [@mattmillerai](https://github.com/mattmillerai) **Created:** 9/8/2026 **Status:** ✅ Merged **Merged:** 9/8/2026 **Merged by:** [@mattmillerai](https://github.com/mattmillerai) **Base:** `main` ← **Head:** `matt/intelligent-pr-assignment` --- ### 📝 Commits (2) - [`4681eef`](https://github.com/Comfy-Org/github-workflows/commit/4681eef5ee71c598cf81d644cc0ae7e1d1d9f7fa) fix(assign-reviewers): route owners by relevant review experience - [`d1a219a`](https://github.com/Comfy-Org/github-workflows/commit/d1a219a38590919746650f36bf9741d9e9ac6b05) feat(assign-reviewers): reuse scheduled review history snapshots ### 📊 Changes **6 files changed** (+759 additions, -109 deletions) <details> <summary>View changed files</summary> ➕ `.github/assign-reviewers/README.md` (+17 -0) ➕ `.github/assign-reviewers/tests/assignment.test.cjs` (+275 -0) 📝 `.github/workflows/assign-reviewers.yml` (+318 -79) ➕ `.github/workflows/test-assign-reviewers.yml` (+27 -0) 📝 `README.md` (+1 -1) 📝 `docs/callers/assign-reviewers.md` (+121 -29) </details> ### 📄 Description ## ELI5 Assign PRs to people who know the changed code. The workflow now uses previous human approvals alongside the ownership map, adds another person only when they cover different code, and can reuse a shared review-history snapshot instead of downloading that history for every PR. ## Motivation The existing selector collapses every matching path rule into one pool and then ranks people by open assignment count. For code outside the map, it uses a general fallback pool without looking for relevant review experience. A small change in one area can therefore influence who owns a much larger change elsewhere, while a two-person request can notify two people with the same coverage. Recent human approvals provide a direct, auditable source of routing evidence for unmapped files. ## Provenance - **Authored by:** interactive session - **Verified:** `node --test .github/assign-reviewers/tests/*.test.cjs`: 64 passed; `python3 -m unittest discover -s .github/refresh-reviewers/tests -p 'test_*.py'`: 48 passed; `actionlint .github/workflows/assign-reviewers.yml .github/workflows/test-assign-reviewers.yml`: passed; `python3 .github/workflow-pins/check_workflow_pins.py`: passed; `python3 .github/agents-md-integrity/check_agents_md.py --root .`: passed with existing advisory warnings about length and ownership; `git diff --check`: passed. ## Summary - Keep the author allowlist, exclusions, configured ownership rules and assignee-based routing. - Read routing configuration from the PR base SHA. Discover additional expertise through final human approvals on up to 50 recently updated merged PRs from the last 90 days on the same base branch. Exact-file evidence needs one approval; directory inference needs two separate PRs. - Select additional file coverage first. Use approval strength and repository-local workload to break relevance ties, with optional cap steering. Unknown load stays unknown. - Interpret `num_reviewers` as a maximum. Remove random growth-pool substitution; use one explicitly described fallback owner when no path evidence exists. - Serialize runs, respect live manual assignments and review requests, skip stale or incomplete diffs, verify assignability, and report the confirmed API result. - Log selection evidence in an Actions summary and add regression tests that execute the shipped inline script. - Add `generate_history` mode using the same collector: a scheduled/manual default-branch job publishes a neutral JSON manifest as a two-day Actions artifact. `history_workflow` opts PR routing into snapshots no older than 12 hours. Missing, stale, invalid, or inaccessible artifacts use live history. - Validate the producing workflow, event, repository, branch, run ID, schema and timestamps. Parse one bounded JSON ZIP member in memory. Current routing policy and workload remain live; refresh failures never publish partial snapshots. ## Rollout and limits Existing live-only callers need only the usual reviewed SHA bump; the workflow remains self-contained. Cached routing adds a scheduled/manual job calling the same reusable with `generate_history: true` and sets `history_workflow` on the PR job. The caller guide includes complete six-hour schedule wiring and initial manual seeding instructions. The App needs Actions read permission for artifact access. Author allowlist scoping remains in place. Review history is a bounded sample and directory proximity is a heuristic; explicit path rules remain the maintained ownership authority. History failures discard partial evidence and use the configured map. No caller rollout or live assignment was performed as part of local validation. ## Test plan - [ ] Confirm the assignment/cache test job passes in CI. - [ ] Adopt the reviewed SHA and schedule in an opted-in caller, run the initial refresh on its default branch, and verify the artifact and cache-hit log on a qualifying PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:37:56 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/github-workflows#270
No description provided.