rlsbl v0.113.0 /rlsbl.changelog.home
On this page

Single source of truth for where generated CHANGELOG.md files live, resolving the correct directory for standalone, implicit, and releasable modes.

#rlsbl.changelog.home

#rlsbl.changelog.home

Single source of truth for where generated CHANGELOG.md files live, resolving the correct directory for standalone, implicit, and releasable modes.

Three consumers previously disagreed about the changelog home in explicit releasable mode: the release flow wrote CHANGELOG.md into the representative member's directory, rlsbl changelog generate wrote it into the releasable's directory, and the changelog-entry check expected the releasable's directory. This module is the ONE resolver all of them (plus undo and the GitHub-Release-notes hint) must go through.

Semantics:

  • Standalone projects (no releasable): the canonical CHANGELOG.md lives at

the project root, exactly as before.

  • Releasable members (explicit monorepo mode): the canonical CHANGELOG.md

lives in the releasable's state directory (.rlsbl-monorepo/releasables/<name>/CHANGELOG.md). Additionally, a combined root CHANGELOG.md at the workspace root covers ALL releasables of the workspace, one section per releasable in workspace.toml order.

#get_changelog_home

python
def get_changelog_home(project_dir: str, *, releasable_dir: str | None=None) -> str

Return the canonical CHANGELOG.md path.

releasable_dir is the releasable's state directory (.rlsbl-monorepo/releasables/<name>/); when given, the canonical changelog lives there. Otherwise it lives at the project root.

#get_workspace_changelog_path

python
def get_workspace_changelog_path(workspace_root: str) -> str

Return the path of the combined root CHANGELOG.md for a workspace.

#_strip_canonical_header

python
def _strip_canonical_header(content: str) -> str

Strip the generated-file comment and the '# Changelog' H1 from a canonical per-releasable changelog, leaving only the version sections.

#generate_workspace_changelog

python
def generate_workspace_changelog(workspace_root: str, *, write_to_disk: bool=True) -> str

Generate the combined root CHANGELOG.md covering all releasables.

Reads each releasable's canonical CHANGELOG.md (in workspace.toml order), strips its header, and emits it under a top-level heading named after the releasable. Releasables without a canonical changelog on disk are omitted. For a single-releasable workspace this yields that releasable's changelog at the root (under its name heading).

Returns the generated content. When write_to_disk is True, writes it to the workspace root (skipping the write if content is unchanged).

Search