Skip to content

Add explicit StrEnum conversions for D-Bus and Docker properties#6533

Draft
agners wants to merge 1 commit intomainfrom
explicit-strenum-convertion
Draft

Add explicit StrEnum conversions for D-Bus and Docker properties#6533
agners wants to merge 1 commit intomainfrom
explicit-strenum-convertion

Conversation

@agners
Copy link
Member

@agners agners commented Feb 5, 2026

Convert string values from D-Bus and Docker API to their respective StrEnum types explicitly to satisfy typeguard runtime type checking.

The conversions will raise ValueError if an unknown enum value is encountered, this will be caught in Sentry. Since D-Bus and the particular property from Docker API are not mission critical for Supervisor update functionality, it will be possible to add new enum values in the future as they arise.

Proposed change

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the supervisor)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to cli pull request:
  • Link to client library pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Ruff (ruff format supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints or add-on configuration are added/changed:

Convert string values from D-Bus and Docker API to their respective StrEnum
types explicitly to satisfy typeguard runtime type checking.

The conversions will raise ValueError if an unknown enum value is encountered,
this will be caught in Sentry. Since D-Bus and the particular property from
Docker API are not mission critical for Supervisor update functionality, it
will be possible to add new enum values in the future as they arise.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@agners agners added the refactor A code change that neither fixes a bug nor adds a feature label Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed refactor A code change that neither fixes a bug nor adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant