feat(robot-server): update run creation endpoint to accept runtime parameter values #14776
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Closes AUTH-130
This PR adds a new, optional argument
runTimeParameterValues
to the request body of thePOST /runs
endpoint to start a run with new runtime parameter values. It is the same shape as the argument for the/protocols
endpoint (a dictionary/map of variable names to the parameter values), but since this endpoint does not take form data, it does not need to be parsed with in the body of the run create function.These values are then fed to the
ProtocolRunner
load method which will bind those to the execute function, so that when the protocol starts it will evaluate and use those values when running the protocol. (assuming there are no errors in setting the parameter values).Since re-analysis has not been implemented yet, when starting a run with overridden values, the frontend will show an incorrect analysis for the run. This will be addressed in a future PR so that it reflects the values (and therefore potentially labware, pipettes, modules used) used in the actual run.
Test Plan
Continuing to use this test protocol seen in other PRs to test parameter values. Using postman, I was able to post the protocol with default values, then start a run with new overridden values:
runTimeParameterValues
uses the default valuesChangelog
runTimeParameterValues
argument toPOST /runs
Review requests
Risk assessment
Low