Repository navigation
ci: defer the Kind smoke on draft PRs - #1286
Conversation
781e6d3 to
fef42c0
Compare
de494f3 to
5b8b0ea
Compare
ac-pplx
left a comment
There was a problem hiding this comment.
Pull CI runs the Kind/Firecracker smoke, eight billed 16-core shards, on every push of a pull request that changes a Kind path, drafts included, and drafts cannot merge. This PR defers the smoke while the PR is a draft (unless it carries kind-smoke) and reruns Pull CI on ready_for_review, so Kind runs on the head that can merge. The deferral itself works: the probe PR #1291 shows the notice, KIND_NEEDED: false and a skipped Kind on the draft, then Kind on the same head once marked ready.
The gap is what space-pull-ci shows on that head in between, from the same probe:
14:03:52 opened as a draft -> run A defers Kind; space-pull-ci SUCCESS at 14:09:34
14:10:05 marked ready -> run B starts on the same head and runs Kind
14:10-14:30 the only space-pull-ci check run on the head is A's success
(B's space-pull-ci job is created at 14:30:01, once its needs finish)
Verdict: Changes requested; 2 threads.
Before merge (inline threads)
- A run that skipped Kind can stand as the head's required check after the PR is ready
- The contributor docs and two headers describe the rule incompletely
Nits
16-core runners are the only Actions minutes a public repository pays for, and Kind shards use most of them. Kind reruns on every push of a PR that changes a Kind path, and most of those runs were drafts' intermediate pushes. Pull CI now also triggers on ready_for_review. While a PR is a draft, kind-pull-needed.sh answers `deferred` for a Kind path unless the PR carries the kind-smoke label, read from the event, so the label applies from the next push. A deferred run skips Kind and fails space-pull-ci with a notice, so a pull request cannot merge on a run that skipped Kind: not on a draft-time success that is still the head's only check while the ready run's Kind is in progress, and not on a rerun of a draft-time run. Marking the PR ready runs the smoke on the same head.
5b8b0ea to
a60ffe4
Compare
|
Thanks for the review. Both threads are fixed in a60ffe4. Nits:
|
ac-pplx
left a comment
There was a problem hiding this comment.
Round 2 at a60ffe4. Every item from the last review is fixed:
- A draft that changes a Kind path now answers
deferred, and the gate fails it. So a Kind-skipped run can no longer stand as a ready head's required check: not in the window before the ready run'sspace-pull-ciposts, not on a re-run of a draft-time run, and not when a late push run cancels the ready run. The probe at this head shows it end to end (run):KIND_NEEDED: deferred, Kind skipped,space-pull-cifailed with the deferral message. - CONTRIBUTING, both headers, the workflow comment and the commit message now describe the rule as it runs. Each holds on every path I checked: an unlabelled Kind-path draft, a labelled draft, a draft with no Kind path, and a draft converted back from ready.
- With the cancelled-run fallback now on main, a deferred run ends as a failure, so the fallback cannot take it as the passing sibling. The two edits merge cleanly.
Verdict: Approved.
Summary
A draft PR no longer runs the Kind smoke on every push. While a Kind-path PR is a draft, Kind is deferred and
space-pull-cifails, so it cannot merge on a run that skipped Kind. The smoke runs when the PR is marked ready for review, or from the next push after the newkind-smokelabel is added.Why. On a public repository, GitHub-hosted larger runners are the only Actions minutes that are billed, and the Kind shards use most of ours. Kind job data for 2026-10-30 to 2026-11-01 (about 2.3 days):
What changes.
ready_for_review.ci/scripts/kind-pull-needed.shanswersdeferred, with a "Kind smoke deferred" notice. Kind does not run, andspace-pull-ci's gate fails with the reason.space-pull-cifor about 20 minutes after the PR is marked ready, while the ready run's Kind is still in progress. A rerun of a draft-time run would also defer again and post a newer green. Either could let an approved PR merge without Kind on its final head; a failing deferral closes both.kind-smokelabel opts a draft in. The label is read from the event, so it applies from the next push.CONTRIBUTING.mdtells contributors when Kind runs, that converting back to a draft defers it again, and that someone with triage access addskind-smoke.Expected savings, as shares of the 16-core runner cost:
An earlier head of this PR also moved the shards to 8-core runners. On one run (run) that cut the run's cost by about 38% but made it 3.6 minutes slower: 24.4 min against 20.8 on 16 cores, with bring-up 38% slower. Latency matters more than cost here, so the shards stay on 16 cores.
Validation
ci/scripts/test-kind-pull-needed.shpasses in a Linux container. Its new cases cover:It fails on main's version of the selector.
Pull CI's YAML parses.
In CI, with disposable probes:
deferred, skipped Kind and failedspace-pull-ciwith the deferral message (run).Severity and risk
Severity: does not apply; this is a CI cost reduction.
Risk:
space-pull-ciuntil it is ready or opted in.AI assistance: Claude Code drafted the change, its tests and this description.
🤖 Generated with Claude Code