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 improvements to the snapshot loading and validation logic in the
switcher_clientlibrary, particularly enhancing support for remote snapshot validation and updates. The changes include new methods for checking and resolving snapshot versions remotely, refactoring of theSnapshotclass for more robust JSON parsing, and new tests to ensure correct remote snapshot behavior. Dependency and workflow updates are also included.Snapshot loading and validation enhancements:
LoadSnapshotOptionsclass and updatedClient.load_snapshotto support remote snapshot validation and updating, including a newcheck_snapshotmethod to verify and update the snapshot if needed. (switcher_client/client.py,switcher_client/lib/globals/global_snapshot.py) [1] [2] [3]Remotefor checking snapshot version and resolving snapshots via GraphQL, with appropriate error handling. (switcher_client/lib/remote.py) [1] [2]validate_snapshotandload_domainto use the new remote methods and improved the snapshot loading logic. (switcher_client/lib/snapshot_loader.py) [1] [2]Refactoring and code structure:
Snapshotclass to encapsulate JSON parsing logic, moving parsing methods into the class for better maintainability. (switcher_client/lib/types.py) [1] [2]switcher_client/errors/__init__.py)Testing improvements:
tests/test_client_load_snapshot_remote.py,tests/snapshots/default_load_1.json) [1] [2]Dependency and workflow updates:
requestsandresponsesdependencies to latest patch versions. (Pipfile).github/workflows/master.yml,.github/workflows/sonar.yml) [1] [2]