scripts/release-tools/README.md
This directory contains Python scripts to help generate release notes and changelogs for ProxySQL releases.
gh) installed and authenticated (for scripts that fetch PR details)categorize_commits.pyCategorizes git commits based on keywords in commit messages.
Usage:
python categorize_commits.py --from-tag v3.0.3 --to-tag v3.0
python categorize_commits.py --input-file /tmp/commits.txt --output-format text
Options:
--from-tag, --to-tag: Git tags/branches to compare--input-file: Read commits from a file (format: git log --pretty=format:'%H|%s|%b')--output-format: markdown (default) or text--verbose: Show detailed outputgenerate_changelog.pyGenerates a changelog from git merge commits (pull requests). Uses second parent of merge commits to get PR-specific commits.
Usage:
python generate_changelog.py --from-tag v3.0.3 --to-tag v3.0 --output changelog.md
Options:
--from-tag, --to-tag: Git tags/branches to compare--output, -o: Output file (default: changelog.md)--verbose: Show progressGenerates formatted release notes using GitHub API (via gh CLI). Provides automatic categorization based on PR labels and titles, with optional manual mapping.
Usage:
python generate_release_notes.py --from-tag v3.0.3 --to-tag v3.0 --output release-notes.md
python generate_release_notes.py --from-tag v3.0.3 --to-tag v3.0 --config category_mapping.json --verbose
Options:
--from-tag, --to-tag: Git tags/branches to compare--output, -o: Output file for release notes (default: release-notes.md)--changelog, -c: Output file for detailed changelog--config: JSON file with manual category mapping (see example)--verbose: Show detailed progressfetch_prs.py (legacy)Legacy script that was used for ProxySQL 3.0.4. Consider using generate_release_notes.py instead.
gen_release_notes.py (legacy)Legacy script with hardcoded mapping for 3.0.4.
For generate_release_notes.py, you can provide a JSON file with manual categorization overrides. The format can be:
{
"5259": ["Bug Fixes", "MySQL"],
"5257": ["New Features", "MySQL"],
"5258": "Documentation"
}
Each key is a PR number. The value can be:
"Documentation")[category, subcategory] (e.g., ["New Features", "PostgreSQL"])See category_mapping.example.json for a complete example.
For high-quality release notes like ProxySQL v3.0.3, use the orchestrated workflow:
# Run the complete workflow
python orchestrate_release.py --from-tag v3.0.3 --to-tag v3.0.4 --output-dir release-data --verbose
# This generates:
# - release-data/pr-data-3.0.4.json # PR details from GitHub
# - release-data/pr-summary-3.0.4.md # PR summary
# - release-data/structured-notes-3.0.4.md # Commit-level data
# - release-data/llm-prompt-3.0.4.md # Complete prompt for LLM
# - release-data/workflow-summary.md # Instructions summary
Ensure you're on the correct branch and have all tags fetched:
git fetch --tags
git checkout v3.0 # or your release branch
python collect_pr_data.py --from-tag v3.0.3 --to-tag v3.0.4 --output pr-data.json --verbose
python generate_structured_notes.py --input pr-data.json --output structured-notes.md --verbose
python categorize_commits.py --from-tag v3.0.3 --to-tag v3.0.4 --output-format markdown > commit-categories.md
Generate comprehensive, human-readable release notes for ProxySQL 3.0.4 using the provided data files. Focus on creating descriptive content that explains what each feature/fix does and why it matters.
## Available Data Files
1. `pr-data.json` - All PR details from GitHub including titles, descriptions, labels
2. `structured-notes.md` - Commit-level organized data with technical details
3. `commit-categories.md` - Commits categorized by type (bug fix, feature, documentation, etc.)
## Requirements
### Structure
- Start with a **concise introduction paragraph** summarizing the release's significance
- Include a **"Highlights" section** with 4-6 bullet points summarizing key improvements
- Organize changes under: New Features, Bug Fixes, Improvements, Documentation, Testing, Build/Packaging, Other Changes
- Each major section should have a **brief introductory sentence** explaining its theme
- End with the release commit hash in backticks
### Writing Style
- Write **descriptive paragraphs** for each feature/fix (2-4 sentences minimum)
- Explain **what the change does** and **why it matters** to users/administrators
- Use **complete sentences** with proper grammar and flow
- Maintain a **professional yet accessible** tone
### Technical Formatting
- Wrap **all technical terms** in backticks:
- Function names: `Read_Global_Variables_from_configfile()`
- Variable names: `wait_timeout`, `cur_cmd_cmnt`
- SQL queries: `SELECT @@version`, `SELECT VERSION()`
- Protocol commands: `COM_PING`, `CLIENT_DEPRECATE_EOF`
- Configuration options: `cache_empty_result=0`
- Metrics: `PgSQL_Monitor_ssl_connections_OK`
- Include **commit hashes (short form)** and **PR numbers** in parentheses after each item
- Remove any `[WIP]`, `[skip-ci]`, or similar tags
- Use **bold for feature/fix names** followed by commit/PR references
### Section Guidelines
- **Highlights**: Focus on user/administrator benefits
- **New Features**: Group related features under subcategories (PostgreSQL Improvements, MySQL Protocol Enhancements, etc.)
- **Bug Fixes**: Clearly state the problem, then explain the solution
- **Improvements**: Focus on performance, stability, and efficiency enhancements
- **Other sections**: Explain practical value (better maintainability, expanded platform support, etc.)
### Example Format for Each Entry:
Feature Name (abc1234, #1234)
Descriptive paragraph explaining what this feature does and why it matters.
Include technical details like technical terms in backticks.
Explain benefits to users/administrators.
### Output Files
- `ProxySQL-3.0.4-Release-Notes-Enhanced.md` - Main enhanced release notes
- `CHANGELOG-3.0.4-detailed.md` - Detailed changelog (optional)
- `CHANGELOG-3.0.4-commits.md` - Complete commit list (optional)
### Tone & Audience
Write for database administrators, developers, system architects, and open source contributors. The notes should be informative for technical decision-making while remaining accessible to those with general database/proxy knowledge.
For basic changelogs without descriptive analysis:
python generate_release_notes.py --from-tag v3.0.3 --to-tag v3.0.4 --output release-notes.md --changelog detailed-changelog.md --verbose
python generate_changelog.py --from-tag v3.0.3 --to-tag v3.0.4 --output changelog.md
See the examples/ directory for output generated for ProxySQL 3.0.4:
ProxySQL-3.0.4-Release-Notes.md: Final release notesProxySQL-3.0.4-Release-Notes-Enhanced.md: Enhanced release notes with descriptive paragraphs, highlights section, and improved readability (recommended)CHANGELOG-3.0.4-detailed.md: Detailed changelog with PR summariesCHANGELOG-3.0.4-commits.md: Complete list of commitsThe enhanced release notes (ProxySQL-3.0.4-Release-Notes-Enhanced.md) demonstrate the recommended format with:
A standalone enhanced prompt template is available as examples/enhanced_prompt_template.md for easy copying and customization.
ProxySQL release notes (see v3.0.3 example) are descriptive, not just collections of PR titles. They:
The scripts in this directory help collect data, but the LLM should:
For enhanced release notes with highlights sections, section introductions, and improved readability, use the enhanced prompt template provided in Step 4 of the Complete Workflow section. This template guides the LLM to create more user-friendly release notes with:
ProxySQL release notes use backticks (`) around technical terms such as:
Read_Global_Variables_from_configfile()wait_timeout, cur_cmd_cmntSELECT @@version, SELECT VERSION()COM_PING, CLIENT_DEPRECATE_EOFcache_empty_result=0PgSQL_Monitor_ssl_connections_OKThe scripts do not automatically apply backtick formatting. When generating final release notes with the LLM, ensure you:
GitHub CLI Authentication: Ensure gh auth login has been run and you have permissions to access the repository.
Tag Names: Use exact tag names (e.g., v3.0.3) or branch names (e.g., HEAD for current branch).
Manual Review: Always review the generated notes. Automatic categorization is not perfect.
Customization: Feel free to modify the categorization keywords in the scripts to match your project's conventions.
These tools are part of the ProxySQL project and follow the same licensing terms.