feat(robot server): add a POST method on the analyses endpoint #14828
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.
Closes AUTH-255
Overview
Adds a POST method to the existing
/protocols/{protocolId}/analyses
endpoint in order to post a new analysis for an existing protocol.This endpoint will take a request body with two optional fields:
runTimeParameterValues
forceReAnalyze
The new method can affect the analyses in three ways:
forceReAnalyze=True
, the server will unconditionally start a new analysis for the protocol using any RTP data sent along with it. It will return a 201 CREATED status and respond with a list of analysis summaries of all the analyses (ordered oldest first), including the newly started analysis.forceReAnalyze
field (or withforceReAnalyze=False
), then the server will check the last analysis of the protocolThis request requires the last analysis of the protocol to have been completed before handling this request. If the last analysis is pending, it will return a 503 error.
Test Plan
Test out the above three cases and anything else you can think might affect the behavior.
It's pretty well tested in unit & integration tests and it is also the same logic used for handling analyses from
POST /protocols
, so it is expected to work well when used as tested in integration tests.Review requests
Usual review for code sanity check.
Risk assessment
Low. New HTTP API not yet used anywhere.