-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(api): remove feature-flag dependency from calibration_storage #13833
Conversation
…d where imports are publicized...
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## edge #13833 +/- ##
==========================================
- Coverage 70.82% 70.82% -0.01%
==========================================
Files 2498 2498
Lines 70181 70162 -19
Branches 8589 8589
==========================================
- Hits 49709 49692 -17
+ Misses 18383 18381 -2
Partials 2089 2089
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good but I think we can take it slightly farther - once we can remove conditions from the ot2 calibration stuff (have it import from ot2 directly) and from reset I think we're done
robot-server/robot_server/robot/calibration/pipette_offset/user_flow.py
Outdated
Show resolved
Hide resolved
- removed tip length cal utils on OT3 because they are not used ever
…s that are irrelevant to OT-2 workflows
# Conflicts: # robot-server/tests/service/legacy/routers/test_settings.py
Tested on OT-2 & Flex. Tested that
Flex is having some bugs with creating maintenance runs outside of protocol setup, but that also seems present on edge so I think it's unrelated to these changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome! Nice!
Overview
As part of the migration of hardware-related code out of the
opentrons
package and into theopentrons_hardware
package, we need to move dependencies on the advanced settings module out of any hardware code to avoid having multiple processes access & possibly modify the same settings file simultaneously.The
calibration_storage
module decides what implementation (OT2 vs OT3) to expose by checking the feature flagenable_ot3_hardware_controller
. This poses an issue because the module is imported by a few files inside ofhardware_control
, so this PR takes the platform logic out ofcalibration_storage
and offloads that logic to packages importing the module.In most of the places that the
opentrons
package importscalibration_storage
, the code is either for an OT2 or OT3 so it's easy to hard code the imports. Inrobot-server
, we just utilize the feature-flag logic that had been done internally bycalibration_storage
.Test Plan
Test calibration flows on ot2/flex and make sure stuff is still working correctly!!! Pushing from this branch should still detect any calibration files already on a robot, and new files should be fully compatible with a downgrade because the code should be the same.
Changelog
Review requests
Some tests ended up getting duplicated into
ot2
andot3
versions. I tried to get clever aboutimportlib
to parameterize based on the robot model but, in the end, theot2
andot3
subpackages are two different chunks of (very similar) code and I personally think it's okay to test them separately. Any objections?A lot of robot-server tests were already only using the OT-2 code so I didn't bother trying to restructure them to test the OT-3 files too. Does someone think it's important to expand the tests as a part of this PR?
Risk assessment
High if it accidentally imports OT2 code on a Flex (or vice versa), but should be pretty easy to verify it doesn't.