Skip to content

fix(scripts): vendor consolidated generate-changelog.py#48

Merged
brettdavies merged 1 commit into
devfrom
fix/vendor-changelog-py
Jun 5, 2026
Merged

fix(scripts): vendor consolidated generate-changelog.py#48
brettdavies merged 1 commit into
devfrom
fix/vendor-changelog-py

Conversation

@brettdavies

@brettdavies brettdavies commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

Replaces the standalone 329-line bash scripts/generate-changelog.sh with the consolidated scripts/generate-changelog.py vendored from the rust-tool-release skill in brettdavies/agent-skills. The Python version exposes the same flags ([--tag vX.Y.Z] [repo-path], --check, --dry-run) and the duplicate-section guard.

Brings this repo onto the same generator as bird, xurl-rs, and (in parallel PRs) agentnative-cli and agentnative-skill.

Doc references updated in RELEASES.md, RELEASES-RATIONALE.md, the cliff.toml pipeline comment, the publish.yml workflow comment, and three planning docs. Historical CHANGELOG.md mention of the old name is intentionally left in place.

Changelog

Changed

  • scripts/generate-changelog.py (consolidated Python) replaces scripts/generate-changelog.sh. Same flags
    ([--tag vX.Y.Z], --check, --dry-run), same git-cliff + PR-body pipeline, plus duplicate-section guard.

Documentation

  • Release docs and cliff.toml / publish.yml comments name generate-changelog.py as the entry point.

Type of Change

  • fix: Bug fix (non-breaking change which fixes an issue)
  • refactor: Code refactoring (no functional changes)

Related Issues/Stories

Files Modified

Modified:

  • .github/workflows/publish.yml: comment names the new script.
  • RELEASES.md, RELEASES-RATIONALE.md: invocation references.
  • cliff.toml: pipeline comment names the new script.
  • docs/plans/2026-04-22-003-release-infra-and-v0.2.0-cut-plan.md
  • docs/plans/2026-04-27-001-refactor-three-repo-naming-alignment-plan.md
  • docs/plans/2026-06-01-001-feat-p0-mirror-skill-pr25-changelog-dry-run-plan.md

Created:

  • scripts/generate-changelog.py: vendored from brettdavies/agent-skills/rust-tool-release/scripts/generate-changelog.py.

Renamed:

  • None.

Deleted:

  • scripts/generate-changelog.sh.

Testing

  • ./scripts/generate-changelog.py --help reflects --check, --dry-run, --tag.
  • Script invocation surface matches the bash version it replaces; no callsites other than docs and the publish.yml comment exist in this repo.

Test Summary:

  • Vendor swap only. The Python script's own behavior is covered by the upstream skill change.

Breaking Changes

  • No breaking changes

Flag surface unchanged from the bash script.

Deployment Notes

  • No special deployment steps required

Land this PR after brettdavies/agent-skills#16 so the vendored copy reflects upstream skill state.

Checklist

  • Conventional Commits
  • Self-review completed
  • No new warnings or errors
  • Backward compatible

Replaces the standalone 329-line bash script with the consolidated
Python version from `brettdavies/agent-skills` (`rust-tool-release`
skill). Same flag surface: `[--tag vX.Y.Z] [repo-path]`, `--check`,
`--dry-run`. The dry-run idempotency check and duplicate-section
guard moved into the upstream Python so the swap preserves behavior.

Doc refs updated in `RELEASES.md`, `RELEASES-RATIONALE.md`,
`cliff.toml` pipeline comment, the `publish.yml` workflow comment,
and three planning docs. Historical `CHANGELOG.md` mention of the old
name is intentionally left in place.
@brettdavies brettdavies merged commit 1016124 into dev Jun 5, 2026
@brettdavies brettdavies deleted the fix/vendor-changelog-py branch June 5, 2026 05:13
brettdavies added a commit to brettdavies/bird that referenced this pull request Jun 5, 2026
…te-section guard (#74)

## Summary

Refreshes the vendored `scripts/generate-changelog.py` to match
[`brettdavies/agent-skills#16`](brettdavies/agent-skills#16),
which added `--dry-run` and a duplicate-section guard. Bird's copy
predated the merge, so it was lagging the upstream `rust-tool-release`
skill by one feature plus one bug fix. This PR closes that gap and keeps
the fleet aligned: bird, xurl-rs, agentnative-cli, agentnative-skill,
and agentnative-spec all run the same script.

`--dry-run` runs the regen pipeline against the current `CHANGELOG.md`
in place, restores the original on exit, and exits 0 on idempotent
output or 1 with a unified diff on drift. The duplicate-section guard
short-circuits the git-cliff prepend when a `## [X.Y.Z]` heading for the
requested tag already exists (in normal mode it prints a one-line note
and exits 0; in dry-run it skips the prepend but still runs PR-body
expansion so the comparison stays meaningful). The prior behavior of
silently appending a second copy of the same section was a defect. It
was not a workflow anyone depended on.

No other files touched. `RELEASES.md` and `RELEASES-RATIONALE.md`
already named `generate-changelog.py` as the entry point.

## Changelog

### Added

- `scripts/generate-changelog.py --dry-run` idempotency check that runs
the regen pipeline against `CHANGELOG.md`, compares against the current
file, restores the original on exit, and exits 1 with a unified diff if
regeneration would drift.

### Fixed

- `scripts/generate-changelog.py` no longer prepends a duplicate `##
[X.Y.Z]` section when one already exists for the requested tag.

## Type of Change

- [x] `feat`: New feature (non-breaking change which adds functionality)
- [x] `fix`: Bug fix (non-breaking change which fixes an issue)

## Related Issues/Stories

- Story: n/a
- Issue: n/a
- Architecture: keeps the vendored copy aligned with the upstream
`rust-tool-release` skill (PR `brettdavies/agent-skills#16`).
- Related PRs:
[brettdavies/agent-skills#16](brettdavies/agent-skills#16),
[brettdavies/agentnative-cli#85](brettdavies/agentnative-cli#85),
[brettdavies/agentnative-skill#31](brettdavies/agentnative-skill#31),
[brettdavies/agentnative#48](brettdavies/agentnative#48).

## Files Modified

**Modified:**

- `scripts/generate-changelog.py`: re-vendored from
`brettdavies/agent-skills/rust-tool-release/scripts/generate-changelog.py`.

**Created, Renamed, Deleted:**

- None.

## Testing

- [x] `./scripts/generate-changelog.py --help` reflects `--check`,
`--dry-run`, `--tag`.
- [x] `./scripts/generate-changelog.py --dry-run --tag v0.1.3` (section
exists in `CHANGELOG.md`): exits 0 with "no regen drift"; original
`CHANGELOG.md` hash unchanged.
- [x] `./scripts/generate-changelog.py --dry-run --tag v0.2.0` (section
not in dev's `CHANGELOG.md`; only on `main`): exits 1 with a unified
diff showing the would-be regeneration; original hash unchanged. Drift
is the correct behavior here because dev's CHANGELOG legitimately
doesn't carry the `[0.2.0]` heading yet.

**Test Summary:**

- No Rust source changed. CI re-runs cargo gates on push regardless.

## Breaking Changes

- [x] No breaking changes

Flag surface (`--check`, `--tag`, positional repo path) preserved. New
`--dry-run` flag is additive. The duplicate-section guard is a behavior
change in normal mode that prevents a silent defect.

## Deployment Notes

- [x] No special deployment steps required

## Checklist

- [x] Conventional Commits
- [x] Self-review completed
- [x] No new warnings or errors
- [x] Backward compatible
brettdavies added a commit to brettdavies/dotfiles that referenced this pull request Jun 5, 2026
## Summary

Updates the global PR template's `## Changelog` section comment to name
`generate-changelog.py` instead of the retired `generate-changelog.sh`
bash wrapper. Repos without their own `.github/pull_request_template.md`
fall back to this file, so the comment is the first thing a contributor
in a fresh brettdavies repo sees when opening a PR.

The fleet (bird, xurl-rs, agentnative-cli, agentnative-skill,
agentnative-spec) all ship the consolidated Python entry point now,
vendored from the `rust-tool-release` skill.

## Changelog

### Documentation

- Global PR template comment under `## Changelog` names
`generate-changelog.py` as the script that parses the categorized
bullets at release time.

## Type of Change

- [x] `docs`: Documentation update

## Related Issues/Stories

- Story: n/a
- Issue: n/a
- Architecture: catches up the global fallback template after
`brettdavies/agent-skills#16` retired the bash wrapper upstream.
- Related PRs:
[brettdavies/agent-skills#16](brettdavies/agent-skills#16),
[brettdavies/agentnative-cli#85](brettdavies/agentnative-cli#85),
[brettdavies/agentnative-skill#31](brettdavies/agentnative-skill#31),
[brettdavies/agentnative#48](brettdavies/agentnative#48).

## Files Modified

**Modified:**

- `stow/github/dot-config/github/pull_request_template.md`: one-word
rename in the `## Changelog` comment.

**Created, Renamed, Deleted:**

- None.

## Testing

- [x] Local stow target (`~/.config/github/pull_request_template.md`)
reflects the rename via the existing symlink.

## Breaking Changes

- [x] No breaking changes

Comment text only; no behavior change.

## Deployment Notes

- [x] No special deployment steps required

`stow` re-applies the symlink target on next sync; no fresh `stow`
invocation required since the file is already linked.

## Checklist

- [x] Conventional Commits
- [x] Self-review completed
- [x] No new warnings or errors
- [x] Backward compatible
brettdavies added a commit to brettdavies/xurl-rs that referenced this pull request Jun 5, 2026
…te-section guard (#57)

## Summary

Refreshes the vendored `scripts/generate-changelog.py` to match
[`brettdavies/agent-skills#16`](brettdavies/agent-skills#16),
which added `--dry-run` and a duplicate-section guard. xurl-rs's copy
predated the merge by a few hours and was lagging the upstream
`rust-tool-release` skill by one feature plus one bug fix. This PR
closes that gap and keeps the fleet aligned: bird, xurl-rs,
agentnative-cli, agentnative-skill, and agentnative-spec all run the
same script.

`--dry-run` runs the regen pipeline against the current `CHANGELOG.md`
in place, restores the original on exit, and exits 0 on idempotent
output or 1 with a unified diff on drift. The duplicate-section guard
short-circuits the git-cliff prepend when a `## [X.Y.Z]` heading for the
requested tag already exists (in normal mode it prints a one-line note
and exits 0; in dry-run it skips the prepend but still runs PR-body
expansion so the comparison stays meaningful). The prior behavior of
silently appending a second copy of the same section was a defect, not a
workflow anyone depended on.

No other files touched. `RELEASES.md`, `RELEASES-RATIONALE.md`, and the
PR template already named `generate-changelog.py` after PR #55 landed.

## Changelog

### Added

- `scripts/generate-changelog.py --dry-run` idempotency check that runs
the regen pipeline against `CHANGELOG.md`, compares against the current
file, restores the original on exit, and exits 1 with a unified diff if
regeneration would drift.

### Fixed

- `scripts/generate-changelog.py` no longer prepends a duplicate `##
[X.Y.Z]` section when one already exists for the requested tag.

## Type of Change

- [x] `feat`: New feature (non-breaking change which adds functionality)
- [x] `fix`: Bug fix (non-breaking change which fixes an issue)

## Related Issues/Stories

- Story: n/a
- Issue: n/a
- Architecture: keeps the vendored copy aligned with the upstream
`rust-tool-release` skill (PR `brettdavies/agent-skills#16`).
- Related PRs:
[brettdavies/agent-skills#16](brettdavies/agent-skills#16),
[brettdavies/bird#74](brettdavies/bird#74),
[brettdavies/agentnative-cli#85](brettdavies/agentnative-cli#85),
[brettdavies/agentnative-skill#31](brettdavies/agentnative-skill#31),
[brettdavies/agentnative#48](brettdavies/agentnative#48).

## Files Modified

**Modified:**

- `scripts/generate-changelog.py`: re-vendored from
`brettdavies/agent-skills/rust-tool-release/scripts/generate-changelog.py`.

**Created, Renamed, Deleted:**

- None.

## Testing

- [x] `./scripts/generate-changelog.py --help` reflects `--check`,
`--dry-run`, `--tag`.
- [x] `./scripts/generate-changelog.py --dry-run --tag v1.2.0` (most
recent section in `CHANGELOG.md`): exits 0 with "no regen drift";
original `CHANGELOG.md` hash unchanged.

**Test Summary:**

- No Rust source changed. CI re-runs cargo gates on push regardless.

## Breaking Changes

- [x] No breaking changes

Flag surface (`--check`, `--tag`, positional repo path) preserved. New
`--dry-run` flag is additive. The duplicate-section guard is a behavior
change in normal mode that prevents a silent defect.

## Deployment Notes

- [x] No special deployment steps required

## Checklist

- [x] Conventional Commits
- [x] Self-review completed
- [x] No new warnings or errors
- [x] Backward compatible
brettdavies added a commit to brettdavies/xurl-rs that referenced this pull request Jun 5, 2026
…te-section guard (#57)

## Summary

Refreshes the vendored `scripts/generate-changelog.py` to match
[`brettdavies/agent-skills#16`](brettdavies/agent-skills#16),
which added `--dry-run` and a duplicate-section guard. xurl-rs's copy
predated the merge by a few hours and was lagging the upstream
`rust-tool-release` skill by one feature plus one bug fix. This PR
closes that gap and keeps the fleet aligned: bird, xurl-rs,
agentnative-cli, agentnative-skill, and agentnative-spec all run the
same script.

`--dry-run` runs the regen pipeline against the current `CHANGELOG.md`
in place, restores the original on exit, and exits 0 on idempotent
output or 1 with a unified diff on drift. The duplicate-section guard
short-circuits the git-cliff prepend when a `## [X.Y.Z]` heading for the
requested tag already exists (in normal mode it prints a one-line note
and exits 0; in dry-run it skips the prepend but still runs PR-body
expansion so the comparison stays meaningful). The prior behavior of
silently appending a second copy of the same section was a defect, not a
workflow anyone depended on.

No other files touched. `RELEASES.md`, `RELEASES-RATIONALE.md`, and the
PR template already named `generate-changelog.py` after PR #55 landed.

## Changelog

### Added

- `scripts/generate-changelog.py --dry-run` idempotency check that runs
the regen pipeline against `CHANGELOG.md`, compares against the current
file, restores the original on exit, and exits 1 with a unified diff if
regeneration would drift.

### Fixed

- `scripts/generate-changelog.py` no longer prepends a duplicate `##
[X.Y.Z]` section when one already exists for the requested tag.

## Type of Change

- [x] `feat`: New feature (non-breaking change which adds functionality)
- [x] `fix`: Bug fix (non-breaking change which fixes an issue)

## Related Issues/Stories

- Story: n/a
- Issue: n/a
- Architecture: keeps the vendored copy aligned with the upstream
`rust-tool-release` skill (PR `brettdavies/agent-skills#16`).
- Related PRs:
[brettdavies/agent-skills#16](brettdavies/agent-skills#16),
[brettdavies/bird#74](brettdavies/bird#74),
[brettdavies/agentnative-cli#85](brettdavies/agentnative-cli#85),
[brettdavies/agentnative-skill#31](brettdavies/agentnative-skill#31),
[brettdavies/agentnative#48](brettdavies/agentnative#48).

## Files Modified

**Modified:**

- `scripts/generate-changelog.py`: re-vendored from
`brettdavies/agent-skills/rust-tool-release/scripts/generate-changelog.py`.

**Created, Renamed, Deleted:**

- None.

## Testing

- [x] `./scripts/generate-changelog.py --help` reflects `--check`,
`--dry-run`, `--tag`.
- [x] `./scripts/generate-changelog.py --dry-run --tag v1.2.0` (most
recent section in `CHANGELOG.md`): exits 0 with "no regen drift";
original `CHANGELOG.md` hash unchanged.

**Test Summary:**

- No Rust source changed. CI re-runs cargo gates on push regardless.

## Breaking Changes

- [x] No breaking changes

Flag surface (`--check`, `--tag`, positional repo path) preserved. New
`--dry-run` flag is additive. The duplicate-section guard is a behavior
change in normal mode that prevents a silent defect.

## Deployment Notes

- [x] No special deployment steps required

## Checklist

- [x] Conventional Commits
- [x] Self-review completed
- [x] No new warnings or errors
- [x] Backward compatible
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.

1 participant