mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
1168254bd9
## Why It's hard to change the set of required jobs when they're managed in the GitHub UI, and when each workflow is responsible for choosing it's own scheduling it's easy to end up with skew between what we enforce on PRs vs. on main. ## What - add a `blocking-ci` caller workflow, triggered by pull requests and pushes to `main`, for Bazel, blob size, cargo-deny, Codespell, `repo-checks`, rust CI, and SDK CI - add an `always()` terminal job named `CI required` that fails unless every called workflow succeeds - add a `postmerge-ci` caller workflow for `rust-ci-full` and `v8-canary`, with a terminal `Postmerge CI results` job - centralize V8 relevance detection in `v8_canary_changes.py`; unrelated PR and postmerge runs execute metadata only and skip the expensive build matrices - leave `v8-canary` outside the blocking gate and leave the external `cla` check independent ## Rollout A repository admin must replace the existing required GitHub Actions contexts with `CI required` in the main-branch ruleset. Retain `cla` as a separate required check. Until that change is coordinated, this PR cannot satisfy the old standalone check names. In-flight PRs will need to be rebased after this lands.
35 lines
964 B
Python
35 lines
964 B
Python
#!/usr/bin/env python3
|
|
|
|
"""Fail a terminal CI job unless every serialized dependency succeeded.
|
|
|
|
Parent workflows pass GitHub's `toJSON(needs)` object through the NEEDS
|
|
environment variable. Treat skipped and cancelled dependencies as failures too:
|
|
for a required fan-in job, only an explicit success is safe to accept.
|
|
"""
|
|
|
|
import json
|
|
import os
|
|
|
|
|
|
def main() -> None:
|
|
# Keep result policy in one script so blocking-ci and postmerge-ci cannot
|
|
# drift in how they interpret dependency conclusions.
|
|
needs = json.loads(os.environ["NEEDS"])
|
|
failures = sorted(
|
|
(name, dependency["result"])
|
|
for name, dependency in needs.items()
|
|
if dependency["result"] != "success"
|
|
)
|
|
|
|
if failures:
|
|
print("CI dependencies did not succeed:")
|
|
for name, result in failures:
|
|
print(f"{name}: {result}")
|
|
raise SystemExit(1)
|
|
|
|
print("All CI dependencies succeeded.")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|