Automated Release Notes System
This document explains how the automated release notes generation system works in the create-polyglot project and how contributors can help improve it.
Overview
The create-polyglot project uses an automated system to generate comprehensive release notes when new versions are published. This system categorizes changes, generates structured notes, and helps maintain consistency across releases.
How It Works
1. Triggering Release Notes Generation
Release notes are automatically generated in the following scenarios:
- Automatic: When a new GitHub release is created
- Manual: By running the "Generate Release Notes" workflow manually
- Integrated: As part of the npm publish workflow
2. Categorization Logic
The system analyzes commit messages and categorizes them into the following sections:
🚀 Features Added
- Commits starting with
feat:orfeat(scope): - Commits containing words like "add", "implement"
- New functionality for users
🐛 Bug Fixes
- Commits starting with
fix:orfix(scope): - Commits containing words like "bug", "patch"
- Fixes that resolve issues for users
⚠️ Breaking Changes
- Commits starting with
feat!:orfix!: - Commits containing the word "breaking"
- Changes that break backward compatibility
📚 Documentation
- Commits starting with
docs:ordocs(scope): - Commits containing "documentation", "readme"
- Documentation-only changes
🔧 Internal/DevOps
- Commits starting with
chore:,ci:,test:,refactor: - Internal changes that don't affect users
📦 Dependencies
- Commits starting with
deps: - Commits containing "dependencies", "package", "bump"
- Dependency updates
🎉 Other Changes
- Any commits that don't fit the above categories
3. Generated Content
Each release note includes:
- Categorized change lists with commit links and authors
- Contributors section with all contributors for the release
- Installation instructions for the new version
- Comparison links to view all changes
- Placeholders for manual additions (upgrade notes, known issues)
Contributing to Better Release Notes
For Contributors
1. Use Conventional Commit Messages
Follow the Conventional Commits specification:
# Good examples
feat: add Kong API gateway integration
fix: resolve port collision in service detection
docs: update README with new CLI commands
feat!: change default service structure (breaking)
chore: update dependencies to latest versions
# Less ideal
Added gateway support
Fixed bug
Updated docs2. Use Descriptive Commit Messages
- Write commit messages that explain what changed from a user's perspective
- Include the scope when relevant:
feat(cli): add --kong flag - Be specific: instead of "fix bug", write "fix port collision in service detection"
3. Fill Out PR Templates
When creating pull requests:
- Select the appropriate Type of Change
- Mark whether it's a User-facing change or Internal change only
- Provide Breaking Changes & Migration details if applicable
- Write clear descriptions that will help with release notes
4. Tag Breaking Changes Properly
For breaking changes:
- Use
!in the commit type:feat!:orfix!: - Include "BREAKING CHANGE:" in the commit body
- Provide migration steps in the PR description
For Maintainers
1. Manual Release Notes Enhancement
After automatic generation, maintainers can enhance the release notes by:
- Adding upgrade notes and migration steps
- Including known issues or caveats
- Highlighting particularly important changes
- Adding usage examples for new features
2. Using Manual Workflow Dispatch
To generate release notes for testing or drafts:
- Go to Actions → "Generate Release Notes"
- Click "Run workflow"
- Enter the tag name (e.g.,
v1.17.0) - Optionally specify target branch
- Review the generated draft release
3. Customizing Templates
The release notes template can be customized by editing:
.github/release-notes-template.md- Main template structure.github/workflows/release-notes.yml- Categorization logic
System Architecture
Files Involved
.github/release-notes-template.md- Template for release notes structure.github/workflows/release-notes.yml- Main release notes generation workflow.github/workflows/npm-publish.yml- Integration with npm publishing.github/pull_request_template.md- Enhanced PR template for categorization
Workflow Process
- Trigger: Release created or manual dispatch
- Analysis: Analyze commits since last release
- Categorization: Sort commits by type using regex patterns
- Generation: Apply categorized content to template
- Publishing: Update release with generated notes
- Artifacts: Save generated notes as workflow artifacts
Customization Options
Adding New Categories
To add a new category:
- Update the template in
.github/release-notes-template.md - Add categorization logic in
.github/workflows/release-notes.yml - Update the PR template if needed
Modifying Categorization Rules
Edit the regex patterns in the workflow file:
# Example: Adding new patterns for API changes
if [[ $lower_subject =~ ^api(\(.*\))?: ]] || [[ $lower_subject =~ api.change ]]; then
api_changes+=("- $subject ([${hash}](https://github.com/${{ github.repository }}/commit/${hash})) by @${author}")
fiCustom Template Variables
Add new template variables by:
- Defining them in the template:
{custom_section} - Generating content in the workflow
- Replacing them in the generation step:
NOTES="${NOTES//\{custom_section\}/$CUSTOM_CONTENT}"
Best Practices
For Contributors
- Be consistent with commit message formats
- Think about users when writing commit messages
- Use scopes to provide context:
feat(cli):,fix(docker): - Document breaking changes thoroughly
For Maintainers
- Review generated notes before publishing
- Add context that automated systems can't provide
- Update templates based on feedback and project evolution
- Test the system with manual dispatches before releases
Troubleshooting
Common Issues
Missing commits in release notes
- Check if commits follow conventional format
- Verify the previous tag detection logic
- Ensure commits are not merge commits (they're filtered out)
Incorrect categorization
- Review the regex patterns in the workflow
- Consider updating commit message to be more specific
- Check for typos in commit prefixes
Workflow failures
- Check GitHub Actions logs
- Verify template syntax
- Ensure proper permissions are set
Testing Changes
To test changes to the release notes system:
- Create a test tag:
git tag v0.0.0-test - Push the tag:
git push origin v0.0.0-test - Manually run the workflow with the test tag
- Review generated output
- Delete test tag when done:
git tag -d v0.0.0-test && git push origin :refs/tags/v0.0.0-test
Future Enhancements
Potential improvements to consider:
- PR-based categorization: Use PR labels instead of just commit messages
- Automated breaking change detection: Analyze code changes for potential breaking changes
- Integration with issue tracking: Link resolved issues in release notes
- Multi-language support: Generate release notes in multiple languages
- Enhanced templates: More sophisticated templating with conditionals
Support
If you encounter issues with the automated release notes system:
- Check the workflow runs for error details
- Review this documentation for best practices
- Open an issue with the
documentationorcilabel - Contact maintainers in the repository discussions
Recent Updates
- Added refactoring and performance section to release notes
- Enhanced categorization for code quality improvements