Regression test for #196 bzlmod local_path_override (issue is fixed) by tinder-maxwellelliott · Pull Request #345 · Tinder/bazel-diff · GitHub
Skip to content

Regression test for #196 bzlmod local_path_override (issue is fixed)#345

Merged
tinder-maxwellelliott merged 1 commit into
masterfrom
claude/reproducer-issue-196
May 12, 2026
Merged

Regression test for #196 bzlmod local_path_override (issue is fixed)#345
tinder-maxwellelliott merged 1 commit into
masterfrom
claude/reproducer-issue-196

Conversation

@tinder-maxwellelliott

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a passing regression-protection test for #196. The original 2023 report was that bazel-diff failed to query a bzlmod workspace whose dependencies were all wired through local_path_override (no BCR fetches). honnix narrowed it to cquery returning labels with apparent vs canonical repo names that did not match the compatible target set; PR fix: Handle canonical repo name for cquery #224 fixed that handling.
  • I verified manually that the originally-broken scenario now works end-to-end on current bazel-diff: both bazel-diff generate-hashes and bazel-diff generate-hashes --useCquery succeed against a local_path_override workspace and produce hashes that reference the local-overridden repo target.
  • This PR captures that working setup as a permanent regression test (not @Ignored — it passes today). If a future change reintroduces the canonical-name mismatch or otherwise breaks local_path_override, this test fails.

New fixture cli/src/test/resources/workspaces/bzlmod_local_repo/:

  • MODULE.bazelbazel_dep + local_path_override on dep_repo
  • dep_repo/ — minimal bzlmod module exporting a file via exports_files
  • BUILD//:consume genrule consumes @dep_repo//:hello

Test asserts:

  • Query mode succeeds and the hashes include //:consume.
  • cquery mode succeeds and the hashes include both the consumer label and a dep_repo-bearing label (canonical @@dep_repo+//...).

Test plan

  • bazel build //cli:cli-test-lib succeeds.
  • bazel test //cli:E2ETest --test_filter=testBzlmodLocalPathOverrideWorks_regressionForIssue196PASSED in 9.5s.
  • Manual verification with the locally built CLI shows both modes produce the expected hashes.

🤖 Generated with Claude Code

The 2023 report (#196) was that bazel-diff failed when a bzlmod
workspace's dependencies were all wired through local repositories (no
BCR fetches). honnix narrowed it down to cquery returning labels with
apparent vs canonical repo names that did not match the compatible
target set; PR #224 fixed the handling.

This is a passing regression-protection test (not @ignore'd). It
exercises a minimal bzlmod workspace where the only dependency uses
`local_path_override`, runs generate-hashes in both query and cquery
modes, and asserts both succeed and produce hashes referencing the
local-repo target. If a future change reintroduces the canonical-name
mismatch or otherwise breaks local_path_override resolution, this test
will fail.

Verified by running the new test:
  //cli:E2ETest                  PASSED in 9.5s

Refs #196

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tinder-maxwellelliott tinder-maxwellelliott merged commit 90c4905 into master May 12, 2026
15 checks passed
@tinder-maxwellelliott tinder-maxwellelliott deleted the claude/reproducer-issue-196 branch May 12, 2026 18:00
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