-
Notifications
You must be signed in to change notification settings - Fork 101
Remove is_item_relevant flawed abstract method from Applier abstract class and convert it to protocol #410
Copy link
Copy link
Closed
Labels
migrate/groupsCorresponds to Migrate Groups Step of go/uc/upgradeCorresponds to Migrate Groups Step of go/uc/upgradetech debtchores and design flawschores and design flaws
Description
is_item_relevant is causing double deserialization of raw permissions state and a more complicated than necessary class structure, increasing coupling as well. Applier has to become a proper typing.Protocol and have only abstract methods, without the need of implementations to inherit from the class.
Example:
def is_item_relevant(self, item: Permissions, migration_state: GroupMigrationState) -> bool:
return True
def _noop(self):
pass
def _get_apply_task(self, item: Permissions, migration_state: GroupMigrationState,
destination: Destination) -> partial:
grant = Grant(**json.loads(item.raw))
group_info = migration_state.get_by_workspace_group_name(grant.principal)
if group_info is None:
# technically, we should be able just to `return self._noop`
return partial(self._noop)
...
return partial(...)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
migrate/groupsCorresponds to Migrate Groups Step of go/uc/upgradeCorresponds to Migrate Groups Step of go/uc/upgradetech debtchores and design flawschores and design flaws
Type
Projects
Status
No status