fix(automerge): a human APPROVED merges any repo (default path was shadow-only) #408
No reviewers
Labels
No labels
Agent
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
2 participants
Notifications
Total time spent: 37 seconds
Due date
igor
37 seconds
No due date set.
Dependencies
No dependencies set
Reference
joshtronic/igor!408
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/human-approve-merges-default-repo"
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?
Gap surfaced by ctj#59/#61: you approved both, but they wouldn't merge.
The bug
On a default (shadow-gated) repo, the gate from #405 only checked the shadow verdict — a human
FORGEJO_REVIEWERAPPROVEDreview was ignored. So when the shadow gave aCOMMENT(routing to you) and you then approved, the PR sat unmerged. That contradicts the design: "a human can always approve/merge any repo."Fix
The default path now merges on either signal:
FORGEJO_REVIEWERAPPROVEDreview (human override — merges any repo), orAPPROVEfor the current head (unchanged, incl. the sha-binding).A
REQUEST_CHANGES— shadow's or the human's — still blocks either path (overriding a flagged problem is a deliberate manual merge, not an auto-merge). Therequire_humancarve-out path is unchanged.Tests
Added: human
APPROVEDoverrides a shadowCOMMENT→ merges; shadowRCblocks even a human approve. Existing shadow-path e2e tests retargeted to "no human review" so they still exercise the shadow path.make testgreen.Once this self-deploys, your approval on any default-repo PR merges it — ctj#59/#61 will auto-merge on the next tick (your APPROVED + green CI are already there).
Gap in the review-gate rollout: on a default (shadow-gated) repo the gate only consulted the shadow verdict -- a human FORGEJO_REVIEWER APPROVED review was ignored. So when the shadow only COMMENTed and the human reviewed + approved (ctj#59/#61), the PR sat unmerged despite the approval, contradicting the design ("a human can always approve/merge any repo"). Default path now merges on EITHER a human APPROVED OR the shadow current-head APPROVE, and never over a REQUEST_CHANGES (shadow or human). Tests: human APPROVED overrides a shadow COMMENT -> merges; shadow RC blocks even a human approve; existing shadow-path tests retargeted to no-human so they still exercise the shadow path.🤖 Review —
APPROVE(automated)CI for
425cfb00: successSmall, well-scoped fix to
lib/automerge.sh's default (shadow-gated) merge branch so a humanFORGEJO_REVIEWERAPPROVEDreview can merge even when the shadow onlyCOMMENTed, while anyREQUEST_CHANGES(shadow's or human's) still blocks. Logic and tests check out; CI green.Correctness review of the rewritten
elsebranch:REQUEST_CHANGES(shadow) →continue. Thenautomerge_reviewer_blocks(human RC) →continue. Only after both block-checks does it merge on human-approve OR shadow-APPROVE-of-current-head. Order is right: a shadow RC blocks even a human approve, matching the stated design and the new test.elif [ "$verdict" = "APPROVE" ] && [ "$reviewed_sha" = "$head" ]retains the sha-binding, so an APPROVE for an older sha still falls through to theelse/continue. The existingoldsha0test still exercises this.forgejo_commit_statusstill runs after this block, so the human override does not bypass green-CI.require_humanpath (ifbranch) is unchanged, as claimed.Test hygiene: The flip of the shared mock
automerge_approved_by() { return 0 → 1 }is necessary and correct — the new code now callsapproved_byon the shadow path, so leaving it atreturn 0would have masked every shadow-path assertion via the human override. It's reset back before the multi-repo sections. New tests cover both the override-merges and RC-blocks-override cases.Checklist honesty: Description's claims (human override merges over shadow COMMENT; shadow RC blocks; existing e2e retargeted to "no human review") all correspond to real diff hunks.
No blocking issues. Scope is tight (~30 lines), no drive-by changes, tests added, CI
success.Independent review by the harness on
claude-opus-4-8(effort: high). The human reviewer is requested once Igor has reviewed; a human still merges.