Skip to content

fix: recover bump files from the version commit even when HEAD has moved past it#136

Merged
theoephraim merged 1 commit into
mainfrom
fix/recover-bump-files-past-version-commit
Jun 25, 2026
Merged

fix: recover bump files from the version commit even when HEAD has moved past it#136
theoephraim merged 1 commit into
mainfrom
fix/recover-bump-files-past-version-commit

Conversation

@theoephraim

Copy link
Copy Markdown
Member

Problem

GitHub release notes came up empty — literally No changelog entries. — for a whole batch of releases, even though the CHANGELOG.md files had full content. (Observed on a varlock release batch: e.g. @varlock/1password-plugin@2.0.0.)

Root cause

Release bodies are generated at draft-creation time from bump files recovered out of git via recoverDeletedBumpFiles. That function only inspected the single HEAD~1..HEAD diff, assuming HEAD is always the version commit that deleted the bump files.

That assumption breaks when publish runs on a commit later than the version commit — e.g. the first publish attempt was blocked, unrelated CI fixes landed on main, and publish was retried hours later. By then HEAD has moved past the version commit, the HEAD~1..HEAD diff contains no bump-file deletions, recovery returns [], and the release body falls back to the empty placeholder. The CHANGELOG.md files are unaffected because they're written and committed at version time.

In the observed case the version commit was 6 commits behind the commit the publish (and the release tags) actually ran on.

Fix

recoverDeletedBumpFiles now locates the most recent commit that actually deleted .bumpy/*.md files (the version commit) via git log --diff-filter=D, and recovers their content from that commit's parent — instead of assuming it's HEAD~1.

This is a sound anchor because feature PRs only ever add bump files; the only thing that deletes them is a version commit. So "most recent bump-file deletion" is always the version commit for the versions being published, whether that's HEAD (the common case, unchanged behavior) or several commits back. No reliance on parsing CHANGELOG.md.

Known limitation

If two version cycles land before a publish (cycle A versions → publish partially fails → cycle B versions → publish runs), only cycle B's bump files are recovered; packages still pending from cycle A fall back to No changelog entries. — same as today, not a regression. Downstream per-package filtering prevents any cross-contamination.

Tests

  • New test: recovery works when HEAD has moved several commits past the version commit.
  • Existing HEAD-is-version-commit test still passes (the new query returns HEAD when HEAD is the deleter).
  • Full core suite: 327 pass, 0 fail.

…ved past it

GitHub release notes came up empty ("No changelog entries.") whenever the
publish ran on a commit later than the version commit — e.g. a retry after
the first publish was blocked and unrelated CI fixes landed on main.

recoverDeletedBumpFiles assumed the version commit was always HEAD~1..HEAD,
so once HEAD diverged it silently recovered nothing and release bodies fell
back to the empty placeholder. It now finds the most recent commit that
actually deleted .bumpy/*.md files and recovers their content from that
commit's parent.
@github-actions

Copy link
Copy Markdown

bumpy-frog

The changes in this PR will be included in the next version bump.

patch Patch releases

  • @varlock/bumpy 1.16.0 → 1.16.1

Bump files in this PR

Click here if you want to add another bump file to this PR


This comment is maintained by bumpy.

@theoephraim theoephraim merged commit 34508a4 into main Jun 25, 2026
5 checks passed
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