fair warning: most of this repository, including this README, is AI generated. It works great, though!
This script analyzes pull requests in the Vercel AI repository to identify breaking changes using AI-powered analysis.
- Fetches all pull requests after PR #6283 that target the
v5branch - Downloads and analyzes the diff for each pull request
- Uses the
aiSDK and Anthropic to determine if breaking changes occurred - Generates detailed markdown reports with:
- Breaking change descriptions
- Before/after code examples
- Migration guides
- Impact analysis
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile in the project root with the following variables:# GitHub Personal Access Token # Create at: https://github.com/settings/tokens # Permissions needed: public_repo (to read public repositories) GITHUB_TOKEN=ghp_your_github_token_here # ANTHROPIC_API_KEY API Key # Get from: https://console.anthropic.com/ ANTHROPIC_API_KEY=sk-your_anthropic_api_key_here
Run the analysis script:
node find-breaking-changes.jsThe script will:
- Fetch all qualifying pull requests from the Vercel AI repository
- Analyze each PR's diff for breaking changes
- Generate markdown files in the
./breaking-changes/directory
Generated files follow the naming convention:
<pr-number>-<changeset-filename>-YYYY-MM-DD.md
Each file contains:
- Pull request metadata (title, author, link)
- Summary of changes
- Detailed breaking change analysis
- Before/after code examples
- Migration instructions
- References to original changeset files
You can modify the following constants in find-breaking-changes.js:
BASE_PR_NUMBER: Starting PR number (default: 6283)TARGET_BRANCH: Target branch to analyze (default: 'v5')REPO_OWNER: Repository owner (default: 'vercel')REPO_NAME: Repository name (default: 'ai')
The script includes a 1-second delay between API calls to respect GitHub's rate limits. For large numbers of PRs, the analysis may take some time to complete.
The script includes robust error handling:
- Continues processing other PRs if one fails
- Logs detailed error messages
- Provides summary statistics at completion
- Node.js 16+ (for ES modules support)
- GitHub Personal Access Token with public repository access
- Anthropic API key with sufficient credits