Skip to content

Commit 9a8910e

Browse files
Google APIscopybara-github
authored andcommitted
fix: Modify the bazel.BUILD file by hand to include the compliance protos which are not autogenerated
PiperOrigin-RevId: 420306668
1 parent 1116092 commit 9a8910e

9 files changed

Lines changed: 298 additions & 89 deletions

File tree

google/devtools/containeranalysis/v1/BUILD.bazel

Lines changed: 45 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# This file was automatically generated by BuildFileGenerator
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
3+
4+
# Most of the manual changes to this file will be overwritten.
5+
# It's **only** allowed to change the following rule attribute values:
6+
# - names of *_gapic_assembly_* rules
7+
# - certain parameters of *_gapic_library rules, including but not limited to:
8+
# * extra_protoc_parameters
9+
# * extra_protoc_file_parameters
10+
# The complete list of preserved parameters can be found in the source code.
211

312
# This is an API workspace, having public visibility by default makes perfect sense.
413
package(default_visibility = ["//visibility:public"])
@@ -74,13 +83,16 @@ java_gapic_library(
7483
srcs = [":containeranalysis_proto_with_info"],
7584
gapic_yaml = "containeranalysis_gapic.yaml",
7685
grpc_service_config = "containeranalysis_grpc_service_config.json",
86+
service_yaml = "containeranalysis_v1.yaml",
7787
test_deps = [
7888
":containeranalysis_java_grpc",
7989
"//google/iam/v1:iam_java_grpc",
8090
],
8191
deps = [
8292
":containeranalysis_java_proto",
93+
"//google/api:api_java_proto",
8394
"//google/iam/v1:iam_java_proto",
95+
"//grafeas/v1:common_java_proto",
8496
],
8597
)
8698

@@ -125,38 +137,38 @@ go_proto_library(
125137
"//grafeas/v1:grafeas_go_proto",
126138
],
127139
)
128-
# Fix compilation error
129-
# cloud.google.com/go/containeranalysis/apiv1/container_analysis_client.go:66:9: undefined: containeranalysispb
130-
#go_gapic_library(
131-
# name = "containeranalysis_go_gapic",
132-
# src = ":containeranalysis_proto_with_info",
133-
# gapic_yaml = "containeranalysis_gapic.yaml",
134-
# importpath = "cloud.google.com/go/containeranalysis/apiv1",
135-
# package = "google.devtools.containeranalysis.v1",
136-
# service_yaml = "//google/devtools/containeranalysis:containeranalysis_v1.yaml",
137-
# deps = [
138-
# ":containeranalysis_go_proto",
139-
# "//google/iam/v1:iam_go_proto",
140-
# ],
141-
#)
142-
#
143-
#go_test(
144-
# name = "containeranalysis_go_gapic_test",
145-
# srcs = [":containeranalysis_go_gapic_srcjar_test"],
146-
# embed = [":containeranalysis_go_gapic"],
147-
# importpath = "cloud.google.com/go/containeranalysis/apiv1",
148-
#)
149-
#
150-
## Open Source Packages
151-
#go_gapic_assembly_pkg(
152-
# name = "gapi-cloud-devtools-containeranalysis-v1-go",
153-
# deps = [
154-
# ":containeranalysis_go_gapic",
155-
# ":containeranalysis_go_gapic_srcjar-smoke-test.srcjar",
156-
# ":containeranalysis_go_gapic_srcjar-test.srcjar",
157-
# ":containeranalysis_go_proto",
158-
# ],
159-
#)
140+
141+
# go_gapic_library(
142+
# name = "containeranalysis_go_gapic",
143+
# srcs = [":containeranalysis_proto_with_info"],
144+
# grpc_service_config = "containeranalysis_grpc_service_config.json",
145+
# importpath = "cloud.google.com/go/devtools/containeranalysis/apiv1;containeranalysis",
146+
# metadata = True,
147+
# service_yaml = "containeranalysis_v1.yaml",
148+
# deps = [
149+
# ":containeranalysis_go_proto",
150+
# "//google/iam/v1:iam_go_proto",
151+
# "//grafeas/v1:common_go_proto",
152+
# ],
153+
# )
154+
155+
# go_test(
156+
# name = "containeranalysis_go_gapic_test",
157+
# srcs = [":containeranalysis_go_gapic_srcjar_test"],
158+
# embed = [":containeranalysis_go_gapic"],
159+
# importpath = "cloud.google.com/go/devtools/containeranalysis/apiv1",
160+
# )
161+
162+
# # Open Source Packages
163+
# go_gapic_assembly_pkg(
164+
# name = "gapi-cloud-devtools-containeranalysis-v1-go",
165+
# deps = [
166+
# ":containeranalysis_go_gapic",
167+
# ":containeranalysis_go_gapic_srcjar-metadata.srcjar",
168+
# ":containeranalysis_go_gapic_srcjar-test.srcjar",
169+
# ":containeranalysis_go_proto",
170+
# ],
171+
# )
160172

161173
##############################################################################
162174
# Python
@@ -208,6 +220,7 @@ php_gapic_library(
208220
name = "containeranalysis_php_gapic",
209221
srcs = [":containeranalysis_proto_with_info"],
210222
grpc_service_config = "containeranalysis_grpc_service_config.json",
223+
service_yaml = "containeranalysis_v1.yaml",
211224
deps = [
212225
":containeranalysis_php_grpc",
213226
":containeranalysis_php_proto",

google/devtools/containeranalysis/v1/containeranalysis.proto

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -23,7 +23,9 @@ import "google/api/resource.proto";
2323
import "google/iam/v1/iam_policy.proto";
2424
import "google/iam/v1/policy.proto";
2525
import "google/protobuf/timestamp.proto";
26-
import "grafeas/v1/vulnerability.proto";
26+
import "grafeas/v1/common.proto";
27+
import "grafeas/v1/grafeas.proto";
28+
import "grafeas/v1/severity.proto";
2729

2830
option csharp_namespace = "Google.Cloud.DevTools.ContainerAnalysis.V1";
2931
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1;containeranalysis";
@@ -48,8 +50,7 @@ option php_namespace = "Google\\Cloud\\ContainerAnalysis\\V1";
4850
// image with the vulnerability referring to that note.
4951
service ContainerAnalysis {
5052
option (google.api.default_host) = "containeranalysis.googleapis.com";
51-
option (google.api.oauth_scopes) =
52-
"https://www.googleapis.com/auth/cloud-platform";
53+
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
5354

5455
// Sets the access control policy on the specified note or occurrence.
5556
// Requires `containeranalysis.notes.setIamPolicy` or
@@ -59,8 +60,7 @@ service ContainerAnalysis {
5960
// The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
6061
// notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
6162
// occurrences.
62-
rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest)
63-
returns (google.iam.v1.Policy) {
63+
rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
6464
option (google.api.http) = {
6565
post: "/v1/{resource=projects/*/notes/*}:setIamPolicy"
6666
body: "*"
@@ -80,8 +80,7 @@ service ContainerAnalysis {
8080
// The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
8181
// notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
8282
// occurrences.
83-
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest)
84-
returns (google.iam.v1.Policy) {
83+
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
8584
option (google.api.http) = {
8685
post: "/v1/{resource=projects/*/notes/*}:getIamPolicy"
8786
body: "*"
@@ -100,8 +99,7 @@ service ContainerAnalysis {
10099
// The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
101100
// notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
102101
// occurrences.
103-
rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest)
104-
returns (google.iam.v1.TestIamPermissionsResponse) {
102+
rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
105103
option (google.api.http) = {
106104
post: "/v1/{resource=projects/*/notes/*}:testIamPermissions"
107105
body: "*"
@@ -114,9 +112,7 @@ service ContainerAnalysis {
114112
}
115113

116114
// Gets a summary of the number and severity of occurrences.
117-
rpc GetVulnerabilityOccurrencesSummary(
118-
GetVulnerabilityOccurrencesSummaryRequest)
119-
returns (VulnerabilityOccurrencesSummary) {
115+
rpc GetVulnerabilityOccurrencesSummary(GetVulnerabilityOccurrencesSummaryRequest) returns (VulnerabilityOccurrencesSummary) {
120116
option (google.api.http) = {
121117
get: "/v1/{parent=projects/*}/occurrences:vulnerabilitySummary"
122118
};
@@ -126,12 +122,13 @@ service ContainerAnalysis {
126122

127123
// Request to get a vulnerability summary for some set of occurrences.
128124
message GetVulnerabilityOccurrencesSummaryRequest {
129-
// The name of the project to get a vulnerability summary for in the form of
125+
// Required. The name of the project to get a vulnerability summary for in the form of
130126
// `projects/[PROJECT_ID]`.
131127
string parent = 1 [
132-
(google.api.resource_reference).type =
133-
"cloudresourcemanager.googleapis.com/Project",
134-
(google.api.field_behavior) = REQUIRED
128+
(google.api.field_behavior) = REQUIRED,
129+
(google.api.resource_reference) = {
130+
type: "cloudresourcemanager.googleapis.com/Project"
131+
}
135132
];
136133

137134
// The filter expression.

google/devtools/containeranalysis/v1/containeranalysis_v1.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,10 @@ backend:
1818
rules:
1919
- selector: 'google.devtools.containeranalysis.v1.ContainerAnalysis.*'
2020
deadline: 30.0
21-
- selector: 'google.longrunning.Operations.*'
22-
deadline: 30.0
2321

2422
authentication:
2523
rules:
2624
- selector: 'google.devtools.containeranalysis.v1.ContainerAnalysis.*'
2725
oauth:
2826
canonical_scopes: |-
2927
https://www.googleapis.com/auth/cloud-platform
30-
- selector: 'google.longrunning.Operations.*'
31-
oauth:
32-
canonical_scopes: |-
33-
https://www.googleapis.com/auth/cloud-platform

grafeas/v1/BUILD.bazel

Lines changed: 113 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ proto_library(
3535
"intoto_statement.proto",
3636
"package.proto",
3737
"provenance.proto",
38+
"severity.proto",
3839
"slsa_provenance.proto",
3940
"upgrade.proto",
4041
"vulnerability.proto",
@@ -60,6 +61,66 @@ proto_library_with_info(
6061
],
6162
)
6263

64+
# The compliance_proto, common_proto and severity_proto targets were added so
65+
# that clients can depend on those specific targets rather than grafeas_proto.
66+
# Some clients that run code on certain VMs needed the smaller targets. Note
67+
# that these were added by hand and were not autogenerated. Please ensure that
68+
# these are not deleted while updating this file.
69+
proto_library(
70+
name = "compliance_proto",
71+
srcs = [
72+
"compliance.proto",
73+
],
74+
deps = [
75+
"//google/api:annotations_proto",
76+
"//google/api:client_proto",
77+
"//google/api:field_behavior_proto",
78+
"//google/api:resource_proto",
79+
"//google/rpc:status_proto",
80+
":severity_proto",
81+
"@com_google_protobuf//:any_proto",
82+
"@com_google_protobuf//:empty_proto",
83+
"@com_google_protobuf//:field_mask_proto",
84+
"@com_google_protobuf//:timestamp_proto",
85+
],
86+
)
87+
88+
proto_library(
89+
name = "common_proto",
90+
srcs = [
91+
"common.proto",
92+
],
93+
deps = [
94+
"//google/api:annotations_proto",
95+
"//google/api:client_proto",
96+
"//google/api:field_behavior_proto",
97+
"//google/api:resource_proto",
98+
"//google/rpc:status_proto",
99+
"@com_google_protobuf//:any_proto",
100+
"@com_google_protobuf//:empty_proto",
101+
"@com_google_protobuf//:field_mask_proto",
102+
"@com_google_protobuf//:timestamp_proto",
103+
],
104+
)
105+
106+
proto_library(
107+
name = "severity_proto",
108+
srcs = [
109+
"severity.proto",
110+
],
111+
deps = [
112+
"//google/api:annotations_proto",
113+
"//google/api:client_proto",
114+
"//google/api:field_behavior_proto",
115+
"//google/api:resource_proto",
116+
"//google/rpc:status_proto",
117+
"@com_google_protobuf//:any_proto",
118+
"@com_google_protobuf//:empty_proto",
119+
"@com_google_protobuf//:field_mask_proto",
120+
"@com_google_protobuf//:timestamp_proto",
121+
],
122+
)
123+
63124
##############################################################################
64125
# Java
65126
##############################################################################
@@ -94,6 +155,7 @@ java_gapic_library(
94155
],
95156
deps = [
96157
":grafeas_java_proto",
158+
":common_proto",
97159
"//google/api:api_java_proto",
98160
],
99161
)
@@ -103,7 +165,9 @@ java_gapic_test(
103165
test_classes = [
104166
"io.grafeas.v1.GrafeasClientTest",
105167
],
106-
runtime_deps = [":grafeas_java_gapic_test"],
168+
runtime_deps = [":grafeas_java_gapic_test",
169+
":common_proto",
170+
],
107171
)
108172

109173
# Open Source Packages
@@ -117,6 +181,10 @@ java_gapic_assembly_gradle_pkg(
117181
],
118182
)
119183

184+
java_proto_library(
185+
name = "common_java_proto",
186+
deps = [":common_proto"],
187+
)
120188
##############################################################################
121189
# Go
122190
##############################################################################
@@ -132,7 +200,8 @@ go_proto_library(
132200
name = "grafeas_go_proto",
133201
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
134202
importpath = "google.golang.org/genproto/googleapis/grafeas/v1",
135-
protos = [":grafeas_proto"],
203+
protos = [":grafeas_proto",
204+
],
136205
deps = [
137206
"//google/api:annotations_go_proto",
138207
"//google/rpc:status_go_proto",
@@ -169,6 +238,47 @@ go_gapic_assembly_pkg(
169238
],
170239
)
171240

241+
# The compliance_go_proto, common_go_proto and severity_go_proto targets were
242+
# added so that clients can depend on those specific targets rather than
243+
# grafeas_proto. Some clients that run code on certain VMs needed the
244+
# smaller targets. Note that these were added by hand and were not
245+
# autogenerated. Please ensure that these are not deleted while updating this
246+
# file.
247+
go_proto_library(
248+
name = "compliance_go_proto",
249+
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
250+
importpath = "google.golang.org/genproto/googleapis/grafeas/v1",
251+
protos = [":compliance_proto",
252+
":severity_proto",
253+
],
254+
deps = [
255+
"//google/api:annotations_go_proto",
256+
"//google/rpc:status_go_proto",
257+
],
258+
)
259+
260+
go_proto_library(
261+
name = "common_go_proto",
262+
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
263+
importpath = "google.golang.org/genproto/googleapis/grafeas/v1",
264+
protos = [":common_proto"],
265+
deps = [
266+
"//google/api:annotations_go_proto",
267+
"//google/rpc:status_go_proto",
268+
],
269+
)
270+
271+
go_proto_library(
272+
name = "severity_go_proto",
273+
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
274+
importpath = "google.golang.org/genproto/googleapis/grafeas/v1",
275+
protos = [":severity_proto"],
276+
deps = [
277+
"//google/api:annotations_go_proto",
278+
"//google/rpc:status_go_proto",
279+
],
280+
)
281+
172282
##############################################################################
173283
# Python
174284
##############################################################################
@@ -371,7 +481,7 @@ cc_proto_library(
371481
)
372482

373483
cc_grpc_library(
374-
name = "logging_cc_grpc",
484+
name = "grafeas_cc_grpc",
375485
srcs = [":grafeas_proto"],
376486
grpc_only = True,
377487
deps = [":grafeas_cc_proto"],

grafeas/v1/compliance.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ syntax = "proto3";
1616

1717
package grafeas.v1;
1818

19-
import "grafeas/v1/vulnerability.proto";
19+
import "grafeas/v1/severity.proto";
2020

2121
option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
2222
option java_multiple_files = true;

0 commit comments

Comments
 (0)