Skip to content

Add changelog subcommands: preview and check - #120

Merged
ericof merged 2 commits into
mainfrom
issue-116
Dec 3, 2026
Merged

ericof merged 2 commits into
mainfrom
issue-116

Conversation

@ericof

@ericof ericof commented Dec 3, 2026

Copy link
Copy Markdown
Member

repoplone changelog becomes a command group, with two subcommands.

changelog preview (breaking)

This is the old repoplone changelog, unchanged. Running repoplone changelog without a subcommand now shows help instead of the draft, so any script still calling it needs updating.

changelog check

The command reports, for each area of a repository, whether the current branch changed it and whether it added a news fragment for it. An area is each package, plus the repository itself when [repository.towncrier] is set.

┃ Area                ┃ Path                   ┃ Requires a fragment ┃ Has a fragment ┃
│ @acme/aurora-videos │ packages/aurora-videos │         ✅          │       ❌       │
│ repository          │ .                      │         ➖          │       ➖       │
  • Requires a fragment: a changed file belongs to the most specific area holding it, so the repository area only gets files that no package holds. Files inside a news folder are never changes that need news.
  • Has a fragment: a file added to the area's news folder counts if towncrier accepts its name as a fragment and it still exists, so .gitkeep and deleted fragments don't count.
  • Which changes: what the branch changed since its merge base with --compare-with (default origin/main), plus uncommitted and untracked files. A branch that is behind main does not pick up main's own changes, and a moved file counts in both areas.
  • Exit code: 1 when any area misses a fragment.
  • Outputs:
    • --json prints the report as JSON.
    • --github prints the step outputs missing and areas, plus a Markdown summary for the step summary.

towncrier check can't tell which areas changed: it only answers whether one news folder received a fragment. That's why repoplone matches files to areas itself and uses towncrier only to read each config and parse fragment names.

The changelog.yml workflow now runs the checked-out command with --github and copies the summary to the run page. This PR is its first real run.

Closes #116

repoplone changelog becomes a command group, like settings: the draft is printed by changelog preview, and changelog alone shows the help.
repoplone changelog check reports, for each area of a repository (each
package and the repository itself), whether the current branch changed it
and whether it added a news fragment for it. A changed file belongs to the
most specific area holding it; files in a news folder are never changes
that need news. Changes are counted from the merge base with the branch
given by --compare-with, plus uncommitted and untracked files.

The command exits with 1 when an area misses a fragment. --json prints the
report as JSON, and --github prints GitHub Actions step outputs with a
Markdown summary. The changelog workflow now uses it.
@ericof
ericof requested a review from a team as a code owner December 3, 2026 15:15
@ericof ericof self-assigned this Dec 3, 2026
@ericof
ericof merged commit 76e5805 into main Dec 3, 2026
9 checks passed
@ericof
ericof deleted the issue-116 branch December 3, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add subcommands to changelog

1 participant