Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module(
name = "bazel-diff",
version = "19.0.0",
version = "19.0.1",
compatibility_level = 0,
)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ First, add the following snippet to your project:
#### Bzlmod snippet

```bazel
bazel_dep(name = "bazel-diff", version = "19.0.0")
bazel_dep(name = "bazel-diff", version = "19.0.1")
```

You can now run the tool with:
Expand Down
27 changes: 27 additions & 0 deletions cli/src/test/kotlin/com/bazel_diff/e2e/E2ETest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,33 @@ class E2ETest {
"/fixture/impacted_targets-1-2-rule-sourcefile.txt")
}

@Test
fun testGenerateHashesWithCqueryStreamedProto() {
// Validates the --useCquery code path that consumes Bazel's `--output=streamed_proto`
// cquery output (https://github.com/Tinder/bazel-diff/issues/219). On Bazel 7.0.0+ this
// exercises the AnalysisProtosV2.CqueryResult.parseDelimitedFrom loop in
// BazelQueryService.query(); on older Bazel it falls back to single-message proto parsing.
// Uses the `distance_metrics` shell-only workspace so cquery analysis works without a
// sandboxed JDK / coursier fetch.
val workspace = copyTestWorkspace("distance_metrics")
val outputDir = temp.newFolder()
val output = File(outputDir, "hashes.json")

val cli = CommandLine(BazelDiff())
val exitCode = cli.execute(
"generate-hashes",
"-w", workspace.absolutePath,
"-b", "bazel",
"--useCquery",
output.absolutePath)

assertThat(exitCode).isEqualTo(0)

val hashes: Map<String, Any> =
Gson().fromJson(output.readText(), object : TypeToken<Map<String, Any>>() {}.type)
assertThat(hashes.isNotEmpty()).isEqualTo(true)
}

@Test
fun testFineGrainedHashExternalRepo() {
// The difference between these two snapshots is simply upgrading the Guava version.
Expand Down
Loading