-
Notifications
You must be signed in to change notification settings - Fork 25
Add changelog_format for compatibility with multiple changelogs
#467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add changelog_format for compatibility with multiple changelogs
#467
Conversation
Fixes JuliaRegistries#216 This adds a new 'auto_changelog' input parameter (default: false) that allows users to opt into GitHub's auto-generated release notes instead of TagBot's custom changelog generation. When enabled: - Release notes are generated by GitHub's built-in algorithm (PR-based) - The custom Changelog class is not initialized (saves API calls) - create_git_release is called with generate_release_notes=True This addresses the feature request to use GitHub's native changelog support, which was introduced in 2021 and focuses on merged PRs only (which some users prefer over the current issues+PRs approach). Changes: - Added auto_changelog input to action.yml - Updated Repo class to accept and use auto_changelog parameter - Modified create_release to use GitHub's auto-generation when enabled - Updated all test helpers and local CLI to support the new parameter - Added comprehensive tests for the new functionality
…entional formats Fixes JuliaRegistries#216, Fixes JuliaRegistries#402 This adds a new 'changelog_format' input parameter that allows users to choose between three changelog generation methods: - 'custom' (default): TagBot's existing Jinja2 template-based changelog - 'github': GitHub's auto-generated release notes (PR-based) - 'conventional': Conventional commits-based changelog generation Features: - Backward compatible: Existing workflows continue with 'custom' format - Extensible: Easy to add new formats in the future - Performance: Skips Changelog initialization for 'github' and 'conventional' - Native conventional commits parser with categorization - Emoji support for conventional commit types Conventional commits format: - Parses commit messages following conventional commits spec - Groups commits by type (feat, fix, docs, test, etc.) - Detects breaking changes and highlights them - Includes commit links and author attribution - Generates compare links between versions Changes: - Refactored auto_changelog boolean to changelog_format enum - Added _generate_conventional_changelog method - Updated create_release to support all three formats - Added comprehensive test coverage for all formats - Updated all test helpers and local CLI - Added validation for changelog_format input
changelog_format for compatibility with multiple changelogs
- Added missing changelog_format parameter to test helpers in test_backfilling.py and test_changelog.py - Updated create_git_release assertions to include generate_release_notes=False parameter in test_repo.py - Fixed logger fixture issues in test_changelog_formats.py by setting proper logging level in caplog - Removed old test_auto_changelog.py file (replaced by test_changelog_formats.py) - Formatted test files with black All 140 tests now passing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds support for multiple changelog formats to TagBot, introducing a new changelog_format input parameter with three options: custom (default, backward compatible), github (auto-generated release notes), and conventional (conventional commits-based changelog). The implementation includes a new conventional commits parser that groups commits by type, detects breaking changes, and generates formatted changelogs with commit links and author attribution.
Key Changes
- New
changelog_formatparameter with validation in the action entry point - Conventional commits changelog generator that parses commit messages and groups them by type
- Conditional changelog initialization based on the selected format
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
| action.yml | Adds changelog_format input parameter with description and default value |
| tagbot/action/main.py | Adds input reading and validation for changelog_format parameter |
| tagbot/action/repo.py | Implements conditional changelog initialization, _generate_conventional_changelog method, and format-based release note generation in create_release |
| tagbot/local/main.py | Passes default changelog_format value to Repo constructor |
| test/action/test_repo.py | Updates _repo helper to accept changelog_format parameter |
| test/action/test_repo_gitlab.py | Updates _repo helper to accept changelog_format parameter |
| test/action/test_changelog_formats.py | Adds comprehensive tests for the new changelog format functionality |
| test/action/test_auto_changelog.py | Contains tests for a non-existent auto_changelog parameter (critical bug) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Store releases list after first fetch in create_release() - Reuse stored releases when finding previous tag for conventional changelog - Reduces API calls by 1 per release creation with conventional format - Improves performance especially for packages with many releases
- Changed test_conventional_changelog_parsing to call create_release() instead of _generate_conventional_changelog() - Tests now go through public API rather than private internal method - Makes tests more robust to internal refactoring - Updated docstring to document the rationale - All 140 tests passing
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… checking - Show "Initial release." when no commits found for first release - Show "No new commits since the previous release." when no commits for non-first release - Add type annotation for categories dict: Dict[str, list[tuple[str, str, str]]] - Fix mypy error by adding None check for self._changelog - Split long lines to pass flake8 line length check - All 142 tests passing, mypy and formatting checks pass
|
@IanButterworth whenever you are free, please review this pr. Thanks! |
New
changelog_formatinput parameter with three options:custom(default) - Existing Jinja2 template-based changelog (backward compatible)github- GitHub's auto-generated release notesconventional- Conventional commits-based changelog (issue Support conventional changelogs #402)Conventional Commits Implementation
conventional commits specFixes #216
Fixes #402