Skip to content

Make the changelog fragment check accept only fragments the release reads #4114

Closed

Description

@anth-volk

Problem

On 2026-10-28, #4084 added its changelog fragment as changelog.d/added/4083.md, in a subfolder and named after its issue.

  • The PR check passed it. .github/scripts/check_changelog_fragment.sh runs find changelog.d -type f ! -name '.gitkeep' | wc -l, so it counts every file anywhere under changelog.d/.
  • The release then stopped. The versioning job in .github/workflows/push.yml runs .github/bump_version.py, which reads only files directly in changelog.d/ and takes the type from names like <name>.<type>.md. It printed "No changelog fragments found" and exited with status 1. Move the live-since changelog fragment to the flat name the version bump reads #4106 renamed the file to changelog.d/report-live-since.added.md.

Two more gaps:

  • The check also counts fragments that earlier PRs left on master, which stay there until the next release. A PR that adds no fragment of its own passes whenever master has a pending one.
  • [tool.towncrier] in pyproject.toml has no ignore setting. Without it, the Towncrier version locked in uv.lock (25.8.0) skips files in subfolders and files with unknown types without failing, and writes an empty fragment as an empty bullet.

Change

  • One definition of a valid fragment, in a tested Python module that both the PR check and .github/bump_version.py use. It reads the fragment directory and the types from [tool.towncrier].
  • The PR check fails unless the PR itself, relative to its base commit, adds at least one non-empty file changelog.d/<name>.<type>.md directly in changelog.d/, with one of the configured types. Subfolders, other names, unknown types and empty or whitespace-only files fail, each with a message that says what to change.
  • The version bump fails on any file in changelog.d/ it can't read, instead of skipping it, and refuses to run if its bump table and the configured types disagree. ignore = [".gitkeep"] makes Towncrier fail on such files too.
  • The rule api.process.changelog-fragment and the docs state the accepted form.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions