From 1b2dd037bebe72b7b5a1d2843b2441107d99ee0b Mon Sep 17 00:00:00 2001 From: Mustafa Gezen Date: Thu, 31 Aug 2023 10:18:44 +0200 Subject: [PATCH] Create grpc-gateway for longrunning --- BUILD | 2 + devtools/nfv2/main.go | 2 +- .../googleapis/google/longrunning/BUILD | 43 +++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 third_party/googleapis/google/longrunning/BUILD diff --git a/BUILD b/BUILD index f5240370..a41e0806 100644 --- a/BUILD +++ b/BUILD @@ -34,6 +34,8 @@ exports_files([".swcrc"]) # gazelle:exclude vendor.go # gazelle:go_grpc_compilers @io_bazel_rules_go//proto:go_grpc,//:go_gen_grpc_gateway # gazelle:resolve go github.com/bazelbuild/bazel-watcher/internal/ibazel/profiler //third_party/github.com/bazelbuild/bazel-watcher/internal/ibazel/profiler +# gazelle:resolve go google.golang.org/genproto/googleapis/longrunning //third_party/googleapis/google/longrunning:longrunning_go_proto +# gazelle:resolve proto go google/longrunning/operations.proto //third_party/googleapis/google/longrunning:longrunning_go_proto # gazelle:resolve proto proto google/api/annotations.proto @googleapis//google/api:annotations_proto # gazelle:resolve proto go google/api/annotations.proto @org_golang_google_genproto//googleapis/api/annotations gazelle(name = "gazelle") diff --git a/devtools/nfv2/main.go b/devtools/nfv2/main.go index 5ac3fa9e..12419024 100644 --- a/devtools/nfv2/main.go +++ b/devtools/nfv2/main.go @@ -65,7 +65,7 @@ func main() { base.LogFatalf("could not change directory: %v", err) } - queryProto := callBazel("query", "kind(go_proto_library, //... - //vendor/... - //third_party/... + //third_party/bazel/...)", "--output", "proto") + queryProto := callBazel("query", "kind(go_proto_library, //... - //vendor/... - //third_party/... + //third_party/bazel/... + //third_party/googleapis/google/longrunning/...)", "--output", "proto") var query blaze_query.QueryResult err = proto.Unmarshal(queryProto, &query) diff --git a/third_party/googleapis/google/longrunning/BUILD b/third_party/googleapis/google/longrunning/BUILD new file mode 100644 index 00000000..0302ad8b --- /dev/null +++ b/third_party/googleapis/google/longrunning/BUILD @@ -0,0 +1,43 @@ +# Copyright 2023 Peridot Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") + +go_proto_library( + name = "longrunning_go_proto", + compilers = [ + "@io_bazel_rules_go//proto:go_grpc", + "//:go_gen_grpc_gateway", + ], + importpath = "google.golang.org/genproto/googleapis/longrunning", + proto = "@go_googleapis//google/longrunning:longrunning_proto", + visibility = ["//visibility:public"], + deps = [ + "@go_googleapis//google/api:annotations_go_proto", + "@go_googleapis//google/rpc:status_go_proto", + "@org_golang_google_protobuf//proto", + "@org_golang_google_protobuf//types/known/anypb", + ], +) + +go_library( + name = "longrunning", + embed = [ + ":longrunning_go_proto", + ], + importpath = "go.resf.org/peridot/third_party/googleapis/google/longrunning", + visibility = ["//visibility:public"], +)