Skip to content

Conversation

@Misha-Shvets
Copy link
Collaborator

@Misha-Shvets Misha-Shvets commented Jan 23, 2026

Починил логику update, раньше не рассматривался кейс, когда на обновление приходят путсые группы.
+немного отрефачил метод, а то сложно читать

@Misha-Shvets Misha-Shvets changed the title FIx: fix update network policy for deleting groups during updates FIx: update network policy for deleting groups during updates Jan 23, 2026
Copy link
Collaborator

@rimu-stack rimu-stack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

напиши тест на это

@milov-dmitriy milov-dmitriy self-requested a review January 23, 2026 16:30
dto: NetworkPolicyUpdateDTO,
) -> NetworkPolicyDTO:
"""Update network policy."""
policy = await self._network_policy_gateway.get_with_for_update(dto.id)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

может стоит внутри метода get_with_for_update сделать # NOTE: с небольшим описанием того, зачем используется .with_for_update() ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

расписать что делает алхимический with_for_update? ИМХО избыточно

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужна блокировка на запись(в целом with_for_update для этого и используют)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я про то, зачем нам здесь нужна блокировка. может несколько запрсоов на изменение прийти?

…th direct check for existing policies before committing changes
@rimu-stack rimu-stack merged commit 002ab56 into dev Jan 27, 2026
6 checks passed
@rimu-stack rimu-stack deleted the fix_delete_np_groups_1219 branch January 27, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants