Skip to content

feat: auto-assign reviewer based on squad × domain matrix#6

Merged
shuse2 merged 3 commits into
mainfrom
feat/auto-assign-reviewer
Apr 28, 2026
Merged

feat: auto-assign reviewer based on squad × domain matrix#6
shuse2 merged 3 commits into
mainfrom
feat/auto-assign-reviewer

Conversation

@shuse2
Copy link
Copy Markdown
Member

@shuse2 shuse2 commented Apr 28, 2026

Summary

  • Adds reusable workflow that auto-requests a reviewer on PR open across lisk-backend, lisk-web, lisk-infra, lisk-mobile, lisk-contracts
  • Routing config in review-map.yml (squad × domain matrix); single source of truth, edited via PR
  • 3-step cascade: own-squad specialist → squad-wide fallback (infra only) → sibling cascade → soft-fail with PR comment
  • Idempotent (skips re-requests), bot/non-squad authors skipped, deterministic round-robin via PR# % N
  • CI lint (validate-review-map.yml) verifies structure and that every login is a LiskHQ org member

Files

  • review-map.yml — routing data
  • .github/workflows/auto-assign-reviewer.yml — reusable workflow
  • .github/workflows/validate-review-map.yml — map lint CI
  • examples/workflows/auto-assign-reviewer-caller.yml — caller stub for product repos
  • docs/auto-reviewer.md — cascade & operating notes
  • README.md — added row for new workflow

Resolved walkthrough (verified locally)

Author Domain Reviewer Path
sameersubudhi backend ishantiw own-squad (platform)
Nazgolze infra ishantiw / sameersubudhi (PR#%2) squad-wide fallback
Nazgolze web mvuco00 (rotates) sibling → org
matjazv backend vardan10 sibling → money
matjazv contracts ricott1 sibling → global
ikem-legend web mvuco00 / mmarinovic / mislavtomic own-squad rotation
oskarleonard mobile Balanced02 / eniolam1000752 / 5heri own-squad rotation
shuse2 backend vardan10 sibling → money
ricott1 contracts matjazv sibling → org
dependabot[bot] any (skipped) bot author
ghost-user any (skipped) not in any squad

Rollout

  1. Merge this PR (does nothing on its own — no caller stubs yet).
  2. Open a per-repo PR in each of the 5 product repos adding the caller stub from examples/.
  3. Pilot: set enabled_repos: [lisk-backend]. Watch a few PRs.
  4. Expand enabled_repos once stable.

Kill switches

  • All off: enabled: false in review-map.yml
  • One repo off: remove from enabled_repos
  • One author off: add to bot_authors

Test plan

  • Validate workflow runs on a small test PR in lisk-backend after caller stub is added there
  • Confirm idempotency by re-running on the same PR (no duplicate request)
  • Confirm soft-fail comment when an unmapped author opens a PR
  • Validate validate-review-map.yml flags a typo'd login when introduced via PR
  • Verify pull_request_target works on a fork PR (e.g., bmijac on lisk-web — should be skipped via bot_authors)

Out of scope (v1)

  • OOO awareness
  • Path-based routing within a repo (CODEOWNERS handles that)
  • Slack notifications (existing GitHub→Slack integration covers it)

shuse2 added 3 commits April 28, 2026 23:51
…trix

Adds a reusable workflow that auto-requests a reviewer when a PR is
opened in lisk-backend, lisk-web, lisk-infra, lisk-mobile, or
lisk-contracts. The reviewer is resolved via a squad × domain matrix
in review-map.yml using a 3-step cascade:

  1. own-squad domain specialists (round-robin via PR# % N)
  2. squad-wide fallback for designated domains (e.g. infra)
  3. sibling-squad cascade

The workflow is best-effort: any resolution failure soft-fails with a
PR comment, never blocks merges. Idempotency check skips re-requests
on the same reviewer. pull_request_target supports forks since the
workflow only calls the GitHub API.

Adds:
- review-map.yml — single source of truth for routing
- .github/workflows/auto-assign-reviewer.yml — reusable workflow
- .github/workflows/validate-review-map.yml — CI lint that verifies
  structure and that every login is a LiskHQ org member
- examples/workflows/auto-assign-reviewer-caller.yml — caller stub
- docs/auto-reviewer.md — cascade and operating notes
The default GITHUB_TOKEN cannot see private org membership via
/orgs/{org}/members/{user} — that endpoint requires a PAT with
read:org scope. Real LiskHQ members were being flagged as errors.

Switch to /users/{login} which is public. This still catches typos
(the main goal of the lint). Org-membership enforcement isn't
strictly necessary: if a non-collaborator is listed, the auto-assign
workflow soft-fails with a PR comment at reviewer-request time.
When an org engineer opens a mobile PR, route to org's web specialists
instead of cascading to money. Same in reverse for money → web. Web
and mobile are interchangeable review skills within a squad.

Cascade now has a Step 2 that walks domain_equivalence[D] and tries
own-squad specialists for each equivalent domain before falling back
to the sibling cascade. Equivalence is intra-squad only; cross-squad
cascade still uses the actual domain.

Examples (verified):
  ikem-legend (org)   + mobile → org.web specialists (mvuco00 / mislavtomic / mmarinovic)
  oskarleonard (money)+ web    → money.mobile specialists (Balanced02 / eniolam1000752 / 5heri)
  matjazv (org)       + mobile → org.web rotation
  Nazgolze (platform) + web    → still cascades to org (platform has no web or mobile)

Validates that domain_equivalence keys/values are real domains.
@shuse2 shuse2 merged commit 75442e0 into main Apr 28, 2026
1 check 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