Skip to content

chore: regenerate libraries with gapic-generator @ eb8a7662 - #18855

Closed
parthea wants to merge 8 commits into
mainfrom
generator-update-2026-10-26
Closed

parthea wants to merge 8 commits into
mainfrom
generator-update-2026-10-26

Conversation

@parthea

@parthea parthea commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Commits 0f79eac and 65710a7 contain manual changes to the post-processing files.

Commits 6470ec4, 7f47443 and 8296956 are the result after running client library generation using gapic-generator at commit eb8a766.

The following commands were used to re-generate the libraries

pip install <path to gapic-generator @ commit faa0f81>
V=$(go run github.com/googleapis/librarian/cmd/librarian@latest config get version)
go run github.com/googleapis/librarian/cmd/librarian@${V} install
go run github.com/googleapis/librarian/cmd/librarian@${V} generate -v --all

53681f8 is needed to resolve the failure in https://github.com/googleapis/google-cloud-python/actions/runs/40380490833/job/121775466746

d8d9616 is needed to resolve the failure in https://github.com/googleapis/google-cloud-python/actions/runs/40386982731/job/121799063007

Towards b/577038296

@parthea
parthea requested review from a team as code owners October 26, 2026 18:44
@parthea
parthea requested review from julianxu-goog and removed request for a team October 26, 2026 18:44

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

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.

Code Review

This pull request updates the generated client libraries for Google Ads AdManager and other services to support OpenTelemetry tracing and client options propagation across all transports. It introduces fallback mechanisms in _compat.py to maintain backward compatibility with older google-api-core versions. The review feedback suggests simplifying the REST transport implementations by replacing defensive getattr(self, '_client_options', None) checks with direct attribute access, since _client_options is guaranteed to be initialized.

…abase

Prevent is_otel_capabilities_enabled() from reading a truthy MagicMock for client_options.tracer_provider and raising FeatureGatingError when SpannerClient is instantiated in test_spanner_api_experimental_host
…ead_client_v1

- Bind  to the autospecced  fixture before calling  so RPC methods (, , etc.) are wrapped with real  retry callables rather than returning a child .
- Set  on  to prevent  from reading a truthy  for  and raising .

This change is necessary following #18433
@parthea parthea added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Oct 26, 2026
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Oct 26, 2026
database._instance._client._ca_certificate = None
database._instance._client._client_certificate = None
database._instance._client._client_key = None
database._instance._client._client_options = None

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.

@parthea For the Spanner test fix, can we initialize self._client_options as a real ClientOptions object inside _Client.__init__ instead of setting _client_options = None in test_spanner_api_experimental_host?

Why ClientOptions seems like a better idea here:

  1. No truthy/mock surprises: With an unspec'ed Mock, reading any unset attribute (like tracer_provider or future ClientOptions fields) returns a truthy child Mock instead of None. A real ClientOptions object naturally defaults unset fields to None.
  2. Avoids shared-state mutation: _Instance.__init__ uses a shared default client=_Client() across tests, so setting database._instance._client._client_options = None in one test mutates _client_options for subsequent tests.
  3. Less boilerplate: It replaces 9 lines of manual None assignments and matches self._client_info = gapic_v1.client_info.ClientInfo() right above it.

Files and Lines to Update

1. packages/google-cloud-spanner/tests/unit/_async/test_database.py

  • Line 2643 (test_spanner_api_experimental_host): Remove database._instance._client._client_options = None.
  • Lines 4292–4309 (_Client.__init__): Replace the CrossSync.Mock() setup with ClientOptions:
        from google.api_core.client_options import ClientOptions
        from google.cloud.spanner_v1 import ExecuteSqlRequest

        self.project = project
        self.project_name = "projects/" + self.project
        self._endpoint_cache = {}
        self.database_admin_api = _make_database_admin_api()
        self.instance_admin_api = _make_instance_api()
        self._client_info = gapic_v1.client_info.ClientInfo()
        self._client_options = ClientOptions(
            api_endpoint="spanner.googleapis.com",
            universe_domain="googleapis.com",
        )
        self._experimental_host = None

2. packages/google-cloud-spanner/tests/unit/test_database.py

  • Lines 3713–3730 (_Client.__init__): Apply the same change to the sync helper:
        from google.api_core.client_options import ClientOptions
        from google.cloud.spanner_v1 import ExecuteSqlRequest

        self.project = project
        self.project_name = "projects/" + self.project
        self._endpoint_cache = {}
        self.database_admin_api = _make_database_admin_api()
        self.instance_admin_api = _make_instance_api()
        self._client_info = gapic_v1.client_info.ClientInfo()
        self._client_options = ClientOptions(
            api_endpoint="spanner.googleapis.com",
            universe_domain="googleapis.com",
        )
        self._experimental_host = None

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 0f4029b in PR #18955

@parthea

parthea commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #18955

@parthea parthea closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants