Skip to content

test: E2E reproducer for remote proto module version bumps#372

Merged
tinder-maxwellelliott merged 1 commit into
masterfrom
claude/elated-lamport-6add99
Jun 17, 2026
Merged

test: E2E reproducer for remote proto module version bumps#372
tinder-maxwellelliott merged 1 commit into
masterfrom
claude/elated-lamport-6add99

Conversation

@tinder-maxwellelliott

Copy link
Copy Markdown
Collaborator

What

Adds an E2E reproducer, testRemoteProtoVersionBumpImpactsConsumer, plus a hermetic proto_external_version_bump fixture, that validates a question we wanted answered directly: when a remote dependency that ships .proto files and exposes java_proto_library targets is version bumped, do the main-repo targets that consume those Java protos get invalidated?

Fixture shape

cli/src/test/resources/workspaces/proto_external_version_bump/:

  • proto_dep — a module resolved via local_path_override (hermetic, but standing in for any remote/BCR module) that ships greeting.proto and exposes @proto_dep//:greeting_java_proto (loaded via @protobuf//bazel:java_proto_library.bzl, same as the repo itself).
  • //:consumer — a main-repo java_library depending on @proto_dep//:greeting_java_proto.

What the test does

Copies the workspace twice and simulates a proto_dep 1.0.0 → 2.0.0 release the way a real version bump looks: it bumps the module version (root + dep MODULE.bazel) and adds a field to the shipped proto. It then runs generate-hashes (A vs B) with --fineGrainedHashExternalRepos @proto_dep and get-impacted-targets, asserting that both //:consumer and @proto_dep//:greeting_java_proto are reported impacted.

Result

bazel-diff correctly propagates the invalidation. Hand-verified with the locally built CLI — the bump impacts //:consumer, @proto_dep//:greeting.proto, @proto_dep//:greeting_proto, and @proto_dep//:greeting_java_proto, while the unchanged @proto_dep//:BUILD keeps its hash (genuine hash-change detection, not an artifact). So this lands as a positive regression lock, like the existing go_mod_change test — not a bug repro.

Notes

  • The E2ETest.kt change is a clean addition (no reformatting of surrounding code); the file isn't ktfmt-formatted on master, so the addition matches the existing hand-formatted style.
  • Includes a checked-in MODULE.bazel.lock (verified free of absolute-path leakage). E2E tests run on the Bazel 8.x/9.x bzlmod matrix, so no version-gating Assume was needed.
  • Behavior holds only with --fineGrainedHashExternalRepos pointed at the proto repo; without it an external repo content change isn't picked up.

🤖 Generated with Claude Code

Adds testRemoteProtoVersionBumpImpactsConsumer plus a hermetic
`proto_external_version_bump` fixture that validates bazel-diff
invalidates main-repo targets when a remote dependency shipping
.proto files and exposing java_proto_library targets is version
bumped.

The fixture wires up a `proto_dep` module (resolved via
local_path_override, standing in for any remote/BCR module) that
ships greeting.proto and exposes @proto_dep//:greeting_java_proto,
plus a //:consumer java_library depending on it. The test simulates
a 1.0.0 -> 2.0.0 release (bumps the module version and adds a proto
field) and asserts that, with --fineGrainedHashExternalRepos
@proto_dep, both //:consumer and @proto_dep//:greeting_java_proto are
reported impacted.

This locks in end-to-end tracking of remote proto targets: if
fine-grained external hashing ever stops descending into proto /
java_proto_library targets, //:consumer would silently stop being
impacted and this test would fail.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tinder-maxwellelliott tinder-maxwellelliott merged commit c00fec3 into master Jun 17, 2026
15 checks passed
@tinder-maxwellelliott tinder-maxwellelliott deleted the claude/elated-lamport-6add99 branch June 17, 2026 19:22
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