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

feat(robot-server): add protocol_kind to the protocols endpoint and persistance layer. #15353

Merged
merged 5 commits into from
Jun 12, 2024

Conversation

vegano1
Copy link
Contributor

@vegano1 vegano1 commented Jun 6, 2024

Overview

A "Quick Transfer" protocol is a protocol that is generated by the on-device-display (ODD) (For now), to perform routine plate filler actions without needing to use a computer and the desktop app. This is a mostly client-side driven feature, However, we do need to make changes on the backend to support this feature. We primarily want 20 Protocol slots intended for "Quick Transfer" protocols. So we need to tell which type of protocol we are dealing with, so we can limit their count, migrate them, store them in the database, etc.

This pull request sets up the backend to handle "ProtocolKinds" sent as "protocolKind" Form data key in the POST /protocols endpoint. We then add this new key to the rest of the infrastructure required to consume this new key, persist, and get reported. This will let us mark protocols as "standard" or "quick_transfer" for the robot server to perform side effects on specific protocol kinds, like not storing runs for "Quick Transfer" protocols.

Closes: PLAT-311 PLAT-312 PLAT-313 PLAT-315 PLAT-316

Test Plan

  • Make sure that a robot can start up properly after migration
  • Make sure adding the "protocolKind" form data key to the POST /protocols endpoint returns the correct kind of protocol
  • Make sure that the GET /protocol endpoint returns the correct protocolKind value
  • Make sure that protocol_kind persists through the robot server app restarts.

Changelog

  • Add the "protocolKind" form data key to the POST /protocols endpoint
  • Add "protocolKind" to the ProtocolResource class
  • Add "protocolKind" to the Protocol class
  • Add the protocol_kind key to the database under schema 5
  • Add a schema v4_v5 migration

Review requests

  • Make sure this makes sense and that I'm not overlooking anything too critical

Risk assessment

  • Medium, this alters the database requiring a migration

@vegano1 vegano1 force-pushed the PLAT-311-add-protocol-kind-arg branch from 0217465 to 2ef220f Compare June 7, 2024 18:34
@vegano1 vegano1 marked this pull request as ready for review June 10, 2024 13:20
@vegano1 vegano1 requested review from a team as code owners June 10, 2024 13:20
Copy link
Contributor

@CaseyBatten CaseyBatten 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 overall, as discussed in person if we change out the query on the POST /protocols request to a form instead this will be in line with the rest of our HTTP API decisions so far. All other decisions seem sensible, your call regarding the exclusion of the ProtocolKind type on the Protocol constructor.

@vegano1 vegano1 force-pushed the PLAT-311-add-protocol-kind-arg branch from 13b5fe2 to cb2fa01 Compare June 11, 2024 17:26
@vegano1 vegano1 requested a review from sanni-t June 11, 2024 17:26
Copy link
Member

@sanni-t sanni-t 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! Thank you for making all the changes!
Good to merge once tests pass

@vegano1 vegano1 merged commit c13fcb1 into edge Jun 12, 2024
7 checks passed
@vegano1 vegano1 deleted the PLAT-311-add-protocol-kind-arg branch June 12, 2024 00:26
aaron-kulkarni pushed a commit that referenced this pull request Jun 13, 2024
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.

3 participants