Skip to content

[BUG] report changelog without --against-ref silently empties a populated Unreleased sectionΒ #202

Description

@Verdenroz

Affected crate(s)

cargo-soothfast

Version

0.3.2

Steps to reproduce

  1. Have a repo with at least one release tag and a populated Unreleased section, e.g. ## Unreleased (draft vs v3.0.0) with ### ✨ Features / ### πŸ“¦ Dependencies / ### πŸ”§ Internal entry lists under it.
  2. Run report changelog without --against-ref:
    cargo soothfast report changelog -p <pkg> --baseline base --features full
    
  3. Read CHANGELOG.md.

In CI the flag is rarely omitted on purpose β€” it is omitted by accident. action/regen.sh passes it only when prev=$(git describe --tags --abbrev=0) is non-empty, and that depends on tags having been fetched. action/prepare.sh:33-34 unshallows with --tags only if [ "$(git rev-parse --is-shallow-repository)" = true ]. A job checked out at fetch-depth: 0 is not shallow, so that branch never runs, and actions/checkout passes --no-tags with fetch-tags defaulting to false. Any job that regenerates the changelog from a full-depth checkout therefore silently takes the no-tag path.

Expected behavior

Either the entries are preserved, or the command says out loud that it is about to replace a populated Unreleased section with one containing no commit entries β€” the way changelog_already_cut already prints when it declines to regenerate.

An initial-surface changelog is a legitimate mode for a genuine first release. The problem is that it is indistinguishable, from the command's output, from total accidental content loss.

Actual behavior

The Unreleased section is silently replaced with ## Unreleased (initial public surface) and zero commit entries. merge_changelog writes that over the real section. Nothing in stdout indicates anything was dropped; the command prints its usual report: regenerated CHANGELOG.md and exits 0.

In cargo-soothfast/src/report.rs at v0.3.2, against_ref: None takes four separate branches, three of which drop content:

  • :265 changelog_already_cut(&existing, None) β€” loses the tag comparison its own rustdoc (:403) describes as the thing that makes it discriminate.
  • :281 β†’ ApiSection::Initial(&entries) instead of the diff.
  • :300 β†’ ref_baseline = None, so the perf section becomes a point-in-time snapshot.
  • :308 β†’ changes = Vec::new(). This is the one that empties the section; merged_changes is never called at all.

Rust version

rustc 1.98.0 (88d9e12ae 2026-08-18)

Operating system

CachyOS (Linux 7.2.3), and GitHub Actions ubuntu-latest

Measurement backend (soothfast-measure issues only)

Not applicable

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions