-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat(ci): automate exact-head live E2E gating #6589
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
Closed
prekshivyas
wants to merge
3
commits into
NVIDIA:main
from
prekshivyas:ci/required-live-e2e-coordinator
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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,183 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: E2E / Required Live Coordinator | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: [synchronize, reopened, closed] | ||
| workflow_run: | ||
| workflows: ["CI / Pull Request"] | ||
| types: [completed] | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: required-live-${{ github.event.pull_request.head.repo.full_name || github.event.workflow_run.head_repository.full_name }}-${{ github.event.pull_request.head.ref || github.event.workflow_run.head_branch }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| cancel-superseded: | ||
| if: ${{ github.repository == 'NVIDIA/NemoClaw' && github.event_name == 'pull_request_target' }} | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| actions: write | ||
| contents: read | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Checkout trusted coordinator | ||
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
| with: | ||
| repository: NVIDIA/NemoClaw | ||
| ref: ${{ github.sha }} | ||
| persist-credentials: false | ||
|
|
||
| - name: Cancel superseded required-live runs | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| run: >- | ||
| node --experimental-strip-types tools/e2e-advisor/pr-risk-gate.mts | ||
| --mode cancel --pr "$PR_NUMBER" | ||
|
|
||
| coordinate: | ||
| if: ${{ github.repository == 'NVIDIA/NemoClaw' && github.event_name == 'workflow_run' && github.event.workflow_run.event == 'pull_request' }} | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| actions: write | ||
| checks: write | ||
| contents: read | ||
| pull-requests: read | ||
| timeout-minutes: 150 | ||
| steps: | ||
| - name: Checkout trusted coordinator | ||
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
| with: | ||
| repository: NVIDIA/NemoClaw | ||
| ref: ${{ github.sha }} | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.0.0 | ||
| with: | ||
| node-version: "22" | ||
| cache: npm | ||
|
|
||
| - name: Install trusted coordinator dependencies | ||
| run: npm ci --ignore-scripts | ||
|
|
||
| - id: initialize | ||
| name: Create exact-head required-live check | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| HEAD_SHA: ${{ github.event.workflow_run.head_sha }} | ||
| run: >- | ||
| node --experimental-strip-types tools/e2e-advisor/pr-risk-gate.mts | ||
| --mode initialize --head "$HEAD_SHA" | ||
|
|
||
| - id: resolve | ||
| name: Resolve exact PR and CI result | ||
| env: | ||
| CI_CONCLUSION: ${{ github.event.workflow_run.conclusion }} | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }} | ||
| HEAD_REPO: ${{ github.event.workflow_run.head_repository.full_name }} | ||
| HEAD_SHA: ${{ github.event.workflow_run.head_sha }} | ||
| run: >- | ||
| node --experimental-strip-types tools/e2e-advisor/pr-risk-gate.mts | ||
| --mode resolve | ||
|
|
||
| - name: Fetch exact first-party PR objects | ||
| if: ${{ steps.resolve.outputs.first_party == 'true' && steps.resolve.outputs.ci_green == 'true' }} | ||
| env: | ||
| BASE_SHA: ${{ steps.resolve.outputs.base_sha }} | ||
| HEAD_SHA: ${{ steps.resolve.outputs.head_sha }} | ||
| run: | | ||
| git fetch --no-tags origin "$BASE_SHA" "$HEAD_SHA" | ||
|
|
||
| - id: advisor | ||
| name: Wait for exact-head Advisor artifacts | ||
| if: ${{ steps.resolve.outputs.first_party == 'true' && steps.resolve.outputs.ci_green == 'true' }} | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| HEAD_SHA: ${{ steps.resolve.outputs.head_sha }} | ||
| run: | | ||
| set -euo pipefail | ||
| for attempt in $(seq 1 60); do | ||
| run_id="$(gh run list --repo "$GITHUB_REPOSITORY" --workflow e2e-advisor.yaml --commit "$HEAD_SHA" --event pull_request --status completed --limit 1 --json databaseId --jq '.[0].databaseId // empty')" | ||
| if [ -n "$run_id" ]; then | ||
| rm -rf "$RUNNER_TEMP/e2e-advisor" | ||
| if gh run download "$run_id" --repo "$GITHUB_REPOSITORY" --name e2e-advisor --dir "$RUNNER_TEMP/e2e-advisor"; then | ||
| echo "artifact_dir=$RUNNER_TEMP/e2e-advisor" >> "$GITHUB_OUTPUT" | ||
| exit 0 | ||
| fi | ||
| fi | ||
| sleep 15 | ||
| done | ||
| echo "::error::Exact-head E2E Advisor artifact did not become available" | ||
| exit 1 | ||
|
|
||
| - id: start | ||
| name: Build exact-head plan and dispatch required live E2E | ||
| if: ${{ always() }} | ||
| env: | ||
| ADVISOR_DIR: ${{ steps.advisor.outputs.artifact_dir }} | ||
| BASE_SHA: ${{ steps.resolve.outputs.base_sha }} | ||
| CHECK_ID: ${{ steps.initialize.outputs.check_id }} | ||
| CI_GREEN: ${{ steps.resolve.outputs.ci_green }} | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| HEAD_REPO: ${{ steps.resolve.outputs.head_repo }} | ||
| HEAD_SHA: ${{ steps.resolve.outputs.head_sha }} | ||
| PR_NUMBER: ${{ steps.resolve.outputs.pr_number }} | ||
| run: >- | ||
| node --experimental-strip-types tools/e2e-advisor/pr-risk-gate.mts | ||
| --mode start | ||
| --check-id "$CHECK_ID" | ||
| --pr "$PR_NUMBER" | ||
| --base "$BASE_SHA" | ||
| --head "$HEAD_SHA" | ||
| --head-repo "$HEAD_REPO" | ||
| --ci-green "$CI_GREEN" | ||
| --advisor-dir "$ADVISOR_DIR" | ||
|
|
||
| - name: Wait for correlated live E2E | ||
| if: ${{ steps.start.outputs.dispatched == 'true' }} | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| RUN_ID: ${{ steps.start.outputs.run_id }} | ||
| run: timeout --signal=TERM --kill-after=30s 105m gh run watch "$RUN_ID" --repo "$GITHUB_REPOSITORY" --exit-status | ||
|
|
||
| - name: Download correlated evidence | ||
| if: ${{ always() && steps.start.outputs.dispatched == 'true' }} | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| RUN_ID: ${{ steps.start.outputs.run_id }} | ||
| run: gh run download "$RUN_ID" --repo "$GITHUB_REPOSITORY" --dir "$RUNNER_TEMP/required-live-evidence" | ||
|
|
||
| - id: finish | ||
| name: Complete exact-head required-live check | ||
| if: ${{ always() && steps.start.outputs.dispatched == 'true' }} | ||
| env: | ||
| CHECK_ID: ${{ steps.initialize.outputs.check_id }} | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| RUN_ID: ${{ steps.start.outputs.run_id }} | ||
| STATE_HASH: ${{ steps.start.outputs.state_hash }} | ||
| run: >- | ||
| node --experimental-strip-types tools/e2e-advisor/pr-risk-gate.mts | ||
| --mode finish | ||
| --check-id "$CHECK_ID" | ||
| --run-id "$RUN_ID" | ||
| --state "$RUNNER_TEMP/required-live-state.json" | ||
| --state-hash "$STATE_HASH" | ||
| --evidence "$RUNNER_TEMP/required-live-evidence" | ||
|
|
||
| - name: Close required-live check after coordinator failure | ||
| if: ${{ always() && steps.initialize.outputs.check_id != '' && steps.finish.outcome != 'success' && (failure() || cancelled()) }} | ||
| env: | ||
| CHECK_ID: ${{ steps.initialize.outputs.check_id }} | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| RUN_ID: ${{ steps.start.outputs.run_id }} | ||
| run: >- | ||
| node --experimental-strip-types tools/e2e-advisor/pr-risk-gate.mts | ||
| --mode abandon --check-id "$CHECK_ID" --run-id "$RUN_ID" | ||
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
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.