Repository navigation
ci: reuse unaffected build stages on pull requests - #7919
Closed
gulsumgudukbay wants to merge 1 commit into
Closed
gulsumgudukbay wants to merge 1 commit into
gulsumgudukbay wants to merge 1 commit into
Conversation
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
1 task done
gulsumgudukbay
force-pushed
the
users/gulsumgudukbay/ci-pr-stage-reuse
branch
from
September 8, 2026 16:00
a7c51c8 to
0bc308b
Compare
Multi-Arch CI computed stage-reuse decisions on every pull request and then discarded them: dry-run reports which stages the diff leaves unaffected while still rebuilding all of them. Pass reuse-stage for pull_request events so those stages are copied from a baseline run instead, and keep every other trigger on dry-run so pushes still produce the artifacts a pull request reuses. A pull request also checks out a merge commit that is not on the baseline branch, so validate_commit_compatibility could not place it in the branch history and rejected every candidate baseline as unknown. Establish ancestry from the pull request base commit instead.
gulsumgudukbay
force-pushed
the
users/gulsumgudukbay/ci-pr-stage-reuse
branch
from
October 2, 2026 17:19
0bc308b to
cb175f0
Compare
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.
ISSUE ID : #3399
Split out of #7912 at @ScottTodd's request so the JAX Bazel cache and this change can be reviewed and rolled out separately. Draft: this is a repository-wide behaviour change that wants deliberate testing, and #7346 may be the better tool for the JAX/PyTorch case since it can reuse ROCm packages too.
Motivation
BUILD_TOPOLOGY.toml, finds the unaffected stages, verifies their artifacts exist in a healthymainbaseline, prints all of it to the step summary, and then rebuilds them anyway, becausepull_requestpassesdry-run.rocm-libraries/projects/<project>/, which today still rebuilds the full Linux and Windows graph..github/,build_tools/,docs/orscripts/are not beneficiaries:stage_impact.full_ci_prefixestreats those as conservative full-CI triggers, so they keep rebuilding everything.Technical Details
multi_arch_ci.ymlpassesreuse-stageforpull_requestand keeps every other trigger ondry-run. Manualworkflow_dispatchstill wins.STAGE_REUSE_CURRENT_SHAwas the checkout commit, which on a pull request is a merge commit that is not on the baseline branch, sovalidate_commit_compatibilityreturnedunknownand rejected every candidate baseline.setup_multi_arch.ymlnow establishes ancestry from the pull request base commit, which is onmainand is by construction an ancestor of the merge commit, so the gate stays as conservative as it is for pushes.Test Plan
pytest build_tools/github_actions/testsfor the new test and the existing stage-reuse and baseline-selection suites.pre-commit run --all-files, includingactionlint..github/,build_tools/anddocs/, which are conservative full-CI triggers. Demonstrating reuse needs a separate branch touching submodule source.Test Result
post_stage_upload_test.py::TestCreateCcacheLogArchive, also fails onmainin the same container).pre-commit: all hooks pass.Submission Checklist