Skip to content

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

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

fix(scripts): vendor consolidated generate-changelog.py#85
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 the bash script did ([--tag vX.Y.Z] [repo-path], --check, --dry-run) plus the duplicate-section guard that prevents re-running against an already-released tag from prepending a second copy of the section.

Brings this repo onto the same generator as bird and xurl-rs. The swap closes a fleet inconsistency where each repo carried its own copy of the bash; future improvements land in the upstream skill once and ride into each consumer via re-vendoring.

Doc references updated in RELEASES.md, RELEASES-RATIONALE.md, .github/pull_request_template.md, and four planning docs that named the script. Historical CHANGELOG.md mentions of the old name are intentionally left in place.

Changelog

Changed

  • scripts/generate-changelog.py (consolidated Python) replaces the standalone bash 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 (RELEASES.md, RELEASES-RATIONALE.md) and PR template 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

  • Story: n/a
  • Issue: n/a
  • Architecture: depends on brettdavies/agent-skills#16, which ports --dry-run and the duplicate-section guard to the upstream Python.
  • Related PRs: parallel vendoring PRs for agentnative-skill and agentnative-spec follow.

Files Modified

Modified:

  • .github/pull_request_template.md: PR template ## Changelog comment names the new script.
  • RELEASES.md, RELEASES-RATIONALE.md: invocation references.
  • docs/plans/2026-04-02-002-feat-release-infrastructure-plan.md
  • docs/plans/2026-04-28-001-feat-show-hn-launch-readiness-plan.md
  • docs/plans/2026-05-07-001-feat-v0.4.0-spec-sync-plan.md
  • docs/plans/2026-06-01-001-feat-p0-mirror-skill-pr25-sync-preconditions-and-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 all three flags (--check, --dry-run, --tag).
  • ./scripts/generate-changelog.py --dry-run --tag v0.0.1 (non-existent tag) exits 1 and restores original CHANGELOG.md unchanged.

Test Summary:

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

Breaking Changes

  • No breaking changes

Flag surface (--check, --tag, --dry-run, positional repo path) is unchanged from the bash script.

Deployment Notes

  • No special deployment steps required

Land this PR after brettdavies/agent-skills#16 to keep the vendored copy aligned with the upstream skill.

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 flags: `[--tag vX.Y.Z] [repo-path]`, `--check`,
`--dry-run` — the Python equivalent carries the dry-run idempotency
check the bash version already exposed, plus the duplicate-section
guard.

Doc references updated in `RELEASES.md`, `RELEASES-RATIONALE.md`, the
PR template's `## Changelog` comment, and four in-progress plan docs.
Historical `CHANGELOG.md` mentions of the old name are intentionally
left in place.
brettdavies added a commit to brettdavies/agentnative that referenced this pull request Jun 5, 2026
## 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

- [x] `fix`: Bug fix (non-breaking change which fixes an issue)
- [x] `refactor`: Code refactoring (no functional changes)

## Related Issues/Stories

- Story: n/a
- Issue: n/a
- Architecture: depends on
[brettdavies/agent-skills#16](brettdavies/agent-skills#16),
which ports `--dry-run` and the duplicate-section guard to the upstream
Python so the swap preserves parity.
- Related PRs:
[brettdavies/agentnative-cli#85](brettdavies/agentnative-cli#85),
[brettdavies/agentnative-skill#31](brettdavies/agentnative-skill#31).

## 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

- [x] `./scripts/generate-changelog.py --help` reflects `--check`,
`--dry-run`, `--tag`.
- [x] 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

- [x] No breaking changes

Flag surface unchanged from the bash script.

## Deployment Notes

- [x] No special deployment steps required

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

## Checklist

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

Replaces the standalone 357-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.

Special care for this repo: `scripts/sync-dev-after-release.sh` actively
calls `--dry-run` as a post-backport idempotency check. The sync script
is updated in the same commit to call `scripts/generate-changelog.py
--dry-run` (same invocation, new file name). Verified locally that the
dry-run against the current `v0.5.0` section reports no drift and
preserves `CHANGELOG.md` unchanged.

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

Doc references updated in `RELEASES.md`, `RELEASES-RATIONALE.md`,
`CONTRIBUTING.md`, `AGENTS.md`, `README.md`,
`.github/pull_request_template.md`, and one planning doc. Historical
`CHANGELOG.md` and `spec/CHANGELOG.md` mentions of the old name are
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.
- `scripts/sync-dev-after-release.sh` calls the new
`generate-changelog.py` for its post-sync idempotency check.

### Documentation

- Release docs, contributor docs, agent docs, README, and PR template
name `generate-changelog.py` as the entry point.

## Type of Change

- [x] `fix`: Bug fix (non-breaking change which fixes an issue)
- [x] `refactor`: Code refactoring (no functional changes)

## Related Issues/Stories

- Story: n/a
- Issue: n/a
- Architecture: depends on
[brettdavies/agent-skills#16](brettdavies/agent-skills#16),
which ports `--dry-run` and the duplicate-section guard to the upstream
Python so the swap preserves parity.
- Related PRs: parallel vendoring PR for `agentnative-cli` is
[brettdavies/agentnative-cli#85](brettdavies/agentnative-cli#85);
`agentnative-spec` follows.

## Files Modified

**Modified:**

- `.github/pull_request_template.md`
- `AGENTS.md`, `CONTRIBUTING.md`, `README.md`
- `RELEASES.md`, `RELEASES-RATIONALE.md`
- `docs/plans/2026-05-01-001-feat-skill-determinism-hardening-plan.md`
- `scripts/sync-dev-after-release.sh`: post-sync idempotency check
invokes the new Python entry point.

**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

- [x] `./scripts/generate-changelog.py --help` reflects `--check`,
`--dry-run`, `--tag`.
- [x] `./scripts/generate-changelog.py --dry-run --tag v0.5.0` exits 0
with "CHANGELOG.md is current (no regen drift)"; original `CHANGELOG.md`
hash unchanged.

**Test Summary:**

- No code shipped beyond the vendored script and the one-line caller
rename. Skill-side tests cover the new Python entry point upstream.

## Breaking Changes

- [x] No breaking changes

`sync-dev-after-release.sh`'s contract is unchanged; only the file it
shells out to is renamed.

## Deployment Notes

- [x] No special deployment steps required

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

## Checklist

- [x] Conventional Commits
- [x] Self-review completed
- [x] No new warnings or errors
- [x] Backward compatible
@brettdavies brettdavies merged commit 18afad0 into dev Jun 5, 2026
8 checks passed
@brettdavies brettdavies deleted the fix/vendor-changelog-py branch June 5, 2026 05:15
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