bug(release-decide): Layer 2 cut-safeguard race condition — forgejo_find_pr_by_merge_sha lags ~8s behind fresh merge #86
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit#86
Loading…
Add table
Add a link
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?
Symptom
When operator merged the v0.5.0 rolling PR #80 at
2026-06-26T00:40:30, the cut workflow fired at2026-06-26T00:40:38(8s later). Layer 2 cut-safeguard FAILED —forgejo_find_pr_by_merge_shaquery returned no match for the just-merged commit's SHA. The safeguard's protective fall-through fired:mode=updateinstead ofmode=cut, opening PR #84 as a precaution rather than risking a false-positive cut on uncertain provenance.Repro-confirmed: a manual probe of the same lookup ~5 minutes later succeeded and correctly identified #80 with
head=release-prep/rolling. The race window is on the order of seconds.The safeguard worked correctly
This is the first empirical falsification of the Layer 2 timing assumption (the safeguard's protective behavior is the very thing #64 deferred test coverage was about). The substrate-honest fall-through fired: when Layer 2 can't verify the merge source, default to the safer
mode=update(refresh rolling PR) rather than the riskiermode=cut(mutate production state). Surveyor's d64a "cut-verification is load-bearing" framing — verified working.What didn't work
The desired outcome (v0.5.0 cut on operator's merge) didn't happen autonomously. Recovery required manual
workflow_dispatchafter Forgejo's API caught up. For a substrate that aims to be "fully autonomous cuts on operator merge," needing manual intervention defeats the design intent.Root cause hypothesis
Forgejo's PR-merge indexing has a window between:
mainmerge_commit_sha+state=closedbeing reflected in thepulls?state=closedquery resultsDuring that window,
forgejo_find_pr_by_merge_shareturns nothing for the just-merged SHA. The window appears to be a few seconds.(Per
feedback_filed_rootcause_is_hypothesis: this is a hypothesis until probed on the live system. The exact duration + mechanism of the lag would need investigation — possibly cache invalidation, async indexer, or similar.)Proposed fix surface
Three candidate approaches:
pullref directlyrelease-decide.sh--wait-for-merge-sha SHA --timeout 30flag that polls until foundI lean (A) — minimal change, well-bounded, falls back to current behavior cleanly. The retry budget (e.g., 3 retries × 5s = 15s) is plenty for the observed ~8s lag.
Sibling deferred test coverage
#64 — Layer-2/3 cut-safeguard FAIL-path coverage. The race-condition fall-through this issue catches IS one of the empirical instances #64's tests would have caught earlier. Pair them in the v0.5.1 substrate-correctness sweep.
Refs
refs/pull/N/headon auto-delete-branch merge #92