Skip to content

feat(cloud): Wrapper clients provide better introspection to determine availability of client objects#1146

Merged
dazuma merged 1 commit intogoogleapis:mainfrom
dazuma:pr/wrapper-services
Jan 24, 2025
Merged

feat(cloud): Wrapper clients provide better introspection to determine availability of client objects#1146
dazuma merged 1 commit intogoogleapis:mainfrom
dazuma:pr/wrapper-services

Conversation

@dazuma
Copy link
Contributor

@dazuma dazuma commented Jan 23, 2025

Currently the client object factory methods in wrapper clients just expect that the underlying GAPIC provides the correct classes, and will raise LoadErrors or NameErrors if used with an out-of-date GAPIC. In particular, the unit tests for wrappers will fail if the GAPIC is out of date. This causes problems when a new service is added to an API, and gets added to the GAPIC and wrapper simultaneously. The wrapper tests fail until the GAPIC is updated and released, and we also typically go through the extra step of updating the version requirement in the dependency. This is a recurring source of toil.

This PR improves the situation by:

  • Providing additional documentation calling out that an out-of-date GAPIC could cause the wrapper's factory method to fail, and noting what should be done.
  • Providing new methods in the wrapper to test whether a service is available in the given API version and transport type.
  • Updating the wrapper unit tests to skip tests when a service is unavailable.

This PR also updates the wrapper README with a clarification that debug logging also requires a recent GAPIC.

@dazuma dazuma requested review from a team and aandreassa January 23, 2025 21:35
[Google Cloud Logging](https://cloud.google.com/logging/) service.

Debug logging also requires that the versioned clients for this service be
sufficently recent, released after about Dec 10, 2024. If logging is not
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo in sufficiently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoa, thanks for catching that!

@dazuma dazuma force-pushed the pr/wrapper-services branch from 2dc7521 to b89b1de Compare January 24, 2025 19:54
@dazuma dazuma merged commit 337bc26 into googleapis:main Jan 24, 2025
3 checks passed
@dazuma dazuma deleted the pr/wrapper-services branch January 24, 2025 22:04
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.

2 participants