feat(automerge): confirm-deploy PR comment + delete branch on merge #257
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: 59 seconds
Due date
igor
59 seconds
No due date set.
Dependencies
No dependencies set
Reference
joshtronic/igor!257
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/automerge-confirm-and-delete"
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?
Two bits of polish from watching the first live run.
1. Confirm-deploy comment on the PR. The deploy barrier now posts a comment when it finishes — a ✅ confirm on verify ("deploy verified, site is live") and a ⚠️ failure note (alongside the email) on a failed CI/smoke. Visible record on the PR, not just buried in the logs.
2. Delete the branch on merge. You were right it's not a Forgejo bug: the repo's "Delete branch after merge by default" only pre-checks the box in the UI merge dialog. An API merge has to send
delete_branch_after_merge: true, whichautomerge_do_mergewasn't. Added — so auto-merged branches get cleaned up like your manual merges do. (Also deleted the leftoverdocs/readme-agent-indexbranch from the #60 run.)Tests: merge body now asserts
Do=merge+delete_branch_after_merge; the barrier asserts a confirm comment on healthy and a failure comment on CI-failure.bash -n+check-syncgreen. No reviewer.Two polish items from watching the first live run: - The deploy barrier now leaves a COMMENT on the PR -- a confirm on verify ("deploy verified, site is live") and a failure note (alongside the email) on a failed CI/smoke. Gives a visible record on the PR itself, not just the logs. - automerge_do_merge now passes delete_branch_after_merge:true. The repo's "Delete branch after merge by default" is only a UI-form default (it pre-checks the box in the merge dialog); an API merge must opt in explicitly, so the auto-merge was leaving head branches behind. Now they're cleaned up. Tests: merge body asserts Do=merge + delete_branch_after_merge; barrier asserts a confirm comment on healthy and a failure comment on CI-failure. check-sync green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011KXPafSYJPY6XkWHHk1Lfs🤖 Review —
COMMENT(automated)CI for
84a558d0: successSmall, focused two-part change to the auto-merge deploy barrier: (1) post a PR comment on deploy verify/failure, (2) send
delete_branch_after_merge:trueon the API merge. Code is in scope, the checklist matches the diff, and CI is green. The one thing I can't confirm from the diff blocks a clean APPROVE.Findings
Can't verify
forgejo_commentis real (the main risk). Both new feature calls —_deploy_alert(lib/automerge.sh:109) anddo_deploy_barrier(lib/automerge.sh:166) — invokeforgejo_comment "$repo" "$pr" "<body>", but the function isn't defined anywhere in this diff. The tests stub it (forgejo_comment() { COMMENTS=...; COMMENT_BODY="$3"; }), so the unit suite passes regardless of whether the production helper exists or takes this exact(repo, pr, body)signature.bash -nwon't catch a runtime "command not found" either. And both call sites swallow failure (2>/dev/null || true/|| log warning), so if the function is missing the whole feature silently no-ops with no test catching it. The name matches the siblingforgejo_commit_statusconvention, so it's likely a real helper — but please confirmforgejo_commentexists in the production source tree and that its arg order is(repo, pr, body).Merge-body change is correct and tested.
automerge_do_mergenow sends{"Do":"merge","delete_branch_after_merge":true}(lib/automerge.sh:79); the new test asserts both fields and that the merge SHA is still returned. The in-shell> "$TMP/merge_sha"(not$()) trick to letMERGE_BODYpersist out of the_fjstub is sound.Comment assertions line up with the bodies. Failure path body contains "did NOT verify" and success path contains "verified", matching the new
hasassertions.Notes / nits (non-blocking)
_fj()override (returns{"merge_commit_sha":"deadbeef"}for any non-merge call) isn't restored before the followingdo_automerge_tickblock; CI green suggests no interference, but worth a glance if later tests get flaky.|| true, confirm path logs a warning) — intentional given the alert path already emails, just noting it.Flagging as COMMENT rather than APPROVE solely because the existence/signature of
forgejo_commentcan't be verified from the diff and the tests can't catch its absence. One quick repo check by the human clears it.===BODY===
Independent review by the harness on
claude-opus-4-8. The human reviewer is requested once Igor has reviewed; a human still merges.