FR: Expose direct/transitive information in maven_install.json
Context: I'm submitting dependency information to the GitHub Dependency Graph using the REST API and a custom tool that parses the contents of maven_install.json.
One thing that's missing and would be really nice to have is the direct/transitive information for each artifact. I'm currently working around this using bazel query to output the list of artifacts that are direct dependencies. (This works because we have strict_visibility = True):
bazel query --output=streamed_jsonproto "attr(maven_coordinates, '', visible(//..., @maven//...))" | jq -r '.rule.attribute[] | select(.name == "maven_coordinates").stringValue'
The problem with this is that it requires us to have a full Bazel instance in the workflow where we submit the dependency information, and I'd like to not require that, if possible.
Would you consider adding this information to maven_install.json? It can be a new attribute under each object in artifacts or a separate top-level attribute listing all coordinates that are directly installed.