-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: rename services to System #883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
38592fb to
88cc71a
Compare
milov-dmitriy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
главное проверь это локально любым из способов, главное чтобы переименование сработало корректно и даунгрейд тоже сработал корректно
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
и еще надо будет подлить к тебе мою задачу 796, т.к. я в ней добавляю понятие системная директория или нет, если системная - значит ее нельзя менять
upd. но это уже после того как ее апрувнут, но я бы предлагал сначала мою апрувать потом твою
UPD. Всё ок
| await session.flush() | ||
| await _update_descendants(session, services_dir.id) | ||
|
|
||
| await _update_attributes(session, "ou=services", "ou=System") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
предлагаю строго привязывать к id той директории которую мы обновили, т.е. передавать в _update_attributes еще и directory_id, чтобы не сделать "лишних" изменений у тех директорий, которые в отбор не попали, но атрибуты которых попали под фильтр атрибутов. думаю, это повысит надежность миграции
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
там вроде все надежно, везде где встретим надо менять
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я бы лучше сделал через явное указание id тех директорий, атрибуты которых надо поменять
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
обсудили
|
upd. надо будет еще свежий dev подлить UPD. Всё ок |
98768c3 to
60ae9bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR renames the LDAP container from ou=services to ou=System for Active Directory compatibility. The change updates configuration files, database migrations, tests, and introduces a volume-based approach for updating Kerberos configurations instead of using the API.
Changes:
- Renamed
ou=servicestoou=Systemacross codebase and tests - Added database migration to rename existing services containers and update all dependent paths/attributes
- Refactored Kerberos config updates to use direct file writes via shared volume instead of API calls
- Updated test assertions to reflect new naming convention
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_shedule.py | Removed kadmin parameter from test function |
| tests/test_api/test_main/test_kadmin.py | Updated test assertions to use System instead of services |
| interface | Updated subproject commit reference |
| docker-compose.yml | Added kdc volume mount for scheduler service |
| app/ldap_protocol/roles/role_use_case.py | Updated to use get_system_container_dn helper function |
| app/ldap_protocol/kerberos/utils.py | Added get_system_container_dn utility function |
| app/ldap_protocol/kerberos/service.py | Refactored to use get_system_container_dn helper |
| app/extra/scripts/update_krb5_config.py | Completely refactored to write configs directly to files with legacy DN migration |
| app/alembic/versions/a1b2c3d4e5f6_rename_services_to_system.py | Added migration to rename services to System with upgrade/downgrade support |
| .kerberos/entrypoint.sh | Added blank line for formatting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| system_exists = await session.scalar( | ||
| select(exists(Directory)) | ||
| .where( | ||
| and_( | ||
| qa(Directory.name) == "System", | ||
| qa(Directory.parent_id) == service_dir.parent_id, | ||
| ), | ||
| ), | ||
| ) # fmt: skip | ||
|
|
||
| if system_exists: | ||
| return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
убрать, лишнее
…or services and system
…es for Kerberos configuration files
…es, enhance config update script, and simplify test case
…e related paths and attributes recursively. Implement downgrade functionality to revert changes.
… the renaming process of 'services' to 'System', including updates to paths and attributes. Enhance downgrade functionality for reverting changes.
…tion sequence for renaming 'services' to 'System'.
… across the codebase to align with updated terminology and improve clarity in Kerberos-related functionality.
…pose configurations; refactor alembic migration for improved descendant path updates during 'services' to 'System' renaming.
…mbic migration; streamline the renaming process of 'services' to 'System'.
…renaming 'services' to 'System'; streamline upgrade and downgrade functions by removing redundant code and improving clarity.
… renaming 'System' back to 'services'; ensure consistency in code style.
…olidating directory selection logic and ensuring proper handling of system directories. Streamline upgrade and downgrade functions for improved clarity and efficiency.
…gration; streamline the upgrade process for renaming 'services' to 'System'.
… 'services' to 'System'; streamline upgrade and downgrade functions for improved efficiency.
65c2b13 to
7b01fe1
Compare
…'System' to reflect the latest migration sequence.
Переименование раздела
servicesвSystemпо аналогии с АДнюансы: Пока сделал обновление конфигов кербероса не по апи, а через volume, т.к. когда мы меняем схему, то kerberos валится при fetch данных и мы не можем дойти с запросом на обновление конфига
Задача: 1084