|
2 | 2 |
|
3 | 3 | All notable changes to ArchiPy are documented in this changelog, organized by version. |
4 | 4 |
|
| 5 | +## [3.6.0] - 2025-07-29 |
| 6 | + |
| 7 | +### New Features |
| 8 | + |
| 9 | +#### gRPC Exception Interceptor System |
| 10 | + |
| 11 | +- **Centralized Exception Handling** - Implemented comprehensive gRPC server exception interceptors for both synchronous |
| 12 | + and asynchronous operations |
| 13 | + - Added `GrpcServerExceptionInterceptor` for synchronous gRPC services with automatic exception conversion |
| 14 | + - Added `AsyncGrpcServerExceptionInterceptor` for asynchronous gRPC services with async exception handling |
| 15 | + - Eliminated the need for repetitive try-catch blocks in individual gRPC service methods |
| 16 | + - Automatic conversion of exceptions to appropriate gRPC error responses with proper status codes |
| 17 | + |
| 18 | +#### Enhanced Error Handling |
| 19 | + |
| 20 | +- **Pydantic Validation Error Handling** - Integrated automatic Pydantic validation error processing in gRPC |
| 21 | + interceptors |
| 22 | + - Automatic conversion of ValidationError to InvalidArgumentError with detailed error information |
| 23 | + - Structured validation error formatting with field-level error details |
| 24 | + - Enhanced debugging capabilities with comprehensive validation error reporting |
| 25 | + |
| 26 | +#### Language Configuration System |
| 27 | + |
| 28 | +- **Global Language Configuration** - Added LANGUAGE configuration to BaseConfig for consistent language handling |
| 29 | + - Introduced LANGUAGE attribute in BaseConfig with default Persian (FA) language support |
| 30 | + - Standardized language type constants to uppercase for ISO compliance |
| 31 | + - Improved language handling across error messages and user interfaces |
| 32 | + |
| 33 | +### Improvements |
| 34 | + |
| 35 | +#### gRPC Status Code Management |
| 36 | + |
| 37 | +- **Enhanced Status Code Handling** - Improved gRPC status code conversion and management in BaseError |
| 38 | + - Added static method for converting integer status codes to gRPC StatusCode enums |
| 39 | + - Enhanced metadata handling in gRPC abort methods with conditional additional data inclusion |
| 40 | + - Refined type hints for context parameters in abort methods for better clarity |
| 41 | + - Improved error context preservation and debugging capabilities |
| 42 | + |
| 43 | +#### Error System Refactoring |
| 44 | + |
| 45 | +- **Optional Language Parameters** - Refactored error handling classes to use optional language parameters |
| 46 | + - Removed mandatory language parameter requirements for improved flexibility |
| 47 | + - Enhanced error initialization with automatic language detection from global configuration |
| 48 | + - Improved error message consistency and localization support |
| 49 | + - Maintained backward compatibility while improving developer experience |
| 50 | + |
| 51 | +### Bug Fixes |
| 52 | + |
| 53 | +#### Error Initialization |
| 54 | + |
| 55 | +- **Language Configuration Fix** - Fixed language initialization in BaseError to use global configuration |
| 56 | + - Ensured language is set correctly from global configuration when not provided during initialization |
| 57 | + - Improved error message consistency across different initialization scenarios |
| 58 | + - Enhanced code readability and maintainability |
| 59 | + |
| 60 | +#### Type Safety Improvements |
| 61 | + |
| 62 | +- **Enhanced Type Hints** - Improved type hints for gRPC status codes and error handling |
| 63 | + - Refined type annotations for better IDE support and code reliability |
| 64 | + - Enhanced type safety across error handling components |
| 65 | + - Improved developer experience with better autocomplete and error detection |
| 66 | + |
| 67 | +### Code Quality |
| 68 | + |
| 69 | +- **Comprehensive Error Coverage** - Updated all error classes to support the new language and gRPC handling system |
| 70 | + - Enhanced auth_errors, business_errors, database_errors, network_errors, resource_errors, system_errors, and |
| 71 | + validation_errors |
| 72 | + - Improved error categorization and handling consistency |
| 73 | + - Enhanced error reporting and debugging capabilities across all error types |
| 74 | + |
5 | 75 | ## [3.5.2] - 2025-07-28 |
6 | 76 |
|
7 | 77 | ### Bug Fixes |
8 | 78 |
|
9 | 79 | #### Elasticsearch Authentication |
10 | 80 |
|
11 | | -- **Password Secret Value Extraction** - Fixed critical authentication issue in Elasticsearch adapters where password secret values were not being properly extracted |
12 | | - - Updated both synchronous and asynchronous Elasticsearch adapters to use `get_secret_value()` method for HTTP_PASSWORD |
13 | | - - Resolved authentication failures when using SecretStr password configuration |
14 | | - - Improved security by properly handling encrypted password fields in Elasticsearch configuration |
| 81 | +- **Password Secret Value Extraction** - Fixed critical authentication issue in Elasticsearch adapters where password |
| 82 | + secret values were not being properly extracted |
| 83 | + - Updated both synchronous and asynchronous Elasticsearch adapters to use `get_secret_value()` method for |
| 84 | + HTTP_PASSWORD |
| 85 | + - Resolved authentication failures when using SecretStr password configuration |
| 86 | + - Improved security by properly handling encrypted password fields in Elasticsearch configuration |
15 | 87 |
|
16 | 88 | ### Dependencies |
17 | 89 |
|
18 | 90 | - **Poetry Lock Update** - Updated poetry.lock file to Poetry 2.1.2 for improved dependency management |
19 | | - - Enhanced dependency resolution with latest Poetry version |
20 | | - - Updated platform-specific package markers for better cross-platform compatibility |
21 | | - - Improved package hash verification and security |
| 91 | + - Enhanced dependency resolution with latest Poetry version |
| 92 | + - Updated platform-specific package markers for better cross-platform compatibility |
| 93 | + - Improved package hash verification and security |
22 | 94 |
|
23 | 95 | ### Code Quality |
24 | 96 |
|
25 | 97 | - **Authentication Consistency** - Standardized password handling across Elasticsearch adapters |
26 | | - - Ensured consistent secret value extraction in both sync and async adapters |
27 | | - - Maintained backward compatibility while improving security practices |
28 | | - - Enhanced error handling for authentication configuration |
| 98 | + - Ensured consistent secret value extraction in both sync and async adapters |
| 99 | + - Maintained backward compatibility while improving security practices |
| 100 | + - Enhanced error handling for authentication configuration |
29 | 101 |
|
30 | 102 | ## [3.5.1] - 2025-07-28 |
31 | 103 |
|
32 | 104 | ### Bug Fixes |
33 | 105 |
|
34 | 106 | #### HTTP Status Code Handling |
35 | 107 |
|
36 | | -- **Status Code Name Mismatch** - Fixed critical issue in FastAPIExceptionHandler where `http_status_code` was incorrectly referenced |
37 | | - - Changed from `exception.http_status_code` to `exception.http_status_code_value` for proper status code retrieval |
38 | | - - Resolved HTTP status code name mismatch that was causing incorrect error responses |
39 | | - - Improved error handling consistency in FastAPI exception processing |
| 108 | +- **Status Code Name Mismatch** - Fixed critical issue in FastAPIExceptionHandler where `http_status_code` was |
| 109 | + incorrectly referenced |
| 110 | + - Changed from `exception.http_status_code` to `exception.http_status_code_value` for proper status code retrieval |
| 111 | + - Resolved HTTP status code name mismatch that was causing incorrect error responses |
| 112 | + - Improved error handling consistency in FastAPI exception processing |
40 | 113 |
|
41 | 114 | ### Improvements |
42 | 115 |
|
43 | 116 | #### Protobuf DTO Runtime Type Safety |
44 | 117 |
|
45 | 118 | - **Runtime Type Checking** - Enhanced BaseProtobufDTO with comprehensive runtime type validation |
46 | | - - Added runtime type checking in `from_proto()` method to validate input parameter types |
47 | | - - Implemented proper type validation before protobuf message processing |
48 | | - - Enhanced error messages with clear type mismatch information |
| 119 | + - Added runtime type checking in `from_proto()` method to validate input parameter types |
| 120 | + - Implemented proper type validation before protobuf message processing |
| 121 | + - Enhanced error messages with clear type mismatch information |
49 | 122 |
|
50 | 123 | #### Custom Exception Integration |
51 | 124 |
|
52 | 125 | - **Custom Exception Handling** - Replaced generic TypeError with domain-specific InvalidEntityTypeError |
53 | | - - Updated protobuf DTO type validation to use `InvalidEntityTypeError` for better error categorization |
54 | | - - Improved error context with expected and actual type information |
55 | | - - Enhanced error handling consistency across the protobuf DTO system |
| 126 | + - Updated protobuf DTO type validation to use `InvalidEntityTypeError` for better error categorization |
| 127 | + - Improved error context with expected and actual type information |
| 128 | + - Enhanced error handling consistency across the protobuf DTO system |
56 | 129 |
|
57 | 130 | ### Code Quality Enhancements |
58 | 131 |
|
59 | 132 | - **Error Handling Consistency** - Standardized error handling patterns across protobuf DTO operations |
60 | | - - Improved error message clarity and debugging capabilities |
61 | | - - Enhanced type safety with proper exception chaining |
62 | | - - Maintained backward compatibility while improving error reporting |
| 133 | + - Improved error message clarity and debugging capabilities |
| 134 | + - Enhanced type safety with proper exception chaining |
| 135 | + - Maintained backward compatibility while improving error reporting |
63 | 136 |
|
64 | 137 | ## [3.5.0] - 2025-07-26 |
65 | 138 |
|
66 | 139 | ### New Features |
67 | 140 |
|
68 | 141 | #### Protobuf DTO Support |
69 | 142 |
|
70 | | -- **BaseProtobufDTO** - Added new base class for Data Transfer Objects that can be converted to and from Protobuf messages |
71 | | - - Provides seamless integration between Pydantic DTOs and Google Protocol Buffers |
72 | | - - Supports bidirectional conversion with `from_proto()` and `to_proto()` methods |
73 | | - - Includes runtime dependency checking for protobuf availability |
74 | | - - Maintains type safety with proper error handling for missing protobuf dependencies |
| 143 | +- **BaseProtobufDTO** - Added new base class for Data Transfer Objects that can be converted to and from Protobuf |
| 144 | + messages |
| 145 | + - Provides seamless integration between Pydantic DTOs and Google Protocol Buffers |
| 146 | + - Supports bidirectional conversion with `from_proto()` and `to_proto()` methods |
| 147 | + - Includes runtime dependency checking for protobuf availability |
| 148 | + - Maintains type safety with proper error handling for missing protobuf dependencies |
75 | 149 |
|
76 | 150 | ### Bug Fixes |
77 | 151 |
|
78 | 152 | #### Type Safety Improvements |
79 | 153 |
|
80 | | -- **ClassVar Type Variable Issue** - Fixed critical type annotation issue in BaseProtobufDTO where ClassVar contained type variables |
81 | | - - Resolved `ClassVar` parameter cannot include type variables error |
82 | | - - Updated type annotations to use concrete `Message` type instead of type variables |
83 | | - - Improved type safety by using proper concrete types for class variables |
84 | | - - Added comprehensive type annotations for all methods and parameters |
| 154 | +- **ClassVar Type Variable Issue** - Fixed critical type annotation issue in BaseProtobufDTO where ClassVar contained |
| 155 | + type variables |
| 156 | + - Resolved `ClassVar` parameter cannot include type variables error |
| 157 | + - Updated type annotations to use concrete `Message` type instead of type variables |
| 158 | + - Improved type safety by using proper concrete types for class variables |
| 159 | + - Added comprehensive type annotations for all methods and parameters |
85 | 160 |
|
86 | 161 | #### Code Quality Enhancements |
87 | 162 |
|
88 | 163 | - **Import Cleanup** - Removed invalid Unicode characters and simplified import structure |
89 | | - - Fixed invisible Unicode character `\uab` that was causing linter errors |
90 | | - - Streamlined protobuf import logic by removing unnecessary type variables |
91 | | - - Enhanced code readability and maintainability |
92 | | - - Added proper docstring formatting with Google-style documentation |
| 164 | + - Fixed invisible Unicode character `\uab` that was causing linter errors |
| 165 | + - Streamlined protobuf import logic by removing unnecessary type variables |
| 166 | + - Enhanced code readability and maintainability |
| 167 | + - Added proper docstring formatting with Google-style documentation |
93 | 168 |
|
94 | 169 | #### Linting Configuration |
95 | 170 |
|
96 | 171 | - **Ruff Configuration** - Updated linting rules to accommodate protobuf DTO patterns |
97 | | - - Added `ANN401` exception for `base_protobuf_dto.py` to allow `Any` types in `*args` and `**kwargs` |
98 | | - - Maintained strict type checking while allowing necessary flexibility for DTO inheritance patterns |
99 | | - - Ensured all pre-commit hooks pass without compromising code quality standards |
| 172 | + - Added `ANN401` exception for `base_protobuf_dto.py` to allow `Any` types in `*args` and `**kwargs` |
| 173 | + - Maintained strict type checking while allowing necessary flexibility for DTO inheritance patterns |
| 174 | + - Ensured all pre-commit hooks pass without compromising code quality standards |
100 | 175 |
|
101 | 176 | ## [3.4.5] - 2025-07-24 |
102 | 177 |
|
103 | 178 | ### Improvements |
104 | 179 |
|
105 | 180 | #### Configuration Template Enhancements |
106 | 181 |
|
107 | | -- **Improved Readability** - Enhanced ElasticsearchAPMConfig size fields to use human-readable string values instead of raw bytes |
108 | | - - Changed `API_REQUEST_SIZE` from `768 * 1024` to `"768kb"` for better configuration clarity |
109 | | - - Changed `LOG_FILE_SIZE` from `50 * 1024 * 1024` to `"50mb"` for improved readability |
110 | | -- **Configuration Clarity** - Updated size-related configuration fields to use standard size notation (kb, mb) making configuration files more intuitive and easier to understand |
| 182 | +- **Improved Readability** - Enhanced ElasticsearchAPMConfig size fields to use human-readable string values instead of |
| 183 | + raw bytes |
| 184 | + - Changed `API_REQUEST_SIZE` from `768 * 1024` to `"768kb"` for better configuration clarity |
| 185 | + - Changed `LOG_FILE_SIZE` from `50 * 1024 * 1024` to `"50mb"` for improved readability |
| 186 | +- **Configuration Clarity** - Updated size-related configuration fields to use standard size notation (kb, mb) making |
| 187 | + configuration files more intuitive and easier to understand |
111 | 188 |
|
112 | 189 | ### Bug Fixes |
113 | 190 |
|
|
0 commit comments