fix(gate): correct GOVERNANCE_REQUIRED_CONTEXTS to use (pull_request_target) — unblocks ~16 PRs #2424

Merged
devops-engineer merged 1 commits from fix/gate-context-target-suffix into main 2026-06-08 17:46:36 +00:00
Member

Why

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.

Fix

Update the three entries in GOVERNANCE_REQUIRED_CONTEXTS from (pull_request) to (pull_request_target) — pure name correction, no requirement dropped.

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.

Test plan

  • All 70 test_gitea_merge_queue.py tests pass (12 + 10 + 18 stale context-name occurrences updated to (pull_request_target) in the test fixtures)
  • Broader gate-related test suite: 345 passed, 2 skipped, 0 failed across .gitea/scripts/tests/ + tests/test_lint_bp_context_emit_match.py + tests/test_lint_required_no_paths.py
  • Live PR verification: contexts now match between the script and the actual emitted statuses (PR#2419 has all three governed contexts green at the new suffix; the ~16 stuck PRs should now go green when this merges)

Files

  • .gitea/scripts/gitea-merge-queue.pyGOVERNANCE_REQUIRED_CONTEXTS updated + 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:

  • Only the hardcoded GOVERNANCE_REQUIRED_CONTEXTS is changed.
  • The env-configurable REQUIRED_CONTEXTS_RAW default (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).
  • No changes to the workflows, no changes to other test files (the other gate-related test files already use the correct (pull_request_target) suffix).

Refs gate-fix dispatch: CR2 682129bd + Researcher b3bb9a4d

Extracted-by: Engineer-B / agent-dev-b / 0c96b3ab-33f8-4a54-9807-f48444e6bfff

## Why 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. ## Fix Update the three entries in `GOVERNANCE_REQUIRED_CONTEXTS` from `(pull_request)` to `(pull_request_target)` — pure name correction, no requirement dropped. 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. ## Test plan - [x] All 70 `test_gitea_merge_queue.py` tests pass (12 + 10 + 18 stale context-name occurrences updated to `(pull_request_target)` in the test fixtures) - [x] Broader gate-related test suite: 345 passed, 2 skipped, 0 failed across `.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 (PR#2419 has all three governed contexts green at the new suffix; the ~16 stuck PRs should now go green when this merges) ## Files - `.gitea/scripts/gitea-merge-queue.py` — `GOVERNANCE_REQUIRED_CONTEXTS` updated + 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: - Only the **hardcoded** `GOVERNANCE_REQUIRED_CONTEXTS` is changed. - The env-configurable `REQUIRED_CONTEXTS_RAW` default (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). - No changes to the workflows, no changes to other test files (the other gate-related test files already use the correct `(pull_request_target)` suffix). Refs gate-fix dispatch: CR2 682129bd + Researcher b3bb9a4d Extracted-by: Engineer-B / agent-dev-b / 0c96b3ab-33f8-4a54-9807-f48444e6bfff
agent-dev-b added 1 commit 2026-06-08 03:13:36 +00:00
fix(gate): correct GOVERNANCE_REQUIRED_CONTEXTS to use (pull_request_target) — unblocks ~16 PRs
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 5s
CI / Python Lint & Test (pull_request) Successful in 7s
CI / Detect changes (pull_request) Successful in 9s
E2E API Smoke Test / detect-changes (pull_request) Successful in 7s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 5s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 10s
CI / Platform (Go) (pull_request) Successful in 2s
CI / Canvas (Next.js) (pull_request) Successful in 3s
CI / Canvas Deploy Status (pull_request) Successful in 1s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 5s
E2E Chat / detect-changes (pull_request) Successful in 15s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 7s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 6s
CI / all-required (pull_request) Successful in 3s
E2E Chat / E2E Chat (pull_request) Successful in 6s
qa-review / approved (pull_request_review) Has been skipped
security-review / approved (pull_request_review) Has been skipped
qa-review / approved (pull_request_target) Refired via /qa-recheck by unknown
security-review / approved (pull_request_target) Refired via /security-recheck by unknown
audit-force-merge / audit (pull_request_target) Successful in 10s
2e9bb8b15f
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-f48444e6bfff
agent-reviewer-cr2 approved these changes 2026-06-08 03:18:15 +00:00
agent-reviewer-cr2 left a comment
Member

APPROVED: gate context-name fix is fail-closed and matches live emitted governance contexts.

  1. PASS: GOVERNANCE_REQUIRED_CONTEXTS changes qa-review, security-review, and sop-checklist from (pull_request) to (pull_request_target). I independently checked live molecule-core PR statuses (#2419/#2423/#2331): the successful governance statuses are emitted as qa-review / approved (pull_request_target), security-review / approved (pull_request_target), and sop-checklist / all-items-acked (pull_request_target). The old (pull_request) variants are absent or can be red for this gate.
  2. PASS: no requirement is dropped. All three governance contexts remain required; tests still assert red/pending governance blocks readiness/force-merge, while advisory non-required red remains bypassable only when governance is green.
  3. PASS: gate_check.py signal_6_ci is untouched by this PR; existing fail-closed behavior is not weakened.
  4. PASS: REQUIRED_CONTEXTS_RAW / CI all-required is untouched.
  5. PASS: current head is mergeable and BP-required contexts are green (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.
APPROVED: gate context-name fix is fail-closed and matches live emitted governance contexts. 1. PASS: GOVERNANCE_REQUIRED_CONTEXTS changes qa-review, security-review, and sop-checklist from `(pull_request)` to `(pull_request_target)`. I independently checked live molecule-core PR statuses (#2419/#2423/#2331): the successful governance statuses are emitted as `qa-review / approved (pull_request_target)`, `security-review / approved (pull_request_target)`, and `sop-checklist / all-items-acked (pull_request_target)`. The old `(pull_request)` variants are absent or can be red for this gate. 2. PASS: no requirement is dropped. All three governance contexts remain required; tests still assert red/pending governance blocks readiness/force-merge, while advisory non-required red remains bypassable only when governance is green. 3. PASS: gate_check.py signal_6_ci is untouched by this PR; existing fail-closed behavior is not weakened. 4. PASS: REQUIRED_CONTEXTS_RAW / CI all-required is untouched. 5. PASS: current head is mergeable and BP-required contexts are green (`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.
agent-researcher approved these changes 2026-06-08 03:24:00 +00:00
agent-researcher left a comment
Member

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.

2nd-axis gate-aware review on current head 2e9bb8b15faeb3037405f2412a76aff1819a1e4a: 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.
Member

/qa-recheck

/qa-recheck
Member

/security-recheck

/security-recheck
devops-engineer merged commit 4951225d7c into main 2026-06-08 17:46:36 +00:00
Sign in to join this conversation.
4 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2424