Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for the system_flags attribute to AttributeType entities to enable identification of replicable vs non-replicable attributes for geo-distribution. The implementation follows the Active Directory systemFlags specification and includes a dedicated UseCase for managing system flags.
Changes:
- Added
system_flagsinteger field to AttributeType entities, DTOs, and schemas with a default value of 0 - Created migration to add the column and populate non-replicated attributes based on AD specification
- Implemented
AttributeTypeSystemFlagsUseCasewith methods to check and set replication flags - Added integration methods in
AttributeTypeUseCasethat delegate to the system flags use case
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| app/entities.py | Added system_flags field to AttributeType entity with default value 0 |
| app/ldap_protocol/ldap_schema/dto.py | Added system_flags field to AttributeTypeDTO |
| app/api/ldap_schema/schema.py | Added system_flags field to AttributeTypeSchema with default value 0 |
| app/repo/pg/tables.py | Added system_flags column to AttributeTypes table with server_default |
| app/ldap_protocol/ldap_schema/attribute_type_system_flags.py | New file implementing IntFlag enum and UseCase for system flags operations |
| app/ldap_protocol/ldap_schema/attribute_type_use_case.py | Added delegation methods for replication flag operations |
| app/api/ldap_schema/adapters/attribute_type.py | Updated converter to handle system_flags in update operations |
| app/ldap_protocol/utils/raw_definition_parser.py | Added system_flags=0 when creating AttributeType from raw definition |
| app/alembic/versions/2dadf40c026a_add_system_flags_to_attribute_types.py | New migration adding system_flags column and populating non-replicated attributes |
| app/alembic/versions/275222846605_initial_ldap_schema.py | Retroactively updated to include system_flags in initial schema and cleanup |
| app/ioc.py | Added provider for AttributeTypeSystemFlagsUseCase |
| tests/conftest.py | Refactored DAO providers to use shorthand syntax and added fixture for system flags use case |
| tests/test_api/test_ldap_schema/test_attribute_type_router.py | Added test verifying system_flags can be set and retrieved via API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 21 changed files in this pull request and generated 15 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Для задачи по геораспределению необходимо понимать, какие атрибуты реплицируемы, а какие нет.
Для каждого Типа атрибута добавлено свойство
system_flags(akasystemFlagsв AD см.доку):system_flagsу сущностейAttributeTypeдобавлен отдельный UseCase.Задача: 1160