Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR applies review feedback to the v2 branch by tightening model validation, improving auth error mapping for Nexity, enforcing enum fallback conventions, and aligning internal client request helpers/tests with updated method names.
Changes:
- Add validation to
StateDefinitionto requirenameorqualified_name, plus a unit test for this behavior. - Rename internal HTTP helpers on
OverkizClient(__get/__post/__delete→_get/_post/_delete) and update tests accordingly. - Improve Nexity auth error handling by mapping specific Cognito
ClientErrorcodes toNexityBadCredentialsExceptionwhile propagating other errors; add test coverage.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_models.py | Adds coverage for StateDefinition rejecting invalid payloads. |
| tests/test_client.py | Updates backoff-related tests to patch renamed internal client methods. |
| tests/test_client_queue_integration.py | Updates queue integration tests to patch _post instead of name-mangled __post. |
| tests/test_auth.py | Adds tests validating Nexity Cognito error mapping/propagation and updates imports for patching. |
| pyoverkiz/models.py | Enforces required identifier field for StateDefinition. |
| pyoverkiz/enums/base.py | Adds subclass-time enforcement that UnknownEnumMixin users define UNKNOWN. |
| pyoverkiz/client.py | Switches to _get/_post/_delete, improves cert path handling via Path, and updates docstring style in execute_action_group. |
| pyoverkiz/auth/strategies.py | Uses get_running_loop() and refines Nexity Cognito error mapping to avoid masking non-credential failures. |
| pyoverkiz/action_queue.py | Aligns docstring with Google-style sections used by the docs tooling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Apply feedback form @tetienne in #1872.
Feedback on models.py skipped for now, as this will require a larger refactor (like https://github.com/iMicknl/python-overkiz-api/pulls).