Add fallback AI provider support to code review workflow#1
Conversation
If the primary provider (Claude or OpenAI) fails due to an API error, quota limit, or outage, the workflow automatically retries with the other provider and labels the review comment accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GitHub org repos restrict the default GITHUB_TOKEN. Explicitly granting pull-requests:write lets the workflow post review comments on PRs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🤖 AI Code Review — GPT-4o-mini (OpenAI)
|
Claude API key is present but not used as primary until verified. Fallback still attempts Claude if OpenAI fails. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🤖 AI Code Review — GPT-4o-mini (OpenAI)Code Review FeedbackGeneral ObservationsThe changes made to the workflow for handling API calls to Claude and OpenAI look well-structured and follow a retry mechanism. However, there are several areas that need attention regarding error handling, input validation, and adherence to global rules. Specific Feedback
SummaryThe changes overall improve the workflow's resilience by implementing a fallback mechanism. However, attention to error handling, input validation, and code duplication is needed to align with global rules and best practices. Addressing these issues will enhance the robustness and maintainability of the code. |
- ai-review-reusable.yml: Central workflow other repos call - templates/ai-review-starter.yml: 10-line file teams copy - templates/review-guidelines.md: Sample rules to customize - SETUP.md: Step-by-step guide for teams - Updated ai-review.yml to use reusable workflow (dogfooding) Teams can now add AI code review to their repo by: 1. Copy the starter template to .github/workflows/ai-review.yml 2. Add OPENAI_API_KEY secret 3. Open a PR Co-Authored-By: Claude <noreply@anthropic.com>
If the primary provider (Claude or OpenAI) fails due to an API error, quota limit, or outage, the workflow automatically retries with the other provider and labels the review comment accordingly.
Business Context
What problem does this PR solve?
Key Changes
Edge Cases
Testing Done