Skip to content

fix: make rereview team requests resilient#24

Merged
keithah merged 1 commit intomainfrom
fix/rereview-team-fallback
Feb 11, 2026
Merged

fix: make rereview team requests resilient#24
keithah merged 1 commit intomainfrom
fix/rereview-team-fallback

Conversation

@keithah
Copy link
Copy Markdown
Member

@keithah keithah commented Feb 11, 2026

Summary

  • add a shared rereview-team helper that normalizes configured team values and supports owner/slug input
  • retry team reviewer requests with aireview/ai-review alias fallback when GitHub returns 422
  • reuse helper in both review and mention handlers; add unit coverage for fallback and already-requested behavior

Verification

  • bun test
  • bunx tsc --noEmit

Normalize configured rereview team slugs and fall back between aireview/ai-review on 422 errors. Reuse this logic in both review and mention handlers so rereview triggers stay best-effort but resilient.
Copilot AI review requested due to automatic review settings February 11, 2026 06:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the reliability of “UI re-review” team reviewer requests by centralizing the logic into a shared helper that normalizes configured team inputs (including owner/slug) and retries with the aireview/ai-review alias on GitHub 422 responses. The helper is then reused by both the review and mention handlers, with unit tests added to cover the fallback and “already requested” behavior.

Changes:

  • Added a rereview-team helper to normalize configured team values, detect already-requested teams, and retry with alias fallback on 422.
  • Updated both review and mention handlers to use the shared helper instead of duplicating reviewer-request logic.
  • Added/updated tests to cover fallback + already-requested behavior and to accommodate the new API call (listRequestedReviewers) in mention rereview tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/handlers/review.ts Replaces inline UI rereview team request logic with shared helper call.
src/handlers/rereview-team.ts Introduces shared normalization + best-effort request with 422 alias fallback and “already requested” short-circuit.
src/handlers/rereview-team.test.ts Adds focused unit tests for normalization, already-requested skipping, and 422 fallback behavior.
src/handlers/mention.ts Routes rereview/recheck mention flow through the shared helper.
src/handlers/mention.test.ts Updates octokit mock to include listRequestedReviewers for rereview command path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@keithah keithah merged commit 71cc6f0 into main Feb 11, 2026
7 checks passed
@keithah keithah deleted the fix/rereview-team-fallback branch February 11, 2026 06:32
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.

2 participants