@@ -21,8 +21,14 @@ classDiagram
2121 }
2222
2323 class PathData {
24+ +str path
2425 +Dict metadata
2526 +Dict~str,Value~ values
27+ +validate() None
28+ +add_value(environment: str, value: Value) None
29+ +get_value(environment: str) Optional[Value]
30+ +to_dict() Dict
31+ +from_dict(data: Dict, create_value_fn) PathData
2632 }
2733
2834 class Value {
@@ -85,6 +91,11 @@ classDiagram
8591 +validate_auth_config(auth_config: dict) None
8692 }
8793
94+ class HelmLogger {
95+ +debug(msg: str, *args: Any) None
96+ +error(msg: str, *args: Any) None
97+ }
98+
8899 HelmValuesConfig "1" *-- "*" ConfigValue
89100 HelmValuesConfig "1" *-- "*" Deployment
90101 HelmValuesConfig "1" *-- "*" PathData
@@ -99,32 +110,32 @@ classDiagram
99110
100111### 2. Value Management
101112
102- The system uses a unified approach to value storage and resolution through the ` Value ` class :
113+ The system manages configuration values through a hierarchy of classes :
103114
104- ``` python
105- class Value :
106- def __init__ (self , path : str , environment : str ,
107- backend : ValueBackend):
108- self .path = path
109- self .environment = environment
110- self ._backend = backend
111-
112- def get (self ) -> str :
113- """ Get the resolved value"""
114- return self ._backend.get_value(self .path, self .environment)
115-
116- def set (self , value : str ) -> None :
117- """ Set the value"""
118- if not isinstance (value, str ):
119- raise ValueError (" Value must be a string" )
120- self ._backend.set_value(self .path, self .environment, value)
121- ```
115+ 1 . ** HelmValuesConfig**
116+ - Top-level configuration manager
117+ - Maintains mapping of paths to PathData instances
118+ - Handles backend selection based on value sensitivity
119+ - Manages deployments and their configurations
120+
121+ 2 . ** PathData**
122+ - Represents a single configuration path and its properties
123+ - Owns the configuration path and ensures consistency
124+ - Stores metadata (description, required status, sensitivity)
125+ - Manages environment-specific values through Value instances
126+ - Validates path consistency between itself and its Values
127+ - Delegates actual value storage to Value instances
122128
123- Key features:
124- - Encapsulated value resolution logic
125- - Unified interface for all storage backends
129+ 3 . ** Value**
130+ - Handles actual value storage and retrieval
131+ - Uses appropriate backend for storage operations
132+ - Maintains reference to its path and environment
133+
134+ This hierarchy ensures:
126135- Clear separation of concerns
127- - Type-safe value handling
136+ - Consistent path handling across the system
137+ - Proper validation at each level
138+ - Flexible backend selection based on value sensitivity
128139
129140### 3. Command Pattern
130141
@@ -249,6 +260,31 @@ The configuration follows the v1 schema:
249260 - Backup before writes
250261 - Atomic updates
251262
263+ ## Logging System
264+
265+ The logging system follows Helm plugin conventions and provides consistent output formatting:
266+
267+ 1 . ** HelmLogger Class**
268+ - Provides debug and error logging methods
269+ - Follows Helm output conventions
270+ - Uses stderr for all output
271+ - Controls debug output via HELM_DEBUG environment variable
272+
273+ 2 . ** Global Logger Instance**
274+ - Available via ` from helm_values_manager.utils.logger import logger `
275+ - Ensures consistent logging across all components
276+ - Simplifies testing with mock support
277+
278+ 3 . ** Performance Features**
279+ - Uses string formatting for efficiency
280+ - Lazy evaluation of debug messages
281+ - Minimal memory overhead
282+
283+ 4 . ** Testing Support**
284+ - Mockable stderr output
285+ - Environment variable control
286+ - String format verification
287+
252288## Benefits of This Design
253289
2542901 . ** Separation of Concerns**
0 commit comments