Open coryan opened 3 years ago
Sweet, this feels much cleaner, thanks for proposing this and giving the clear breakdown. I'll look a bit deeper and see if there's any other feedback I can add, or possible suggestions, but this definitely feels good to me as you've outlined it.
Thanks. Realistically I won't be able to work on this for several weeks. If anybody wants to improve things, please go ahead.
Problem
When I moved the REST service implementation to the
testbench
directory I created a cyclic dependency. Basicallytestbench
needstestbench/rest_server.py
(for therun()
) function, which needsgcs/bucket.py
, which needstestbench
(for all the helper functions).Proposal
I think we need to redefine the layers for the testbench, they were already kind of fuzzy, and my breakage makes it worse. I think we should organize the code in the following layers.
testbench
run()
function forgunicorn
andmain
testbench.servers
testbench.servers
testbench.database
,testbench.utility
,google.storage.v2
testbench.database
testbench.utility
testbench.utility
google.storage.v2
google.storage.v2
Where do things move?
The
grpc_server.py
andrest_server.py
files move totestbench.servers
. We will not splitrest_server.py
as part of this work.The current
gcs
module would move totestbench.database
.For the most part, other
testbench/*.py
files move totestbench.utility
.Breakdown
Some of these are tentative, but the general idea would be to break this down into steps.
testbench/error.py
totestbench/utility/error.py
testbench/common.py
snake case functions totestbench/utility/*
testbench/acl.py
totestbench/utility/
testbench/project.py
, move the server-like things totestbench/servers/
and the rest totestbench/utility/
.testbench/csek.py
totestbench/utility/
testbench/generation.py
totestbench/utility/
testbench/handle_gzip.py
totestbench/servers/
gcs/*.py
totestbench/database/*.py
testbench/database.py
totestbench/database/
testbench/grpc_server.py
totestbench/servers/
testbench/rest_server.py
totestbench/servers/