Skip to content

Prevent Enum classes being treated as Bluesky Protocols - #873

Merged
DiamondJoseph merged 4 commits into
mainfrom
fix-enums
Mar 27, 2025
Merged

DiamondJoseph merged 4 commits into
mainfrom
fix-enums

Conversation

@DiamondJoseph

Copy link
Copy Markdown
Contributor

Enum defines a property for name and value- meaning that according to ducks, any enum class extends HasName. Now that we are checking the origin of types, we have started catching this when trying to import plans that take enums as a parameter and possibly even just on devices that have enums as a type arg (e.g. a Movable[ShutterDemand]).

This change makes HasName, HasParent and HasHints on their own no longer sufficient to define that a class is a Device class.

This was making blueapi try and treat Enum classes as Device classes, and so constructing References which extend them- extending an Enum class is not allowed.

@callumforrester callumforrester left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main worry with this is unknown knock-on effects, hopefully system testing will catch those...

@codecov

codecov Bot commented Mar 27, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.56%. Comparing base (f5060ca) to head (2222a57).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #873      +/-   ##
==========================================
- Coverage   93.57%   93.56%   -0.02%     
==========================================
  Files          38       38              
  Lines        2148     2144       -4     
==========================================
- Hits         2010     2006       -4     
  Misses        138      138              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants