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(api,robot-server): export notes on commands #14616

Merged
merged 3 commits into from
Mar 11, 2024

Conversation

sfoster1
Copy link
Member

@sfoster1 sfoster1 commented Mar 8, 2024

Commands in runs can have notes attached to them. Each command can have zero or more notes, and zero notes can be expressed as any of (notes=None, notes is-not-present, notes is empty-list). This is to make the public models a little more robust across versions.

Closes EXEC-288

@sfoster1 sfoster1 requested a review from a team March 8, 2024 21:09
@sfoster1 sfoster1 requested a review from a team as a code owner March 8, 2024 21:09
Copy link

codecov bot commented Mar 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.47%. Comparing base (cd79d6d) to head (1a69b84).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             edge   #14616   +/-   ##
=======================================
  Coverage   67.47%   67.47%           
=======================================
  Files        2484     2484           
  Lines       71316    71316           
  Branches     9085     9085           
=======================================
  Hits        48120    48120           
  Misses      21040    21040           
  Partials     2156     2156           
Flag Coverage Δ
g-code-testing 92.43% <ø> (ø)
shared-data 75.94% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
api/src/opentrons/protocol_engine/__init__.py 100.00% <ø> (ø)
...src/opentrons/protocol_engine/commands/__init__.py 100.00% <ø> (ø)
.../src/opentrons/protocol_engine/commands/command.py 94.11% <ø> (ø)
...server/robot_server/runs/router/commands_router.py 100.00% <ø> (ø)
robot-server/robot_server/runs/run_models.py 100.00% <ø> (ø)

@sfoster1 sfoster1 requested a review from a team as a code owner March 8, 2024 21:26
DerekMaggio
DerekMaggio previously approved these changes Mar 8, 2024
Copy link
Contributor

@DerekMaggio DerekMaggio left a comment

Choose a reason for hiding this comment

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

Looks straightforward to me.

@@ -176,6 +176,13 @@ class BaseCommand(GenericModel, Generic[CommandParamsT, CommandResultT]):
" a command that is part of a calibration procedure."
),
)
notes: Optional[List[CommandNote]] = Field(
Copy link
Contributor

Choose a reason for hiding this comment

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

Will the ordering of the notes end up being important?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think probably not

@DerekMaggio DerekMaggio dismissed their stale review March 8, 2024 21:39

Removing review. There is a requirement in the ticket about being able to send 0 or more notes over the wire for this to be done.
I am not familiar enough with the Protocol Engine to confirm that this is happening.

Going to look into it more Monday, will re-review then

Copy link
Contributor

@DerekMaggio DerekMaggio left a comment

Choose a reason for hiding this comment

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

Did some digging to ensure that the requirements of the ticket are being met. Commands are sent via HTTP, with a note attached, the note is validated by querying for said command, and then checking its value.

Approval, on the condition that all tests and stuff end up passing

Base automatically changed from exec-287-define-note-model to edge March 11, 2024 19:46
Commands in runs can have notes attached to them. Each command can have
zero or more notes, and zero notes can be expressed as any
of (notes=None, notes is-not-present, notes is empty-list). This is to
make the public models a little more robust across versions.

Closes EXEC-288
Copy link
Contributor

@TamarZanzouri TamarZanzouri left a comment

Choose a reason for hiding this comment

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

Looks great! thank you! do we not need to update the json commands schema?

Copy link
Contributor

@SyntaxColoring SyntaxColoring left a comment

Choose a reason for hiding this comment

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

No notes (ha ha ha ha ha)

@sfoster1
Copy link
Member Author

Looks great! thank you! do we not need to update the json commands schema?

We do not, because the commands schema actually contains the CommandCreate union. Notes do not appear in protocols, only runs, so they don't need to be there.

@sfoster1 sfoster1 merged commit 08a599f into edge Mar 11, 2024
42 of 43 checks passed
@sfoster1 sfoster1 deleted the exec-288-add-notes-to-runs branch March 11, 2024 21:11
Carlos-fernandez pushed a commit that referenced this pull request May 20, 2024
Commands in runs can have notes attached to them. Each command can have
zero or more notes, and zero notes can be expressed as any of
(notes=None, notes is-not-present, notes is empty-list). This is to make
the public models a little more robust across versions.

Closes EXEC-288
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.

4 participants