|
27 | 27 | merge_group: |
28 | 28 | # ── THE SCHEDULED FULL RUN (#16467), the half this file owns ───────────── |
29 | 29 | # Every 4 hours since #25771 (maintainer ruling Q6 = C), the same cadence as |
30 | | - # ci.yml's half and for the reason stated there; no step changed. |
| 30 | + # ci.yml's half and for the reason stated there. |
| 31 | + # |
| 32 | + # ⭐ IT SKIPS WHEN THE PUSH RUN ALREADY COVERED THE COMMIT (#26071, ruling |
| 33 | + # 6416984681, letter A (i)). A scheduled run tests `main`'s head, and the |
| 34 | + # push run of that same commit ran the same battery over the same tree: on |
| 35 | + # `push` the selector keeps every family and the workspace type check takes |
| 36 | + # the whole universe, exactly as on `schedule`. Measured on 2026-10-28: all 12 |
| 37 | + # newest scheduled runs repeated a commit whose push run had already ended |
| 38 | + # `success`. So the `schedule-gate` job (first under `jobs:`) asks the runs |
| 39 | + # API for a completed `push` run of THIS workflow on `github.sha` that |
| 40 | + # concluded `success`; when there is one, every lane skips and the two |
| 41 | + # aggregates skip with them, and the run concludes `success` with one ran |
| 42 | + # job. ⛔ It fails CLOSED toward running: no answer, an error, a 403 or a |
| 43 | + # body it cannot read all mean "run the battery". Only `schedule` is gated: |
| 44 | + # on `push`, `pull_request`, `merge_group` and `workflow_dispatch` the gate |
| 45 | + # job is skipped, its output reads empty, and every lane runs as before. |
| 46 | + # ci.yml's scheduled run is NOT gated: there `push` tests the affected set |
| 47 | + # only, and the schedule is the full battery. |
| 48 | + # |
31 | 49 | # The card's ruling is that the scheduled run covers BOTH required-context |
32 | 50 | # files, not just ci.yml, and the reason is measured rather than symmetric: |
33 | 51 | # the push-on-`main` run of THIS workflow is the only post-merge full-battery |
|
42 | 60 | # |
43 | 61 | # The selector already treats every event that is neither `merge_group` nor |
44 | 62 | # `pull_request` as "run every family", so this trigger alone restores the |
45 | | - # full battery here — no step in this file changes. |
| 63 | + # full battery here — no step in this file changes. That same sentence is |
| 64 | + # why the gate above may skip it: the push run of the commit already ran it. |
46 | 65 | # |
47 | 66 | # ⛔ A NEW TRIGGER KEY, not a widening of `push:`; see ci.yml's `on:` block. |
48 | 67 | schedule: |
@@ -197,6 +216,61 @@ concurrency: |
197 | 216 |
|
198 | 217 | jobs: |
199 | 218 |
|
| 219 | + schedule-gate: |
| 220 | + # ── THE SCHEDULED RUN'S SKIP (#26071, ruling 6416984681, letter A (i)) ─── |
| 221 | + # The why is the `on:` block's ⭐ note. This job runs on `schedule` only, and |
| 222 | + # every other job in this file needs it and carries the same `if:`: |
| 223 | + # |
| 224 | + # if: ${{ !cancelled() && needs.schedule-gate.outputs.skip != 'true' }} |
| 225 | + # |
| 226 | + # On every other event this job is SKIPPED, a skipped job's outputs read as |
| 227 | + # the empty string, and `!cancelled()` lets a job run past a skipped (or a |
| 228 | + # failed) need, so each lane runs exactly as it did before this job existed. |
| 229 | + # The two aggregates keep `always()` and add one schedule-only conjunct: |
| 230 | + # they skip only on a scheduled run whose lanes skipped, never on a PR or a |
| 231 | + # queue build, where a skipped required context would read as green. |
| 232 | + # |
| 233 | + # ⛔ FAIL CLOSED TOWARD RUNNING. Only a positive answer skips: a completed |
| 234 | + # `push` run of THIS workflow on `github.sha`, concluded `success`, read |
| 235 | + # from the runs API. A failed read, a 403, a body that does not parse, no |
| 236 | + # such run, or a push run still in progress all leave `skip=false`, and a |
| 237 | + # crash of this job leaves the output empty, which also runs the lanes. |
| 238 | + name: Schedule gate · skip when a green push run covers the commit |
| 239 | + if: github.event_name == 'schedule' |
| 240 | + runs-on: ubuntu-latest |
| 241 | + # The job-wall rule's floor (see the `lint` job): one API read, no checkout. |
| 242 | + timeout-minutes: 10 |
| 243 | + permissions: |
| 244 | + actions: read |
| 245 | + outputs: |
| 246 | + skip: ${{ steps.probe.outputs.skip }} |
| 247 | + steps: |
| 248 | + - name: Look for a completed green push run on this commit |
| 249 | + id: probe |
| 250 | + env: |
| 251 | + GH_TOKEN: ${{ github.token }} |
| 252 | + OS_GATE_SHA: ${{ github.sha }} |
| 253 | + run: | |
| 254 | + set -uo pipefail |
| 255 | + skip=false |
| 256 | + reason="no completed push run of this workflow on $OS_GATE_SHA concluded success" |
| 257 | + if green=$(gh api "repos/$GITHUB_REPOSITORY/actions/workflows/lint.yml/runs?event=push&branch=main&head_sha=$OS_GATE_SHA&status=completed&per_page=10" \ |
| 258 | + --jq '.workflow_runs[] | select(.event == "push" and .status == "completed" and .conclusion == "success") | "\(.head_sha) \(.id)"' \ |
| 259 | + 2> "$RUNNER_TEMP/schedule-gate.err"); then |
| 260 | + while read -r sha id; do |
| 261 | + if [ -n "$sha" ] && [ "$sha" = "$OS_GATE_SHA" ]; then |
| 262 | + skip=true |
| 263 | + reason="push run $id on $OS_GATE_SHA concluded success: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$id" |
| 264 | + break |
| 265 | + fi |
| 266 | + done <<< "$green" |
| 267 | + else |
| 268 | + reason="the runs API did not answer ($(head -c 300 "$RUNNER_TEMP/schedule-gate.err" | tr '\n' ' ')), so the battery runs" |
| 269 | + fi |
| 270 | + echo "skip=$skip" >> "$GITHUB_OUTPUT" |
| 271 | + echo "schedule-gate: skip=$skip -- $reason" |
| 272 | + echo "schedule-gate: skip=$skip -- $reason" >> "$GITHUB_STEP_SUMMARY" |
| 273 | +
|
200 | 274 | lint: |
201 | 275 | # ⚠️ This `name:` IS the required-status-check context in repository |
202 | 276 | # Settings → Rulesets (a job's check-run name is its `name:`), so it is |
@@ -300,7 +374,12 @@ jobs: |
300 | 374 | # skipped required context is an absence, which reads as green in every |
301 | 375 | # checks list and never blocks the queue. The `typecheck` job carries the |
302 | 376 | # same contract and says so at length. |
303 | | - if: always() |
| 377 | + # The one conjunct after it is the scheduled run's skip (`schedule-gate`): |
| 378 | + # on `schedule` alone, lanes that skipped mean the gate found a green push |
| 379 | + # run on the commit, and this aggregate skips with them rather than reding |
| 380 | + # over lanes that were told not to run. On every other event the |
| 381 | + # conjunct is true and `always()` alone decides, as before. |
| 382 | + if: ${{ always() && !(github.event_name == 'schedule' && contains(needs.*.result, 'skipped')) }} |
304 | 383 | runs-on: ubuntu-latest |
305 | 384 | # ⭐ JOB WALL — measured, and the rule for every job in this file. No step in |
306 | 385 | # this workflow runs under `scripts/run-with-stall-guard.mjs` (if one ever |
@@ -429,6 +508,8 @@ jobs: |
429 | 508 | # test-double contract gate, the two heaviest always-on gates, side by |
430 | 509 | # side. |
431 | 510 | name: Lint · ESLint |
| 511 | + needs: [schedule-gate] |
| 512 | + if: ${{ !cancelled() && needs.schedule-gate.outputs.skip != 'true' }} |
432 | 513 | runs-on: ubuntu-latest |
433 | 514 | # JOB WALL = CHECKOUT BUDGET (20, on the checkout step) + BODY BUDGET, the |
434 | 515 | # scheme `typecheck-source-gates` argues for a full-history checkout. Body |
@@ -511,6 +592,8 @@ jobs: |
511 | 592 | # shared-module self-tests, the PM tooling self-tests, the Claude hook |
512 | 593 | # guards, the docs authoring gates and both censuses. |
513 | 594 | name: Lint · repo & tooling gates |
| 595 | + needs: [schedule-gate] |
| 596 | + if: ${{ !cancelled() && needs.schedule-gate.outputs.skip != 'true' }} |
514 | 597 | runs-on: ubuntu-latest |
515 | 598 | # JOB WALL = CHECKOUT BUDGET (20) + BODY BUDGET, `typecheck-source-gates`' |
516 | 599 | # scheme. Body after the checkout, rebuilt per run from the 70 runs the |
@@ -1934,6 +2017,8 @@ jobs: |
1934 | 2017 | # symbol anchors, and the product-code guards (CLI, error codes, routes, |
1935 | 2018 | # logging, the objectui pin). |
1936 | 2019 | name: Lint · docs & code guards |
| 2020 | + needs: [schedule-gate] |
| 2021 | + if: ${{ !cancelled() && needs.schedule-gate.outputs.skip != 'true' }} |
1937 | 2022 | runs-on: ubuntu-latest |
1938 | 2023 | # JOB WALL = CHECKOUT BUDGET (20) + BODY BUDGET, `typecheck-source-gates`' |
1939 | 2024 | # scheme. Body after the checkout, rebuilt per run from the 70 runs the |
@@ -2953,6 +3038,8 @@ jobs: |
2953 | 3038 | # them), the engine and packaging gates, and the issue-citation gate, |
2954 | 3039 | # which is why this lane alone reads issues and pull requests. |
2955 | 3040 | name: Lint · CI, release & engine gates |
| 3041 | + needs: [schedule-gate] |
| 3042 | + if: ${{ !cancelled() && needs.schedule-gate.outputs.skip != 'true' }} |
2956 | 3043 | runs-on: ubuntu-latest |
2957 | 3044 | # JOB WALL = CHECKOUT BUDGET (20) + BODY BUDGET, `typecheck-source-gates`' |
2958 | 3045 | # scheme. Body after the checkout, rebuilt per run from the 70 runs the |
@@ -4090,6 +4177,8 @@ jobs: |
4090 | 4177 | # argument is in this lane) and pays its setup even when the selector |
4091 | 4178 | # skips everything in it: about a minute of runner, not of wall. |
4092 | 4179 | name: Lint · scoped · query-options erasure |
| 4180 | + needs: [schedule-gate] |
| 4181 | + if: ${{ !cancelled() && needs.schedule-gate.outputs.skip != 'true' }} |
4093 | 4182 | runs-on: ubuntu-latest |
4094 | 4183 | # JOB WALL = CHECKOUT BUDGET (20) + BODY BUDGET, `typecheck-source-gates`' |
4095 | 4184 | # scheme. Body after the checkout, rebuilt per run from the 70 runs the |
@@ -4246,6 +4335,8 @@ jobs: |
4246 | 4335 | # entry-guard sweep and the comment-mask corpus walk. The slot-lookup |
4247 | 4336 | # ratchet is the gate the checkout step's `fetch-depth: 0` note names. |
4248 | 4337 | name: Lint · scoped · slot lookup & corpus |
| 4338 | + needs: [schedule-gate] |
| 4339 | + if: ${{ !cancelled() && needs.schedule-gate.outputs.skip != 'true' }} |
4249 | 4340 | runs-on: ubuntu-latest |
4250 | 4341 | # JOB WALL = CHECKOUT BUDGET (20) + BODY BUDGET, `typecheck-source-gates`' |
4251 | 4342 | # scheme. Body after the checkout, rebuilt per run from the 70 runs the |
@@ -4390,6 +4481,8 @@ jobs: |
4390 | 4481 | # self-test, the self-test workflow-command gate and the verify-lock |
4391 | 4482 | # entry-point self-test. |
4392 | 4483 | name: Lint · scoped · tooling self-tests |
| 4484 | + needs: [schedule-gate] |
| 4485 | + if: ${{ !cancelled() && needs.schedule-gate.outputs.skip != 'true' }} |
4393 | 4486 | runs-on: ubuntu-latest |
4394 | 4487 | # JOB WALL = CHECKOUT BUDGET (20) + BODY BUDGET, `typecheck-source-gates`' |
4395 | 4488 | # scheme. Body after the checkout, rebuilt per run from the 70 runs the |
@@ -4576,6 +4669,8 @@ jobs: |
4576 | 4669 | # `schedule` and `push` both tiers, the slow tier's daily home under the |
4577 | 4670 | # ruling (`scripts/pm/check-dispatch-gates.mjs` decides, from the event). |
4578 | 4671 | name: Lint · PM dispatch-gates |
| 4672 | + needs: [schedule-gate] |
| 4673 | + if: ${{ !cancelled() && needs.schedule-gate.outputs.skip != 'true' }} |
4579 | 4674 | runs-on: ubuntu-latest |
4580 | 4675 | # JOB WALL = CHECKOUT BUDGET (20) + BODY BUDGET, `typecheck-source-gates`' |
4581 | 4676 | # scheme. Body after the checkout, rebuilt per run from the 70 runs the |
@@ -4722,6 +4817,8 @@ jobs: |
4722 | 4817 | # missing or stale one. Build-dependent gates belong in the lanes below. |
4723 | 4818 | typecheck-source-gates: |
4724 | 4819 | name: Type Check · source gates |
| 4820 | + needs: [schedule-gate] |
| 4821 | + if: ${{ !cancelled() && needs.schedule-gate.outputs.skip != 'true' }} |
4725 | 4822 | runs-on: ubuntu-latest |
4726 | 4823 | # JOB WALL — why every job here has one and the rule (about 2× the measured |
4727 | 4824 | # maximum, a 5-minute grain, never below 10, never above the queue's |
@@ -5411,6 +5508,8 @@ jobs: |
5411 | 5508 | # runs the `typecheck` task family and so the only one that can seed it. |
5412 | 5509 | typecheck-workspace: |
5413 | 5510 | name: Type Check · workspace |
| 5511 | + needs: [schedule-gate] |
| 5512 | + if: ${{ !cancelled() && needs.schedule-gate.outputs.skip != 'true' }} |
5414 | 5513 | runs-on: ubuntu-latest |
5415 | 5514 | # JOB WALL = CHECKOUT BUDGET (20) + BODY BUDGET; the split, its window, the |
5416 | 5515 | # checkout numbers and what the aggregate reads: `typecheck-source-gates`. |
@@ -5656,6 +5755,8 @@ jobs: |
5656 | 5755 | # semantics are untouched: same script, same flags, same command. |
5657 | 5756 | typecheck-debt: |
5658 | 5757 | name: Type Check · debt ledger |
| 5758 | + needs: [schedule-gate] |
| 5759 | + if: ${{ !cancelled() && needs.schedule-gate.outputs.skip != 'true' }} |
5659 | 5760 | runs-on: ubuntu-latest |
5660 | 5761 | # JOB WALL = CHECKOUT BUDGET (20) + BODY BUDGET; the split, its window, the |
5661 | 5762 | # checkout numbers and what the aggregate reads: `typecheck-source-gates`. |
@@ -5858,6 +5959,8 @@ jobs: |
5858 | 5959 | # api-surface family, the skill/docs example compilers and the i18n gates. |
5859 | 5960 | typecheck-consumers: |
5860 | 5961 | name: Type Check · consumer gates |
| 5962 | + needs: [schedule-gate] |
| 5963 | + if: ${{ !cancelled() && needs.schedule-gate.outputs.skip != 'true' }} |
5861 | 5964 | runs-on: ubuntu-latest |
5862 | 5965 | # JOB WALL = CHECKOUT BUDGET (20) + BODY BUDGET; the split, its window, the |
5863 | 5966 | # checkout numbers and what the aggregate reads: `typecheck-source-gates`. |
@@ -6387,8 +6490,9 @@ jobs: |
6387 | 6490 | # required context is not a red — it is an absence, which reads as green in |
6388 | 6491 | # every checks list and never blocks the queue. The same contract |
6389 | 6492 | # ci.yml's `test-gate` documents. With `always()` the job runs on every |
6390 | | - # outcome and the verdict below is what decides. |
6391 | | - if: always() |
| 6493 | + # outcome and the verdict below is what decides. Its one schedule-only |
| 6494 | + # conjunct is the `lint` job's, for the reason stated there. |
| 6495 | + if: ${{ always() && !(github.event_name == 'schedule' && contains(needs.*.result, 'skipped')) }} |
6392 | 6496 | runs-on: ubuntu-latest |
6393 | 6497 | timeout-minutes: 10 |
6394 | 6498 | permissions: |
|
0 commit comments