-
Notifications
You must be signed in to change notification settings - Fork 42
feat(gapic): support mTLS certificates when available #658
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
Conversation
…prod/images-prod/python-librarian-generator@sha256:b8058df4c45e9a6e07f6b4d65b458d0d059241dd34c814f151c8bf6b89211209
Summary of ChangesHello @parthea, 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 primarily focuses on maintenance and compatibility improvements. It updates the core librarian generator image, removes obsolete code, and enhances the client libraries with better Python version and dependency checks. Additionally, it refactors the mTLS client certificate handling for improved clarity and robustness, along with corresponding test updates. 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this 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 is an automated update from the librarian tool. It updates the generator image and applies several changes across the codebase. Key changes include:
- Removal of legacy
fixupscripts. - Addition of Python version and dependency checks in the
__init__.pyfiles of the client libraries to warn users about outdated environments. - Refactoring of the mTLS client certificate handling logic into a shared helper method for better code reuse and maintainability.
- Corresponding updates to unit tests to cover the new logic and remove obsolete tests.
The changes are generally good and improve the library's robustness and maintainability. I've added a few minor suggestions to improve the readability of the new warning messages.
| "You are using a non-supported Python version " | ||
| + f"({_py_version_str}). Google will not post any further " | ||
| + f"updates to {_package_label} supporting this Python version. " | ||
| + "Please upgrade to the latest Python version, or at " | ||
| + f"least to Python 3.9, and then update {_package_label}.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning message is constructed using a mix of string concatenation with + and an f-string. This can be simplified into a single multi-line string using implicit concatenation for better readability.
("You are using a non-supported Python version "
f"({_py_version_str}). Google will not post any further "
f"updates to {_package_label} supporting this Python version. "
"Please upgrade to the latest Python version, or at "
f"least to Python 3.9, and then update {_package_label}.")| f"You are using a Python version ({_py_version_str}) " | ||
| + f"which Google will stop supporting in {_package_label} in " | ||
| + "January 2026. Please " | ||
| + "upgrade to the latest Python version, or at " | ||
| + "least to Python 3.10, before then, and " | ||
| + f"then update {_package_label}.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning message is constructed using a mix of string concatenation with + and an f-string. This can be simplified into a single multi-line string using implicit concatenation for better readability.
(f"You are using a Python version ({_py_version_str}) "
f"which Google will stop supporting in {_package_label} in "
"January 2026. Please "
"upgrade to the latest Python version, or at "
"least to Python 3.10, before then, and "
f"then update {_package_label}.")| f"Package {_package_label} depends on " | ||
| + f"{_dependency_package}, currently installed at version " | ||
| + f"{_version_used_string}. Future updates to " | ||
| + f"{_package_label} will require {_dependency_package} at " | ||
| + f"version {_next_supported_version} or higher{_recommendation}." | ||
| + " Please ensure " | ||
| + "that either (a) your Python environment doesn't pin the " | ||
| + f"version of {_dependency_package}, so that updates to " | ||
| + f"{_package_label} can require the higher version, or " | ||
| + "(b) you manually update your Python environment to use at " | ||
| + f"least version {_next_supported_version} of " | ||
| + f"{_dependency_package}.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning message is constructed using a mix of string concatenation with + and an f-string. This can be simplified into a single multi-line string using implicit concatenation for better readability.
(f"Package {_package_label} depends on "
f"{_dependency_package}, currently installed at version "
f"{_version_used_string}. Future updates to "
f"{_package_label} will require {_dependency_package} at "
f"version {_next_supported_version} or higher{_recommendation}."
" Please ensure "
"that either (a) your Python environment doesn't pin the "
f"version of {_dependency_package}, so that updates to "
f"{_package_label} can require the higher version, or "
"(b) you manually update your Python environment to use at "
f"least version {_next_supported_version} of "
f"{_dependency_package}.")| "You are using a non-supported Python version " | ||
| + f"({_py_version_str}). Google will not post any further " | ||
| + f"updates to {_package_label} supporting this Python version. " | ||
| + "Please upgrade to the latest Python version, or at " | ||
| + f"least to Python 3.9, and then update {_package_label}.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning message is constructed using a mix of string concatenation with + and an f-string. This can be simplified into a single multi-line string using implicit concatenation for better readability.
("You are using a non-supported Python version "
f"({_py_version_str}). Google will not post any further "
f"updates to {_package_label} supporting this Python version. "
"Please upgrade to the latest Python version, or at "
f"least to Python 3.9, and then update {_package_label}.")| f"You are using a Python version ({_py_version_str}) " | ||
| + f"which Google will stop supporting in {_package_label} in " | ||
| + "January 2026. Please " | ||
| + "upgrade to the latest Python version, or at " | ||
| + "least to Python 3.10, before then, and " | ||
| + f"then update {_package_label}.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning message is constructed using a mix of string concatenation with + and an f-string. This can be simplified into a single multi-line string using implicit concatenation for better readability.
(f"You are using a Python version ({_py_version_str}) "
f"which Google will stop supporting in {_package_label} in "
"January 2026. Please "
"upgrade to the latest Python version, or at "
"least to Python 3.10, before then, and "
f"then update {_package_label}.")| f"Package {_package_label} depends on " | ||
| + f"{_dependency_package}, currently installed at version " | ||
| + f"{_version_used_string}. Future updates to " | ||
| + f"{_package_label} will require {_dependency_package} at " | ||
| + f"version {_next_supported_version} or higher{_recommendation}." | ||
| + " Please ensure " | ||
| + "that either (a) your Python environment doesn't pin the " | ||
| + f"version of {_dependency_package}, so that updates to " | ||
| + f"{_package_label} can require the higher version, or " | ||
| + "(b) you manually update your Python environment to use at " | ||
| + f"least version {_next_supported_version} of " | ||
| + f"{_dependency_package}.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning message is constructed using a mix of string concatenation with + and an f-string. This can be simplified into a single multi-line string using implicit concatenation for better readability.
(f"Package {_package_label} depends on "
f"{_dependency_package}, currently installed at version "
f"{_version_used_string}. Future updates to "
f"{_package_label} will require {_dependency_package} at "
f"version {_next_supported_version} or higher{_recommendation}."
" Please ensure "
"that either (a) your Python environment doesn't pin the "
f"version of {_dependency_package}, so that updates to "
f"{_package_label} can require the higher version, or "
"(b) you manually update your Python environment to use at "
f"least version {_next_supported_version} of "
f"{_dependency_package}.")PR created by the Librarian CLI to initialize a release. Merging this PR will auto trigger a release. Librarian Version: v0.7.0 Language Image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:b8058df4c45e9a6e07f6b4d65b458d0d059241dd34c814f151c8bf6b89211209 <details><summary>google-cloud-datastore: 2.23.0</summary> ## [2.23.0](v2.22.0...v2.23.0) (2025-12-16) ### Features * support mTLS certificates when available (#658) ([85c0232](85c02328)) </details>
chore: librarian update image pull request: 20251216T200852Z