Skip to content

Commit 7fe1257

Browse files
committed
add missing proto stubs; refactor
1 parent f3191fa commit 7fe1257

31 files changed

+4009
-4
lines changed

.github/.OwlBot.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,18 @@ deep-remove-regex:
2121
deep-copy-regex:
2222
- source: /google/spanner/(v.*)/.*-py/(.*)
2323
dest: /owl-bot-staging/spanner/$1/$2
24+
- source: /google/spanner/(v.*)/.*-pb2-py/(commit_response.*|keys.*|mutation.*|query_plan.*|result_set.*|spanner.*|transaction.*|type.*)
25+
dest: /owl-bot-staging/spanner_pb2/$1/$2
2426
- source: /google/spanner/admin/instance/(v.*)/.*-py/(.*)
2527
dest: /owl-bot-staging/spanner_admin_instance/$1/$2
28+
- source: /google/spanner/admin/instance/(v.*)/.*-pb2-py/(common.*|spanner_instance_admin.*)
29+
dest: /owl-bot-staging/spanner_admin_instance_pb2/$1/$2
2630
- source: /google/spanner/admin/database/(v.*)/.*-py/(.*)
2731
dest: /owl-bot-staging/spanner_admin_database/$1/$2
28-
- source: /google/spanner/executor/(v.*)/.*-py/(cloud_executor.*)
29-
dest: /owl-bot-staging/spanner_executor/$1/$2
32+
- source: /google/spanner/admin/database/(v.*)/.*-pb2-py/(common.*|backup.*|spanner_database_admin.*)
33+
dest: /owl-bot-staging/spanner_admin_database_pb2/$1/$2
34+
- source: /google/spanner/executor/(v.*)/.*-pb2-py/(cloud_executor.*)
35+
dest: /owl-bot-staging/spanner_executor_pb2/$1/$2
3036

3137
begin-after-commit-hash: b154da710c5c9eedee127c07f74b6158c9c22382
3238

owlbot.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,24 @@ def get_staging_dirs(
119119
)
120120

121121
for library in get_staging_dirs(default_version="None",
122-
sub_directory="spanner_executor"
122+
sub_directory="spanner_executor_pb2"
123123
):
124-
s.move(library, "test_proxy/protos")
124+
s.move(library, "test_proxy/protos/google/spanner/executor/v1")
125+
126+
for library in get_staging_dirs(default_version="None",
127+
sub_directory="spanner_pb2"
128+
):
129+
s.move(library, "test_proxy/protos/google/spanner/v1")
130+
131+
for library in get_staging_dirs(default_version="None",
132+
sub_directory="spanner_admin_database_pb2"
133+
):
134+
s.move(library, "test_proxy/protos/google/spanner/admin/database/v1")
135+
136+
for library in get_staging_dirs(default_version="None",
137+
sub_directory="spanner_admin_instance_pb2"
138+
):
139+
s.move(library, "test_proxy/protos/google/spanner/admin/instance/v1")
125140

126141
s.remove_staging_dirs()
127142

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright 2015 gRPC authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""The Python implementation of the GRPC helloworld.Greeter server."""
15+
16+
from concurrent import futures
17+
import logging
18+
19+
import grpc
20+
from google.spanner.executor.v1 import cloud_executor_pb2
21+
from google.spanner.executor.v1 import cloud_executor_pb2_grpc
22+
23+
24+
class TestProxyServer(cloud_executor_pb2_grpc.SpannerExecutorProxyServicer):
25+
def ExecuteActionAsync(self, request, context):
26+
print("Execute action async")
27+
print(f"{request=}")
28+
# TODO: do something with the request
29+
yield cloud_executor_pb2.SpannerAsyncActionResponse()
30+
31+
def serve():
32+
port = '50055'
33+
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
34+
cloud_executor_pb2_grpc.add_SpannerExecutorProxyServicer_to_server(TestProxyServer(), server)
35+
server.add_insecure_port('[::]:' + port)
36+
server.start()
37+
print("Server started, listening on " + port)
38+
server.wait_for_termination()
39+
40+
41+
if __name__ == '__main__':
42+
logging.basicConfig()
43+
serve()

test_proxy/protos/google/spanner/admin/database/v1/backup_pb2.py

Lines changed: 143 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2+
"""Client and server classes corresponding to protobuf-defined services."""
3+
import grpc
4+

test_proxy/protos/google/spanner/admin/database/v1/common_pb2.py

Lines changed: 49 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2+
"""Client and server classes corresponding to protobuf-defined services."""
3+
import grpc
4+

test_proxy/protos/google/spanner/admin/database/v1/spanner_database_admin_pb2.py

Lines changed: 221 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)