fix(gate): correct GOVERNANCE_REQUIRED_CONTEXTS to use (pull_request_target) — unblocks ~16 PRs #2424
Reference in New Issue
Block a user
Delete Branch "fix/gate-context-target-suffix"
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?
Why
Per live-CI RCA + 2-source verification (CR2 + Researcher), the
GOVERNANCE_REQUIRED_CONTEXTSconstant ingitea-merge-queue.pywas using the(pull_request)suffix, but the actual emitted status contexts from theqa-review,security-review, andsop-checklistworkflows are(pull_request_target)(theiron:blocks usepull_request_target, notpull_request). Verified live against PR#2419, PR#2331, and others: the workflows emit:qa-review / approved (pull_request_target)qa-review / approved (pull_request_review)security-review / approved (pull_request_target)security-review / approved (pull_request_review)sop-checklist / all-items-acked (pull_request_target)[also(pull_request)compat]The script's old
(pull_request)suffix never matched these, so the gate would reportqa-review / approved (pull_request)=missingeven after both qa-review and security-review passed. That painted ~16 ready PRs red and blocked the self-merge pile.Fix
Update the three entries in
GOVERNANCE_REQUIRED_CONTEXTSfrom(pull_request)to(pull_request_target)— pure name correction, no requirement dropped.The
tests/test_lint_bp_context_emit_match.pylint already asserts the(pull_request_target)form for these names, confirming the canonical emitted form.Test plan
test_gitea_merge_queue.pytests pass (12 + 10 + 18 stale context-name occurrences updated to(pull_request_target)in the test fixtures).gitea/scripts/tests/+tests/test_lint_bp_context_emit_match.py+tests/test_lint_required_no_paths.pyFiles
.gitea/scripts/gitea-merge-queue.py—GOVERNANCE_REQUIRED_CONTEXTSupdated + extended comment explaining the suffix choice and the live-PR verification.gitea/scripts/tests/test_gitea_merge_queue.py— 40 stale test fixtures updated to use(pull_request_target)Scope
This is intentionally narrow:
GOVERNANCE_REQUIRED_CONTEXTSis changed.REQUIRED_CONTEXTS_RAWdefault (CI / all-required) is left alone — the CI workflows emit BOTH(pull_request)and(pull_request_target)(per the PR#2419 head status), so the existing default still matches. Changing it would be a separate decision (and would require coordination with anyone who's set the env var to override the default).(pull_request_target)suffix).Refs gate-fix dispatch: CR2 682129bd + Researcher b3bb9a4d
Extracted-by: Engineer-B / agent-dev-b / 0c96b3ab-33f8-4a54-9807-f48444e6bfff
Per live-CI RCA + 2-source verification (CR2 + Researcher), the `GOVERNANCE_REQUIRED_CONTEXTS` constant in `gitea-merge-queue.py` was using the (pull_request) suffix, but the actual emitted status contexts from the qa-review, security-review, and sop-checklist workflows are (pull_request_target) (their `on:` blocks use pull_request_target, not pull_request). Verified live against PR#2419, PR#2331, and others: the workflows emit: - qa-review / approved (pull_request_target) - qa-review / approved (pull_request_review) - security-review / approved (pull_request_target) - security-review / approved (pull_request_review) - sop-checklist / all-items-acked (pull_request_target) [also (pull_request) compat] The script's old (pull_request) suffix never matched these, so the gate would report `qa-review / approved (pull_request)=missing` even after both qa-review and security-review passed. That painted ~16 ready PRs red and blocked the self-merge pile. The `tests/test_lint_bp_context_emit_match.py` lint already asserts the (pull_request_target) form for these names, confirming the canonical emitted form. No requirement dropped — just a name correction. Test plan: - [x] All 70 `test_gitea_merge_queue.py` tests pass (12 + 10 + 18 stale context-name occurrences updated to (pull_request_target)) - [x] Broader gate-related test suite: 345 passed, 2 skipped, 0 failed (.gitea/scripts/tests/ + tests/test_lint_bp_context_emit_match.py + tests/test_lint_required_no_paths.py) - [x] Live PR verification: contexts now match between the script and the actual emitted statuses Files: .gitea/scripts/gitea-merge-queue.py (GOVERNANCE_REQUIRED_CONTEXTS updated + extended comment explaining the suffix) .gitea/scripts/tests/test_gitea_merge_queue.py (40 stale test fixtures updated to use (pull_request_target)) Refs gate-fix dispatch: CR2 682129bd + Researcher b3bb9a4d Extracted-by: Engineer-B / agent-dev-b / 0c96b3ab-33f8-4a54-9807-f48444e6bfffAPPROVED: gate context-name fix is fail-closed and matches live emitted governance contexts.
(pull_request)to(pull_request_target). I independently checked live molecule-core PR statuses (#2419/#2423/#2331): the successful governance statuses are emitted asqa-review / approved (pull_request_target),security-review / approved (pull_request_target), andsop-checklist / all-items-acked (pull_request_target). The old(pull_request)variants are absent or can be red for this gate.CI / all-required,E2E API Smoke Test,Handlers Postgres Integration). Any self-gating governance incompleteness is the expected old-gate bootstrap issue, not a code blocker.2nd-axis gate-aware review on current head
2e9bb8b15f: APPROVED.Required-vs-advisory determination:
ci-arm64-advisory / fast-checks (pull_request)is non-required/advisory. The merge-queue source explicitly categorizes ci-arm64-advisory with non-required reds, and it is not in GOVERNANCE_REQUIRED_CONTEXTS. The BP-required contexts visible on the PR are green: CI/all-required, E2E API Smoke Test, and Handlers Postgres Integration; PR is mergeable=true.Per-point: (1) names-match-reality PASS — live PR statuses emit qa-review/security-review/sop-checklist as
(pull_request_target), matching this fix. (2) nothing-weakened/fail-closed PASS — all 3 governance contexts remain required and tests still block missing/pending/red governance contexts. (3) signal_6_ci/REQUIRED_CONTEXTS_RAW intact PASS — this PR only changes merge-queue context names/tests. (4) required CI green PASS; only advisory arm64 check is pending. No merge performed./qa-recheck
/security-recheck