feat(seer): Route reviewer-less Seer PRs via fallback candidate sources - #120202
Open
vaind wants to merge 5 commits into
Open
feat(seer): Route reviewer-less Seer PRs via fallback candidate sources#120202vaind wants to merge 5 commits into
vaind wants to merge 5 commits into
Conversation
Contributor
Sentry Snapshot Testing
|
vaind
force-pushed
the
feat/seer-pr-cap-exhausted-assign
branch
from
July 21, 2026 15:52
446a29d to
aa2640c
Compare
vaind
force-pushed
the
feat/seer-pr-reviewer-candidates
branch
2 times, most recently
from
July 21, 2026 16:02
20819f5 to
7add9a0
Compare
vaind
force-pushed
the
feat/seer-pr-cap-exhausted-assign
branch
2 times, most recently
from
July 21, 2026 18:30
26ce262 to
0d6f6bb
Compare
vaind
force-pushed
the
feat/seer-pr-reviewer-candidates
branch
from
July 22, 2026 18:27
7add9a0 to
c3290b2
Compare
vaind
marked this pull request as ready for review
July 22, 2026 18:27
A run whose triggering user can't be resolved to a GitHub login (Night Shift, unlinked identities) previously never got a review request at all. Candidate collection now falls back to people connected to the change — the issue's suspect-commit author, linked individual code owners of the PR's changed files, then their most frequent recent committers via the provider's per-path commit listing — ranked with provenance and bounded in provider cost. A resolvable triggering user still short-circuits as the sole candidate, so the only new ping-a-third-party behavior is confined to runs that were previously unroutable; that confinement is why this ships without its own feature flag, riding the existing review-request flag.
GitHub ignores character-range, negation, and unescaped-whitespace patterns as documented syntax exceptions (GitLab-style [Section] headers parse to one), so drop those lines like convert_codeowners_syntax does instead of keeping them as inert rules.
vaind
force-pushed
the
feat/seer-pr-reviewer-candidates
branch
from
July 23, 2026 08:08
96ce5db to
f06292d
Compare
build_codeowners_associations validates identities against a single ProjectCodeOwners.project, so in repos shared by several projects a linked owner without team access on the arbitrarily-picked project was dropped. Reviewing happens on GitHub where repo access is what matters, so resolve the identity link with an org-scoped ExternalActor lookup, the same way the triggering-user source does.
| asked (e.g. Night Shift, or an identity we can't map to a GitHub login) | ||
| does selection fan out to people who didn't opt in, in rank order: | ||
|
|
||
| 1. ``suspect_commit_author`` — the author of the issue's suspect commit; they |
Contributor
There was a problem hiding this comment.
I thought this was considered an unreliable source of info?
Contributor
Author
There was a problem hiding this comment.
hmm, I didn't know about this - do you have some more insights/doc reference?
…r source The raw-payload access sat outside the per-path try/except, so a malformed provider response for one path aborted the whole source rather than skipping just that path, unlike the equivalent guard in _changed_files.
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d496359. Configure here.
Schema-only rebuilds (e.g. on team changes) save the row and the pre_save signal bumps date_updated without refreshing raw, so in multi-project repos a stale copy could outrank a freshly synced one. date_synced is the actual fetch timestamp; date_updated remains the tiebreak for manually uploaded copies where it is NULL.
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.

Problem
A run whose triggering user can't be resolved to a GitHub login — Night Shift and other system runs, or an unlinked identity — never gets a review request at all: the candidate list from #120185 comes back empty and the green event is skipped as
no_candidates.What this does
collect_reviewer_candidatesnow falls back to people connected to the change when no triggering user resolves, in rank order:suspect_commit_author— latest suspect-commitGroupOwnerfor the run's issue →Commit.author.get_username_from_external_id(), falling back to the email-matched Sentry user. They wrote the code being fixed.code_owner— the PR's changed files (providerget_pull_request_files) matched against the repo's syncedProjectCodeOwners.rawwith last-rule-wins CODEOWNERS semantics, ranked by files owned. Only individual@loginowners with a linkedExternalActoridentity are kept — teams are skipped on purpose (team-level requests are the diffuse thing this project avoids), and the raw file is matched directly so no stack-root mapping is involved.recent_committer— most frequent recent (90d) committers of the most heavily changed files via the provider's per-path commit listing (get_commits_by_path); Seer checkouts are tarball extracts with no git history, so the provider API is the only source. Logins come from the raw payload, which also lets us droptype: Botaccounts.A resolvable triggering user still short-circuits as the sole candidate with zero provider calls — the common case behaves exactly as in #120185. The only new ping-a-third-party behavior is confined to runs that were previously unroutable, which is why this ships without its own feature flag, riding the existing review-request flag: turning the expansion off again means reverting one additive commit, and the blast radius of a ranking mistake is limited to PRs nobody would have been asked to review at all.
Provider work is bounded (≤20 changed files fetched, ≤5 per-path history calls, one page each); a failing source is skipped (metric-counted) rather than emptying the list; duplicates keep their highest-ranked provenance.
Everything downstream is unchanged from #120185: lazy decision-time computation, the persisted candidates marker with provenance (fallbacks for re-request, and the data to measure which source's reviewers actually respond before tuning the ranking), the preexisting-reviewer check, the bounded request retry, and the
source-tagged metrics — the fallback sources just appear as newsourcetag values.This is the chunk that makes night-shift PRs routable at all.