Files
awesome-copilot/.github/workflows/review-routing-request.yml
T
0c54bcee82 Phase 1: distributed CODEOWNERS and automated reviewer routing (#4184) (#4189)
* Phase 1: distributed CODEOWNERS and automated reviewer routing (#4184)

- Replace the individual default CODEOWNERS owner with the core-maintainer
  team and add domain team ownership for extensions, plugins, content,
  hooks, workflows, .github, and eng.
- Add .github/review-routing.yml as the single source of truth for reviewer
  pools, routes, labels, and SLA settings (ships in dry-run mode).
- Add eng/review-routing.mjs (+ unit tests) with business-day math,
  least-loaded reviewer selection, routing and escalation planning, and
  workflow_run artifact validation.
- Add Review Routing (workflow_run/dispatch/schedule), Review Routing Request
  (read-only needs-reviewer reader), and Review Escalation (weekday schedule)
  workflows.
- Add needs-reviewer, review-overdue, review-escalated to setup-labels.
- Document the model in docs/maintainers/review-routing.md.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Address review feedback on reviewer routing and escalation

- Escalate at routedOn + escalation business days (Mon -> Fri)
- Leave labels untouched when requestReviewers fails and fail the job
- Serialize read/plan/apply per PR across routing and escalation
- Treat Label PR Intent artifact labels as authoritative
- Re-route to an uncovered pool on head changes without restarting SLA
- Use the due-label timestamp as the review boundary
- Fall back to pool/escalation teams and report what was requested

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Address second-round review feedback on review routing (#4184)

- CODEOWNERS: route /hooks/ and /workflows/ to content reviewers, drop the
  separate /.github/workflows/ rule, and leave per-resource owner lines as on
  main (their removal is deferred to a separate cleanup).
- Routing: ignore pending requests for unavailable reviewers when checking
  coverage; needs-reviewer excludes prior reviewers and changes nothing when no
  new reviewer can be requested.
- Escalation comments show the actual routing date.
- Cap sweep matrices at 256 targets and defer the remainder.
- Docs: best-effort load balancing, matrix cap, and needs-reviewer semantics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Route workflow and hooks labels to the content pool (#4184)

Drop the workflow-security reviewer pool per maintainer feedback: agentic
workflows and hooks are reviewed like other content, and the repository's
own GitHub Actions workflows stay with core maintainers.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Pin routing contract in tests; make CONTRIBUTING routing note dry-run aware

- Assert the exact label-to-pool mapping and priority order, pool set, and default/escalation pools for the shipped config.
- CONTRIBUTING.md: describe automatic routing as active only once dry_run is turned off.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Simplify dry_run validation condition

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Aaron Powell <me@aaron-powell.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-10-01 00:51:10 +00:00

46 lines
1.6 KiB
YAML

name: Review Routing Request
# Reader half of the needs-reviewer routing flow. Runs with a read-only token
# and only records which PR asked for a reviewer; the privileged Review Routing
# workflow validates this artifact and performs the request.
#
# Labels added with GITHUB_TOKEN do not emit `labeled` events, so automation
# should dispatch review-routing.yml directly (or rely on its scheduled sweep).
on:
pull_request:
types: [labeled]
permissions:
contents: read
jobs:
capture:
runs-on: ubuntu-latest
if: github.event.label.name == 'needs-reviewer'
steps:
- name: Record routing request
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0
with:
script: |
const fs = require('fs');
const path = require('path');
const outDir = path.join(process.env.RUNNER_TEMP, 'review-routing-request');
fs.mkdirSync(outDir, { recursive: true });
fs.writeFileSync(path.join(outDir, 'result.json'), `${JSON.stringify({
schema_version: 'review-routing-request/v1',
event: 'pull_request',
pr_number: context.payload.pull_request.number,
head_sha: context.payload.pull_request.head.sha,
run_id: process.env.GITHUB_RUN_ID,
}, null, 2)}\n`);
- name: Upload routing request artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: review-routing-request
path: ${{ runner.temp }}/review-routing-request/result.json
if-no-files-found: error
retention-days: 3