Skip to content

fix: fallback to app reviewer for rereview triggers#27

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

fix: fallback to app reviewer for rereview triggers#27
keithah merged 1 commit intomainfrom
fix/rereview-fallback-reviewer

Conversation

@keithah
Copy link
Copy Markdown
Member

@keithah keithah commented Feb 11, 2026

Summary

  • keep team-based rereview requests as primary (aireview + alias fallback)
  • when team requests fail, request the app reviewer as a fallback to keep @kodiai recheck effective
  • add unit coverage for fallback reviewer request behavior

Verification

  • bun test
  • bunx tsc --noEmit

If team reviewer requests fail (including aireview/ai-review alias retries), request the app user as fallback so @kodiai recheck still retriggers review without thread noise.
Copilot AI review requested due to automatic review settings February 11, 2026 16:07
@keithah keithah merged commit ddbfba3 into main Feb 11, 2026
5 checks passed
@keithah keithah deleted the fix/rereview-fallback-reviewer branch February 11, 2026 16:08
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-only” re-review triggers by falling back to requesting the GitHub App reviewer when the configured re-review team (and its alias) cannot be requested, ensuring @kodiai recheck can still generate an effective review_requested event.

Changes:

  • Pass an app-slug-based fallbackReviewer into the best-effort re-review request helper from both review and mention handlers.
  • Extend requestRereviewTeamBestEffort to request a fallback individual reviewer after team request attempts fail.
  • Add unit coverage for the fallback reviewer request behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/handlers/review.ts Supplies fallbackReviewer when auto-requesting the UI re-review team on PR open/ready events.
src/handlers/mention.ts Supplies fallbackReviewer for @kodiai review / @kodiai recheck rereview triggers.
src/handlers/rereview-team.ts Adds fallback reviewer request logic after team request failures.
src/handlers/rereview-team.test.ts Adds a unit test verifying fallback reviewer is requested when team requests fail.
Comments suppressed due to low confidence (3)

src/handlers/mention.ts:29

  • Unused import containsMention.
import {
  type MentionEvent,
  normalizeIssueComment,
  normalizeReviewComment,
  normalizeReviewBody,
  containsMention,
  stripMention,
} from "./mention-types.ts";

src/handlers/review.ts:524

  • Unused variable appSlug.
            const appSlug = githubApp.getAppSlug();

src/handlers/mention.ts:138

  • Unused variable possibleHandles.
    const possibleHandles = [appSlug, "claude"];

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

Comment on lines +105 to +114
const reviewer = (fallbackReviewer ?? "").trim();
if (reviewer.length > 0) {
try {
await octokit.rest.pulls.requestReviewers({
owner,
repo,
pull_number: prNumber,
reviewers: [reviewer],
team_reviewers: [],
});
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The fallback reviewer request doesn’t check whether that reviewer is already in listRequestedReviewers (users). If the team request fails and the fallback reviewer is already requested, GitHub typically returns 422 and no new review_requested event is emitted, which can make repeated recheck attempts ineffective and adds noisy warn logs. Consider extending the initial listRequestedReviewers check to also detect an already-requested fallbackReviewer (normalize/trim like elsewhere) and return alreadyRequested: true (or skip the fallback call) in that case.

Copilot uses AI. Check for mistakes.
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