Fix commit pagination, check the release branch, and freeze the changelog - #16
Merged
Merged
Conversation
The loop moved page on to the next one before testing it, so it stopped one short of the last page GitHub reported and never read the oldest commits on the branch. Every tag pointing at one of those commits then failed the reachability check that the commits, issues and milestones data sources apply, and its section vanished from the changelog. Regenerating this repository's changelog kept 36 of its 47 tags. It now keeps 44; the other three are not on master at all, which no amount of paging will change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Fenced blocks now name their language. The two sample releases were quoted rather than fenced, so their headings counted towards the document's heading levels and made the heading after each one look like a jump from h2 to h4; fencing them as markdown both silences that and shows them as what gren writes. The one thing left is a bare URL in a commit subject the changelog quotes, which is only fixable by editing generated output by hand. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Three small corrections found while rebuilding this project's own changelog. Tags are checked against GitHub and the commits of a release are read from the local repository, so the two have to agree. A tag that is missing or has moved already stops the run, but the branch the unreleased section is built from was only checked to exist, and a clone left behind would quietly describe work nobody else can see. The check is skipped when the version being prepared is already tagged, as the branch is not read at all then. A release whose commits are all filtered out left a heading with nothing under it, rather than saying there was nothing to list. A commit subject with a space at either end put that space inside the link text, which reads as [ text ] and fails a markdown linter. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The releases up to 5.0.0 cannot be regenerated. The older sections were written from the upstream project's issue tracker, which this repository does not have, and three of its tags sit on a version-bump commit that never merged into master, so the commits data source drops them. frozenBefore keeps all of it as it reads. Releases from here are built from pull requests, which means a commit that reaches master without one is reported after generating rather than written to the changelog. The catch-all group is not optional: without it a pull request whose labels match no group is dropped in silence. The changelog itself is regenerated once to drop the release commits and to put the releases of a single day in order. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Four corrections, found by rebuilding this project's own changelog with the 5.1.0 code and reading the result.
Read every page of a branch's commits
_getAllCommitsForBranchadvancedpagebefore testing it, sowhile (page < totalPages)stopped one page short of what GitHub reported. For this repository that meant 300 of master's 347 commits, and every tag pointing into the unread page failed the reachability filter that thecommits,issuesandmilestonesdata sources apply — its section simply vanished from the changelog.Regenerating kept 36 of 47 tags. It now keeps 44; the other three are not on master at all, which no amount of paging changes.
The other three paginated calls use a recursion form that tests before advancing, so they were already correct.
Check the release branch, and tidy what is written
Tags are checked against GitHub and the commits of a release are read from the local clone, so the two have to agree. A missing or moved tag already stops the run, but the branch the unreleased section is built from was only checked to exist — a clone left behind would quietly describe work nobody else can see. The check is skipped when the version being prepared is already tagged, since the branch is not read at all then.
Two output fixes alongside it: a release whose commits are all filtered left a heading with nothing under it instead of saying there was nothing to list, and a commit subject with a space at either end put that space inside the link text, which reads as
[ text ]and fails a markdown linter.Give the markdown what a linter asks for
.markdownlint.jsondisabledMDO13— letter O, and a stray colon — so line-length was never actually turned off and every long line in the repository was an error.With that fixed, three fenced blocks needed a language, and the two sample releases were quoted rather than fenced, so their headings counted towards the document's heading levels and made the heading after each one look like a jump from h2 to h4. Fencing them as
markdownsilences that and shows them as what gren writes.Freeze this project's changelog and build it from pull requests
The releases up to 5.0.0 cannot be regenerated: the older sections came from the upstream project's issue tracker, which this repository does not have, and three tags sit on a version-bump commit that never merged into master.
frozenBeforekeeps all of it as it reads, and releases from here are built from pull requests.Two things follow. A commit that reaches master without a pull request is reported after generating rather than written to the changelog. And the catch-all group is load-bearing — without it, a pull request whose labels match no group is dropped in silence.
The changelog is regenerated once here to drop the release commits and to order the releases of a single day by version rather than arbitrarily.
Verification
Gren.spec.jsskips itself whenGREN_GITHUB_TOKENis unset.npm run changelogreproduces the committedCHANGELOG.mdbyte for byte, and a release simulation adds only the new section.commits,issuesandmilestonesdata sources behave exactly as before; nothing here changes what they read or emit beyond the two output fixes.🤖 Generated with Claude Code