eng/breakingChanges/README.md
This script automates the creation of high-quality breaking change documentation for .NET runtime PRs using AI-powered analysis.
Install Prerequisites:
gh auth logingh extension install github/gh-models$env:OPENAI_API_KEY = "your-key"Configure:
# Edit config.ps1 to set:
# - LlmProvider = "github-models" (or other provider)
Run the workflow:
.\breaking-change-doc.ps1 -Help
Choose your workflow:
# Default: Analysis only (generates drafts without making GitHub changes)
.\breaking-change-doc.ps1 -PrNumber 123456
# Add comments with create issue links
.\breaking-change-doc.ps1 -PrNumber 123456 -Comment
# Create issues directly
.\breaking-change-doc.ps1 -PrNumber 123456 -CreateIssues
# Just collect data
.\breaking-change-doc.ps1 -PrNumber 123456 -CollectOnly
# Help (shows all parameters and examples)
.\breaking-change-doc.ps1 -Help
# Default workflow (analysis only - generates drafts)
.\breaking-change-doc.ps1 -PrNumber 123456
# Add comments with issue creation links
.\breaking-change-doc.ps1 -PrNumber 123456 -Comment
# Create issues directly
.\breaking-change-doc.ps1 -PrNumber 123456 -CreateIssues
# Data collection only
.\breaking-change-doc.ps1 -PrNumber 123456 -CollectOnly
# Query multiple PRs
.\breaking-change-doc.ps1 -Query "repo:dotnet/runtime state:closed label:needs-breaking-change-doc-created is:merged"
# Clean previous data
.\breaking-change-doc.ps1 -Clean
# Clean and process
.\breaking-change-doc.ps1 -Clean -PrNumber 123456
Edit config.ps1 to customize:
GitHub Models (recommended - no API key needed):
gh extension install github/gh-models
# Set provider in config.ps1: LlmProvider = "github-models"
OpenAI:
$env:OPENAI_API_KEY = "your-key"
# Set provider in config.ps1: LlmProvider = "openai"
Anthropic Claude:
$env:ANTHROPIC_API_KEY = "your-key"
# Set provider in config.ps1: LlmProvider = "anthropic"
Azure OpenAI:
$env:AZURE_OPENAI_API_KEY = "your-key"
# Configure endpoint in config.ps1: LlmProvider = "azure-openai"
(repoRoot)\artifacts\docs\breakingChanges\data\summary_report.md, (repoRoot)\artifacts\docs\breakingChanges\data\pr_*.json(repoRoot)\artifacts\docs\breakingChanges\issue-drafts\*.md(repoRoot)\artifacts\docs\breakingChanges\comment-drafts\*.mdThe script automatically determines accurate .NET version information using the local git repository:
git describe commands on the repositoryAI generates 90%+ ready documentation, but review for:
Between runs:
.\breaking-change-doc.ps1 -Clean
| Parameter | Description | Example |
|---|---|---|
-Help | Show help and parameter information | .\breaking-change-doc.ps1 -Help |
-PrNumber | Process a specific PR number | .\breaking-change-doc.ps1 -PrNumber 123456 |
-Query | GitHub search query for multiple PRs | .\breaking-change-doc.ps1 -Query "repo:dotnet/runtime state:closed label:needs-breaking-change-doc-created is:merged" |
-CollectOnly | Only collect PR data, don't generate documentation | .\breaking-change-doc.ps1 -PrNumber 123456 -CollectOnly |
-Comment | Add comments to PRs with issue creation links | .\breaking-change-doc.ps1 -PrNumber 123456 -Comment |
-CreateIssues | Create GitHub issues directly | .\breaking-change-doc.ps1 -PrNumber 123456 -CreateIssues |
-Clean | Clean previous data before starting | .\breaking-change-doc.ps1 -Clean |
Note: Either -PrNumber or -Query must be specified (unless using -Clean or -Help alone).
GitHub CLI: gh auth status and gh auth login
API Keys: Verify environment variables are set for non-GitHub Models providers
Rate Limits: Script includes delays between API calls
Git Operations: Ensure git is in PATH and repository is up to date (git fetch --tags)
Parameter Issues: Use -Help to see current parameter list and examples