Aspects: Validation actions defined by aspects are only ran for the top level targets
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the feature request:
See https://groups.google.com/g/bazel-discuss/c/TCo0msh1My4?pli=1 for an example.
If an aspect is used to generate [validation actions](https://bazel.build/extending/rules#validation_actions). i.e.,
```
return [
OutputGroupInfo(
_validation = depset(...)
]
```
The validation is only ran for the top level target, and not the transitive dependencies. This makes it difficult to attach validators because we now need to construct a full shadow graph of all the nodes so we can manually propagate the `validation_output` from the leafs to the root node.
### Which category does this issue belong to?
Core
### What underlying problem are you trying to solve with this feature?
Make attaching validation actions using aspects more intuitive. This issue, along with https://github.com/bazelbuild/bazel/issues/19624 should allow us to have multiple aspects easily add validations to the graph.
### Which operating system are you running Bazel on?
Linux
### What is the output of `bazel info release`?
6.2.0
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
_No response_
### What's the output of `git remote get-url origin; git rev-parse master; git rev-parse HEAD` ?
_No response_
### Have you found anything relevant by searching the web?
_No response_
### Any other information, logs, or outputs that you want to share?
_No response_
Contributor guide
Research direction
Start with the linked Bazel validation-actions documentation and the bazel-discuss example, then inspect how aspects return OutputGroupInfo with the _validation group. The change is complete when validation actions produced by aspects also run for transitive dependencies without requiring a manually constructed shadow graph.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100