chore: librarian generate pull request: 20260325T203946Z#1783
chore: librarian generate pull request: 20260325T203946Z#1783
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request, generated by the Librarian CLI, integrates recent proto changes into the Cloud Client Libraries. It enhances object composition capabilities with a new field, refines documentation for various read operations and object contexts, and updates the project's build and test configurations to align with current Python ecosystem standards and testing practices. These changes ensure the library remains up-to-date with the latest API definitions and improves the overall development and testing workflow. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the Python environment and testing configurations, including raising the minimum required Python version to 3.10, adding new grpc and testing extra dependencies in setup.py, and refactoring Nox sessions for conformance tests. Specifically, a new conftest_retry_bidi session is introduced, and the existing conftest_retry session is improved. The PR also removes explicit flake8 pinning and the re import, updates internal metadata files, and makes minor documentation adjustments in storage.py for ComposeObjectRequest, ReadRange, and ObjectContexts. Additionally, the mTLS client certificate handling in client.py is refactored to directly validate the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable, with corresponding unit test updates. Review feedback points out an inconsistency in handling the case sensitivity of the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable, an inefficiency in the conftest_retry_bidi Nox session due to repeated pytest invocations, and a duplicate google-cloud-testutils dependency in setup.py's testing extras.
| if client_options is None: | ||
| client_options = client_options_lib.ClientOptions() | ||
| use_client_cert = StorageClient._use_client_cert_effective() | ||
| use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") |
There was a problem hiding this comment.
The value of the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not converted to lowercase here. This is inconsistent with the _read_environment_variables method (line 438) and means that values like 'True' or 'TRUE' will raise a ValueError instead of being correctly interpreted. To handle the environment variable case-insensitively and improve robustness, please add .lower().
| use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") | |
| use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false").lower() |
| bidi_tests = [ | ||
| "tests/conformance/test_bidi_reads.py", | ||
| "tests/conformance/test_bidi_writes.py", | ||
| ] | ||
| for test_file in bidi_tests: | ||
| session.run( | ||
| "pytest", | ||
| "-vv", | ||
| "-s", | ||
| test_file, | ||
| env={"DOCKER_API_VERSION": "1.39"}, | ||
| ) |
There was a problem hiding this comment.
The conftest_retry_bidi session runs pytest in a loop for each test file. This is inefficient as it incurs pytest startup overhead for each file. You can improve performance by running pytest once with all test files passed as arguments.
bidi_tests = [
"tests/conformance/test_bidi_reads.py",
"tests/conformance/test_bidi_writes.py",
]
session.run(
"pytest",
"-vv",
"-s",
*bidi_tests,
env={"DOCKER_API_VERSION": "1.39"},
)| "pytest-asyncio", | ||
| "pytest-rerunfailures", | ||
| "pytest-xdist", | ||
| "google-cloud-testutils", |
PR created by the Librarian CLI to generate Cloud Client Libraries code from protos.
BEGIN_COMMIT
BEGIN_NESTED_COMMIT
feat: Added a new field
ComposeObjectRequest.delete_source_objectsfieldPiperOrigin-RevId: 863087065
Library-IDs: google-cloud-storage
Source-link: googleapis/googleapis@51ff87f4
END_NESTED_COMMIT
BEGIN_NESTED_COMMIT
docs: Updated documentation for
BidiReadObject,ReadObjectRequest, andObjectContextsPiperOrigin-RevId: 863087065
Library-IDs: google-cloud-storage
Source-link: googleapis/googleapis@51ff87f4
END_NESTED_COMMIT
END_COMMIT
This pull request is generated with proto changes between
googleapis/googleapis@5400ccce
(exclusive) and
googleapis/googleapis@51ff87f4
(inclusive).
Librarian Version: v1.0.2-0.20260309131826-42ac5c451239
Language Image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:8e2c32496077054105bd06c54a59d6a6694287bc053588e24debe6da6920ad91