Skip to content

Feature: Fine-grained changelog generation via CLI flags #13

@mikhailovdv

Description

@mikhailovdv

Description

Provide precise control over changelog creation during version generation.

Add new console flags to calaf make so that, for any release type (stable, rc, beta, alpha, nightly), the user can decide whether to generate a changelog and whether to include changes from pre-release tags in the range.

New/Updated Flags

--changelog
When present, Calaf generates a changelog for the current release.

--include-prerelease
Applies only when --changelog is used. If set, the changelog range starts at the nearest previous stable tag; otherwise it starts at the nearest previous tag of any kind (stable or pre-release).
⚠️ If earlier pre-releases already generated their own changelogs, enabling --include-prerelease may surface duplicated entries. This is expected.

Ranging Rules (git tag → tag)

  • With --include-prerelease: prev_stable_tag … current_tag
  • Without --include-prerelease: prev_any_tag … current_tag
  • If no suitable previous tag exists, start from the repository root (first commit).

Output

  • Prepend changes to CHANGELOG.md (create if missing) and echo the section to stdout.
  • The release commit includes the CHANGELOG update when --changelog is used.

Benefits

  • Explicit, predictable control over when and how changelogs are produced.
  • Aligns release notes with real-world workflows (pre-release notes vs. consolidated stable notes).
  • No changes to versioning behavior unless flags are used.

Acceptance Criteria

** Functional Requirements**

  • calaf make <type> --changelog generates a changelog section for the computed range.

  • --include-prerelease alters only the changelog range selection (not versioning).

  • Behavior is consistent across all release types: stable, rc, beta, alpha, nightly.

  • Range Selection Examples

Current: 2025.9.1-rc.1

--changelog --include-prerelease → range from nearest previous stable (e.g., 2025.9.02025.9.1-rc.1).
--changelog (no include) → range from nearest previous tag of any kind (e.g., 2025.9.1-beta.32025.9.1-rc.1).

Current: 2025.9.1

--changelog --include-prerelease → consolidates all pre-release changes since last stable (e.g., 2025.9.02025.9.1), duplicates allowed.
--changelog (no include) → uses nearest previous tag (e.g., 2025.9.1-rc.12025.9.1).

Technical Requirements

  • Implement range resolution via git tags honoring Calaf’s version/tag conventions.
  • Prepend-only write to CHANGELOG.md with atomic file update semantics.
  • Release commit includes: version bumps (csproj/fsproj) and updated CHANGELOG.md.
  • Tag annotation may include the generated changelog excerpt when --changelog is used.
  • No changes to SemVer/precedence logic.

Quality Requirements

  • All unit/integration tests pass; new tests cover:

    • Range selection (stable vs any-tag).
    • Presence/absence of duplicates with --include-prerelease.
    • Prepend-only file update semantics.
  • Code coverage ≥ current baseline.

  • No performance regression for repositories with large histories.

  • No new compiler warnings.

  • README updated with usage examples and caveats.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions