Skip to content

fix(release): detect resume by tag, not by HEAD commit message#2423

Merged
dunglas merged 3 commits into
mainfrom
fix-release-resume-by-tag
May 15, 2026
Merged

fix(release): detect resume by tag, not by HEAD commit message#2423
dunglas merged 3 commits into
mainfrom
fix-release-resume-by-tag

Conversation

@dunglas
Copy link
Copy Markdown
Member

@dunglas dunglas commented May 15, 2026

Summary

The resume detection in release.yaml only recognised a resume when main HEAD itself was the chore: prepare release X [skip ci] commit. If a follow-up commit landed on top — exactly what happened mid-1.12.3 release when #2421 and #2422 had to merge after the tag was created — HEAD was no longer the release commit and the workflow's tag-existence guard fired, refusing to resume even though tags + commit were already in main's history.

Fix

Use tag existence as the resume signal instead. The tag v<version> is the actual artifact we're trying to land; whether main HEAD has advanced past it doesn't matter for the resume decision. The release commit SHA is read from the tag's object (with annotated-tag dereferencing).

A bare caddy/v<version> tag without v<version> still aborts as a split-state guard.

Validation

This is the third workflow patch needed during the v1.12.3 dispatch (#2421 ARG_MAX, #2422 REST draft). With this in place, re-dispatching v1.12.3 should detect resume=true, skip PGO/bump/commit/tag (all already done), reach the now-fixed Draft step, create the draft via REST, dispatch downstreams, bump Homebrew. Run time ~30s.

The previous logic only recognised a resume when main HEAD itself was
the `chore: prepare release X [skip ci]` commit. If a follow-up commit
landed on top (a hotfix to the release workflow itself, in v1.12.3's
case), HEAD was no longer the release commit and the tag-exists guard
fired, refusing to resume — even though the rest of the work was
already done and the commit was still in main's history.

Switch to tag-based detection: if v<version> exists on origin, this is
a resume; pull the release commit SHA from the tag's object (deref the
annotated tag). The tag is the actual artifact we're trying to land, so
it's the right resume signal regardless of where main HEAD has moved.

A bare caddy/v<version> without v<version> still aborts as a split-
state guard.
Copilot AI review requested due to automatic review settings May 15, 2026 13:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the GitHub Actions release workflow’s “resume” detection to key off the existence of the v<version> tag (and resolve the commit SHA from the tag object), instead of relying on main’s HEAD commit message—allowing a release to be resumed even if follow-up commits landed on top of the release commit.

Changes:

  • Switch resume detection from main HEAD commit-message matching to v<version> tag existence.
  • Resolve the release commit SHA via dereferencing annotated tags (git/tags/<sha> -> object.sha).
  • Replace the previous “tags exist but HEAD mismatch” guard with a “split state” guard (caddy/v<version> exists without v<version>).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yaml
Comment thread .github/workflows/release.yaml
Comment thread .github/workflows/release.yaml Outdated
Per Copilot review: resume-by-tag-existence proceeds even when the
tag's target isn't reachable from main (orphan tag created on a side
branch). Add a `git merge-base --is-ancestor` check so we abort
rather than skip the bump/commit steps against unreachable history.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/release.yaml
Per Copilot review (flagged twice): `if ref=$(gh api ...); then`
swallowed transient API failures (rate limit, 5xx, auth) as "tag
missing", silently downgrading a resume into a fresh attempt with no
visible state divergence.

Capture stderr, branch on whether it contains `(HTTP 404)`: only that
case is a true "tag absent → fresh attempt". Anything else aborts with
the original stderr surfaced.
@dunglas dunglas merged commit f650727 into main May 15, 2026
31 checks passed
@dunglas dunglas deleted the fix-release-resume-by-tag branch May 15, 2026 13:54
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.

2 participants