Skip to content

Add resolved-dependency override mechanism for DR-008#278

Draft
Subramanian-K812 wants to merge 6 commits into
eclipse-score:mainfrom
qorix-group:Subramanian-K812_resolve_override_mechanism
Draft

Add resolved-dependency override mechanism for DR-008#278
Subramanian-K812 wants to merge 6 commits into
eclipse-score:mainfrom
qorix-group:Subramanian-K812_resolve_override_mechanism

Conversation

@Subramanian-K812

Copy link
Copy Markdown
Contributor

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 full
integrated dependency set at the reference_integration root and (2) override those
resolved versions directly into an individual module.

  • Resolve (root): merges the override directives ref_int actually declares
    (MODULE.bazel + bazel_common/*.MODULE.bazel) with the post-MVS registry versions
    from bazel mod graph --output=json, and serializes the result to a single
    resolved_versions.json manifest (--export / from_mod_graph / to_file).
  • Override (into a module): scans a module's MODULE.bazel for every declared
    bazel_dep and appends a git_override / single_version_override for each one we
    have a resolved version for, so the module builds/tests against the resolved set
    (scan / overwrite). Injection is append-only and idempotent (marked with begin/end
    comments), 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

File Change
scripts/known_good/resolved_dependencies.py New — the ResolvedDependencies mechanism (resolve + override) + CLI
scripts/known_good/tests/test_resolved_dependencies.py New — 18 self-contained unit tests (no cloned repos / Bazel needed)
scripts/known_good/BUILD Newpy_library :known_good, py_binary :resolve_deps (Bazel-runnable), and score_py_pytest :known_good_tests so the unit tests run under Bazel
scripts/tooling/BUILD Modifiedalias :resolve_deps exposing it as bazel run //scripts/tooling:resolve_deps

Follow-up (PR 2)

The two-stage test_and_docs.yml (Stage 1 resolves + exports the manifest; Stage 2 checks
out 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 the
associated config all land in the follow-up PR, which is stacked on this one.

@Subramanian-K812 Subramanian-K812 force-pushed the Subramanian-K812_resolve_override_mechanism branch from 6d78316 to fbc58a3 Compare July 3, 2026 08:31
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

Comment thread scripts/tooling/BUILD

# Alias: expose resolve_deps under //scripts/tooling for `bazel run //scripts/tooling:resolve_deps`.
alias(
name = "resolve_deps",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this alias? This is usually for backwards-compatibility but since this is new functionality it should not be necessary.

"""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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants