CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

fix(ci): server-side merges fire push workflows; gated chain gets the ancestry guard #5469

Merged⚡ AI-generatedXSccantynz wants to mergefix/merge-fires-push-workflowsmainopened 24d ago
ccantynzcommented 24d ago

Two gaps found by PR #5468's live test (it merged to main and produced no verify-deploy run at all):

1. Merges never fired on: push workflows. A server-side merge advances the base ref directly — the receive-pack hook that calls syncAndEnqueuePushWorkflows never sees it. On a platform where PR merges are the primary way main moves, on: push: branches: [main] effectively never fired. New shared helper enqueuePushWorkflowsForBranchAdvance() (resolves the post-merge tip, enqueues matching workflows, never throws) is called from all five merge sites: performMerge (ai-loop/auto-merge/autopilot), the gated v2/MCP chain, the merge button, and both merge-queue success exits.

2. The gated chain was still missing the incident-day ancestry guard. pr-merge-gated.ts — the exact path MCP merges take — had a bare update-ref with no merge-base --is-ancestor check: the INCIDENT 2026-08-08 class that discarded five merged PRs. Guard added, mirroring pr-merge.ts; a stale branch now routes through mergeWithAutoResolve instead of replacing the base.

Structural tests pin all five call sites and the guard in all three update-ref paths. This PR's own merge is the live test: merging it via MCP goes through the gated chain, which (once deployed... note: the current deployed code still lacks the hook, so the proof run comes from the next merge after this one deploys).

🤖 Generated with Claude Code

ccantynzAI Reviewcommented 24d ago

AI Triage

(no summary)

Priority: medium Risk area: mixed

Suggested labels: (no label suggestions) Suggested reviewers: (no reviewer suggestions)

Suggestions only — nothing has been applied. The PR author stays in control.

gluecron[bot]🤖 botAI Reviewcommented 24d ago

AI review unavailable

The platform's AI balance is exhausted, so AI generation is temporarily unavailable. Nothing was lost. You can queue this as a repair for the internal agent from the repository's Health page, or try again once the balance is restored. The PR is otherwise unchanged.

Cross-repo impact

See what breaks downstream if this PR merges.

Analyze →
⮌ Merged

This pull request was merged into main.

c comment · e edit title · m merge · a approve · r request changes · ? shortcuts