Skip to content

ci: fetch full history before amending the release commit - #269

Merged
xiaoyijun merged 1 commit into
masterfrom
xiaoyijun-ci-fix-sign-shallow-checkout
Jun 12, 2026
Merged

ci: fetch full history before amending the release commit#269
xiaoyijun merged 1 commit into
masterfrom
xiaoyijun-ci-fix-sign-shallow-checkout

Conversation

@xiaoyijun

Copy link
Copy Markdown
Collaborator

Summary

Fixes the bug that just destroyed release PR #245. The sign-release-branch job from #268 used the default shallow checkout (fetch-depth: 1): git commit --amend in a clone whose parent objects are behind the shallow boundary rewrote the release commit into a parentless orphan containing the whole repo tree (181 files, hence the size/xl relabel). Force-pushing that orphan left the release branch with no common ancestor with master, so GitHub auto-closed #245 as unmergeable — attributed to silverhand-bot, whose PAT pushed it.

Two changes:

  • fetch-depth: 0 on the checkout, so the amend keeps the commit's parent;
  • a post-amend guard: if the amended commit has an empty %P, abort instead of pushing — a history rewrite must never reach the branch again, whatever the cause.

Recovery

No manual branch surgery needed — merging this PR is the recovery: the master push makes release-please notice its PR is closed, force-push a fresh, correctly-parented release commit over the orphan, and open a new release: 3.0.0-beta PR; that push then triggers the fixed sign job, which amends it with the bot's GPG key. The new release PR should come up green and Verified, ready to merge.

Testing

  • Reproduced the failure mode from the evidence: c693c58 has parents: [] and the full tree as its diff, exactly what a shallow amend produces.
  • The guard condition (git log -1 --format=%P empty on orphan, non-empty otherwise) is the direct negation of the corruption.

Checklist

  • .changeset (N/A — release-please)
  • unit tests (N/A — workflow change)
  • integration tests (N/A)
  • necessary KDoc comments (N/A)

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@xiaoyijun
xiaoyijun merged commit 0ce18d2 into master Jun 12, 2026
3 checks passed
@xiaoyijun
xiaoyijun deleted the xiaoyijun-ci-fix-sign-shallow-checkout branch June 12, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant