Repository navigation
feat(BA-8504): update the placement policy of a session group - #15747
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
597bc6f to
5c270d0
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
69336cb to
6322cab
Compare
| condition=SessionGroupSearchableFields.linked.replica_groups.not_exists(), | ||
| error=EntityNotFoundError( | ||
| f"Session group {self.group_id} not found", | ||
| entity_type=SessionGroupEntityType(), | ||
| operation=ActionOperationType.UPDATE, | ||
| ), |
There was a problem hiding this comment.
Why does this say "not found"?
There was a problem hiding this comment.
Changed it to SessionGroupInUseForUpdate in 5dfedf3.
| A group a replica group holds answers not found, as the reads do. | ||
| """ | ||
|
|
||
| group_id: SessionGroupID |
There was a problem hiding this comment.
If possible, please set the field name to "session_group_id."
There was a problem hiding this comment.
Renamed it to session_group_id in 9409047.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3605c4c to
9409047
Compare
| if not isinstance(self.placement_direction, SessionGroupPlacementDirectionEnum) and not ( | ||
| isinstance(self.placement_enforcement, SessionGroupPlacementEnforcementEnum) | ||
| ): | ||
| raise ValueError( | ||
| "UpdateSessionGroupInput requires 'placement_direction' or 'placement_enforcement'" | ||
| ) |
There was a problem hiding this comment.
Is there a scenario where one side is set to None and the other is left as UNSET?
There was a problem hiding this comment.
Yes. For example, {"placement_direction": null} passes null for one field and omits the other.
Both columns are NOT NULL, so the adapter’s OptionalState.from_unset treats null the same as an omitted field: “keep the existing value.”
Since neither field carries a value to change, the validator rejects the request (400 on REST).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
518181a to
865640e
Compare
| async def update_session_group( | ||
| info: Info[StrawberryGQLContext], | ||
| input: UpdateSessionGroupInputGQL, | ||
| ) -> UpdateSessionGroupPayloadGQL: |
There was a problem hiding this comment.
Please set the type nullable (UpdateSessionGroupPayloadGQL | None). The reason is to set nullable response of updateSessionGroup GQL schema
There was a problem hiding this comment.
Made both updateSessionGroup and purgeSessionGroup payloads nullable in c90a4ab.
| @model_validator(mode="after") | ||
| def _require_a_change(self) -> Self: | ||
| if not isinstance(self.placement_direction, SessionGroupPlacementDirectionEnum) and not ( | ||
| isinstance(self.placement_enforcement, SessionGroupPlacementEnforcementEnum) | ||
| ): | ||
| raise ValueError( | ||
| "UpdateSessionGroupInput requires 'placement_direction' or 'placement_enforcement'" | ||
| ) |
There was a problem hiding this comment.
this is okay but we don't need to validate all update input DTOs like this. maybe we can consider of implementing a new generalized update input type
There was a problem hiding this comment.
Implementing a new generalized update input type sounds like a good idea. I’ll note it down and work on it in a separate PR when I get the chance.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the service and adapter Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lidator Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d map Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rather than not found Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…than a bare group Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ds nullable Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…phQL inspector Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b607ef7 to
dd24c4e
Compare
Co-authored-by: octodog <mu001@lablup.com>
Summary
PATCH /v2/session-groups/{session_group_id}changes a session group'splacement_directionandplacement_enforcement.updateSessionGroupmutation withUpdateSessionGroupInputandUpdateSessionGroupPayload.update, which runsUpdateSessionGroupActionwith aSessionGroupUpdater.Resolves BA-8504
🤖 Generated with Claude Code
📚 Documentation preview 📚: https://sorna--15747.org.readthedocs.build/en/15747/
📚 Documentation preview 📚: https://sorna-ko--15747.org.readthedocs.build/ko/15747/