RCA: automatic sop-tier-check workflow still fail-opens protected tier gate #2141

Open
opened 2026-06-02 21:31:06 +00:00 by molecule-code-reviewer · 0 comments
Member

MECHANISM
The automatic sop-tier-check workflow can publish a green required check even when .gitea/scripts/sop-tier-check.sh detects a missing tier label or missing required approver team. The workflow step that runs the evaluator has continue-on-error: true, sets SOP_FAIL_OPEN=1, and invokes bash .gitea/scripts/sop-tier-check.sh || true. The script itself honors SOP_FAIL_OPEN=1 for several hard failures by exiting 0. If branch protection requires the native job context sop-tier-check / tier-check (pull_request), the job can be successful while the evaluator’s actual policy result is red.

EVIDENCE
Current molecule-core main inspected at 58dc5f7. sop-tier-check.yml:35-40 says the burn-in mask closed and continue-on-error should not be reintroduced silently. But sop-tier-check.yml:112-131 still has continue-on-error: true, SOP_FAIL_OPEN: '1', and bash .gitea/scripts/sop-tier-check.sh || true. In the evaluator, sop-tier-check.sh:132-134 fails missing tier labels, sop-tier-check.sh:402-408 fails missing approval clauses, while sop-tier-check.sh:70-75, 109-111, 205-207, and 262-264 explicitly exit 0 under SOP_FAIL_OPEN=1 for other hard failures. Log excerpt: SOP_FAIL_OPEN=1.

RECOMMENDED FIX SHAPE
Responsible repo/files: molecule-ai/molecule-core, .gitea/workflows/sop-tier-check.yml and .gitea/scripts/sop-tier-check.sh. Separate runner-dependency failure handling from policy result. The protected status must reflect tier policy truth: missing tier label, missing required team approval, invalid token, or unreadable org/team state should not produce a green protected context. If jq install flakiness still needs fail-open treatment, confine that to an explicit non-protected diagnostic context or make the script post an explicit failure status before exiting. Add workflow/script tests proving missing tier label and missing medium/high approval do not result in a successful protected sop-tier-check / tier-check context. This is a sibling to #2140, which covers the manual refire path.

MECHANISM The automatic `sop-tier-check` workflow can publish a green required check even when `.gitea/scripts/sop-tier-check.sh` detects a missing tier label or missing required approver team. The workflow step that runs the evaluator has `continue-on-error: true`, sets `SOP_FAIL_OPEN=1`, and invokes `bash .gitea/scripts/sop-tier-check.sh || true`. The script itself honors `SOP_FAIL_OPEN=1` for several hard failures by exiting 0. If branch protection requires the native job context `sop-tier-check / tier-check (pull_request)`, the job can be successful while the evaluator’s actual policy result is red. EVIDENCE Current molecule-core main inspected at `58dc5f7`. `sop-tier-check.yml:35-40` says the burn-in mask closed and continue-on-error should not be reintroduced silently. But `sop-tier-check.yml:112-131` still has `continue-on-error: true`, `SOP_FAIL_OPEN: '1'`, and `bash .gitea/scripts/sop-tier-check.sh || true`. In the evaluator, `sop-tier-check.sh:132-134` fails missing tier labels, `sop-tier-check.sh:402-408` fails missing approval clauses, while `sop-tier-check.sh:70-75`, `109-111`, `205-207`, and `262-264` explicitly exit 0 under `SOP_FAIL_OPEN=1` for other hard failures. Log excerpt: `SOP_FAIL_OPEN=1`. RECOMMENDED FIX SHAPE Responsible repo/files: `molecule-ai/molecule-core`, `.gitea/workflows/sop-tier-check.yml` and `.gitea/scripts/sop-tier-check.sh`. Separate runner-dependency failure handling from policy result. The protected status must reflect tier policy truth: missing tier label, missing required team approval, invalid token, or unreadable org/team state should not produce a green protected context. If jq install flakiness still needs fail-open treatment, confine that to an explicit non-protected diagnostic context or make the script post an explicit failure status before exiting. Add workflow/script tests proving missing tier label and missing medium/high approval do not result in a successful protected `sop-tier-check / tier-check` context. This is a sibling to #2140, which covers the manual refire path.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2141