Skip to content

docs(core): document ClientOptions#adapter requirements and caveats - #28298

Merged
quartzmo merged 2 commits into
googleapis:mainfrom
quartzmo:docs-core-adapter-caveats
Oct 22, 2026
Merged

quartzmo merged 2 commits into
googleapis:mainfrom
quartzmo:docs-core-adapter-caveats

Conversation

@quartzmo

Copy link
Copy Markdown
Member

Follows up #27337 by documenting what a non-default adapter must support (streaming downloads, timeouts and proxy, retriable errors, thread safety), plus the fork and timing caveats. Also fixes the OVERVIEW wording, adds a spec for the default adapter and removes the unused use_net_http spec setting.

Refs: #27337

Follows up googleapis#27337 by documenting what a non-default adapter must support
(streaming downloads, timeouts and proxy, retriable errors, thread safety),
plus the fork and timing caveats. Also fixes the OVERVIEW wording, adds a
spec for the default adapter and removes the unused `use_net_http` spec
setting.

Refs googleapis#27337
@quartzmo
quartzmo requested a review from a team as a code owner October 22, 2026 16:04
gem "google-apis-core", "~> 0.18"

The `faraday` integration ships with, and only tests against the default adapter, which wraps [net-http](https://github.com/ruby/net-http). You can change the adapter by setting the `:adapter` client option:
google-apis-core uses Faraday's default adapter, which wraps [net-http](https://github.com/ruby/net-http), and is tested only against it. You can change the adapter by setting the `:adapter` client option:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So we were still communicating the adapter client_option but stopped offering it? ✅

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No, the option and this section are both new from #27337 (merged today), and they will release together in google-apis-core 1.4.0 (#28297). This PR only rewords the section and links it to the attribute docs.

Google::Apis::RequestOptions.default.retries = 5

# Allow testing different adapters
Google::Apis::ClientOptions.default.use_net_http = true if ENV['USE_NET_HTTP']

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not keep this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's dead code: ClientOptions#use_net_http was an httpclient-era switch (e8481dd, 2015) that stopped being read in 2046e00 (2016) and was removed from ClientOptions in 4682267 (2017). Setting it now raises NoMethodError, so USE_NET_HTTP=1 would break the spec run. I've removed the same line from the generator's spec helper too. Faraday's default adapter already is net-http.

Same dead line as in the core spec helper: ClientOptions#use_net_http was removed in 2017 (4682267), so setting it raises NoMethodError when USE_NET_HTTP is set.
@quartzmo quartzmo closed this Oct 22, 2026
@quartzmo quartzmo reopened this Oct 22, 2026
@quartzmo
quartzmo merged commit 96bd38f into googleapis:main Oct 22, 2026
27 checks passed
@quartzmo
quartzmo deleted the docs-core-adapter-caveats branch October 22, 2026 17:05
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