Skip to content

Split ActionGroup into base class and PersistedActionGroup#2017

Merged
iMicknl merged 7 commits intov2/mainfrom
v2/code_quality_fixes
Apr 25, 2026
Merged

Split ActionGroup into base class and PersistedActionGroup#2017
iMicknl merged 7 commits intov2/mainfrom
v2/code_quality_fixes

Conversation

@iMicknl
Copy link
Copy Markdown
Owner

@iMicknl iMicknl commented Apr 25, 2026

Summary

  • Split ActionGroup into a lean base class (user-facing) and PersistedActionGroup subclass (API-returned from /actionGroups)
  • PersistedActionGroup has non-optional oid: str, creation_time: int, last_update_time: int
  • get_action_groups() now returns list[PersistedActionGroup]
  • Execution.action_group stays typed as ActionGroup | None

Breaking changes

  • get_action_groups() returns list[PersistedActionGroup] instead of list[ActionGroup]; ActionGroup no longer has oid, creation_time, or last_update_time fields

Test plan

  • 7 new model tests for ActionGroup/PersistedActionGroup construction, inheritance, and type guarantees
  • Updated test_get_action_groups assertions to verify PersistedActionGroup type and oid as str
  • Updated test_get_current_execution to verify execution-embedded groups are not PersistedActionGroup
  • Full test suite passes (262 tests in test_models + test_client)
  • ruff clean, mypy clean

@iMicknl iMicknl added enhancement New feature or request breaking v2 labels Apr 25, 2026
Copilot AI review requested due to automatic review settings April 25, 2026 10:13
@iMicknl iMicknl added the enhancement New feature or request label Apr 25, 2026
@iMicknl iMicknl requested a review from tetienne as a code owner April 25, 2026 10:13
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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 ActionGroup into ActionGroup + PersistedActionGroup (with required oid and non-optional timestamps) and update get_action_groups() to return persisted groups.
  • Update action-queue construction to use an ActionQueueSettings object.
  • 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.

Comment thread tests/test_auth.py
Comment thread tests/test_auth.py Outdated
Comment thread pyoverkiz/action_queue.py Outdated
…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
@iMicknl iMicknl mentioned this pull request Apr 25, 2026
@iMicknl iMicknl merged commit a6482c1 into v2/main Apr 25, 2026
6 checks passed
@iMicknl iMicknl deleted the v2/code_quality_fixes branch April 25, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking enhancement New feature or request v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants