Skip to content

test(e2e): reproducer for #510 (fine-grained change missed through non-root-visible wrapper) - #511

Draft
tinder-maxwellelliott wants to merge 1 commit into
masterfrom
claude/bazel-diff-issue-510-reproducer-517844
Draft

tinder-maxwellelliott wants to merge 1 commit into
masterfrom
claude/bazel-diff-issue-510-reproducer-517844

Conversation

@tinder-maxwellelliott

Copy link
Copy Markdown
Collaborator

Reproducer for #510.

Fixture

tests/resources/workspaces/hidden_wrapper_external_repo, the issue's layout:

//:consumer -> @facade//:export -> @@middle+//:wrapped -> @leaf//:value -> @leaf//:value.txt

middle is declared only by facade (as private_wrapper), so unlike the #197 fixture (wrapped_external_repo) it is not in the root's repo mapping.

Cases (tests/e2e/regressions.rs)

  • hidden_wrapper_external_repo_change_reaches_main_consumer_reproducer_for_issue_510: fails on master by design. With --fineGrainedHashExternalRepos=@leaf, changing leaf/value.txt impacts only {"@leaf//:value", "@leaf//:value.txt"}, and //:consumer is missed. It also asserts //:control stays unimpacted.
  • hidden_wrapper_external_repo_change_propagates_with_explicit_chain: a control that passes. It names @leaf,@facade,@@middle+ and shows the fixture's edges are real.

Root cause (observed)

//external:leaf changes between the snapshots, but //external:facade doesn't. query_bzlmod_repos (src/bazel.rs) lowers only the repos in bazel mod dump_repo_mapping "" (root-visible). So @@middle+ never becomes a //external: node, and in lower_repositories the facade -> middle module edge is dropped by the module_to_canonical lookup. //:consumer's input @facade//:export is rewritten to //external:facade, whose hash doesn't reflect the leaf change. In #197 both repos are root-visible, so the edge survives.

Possible fix direction: lower every repo from bazel mod graph (or the transitive repo mappings) instead of only the root's, keyed by canonical name, so chains through non-root-visible modules stay connected.

🤖 Generated with Claude Code

…non-root-visible wrapper

Adds the hidden_wrapper_external_repo fixture from the issue:
//:consumer -> @facade//:export -> @@middle+//:wrapped -> @leaf//:value,
where `middle` is declared only by `facade` (as `private_wrapper`), so it is
not in the root repo mapping.

With --fineGrainedHashExternalRepos=@leaf, a change to leaf/value.txt impacts
only @leaf//:value{,.txt}; //:consumer is missed. //external:leaf changes but
//external:facade does not, because query_bzlmod_repos only lowers repos from
the root's `mod dump_repo_mapping`, so @@middle+ never becomes a synthetic
node and the facade -> middle -> leaf edge is dropped.

The reproducer case fails on master by design. A companion control case shows
that naming @leaf,@facade,@@middle+ explicitly propagates the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant