Skip to content

fix(post-result): Advise a retry when a failed publish already has targets done - #10269

Merged
BYK merged 2 commits into
mainfrom
byk/fix/retry-advice-after-partial-publish
Nov 6, 2026
Merged

BYK merged 2 commits into
mainfrom
byk/fix/retry-advice-after-partial-publish

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Companion to getsentry/craft#965. With that change, Craft fails the publish when it can't merge the release branch back, even though every target already shipped. The failure comment here then says "Bad branch? You can delete with ease and start over", which is the wrong advice: the version is already out, so starting over can't work, and the fix is to retry.

What changed

  • The "Inform about failure" and "Inform about cancellation" steps now get CRAFT_STATE_FILE_PATH (the same .issue hard link that "Update completed targets" reads).
  • post-result.js reads the published targets from it. When any target is checked, the comment lists them and says to fix the cause in the run logs and re-add accepted, because the retry skips the checked targets. Otherwise the comment keeps the "Bad branch?" link.
  • If the state file can't be read, the step logs a warning and posts the default comment, so a bad state file can't drop the failure comment.

Example:

Failed to publish. (run logs)

Already done: npm, github. Don't delete the release branch and start over. Fix the cause in the run logs, then add the accepted label again: the retry skips the done targets.

Caveat: the state file also has targets that someone checked by hand to skip them, so a run that fails before it publishes anything but has hand-checked targets gets the retry advice too. I think that's fine, because retrying is still safe there.

Verification: pnpm test (163 tests) and pnpm lint pass. The new tests cover the comment with and without done targets, reading the state file (present, missing, unreadable), and the workflow wiring.

via @BYK.

--

View Session in Sentry

…rgets done

When Craft fails after some targets published (for example, when the
release branch merge fails after every target shipped), the failure
comment told people to delete the release branch and start over. That
can't work: the version is already out. The comment now lists the
checked targets from the Craft publish state and says to fix the cause
and re-add `accepted`, so the retry skips them.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
Comment thread src/modules/process-end-state.js Resolved
Comment thread src/modules/process-end-state.js Resolved
…mment

Apply review feedback: the advice now says to keep the release branch
and that fixes can go in as PRs to it, noting that the remaining
targets then publish from the new commit. The default "Bad branch?"
advice also mentions fixing the branch with a PR before deleting it.
@BYK
BYK merged commit 8161c7b into main Nov 6, 2026
13 checks passed
@BYK
BYK deleted the byk/fix/retry-advice-after-partial-publish branch November 6, 2026 13:18
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