-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathcontaineranalysis-grafeas-integration.yaml
More file actions
166 lines (165 loc) · 6.97 KB
/
containeranalysis-grafeas-integration.yaml
File metadata and controls
166 lines (165 loc) · 6.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Copyright 2023 Google LLC
#
# 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.
description: Customizations related to the integration with grafeas
url: https://github.com/googleapis/gapic-generator-python/issues/1830
replacements:
- paths: [
packages/google-cloud-containeranalysis/setup.py
]
before: |
dependencies = \[
"google-api-core\[grpc\] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
# Exclude incompatible versions of `google-auth`
# See https://github.com/googleapis/google-cloud-python/issues/12364
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
"grpcio >= 1.33.2, < 2.0.0",
after: |
dependencies = [
"google-api-core[grpc] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
# Exclude incompatible versions of `google-auth`
# See https://github.com/googleapis/google-cloud-python/issues/12364
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
"grafeas >=1.4.1, <2.0",
"grpcio >= 1.33.2, < 2.0.0",
count: 1
- paths: [
packages/google-cloud-containeranalysis/testing/constraints-3.7.txt
]
before: |
google-api-core==1.34.1
google-auth==2.14.1
after: |
google-api-core==1.34.1
grafeas==1.4.1
google-auth==2.14.1
count: 1
- paths: [
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/services/container_analysis/client.py,
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/services/container_analysis/async_client.py,
]
before: |
import google.iam.v1.policy_pb2 as policy_pb2 # type: ignore\n
after: |
import google.iam.v1.policy_pb2 as policy_pb2 # type: ignore
from grafeas import grafeas_v1
from grafeas.grafeas_v1.services.grafeas import transports\n
count: 2
- paths: [
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/services/container_analysis/client.py,
]
before: |
\,\n "credentialsType": None,
\ \},
\ \)
\
\ def set_iam_policy\(
after: |
,\n "credentialsType": None,
},
)\n
def get_grafeas_client(self) -> grafeas_v1.GrafeasClient:
grafeas_transport = grafeas_v1.services.grafeas.transports.GrafeasGrpcTransport(
credentials=self.transport._credentials,
# Set ``credentials_file`` to ``None`` here as
# transport._credentials contains the credentials
# which are saved
credentials_file=None,
host=self.transport._host,
scopes=self.transport.AUTH_SCOPES,
)
return grafeas_v1.GrafeasClient(transport=grafeas_transport)\n
def set_iam_policy(
count: 1
- paths: [
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/services/container_analysis/async_client.py,
]
before: |
\,\n "credentialsType": None,
\ \},
\ \)
\
\ async def set_iam_policy\(
after: |
,\n "credentialsType": None,
},
)\n
def get_grafeas_client(self) -> grafeas_v1.GrafeasClient:
grafeas_transport = grafeas_v1.services.grafeas.transports.GrafeasGrpcTransport(
credentials=self.transport._credentials,
# Set ``credentials_file`` to ``None`` here as
# transport._credentials contains the credentials
# which are saved
credentials_file=None,
host=self.transport._host,
scopes=self.transport.AUTH_SCOPES,
)
return grafeas_v1.GrafeasClient(transport=grafeas_transport)\n
async def set_iam_policy(
count: 1
- paths: [
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/types/containeranalysis.py
]
before: import grafeas.v1.severity_pb2 as severity_pb2 # type: ignore
after: import grafeas.grafeas_v1 # type: ignore
count: 1
- paths: [
packages/google-cloud-containeranalysis/tests/unit/gapic/containeranalysis_v1/test_container_analysis.py
]
before: |
\)
\ create_channel.assert_called_with\(
\ "containeranalysis.googleapis.com:443",
\ credentials=file_creds,
\ credentials_file=None,
\ quota_project_id=None,
\ default_scopes=\("https://www.googleapis.com/auth/cloud-platform",\),
\ scopes=None,
\ default_host="containeranalysis.googleapis.com",
\ ssl_credentials=None,
\ options=\[
\ \("grpc.max_send_message_length", -1\),
\ \("grpc.max_receive_message_length", -1\),
\ \],
\ \)\n\n
after: |
)
create_channel.assert_called_with(
"containeranalysis.googleapis.com:443",
credentials=file_creds,
credentials_file=None,
quota_project_id=None,
default_scopes=("https://www.googleapis.com/auth/cloud-platform",),
scopes=None,
default_host="containeranalysis.googleapis.com",
ssl_credentials=None,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
# Also check client.get_grafeas_client() to make sure that the file credentials are used
assert file_creds == client.get_grafeas_client().transport._credentials\n\n
count: 1
- paths: [
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/types/containeranalysis.py
]
before: grafeas.v1.severity_pb2.Severity
after: grafeas.v1.grafeas.grafeas_v1.Severity
count: 1
- paths: [
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/types/containeranalysis.py
]
before: severity_pb2
after: grafeas.grafeas_v1
count: 2