Skip to content

Commit

Permalink
PR Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
bdomen-ggl committed May 22, 2023
1 parent f0b0b6a commit 6037e2b
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 80 deletions.
4 changes: 2 additions & 2 deletions build/grpc_gateway/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ go_proto_compiler(
visibility = ["//visibility:public"],
deps = [
"@com_github_golang_protobuf//descriptor:go_default_library_gen",
"@com_github_grpc_ecosystem_grpc_gateway//runtime:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway//utilities:go_default_library",
"@go_googleapis//google/api:annotations_go_proto",
"@grpc_ecosystem_grpc_gateway//runtime:go_default_library",
"@grpc_ecosystem_grpc_gateway//utilities:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//grpclog:go_default_library",
Expand Down
7 changes: 3 additions & 4 deletions build/grpc_gateway/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@

load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")

def go_grpc_gateway_proto_library(name, import_path, protos, embed = []):
def go_grpc_gateway_proto_library(name, visibility = None, **kwargs):
go_proto_library(
name = name,
compilers = [
"//build/grpc_gateway:go_apiv2",
"//build/grpc_gateway:go_grpc",
"//build/grpc_gateway:go_grpc_gateway",
],
embed = embed,
importpath = import_path,
protos = protos,
visibility = visibility,
**kwargs
)
2 changes: 1 addition & 1 deletion build/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def wfa_measurement_system_repositories():
)

http_archive(
name = "com_github_grpc_ecosystem_grpc_gateway",
name = "grpc_ecosystem_grpc_gateway",
sha256 = "0675f7f8300f659a23e7ea4b8be5b38726c173b506a4d25c4309e93b4f1616ae",
strip_prefix = "grpc-gateway-2.15.2",
urls = ["https://github.com/grpc-ecosystem/grpc-gateway/archive/refs/tags/v2.15.2.tar.gz"],
Expand Down
48 changes: 6 additions & 42 deletions src/main/proto/wfa/measurement/reporting/bff/v1alpha/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("//build/grpc_gateway:defs.bzl", "go_grpc_gateway_proto_library")

package(default_visibility = ["//visibility:public"])
Expand Down Expand Up @@ -63,64 +62,29 @@ proto_library(
],
)

go_proto_library(
go_grpc_gateway_proto_library(
name = "metric_go_proto",
compilers = [
"//build/grpc_gateway:go_apiv2",
"//build/grpc_gateway:go_grpc",
"//build/grpc_gateway:go_grpc_gateway",
],
embed = [
":time_interval_go_proto",
],
embed = [":time_interval_go_proto"],
importpath = GO_IMPORT_PATH,
protos = [":metric_proto"],
)

go_proto_library(
go_grpc_gateway_proto_library(
name = "time_interval_go_proto",
compilers = [
"//build/grpc_gateway:go_apiv2",
"//build/grpc_gateway:go_grpc",
"//build/grpc_gateway:go_grpc_gateway",
],
importpath = GO_IMPORT_PATH,
protos = [":time_interval_proto"],
)

go_proto_library(
go_grpc_gateway_proto_library(
name = "report_go_proto",
compilers = [
"//build/grpc_gateway:go_apiv2",
"//build/grpc_gateway:go_grpc",
"//build/grpc_gateway:go_grpc_gateway",
],
embed = [
":metric_go_proto",
],
embed = [":metric_go_proto"],
importpath = GO_IMPORT_PATH,
protos = [":report_proto"],
)

go_grpc_gateway_proto_library(
name = "reports_service_go_proto",
embed = [":report_go_proto"],
import_path = GO_IMPORT_PATH,
importpath = GO_IMPORT_PATH,
protos = [":reports_service_proto"],
)

# go_proto_library(
# name = "reports_service_go_proto",
# compilers = [
# "//build/grpc_gateway:go_apiv2",
# "//build/grpc_gateway:go_grpc",
# "//build/grpc_gateway:go_grpc_gateway",
# ],
# embed = [
# ":report_go_proto",
# ],
# importpath = GO_IMPORT_PATH,
# protos = [
# ":reports_service_proto",
# ],
# )
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ message MetricResult {
// The metric value once calculated is stored in `MetricResult`.
message Metric {
option (google.api.resource) = {
type: "reporting.halo-cmm.org/Metric"
type: "ui.reporting.halo-cmm.org/Metric"
pattern: "measurementConsumers/{measurement_consumer}/metrics/{metric}"
};
// Resource name
Expand All @@ -199,7 +199,7 @@ message Metric {
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE,
(google.api.resource_reference) = {
type: "reporting.halo-cmm.org/ReportingSet"
type: "ui.reporting.halo-cmm.org/ReportingSet"
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ option go_package = "wfa/measurement/reporting/bff/v1alpha/reportingpb";
// of `Grouping`s defined in `MetricCalculationSpec`.
message Report {
option (google.api.resource) = {
type: "reporting.halo-cmm.org/Report"
type: "ui.reporting.halo-cmm.org/Report"
pattern: "measurementConsumers/{measurement_consumer}/reports/{report}"
};

Expand Down Expand Up @@ -90,7 +90,7 @@ message Report {
string key = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "reporting.halo-cmm.org/ReportingSet"
type: "ui.reporting.halo-cmm.org/ReportingSet"
}
];
// Value of the map entry.
Expand Down Expand Up @@ -137,7 +137,7 @@ message Report {

// The reporting set associated with this `MetricCalculationSpec`.
string reporting_set = 2 [(google.api.resource_reference) = {
type: "reporting.halo-cmm.org/ReportingSet"
type: "ui.reporting.halo-cmm.org/ReportingSet"
}];

// Whether the results for a given time interval is cumulative with those of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ service Reports {
};
option (google.api.method_signature) = "parent";
}

// // Creates a `Report`.
// rpc CreateReport(CreateReportRequest) returns (Report) {
// option (google.api.http) = {
// post: "/v1alpha/{parent=measurementConsumers/*}/reports"
// body: "report"
// };
// option (google.api.method_signature) = "parent,report";
// }
}

// Request message for `GetReport` method.
Expand All @@ -58,7 +49,9 @@ message GetReportRequest {
// Format: measurementConsumers/{measurement_consumer}/reports/{report}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "reporting.halo-cmm.org/Report" }
(google.api.resource_reference) = {
type: "ui.reporting.halo-cmm.org/Report"
}
];
}

Expand All @@ -68,7 +61,7 @@ message ListReportsRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "reporting.halo-cmm.org/Report"
child_type: "ui.reporting.halo-cmm.org/Report"
}
];

Expand All @@ -95,18 +88,3 @@ message ListReportsResponse {
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}

// // Request message for `CreateReport` method.
// message CreateReportRequest {
// // The parent resource where this report will be created.
// // Format: measurementConsumers/{measurement_consumer}
// string parent = 1 [
// (google.api.field_behavior) = REQUIRED,
// (google.api.resource_reference) = {
// child_type: "reporting.halo-cmm.org/Report"
// }
// ];

// // The report to create.
// Report report = 2 [(google.api.field_behavior) = REQUIRED];
// }

0 comments on commit 6037e2b

Please sign in to comment.