Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

chore: librarian generate pull request: 20260325T203946Z#1783

Closed
parthea wants to merge 2 commits intomainfrom
librarian-20260325T203946Z
Closed

chore: librarian generate pull request: 20260325T203946Z#1783
parthea wants to merge 2 commits intomainfrom
librarian-20260325T203946Z

Conversation

@parthea
Copy link
Copy Markdown
Contributor

@parthea parthea commented Mar 25, 2026

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_objects field

PiperOrigin-RevId: 863087065
Library-IDs: google-cloud-storage
Source-link: googleapis/googleapis@51ff87f4
END_NESTED_COMMIT

BEGIN_NESTED_COMMIT
docs: Updated documentation for BidiReadObject, ReadObjectRequest, and ObjectContexts

PiperOrigin-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

@parthea parthea requested review from a team as code owners March 25, 2026 20:39
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: storage Issues related to the googleapis/python-storage API. labels Mar 25, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • New Feature: Added a new optional field delete_source_objects to ComposeObjectRequest and ObjectPreconditions to control the deletion of source objects during a compose operation.
  • Documentation Updates: Updated documentation for BidiReadObject, ReadObjectRequest, and ObjectContexts to clarify error types, negative read offsets, and custom context limits.
  • Python Version Support: Updated the minimum required Python version from 3.7 to 3.10 in setup.py.
  • Testing Infrastructure: Refactored Nox sessions to introduce a new conftest_retry_bidi session for bidirectional conformance tests, updated conftest_retry to use pytest directly, and added pytest-asyncio to system test dependencies.
  • Dependency Management: Introduced new grpc and testing extras in setup.py to manage related dependencies, and loosened the grpcio version constraint in testing/constraints-3.14.txt.
  • mTLS Configuration Simplification: Simplified the client-side mTLS configuration logic by removing the _use_client_cert_effective method and directly handling the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

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().

Suggested change
use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false")
use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false").lower()

Comment on lines +280 to +291
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"},
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The dependency google-cloud-testutils is listed twice in the testing extras (here and on line 63). Please remove this duplicate entry to keep the dependencies clean.

@parthea parthea closed this Mar 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: storage Issues related to the googleapis/python-storage API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants