-
Notifications
You must be signed in to change notification settings - Fork 178
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(api): Split UpdateCommandAction #14726
Merged
Merged
Changes from 11 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
3d57263
Split UpdateCommandAction into RunCommandAction and SucceedCommandAct…
SyntaxColoring 43f50d3
Update CommandStore.
SyntaxColoring fad2416
Trivially update remaining state stores.
SyntaxColoring d186f1f
Update legacy equipment loads.
SyntaxColoring c755485
WIP: CommandExecutor.
SyntaxColoring 4127d7e
WIP: legacy
SyntaxColoring 6df0bcc
WIP: Legacy
SyntaxColoring f02ec73
Dispatch actions atomically from LegacyContextPlugin.
SyntaxColoring 815297e
WIP: legacy tests
SyntaxColoring 10b3372
Fix race condition in legacy Python protocols' initial home command.
SyntaxColoring b5c54af
Leave a todo for removing the old ThreadAsyncQueue.
SyntaxColoring cfa9053
Less ambiguous docstrings.
SyntaxColoring e0de9dd
Let FailCommandAction set command notes.
SyntaxColoring dd05fd8
Import fixup.
SyntaxColoring 098fc2e
Update various things to supply notes.
SyntaxColoring e012b78
Leave todo comment for maintenance_run arg.
SyntaxColoring 308c5bc
Forgot my keys.
SyntaxColoring f173f7b
Set notes=[] for succeeded commands in LegacyCommandMapper.
SyntaxColoring cb3d655
Update integration tests to expect `notes: []` on completed commands.
SyntaxColoring 7c48aca
I'm sorry, Mike.
SyntaxColoring 32543f8
Update test_legacy_context_plugin.py.
SyntaxColoring ec58e46
Update legacy command mapper unit tests.
SyntaxColoring 8c6f65d
Lint.
SyntaxColoring 33e39e0
Flow variables from queued->running->completed.
SyntaxColoring File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,16 +121,35 @@ class QueueCommandAction: | |
|
||
|
||
@dataclass(frozen=True) | ||
class UpdateCommandAction: | ||
"""Update a given command.""" | ||
class RunCommandAction: | ||
"""Mark a given command as running. | ||
|
||
The command must be queued immediately prior to this action. | ||
""" | ||
|
||
command_id: str | ||
started_at: datetime | ||
|
||
|
||
@dataclass(frozen=True) | ||
class SucceedCommandAction: | ||
"""Mark a given command as succeeded. | ||
|
||
The command must be running immediately prior to this action. | ||
""" | ||
|
||
command: Command | ||
"""The command in its new succeeded state.""" | ||
|
||
private_result: CommandPrivateResult | ||
|
||
|
||
@dataclass(frozen=True) | ||
class FailCommandAction: | ||
"""Mark a given command as failed.""" | ||
"""Mark a given command as failed. | ||
|
||
The command must be running immediately prior to this action. | ||
""" | ||
|
||
command_id: str | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we don't want to make |
||
error_id: str | ||
|
@@ -211,7 +230,8 @@ class SetPipetteMovementSpeedAction: | |
HardwareStoppedAction, | ||
DoorChangeAction, | ||
QueueCommandAction, | ||
UpdateCommandAction, | ||
RunCommandAction, | ||
SucceedCommandAction, | ||
FailCommandAction, | ||
AddLabwareOffsetAction, | ||
AddLabwareDefinitionAction, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when
UpdateCommandAction
was the everything-doer, having the command embedded made sense, but now having it inSucceedCommandAction
looks a little weirder amongst all its siblings that only reference the id. Does it maybe make sense to haveSucceedCommandAction
carrynotes: List[CommandNote]
,result: CommandResult
,private_result: CommandPrivateResult
independently?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @sfoster1 we might want to add these to the
SucceedCommandAction
. I agreeUpdateCommandAction
had too many responsibilitiesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that makes sense.
I’m pretty sure some of the states stores are reading
command.params
, too. So to replace that, we’d either need to addparams
toCompleteCommandAction
, or give every state store access to theCommandView
so they can retrieve the params themselves.