Commit e031d63
committed
Fix query-failure fallback for bzlmod-only workspaces
The per-repo rdeps query-failure fallback filtered out every `@@` label
on the assumption that the hash set was mostly workspace-local `//...`
targets. That assumption does not hold on bzlmod-only workspaces where
`generate-hashes` emits almost entirely `@@canonical` labels plus a
small number of `//external:<apparent>` bzlmod-synthetic bridges, with
zero workspace-local targets.
On such workspaces, a single failed `rdeps(//..., @@<repo>//...)` query
(for example, one caused by an unrelated loading error elsewhere in the
dep graph) left the filter with only the `//external:*` bridges, which
the downstream `excludeExternalTargets=true` default (Tinder#334) then strips
entirely — producing silently-empty impacted output on what should be a
"conservatively rebuild everything" signal.
Mirror the outer catch at line 401 and mark every hashed target as
impacted on per-repo query failure. Downstream filters (`targetTypes`,
`excludeExternalTargets`) remain the caller's responsibility, which is
the whole point of surfacing the full set upstream.
Add a regression test in CalculateImpactedTargetsInteractorModuleQueryTest
that constructs a bzlmod-shaped hash set (two `@@abseil-cpp+` targets +
one `//external:*` bridge, no workspace targets), stubs
`queryService.query` to throw, and asserts all three labels appear in
the output.1 parent a61697d commit e031d63
2 files changed
Lines changed: 50 additions & 1 deletion
File tree
- cli/src
- main/kotlin/com/bazel_diff/interactor
- test/kotlin/com/bazel_diff/interactor
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
378 | 389 | | |
379 | 390 | | |
380 | 391 | | |
| |||
cli/src/test/kotlin/com/bazel_diff/interactor/CalculateImpactedTargetsInteractorModuleQueryTest.kt
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
315 | 353 | | |
316 | 354 | | |
317 | 355 | | |
| |||
0 commit comments