mafw.devtools.release.notes

Release note generation utilities for MAFw releases.

This module contains the business logic for creating release notes from a markdown template, collecting git statistics, and resolving contributors.

Module Attributes

RELEASE_TEMPLATE_FILE

Path to the markdown template used to build release notes.

Functions

create_release_note(version, dry_run)

Create the release note markdown file for the given version.

get_contributors(since_ref)

Collect contributor names since the baseline reference.

get_release_note_base_ref()

Determine the git reference used as baseline for release-note metadata.

get_release_statistics(since_ref)

Collect release statistics since the baseline reference.

render_release_note_section(content, header, ...)

Replace a release-note section in the markdown template.

mafw.devtools.release.notes.create_release_note(version: str, dry_run: bool) Path[source]

Create the release note markdown file for the given version.

Change sections are copied from the generated changelog for the same version to ensure release notes stay aligned with changelog content.

Parameters:
  • version (str) – Target release version.

  • dry_run (bool) – Whether command execution is disabled.

Returns:

Path to the release note markdown file.

Return type:

Path

Raises:

DevtoolsError – If the template is missing.

mafw.devtools.release.notes.get_contributors(since_ref: str) list[str][source]

Collect contributor names since the baseline reference.

Parameters:

since_ref (str) – Baseline reference to compare against HEAD.

Returns:

Ordered list of contributor names.

Return type:

list[str]

mafw.devtools.release.notes.get_release_note_base_ref() str[source]

Determine the git reference used as baseline for release-note metadata.

Returns:

Last stable tag if available, otherwise the first commit hash.

Return type:

str

mafw.devtools.release.notes.get_release_statistics(since_ref: str) tuple[str, str][source]

Collect release statistics since the baseline reference.

Parameters:

since_ref (str) – Baseline reference to compare against HEAD.

Returns:

Commit count and short diff statistics.

Return type:

tuple[str, str]

mafw.devtools.release.notes.render_release_note_section(content: str, header: str, section_markdown: str) str[source]

Replace a release-note section in the markdown template.

If the provided section markdown is empty, the entire section (header and placeholder) is removed from the content.

Parameters:
  • content (str) – Current release note markdown text.

  • header (str) – Section header to replace.

  • section_markdown (str) – Markdown content to insert under the section header.

Returns:

Updated markdown text.

Return type:

str

Raises:

DevtoolsError – If the section header cannot be matched in template.

mafw.devtools.release.notes.RELEASE_TEMPLATE_FILE = PosixPath('.gitlab/release_templates/Default.md')

Path to the markdown template used to build release notes.