Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhuff committed Oct 22, 2024
1 parent b26eff9 commit 7f53850
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions robot-server/robot_server/runs/router/base_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class AllRunsLinks(BaseModel):
class CurrentStateLinks(BaseModel):
"""Links returned with the current state of a run."""

last: Optional[CommandLinkNoMeta] = Field(
lastCompleted: Optional[CommandLinkNoMeta] = Field(
None,
description="Path to the last completed command when current state was reported, if any.",
)
Expand Down Expand Up @@ -597,7 +597,7 @@ async def get_current_state(
raise RunStopped(detail=str(e)).as_error(status.HTTP_409_CONFLICT)

links = CurrentStateLinks.construct(
last=CommandLinkNoMeta.construct(
lastCompleted=CommandLinkNoMeta.construct(
id=last_completed_command.command_id,
href=f"/runs/{runId}/commands/{last_completed_command.command_id}",
)
Expand Down
2 changes: 1 addition & 1 deletion robot-server/robot_server/runs/run_data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def _get_historical_run_last_command(self, run_id: str) -> Optional[CommandPoint
command_id=command.id,
command_key=command.key,
created_at=command.createdAt,
index=command_slice.total_length - 1,
index=command_slice.cursor,
)
if command
else None
Expand Down
2 changes: 1 addition & 1 deletion robot-server/tests/runs/router/test_base_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ async def test_get_current_state_success(
}
)
assert result.content.links == CurrentStateLinks(
last=CommandLinkNoMeta(
lastCompleted=CommandLinkNoMeta(
href="/runs/test-run-id/commands/last-command-id",
id="last-command-id",
)
Expand Down
6 changes: 3 additions & 3 deletions robot-server/tests/runs/test_run_data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def test_get_current_command_not_current_run(
)

command_slice = CommandSlice(
commands=[last_command_slice], cursor=1, total_length=1
commands=[last_command_slice], cursor=0, total_length=1
)

decoy.when(mock_run_orchestrator_store.current_run_id).then_return("not-run-id")
Expand All @@ -1049,7 +1049,7 @@ def test_get_last_completed_command_current_run(
command_id=run_command.id,
command_key=run_command.key,
created_at=run_command.createdAt,
index=5,
index=1,
)

decoy.when(mock_run_orchestrator_store.current_run_id).then_return(run_id)
Expand Down Expand Up @@ -1084,7 +1084,7 @@ def test_get_last_completed_command_not_current_run(
command_id="command-id-1",
command_key="command-key",
created_at=datetime(year=2021, month=1, day=1),
index=0,
index=1,
)

decoy.when(mock_run_orchestrator_store.current_run_id).then_return(
Expand Down

0 comments on commit 7f53850

Please sign in to comment.