Add resolved-dependency override mechanism for DR-008#278
Draft
Subramanian-K812 wants to merge 6 commits into
Draft
Add resolved-dependency override mechanism for DR-008#278Subramanian-K812 wants to merge 6 commits into
Subramanian-K812 wants to merge 6 commits into
Conversation
… markers, simplify imports
…directive inline, add BUILD for bazel run
…wn_good.py, and tooling BUILD format
6d78316 to
fbc58a3
Compare
|
The created documentation from the pull request is available at: docu-html |
a-zw
reviewed
Jul 3, 2026
|
|
||
| # Alias: expose resolve_deps under //scripts/tooling for `bazel run //scripts/tooling:resolve_deps`. | ||
| alias( | ||
| name = "resolve_deps", |
Contributor
There was a problem hiding this comment.
Why this alias? This is usually for backwards-compatibility but since this is new functionality it should not be necessary.
a-zw
reviewed
Jul 3, 2026
| """Unit tests for ResolvedDependencies (DR-008 Option 4 dependency injection). | ||
|
|
||
| Self-contained: builds the resolved set from a temporary known_good.json and | ||
| overwrites a temporary module MODULE.bazel — no cloned repos or Bazel required. |
Contributor
There was a problem hiding this comment.
I like this self-contained aspect. It allows to use this in an hermetic way.
However, the tradeoff is that we cannot parallelize the followup actions (build, test, docs, etc) via GitHub actions, can we?
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.
DR-008: resolved-dependency resolve + override mechanism (PR 1 of 2)
Part of #264. This is the first of two PRs that split the original DR-008 Option 4
change. This PR adds only the mechanism; the follow-up
PR wires it into the test workflow.
What this PR does
Adds
ResolvedDependencies— the mechanism DR-008 Option 4 needs to (1) resolve the fullintegrated dependency set at the
reference_integrationroot and (2) override thoseresolved versions directly into an individual module.
(
MODULE.bazel+bazel_common/*.MODULE.bazel) with the post-MVS registry versionsfrom
bazel mod graph --output=json, and serializes the result to a singleresolved_versions.jsonmanifest (--export/from_mod_graph/to_file).MODULE.bazelfor every declaredbazel_depand appends agit_override/single_version_overridefor each one wehave a resolved version for, so the module builds/tests against the resolved set
(
scan/overwrite). Injection is append-only and idempotent (marked with begin/endcomments), always skips the module-under-test itself (the root is never overridden),
always overwrites any dependency the module already declares an override for (ref_int's
resolved version always wins), and is never committed back to module sources. A declared
dependency with no entry in the resolved set is left to resolve on its own and logs a
warning — this is expected to be effectively impossible once the resolved set comes from
the full
bazel mod graph(a superset of any module's own graph).Files
scripts/known_good/resolved_dependencies.pyResolvedDependenciesmechanism (resolve + override) + CLIscripts/known_good/tests/test_resolved_dependencies.pyscripts/known_good/BUILDpy_library :known_good,py_binary :resolve_deps(Bazel-runnable), andscore_py_pytest :known_good_testsso the unit tests run under Bazelscripts/tooling/BUILDalias :resolve_depsexposing it asbazel run //scripts/tooling:resolve_depsFollow-up (PR 2)
The two-stage
test_and_docs.yml(Stage 1 resolves + exports the manifest; Stage 2 checksout each module, overrides deps via this mechanism, and runs its UT + coverage; then
aggregates), the module-context
quality_runners.py, the dependency pin bumps, and theassociated config all land in the follow-up PR, which is stacked on this one.