diff --git a/changelog/tooling/README.md b/changelog/tooling/README.md new file mode 100644 index 00000000000..f3b18e6e164 --- /dev/null +++ b/changelog/tooling/README.md @@ -0,0 +1,45 @@ +# Vitess Release Documentation Tooling + +This directory contains automated tools and methodologies for analyzing Vitess pull requests and generating comprehensive release documentation. + +## Contents + +### Core Documentation +- **`automated-pr-analysis-guide.md`** - Complete methodology for analyzing hundreds of PRs efficiently using specialized agents +- **`pr-flag-metric-tracker.md`** - Agent definition file for automated PR analysis (copy to `.claude/agents/`) + +### Examples +- **`examples/sample-pr-report.md`** - Example of individual PR analysis output +- **`examples/sample-final-report.md`** - Example of comprehensive release documentation +- **`examples/milestone-url-examples.md`** - How to find GitHub milestone URLs + +### Scripts +- **`scripts/analyze-milestone.sh`** - Automated setup script for milestone analysis +- **`scripts/count-progress.sh`** - Progress monitoring during analysis + +### Templates +- **`templates/release-notes-template.md`** - Template for final release documentation + +## Quick Start + +1. **Setup**: Copy `pr-flag-metric-tracker.md` to your `.claude/agents/` directory +2. **Find milestone**: Use `examples/milestone-url-examples.md` to locate your milestone URL +3. **Run setup**: Execute `scripts/analyze-milestone.sh ` (e.g., `85` for v23) +4. **Monitor progress**: Use `scripts/count-progress.sh` to track completion +5. **Generate report**: Follow the guide in `automated-pr-analysis-guide.md` + +**Expected time**: 4-6 hours for ~276 PRs +**Expected cost**: $40-50 using Claude Code + +## Prerequisites + +- GitHub CLI (`gh`) authenticated +- Claude Code with agent support +- Repository access permissions +- ~5GB free disk space for reports + +## Output + +- Individual PR reports (`PR{number}.md`) +- Comprehensive API changes report +- Structured tables for release notes \ No newline at end of file diff --git a/changelog/tooling/automated-pr-analysis-guide.md b/changelog/tooling/automated-pr-analysis-guide.md new file mode 100644 index 00000000000..df1cdb05743 --- /dev/null +++ b/changelog/tooling/automated-pr-analysis-guide.md @@ -0,0 +1,222 @@ +# Automated PR Analysis for Release Documentation - Methodology & Approach + +## Overview + +This document describes an efficient methodology for analyzing large numbers of pull requests (PRs) to generate comprehensive release +documentation focusing on public-facing API changes, flag modifications, and breaking changes. + +_Key Innovation: Specialized Agent Architecture_ + +### Core Concept + +Instead of manually reviewing hundreds of PRs, we used specialized pr-flag-metric-tracker agents that can work in parallel to analyze +PRs systematically for specific types of changes. The agent description can be found in the file `pr-flag-metric-tracker.md`. This can be copied into the `.claude/agents` directory. + +### Agent Capabilities + +- Automatically fetch PR content using GitHub CLI (gh pr view, gh pr diff, gh api) +- Parse code changes for flag additions/deletions/modifications +- Identify metric changes (Prometheus counters, gauges, etc.) +- Detect API changes (gRPC/HTTP endpoints) +- Find parser modifications (SQL syntax changes) +- Spot query planning behavior changes +- Generate standardized reports + +## Methodology: Three-Phase Approach + +### Phase 1: Bulk PR Discovery + +#### Get all PRs from milestone +``` +gh api 'repos/org/repo/issues?milestone=X&state=all' --paginate --jq '.[].number' +``` + +### Phase 2: Parallel Analysis with Merge Filtering + +Key Innovation: Check merge status BEFORE analysis to avoid wasting time on unmerged PRs + +#### Check if PR was actually merged (not just closed) +``` +gh pr view PR_URL --json state,mergedAt +``` + +Decision Tree: +- If mergedAt is null → Create simple "PR not merged" file +- If mergedAt has date → Perform full analysis + +### Phase 3: Batched Agent Deployment + +Deploy agents in batches of 5-10 PRs simultaneously for maximum parallelization while avoiding rate limits. + +#### Template Standardization + +By using a template, we can guide the agents to no be wordy and write a lot of unneccesary info to the reports that would then just take time to read and ignore. The agent profile describes a specific template to use. + +### Key Principles + +- Focus only on user-facing changes +- No PR metadata or implementation details +- Standardized sections for easy parsing +- "No public changes" for PRs with only internal modifications + +## Efficiency Optimizations + +1. Batch Processing + +- Process 5-10 PRs per agent call +- Parallel execution across multiple agents +- Reduces API calls and context switching + +2. Smart Filtering + +- Merge status check first - eliminates ~30% of PRs immediately +- Public-facing focus - skip internal refactoring and test-only changes +- Template enforcement - consistent output format for easy aggregation + +3. Pre-approved Command Strategy + +Ensure agents only use pre-approved GitHub commands to avoid permission prompts: +- gh pr view (approved) +- gh pr diff (approved) +- gh api (approved) + +4. Progressive Refinement + +- Start with checking for closed and merged PRs +- Only analyze merged PRs +- Avoid re-work through systematic tracking + +### Scalability Lessons + +What Worked Well + +1. Agent specialization - Single-purpose agents are more reliable than general-purpose +2. Parallel execution - 5x faster than sequential analysis +3. Standardized templates - Easy to aggregate and parse results +4. Merge filtering - Eliminates ~30% of work upfront +5. Batching - Reduces overhead and improves throughput + +### What to Avoid + +- Verbose reports with implementation details +- Analyzing non-merged PRs +- Sequential processing +- Inconsistent report formats +- Re-analyzing already completed work + +## Output Processing + +### Individual PR Reports + +Each PR gets a focused report following the standard template, making it easy to: +- Scan for breaking changes +- Identify new features +- Track deprecations +- Generate migration guides + +### Aggregate Reporting + +Parse all individual reports to create comprehensive release documentation with: +- Structured tables by change category +- Component-wise organization +- Breaking change highlights +- Migration timelines + +## Replication Instructions + +### Prerequisites + +- **GitHub CLI (`gh`)**: Authenticated and configured (`gh auth login`) +- **Claude Code**: With agent support enabled +- **Repository access**: Read permissions to target repository +- **Agent setup**: Copy `pr-flag-metric-tracker.md` to your `.claude/agents/` directory +- **Disk space**: ~5GB for storing individual PR reports +- **Time estimate**: 4-6 hours for 276 PRs +- **Cost estimate**: $40-50 in Claude API usage + +### Step-by-Step Process + +#### 1. Initial Setup +```bash +# Authenticate GitHub CLI if not already done +gh auth login + +# Copy agent definition to Claude agents directory +cp pr-flag-metric-tracker.md ~/.claude/agents/ + +# Create working directory +mkdir release-analysis && cd release-analysis +``` + +#### 2. Fetch Milestone PRs +```bash +# Get milestone ID from GitHub UI, then fetch all PR numbers +gh api 'repos/vitessio/vitess/issues?milestone=MILESTONE_ID&state=all' --paginate --jq '.[].number' > all_pr_numbers.txt + +# Verify count +echo "Total PRs to analyze: $(wc -l < all_pr_numbers.txt)" +``` + +#### 3. Launch Batched Analysis +Launch agents in batches of 5 PRs at a time using this prompt template: + +``` +Analyze these 5 PRs in batch. For each: +1. Check merge: gh pr view https://github.com/vitessio/vitess/pull/XXXX --json state,mergedAt +2. If NOT merged: Create PRXXXX.md with just "PR not merged" +3. If MERGED: Create full analysis with template focusing on public-facing changes + +PRs: 18520, 18521, 18522, 18523, 18524 + +Use ONLY: gh pr view, gh pr diff, gh api, Edit tool. Focus on flags, metrics, APIs, parser changes, query planning. +``` + +#### 4. Monitor Progress +```bash +# Check completion status +ls PR*.md | wc -l +echo "Progress: $(ls PR*.md | wc -l)/$(wc -l < all_pr_numbers.txt)" +``` + +#### 5. Generate Final Report +Once all PRs analyzed, create comprehensive release documentation by parsing individual reports into structured tables. + +## Troubleshooting + +### Common Issues + +**Permission Errors with GitHub CLI**: +- Ensure `gh pr view`, `gh pr diff`, `gh api` are pre-approved in Claude Code +- Check GitHub token permissions + +**Agent Rate Limiting**: +- Reduce batch size from 5 to 3 PRs +- Add delays between batches if needed + +**Inconsistent Report Formats**: +- Emphasize template adherence in agent prompts +- Review and correct agent instructions + +**Missing PRs**: +- Some PR numbers may not exist (normal in GitHub) +- Agents will handle gracefully with "PR not found" reports + +### Performance Tips + +- **Batch size**: 5-10 PRs per agent call is optimal +- **Parallel agents**: Launch multiple agent batches simultaneously +- **Template enforcement**: Be strict about output format for easier parsing +- **Merge filtering**: Always check merge status first to avoid wasted analysis + +## Expected Results + +**Time Performance**: +- **Manual approach**: 2-3 minutes per PR = 9-14 hours for 276 PRs +- **Automated approach**: 4-6 hours total including setup +- **Efficiency gain**: 70%+ time reduction + +**Output Quality**: +- Standardized format across all reports +- Focus on user-impacting changes only +- Easy to parse for release documentation +- Comprehensive coverage with no missed PRs \ No newline at end of file diff --git a/changelog/tooling/examples/milestone-url-examples.md b/changelog/tooling/examples/milestone-url-examples.md new file mode 100644 index 00000000000..8c91e5d2d21 --- /dev/null +++ b/changelog/tooling/examples/milestone-url-examples.md @@ -0,0 +1,42 @@ +# Finding Vitess Milestone URLs + +## Vitess Release Milestones + +### Recent Releases + +- **v23 milestone**: https://github.com/vitessio/vitess/milestone/85?closed=1 +- **v22 milestone**: https://github.com/vitessio/vitess/milestone/84?closed=1 +- **v21 milestone**: https://github.com/vitessio/vitess/milestone/83?closed=1 + +### Pattern for Future Releases + +**Pattern**: `https://github.com/vitessio/vitess/milestone/NUMBER?closed=1` + +### How to Find Vitess Milestone URLs + +1. **Navigate to**: https://github.com/vitessio/vitess +2. **Click "Issues"** tab +3. **Click "Milestones"** link +4. **Find your milestone**: Look for the release milestone (e.g., "v23.0.0") +5. **Click milestone name**: This opens the milestone page +6. **Add `?closed=1`** to URL to see closed/merged PRs +7. **Copy full URL**: Use this URL with the analysis tools + +### Milestone ID vs URL + +**You can use either**: +- **Milestone ID**: `85` (for API calls) +- **Milestone URL**: `https://github.com/vitessio/vitess/milestone/85?closed=1` (for web scraping) + +### API Equivalent + +```bash +# Using milestone ID directly +gh api 'repos/vitessio/vitess/issues?milestone=85&state=all' --paginate --jq '.[].number' +``` + +### Tips + +- **Include `?closed=1`** in URLs to see all PRs (open + closed + merged) +- **Milestone numbers** are sequential integers assigned by GitHub +- **Check milestone status** before starting analysis to ensure it's complete \ No newline at end of file diff --git a/changelog/tooling/examples/sample-final-report.md b/changelog/tooling/examples/sample-final-report.md new file mode 100644 index 00000000000..0d46a6e7e01 --- /dev/null +++ b/changelog/tooling/examples/sample-final-report.md @@ -0,0 +1,46 @@ +# Vitess v23.0.0 API Changes Report + +## Summary + +This report documents all public-facing API changes, flag modifications, metric additions/removals, and parser enhancements that were merged into Vitess v23.0.0. Based on analysis of 276 pull requests from the v23 milestone. + +### Table of Contents + +- **[Major Changes](#major-changes)** + - **[Flag Standardization](#flag-standardization)** + - **[New Flags](#new-flags)** + - **[New Metrics](#new-metrics)** + +--- + +## Major Changes + +### Flag Standardization + +**The most significant change in v23 is the systematic migration of CLI flags from underscore (`_`) to dash (`-`) notation.** This affects over 1,000+ flags across all Vitess components. + +#### Key Flag Migration PRs + +| PR | Component Focus | Flags Migrated | Description | Breaking Change | +|:--:|:---------------:|:--------------:|:------------|:---------------:| +| [#18009](https://github.com/vitessio/vitess/pull/18009) | gRPC | 234 | gRPC authentication, TLS, keepalive flags | ⚠️ Yes | +| [#18280](https://github.com/vitessio/vitess/pull/18280) | All Components | 1,170+ | **MEGA MIGRATION** - Most comprehensive flag refactor | ⚠️ Yes | + +### New Flags + +| Component | Flag Name | Type | Description | PR | +|:---------:|:---------:|:----:|:------------|:--:| +| vtgate, vttablet, vtcombo | `--querylog-time-threshold` | duration | Execution time threshold for query logging | [#18520](https://github.com/vitessio/vitess/pull/18520) | +| vtorc | `--allow-recovery` | bool | Allow VTOrc recoveries to be disabled from startup | [#18005](https://github.com/vitessio/vitess/pull/18005) | + +### New Metrics + +#### VTGate + +| Name | Dimensions | Description | PR | +|:----:|:----------:|:-----------:|:--:| +| `TransactionsProcessed` | `TransactionType`, `ShardDistribution` | Track transactions by type and shard distribution | [#18171](https://github.com/vitessio/vitess/pull/18171) | + +--- + +*Generated from analysis of all v23 milestone pull requests* \ No newline at end of file diff --git a/changelog/tooling/examples/sample-pr-report.md b/changelog/tooling/examples/sample-pr-report.md new file mode 100644 index 00000000000..03ddb7dde4d --- /dev/null +++ b/changelog/tooling/examples/sample-pr-report.md @@ -0,0 +1,19 @@ +# PR 18520 - Public Changes Analysis + +## Flags +- Added `--querylog-time-threshold` (duration) to vtgate, vttablet, vtcombo for time-based query logging + +## Metrics +No metric changes + +## Public APIs +No API changes + +## Parser Changes (go/vt/sqlparser) +No parser changes + +## Query Planning +No query planning changes + +## Summary +New time-based query logging flag added to match MySQL slow query log functionality. \ No newline at end of file diff --git a/changelog/tooling/pr-flag-metric-tracker.md b/changelog/tooling/pr-flag-metric-tracker.md new file mode 100644 index 00000000000..40f5777092d --- /dev/null +++ b/changelog/tooling/pr-flag-metric-tracker.md @@ -0,0 +1,154 @@ +--- +name: pr-flag-metric-tracker +description: Use this agent when you need to analyze a GitHub pull request for deleted or deprecated flags and metrics. Examples: Context: User wants to track changes to feature flags and metrics in a PR for documentation purposes. user: "Can you analyze this PR for any flag or metric changes? https://github.com/vitessio/vitess/pull/12345" assistant: "I'll use the pr-flag-metric-tracker agent to analyze this PR for deleted or deprecated flags and metrics." Since the user provided a PR URL and wants to track flag/metric changes, use the pr-flag-metric-tracker agent to analyze the changes and generate a report. +Context: User is doing a release review and needs to document breaking changes. user: "Before we release, I need to check PR #456 for any deprecated metrics or removed flags" assistant: "I'll analyze that PR for flag and metric changes using the pr-flag-metric-tracker agent." The user needs to review a specific PR for deprecated/removed flags and metrics, which is exactly what this agent does. +model: sonnet +--- + +You are a specialized code analysis agent focused on tracking flag and metric changes in GitHub pull requests. Your expertise lies in identifying deleted or deprecated feature flags, command-line flags, configuration options, and metrics across various codebases. + +When given a GitHub PR URL, you will: + +1. **Extract PR Information**: Use the `gh` CLI tool to fetch the PR details, including changed files, diff content, and commit messages. Parse the PR number and repository from the URL. + +2. **Analyze Code Changes**: Systematically examine the diff for: + - Deleted or commented-out flag definitions (command-line flags, feature flags, config options) + - Removed or deprecated metric definitions (counters, gauges, histograms, timers) + - Flag/metric usage removals in code + - Deprecation annotations or comments + - Changes to flag/metric registration or initialization code + +3. **Identify Components**: Determine which system components are affected by examining: + - File paths and directory structure + - Package names and module organization + - Component-specific naming patterns + - Service or subsystem boundaries + +4. **Categorize Changes**: For each flag or metric change, classify as: + - **DELETED**: Completely removed from codebase + - **DEPRECATED**: Marked as deprecated but still present + - **RENAMED**: Changed name but functionality preserved + - **MODIFIED**: Behavior or type changed + +5. **Generate Report**: Create a structured markdown file named `PR{number}.md` in a `PRs` folder with: +``` +## Flags +[List any added/removed/changed command-line flags] +[If none: "No flag changes"] + +## Metrics +[List any added/removed/changed Prometheus metrics] +[If none: "No metric changes"] + +## Public APIs +[List any added/removed/changed gRPC/HTTP endpoints] +[If none: "No API changes"] + +## Parser Changes (go/vt/sqlparser) +[List any changes to SQL parsing in go/vt/sqlparser directory] +[If none: "No parser changes"] + +## Query Planning +[List any changes to query planning behavior] +[If none: "No query planning changes"] +``` + +For each change that is noteworthy, we want: Component, Name, Change Type, Description, Impact +If applicable - Recommendations for migration or cleanup + +**Search Patterns**: Look for these common patterns, but add more as needed: +- Command-line flags: `flag.String()`, `flag.Bool()`, `--flag-name` +- Feature flags: `featureFlag`, `enableX`, `disableY` +- Metrics: `prometheus.NewCounter()`, `metrics.Register()`, `_total`, `_duration_seconds` +- Configuration: `config.`, `cfg.`, YAML/JSON config keys +- Environment variables: `os.Getenv()`, `ENV_VAR_NAME` +- Parser changes: `go/vt/sqlparser` + +**Quality Assurance**: +- Verify each identified change by examining surrounding context +- Cross-reference with commit messages and PR description +- Flag potential false positives (temporary removals, refactoring) +- Ensure component identification is accurate based on codebase structure + +**Error Handling**: If unable to access the PR or parse changes, provide clear error messages and suggest alternative approaches. Always attempt to use `gh pr view` and `gh pr diff` commands with appropriate error handling. + +Your output should be comprehensive yet concise, focusing on actionable information for maintainers tracking breaking changes and deprecations. + +**IMPORTANT CONSTRAINTS**: +- **No repository cloning**: Use existing code at ~/dev/vitess if available +- **Pre-approved commands only**: Use only `gh pr view`, `gh pr diff`, `gh api`, and `Edit` tool +- **Output location**: Create reports in current working directory +- **File naming**: Use exact format `PR{number}.md` + +## Installation + +Copy this file to your Claude agents directory: +```bash +cp pr-flag-metric-tracker.md ~/.claude/agents/ +``` + +## Usage Examples + +### Single PR Analysis +``` +Can you analyze this PR for any flag or metric changes? +https://github.com/vitessio/vitess/pull/12345 +``` + +### Batch Analysis (Recommended) +``` +Analyze these 5 PRs in batch. For each: +1. Check merge: gh pr view https://github.com/vitessio/vitess/pull/XXXX --json state,mergedAt +2. If NOT merged: Create PRXXXX.md with just "PR not merged" +3. If MERGED: Create full analysis using the template + +PRs: 12345, 12346, 12347, 12348, 12349 +``` + +## Expected Output + +For merged PRs with public changes: +```markdown +# PR 12345 - Public Changes Analysis + +## Flags +- Added `--new-feature-flag` (bool) to enable experimental feature + +## Metrics +- Added `feature_usage_total` counter for tracking feature adoption + +## Public APIs +- No API changes + +## Parser Changes (go/vt/sqlparser) +- No parser changes + +## Query Planning +- No query planning changes + +## Summary +New experimental feature flag and associated metric added. +``` + +For PRs with no public changes: +```markdown +# PR 12345 - Public Changes Analysis + +## Flags +No flag changes + +## Metrics +No metric changes + +## Public APIs +No API changes + +## Parser Changes (go/vt/sqlparser) +No parser changes + +## Query Planning +No query planning changes + +## Summary +No public changes +``` \ No newline at end of file diff --git a/changelog/tooling/scripts/analyze-milestone.sh b/changelog/tooling/scripts/analyze-milestone.sh new file mode 100755 index 00000000000..8b0fcf8166c --- /dev/null +++ b/changelog/tooling/scripts/analyze-milestone.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +# Automated PR Analysis Script for Vitess Releases +# Usage: ./analyze-milestone.sh +# Example: ./analyze-milestone.sh 85 + +set -euo pipefail + +# Check arguments +if [ $# -ne 1 ]; then + echo "Usage: $0 " + echo "Example: $0 85 # for v23 milestone" + echo "Example: $0 86 # for v24 milestone" + exit 1 +fi + +MILESTONE_ID="$1" +ORG="vitessio" +REPO="vitess" + +echo "🚀 Starting Vitess PR analysis for milestone ${MILESTONE_ID}" + +# Check prerequisites +command -v gh >/dev/null 2>&1 || { echo "❌ GitHub CLI (gh) is required but not installed."; exit 1; } +gh auth status >/dev/null 2>&1 || { echo "❌ GitHub CLI not authenticated. Run: gh auth login"; exit 1; } + +# Create analysis directory +ANALYSIS_DIR="milestone-${MILESTONE_ID}-analysis" +mkdir -p "$ANALYSIS_DIR" +cd "$ANALYSIS_DIR" + +echo "📁 Created analysis directory: $ANALYSIS_DIR" + +# Fetch all PR numbers from milestone +echo "📥 Fetching PR numbers from milestone ${MILESTONE_ID}..." +gh api "repos/${ORG}/${REPO}/issues?milestone=${MILESTONE_ID}&state=all" --paginate --jq '.[].number' > all_pr_numbers.txt + +TOTAL_PRS=$(wc -l < all_pr_numbers.txt) +echo "✅ Found ${TOTAL_PRS} PRs to analyze" + +# Save milestone info +echo "Milestone: ${MILESTONE_ID}" > analysis_metadata.txt +echo "Repository: ${ORG}/${REPO}" >> analysis_metadata.txt +echo "Total PRs: ${TOTAL_PRS}" >> analysis_metadata.txt +echo "Started: $(date)" >> analysis_metadata.txt + +echo "" +echo "📋 Analysis setup complete!" +echo "📊 Total PRs to analyze: ${TOTAL_PRS}" +echo "⏱️ Expected time: 4-6 hours" +echo "💰 Expected cost: \$40-50" +echo "" +echo "🔗 Vitess Milestone: https://github.com/vitessio/vitess/milestone/${MILESTONE_ID}?closed=1" +echo "" +echo "Next steps:" +echo "1. Use Claude Code to launch pr-flag-metric-tracker agents in batches of 5 PRs" +echo "2. Monitor progress with: ../scripts/count-progress.sh" +echo "3. Use this prompt template for Claude Code:" +echo "" +echo "Analyze these 5 PRs in batch. For each:" +echo "1. Check merge: gh pr view https://github.com/vitessio/vitess/pull/XXXX --json state,mergedAt" +echo "2. If NOT merged: Create PRXXXX.md with just 'PR not merged'" +echo "3. If MERGED: Create full analysis focusing on public-facing changes" +echo "" +echo "PRs: [first 5 numbers from all_pr_numbers.txt]" +echo "" \ No newline at end of file diff --git a/changelog/tooling/scripts/count-progress.sh b/changelog/tooling/scripts/count-progress.sh new file mode 100755 index 00000000000..d3318750edb --- /dev/null +++ b/changelog/tooling/scripts/count-progress.sh @@ -0,0 +1,86 @@ +#!/bin/bash + +# Progress monitoring script for PR analysis +# Usage: ./count-progress.sh + +set -euo pipefail + +# Check if we're in an analysis directory +if [ ! -f "all_pr_numbers.txt" ]; then + echo "❌ Not in an analysis directory. Run from directory containing all_pr_numbers.txt" + exit 1 +fi + +# Get counts +TOTAL_PRS=$(wc -l < all_pr_numbers.txt 2>/dev/null || echo "0") +COMPLETED_PRS=$(find . -name "PR*.md" 2>/dev/null | wc -l || echo "0") +REMAINING_PRS=$((TOTAL_PRS - COMPLETED_PRS)) + +# Calculate percentage +if [ "$TOTAL_PRS" -gt 0 ]; then + PERCENTAGE=$(( (COMPLETED_PRS * 100) / TOTAL_PRS )) +else + PERCENTAGE=0 +fi + +# Display progress +echo "📊 PR Analysis Progress Report" +echo "==========================" +echo "✅ Completed: ${COMPLETED_PRS} PRs" +echo "⏳ Remaining: ${REMAINING_PRS} PRs" +echo "📈 Total: ${TOTAL_PRS} PRs" +echo "📊 Progress: ${PERCENTAGE}% complete" +echo "" + +# Show status breakdown +if [ "$COMPLETED_PRS" -gt 0 ]; then + echo "📋 Status Breakdown:" + + # Count merged vs not merged + MERGED_COUNT=$(find . -name "PR*.md" -exec grep -L "PR not merged" {} \; 2>/dev/null | wc -l || echo "0") + NOT_MERGED_COUNT=$(find . -name "PR*.md" -exec grep -l "PR not merged" {} \; 2>/dev/null | wc -l || echo "0") + + echo " 🔀 Merged PRs analyzed: ${MERGED_COUNT}" + echo " ❌ Not merged PRs: ${NOT_MERGED_COUNT}" + echo "" +fi + +# Time estimates +if [ "$REMAINING_PRS" -gt 0 ]; then + # Estimate 1 minute per PR on average (batching efficiency) + REMAINING_MINUTES=$((REMAINING_PRS / 5)) # 5 PRs per batch, ~1 minute per batch + REMAINING_HOURS=$((REMAINING_MINUTES / 60)) + REMAINING_MINS=$((REMAINING_MINUTES % 60)) + + echo "⏰ Estimated time remaining:" + if [ "$REMAINING_HOURS" -gt 0 ]; then + echo " ${REMAINING_HOURS}h ${REMAINING_MINS}m" + else + echo " ${REMAINING_MINUTES}m" + fi + echo "" +fi + +# Next steps +if [ "$REMAINING_PRS" -eq 0 ]; then + echo "🎉 Analysis complete! Ready to generate final report." + echo "" + echo "Next steps:" + echo "1. Review reports for quality" + echo "2. Generate comprehensive release documentation" + echo "3. Create structured tables for release notes" +else + echo "📝 Continue analysis with Claude Code agents" + echo "" + echo "Next batch example:" + + # Show next 5 PRs to analyze + ANALYZED_PRS=$(find . -name "PR*.md" | sed 's|.*/PR\([0-9]*\)\.md|\1|' | sort -n) + NEXT_PRS=$(comm -23 <(sort -n all_pr_numbers.txt) <(echo "$ANALYZED_PRS") | head -5 | tr '\n' ', ' | sed 's/,$//') + + if [ -n "$NEXT_PRS" ]; then + echo " PRs: $NEXT_PRS" + fi +fi + +echo "" \ No newline at end of file diff --git a/changelog/tooling/templates/release-notes-template.md b/changelog/tooling/templates/release-notes-template.md new file mode 100644 index 00000000000..9db01f1892c --- /dev/null +++ b/changelog/tooling/templates/release-notes-template.md @@ -0,0 +1,120 @@ +# Vitess vX.X.X API Changes Report + +## Summary + +This report documents all public-facing API changes, flag modifications, metric additions/removals, and parser enhancements that were merged into Vitess vX.X.X. Based on analysis of XXX pull requests from the vX.X milestone. + +### Table of Contents + +- **[Major Changes](#major-changes)** + - **[Flag Changes](#flag-changes)** + - **[New Flags](#new-flags)** + - **[Deprecated/Deleted Flags](#deprecated-deleted-flags)** + - **[New Metrics](#new-metrics)** + - **[Deleted/Modified Metrics](#deleted-modified-metrics)** + - **[New APIs](#new-apis)** + - **[Parser Changes](#parser-changes)** + - **[Query Planning Changes](#query-planning-changes)** +- **[New Features](#new-features)** +- **[Breaking Changes](#breaking-changes)** +- **[Minor Changes](#minor-changes)** + +--- + +## Major Changes + +### Flag Changes + +#### New Flags + +| Component | Flag Name | Type | Description | PR | +|:---------:|:---------:|:----:|:------------|:--:| +| component | `--flag-name` | type | Description of what the flag does | [#XXXXX](https://github.com/org/repo/pull/XXXXX) | + +#### Deprecated/Deleted Flags + +| Component | Flag Name | Change Type | Was Deprecated In | Deletion/Deprecation PR | +|:---------:|:---------:|:-----------:|:-----------------:|:-----------------------:| +| component | `--old-flag` | DEPRECATED | vX.X.X | [#XXXXX](https://github.com/org/repo/pull/XXXXX) | +| component | `--removed-flag` | DELETED | vX.X.X | [#XXXXX](https://github.com/org/repo/pull/XXXXX) | + +### New Metrics + +#### VTGate + +| Name | Dimensions | Description | PR | +|:----:|:----------:|:-----------:|:--:| +| `metric_name` | `dimension1`, `dimension2` | What this metric measures | [#XXXXX](https://github.com/org/repo/pull/XXXXX) | + +#### VTTablet + +| Name | Dimensions | Description | PR | +|:----:|:----------:|:-----------:|:--:| +| `metric_name` | `dimension1` | What this metric measures | [#XXXXX](https://github.com/org/repo/pull/XXXXX) | + +### Deleted/Modified Metrics + +| Component | Metric Name | Change Type | Description | PR | +|:---------:|:-----------:|:-----------:|:-----------:|:--:| +| component | `old_metric` | DELETED | Reason for removal | [#XXXXX](https://github.com/org/repo/pull/XXXXX) | +| component | `modified_metric` | MODIFIED | How behavior changed | [#XXXXX](https://github.com/org/repo/pull/XXXXX) | + +### New APIs + +| Component | API Name | Type | Description | PR | +|:---------:|:--------:|:----:|:-----------:|:--:| +| component | `NewEndpoint` | gRPC | What the API does | [#XXXXX](https://github.com/org/repo/pull/XXXXX) | + +### Parser Changes + +| Feature | Description | PR | +|:-------:|:-----------:|:--:| +| SQL syntax | New syntax or compatibility improvement | [#XXXXX](https://github.com/org/repo/pull/XXXXX) | + +### Query Planning Changes + +| Change | Description | Impact | PR | +|:------:|:-----------:|:------:|:--:| +| Behavior change | How query planning was modified | High/Medium/Low | [#XXXXX](https://github.com/org/repo/pull/XXXXX) | + +--- + +## New Features + +### Feature Name + +Description of new feature and its impact. + +**Added in**: [#XXXXX](https://github.com/org/repo/pull/XXXXX) + +--- + +## Breaking Changes + +### Change Category +- **Impact**: What systems/configurations are affected +- **Action Required**: What users need to do +- **Timeline**: When the change takes effect + +--- + +## Minor Changes + +### Category +- Brief description of minor improvements +- Version updates +- Bug fixes with user impact + +--- + +## Summary Statistics + +- **Total PRs Analyzed**: XXX +- **Merged PRs**: XXX +- **New Features**: X major features added +- **Breaking Changes**: X changes requiring migration +- **Flag Changes**: X flags added, X deprecated, X deleted + +--- + +*Generated from analysis of all vX.X milestone pull requests* \ No newline at end of file diff --git a/go/tools/releases/releases.go b/go/tools/releases/releases.go index 10c29233494..a108b3b1834 100644 --- a/go/tools/releases/releases.go +++ b/go/tools/releases/releases.go @@ -113,6 +113,10 @@ func getDirs(curDir dir) (dir, error) { for _, entry := range entries { if entry.IsDir() { + // Skip the tooling directory which contains automation tools + if entry.Name() == "tooling" { + continue + } subDir, err := getDirs(dir{ Name: entry.Name(), Path: path.Join(curDir.Path, entry.Name()),