Open
Conversation
Contributor
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Для задачи по геораспределению необходимо понимать, какие атрибуты реплицируемы, а какие нет.
Для каждого Типа атрибута добавлено свойство
system_flags(akasystemFlagsв AD см.доку):system_flagsу сущностейAttributeTypeдобавлен отдельный UseCase.Открытые вопросы:
AttributeTypeSystemFlagsUseCaseвAttributeTypeUseCase?p.s. На данный момент эта бизнес логика нигде не используется. Кажется, что это избыточная модификация.
..UseCaseдляAttributeTypeSystemFlagsUseCaseэто подходящий выбор?p.s. Мне не нравится использование одного UseCase внутри другого UseCase. Как я думаю, в теории было бы правильно делать отдельный UseCase в котором была бы работа только с
AttributeTypeи сAttributeType.system_flags.Задача: 1160