Skip to content

ci(release): move the failed-run retry where the rerun API accepts it - #1322

Open
FerroxLabs wants to merge 1 commit into
mainfrom
fix/auto-retry-deadlock
Open

FerroxLabs wants to merge 1 commit into
mainfrom
fix/auto-retry-deadlock

Conversation

@FerroxLabs

Copy link
Copy Markdown
Owner

The auto-retry job inside Build and Release could never have worked. It slept five minutes and then POSTed .../actions/runs//rerun for its OWN run id, but it was a job of that run, so the run was necessarily still in progress:

403 {"message": "This workflow is already running"}

It was skipped on every green run and on every dev build, so it first executed on v0.12.14 and failed exactly as written, five minutes after a transient Azure signing crash had already cost a twenty-minute build. Same class as the four acceptance defects that burned nine version numbers: code no run had reached.

Replaced with a workflow_run-triggered workflow, which fires only after the run has finished and is therefore the one moment the rerun API will accept the call.

Verified by hand on v0.12.14: once the run reached completed, rerun-failed-jobs was accepted, produced attempt 2, and rebuilt only the one failed target while the five green builds kept their artifacts. That is why this uses rerun-failed-jobs rather than a full rerun.

Loop safety is the run_attempt == 1 guard: a run this retries becomes attempt 2 and can never trigger it again. head_branch reaches the shell through env rather than template interpolation, so a crafted branch name cannot inject.

Worth a careful read since it changes the release workflow. Nothing references the removed job.

The auto-retry job inside Build and Release could never have worked. It slept
five minutes and then POSTed .../actions/runs/<id>/rerun for its OWN run id,
but it was a job of that run, so the run was necessarily still in progress:

  403 {"message": "This workflow is already running"}

It was skipped on every green run and on every dev build, so it first executed
on v0.12.14 and failed exactly as written, five minutes after a transient Azure
signing crash had already cost a twenty-minute build. The same class as the four
acceptance defects that burned nine version numbers: code no run had reached.

Replaced with a workflow_run-triggered workflow, which fires only after the run
has finished and is therefore the one moment the rerun API will accept the call.
Verified by hand on v0.12.14: once the run reached completed, rerun-failed-jobs
was accepted, produced attempt 2, and rebuilt only the one failed target while
the five green builds kept their artifacts. That is why this uses
rerun-failed-jobs rather than a full rerun.

Loop safety is the run_attempt == 1 guard: a run this retries becomes attempt 2
and can never trigger it again. head_branch reaches the shell through env rather
than template interpolation, so a crafted branch name cannot inject.
@github-actions github-actions Bot added area:packaging Signing, notarization, updater area:workflows Workflows & automation labels Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:packaging Signing, notarization, updater area:workflows Workflows & automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant