Skip to content
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

feat(api): add liquid classes to the StateSummary. #16899

Merged
merged 3 commits into from
Nov 21, 2024
Merged

Conversation

ddcc4
Copy link
Contributor

@ddcc4 ddcc4 commented Nov 19, 2024

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 the StateSummary, we want to export the liquid classes as a list, so this PR defines a new LiquidClassRecordWithId class for the summary.

The fields in the StateSummary in turn are propagated to the CLI AnalyzeResults, and are mirrored to the robot-server CompletedAnalysis, Run, and MaintenanceRun 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.

@ddcc4 ddcc4 requested a review from sanni-t November 19, 2024 23:37
@ddcc4 ddcc4 requested review from a team as code owners November 19, 2024 23:37
@y3rsh y3rsh added the gen-analyses-snapshot-pr Generate a healing PR if the analyses snapshot test fails label Nov 20, 2024
Copy link
Contributor

A PR has been opened to address analyses snapshot changes. Please review the changes here: #16914

github-actions bot and others added 2 commits November 20, 2024 14:38
Copy link
Contributor

@jbleon95 jbleon95 left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for adding this, know it had to touch a lot especially with the snapshot tests.

Copy link
Member

@sanni-t sanni-t left a comment

Choose a reason for hiding this comment

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

LGTM!
Tested that all the updated protocol & run responses don't cause any issues with the app. The app is able to ignore the yet unidentified liquidClasses field 👍

@ddcc4 ddcc4 merged commit a910cf0 into edge Nov 21, 2024
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gen-analyses-snapshot-pr Generate a healing PR if the analyses snapshot test fails
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants