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

docs(robot-server): Correct and unify the definition of "current" #15223

Merged
merged 3 commits into from
May 20, 2024

Conversation

SyntaxColoring
Copy link
Contributor

Overview

This tries to resolve some confusion around the cursor query parameter and links.current field in the GET /runs/{id}/commands and GET /maintenance_runs/{id}/commands endpoints.

Test plan

None needed.

Changelog

links.current is a bit confusing:

  • The public OpenAPI spec says that it returns the command that's currently running or next queued.
  • The docstring on the internal low-level Python code says that it returns the command that's currently running or most recently completed.
  • The Python implementation appears to actually return the command that's currently running or most recently completed.

Compare with the cursor query param of GET /runs/{id}/commands, which appears consistent about returning the currently running or most recently completed command.

This PR changes the OpenAPI spec of links.current to say it's the currently running or most recently completed command. This unifies everything. I'm working under the premise that this reflects what we have now, and it's working fine, and we have no reason to change it.

Review requests

Am I misreading the StateView.get_slice() and StateView.get_current() implementation logic and misunderstanding the current behavior?

If this is the current behavior, is my premise correct that it's fine and we have no reason to change it?

Risk assessment

No risk.

@SyntaxColoring SyntaxColoring requested a review from a team as a code owner May 20, 2024 14:50
@SyntaxColoring SyntaxColoring requested review from a team May 20, 2024 14:50
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.

Looks good to me, I agree that the implementation is to return the most recently executed command.

@SyntaxColoring SyntaxColoring merged commit 343454c into edge May 20, 2024
21 checks passed
@SyntaxColoring SyntaxColoring deleted the unify_definition_of_current branch May 20, 2024 15:43
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.

2 participants