[build] validate affected test targets against the current build graph - #17809
Conversation
PR Summary by QodoValidate affected Bazel test targets against current build graph
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. prune_stale_targets missing unit tests
|
There was a problem hiding this comment.
Pull request overview
This PR hardens Selenium’s CI “affected Bazel targets” selection by reconciling the cached trunk-based test index output with the current checkout’s Bazel build graph, preventing CI failures from stale labels and reducing the chance of silently skipping tests after BUILD-only changes.
Changes:
- Prunes stale
_testlabels produced by the cached index by querying the current checkout’s build graph (falling back to keeping all labels if validation fails). - Expands unindexed-file handling so BUILD file changes query the whole package (instead of
attr(srcs, ...)) to catch added/renamed targets in that package.
🔗 Related Issues
💥 What does this PR do?
The Check Targets job selects which tests to run from a cached test-file index (a snapshot of trunk) and writes them to
bazel-targets.txt; the per-language jobs (Java, Python, Ruby, .NET, Rust, Grid) feed that list tobazel test/bazel query. Because the index is a snapshot, it drifts from the branch under test:Check Targets now validates the selected targets against the current checkout before the language jobs act on them.
🔧 Implementation Notes
🤖 AI assistance
🔄 Types of changes