Collect scriv changelog fragments at release and backfill CHANGELOG.md - #81
Open
blarghmatey wants to merge 5 commits into
Open
blarghmatey wants to merge 5 commits into
blarghmatey wants to merge 5 commits into
Conversation
blarghmatey
added a commit
to mitodl/ol-concourse
that referenced
this pull request
Sep 30, 2026
The bump-my-version pre_commit_hooks added in mitodl/ol-analytics-api#81 run in this image during bump_version_task and call `uv run --frozen --only-group release`. The image has no uv, so the hook first runs `python3 -m pip install uv`, which pulls an unpinned uv at release time, outside the lockfile hashes and the repo's exclude-newer window. Copying a digest-pinned uv into the image lets that hook step be dropped, and Renovate's dockerfile manager keeps the tag and digest current. Claude-Session: https://claude.ai/code/session_01VaJ4VtbQFPV63VWtQV6JEg
Releases are cut by the ol-concourse release job, which runs `bump-my-version bump --no-commit` and then commits with `git add -u`. This adds a bump-my-version pre-commit hook that installs uv and runs bin/collect-changelog, which folds changelog.d/ fragments into CHANGELOG.md under the new version. A release with no fragments is a no-op rather than an error, because `scriv collect` exits 2 in that case and would otherwise fail Renovate-only releases. Claude-Session: https://claude.ai/code/session_01VaJ4VtbQFPV63VWtQV6JEg
Reconstructed from the commits and PRs between each CalVer tag, 2026.7.22.1 through 2026.9.30.1. The file has to be tracked before the first scriv release because the release resource stages with `git add -u`. Claude-Session: https://claude.ai/code/session_01VaJ4VtbQFPV63VWtQV6JEg
mitodl/ol-concourse-dsl ships uv since mitodl/ol-concourse#111, so the hook no longer needs to install an unpinned uv from PyPI at release time. Claude-Session: https://claude.ai/code/session_01VaJ4VtbQFPV63VWtQV6JEg
blarghmatey
force-pushed
the
scriv-changelog
branch
from
September 30, 2026 14:53
728226d to
296dcc9
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The release-critical collection branches need automated coverage, alongside the smaller configuration and wording corrections.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds Scriv-based changelog fragments and release-time collection, with historical releases backfilled.
Changes:
- Configures Scriv and release dependencies.
- Adds a release hook that safely handles empty fragment directories.
- Documents the workflow and backfills release history.
| File | Description |
|---|---|
README.md |
Documents changelog fragments. |
CHANGELOG.md |
Backfills historical releases. |
bin/collect-changelog |
Collects fragments during releases. |
changelog.d/.gitkeep |
Preserves the fragment directory. |
changelog.d/20260930_101301_blarghmatey_scriv_changelog.md |
Describes this feature. |
pyproject.toml |
Configures Scriv and the release hook. |
uv.lock |
Locks Scriv and dependencies. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
`output_file` is a deprecated alias for `changelog` in scriv 1.8.0. The fragment claimed every PR adds one, which nothing enforces. Claude-Session: https://claude.ai/code/session_01VaJ4VtbQFPV63VWtQV6JEg
The release hook fails the release if this script fails, so run it against the repo's real scriv config with and without fragments. Claude-Session: https://claude.ai/code/session_01VaJ4VtbQFPV63VWtQV6JEg
Member
Author
|
Added tests/test_collect_changelog.py in 3254426 for the review's coverage note. It runs bin/collect-changelog against the repo's real scriv config with and without fragments. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What are the relevant tickets?
N/A
Description (What does it do?)
This repo has no changelog, and the release job's commit is only a version bump. This adds scriv fragments that are collected into
CHANGELOG.mdwhen a release is cut.uv run scriv createwrites a fragment underchangelog.d/(Keep a Changelog categories). The README has a short section on it.bump-my-version bump --no-commitin theol-concourse-dslimage (uv since Add a digest-pinned uv to the ol-concourse-dsl image ol-concourse#111, no scriv), then the release resource commits withgit add -u. A bump-my-versionpre_commit_hooksentry runsbin/collect-changelogthroughuv run --frozen --only-group release. bump-my-version runs pre-commit hooks under--no-committoo, afterpyproject.tomlhas the new version, which is where scriv reads it from.bin/collect-changelogwrapsscriv collectso an emptychangelog.d/is a no-op.scriv collectexits 2 with no fragments, which would fail a Renovate-only release.releasedependency group (included indev) so the release task installs only scriv from the lockfile.CHANGELOG.mdis backfilled for 2026.7.22.1 through 2026.9.30.1 from the commits and PRs between tags. It has to be tracked before the first release becausegit add -udoesn't stage new files.How can this be tested?
I reproduced the release task in the
mitodl/ol-concourse-dsl:latestimage the job uses, as published after ol-concourse#111 (bump-my-version 1.5.1, uv 0.12.15, no scriv): committed the tree, ranbump-my-version bump --new-version 2026.10.1.1 --no-commit --allow-dirty, thengit add -u.CHANGELOG.md(new2026.10.1.1entry), the deleted fragment,pyproject.toml, anduv.lock.changelog.d/empty, the bump succeeded and onlypyproject.tomlanduv.lockchanged.It hasn't run in Concourse. The next release cut is the real test.
Additional Context
bump_version_taskruns on main HEAD, and_create_hotfixstashes that tree and pops it onto production plus the cherry-picked commit. So the hotfix entry lists every unreleased fragment on main, and because the fragment deletions don't apply on the hotfix branch, those fragments stay on main and are listed again in the next normal release. Hotfixes are rare enough that I'd rather hand-edit the entry than fix this in the release resource now.getof main and the cut is attributed to the next release. The version bump already has this race.