Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move firestore to use GAPICBazel and regenerate #187

Merged
merged 15 commits into from
Sep 18, 2020

Conversation

crwilcox
Copy link
Contributor

@crwilcox crwilcox commented Sep 16, 2020

No description provided.

@crwilcox crwilcox added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Sep 16, 2020
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 16, 2020
@tseaver tseaver marked this pull request as draft September 16, 2020 18:24
synth.py Outdated Show resolved Hide resolved
synth.py Show resolved Hide resolved
synth.py Show resolved Hide resolved
@@ -1,2 +1,2 @@
# Marker file for PEP 561.
# The google-firestore-admin package uses inline types.
# The google-cloud-firestore-admin package uses inline types.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am guessing this is not easily changed for multi-gen packages?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to put in feature request to allow for custom package names. Sometimes I want to change the name for other reasons (to insert a hyphen in the middle of a reallylongapiname for example). Getting this right is important for _GAPIC_LIBRARY_VERSION.

synth.py Show resolved Hide resolved
@crwilcox
Copy link
Contributor Author

New Unit test failures that are inline with what @tseaver was seeing.

=========================== short test summary info ============================
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_client_client_options[FirestoreClient-FirestoreGrpcTransport-grpc]
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_client_client_options[FirestoreAsyncClient-FirestoreGrpcAsyncIOTransport-grpc_asyncio]
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_client_client_options_scopes[FirestoreClient-FirestoreGrpcTransport-grpc]
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_client_client_options_scopes[FirestoreAsyncClient-FirestoreGrpcAsyncIOTransport-grpc_asyncio]
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_client_client_options_credentials_file[FirestoreClient-FirestoreGrpcTransport-grpc]
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_client_client_options_credentials_file[FirestoreAsyncClient-FirestoreGrpcAsyncIOTransport-grpc_asyncio]
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_client_client_options_from_dict
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_list_collection_ids
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_list_collection_ids_async
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_base_transport
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_base_transport_with_credentials_file
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_auth_adc
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_transport_auth_adc
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_grpc_transport_channel_mtls_with_client_cert_source
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_grpc_asyncio_transport_channel_mtls_with_client_cert_source
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_grpc_transport_channel_mtls_with_adc[mtls.squid.clam.whelk]
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_grpc_transport_channel_mtls_with_adc[mtls.squid.clam.whelk:443]
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_grpc_asyncio_transport_channel_mtls_with_adc[mtls.squid.clam.whelk]
FAILED tests/unit/gapic/firestore_v1/test_firestore_v1.py::test_firestore_grpc_asyncio_transport_channel_mtls_with_adc[mtls.squid.clam.whelk:443]
19 failed, 1100 passed, 6 warnings in 14.11s
nox > Command py.test --quiet --cov=google.cloud.firestore --cov=google.cloud --cov=tests.unit --cov-append --cov-config=.coveragerc --cov-report= --cov-fail-under=0 tests/unit failed with exit code 1
nox > Session unit-3.8 failed.

@crwilcox
Copy link
Contributor Author

Coverage is down, but otherwise tests are good after merging the two test files and using the generated one as recommended by generator team

nox > Session docfx was successful.
nox > Ran multiple sessions:
nox > * lint: success
nox > * blacken: success
nox > * lint_setup_py: success
nox > * unit-3.6: success
nox > * unit-3.7: success
nox > * unit-3.8: success
nox > * system-3.7: success
nox > * cover: failed
nox > * docs: success
nox > * docfx: success
cleanup

@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/python-firestore API. label Sep 17, 2020
@crwilcox
Copy link
Contributor Author

I think coverage hasn't fell, so much as it was already too low. This issue is still open from @rafilong 's work. #92

@crwilcox crwilcox marked this pull request as ready for review September 17, 2020 17:42
@crwilcox crwilcox removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Sep 18, 2020
Copy link
Contributor

@busunkim96 busunkim96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please also bump the dep google-api-core>=1.22.1 in setup.py.

@@ -1,2 +1,2 @@
# Marker file for PEP 561.
# The google-firestore-admin package uses inline types.
# The google-cloud-firestore-admin package uses inline types.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to put in feature request to allow for custom package names. Sometimes I want to change the name for other reasons (to insert a hyphen in the middle of a reallylongapiname for example). Getting this right is important for _GAPIC_LIBRARY_VERSION.

@tseaver
Copy link
Contributor

tseaver commented Sep 18, 2020

@crwilcox Do you want to force-merge this and then scramble to fix coverage? Or add a temporary hack to synth.py to drop the required coverage level?

@crwilcox crwilcox merged commit 4861b63 into googleapis:master Sep 18, 2020
@crwilcox
Copy link
Contributor Author

@tseaver I forced it in. We have an issue to fix coverage that should likely be prioritized. Though I think if it blocks anything else I am okay dropping to 97% for a time

from google.api_core import operation as ga_operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.api_core import operation as ga_operation
from google.api_core import operation_async
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to break pytype -- I can't tell why it isn't being run in https://source.cloud.google.com/results/invocations/02606fdf-7059-497e-931f-b5c4192081d1/targets/cloud-devrel%2Fclient-libraries%2Fpython%2Fgoogleapis%2Fpython-firestore%2Fpresubmit%2Fpresubmit/log

The fix for it is in [this PR], released in gapic-generator-python 0.33.2. Do we need to update the bazel config to use the newer version?

from google.api_core import operation_async # type: ignore
from google.api_core import operation as ga_operation
from google.api_core import operation
from google.api_core import operation_async
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise here.

@@ -55,6 +55,7 @@ class firestoreCallTransformer(cst.CSTTransformer):
'run_query': ('parent', 'structured_query', 'transaction', 'new_transaction', 'read_time', ),
'update_document': ('document', 'update_mask', 'mask', 'current_document', ),
'write': ('database', 'stream_id', 'writes', 'stream_token', 'labels', ),

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Odd that black didn't correct this -- do we not run it against the scripts directory?

@@ -25,7 +25,7 @@
version = "2.0.0-dev1"
release_status = "Development Status :: 5 - Production/Stable"
dependencies = [
"google-api-core[grpc] >= 1.21.0, < 2.0.0dev",
"google-api-core[grpc] >= 1.22.1, < 2.0.0dev",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 1.22.1 release is odd to have as a minimum: it changes only docstrings. Seems like we would want 1.22.0 (to pick up the feature, "allow quota project to be passed to create_channel"), or else 1.22.2 (bugfix, "only add quota project id if supported").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/python-firestore API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants