rlsbl v0.92.0 /rlsbl.commands.changelog_cmd
On this page

Changelog subcommands for adding entries with duplicate detection, amending released versions, and generating Markdown from JSONL.

#rlsbl.commands.changelog_cmd

#rlsbl.commands.changelog_cmd

Changelog subcommands for adding new entries, amending released versions, and generating Markdown changelogs from JSONL sources.

#_ResolvedContext

Carries project, releasable, and workspace info for changelog commands.

#is_releasable

python
def is_releasable(self)

#name

python
def name(self)

#get

python
def get(self, key, default=None)

#_resolve_workspace_project

python
def _resolve_workspace_project(project_root)

Resolve the WorkspaceProject for project_root, or None in standalone mode.

Also checks and exits if the project is non-releasable. Returns a _ResolvedContext with releasable info when in explicit mode.

#_check_project_scope

python
def _check_project_scope(resolved_commits, ws_context)

Verify all commits touch files belonging to the project or releasable.

Hard error if any commit does not touch the project's files. In explicit releasable mode, checks against all member projects. Skipped when ws_context is None (standalone mode).

#_check_duplicate_commits

python
def _check_duplicate_commits(existing_entries, new_entry)

Check if any commits in new_entry already appear in existing entries.

Hard error when a commit appears in an existing entry with the same user_facing value and type. Warning when the types differ (legitimate case: one commit spanning multiple changelog types).

#_build_entry

python
def _build_entry(flags, resolved_commits)

Build and validate a ChangelogEntry from CLI flags and resolved commits.

Reads user_facing, description, type, and release_type from flags. Validates that user-facing entries have description and type. Returns a validated ChangelogEntry.

#_resolve_changes_dir

python
def _resolve_changes_dir(ws_context, project_root)

Return the appropriate changes directory based on context.

In explicit releasable mode, returns the releasable's changes dir. Otherwise, returns the per-project changes dir.

#_derive_packages_from_commits

python
def _derive_packages_from_commits(resolved_commits, member_projects)

Derive the list of affected package names from commit file paths.

For each commit, checks which member projects have files touched. Returns a sorted, deduplicated list of project names, or None if there are no member projects to check against.

#cmd_add

python
def cmd_add(flags, project_root)

Add a changelog entry to unreleased.jsonl.

Required flags:

  • --commits: comma-separated commit hashes
  • --description and --type: required unless --no-user-facing is set

#cmd_generate

python
def cmd_generate(flags, project_root)

Generate CHANGELOG.md from JSONL changelog files.

#cmd_amend

python
def cmd_amend(flags, project_root)

Amend a released version's JSONL changelog by appending a new entry.

Unlocks the read-only versioned JSONL file, appends the entry, re-locks it, regenerates CHANGELOG.md, and optionally syncs GitHub Release notes.

Required flags:

  • --version: which released version to amend (e.g., "0.39.0")
  • --commits: comma-separated commit hashes

Optional flags:

  • --description and --type: required unless --no-user-facing is set
  • --no-user-facing: mark entry as non-user-facing
  • --no-resolve: skip hash validation (for old/amended commits)

#cmd_edit

python
def cmd_edit(flags, project_root)

Edit an existing changelog entry in unreleased or released JSONL files.

Finds the entry by commit hash, applies field changes, and rewrites the file atomically. For released files, temporarily unlocks the read-only file, regenerates CHANGELOG.md, and syncs GitHub Release notes.

Required flags:

  • --commits: comma-separated commit hashes identifying the target entry

At least one edit flag required:

  • --type: new type value (feature, fix, breaking)
  • --description: new description text
  • --no-user-facing: set user_facing=false, clear description and type
  • --user-facing: set user_facing=true

#_sync_github_release

python
def _sync_github_release(version: str) -> None

Sync GitHub Release notes for a version (best-effort, warns on failure).

#_get_generated_files

python
def _get_generated_files(project_path: str) -> list[str]

Return paths of files modified or created by generate_changelog.

Checks git status for CHANGELOG.md and .rlsbl/changes/*.md files.