test: hermetic cross-machine hashing + MODULE.bazel.lock edit E2E coverage by maxwellE · Pull Request #3 · maxwellE/bazel-diff · GitHub
Skip to content

test: hermetic cross-machine hashing + MODULE.bazel.lock edit E2E coverage#3

Open
maxwellE wants to merge 3 commits into
masterfrom
claude/hermetic-hashing-e2e-tests
Open

test: hermetic cross-machine hashing + MODULE.bazel.lock edit E2E coverage#3
maxwellE wants to merge 3 commits into
masterfrom
claude/hermetic-hashing-e2e-tests

Conversation

@maxwellE

Copy link
Copy Markdown
Owner

Summary

Adds two bzlmod E2E tests that lock in the cross-machine reproducibility guarantee bazel-diff relies on when the "from" hashes are produced on one CI agent and the "to" hashes on another. Follow-up to the external-repo content-hash key fix (Tinder#385), which removed the last absolute-path dependency from source-file hashing.

  • testGenerateHashesIsHermeticAcrossWorkspacePaths — generates hashes for byte-identical sources checked out at two different absolute paths (and thus two different Bazel output bases) and asserts the resulting target-hash maps are identical. Guards against any workspace/output-base path leaking into a digest.

  • testModuleBazelLockReformatDoesNotImpactTargets — re-serialises MODULE.bazel.lock in one checkout (same resolved module graph, different bytes on disk) and asserts no targets are impacted. bazel-diff keys bzlmod change detection off bazel mod graph, not the raw lock bytes, so lock churn that is common across machines stays a no-op. Lock-file companion to the MODULE.bazel comment-only regression test for issue Over-triggering with rules_go and Gazelle under certain circumstances Tinder/bazel-diff#83.

Notes

  • Both reuse the existing module_bazel_comment fixture and are gated to Bazel 8.6.0+/9.0.1+ (shared assumeBazelSupportsModShowRepo helper), matching the other bzlmod E2E tests. CI runs Bazel 8.x/9.x, so they execute rather than skip.

🤖 Generated with Claude Code


Generated by Claude Code

claude and others added 3 commits June 24, 2026 19:45
…bazel.lock edits

Adds two bzlmod E2E tests that lock in the cross-machine reproducibility
guarantee bazel-diff relies on when "from" and "to" hashes are produced on
different CI agents:

- testGenerateHashesIsHermeticAcrossWorkspacePaths: generates hashes for
  byte-identical sources checked out at two different absolute paths (and thus
  two different Bazel output bases) and asserts the resulting target-hash maps
  are identical. Guards against any workspace/output-base path leaking into a
  digest.

- testModuleBazelLockReformatDoesNotImpactTargets: re-serialises
  MODULE.bazel.lock in one checkout (same resolved module graph, different
  bytes) and asserts no targets are impacted. bazel-diff keys bzlmod change
  detection off `bazel mod graph`, not the raw lock bytes, so lock churn that
  is common across machines stays a no-op. Lock-file companion to the
  MODULE.bazel comment-only regression test for issue Tinder#83.

Both reuse the existing module_bazel_comment fixture and are gated to Bazel
8.6.0+/9.0.1+ to match the other bzlmod E2E tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FLwXzgBTGkZp63N9jv16x8
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.

3 participants