Skip to content

File a cycle's changelogs as a pull request - #2103

Merged
stonebig merged 2 commits into
winpython:masterfrom
stonebig:changelog-pull-request
Sep 6, 2026
Merged

stonebig merged 2 commits into
winpython:masterfrom
stonebig:changelog-pull-request

Conversation

@stonebig

@stonebig stonebig commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Move 3 of the publishing clean-up, after #2098 (one dispatch per cycle, build publishes itself). The build already produces everything changelogs/ needs; this stops it being copied in by hand — nine package indexes, nine lock files, nine requirements, and nine _History.md written one wppm.diff call at a time.

How it works

A changelogs job takes the metadata artifacts the legs produced, files the three kinds that belong in changelogs/, writes the histories, and opens one pull request for the cycle.

The histories are written from the checkout rather than shipped by the build, because a history compares against the previous release and only the repository has that. changelog_files.py decides what goes where; wppm.diff still decides what a history says.

hashes_<winpyver>.md stays out: it describes one build's binaries rather than the release, and changelogs/ has never held one.

Whole-cycle runs only

if: inputs.publish && inputs.python_versionf == 'all'. Re-running a single leg would otherwise reduce the branch to that leg's files — and it has nothing to add anyway, since the same lockfile builds the same package list, so a rebuilt leg cannot change a changelog.

No new action

Opened with git and gh rather than a create-pull-request action. A repo that hash-pins its build inputs shouldn't take on a third-party action with contents: write and pull-requests: write for the sake of filing nine files.

Checked against the real thing

Not a mock: the 27 metadata files of the 2026-04b1 draft, run over a copy of the real changelogs/.

27 file(s) filed, 9 history file(s) written
36 new files, 0 existing files modified
history WinPythonslim-64bit-3.15.0.5b1 vs 3.15.0.4
history WinPythonslim-64bit-3.14.7.1b1 vs 3.14.7.0

The slim history lists real deltas (aiohappyeyeballs 2.6.1 → 2.7.1, new clarabel/lmfit/scipy); the dot one correctly reports no differences, bare Python being unchanged.

Testing

16 new tests, 223 in the full suite. The selection is pinned against the leg output names verbatim, and mutation-checked: widening the filter to any .md/.toml/.txt fails the two tests that say hashes stay behind, and loosening the whole-cycle gate fails the test that says a single-leg re-run must not file changelogs.

One thing that only runs for real on a dispatch: the push and gh pr create. The job is gated so it cannot fire on a publish: off or single-version run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MBk5k7WdpPvx4SUFyEk3U3

stonebig and others added 2 commits September 6, 2026 18:44
The build already produced everything changelogs/ needs, and it was still
copied in by hand: nine package indexes, nine lock files, nine
requirements, and nine _History.md written one wppm.diff call at a time.

A changelogs job now does it. It takes the metadata artifacts the legs
produced, files the three kinds that belong in changelogs/, writes the
histories from the checkout -- a history compares against the previous
release, which only the repository has -- and opens one pull request for
the cycle. changelog_files.py decides what goes where; wppm.diff still
decides what a history says.

Whole-cycle publish runs only. Re-running one leg would otherwise reduce
the branch to that leg's files, and it has nothing to add: the same
lockfile builds the same package list, so a rebuilt leg cannot change a
changelog.

Opened with git and gh rather than a third-party action, to keep a repo
that hash-pins its build inputs from taking a new action with write
permissions for the sake of nine files.

Checked against the real thing: the 27 metadata files of 2026-04 b1, run
over a copy of changelogs/, file 27 and write 9 histories against the
right baselines -- 3.15.0.5b1 against 3.15.0.4 -- adding 36 files and
modifying none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MBk5k7WdpPvx4SUFyEk3U3
changelog_files.py imported wppm and CI answered ModuleNotFoundError.
Running a script puts the script's own directory on sys.path -- here
.github/scripts -- and not the checkout root, so the import fell through
to whatever else was reachable. On a developer machine that is the
installed wppm and everything looks fine; a runner installs none, so the
step died. The workflow job would have died the same way, not just the
tests.

The path is now derived from __file__ and inserted first, so the wppm
imported is the one being released.

The tests missed it for the same reason CI caught it, so they now run the
script by absolute path from an unrelated directory, with a decoy wppm
on PYTHONPATH. The insert puts the checkout ahead of that decoy; without
it the decoy wins and the test fails, on any machine.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MBk5k7WdpPvx4SUFyEk3U3
@stonebig
stonebig merged commit f640865 into winpython:master Sep 6, 2026
2 checks passed
@stonebig
stonebig deleted the changelog-pull-request branch September 6, 2026 17: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.

1 participant