ChangelogBuilder
TheChangelogBuilder class transforms raw commit data into structured changelog objects.
Constructor
Parameters
BaseSummarizer
Optional AI summarizer for enhancing commit descriptions.Pass
None to disable AI summarization.List[str]
Custom ordering for changelog sections.Default order:
- Breaking Changes
- Features
- Bug Fixes
- Performance
- Documentation
- Refactoring
- Tests
- Build
- CI/CD
- Chores
- Style
bool
default:"true"
Whether to include commit scopes in output.
bool
default:"true"
Whether to deduplicate pull requests across commits.
build() method
Generate a structured changelog from commits.Parameters
str
Version number for the release (e.g., “v2.0.0”).
datetime
required
Date and time of the release.
List[CommitInfo]
required
List of commits to include in the changelog.
Dict[str, List[PullRequestInfo]]
Mapping of commit SHAs to associated pull requests.
Dict[int, PullRequestInfo]
Mapping of PR numbers to PR information.
Callable[[str, str, bool], None]
Optional handler to receive incremental streaming chunks from an AI summarizer. The handler is called as
handler(identifier, chunk, final) where identifier is the summary id, chunk is a piece of text, and final is a boolean set to True on the last chunk. When provided, summarization will stream chunks to the handler; final summaries are still returned in the resulting Changelog object.Returns
Changelog
Structured changelog object containing:
version: Optional[str]- Version numberrelease_date: datetime- Release datesections: List[ChangelogSection]- Organized sectionsmetadata: Dict[str, Any]- Additional metadata