Commit 876b186
committed
Fix query-failure fallback for bzlmod-only workspaces
The unioned 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 query failure (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.
Mark every hashed target as impacted on 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 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 f40009d commit 876b186
2 files changed
Lines changed: 47 additions & 2 deletions
File tree
- cli/src
- main/kotlin/com/bazel_diff/interactor
- test/kotlin/com/bazel_diff/interactor
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
377 | | - | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
378 | 386 | | |
379 | 387 | | |
380 | 388 | | |
| |||
cli/src/test/kotlin/com/bazel_diff/interactor/CalculateImpactedTargetsInteractorModuleQueryTest.kt
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
331 | 368 | | |
332 | 369 | | |
333 | 370 | | |
| |||
0 commit comments