Skip to content

feat: round-robin within team when no domain specialist is eligible#9

Merged
shuse2 merged 1 commit into
mainfrom
chore/route-bot-prs-to-repo-owner
May 7, 2026
Merged

feat: round-robin within team when no domain specialist is eligible#9
shuse2 merged 1 commit into
mainfrom
chore/route-bot-prs-to-repo-owner

Conversation

@shuse2
Copy link
Copy Markdown
Member

@shuse2 shuse2 commented May 7, 2026

Summary

  • Make Step 3 (squad-wide fallback) unconditional in auto-assign-reviewer.yml. Previously gated by each squad's fallback_to_squad_members_for list; now any author whose own-squad domain specialists are exhausted (or who is the sole specialist) gets routed to a teammate via PR# round-robin before the sibling cascade fires.
  • Sole specialists like matjazv (backend/contracts in org), vardan10 (backend in money), ricott1 (contracts in global), and Nazgolze (infra in platform) now stay in-team for review instead of crossing to a sibling squad.
  • Drop the now-redundant fallback_to_squad_members_for field from review-map.yml and its validator block in validate-review-map.yml.
  • Update docs/auto-reviewer.md cascade description and matrix legend to reflect the new in-team-priority behavior.

Test plan

  • yq -o=json review-map.yml | jq . parses cleanly with the field removed.
  • Trace: matjazv opens backend PR #N → Step 1 yields [matjazv] - matjazv = [] → Step 2 no equivalence → Step 3 picks org.members - matjazv round-robin (mmarinovic, mvuco00, ikem-legend, mislavtomic).
  • Trace: vardan10 opens backend PR #N → Step 3 picks from money.members - vardan10 round-robin (oskarleonard, Balanced02, eniolam1000752, 5heri).
  • Trace: sameersubudhi opens backend PR → Step 1 still picks ishantiw (specialists keep priority over generic team round-robin).
  • Trace: Nazgolze opens infra PR → Step 3 picks from platform.members - Nazgolze (same end-state as the old gated fallback).
  • validate-review-map.yml passes on the updated map (no orphaned fallback_to_squad_members_for references).

Summary by CodeRabbit

  • New Features

    • Bot and external author pull requests now route to designated repository owners.
  • Improvements

    • Enhanced reviewer assignment with earlier deduplication and squad-wide round-robin fallback when specialists aren’t available.
    • Eliminated prior repo-specific fallback behavior (infra-specific case removed).
    • Review requests are best-effort and soft-fail with clearer rejection handling.
  • Documentation

    • Updated reviewer routing docs to reflect bot routing and revised cascade order.
  • Validation

    • Configuration validation now ensures bot owner mappings reference enabled repositories and real accounts.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8191ff08-9875-463a-bda2-9ccff6cd5e45

📥 Commits

Reviewing files that changed from the base of the PR and between 79aae64 and 7b509b7.

📒 Files selected for processing (4)
  • .github/workflows/auto-assign-reviewer.yml
  • .github/workflows/validate-review-map.yml
  • docs/auto-reviewer.md
  • review-map.yml
💤 Files with no reviewable changes (1)
  • .github/workflows/validate-review-map.yml

📝 Walkthrough

Walkthrough

This PR refactors PR reviewer auto-assignment by adding per-repo bot author routing, moving idempotency checks earlier, replacing domain-gated squad fallback with squad-wide round-robin fallback, and updating validation and documentation accordingly.

Changes

Bot-authored PR routing with squad cascade refactor

Layer / File(s) Summary
Configuration Schema
review-map.yml
Introduces bot_pr_owners per-repo mapping for routing bot-authored PRs; clarifies bot_authors behavior; updates comments for sibling fallback logic.
Workflow Bot Routing & Cascade
.github/workflows/auto-assign-reviewer.yml
Implements bot author early-exit with bot_pr_owners lookup, moves idempotency fetch earlier, replaces domain-gated fallback_to_squad_members_for with squad-wide round-robin fallback using all squad members when no specialist selected.
Validation
.github/workflows/validate-review-map.yml
Validates bot_pr_owners repository keys exist in enabled_repos; extends login verification to include bot owner handles.
Documentation
docs/auto-reviewer.md
Documents bot author early-exit cascade bypass, clarified step-by-step human author cascade (own-squad specialist → equivalent → round-robin → sibling), kill switch controls, and explicit bot routing behavior with no fallback or domain logic.

Sequence Diagram(s)

sequenceDiagram
  participant PR as PR Event
  participant WF as auto-assign-reviewer workflow
  participant Config as review-map.yml
  participant GH as GitHub API
  PR->>WF: trigger
  WF->>WF: fetch already-requested reviewers
  WF->>Config: lookup bot_pr_owners[repo] if author in bot_authors
  alt bot owner mapped
    WF->>GH: request mapped owner
    GH-->>WF: accept/reject
  else no mapping
    WF-->>PR: exit silently
  end
  WF->>Config: run squad cascade for human authors (specialist → eq-domain → round-robin → sibling)
  WF->>GH: request selected reviewer
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • LiskHQ/workflows#8: Both PRs implement bot-authored PR routing via per-repo bot_pr_owners mapping, replace bot-author skip with idempotent route-and-request in auto-assign-reviewer.yml, and update validation and documentation.

Poem

🐰 I hop through configs, maps, and flows,
Bot authors routed where the mapping goes,
Round-robin hums when specialists hide,
Validators check keys with pride,
A tiny rabbit guards the review road.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: implementing squad-wide round-robin fallback when no domain specialist is eligible, which is the core feature introduced across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/route-bot-prs-to-repo-owner

Comment @coderabbitai help to get the list of available commands and usage tips.

Make the squad-wide fallback unconditional so a sole-specialist author
(matjazv on backend/contracts, vardan10 on backend, ricott1 on contracts,
Nazgolze on infra) gets a teammate via round-robin instead of cascading to
a sibling squad. In-team review is now the priority; sibling cascade only
fires when the entire team has no other eligible member.

Drop the now-obsolete fallback_to_squad_members_for field and its
validator block.
@shuse2 shuse2 force-pushed the chore/route-bot-prs-to-repo-owner branch from 40d2e6a to 7b509b7 Compare May 7, 2026 13:13
@shuse2 shuse2 merged commit 98d5a19 into main May 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant