feat(signals): advisory reviewer routing via CODEOWNERS (#540) - #829
Closed
JSONbored wants to merge 1 commit into
Closed
feat(signals): advisory reviewer routing via CODEOWNERS (#540)#829JSONbored wants to merge 1 commit into
JSONbored wants to merge 1 commit into
Conversation
Suggest reviewers from a repo's CODEOWNERS for a PR's changed files, ranked by ownership and de-weighted by each owner's current load — advisory only, surfaced in the maintainer-private PR panel. - src/github/codeowners.ts: pure parseCodeowners + matchCodeowners (GitHub last-match-wins; a pattern with any slash is root-anchored, a slash-free pattern matches anywhere; dir/ owns files under it; ** crosses segments) + loadRepoCodeowners (raw.githubusercontent.com HEAD fetch of .github/CODEOWNERS|CODEOWNERS|docs/CODEOWNERS, best-effort, [] on any failure). - src/signals/reviewer-routing.ts: pure buildReviewerRouting ranks individual owners by matched-file count then load band (busy = >= 3 authored open PRs, the only available proxy — PRs carry no requested-reviewer data), excludes the PR author, collects teams separately, caps at 5. Public-safe: login + file count + band only. - reviewerRoutingMode setting (off|advisory, default off) wired like mergeReadinessGateMode + .gittensory.yml settings-block parity; migration 0042. Gate path reuses the shared changed-file load. - Panel section 'Suggested reviewers (advisory)' via sanitizePanelText. auto_request (actually assigning reviewers on GitHub) is intentionally deferred to a follow-up — it is outward-facing and warrants its own review. The TEXT column means it needs no migration to add later.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 1cd6e9a | Commit Preview URL Branch Preview URL |
Jun 17 2026, 11:58 AM |
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
5 tasks
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #829 +/- ##
==========================================
- Coverage 96.56% 96.32% -0.24%
==========================================
Files 98 100 +2
Lines 14175 14292 +117
Branches 5169 5217 +48
==========================================
+ Hits 13688 13767 +79
- Misses 105 128 +23
- Partials 382 397 +15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Part of #540 (advisory core;
auto_requestdeferred — see follow-up).What
Suggest reviewers from a repo's CODEOWNERS for a PR's changed files, ranked by ownership and de-weighted by each owner's current load — advisory only, surfaced in the maintainer-private PR panel. Opt-in via
reviewerRoutingMode(off|advisory, default off).How
src/github/codeowners.ts— pureparseCodeowners+matchCodeownersimplementing GitHub's CODEOWNERS semantics: last-match-wins; a pattern with any slash (leading/internal/trailing) is root-anchored, a slash-free pattern matches anywhere;dir/owns files under the dir (not a file nameddir);*stays within a segment,**crosses segments.loadRepoCodeownersfetches.github/CODEOWNERS→CODEOWNERS→docs/CODEOWNERSviaraw.githubusercontent.com/.../HEAD/...(mirrors the focus-manifest fetch), best-effort,[]on any failure.src/signals/reviewer-routing.ts— purebuildReviewerRoutingranks individual owners by matched-file count, then load band (busy = ≥ 3 authored open PRs — the only available proxy, since PR records carry no requested-reviewer data), then login. Excludes the PR author, collects@org/teamhandles separately, caps at 5. Public-safe: output is login + file count + band + reason only — no trust/score/reward fields (asserted in tests).reviewerRoutingModewired likemergeReadinessGateMode(types/schema/migration 0042/repositories/openapi/settings-preview) +.gittensory.ymlsettings:block parity. The gate path reuses the shared changed-file load (no double fetch); routing is advisory and never feeds the gate.sanitizePanelText.Deferred (follow-up)
auto_request— actually assigning reviewers on GitHub — is outward-facing and intentionally split out for its own focused review (with the strict opt-in + first-time-external-contributor guard the issue calls for). The column is TEXT, so adding the value + action later needs no migration.Tests
codeowners.test.ts(parser + matcher: comments, multiple owners, last-match-wins, leading-slash anchor,dir/,*/**, bare-name-anywhere, no-match).reviewer-routing.test.ts(rank by match count; busy ranks below light at equal match; author-exclusion; teams separate; empty cases; public-safe assertion).Verification
migration guard (0001..0042, no dup) · typecheck clean · full suite 2017 passed, 1 skipped (only the pre-existing pngjs visual-agent skip) · openapi regenerated + drift-clean · UI lint clean.
Relates #525/#528 (Phase 1).