Split ActionGroup into base class and PersistedActionGroup#2017
Merged
Split ActionGroup into base class and PersistedActionGroup#2017
Conversation
…nfiguration and update authentication factory to use a unified credentials validation function
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors Overkiz action group modeling by splitting ActionGroup into a minimal user-facing base model and a server-returned PersistedActionGroup, updating the client and tests accordingly. It also includes additional refactors in auth credential validation and action queue configuration.
Changes:
- Split
ActionGroupintoActionGroup+PersistedActionGroup(with requiredoidand non-optional timestamps) and updateget_action_groups()to return persisted groups. - Update action-queue construction to use an
ActionQueueSettingsobject. - Refactor auth factory credential validation helpers into a generic
_ensure_credentials()and adjust tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
pyoverkiz/models.py |
Introduces PersistedActionGroup subclass and trims persisted-only fields from ActionGroup; optimizes States.__setitem__ indexing. |
pyoverkiz/client.py |
Updates get_action_groups() return type and structuring target to PersistedActionGroup; wires action queue via settings. |
pyoverkiz/action_queue.py |
Changes ActionQueue constructor to accept settings instead of delay/max_actions. |
pyoverkiz/auth/factory.py |
Consolidates credential-type validation into _ensure_credentials(). |
tests/test_models.py |
Adds coverage for ActionGroup vs PersistedActionGroup construction and type guarantees. |
tests/test_client.py |
Updates client tests to assert PersistedActionGroup results for /actionGroups and non-persisted groups in executions. |
tests/test_action_queue.py |
Updates tests to construct ActionQueue via ActionQueueSettings. |
tests/test_auth.py |
Updates credential validation tests and modifies Nexity auth tests (currently problematic). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…eue settings storage - Add missing pytest.raises assertions for Nexity auth tests that were silently passing without verifying exception behavior - Store ActionQueueSettings directly instead of unpacking into separate fields
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.
Summary
ActionGroupinto a lean base class (user-facing) andPersistedActionGroupsubclass (API-returned from/actionGroups)PersistedActionGrouphas non-optionaloid: str,creation_time: int,last_update_time: intget_action_groups()now returnslist[PersistedActionGroup]Execution.action_groupstays typed asActionGroup | NoneBreaking changes
get_action_groups()returnslist[PersistedActionGroup]instead oflist[ActionGroup];ActionGroupno longer hasoid,creation_time, orlast_update_timefieldsTest plan
test_get_action_groupsassertions to verifyPersistedActionGrouptype andoidasstrtest_get_current_executionto verify execution-embedded groups are notPersistedActionGroup