docs/Automated-Changelog-Usage.md
This guide explains how to use the new automated changelog system for the Fabric project.
The automated changelog system allows developers to pre-process their PR changelog entries during development, which are then automatically aggregated during the release process. This eliminates manual CHANGELOG.md editing and reduces merge conflicts.
Work on your feature as usual and create a pull request.
Once your PR is ready for review, generate a changelog entry:
cd cmd/generate_changelog
go build -o generate_changelog .
./generate_changelog --incoming-pr YOUR_PR_NUMBER
For example, if your PR number is 1672:
./generate_changelog --incoming-pr 1672
The tool will validate:
If any validation fails, fix the issues and try again.
The tool will:
./cmd/generate_changelog/incoming/1672.txt--ai-summarize is enabled)--push to also push to remote)Review the generated file and edit if needed:
cat ./cmd/generate_changelog/incoming/1672.txt
The incoming changelog entry is now part of your PR and will be reviewed along with your code changes.
### PR [#1672](https://github.com/danielmiessler/fabric/pull/1672) by [ksylvan](https://github.com/ksylvan): Changelog Generator Enhancement
- Added automated CI/CD integration for changelog generation
- Implemented pre-processing of PR entries during development
- Enhanced caching system for better performance
- Added validation for mergeable PR states
--incoming-prPre-process a specific PR for changelog generation.
Usage: ./generate_changelog --incoming-pr PR_NUMBER
Requirements:
GITHUB_TOKEN env var or --token flag)Mutual Exclusivity: Cannot be used with --process-prs flag
--incoming-dirSpecify custom directory for incoming PR files (default: ./cmd/generate_changelog/incoming).
Usage: ./generate_changelog --incoming-pr 1672 --incoming-dir ./custom/path
--process-prsProcess all incoming PR files for release aggregation. Used by CI/CD during release creation.
Usage: ./generate_changelog --process-prs {new_version_string}
Mutual Exclusivity: Cannot be used with --incoming-pr flag
--ai-summarizeEnable AI-enhanced summaries using Fabric integration.
Usage: ./generate_changelog --incoming-pr 1672 --ai-summarize
--pushEnable automatic git push after creating an incoming entry. By default, the commit is created locally but not pushed to the remote repository.
Usage: ./generate_changelog --incoming-pr 1672 --push
Note: When using --push, ensure you have proper authentication configured (SSH keys or GITHUB_TOKEN environment variable).
Your PR has been closed or merged. Only open PRs can be processed.
Your PR has merge conflicts or other issues preventing it from being merged. Resolve conflicts and ensure the PR is in a mergeable state.
You have uncommitted changes. Commit or stash them before running the tool.
Check your GitHub token and network connection. Ensure the PR number exists.
The system automatically processes all incoming PR files during the release workflow. No manual intervention is required.
When a release is created:
incoming/*.txt files are aggregated using --process-prsversion.nix or latest git tag--ai-summarize for more professional, consistent formatting./generate_changelog --incoming-pr 1672 --token YOUR_GITHUB_TOKEN
./generate_changelog --incoming-pr 1672 --repo /path/to/repo
./generate_changelog --incoming-pr 1672 --no-cache
./generate_changelog --incoming-pr 1672 --push
This creates the commit locally and pushes it to the remote repository. By default, commits are only created locally, allowing you to review changes before pushing manually.
Authentication: The tool automatically detects GitHub repositories and uses the GITHUB_TOKEN environment variable for authentication when pushing. For SSH repositories, ensure your SSH keys are properly configured.
This system is fully backward compatible. The existing changelog generation continues to work unchanged. The new features are opt-in and only activated when using the new flags.
If you encounter issues:
./generate_changelog --helpFor bugs or feature requests, please create an issue in the repository.