From f822ead5833e1b4091b7fa88981c8935915a2ace Mon Sep 17 00:00:00 2001 From: Googler Date: Mon, 16 May 2022 09:24:22 -0700 Subject: [PATCH] ModqueryExecutor logic - `tree`, `all_paths` core implementations (using the same helper graph walkers) - `show` implementation added (mostly uses `Query`'s `TargetOutputter` which is now publicly exposed instead of package-private). - `text`, `json` and `graphviz dot` outputters added - Unit testing for `ModqueryCommand` syntax logic - Unit testing for `ModqueryExecutor` both processing and output logic https://github.com/bazelbuild/bazel/issues/15365 PiperOrigin-RevId: 448979280 --- proto/BUILD | 2 +- .../bazel/src/main/protobuf/failure_details.proto | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/proto/BUILD b/proto/BUILD index 776e1f783249..5f5a54cd3022 100644 --- a/proto/BUILD +++ b/proto/BUILD @@ -20,7 +20,7 @@ create_proto_visibility_group() java_import( name = "proto_deps", jars = [":repackaged_proto_deps"], - visibility = PLUGIN_PACKAGES_VISIBILITY, + visibility = PLUGIN_PACKAGES_VISIBILITY + ["//third_party/bazel/src/test/java/com/google/devtools/build/lib/bazel/commands:__pkg__"], ) proto_library( diff --git a/third_party/bazel/src/main/protobuf/failure_details.proto b/third_party/bazel/src/main/protobuf/failure_details.proto index c8a872147653..54091ef95939 100644 --- a/third_party/bazel/src/main/protobuf/failure_details.proto +++ b/third_party/bazel/src/main/protobuf/failure_details.proto @@ -147,6 +147,7 @@ message FailureDetail { StarlarkLoading starlark_loading = 179; ExternalDeps external_deps = 181; DiffAwareness diff_awareness = 182; + ModqueryCommand modquery_command = 183; } reserved 102; // For internal use @@ -1274,3 +1275,14 @@ message DiffAwareness { Code code = 1; } + +message ModqueryCommand { + enum Code { + MODQUERY_COMMAND_UNKNOWN = 0 [(metadata) = { exit_code: 37 }]; + MISSING_ARGUMENTS = 1 [(metadata) = { exit_code: 2 }]; + TOO_MANY_ARGUMENTS = 2 [(metadata) = { exit_code: 2 }]; + INVALID_ARGUMENTS = 3 [(metadata) = { exit_code: 2 }]; + } + + Code code = 1; +}