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 significant enhancements to the mocking and bypassing capabilities of the Switcher SDK, allowing for more flexible and testable feature flag behaviors. The main changes include the implementation of conditional mocking based on input criteria, support for attaching metadata to mocked results, and comprehensive tests to ensure the new features work as expected.
Mocking & Bypasser Enhancements
when,with_metadata,true,false) to theKeyclass inswitcher_client/lib/bypasser/key.py, enabling feature flags to be forced on/off based on specific strategies and input values, with optional metadata attached to responses.Switcher.is_on_with_detailsmethod to check for bypassed keys and return the mocked result with details, integrating the new bypassing logic into the main evaluation flow.Public API & Documentation
StrategiesTypeinswitcher_client/__init__.pyto make strategy types available for mocking criteria in user code.Testing
tests/test_switcher_stub.pyto verify basic and advanced mocking scenarios, including conditional criteria, metadata, and multiple strategy values.StrategiesTypein test files to support new mocking criteria in tests.These changes greatly improve the SDK's testability and flexibility for feature flag evaluation in development and CI environments.