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(robot-server): Robot server command responses #7170

Merged
merged 6 commits into from
Jan 5, 2021

Conversation

amitlissack
Copy link
Contributor

@amitlissack amitlissack commented Dec 30, 2020

Overview

Refactor session command models to eliminate dreaded Union problems in requests and responses.

closes #6519

Changelog

  • SessionCommandRequest is a generic that accepts the command type, request data, and response data.
  • SessionCommandResponse is derived from SessionCommandRequest
  • SessionCommandRequest.make_response creates a SessionCommandResponse

Review requests

Is this clear? Do the comments help?

Risk assessment

Low. Unit and tavern tests beat up on this code pretty well.

@amitlissack amitlissack added WIP refactor robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience). labels Dec 30, 2020
@amitlissack amitlissack requested review from Laura-Danielle, a team, mcous and sanni-t and removed request for a team December 30, 2020 16:59
@codecov
Copy link

codecov bot commented Dec 30, 2020

Codecov Report

Merging #7170 (acbb1aa) into edge (29fac8a) will increase coverage by 8.67%.
The diff coverage is 97.26%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge    #7170      +/-   ##
==========================================
+ Coverage   78.71%   87.38%   +8.67%     
==========================================
  Files         264       99     -165     
  Lines       18953     4551   -14402     
==========================================
- Hits        14918     3977   -10941     
+ Misses       4035      574    -3461     
Impacted Files Coverage Δ
...service/session/command_execution/base_executor.py 80.00% <ø> (ø)
...ice/session/command_execution/callable_executor.py 53.33% <0.00%> (ø)
...rver/service/session/models/command_definitions.py 97.14% <ø> (ø)
...erver/service/session/command_execution/command.py 100.00% <100.00%> (ø)
...ver/robot_server/service/session/models/command.py 100.00% <100.00%> (ø)
...rver/service/session/session_types/base_session.py 91.83% <100.00%> (ø)
...on/session_types/live_protocol/command_executor.py 95.83% <100.00%> (ø)
...n/session_types/live_protocol/command_interface.py 89.74% <100.00%> (ø)
...session/session_types/live_protocol/state_store.py 100.00% <100.00%> (ø)
...ssion_types/protocol/execution/command_executor.py 89.13% <100.00%> (ø)
... and 165 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29fac8a...acbb1aa. Read the comment docs.

@amitlissack amitlissack marked this pull request as ready for review January 4, 2021 16:53
@amitlissack amitlissack requested a review from a team as a code owner January 4, 2021 16:53
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, love generics

Copy link
Contributor

@Laura-Danielle Laura-Danielle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very excited for this!

@amitlissack amitlissack merged commit 4cab53f into edge Jan 5, 2021
@amitlissack amitlissack deleted the robot-server_command-responses branch January 5, 2021 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor(robot-server): Use Literal to simplify models
4 participants