[ci] fix: resolve test matrix from the PR merge commit, not the head - #4486
Merged
Conversation
generate-test-matrix scanned a checkout of github.sha (the PR head branch tip), but the container image — and thus the launch scripts that actually run via docker exec — is built from the PR merge_commit_sha (head merged into main). When main renames or recategorizes launch scripts, the matrix schedules jobs under stale head-tree names absent from the merge-commit container, so every renamed script fails exit 127 'No such file'. Centralize merge_commit_sha resolution in the configure job (new merge_sha output) and consume it throughout: every source checkout, the image build tag, and every container-image reference. The matrix is now scanned from the same tree the container is built from, so a PR behind a launch-script rename stays green without a rebase. Signed-off-by: oliver könig <okoenig@nvidia.com>
Contributor
Author
|
/ok to test 3316e68 |
Contributor
|
LGTM — clean, well-scoped fix. Verified:
Suggested test cases No perf tests impacted. |
thomasdhc
approved these changes
Jun 24, 2026
liding-nv
pushed a commit
that referenced
this pull request
Jun 26, 2026
…4486) Signed-off-by: oliver könig <okoenig@nvidia.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Background / motivation
A large batch of functional jobs on PR #4466 failed with
bash: tests/functional_tests/launch_scripts/.../<NAME>.sh: No such file or directory(exit 127), unrelated to the PR's actual change.Root cause is a commit-resolution split inside
cicd-main.yml:generate-test-matrix/generate-gb200-test-matrixscan a checkout that defaults togithub.sha— the PR head branch tip.cicd-container-buildchecks out and builds from the PRmerge_commit_sha(head merged intomain), but tags the image withgithub.sha, which disguised the split. The launch scripts execute inside that container viadocker exec(the host checkout is not mounted).When
mainrenames/recategorizes launch scripts (e.g. #4470 bumped tier prefixesL0→L1→L2), a PR that is behindmainscans the stale head-tree names, schedules jobs under those names, and then can't find them in the merge-commit container → exit 127. Every non-renamed script still passes, which is why the failures look scattered.What changed
configurejob and expose it as amerge_shaoutput.merge_shathroughout the workflow: every source checkout (ref:), the image build tag, and everycontainer-imagereference.cicd-container-build.configureto theneeds:of jobs that now consume the output.The matrix is now scanned from the same tree the container is built from, so a PR behind a launch-script rename stays green without a rebase.
Details
configure: newmerge_shaoutput +Resolve merge commit shastep (PR →get-pr-info.merge_commit_sha, non-PR →$GITHUB_SHA; identical logic to the old container-build step).cicd-container-build: drops its localGet merge commit shastep; checkoutrefand the:${{ github.sha }}image tag →:${{ needs.configure.outputs.merge_sha }}.merge_sha.megatron-bridge:${{ github.sha }}, so nothing downstream breaks.flowchart TD subgraph before["Before — split commit"] H1["github.sha (PR head)"] --> M1[generate-test-matrix] MC1["merge_commit_sha (head + main)"] --> B1[cicd-container-build] M1 -->|"old script names"| T1{{docker exec in container}} B1 -->|"new script names"| T1 T1 --> X1["exit 127: No such file"] end subgraph after["After — single source"] CFG["configure.merge_sha = merge_commit_sha"] --> M2[generate-test-matrix] CFG --> B2[cicd-container-build] M2 -->|"same names"| T2{{docker exec in container}} B2 -->|"same names"| T2 T2 --> OK2["tests run"] endTested
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/cicd-main.yml'))"→ parses.${{ github.sha }}orsteps.sha.outputs.mainreferences remain incicd-main.yml.merge_shahasconfigureinneeds(no DAG cycle;configureonly needspre-flight).