Skip to content

Commit f3ae03f

Browse files
authored
ci: adopt CCCL check_result aggregator for Check job status (fixes #900) (#912)
## Summary Ports the gating-check fix from NVIDIA/cuda-python#2210 to this repo. Closes #900. Root cause and design discussion live in NVIDIA/cuda-python#2208 — not repeating here. Bit us in this repo on 2026-07-03 when [`5f530b96`](5f530b96) auto-merged with a silent Windows failure and had to be reverted in [`441882b2`](441882b2). ## Change One file, `.github/workflows/ci.yaml`, `checks:` job only: - Replace the `cancelled || failure` predicate with CCCL's `check_result` pattern: per-dep `expected="success"`, `[no-ci]` short-circuit at the top. - Add `should-skip` to `needs:` and check its result explicitly — a crash in the gating job can no longer masquerade as a green CI run. - No `[doc-only]` machinery — this repo doesn't have that PR mode. If added later, mirror NVIDIA/numba-cuda-mlir#142. ## Verification Local simulation of the new aggregator across 6 scenarios (normal-green, build-windows-fail-cascade, build-linux-64-fail-cascade, `[no-ci]`, pre-commit-fail, should-skip-itself-fails) — all behave as expected. ## Reference - Tracking issue on this repo: #900 - Root cause: NVIDIA/cuda-python#2208 - Source-of-truth fix: NVIDIA/cuda-python#2210 - Sibling port to numba-cuda-mlir: NVIDIA/numba-cuda-mlir#142 - CCCL gate pattern: https://github.com/NVIDIA/cccl/blob/8c0e6cb1b6412d7bd0070f9ac3f55fa80231961a/.github/workflows/ci-workflow-pull-request.yml#L463-L526
1 parent 441882b commit f3ae03f

1 file changed

Lines changed: 37 additions & 40 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ jobs:
294294
if: always()
295295
runs-on: ubuntu-latest
296296
needs:
297+
- should-skip
297298
- test-linux-64
298299
- test-linux-aarch64
299300
- test-windows
@@ -308,45 +309,41 @@ jobs:
308309
steps:
309310
- name: Exit
310311
run: |
311-
# if any dependencies were cancelled or failed, that's a failure
312-
#
313-
# see https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#always
314-
# and https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks
315-
# for why this cannot be encoded in the job-level `if:` field
316-
#
317-
# TL; DR: `$REASONS`
318-
#
319-
# The intersection of skipped-as-success and required status checks
320-
# creates a scenario where if you DON'T `always()` run this job, the
321-
# status check UI will block merging and if you DO `always()` run and
322-
# a dependency is _cancelled_ (due to a critical failure, which is
323-
# somehow not considered a failure ¯\_(ツ)_/¯) then the critically
324-
# failing job(s) will timeout causing a cancellation here and the
325-
# build to succeed which we don't want (originally this was just
326-
# 'exit 0')
327-
if ${{ needs.test-linux-64.result == 'cancelled' ||
328-
needs.test-linux-64.result == 'failure' ||
329-
needs.test-linux-aarch64.result == 'cancelled' ||
330-
needs.test-linux-aarch64.result == 'failure' ||
331-
needs.test-windows.result == 'cancelled' ||
332-
needs.test-windows.result == 'failure' ||
333-
needs.pre-commit.result == 'cancelled' ||
334-
needs.pre-commit.result == 'failure' ||
335-
needs.test-conda.result == 'cancelled' ||
336-
needs.test-conda.result == 'failure' ||
337-
needs.test-simulator.result == 'cancelled' ||
338-
needs.test-simulator.result == 'failure' ||
339-
needs.test-thirdparty-cudf.result == 'cancelled' ||
340-
needs.test-thirdparty-cudf.result == 'failure' ||
341-
needs.test-thirdparty-nvmath.result == 'cancelled' ||
342-
needs.test-thirdparty-nvmath.result == 'failure' ||
343-
needs.test-thirdparty-awkward.result == 'cancelled' ||
344-
needs.test-thirdparty-awkward.result == 'failure' ||
345-
needs.build-docs.result == 'cancelled' ||
346-
needs.build-docs.result == 'failure' ||
347-
needs.coverage-report.result == 'cancelled' ||
348-
needs.coverage-report.result == 'failure' }}; then
349-
exit 1
350-
else
312+
# GitHub treats `result == 'skipped'` as success for required
313+
# status checks (see CCCL gate comment + cccl#605). The previous
314+
# `cancelled || failure` predicate let upstream build failures
315+
# propagate as `skipped` on downstream test jobs and silently
316+
# pass this aggregator. Adopt CCCL's `check_result` pattern:
317+
# require an explicit `expected` status per dependency, where
318+
# anything else (including `skipped` from a failed upstream)
319+
# fails the gate. `if: always()` on the job still ensures this
320+
# step runs even when needs are skipped.
321+
if [[ "${{ needs.should-skip.outputs.skip }}" == "true" ]]; then
322+
echo "[no-ci] - skipping aggregator checks"
351323
exit 0
352324
fi
325+
326+
status="success"
327+
check_result() {
328+
name=$1; expected=$2; result=$3
329+
echo "Checking $name: result='$result' (expected '$expected')"
330+
if [[ "$result" != "$expected" ]]; then
331+
echo "::error::$name did not match expected result"
332+
status="failed"
333+
fi
334+
}
335+
336+
check_result "should-skip" "success" "${{ needs.should-skip.result }}"
337+
check_result "test-linux-64" "success" "${{ needs.test-linux-64.result }}"
338+
check_result "test-linux-aarch64" "success" "${{ needs.test-linux-aarch64.result }}"
339+
check_result "test-windows" "success" "${{ needs.test-windows.result }}"
340+
check_result "pre-commit" "success" "${{ needs.pre-commit.result }}"
341+
check_result "test-conda" "success" "${{ needs.test-conda.result }}"
342+
check_result "test-simulator" "success" "${{ needs.test-simulator.result }}"
343+
check_result "test-thirdparty-cudf" "success" "${{ needs.test-thirdparty-cudf.result }}"
344+
check_result "test-thirdparty-nvmath" "success" "${{ needs.test-thirdparty-nvmath.result }}"
345+
check_result "test-thirdparty-awkward" "success" "${{ needs.test-thirdparty-awkward.result }}"
346+
check_result "build-docs" "success" "${{ needs.build-docs.result }}"
347+
check_result "coverage-report" "success" "${{ needs.coverage-report.result }}"
348+
349+
[[ "$status" == "success" ]]

0 commit comments

Comments
 (0)