fix(forgejo): auto-merge attempt_merge signals via return code, not stdout #45
No reviewers
Labels
No labels
adr
agent:blocked-ci
agent:blocked-human
agent:blocked-resolver
agent:done
agent:in-progress
agent:no-touch
agent:pinged
agent:pr-open
agent:queued
agent:wip
area:board
area:funding
area:infra
area:phy
area:poplink
area:rtl
area:software
area:supply-chain
area:verification
ci-failed
ci-timeout
docs
do-not-merge
human-approved
needs-human-approval
needs-rebase
needs-triage
phase:1
ready-for-review
review:findings
review:pass
risk:tripwire
swarm:quarantined
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Fluid/fluidpop-v1!45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/auto-merge-result-return"
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?
Summary
Follow-up to #44. The previous refactor captured
attempt_merge's stdout intoRESULTand branched on the string. On the success path (HTTP 200), the function echoed"[auto-merge] PR #N merged via squash"to stdout, which madeRESULTnon-empty and tripped the "Unexpected merge result" branch — so the script exited 5 after a clean merge, even though the merge had actually landed.This was harmless when the API succeeded (PR really did merge, the bogus exit just looked like failure) but it confuses
pr-approver, which would see exit 5 and kick the loop again — exactly the spam path the rebase work was meant to close.Change
attempt_mergekeeps all log lines on stderr and signals state purely via return code:0= merged,MERGE_BEHIND_BASE(100) = needs rebase, hardexit 5otherwise.set +e; attempt_merge ...; RESULT=$?; set -eso a non-zero return doesn't tripset -e, then branches on the integer.Test plan
bash -n infra/forgejo/auto-merge.shNotes
infra/forgejo/**off-limits per ADR-017 — merged manually.CI green (head
28e7b77076), auto-approving