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

fix(protocol-designer): append definitionId to the labwareId in migration #15396

Merged
merged 4 commits into from
Jun 12, 2024

Conversation

jerader
Copy link
Collaborator

@jerader jerader commented Jun 12, 2024

closes RESC-271

Overview

This PR addresses 2 bugs in 1.

The first bug has to do with the 7.0.0 migration file. Lots of the logic relies on the labware id having the definitionId appended to the end of the uuid string. This is NOT GREAT but that's how i architectured it so the migration should handle appending it. It does in most cases but somehow missed some cases which are fixed in this PR. So basically the bug is the migration couldn't find certain labwareIds and labware definitions because it was searching via a string that didn't include the definitionId.

The 2nd bug is in the 8.1.0 migration file where to populate the tiprack command, it is incorrectly searching for a tipRack key in the step form which doesn't exist yet? idk how we didn't notice this bug sooner. I guess it doesn't whitescreen but it does require the user to add their tiprack location manually instead of auto-populating upon migrating.

Test Plan

Upload the attached protocol and see that it migrated correctly. Go to the deck map and see that there are no errors in the steps (NOTE they will have the tuberack warnings but that is fine). Export the protocol. Then, reimport the migrated protocol and see that there are no errors.

16S Bakterien qPCR 3 Primer 5mL JoLo tubes_V6.json

Changelog

  • make sure each labwareId instance has the definitionid appended to the end of it unless it is the fixed trash
  • fix the tiprack bug in the 8.1.0 migration

Review requests

see test plan

Risk assessment

low

@jerader jerader requested a review from a team as a code owner June 12, 2024 13:14
@@ -79,7 +79,7 @@ export const migrateFile = (
.filter(labwareId => getIsAdapter(labwareId))
.reduce((acc: LabwareIdMapping, labwareId: string): LabwareIdMapping => {
const { labwareUri, adapterUri } = getAdapterAndLabwareSplitInfo(
Copy link
Collaborator Author

@jerader jerader Jun 12, 2024

Choose a reason for hiding this comment

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

if you search getAdapterAndLabwareSplitInfo util, it relies on having the labwareDefURI info, which definitionId === defURI (i know its confusing but we removed definitionIds starting in 7.0.0 and started only using defURI or labwareDefURI.

acc[labwareId] = labwareLocationUpdate[labwareId]
const definitionId = labware[labwareId].definitionId
const labId =
labwareId === 'fixedTrash' || labwareId.includes(definitionId)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

for consistency

Suggested change
labwareId === 'fixedTrash' || labwareId.includes(definitionId)
labwareId.includes(definitionId) || labwareId === 'fixedTrash'

Copy link
Contributor

@koji koji left a comment

Choose a reason for hiding this comment

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

the changes look good to me and the sandbox worked as expected.

e2e test failed. once the test error is fixed, this pr is good to go.

Copy link
Member

@shlokamin shlokamin left a comment

Choose a reason for hiding this comment

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

can we add a test case to the v7 migration file that checks for this fix? it'll serve as great documentation for what's going on here and why we're doing this

@jerader jerader changed the base branch from edge to chore_release-pd-8.1.0 June 12, 2024 14:56
@jerader jerader merged commit 3b4c9d8 into chore_release-pd-8.1.0 Jun 12, 2024
14 checks passed
@jerader jerader deleted the pd_migration-bug branch June 12, 2024 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants