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

refactor(api): Relocate module location validation to engine #14960

Merged
merged 3 commits into from
Apr 19, 2024

Conversation

CaseyBatten
Copy link
Contributor

Overview

See: RQA-2577
Prevents the engine from accepting load module commands in locations for modules that match the deck configuraiton but would not have passes protocol core validation.

Test Plan

If a maintenance run is created with a load module command loading a thermocycler in slot A1, expect that an error will be raised by the robot containing the line:
ValueError: A thermocyclerModuleType cannot be loaded into slot A1

Changelog

Previously we ensured that a module location was valid on the protocol core. This was acceptable previously as module locations were whitelisted based on their definitions. Now our dependency hierarchy has changed however. When a module is configured, it must first be added to the deck config. In order to add it to the deck config, it's fixture must allow it to load into a given mayMountTo location. This results in the same behavior as our definition dependency before, however in the case of the thermocycler both A1 and B1 became valid load slots because its fixtureGroup spanned both slots. This meant the engine could now validate a load_module engine command with a thermocycler in A1 so long as the deck provided a valid related fixture. PAPI protocols would prevent this because protocol core had stricter validation requirements. In order to correct this, the _ensure_module_location(...) validation has been relocated to the engine load_module logic so that all validation occurs engine-side, preventing historically unsupported load locations.

Risk assessment

Low, the same validations are occurring we are just more thorough that before.

@CaseyBatten CaseyBatten requested a review from a team as a code owner April 19, 2024 17:33
this tavern test appears to have been built to exploit our previously incorrect load module engine side validation
@CaseyBatten CaseyBatten requested a review from a team as a code owner April 19, 2024 18:51
@CaseyBatten CaseyBatten requested a review from a team April 19, 2024 19:20
Copy link
Contributor

@b-cooper b-cooper 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 to me 👍

@CaseyBatten CaseyBatten merged commit 15bfd98 into edge Apr 19, 2024
20 checks passed
@CaseyBatten CaseyBatten deleted the relocate-module-location-validation-to-engine branch April 19, 2024 19:51
Carlos-fernandez pushed a commit that referenced this pull request May 20, 2024
Prevents the engine from accepting load module commands in locations for
modules that match the deck configuraiton but would not have passed
protocol core validation.
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.

None yet

2 participants