Skip to content

Conversation

@rclarke0
Copy link
Contributor

@rclarke0 rclarke0 commented Dec 8, 2025

Overview

Timeline errors for flex stacker steps

Test Plan and Hands on Testing

  • Unit tests for all error types added
  • smoke testing will be done in future PRS

Changelog

  • Added error types and checking for HOPPER_EMPTY, SHUTTLE_EMPTY, SHUTTLE_FULL and MISMATCHED_LABWARE
  • Added utils to check for labware on the shuttle and for determining if the labware being stored matched what is inside the hopper

Review requests

Risk assessment

  • low

Partially closes EXEC-2083 and EXEC-2084 until it can be tested in the UI

@rclarke0 rclarke0 requested review from jerader and ncdiehl11 December 8, 2025 16:10
@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.77%. Comparing base (62d016d) to head (f2f0b12).
⚠️ Report is 9 commits behind head on edge.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #20317      +/-   ##
==========================================
- Coverage   25.78%   25.77%   -0.02%     
==========================================
  Files        3625     3636      +11     
  Lines      301800   303125    +1325     
  Branches    42290    42430     +140     
==========================================
+ Hits        77827    78118     +291     
- Misses     223944   224978    +1034     
  Partials       29       29              
Flag Coverage Δ
protocol-designer 19.35% <7.89%> (+0.05%) ⬆️
step-generation 5.59% <100.00%> (-0.02%) ⬇️

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

Files with missing lines Coverage Δ
.../src/commandCreators/atomic/flexStackerRetrieve.ts 100.00% <100.00%> (ø)
...ion/src/commandCreators/atomic/flexStackerStore.ts 100.00% <100.00%> (ø)
step-generation/src/errorCreators.ts 71.20% <100.00%> (+1.97%) ⬆️
step-generation/src/types.ts 100.00% <ø> (ø)
step-generation/src/utils/misc.ts 61.88% <100.00%> (+0.48%) ⬆️

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

const labwareIdOnModule = getLabwareIdOnHopper(labware, moduleLocation)
const labwarePythonName = labwareEntities[labwareIdOnModule]?.pythonName
// TODO: add error creator if there is no labware in the hopper
// TODO: add error for if there is labware on the shuttle
Copy link
Collaborator

Choose a reason for hiding this comment

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

All good either way, but do you plan to wire up this error in this PR? I think we can create a utility in step-generation/src/utils/misc.ts that accesses the module's state. Something like:

export const getLabwareIdOnShuttle = (
  stackerState: FlexStackerModuleState
): string | null => {
  return stackerState.labwareOnShuttle?.primaryLabwareId ?? null
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks Nick. ya, up to you Rhyann! you can address multiple timeline errors in this PR if you want. But if you wire this up, can you also add a unit test for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

on it!

},
labware: {
[mockLabwareId]: {
stack: ['D2'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: this isn't a valid stack, it should include the labwareId itself in it. so something like this: this means mockLabwareId is directly on the slot.

Suggested change
stack: ['D2'],
stack: [mockLabwareId, 'D2'],

}
}

export const flexStackerHopperEmpty = (): CommandCreatorError => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

cool thanks for adding all the error types in here 😄

@rclarke0 rclarke0 requested review from jerader and ncdiehl11 December 8, 2025 22:30
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