Skip to content

Commit 0899ad8

Browse files
refactor(redis): standardize cluster configuration parameters
- Replace deprecated skip_full_coverage_check with require_full_coverage - Remove CLUSTER_SKIP_FULL_COVERAGE_CHECK from RedisConfig - Update both sync and async Redis cluster adapters - Align with redis-py library best practices - Update Pydantic to 2.12.2 for improved validation
1 parent 058bc1c commit 0899ad8

5 files changed

Lines changed: 200 additions & 141 deletions

File tree

archipy/adapters/redis/adapters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ def _set_cluster_clients(self, configs: RedisConfig) -> None:
9999
startup_nodes=startup_nodes,
100100
password=configs.PASSWORD,
101101
decode_responses=configs.DECODE_RESPONSES,
102-
skip_full_coverage_check=configs.CLUSTER_SKIP_FULL_COVERAGE_CHECK,
103102
max_connections=configs.MAX_CONNECTIONS,
104103
retry_on_timeout=configs.RETRY_ON_TIMEOUT,
105104
socket_connect_timeout=configs.SOCKET_CONNECT_TIMEOUT,
106105
socket_timeout=configs.SOCKET_TIMEOUT,
107106
health_check_interval=configs.HEALTH_CHECK_INTERVAL,
108107
read_from_replicas=configs.CLUSTER_READ_FROM_REPLICAS,
108+
require_full_coverage=configs.CLUSTER_REQUIRE_FULL_COVERAGE,
109109
)
110110

111111
# In cluster mode, both clients point to the cluster
@@ -1171,13 +1171,13 @@ def _set_cluster_clients(self, configs: RedisConfig) -> None:
11711171
startup_nodes=startup_nodes,
11721172
password=configs.PASSWORD,
11731173
decode_responses=configs.DECODE_RESPONSES,
1174-
skip_full_coverage_check=configs.CLUSTER_SKIP_FULL_COVERAGE_CHECK,
11751174
max_connections=configs.MAX_CONNECTIONS,
11761175
retry_on_timeout=configs.RETRY_ON_TIMEOUT,
11771176
socket_connect_timeout=configs.SOCKET_CONNECT_TIMEOUT,
11781177
socket_timeout=configs.SOCKET_TIMEOUT,
11791178
health_check_interval=configs.HEALTH_CHECK_INTERVAL,
11801179
read_from_replicas=configs.CLUSTER_READ_FROM_REPLICAS,
1180+
require_full_coverage=configs.CLUSTER_REQUIRE_FULL_COVERAGE,
11811181
)
11821182

11831183
# In cluster mode, both clients point to the cluster

archipy/configs/config_template.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,6 @@ class RedisConfig(BaseModel):
572572
CLUSTER_NODES: list[str] = Field(default=[], description="List of cluster node addresses (host:port)")
573573
CLUSTER_REQUIRE_FULL_COVERAGE: bool = Field(default=True, description="Require full cluster coverage")
574574
CLUSTER_READ_FROM_REPLICAS: bool = Field(default=True, description="Allow reading from replica nodes")
575-
CLUSTER_SKIP_FULL_COVERAGE_CHECK: bool = Field(default=False, description="Skip full coverage check for testing")
576575

577576
# Sentinel mode settings
578577
SENTINEL_NODES: list[str] = Field(default=[], description="List of sentinel addresses (host:port)")

docs/changelog.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
All notable changes to ArchiPy are documented in this changelog, organized by version.
44

5+
## [3.13.8] - 2025-10-15
6+
7+
### Changed
8+
9+
#### Redis Configuration Refinements
10+
11+
- **Redis Cluster Parameter Standardization** - Aligned Redis cluster configuration with redis-py library standards
12+
- Replaced deprecated `skip_full_coverage_check` parameter with standard `require_full_coverage` parameter
13+
- Updated both synchronous and asynchronous Redis cluster adapters for compatibility with latest redis-py
14+
- Removed redundant `CLUSTER_SKIP_FULL_COVERAGE_CHECK` configuration field
15+
- Enhanced Redis cluster reliability with proper full coverage validation
16+
- Improved code maintainability by following redis-py best practices
17+
18+
#### Dependency Updates
19+
20+
- **Pydantic Version Update** - Updated Pydantic to version 2.12.2 for enhanced data validation
21+
- Improved validation performance and bug fixes
22+
523
## [3.13.7] - 2025-10-13
624

725
### Changed
@@ -15,7 +33,8 @@ All notable changes to ArchiPy are documented in this changelog, organized by ve
1533
#### Configuration Improvements
1634

1735
- **Redis Mode Constants** - Standardized Redis mode constants to uppercase format for better consistency
18-
- Updated RedisMode enum values from lowercase to uppercase (`standalone``STANDALONE`, `sentinel``SENTINEL`, `cluster``CLUSTER`)
36+
- Updated RedisMode enum values from lowercase to uppercase (`standalone``STANDALONE`, `sentinel``SENTINEL`,
37+
`cluster``CLUSTER`)
1938
- Enhanced configuration consistency across Redis deployment modes
2039
- Improved code readability and standardization
2140

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ readme = "README.md"
99
version = "0.1.0" # This vesrion set on publish flow!
1010
requires-python = ">=3.13,<4"
1111
dependencies = [
12-
"pydantic>=2.12.0",
12+
"pydantic>=2.12.2",
1313
"pydantic-settings>=2.11.0",
1414
"requests>=2.32.5",
1515
"jdatetime>=5.2.0",

0 commit comments

Comments
 (0)