Skip to content

Commit

Permalink
ModqueryExecutor logic
Browse files Browse the repository at this point in the history
- `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

bazelbuild/bazel#15365

PiperOrigin-RevId: 448979280
  • Loading branch information
Googler authored and copybara-github committed May 26, 2022
1 parent 8dd83bf commit 616a435
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion proto/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
12 changes: 12 additions & 0 deletions third_party/bazel/src/main/protobuf/failure_details.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

0 comments on commit 616a435

Please sign in to comment.