Skip to main content

ChangelogBuilder

The ChangelogBuilder 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:
  1. Breaking Changes
  2. Features
  3. Bug Fixes
  4. Performance
  5. Documentation
  6. Refactoring
  7. Tests
  8. Build
  9. CI/CD
  10. Chores
  11. 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 number
  • release_date: datetime - Release date
  • sections: List[ChangelogSection] - Organized sections
  • metadata: Dict[str, Any] - Additional metadata

Complete example


Changelog data model

Changelog

ChangelogSection

ChangelogItem


Next steps

Git client

Learn about fetching commits

Formatters

Render changelogs in different formats

Python API

Complete API reference

Examples

See practical usage examples