fix(api): add default values to optional fields of QUADRANT configuration #16002
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 RQA-2992
Overview
The
QuadrantNozzleLayoutConfiguration
has two optional fields-frontRightNozzle
andbackLeftNozzle
, but they didn't have a default value assigned. So when the app tries to fetch the run's data, if the RunStore reads the following valid command from the database-..then pydantic runs into a validation error since it doesn't know how to parse
configurationParams
with a missingfrontRightNozzle
.This was resulting in the 'Download Run Log' option to give a 500 error.
Once default values are set for the fields, pydantic is able to parse the params correctly and run log downloads without any issues.
Test Plan and Hands on Testing
Protocol for testing:
Review requests
It's been a while since I looked at the partial tip code so want to make sure that parts of the code that consume quadrant configuration know to verify the presence of at least one of
frontRightNozzle
orbackLeftNozzle
and to handle the case where neither is specified.The alternative to this approach would be to make the two fields non-optional and make the python API extract the info of the missing field before calling the engine command.
Risk assessment
None. Bug fix.