Skip to content

Conversation

@iMicknl
Copy link
Owner

@iMicknl iMicknl commented Jan 27, 2026

No description provided.

@iMicknl iMicknl requested a review from tetienne as a code owner January 27, 2026 19:05
Copilot AI review requested due to automatic review settings January 27, 2026 19:05
Copy link
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 the enum structure by introducing a shared UnknownEnumMixin class to eliminate duplicated _missing_ method implementations across multiple enum files. The refactoring consolidates common enum fallback behavior and logging into a reusable mixin.

Changes:

  • Introduces UnknownEnumMixin in pyoverkiz/enums/base.py to provide shared _missing_ and from_value methods
  • Migrates 8 enum classes across 5 files to use the new mixin (UIClass, UIWidget, Protocol, FailureType, EventName, GatewayType, GatewaySubType, ExecutionType, ExecutionState, ExecutionSubType)
  • Updates pyoverkiz/enums/__init__.py to explicitly construct __all__ by filtering Enum subclasses

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 20 comments.

Show a summary per file
File Description
pyoverkiz/enums/base.py New file introducing UnknownEnumMixin with shared missing and from_value methods
pyoverkiz/enums/ui.py Adds UnknownEnumMixin to UIClass and UIWidget, removes logging imports and UIClass's missing method
pyoverkiz/enums/protocol.py Adds UnknownEnumMixin to Protocol, removes logging imports and missing method, adds custom missing_message
pyoverkiz/enums/general.py Adds UnknownEnumMixin to FailureType and EventName, removes logging imports and FailureType's missing method
pyoverkiz/enums/gateway.py Adds UnknownEnumMixin to GatewayType and GatewaySubType, removes logging imports and their missing methods
pyoverkiz/enums/execution.py Adds UnknownEnumMixin to ExecutionType, ExecutionState, and ExecutionSubType, removes logging imports and their missing methods
pyoverkiz/enums/init.py Constructs explicit all list by filtering Enum subclasses from enum modules

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@iMicknl iMicknl marked this pull request as draft January 27, 2026 19:12
Copy link
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

Copilot reviewed 10 out of 10 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

iMicknl and others added 9 commits January 27, 2026 19:51
…um with labels, and implement protocol enum generation script
- Implemented `generate_ui_profiles` function to fetch and generate UIProfile enums.
- Added error handling for fetching profile details.
- Included detailed comments for commands and states in the generated enum.
- Updated the main generation function to include UIProfile generation.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@iMicknl
Copy link
Owner Author

iMicknl commented Jan 27, 2026

@copilot do a thorough review and fix all your suggestions in a new PR. Make sure the CI is green (so run uv run prek run --all-files to check this after your changes.

Copy link

Copilot AI commented Jan 27, 2026

@iMicknl I've opened a new pull request, #1926, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 16 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI and others added 3 commits January 28, 2026 09:42
…nt enum conversion (#1926)

## Progress Plan

- [x] Add missing UIClassifier enum to exports
- [x] Revert to simpler approach without explicit enum conversion
(maintainer preference)
- [x] Verify all linting and type checking passes
- [x] Test functionality works correctly

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/iMicknl/python-overkiz-api/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: iMicknl <1424596+iMicknl@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Jan 28, 2026

@iMicknl I've opened a new pull request, #1929, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits January 29, 2026 12:48
The `UnknownEnumMixin._missing_` method overrides `StrEnum._missing_`
but lacked explicit acknowledgment, causing type checker ambiguity about
the intentional override in the mixin pattern.

## Changes

- Added `# type: ignore[override]` to `_missing_` method signature
- Enhanced docstring to document the intentional override of
`StrEnum._missing_`
- Removed unused `Any` import

## Context

Mixin classes can't use `@override` decorator since they don't directly
inherit from the classes they'll be mixed with. The type ignore
annotation is the standard pattern for acknowledging overrides in
mixins.

```python
class UnknownEnumMixin:
    @classmethod
    def _missing_(cls, value: object) -> Self:  # type: ignore[override]
        """Return `UNKNOWN` and log unrecognized values.

        Intentionally overrides `StrEnum._missing_` to provide UNKNOWN fallback.
        """
        # ... implementation
```

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: iMicknl <1424596+iMicknl@users.noreply.github.com>
Co-authored-by: Mick Vleeshouwer <mick@imick.nl>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@iMicknl iMicknl marked this pull request as ready for review January 29, 2026 17:31
@iMicknl iMicknl added the v2 label Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants