feat(api): add liquid classes to the StateSummary. #16899
Merged
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.
Overview
AUTH-851
Export the liquid classes we loaded into the Protocol Engine to the
StateSummary
, which will let clients see what liquid classes we loaded.The liquid classes are stored internally as a map of
{liquid_class_id -> LiquidClassRecords}
, but following the convention for the other fields in theStateSummary
, we want to export the liquid classes as a list, so this PR defines a newLiquidClassRecordWithId
class for the summary.The fields in the
StateSummary
in turn are propagated to the CLIAnalyzeResults
, and are mirrored to the robot-serverCompletedAnalysis
,Run
, andMaintenanceRun
models. So every call-site that uses those classes had to be updated, as well as every test that checks those classes, as well as 200 snapshot tests -- which was kind of painful.Test Plan and Hands on Testing
I'm relying on the CI tests to make sure I found all the call-sites that are affected.
(We don't yet have any protocols that load liquid classes, but when we do, we can probably add integration tests to show that the liquid classes end up in the summaries.)
Review requests
I recommend collapsing the
analyses-snapshot-testing/
when looking at this PR in Github. There are so many snapshot changes that Github sometimes errors out when trying to render the diff.The primary files with code changes are:
api/src/opentrons/protocol_engine/types.py
api/src/opentrons/protocol_engine/state/state.py
api/src/opentrons/protocol_engine/state/state_summary.py
api/src/opentrons/cli/analyze.py
robot-server/robot_server/runs/run_models.py
robot-server/robot_server/protocols/analysis_models.py
robot-server/robot_server/maintenance_runs/maintenance_run_models.py
The other files are pretty mechanical changes.
Risk assessment
Low risk, should affect dev only.