fix: Retry the release POST; a transient 500 strands the tag #40
Labels
No labels
priority/P0
priority/P1
priority/P2
priority/P3
size/L
size/M
size/S
size/XL
size/XS
state/done
state/in-progress
state/in-review
state/needs-refinement
state/ready
type/bug
type/chore
type/feature
type/refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
amtronics/platform-actions#40
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
release/action.ymlpushes the new tag and then immediatelyPOSTs the release thatreferences it. When Forgejo has not finished indexing the tag, that POST returns 500,
curl -fsSexits 22, and the job fails — after the tag has been pushed.The failure mode is bad out of proportion to the cause. The repository is left with a tag
and no release;
publishanddeployare skipped because they needversion; and thenext ordinary dispatch finds the tag already present, decides no release is warranted, and
exits 0. Recovering means either publishing the release by hand or force-bumping to a new
version, which strands the tagged one forever.
It is transient. Observed on
ahmad/imamahv0.5.0 (its #148); replaying the identical callby hand minutes later returned
201. The notes had already been generated and were lostwith the failed run — the rewrite had succeeded,
notes_fallback=false.Scope
Acceptance criteria
before failing the job.
publishruns as normal.
the response body — not only
curl: (22).unchanged.
Notes
Two things are worth separating. The retry is the fix. But the ordering is what makes the
failure expensive: the tag is pushed before the release is known to be creatable, so a
failure anywhere after that point strands a version number. If the tag push can be moved
after a successful release creation — or made conditional on it — the same class of failure
becomes harmless and re-runnable. That may be the more valuable change; it is larger, so it
is worth deciding deliberately rather than folding in here.
curl -fsSalso swallows the response body, which is why the original diagnosis took a logdig.
--write-out '%{http_code}'with the body kept would have said so directly.A second instance of the ordering problem, from a different cause — which I think settles that the ordering, not the 500, is the thing worth fixing here.
ahmad/imamahrelease #283 (merge4ddb512d):versionsucceeded, taggedv0.5.1and published the release with proper notes.publish (web)succeeded.publish (api)has now been running 53 minutes and has produced no output for the last 28:A
WORKDIRinstruction taking 483 seconds is the tell: this is host I/O, not the registry and not the network — and the siblingpublish (web)completing normally rules out the runner being dead. It belongs withamtronics/infrastructure-vps#390and#393, and I have not touched it.Why it matters here. If that job dies,
v0.5.1ends up a tag and a release with awebimage and noapiimage, anddeploynever runs — the same stranded shape asv0.5.0, reached by a completely different route. And the recovery is the same dead end: the tag exists, so a re-dispatch derives no release and skipspublish, meaning the image can never be built for that version.That is the argument for reordering rather than only retrying. A retry fixes a transient 500. It does nothing for a build that hangs, a runner that is killed, or any other failure after the tag is pushed — and each of those strands a version number just as thoroughly. Tagging only once the artefacts exist, or making the tag reproducible so a re-dispatch can rebuild for it, closes the whole class.
I am not widening this issue: the retry is still the small, correct fix and should land as scoped. But the note under Notes about ordering being "the more valuable change" now has two independent instances behind it in one day, which is worth knowing when it is prioritised.