Skip to content

fix(release-nicely): rerun once a release run that failed before it published #481

Open

Description

@pascalandy

The problem (CMO)

Agent role: Chef in brigade-mode, running the release after a merge

Problem Statement: The end user wants each release published without a wait. The release workflow failed on a flaky check before it published anything. The skill told the agent to stop, and it allows no rerun. The agent had to ask the end user for one rerun. That rerun passed and published the release.

Use cases:

  • A check in "Rehearse without publishing" fails on a known flake. Nothing is published. One rerun is safe.
  • A step at or after "Prepare release assets" fails. Something may be published. A rerun could publish twice. The agent must stop, as today.
  • The rerun also fails. The agent must stop and fix the cause through a pull request, as today.

Out of scope: fixing the flake itself (#474), and a new dispatch, which stays forbidden.

REF: #474, #441

Analogy

A bakery checks the cake before it goes into the shop window. The checker's hand slipped, so the check failed. The cake never reached the window.

  • What should happen: the baker checks the cake once more, because nothing was sold yet.
  • What happened in the v0.26.1 release: the rule said "never check again" and "stop". The baker had to call the owner to ask for one more check. The second check passed.

In the real event, workflow run 41841543471 failed at step 9, "Rehearse without publishing", with check-layers-test: SIGINT: check-layers did not end through its SIGINT trap. Steps 10 to 14 (assets, notes, archives, formula, tap) were skipped. No release existed. The end user approved one gh run rerun <id> --failed, and attempt 2 passed all 14 steps. The cost was one round trip to the end user, with a waiting batch blocked on the release. Nothing broke.

Why it happened

The skill treats every failure of the run as a failed publication. It says "Never dispatch again or retry a publication" and "If it fails, report … and stop". A failure in the rehearsal step happens before any publication, but the skill gives no way to tell the two apart.

The change (FMO)

Change one line in .agents/skills/release-nicely/SKILL.md, under ## Tag and publish once, step 6. It currently says:

If it fails, report gh run view <id> --repo pascalandy/nicely --log-failed and stop.

It would say instead:

If it fails, report gh run view <id> --repo pascalandy/nicely --log-failed. When it failed before "Prepare release assets" and gh release view vX.Y.Z finds no release, run gh run rerun <id> --repo pascalandy/nicely --failed once and wait again; otherwise, or if that rerun fails, stop.

That's the whole fix.

How we'll know it works

  1. Before the change: run 41841543471 attempt 1 failed at step 9 with nothing published. The agent stopped and needed the end user's approval for the rerun.
  2. After the change: the same failure leads the agent to one rerun without asking. A second failure stops it.
  3. Nothing else changes: a failure at "Prepare release assets" or later still stops at once, and a new gh workflow run dispatch stays forbidden.
  4. just check passes

👨🏻‍🍳 For the agent

👨🏻‍🍳 Details

Evidence from run 41841543471:

  • Attempt 1, step list: 9 Rehearse without publishing failure, 10 Prepare release assets skipped … 14 Update Homebrew tap skipped. gh release list showed v0.26.0 as the latest release.
  • Failed log tail:
    check-layers-test: SIGINT: check-layers did not end through its SIGINT trap
    error: recipe `test` failed with exit code 1
    error: recipe `release-check` failed on line 147 with exit code 1
    
  • Attempt 2 (gh run rerun 41841543471 --repo pascalandy/nicely --failed): all 14 steps succeeded. The release and tap commit were published, and just release-verify v0.26.1 exited 0.

How the command was proven: gh run rerun --failed on this workflow_dispatch run kept headBranch v0.26.1 and the same headSha, and reran the one job from step 1. The workflow has a single job, so --failed reruns everything, including the tag validation steps. Not proven: a run whose failure leaves a partial publication. The "before Prepare release assets" condition keeps that case on the stop path.

Step order is in .github/workflows/release.yml: "Rehearse without publishing" comes before "Prepare release assets", and every publishing step follows it.

Blast radius: one line of the release skill. The "Never dispatch again" line of step 5 stays, since a dispatch is a new run and a rerun is not.

Related: #474 (the flake that failed step 9, third observation in its comments). The same flake class can recur in any check of the rehearsal.

by Opus-5.5 via Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    1-needs-triageScope, approach, or direction needs evaluation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions