Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This pull request introduces a new
RemoteOptionsconfiguration object to centralize and enhance remote transport settings, including SSL certificate path and various timeout controls. The changes improve the flexibility and reliability of remote API calls, especially in scenarios involving silent mode and failover to local evaluation. The update also refactors the client initialization and remote logic to consistently utilize these new options, and expands test helpers for better error simulation.The most important changes are:
Remote transport configuration and usage:
RemoteOptionsdataclass to encapsulate remote transport settings such ascert_path,connect_timeout,read_timeout,write_timeout, andpool_timeout. These options are now part ofContextOptionsunder theremotefield, replacing the previous directcert_pathusage.Remote._get_client) to use the new timeout values fromRemoteOptionsand to reinitialize the client if any transport settings change.RemoteOptionsinstead of the now-removedcert_pathfield inContextOptions.Client and context initialization:
Client.build_contextand related context creation logic to accept and propagate the newRemoteOptionsthroughContextOptions, ensuring all components use the unified configuration.Remote request handling improvements:
_do_post,_do_get) to a unified interface that handles request errors more robustly, raising operation-specific exceptions and supporting fail-fast behavior for silent mode. ([switcher_client/lib/remote.pyR169-R191](https://github.com/switcherapi/switcher-client-py/pull/57/files#diff-4ecc9a37ec39f8228d468725cd0c48b183121ffc4c8e8e7aeaa3febd91eeb5c6R169-R191))Documentation and test improvements:
README.mdto document the newremoteconfiguration, including descriptions and default values for allRemoteOptionsfields, and clarified error handling behavior.These changes make remote communication more configurable, reliable, and easier to maintain.