-
Notifications
You must be signed in to change notification settings - Fork 14k
[codex] group blocking and postmerge CI workflows #30146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3588c1f
add single required CI gate
anp-oai 82f5dc4
rename PR workflow to blocking CI
anp-oai bfd5f92
rename CI workflow to repo checks
anp-oai b726f79
group main checks under blocking CI
anp-oai 2efdd80
group postmerge checks under parent workflow
anp-oai cef1d74
move CI orchestration logic into scripts
anp-oai ee61530
document CI orchestration invariants
anp-oai 9997831
trust CI gate helper on PRs
anp-oai eb158bf
restore CI gate head checkout
anp-oai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| #!/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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: blocking-ci | ||
|
|
||
| # This is the single entrypoint for checks that block a PR merge. It also runs | ||
| # after pushes to main so the same check family stays grouped in the Actions UI. | ||
| on: | ||
| pull_request: {} | ||
| push: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| # Keep reusable workflow calls alphabetized. The `required` job below is the | ||
| # version-controlled list that the main-branch ruleset should require. | ||
| bazel: | ||
| name: Bazel | ||
| uses: ./.github/workflows/bazel.yml | ||
| secrets: inherit | ||
|
|
||
| blob-size-policy: | ||
| name: Blob size policy | ||
| uses: ./.github/workflows/blob-size-policy.yml | ||
| secrets: inherit | ||
|
|
||
| cargo-deny: | ||
| name: cargo-deny | ||
| uses: ./.github/workflows/cargo-deny.yml | ||
| secrets: inherit | ||
|
|
||
| codespell: | ||
| name: Codespell | ||
| uses: ./.github/workflows/codespell.yml | ||
| secrets: inherit | ||
|
|
||
| repo-checks: | ||
| name: repo-checks | ||
| uses: ./.github/workflows/repo-checks.yml | ||
| secrets: inherit | ||
|
|
||
| rust-ci: | ||
| name: rust-ci | ||
| uses: ./.github/workflows/rust-ci.yml | ||
| secrets: inherit | ||
|
|
||
| sdk: | ||
| name: sdk | ||
| uses: ./.github/workflows/sdk.yml | ||
| secrets: inherit | ||
|
|
||
| required: | ||
| name: CI required | ||
| # Without `always()`, GitHub skips this job after a failed dependency and a | ||
| # required check can appear successful instead of reporting the failure. | ||
| if: ${{ always() }} | ||
| needs: | ||
| - bazel | ||
| - blob-size-policy | ||
| - cargo-deny | ||
| - codespell | ||
| - repo-checks | ||
| - rust-ci | ||
| - sdk | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| # Keep the helper on the same revision as the caller and child workflows. | ||
| # CI workflow uploads are restricted, so this repository does not need a | ||
| # separate trusted-base checkout for the terminal policy step. Using the | ||
| # PR head also lets the introducing PR exercise a newly added helper. | ||
| # | ||
| # During the initial rollout, PR branches created before | ||
| # check_ci_results.py exists must rebase onto main before this gate can | ||
| # run. | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | ||
| persist-credentials: false | ||
|
|
||
| - name: Require successful dependencies | ||
| env: | ||
| NEEDS: ${{ toJSON(needs) }} | ||
| run: python3 .github/scripts/check_ci_results.py | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: postmerge-ci | ||
|
|
||
| # This is the single entrypoint for main-only CI that is intentionally outside | ||
| # the merge-blocking suite. It keeps the broader postmerge signal in one run. | ||
| on: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| # Keep reusable workflow calls alphabetized. Each child retains its own | ||
| # workflow_dispatch trigger so maintainers can rerun flaky suites directly. | ||
| rust-ci-full: | ||
| name: rust-ci-full | ||
| uses: ./.github/workflows/rust-ci-full.yml | ||
| secrets: inherit | ||
|
|
||
| v8-canary: | ||
| name: v8-canary | ||
| uses: ./.github/workflows/v8-canary.yml | ||
| secrets: inherit | ||
|
|
||
| results: | ||
| name: Postmerge CI results | ||
| needs: | ||
| - rust-ci-full | ||
| - v8-canary | ||
| if: ${{ always() }} | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| # Postmerge runs use the pushed main commit, so this helper always comes | ||
| # from the same revision that defined the parent workflow. | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| ref: ${{ github.sha }} | ||
| persist-credentials: false | ||
|
|
||
| - name: Require successful dependencies | ||
| env: | ||
| NEEDS: ${{ toJSON(needs) }} | ||
| run: python3 .github/scripts/check_ci_results.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,7 @@ | ||
| name: ci | ||
| name: repo-checks | ||
|
|
||
| on: | ||
| pull_request: {} | ||
| push: { branches: [main] } | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| build-test: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.