CI: a failed change classifier runs the full suite, then fails (PLAT-986) #345
Loading…
Reference in a new issue
No description provided.
Delete branch "ci-opt/plat-986-scope-fail-closed"
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?
PLAT-986 follow-up to #344. Before this PR, a failed change classifier left
ci / checkred but skipped the Rust steps and both dependent jobs, so the full suite never ran. It now falls back to the full suite and still fails, the same fix gerri asked for on regent#399.What changes in
.forgejo/workflows/ci.yml.Classify the changehascontinue-on-error: true.content(steps.scope.outcome != 'success' || steps.scope.outputs.scope != 'content').Fail when classification failedturnscheckred when the classifier failed or gave no valid scope (contentorfull).scopeisfullunless the classifier succeeded.classifiedisokonly for a successful classifier with a valid scope.coverageandlive-e2enow run whencheckpassed, or whencheckfailed after a failed or empty classification. Acheckthat is red for any other reason still skips them, as before.Testing.
scripts/ci-scope-fj.test.shchecks each condition in the workflow text. Eight deliberate breakages were all caught: dropping the outcome check, droppingcontinue-on-error, the final step withoutalways(), the final step without the scope check, the job output without its fallback,classifiedignoring the scope, the inverted dependent condition, and the dependent condition without!cancelled().forgejo-runner exec(v13.2.1) in a synthetic workflow:checkTime to green. No change to any successful path. A content-only PR still runs only the classifier, and a full one runs exactly what it ran before.
Self-review: two rounds. The first found that the dependent jobs still skipped after a classifier failure, and a test run surfaced the empty-scope case; both are fixed here.
Automated Codex review (read-only) of head
3c6c55f332..forgejo/workflows/ci.yml:126(also line 186): The invariant is that dependent jobs run after a failedcheckonly when classification itself failed or returned an invalid scope. If checkout or the preceding classifier tests fail, the classifier is skipped, leavingclassifiedasfailed. Both coverage and live-e2e then run despite an unrelatedcheckfailure. For example, a regression caught byci-scope-fj.test.shstarts both dependent jobs, consuming runner capacity and invoking the live API when the PR says they would remain skipped. This is introduced by the new fallback condition. Export a distinct state for a classifier that actually ran and failed or returned an invalid scope, and require that state when allowing dependent jobs after a failedcheck. Cover the skipped-classifier path for both jobs.BLOCKING: 1
Reviewed head
3c6c55f332at 2026-12-02T16:26:31Z by codex exec (read-only sandbox).Automated Codex review (read-only) of head
2561e748ff..forgejo/workflows/ci.yml:126and.forgejo/workflows/ci.yml:186: The invariant is that dependent jobs run after a failedcheckonly when classification failed. If checkout or the classifier test step fails before the classifier runs,classifiedandscopedo not indicate a successful classification. Both dependent conditions therefore pass, starting coverage and live E2E despite an unrelatedcheckfailure. A transient checkout or network failure can trigger two expensive jobs and live API calls that previously would have been skipped. This belongs in the PR because both dependent conditions changed and the body explicitly promises the old behavior for other failures. Export a distinct state that proves the classifier ran and failed, and require that state in both conditions. Add a workflow-level test for a failure before classification.BLOCKING: 1
Reviewed head
2561e748ffat 2026-12-02T18:56:08Z by codex exec (read-only sandbox).gerri's Medium at
2561e748is fixed in154220e, in one push.The problem. A failure before the classifier (checkout, or the classifier self-test) left
classifiednotok, so coverage and live-e2e started after an unrelatedcheckfailure.The fix.
classifiedis nowok(a valid scope),failed(the classifier ran and failed, or gave no valid scope) ornot-run(checkfailed before it).checkonly whenclassifiedisfailed.!= 'ok', and they now assert the new conditions and the final step'sexit 1. Seven mutations were checked; all were caught.Runner check. I ran these exact expressions through
forgejo-runner execv13.2.1 on a synthetic workflow (the repo's CI can't run a runner inside a job):checkcontent, then failsAutomated Codex review (read-only) of head
154220e113.scripts/ci-scope.shmakes those tests fail, so the classifier never runs, the Rust steps are skipped, andclassifiedbecomesnot-run. Both coverage and live-e2e then skip. This is a plausible classifier regression on the supported PR workflow and leaves the failure mode this PR intends to fix. Make classifier-test failures trigger the full-suite fallback too, while keepingcheckred, and test that path through both dependent jobs.BLOCKING: 1
Reviewed head
154220e113at 2026-12-02T20:11:18Z by codex exec (read-only sandbox).gerri's Medium at
154220eis fixed in8a01ed0, in one push.The problem. The classifier self-tests and the content-unread guard ran in their own step before the classifier. A broken classifier failed them, so the classifier never ran and the suite skipped.
The fix.
continue-on-errorclassifier step. Any failure there falls back like a failed classification: every Rust step, coverage and live-e2e run, andcheckfails.CI_EVENT,CI_BASE_SHA,CI_HEAD_SHAandGITHUB_OUTPUTunset.scope=lines to the step's output file. A classifier that exited 0 without writing would then have taken a stale value.Runner check (
forgejo-runner exec, a synthetic workflow with the same expressions), new case: a self-test fails before any output is written.checkgoes red, every step runs, and coverage runs with scope=full and classified=failed. The earlier six cases are unchanged.Automated Codex review (read-only) of head
8a01ed0f41.checkfails for a reason other than classification. If classification fails and a later Rust step also fails,classifiedremainsfailed, so both coverage and live-e2e run despite the second failure. This is a simultaneous-failure case, but it contradicts the stated behavior. Export whether a non-classifier step failed and include that in both dependent-job conditions.BLOCKING: 0
Reviewed head
8a01ed0f41at 2026-12-02T21:00:14Z by codex exec (read-only sandbox).