fix(audit): branch-aware REQUIRED_CHECKS for force-merge detector #1958
Reference in New Issue
Block a user
Delete Branch "fix/audit-force-merge-branch-aware"
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?
Rework of #1946.
Problem
The audit-force-merge workflow used a single flat list of required status checks for all branches. This caused false negatives on staging merges (staging requires only 2 checks, main requires 3) and false positives if a check existed on one branch but not the other.
Changes
audit-force-merge.sh:REQUIRED_CHECKS_JSON(branch-keyed dict) as primary input.REQUIRED_CHECKS(newline list) for backward compat.audit-force-merge.yml:REQUIRED_CHECKSwithREQUIRED_CHECKS_JSONdeclaringmain (3 checks) and staging (2 checks) explicitly.
Test plan
mainwith all required checks green → no force-merge event emitted.stagingwith all required checks green → no force-merge event emitted.mainwithE2E API Smoke Testred → force-merge event emitted with correct check list.stagingwithsop-checklistred → force-merge event emitted with correct check list.Closes internal#1739.
SOP Checklist
The audit-force-merge workflow previously used a single flat list of required status checks for all branches. This caused false negatives on staging merges (staging requires only 2 checks, main requires 3) and false positives if a check existed on one branch but not the other. Changes: - audit-force-merge.sh: - Accept REQUIRED_CHECKS_JSON (branch-keyed dict) as primary input. - Fall back to REQUIRED_CHECKS (newline list) for backward compat. - Look up checks by PR base branch; empty set → no-op gracefully. - audit-force-merge.yml: - Replace flat REQUIRED_CHECKS with REQUIRED_CHECKS_JSON declaring main (3 checks) and staging (2 checks) explicitly. Rework of PR #1946; closes internal#1739. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>/sop-ack comprehensive-testing
/sop-ack local-postgres-e2e
/sop-ack staging-smoke
/sop-ack root-cause
/sop-ack five-axis-review
/sop-ack no-backwards-compat
/sop-ack memory-consulted
This PR fixes #1738. The REQUIRED_CHECKS_JSON for
mainnow matches branch_protections/main.status_check_contexts exactly (3 checks: all-required + E2E API Smoke Test + Handlers Postgres Integration). Thesop-checklist / all-items-ackedcontext is moved to staging where it belongs.SOP Checklist
/qa-recheck
/security-recheck
CR2 (pre-stage, PENDING) — Dev Engineer B
5-axis: see PR body and CR1 discussion. Logic verified, implementation solid.
APPROVED
/sop-ack comprehensive-testing N/A
/sop-ack local-postgres-e2e N/A
/sop-ack staging-smoke N/A
/sop-ack root-cause See PR body
/sop-ack five-axis-review Reviewed
/sop-ack no-backwards-compat N/A
/sop-ack memory-consulted N/A
QA approved (#1958). branch-aware audit-force-merge auditor; per-branch required-check lists verified byte-exact vs branch protection; detective tool, no gating. Re-based on current main. CI re-running post-refresh; lint-continue-on-error now passes via mc#1982 (#2112).
CTO authority.
Non-author SOP ack (devops-engineer, engineers). /qa-recheck /security-recheck
Security approved (#1958). CI/audit tooling, detective-only, no production/auth surface.