Skip to content

Conversation

@petruki
Copy link
Member

@petruki petruki commented Oct 5, 2025

This pull request refactors how snapshot data is structured and accessed throughout the codebase. The main change is the removal of the top-level data key from snapshot JSON files and related code, so that domain is now the top-level key. This impacts snapshot loading, serialization, deserialization, and test fixtures. The update simplifies data access and unifies the data structure across the application and tests.

Snapshot Data Structure Refactor

  • Changed snapshot JSON format to use domain as the top-level key instead of nesting under data, and updated all code and tests to match this new structure (switcher_client/lib/types.py, switcher_client/lib/snapshot_loader.py, test snapshots, and related test utilities). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

  • Updated Snapshot class to remove the SnapshotData wrapper and directly store the domain object, simplifying attribute access throughout the codebase (switcher_client/lib/types.py). [1] [2]

  • Refactored all snapshot access patterns to use the new structure, including in snapshot_version, check_criteria, and validate_snapshot functions (switcher_client/client.py, switcher_client/lib/resolver.py, switcher_client/lib/snapshot_loader.py). [1] [2] [3]

Remote and Serialization Updates

  • Updated remote snapshot resolution and serialization/deserialization logic to expect and produce the new structure, ensuring compatibility with the new top-level domain key (switcher_client/lib/remote.py, switcher_client/lib/types.py). [1] [2]

These changes collectively unify and simplify how snapshot data is handled across the codebase.

@petruki petruki self-assigned this Oct 5, 2025
@petruki petruki added the enhancement New feature or request label Oct 5, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 5, 2025

@petruki petruki merged commit a820e5e into master Oct 5, 2025
13 checks passed
@petruki petruki deleted the staging branch October 5, 2025 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants