Skip to content

Retry a PR run whose failing jobs GitHub never ran - #124479

Merged
alexey-milovidov merged 2 commits into
ClickHouse:masterfrom
groeneai:retry-run-whose-failed-jobs-never-ran
Oct 11, 2026
Merged

alexey-milovidov merged 2 commits into
ClickHouse:masterfrom
groeneai:retry-run-whose-failed-jobs-never-ran

Conversation

@groeneai

@groeneai groeneai commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #115569

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Description

When GitHub queues PR jobs and never gives them a runner, as in the 2026-10-07 Actions outage, the run concludes failure but no listed job does: the jobs either vanish from the run's job listing or stay listed as queued with conclusion: null. praktika scores them DROPPED, so Mergeable Check is red with no test signal, e.g. runs 37627725265 (#121522) and 37633013469 (#123293), both Failed: 0, Dropped: 3, and 37620918397 (#123798, Failed: 0, Dropped: 85).

retry_infra_failures.yml builds its verdicts only from jobs that concluded failure and treats an empty list as "nothing to retry", so it skips these runs: the 17:50Z and 18:55Z ticks both logged Not an infrastructure failure, skipping. for 37627725265. The PR stays red until the next push.

The empty-verdict branch now reruns when the listing is non-empty and every listed job is success, skipped, neutral or null. A listed timed_out, cancelled or action_required job, or an empty listing, keeps the old outcome. Same class as #115569.

Validation: the classification block, extracted from the file before and after, was replayed over the job listings of all 261 failed PR runs created between 2026-10-06 12:55Z and 2026-10-07 17:36Z. Only the 9 runs in this shape change decision; the other 252 are unchanged. The old side matches every decision in the two real tick logs.


Workflow [PR]
Sync PR [sync-upstream/pr/124479]

Version info

  • Merged into: 26.10.1.2163-master (included in 26.10 and later)

When GitHub queues jobs and never gives them a runner, the run concludes
`failure` while no listed job concluded `failure`: the jobs either vanish
from the run's job listing ("abandoned") or stay listed as queued with
`conclusion: null`. praktika scores them DROPPED, so `Mergeable Check` is
red with `Failed: 0, Dropped: N`, but the empty-verdict branch treated
"no failed job" as "nothing to retry", so the run stayed red until the
next push.

Rerun when the listing is non-empty and every listed job is `success`,
`skipped`, `neutral` or `null`. A listed `timed_out`, `cancelled` or
`action_required` job, or an empty listing, keeps the old outcome.

Replayed over the 261 failed PR runs created 2026-10-06 12:55Z to
2026-10-07 17:36Z: only the 9 runs in this shape change decision (e.g.
37627725265, skipped by the 17:50Z and 18:55Z ticks).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect labels Oct 7, 2026
@groeneai

groeneai commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (4 nits, none blocking).

# Sev Finding Verdict Evidence / action
1 💡 The unchanged heading # Infrastructure failure = at least one failed job, and all of them are infra no longer covers the empty-verdict arm AGREE, noted The comment inside the new arm states the exception; not blocking
2 💡 A run rerun by someone else between the listing and the jobs fetch shows an in-progress attempt, which matches the new predicate DISAGREE Same path as today for an in-progress attempt with an early infra failure: gh run rerun is refused and logged as Failed to trigger rerun, not counted toward MAX_RERUNS
3 💡 An empty job listing is still not retried DISAGREE None of the 261 replayed failed runs has an empty listing; the old outcome is kept for a shape with no observed producer
4 💡 Run 37598700864 (#124043) is rerun although its Mergeable Check was already green AGREE, noted One bounded rerun per run (attempt guard); praktika reuses successful job results (enable_cache=True)

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-9:20261007-195400

@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Oct 7, 2026
@groeneai

groeneai commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. Offline replay of the classification block over the captured job listings: the old code returns should_rerun=false for run 37627725265 every time, as both real ticks logged.
b Root cause explained? Verdicts come only from jobs with conclusion: failure. A job GitHub never ran is absent or null, so the verdict list is empty, and the empty arm was a no-op.
c Fix matches root cause? Yes. The empty arm now decides from the full listing. No existing classification is widened.
d Test intent preserved / new tests added? No CI-side test (this workflow has none upstream). Validated by replay over 261 real failed runs, 11 synthetic listings and 3 mutations.
e Both directions demonstrated? Old -> new: exactly the 9 runs in this shape flip false -> true; the other 252 are unchanged.
f Fix is general across code paths? The S3 fallback, Config Workflow check, attempt guard and MAX_RERUNS are unchanged in outcome.
g Fix generalizes across inputs (params/datatypes/wrappers)? null/success/skipped/neutral rerun; timed_out/cancelled/action_required/failure and an empty listing do not; multi-page listings are tested both ways.
h Backward compatible? (maintainer-approved exception only) N/A: CI workflow, no setting or format.
i Invariants and contracts preserved? At most one extra rerun per run (the attempt guard excludes the rerun's attempt). jq -e inside if does not trip set -e.

Session id: cron:clickhouse-impl-slot-7:20261007-192300

@clickhouse-gh

clickhouse-gh Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [da5f026]

Summary: ✅


AI Review

Summary

This PR teaches retry_infra_failures.yml to rerun failed PR workflows whose failed state came from jobs GitHub never actually started, and it now guards that empty-verdict path by verifying the run is still on the same failed attempt before rerunning. I do not see a remaining correctness issue in the current patch.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Oct 7, 2026
The empty-verdict branch classifies `runs/<id>/jobs`, which lists the
latest attempt, while the `failure` status comes from the run listing
made at the start of the tick. The jobs predicate is also true for any
green run, so a run that a human or `clickhouse-gh[bot]` reran after
the listing and that went green before the loop reached it would be
rerun again, spending one of MAX_RERUNS. The window is real: the
partition walk takes ~5.5 min (tick 37685019106: listing 20:50:09Z,
first classification 20:55:46Z), and green rerun attempts as short as
121 s were measured.

Require the run to still be at the listed attempt and concluded
`failure` before taking that branch. The probe runs only when the jobs
predicate already holds; a failed probe skips the rerun.

Replay over the same 261 failed runs is decision-identical when the
listed attempt is still the failed one, and the probe fires only on the
9 runs in the dropped-jobs shape.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov alexey-milovidov self-assigned this Oct 11, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 11, 2026
Merged via the queue into ClickHouse:master with commit 72d7d88 Oct 11, 2026
152 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect manual approve Manual approve required to run CI pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants