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

chore(api): return stall/collision defined error from stacker store #17613

Conversation

TamarZanzouri
Copy link
Contributor

@TamarZanzouri TamarZanzouri commented Feb 28, 2025

Overview

closes https://opentrons.atlassian.net/browse/EXEC-1198.
return a defined error from store and retrive when encountering a stall.

Test Plan and Hands on Testing

upload a protocol to the flex and trigger a stall upon store + retrive.
make sure the server is returning a defined error and not propagating the stall collision error.

*** will add a protocol soon and will test locally as well

Changelog

  • retreive and store now catch a FlexStackerStallError and return a defined error for ER.
  • added FlexStackerStallOrCollisionError to the defined errors union.

Review requests

  1. should we update the state when there is a stall?
  2. do we need to add a new error code for the stacker stall?
  3. do we need the axis and serial as props to the error?
  4. did I miss anything?

Risk assessment

low. return a defined error instead of the error propagating.

Copy link
Contributor

@ahiuchingau ahiuchingau left a comment

Choose a reason for hiding this comment

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

LGTM. Just a note on the error docstring.

Co-authored-by: Alise Au <20424172+ahiuchingau@users.noreply.github.com>
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

I think we should add a new error code for this, yeah. Especially since the axis names overlap with the flex axes (both have X), and double especially since we're putting it in a different DefinedError kind. And yeah, when we build an error instance we'll want to fill in the axis and serial details.

Also, IMO this is more "flex stacker" than it is "stall error", so let's put the definition of the defined error in a new flex_stacker/common.py file in the engine, since nothing outside of a flex stacker command will ever want to build one.

@TamarZanzouri TamarZanzouri requested a review from a team as a code owner February 28, 2025 17:41
Copy link

codecov bot commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 24.56%. Comparing base (1bcbccb) to head (ef19e8e).
Report is 18 commits behind head on edge.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #17613      +/-   ##
==========================================
- Coverage   25.70%   24.56%   -1.15%     
==========================================
  Files        2843     2848       +5     
  Lines      218884   219240     +356     
  Branches    17947    18075     +128     
==========================================
- Hits        56268    53855    -2413     
- Misses     162601   165376    +2775     
+ Partials       15        9       -6     
Flag Coverage Δ
protocol-designer 18.99% <ø> (+0.03%) ⬆️
step-generation 4.39% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...-data/python/opentrons_shared_data/errors/codes.py 94.18% <ø> (ø)
.../python/opentrons_shared_data/errors/exceptions.py 55.20% <ø> (ø)

... and 55 files with indirect coverage changes

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

couple details, looks good other than those once tested

Copy link
Member

@sfoster1 sfoster1 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 once we fix the testing and remove the import from shared-data!

@TamarZanzouri
Copy link
Contributor Author

tested and works as expected!

@TamarZanzouri TamarZanzouri merged commit 7705c47 into edge Mar 3, 2025
70 checks passed
@TamarZanzouri TamarZanzouri deleted the EXEC-1198-add-a-defined-error-status-for-stacker-shuttle-stalls branch March 3, 2025 20:33
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.

4 participants