Repository navigation
Score a job GitHub never scheduled as dropped, not as a script error - #116648
Conversation
GitHub Actions reports an undocumented fifth `needs.<job>.result` value,
`abandoned`, for a job it queued and never assigned a runner. The classifier in
`_finish_workflow` matched only `cancelled`/`canceled`, so such a job fell
through to the `else` branch and was scored `ERROR` with
`ResultInfo.NOT_FINALIZED` ("Job failed to produce Result due to a script error
or CI runner issue") for a job that executed zero commands. `is_cancelled` was
never set, and the `Mergeable Check` status then read
`Failed: <job name>`, naming a job that never started. Once the node is `ERROR`
it is `is_completed()`, so a re-run's carried-forward `cancelled` record could
not repair it either.
Measurement: verdicts were read out of the `Finish Workflow` job logs, where the
`toJson(needs)` heredoc is echoed (jobs 98272432828 and 98250718152). Matching
every `needs` key against the jobs API across 4 attempts gives 688 job/verdict
pairs with zero off-diagonal: `abandoned` pairs with a zero-step cancelled job
10/10 and `cancelled` 8/8, while `success`/`skipped` account for the other 670.
`abandoned` appears nowhere else in `ci/` or `.github/`, and this line is the
only reader of a `needs` verdict in the repository; the jobs and check-runs APIs
report `cancelled` for the same job, so the two `.github/` conclusion
classifiers are unaffected.
The note says "did not finish" rather than "did not run" because the branch is
shared with mid-run cancels: `runner.py` `_pre_run` publishes a `RUNNING` result
before the job body, so a node reaching here may genuinely have started. The
interpolated verdict token keeps the distinction between a job that never
started and one killed mid-run.
This deliberately does not unblock the merge. `dropped_results` keeps the merge
status at `FAIL` and `DROPPED` still maps to a GitHub `error` status, so a check
that did not run is not laundered into green; only the description changes, from
`Failed: <job name>` to `Failed: 0, Dropped: 1`. Nothing here retries or
reschedules a job.
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 3 findings). I fixed none of them
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20260827-050500 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-7:20260827-041000 |
|
Workflow [PR], commit [9685355] Summary: ✅ AI ReviewSummaryThis PR teaches Tests
Final Verdict
|
|
cc @leshikus, could you review this? It adds GitHub's undocumented |
| gh_job_result = (gh_job.get("result") or "").lower() | ||
| if gh_job_result in ("cancelled", "canceled"): | ||
| # `abandoned` is GitHub's undocumented verdict for a job it queued and never assigned a runner. | ||
| if gh_job_result in ("cancelled", "canceled", "abandoned"): |
There was a problem hiding this comment.
This changes the contract for unfinished-job classification, but there is still no committed regression that feeds _finish_workflow an abandoned verdict. The focused test we already have in ci/tests/test_result.py only pins the fallback ERROR path, so dropping abandoned from this tuple would still pass CI and silently reintroduce the mis-scoring this PR is fixing.
Please add a small arm that writes an abandoned entry into workflow_status.json and asserts the job node becomes DROPPED, carries the new note, and does not emit the NOT_FINALIZED workflow error.
There was a problem hiding this comment.
Confirmed by measurement, and the gap is total rather than partial: with abandoned removed from the tuple, every committed test that exercises _finish_workflow still passes (test_result.py, test_pipeline_status_non_blocking.py, test_job_filtering.py, 85 passed on both trees). abandoned occurs nowhere else under ci/ or .github/, and the one source-inspecting test reads only allow_failure, so nothing committed pins this.
I wrote the arm you specified and ran it rather than declining on principle. It is load-bearing:
| tree | node DROPPED |
carries the note | no NOT_FINALIZED |
|---|---|---|---|
| this branch | pass | pass | pass |
abandoned removed from the tuple |
fail | fail | fail |
add_note line deleted |
pass | fail | pass |
Two controls hold in all three trees: a cancelled verdict still becomes DROPPED, and an unrecognized verdict still reaches ERROR with NOT_FINALIZED. So the first mutant is narrow rather than a blanket break, and the note assertion is not carried by the status assertion.
I am not committing it, and the reason is the location rather than the arm. #115650 deletes ci/tests/test_result.py, ci/jobs/ci_tests_job.py and the CI Tests job definition; it is open and mergeable, and its predecessor #114675 merged at +0/-6543. AGENTS.md line 190: "When you want to test changes in the CI scripts, you can write and run a throwaway test, but you don't need to commit it to the repository, because we don't have automated CI tests." That is the form I used, and the description now records that the change is verified but unpinned.
2a521ee
Related: #116260 (witness, one abandoned job)
Related: #113737 (witness, eight of them, surviving two re-runs)
Related: #115745 (why the retry layer is untouched; no open issue exists for this class)
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Nothing here retries, reschedules or filters any job. The change is only how praktika scores a job that produced no result.
GitHub reports an undocumented fifth
needs.<job>.resultvalue,abandoned, for a job it queued and never assigned a runner._finish_workflowmatched onlycancelled/canceled, so such a job fell through to theelsebranch and was scoredERRORwithJob failed to produce Result due to a script error or CI runner issuefor a job that ran zero commands.Mergeable Checkthen saidFailed: <job name>, naming a job that never started, andis_cancelledwas never set. Once the node isERRORit isis_completed, so a re-run's carried-forwardcancelledrecord cannot repair it either.I read the verdicts out of the
Finish Workflowjob logs, where thetoJson(needs)heredoc is echoed: jobs 98272432828 and 98250718152. Matching everyneedskey against the jobs API over 4 attempts gives 688 job/verdict pairs with zero off-diagonal:abandonedpairs with zero-step-cancelled 10/10,cancelled8/8. Report for one witness: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=116260&sha=9dd6a67f4ee2c7272ae707a47769a9a9efdcefbe&name_0=PRThe merge gate deliberately still blocks:
dropped_resultskeepsMergeable Checkat FAIL andDROPPEDstill maps to a GitHuberrorstatus, so a check that did not run is not laundered into green. Only the description changes, fromFailed: <job name>toFailed: 0, Dropped: 1.Out of scope, and disclosed: the abandonment itself is GitHub-side with no in-repo lever, and job retry lives in the out-of-repo Lambda, per @ maxknv on #115745. The class is episodic rather than steady - it took 10 jobs across two of my PRs on 2026-08-26, while a 300-run sample of
pull_request.ymlruns started over the following 11 hours holds none.Nothing committed pins this: #115650 removes
ci/testsand theCI Testsjob, so I validated with a throwaway harness perAGENTS.md.Workflow [PR]
Sync PR [sync-upstream/pr/116648]
Version info
26.9.1.1110(included in26.9and later)