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(app,robot-server): Subscribe to currentlyRecoveringFrom notifications #15242

Merged
merged 10 commits into from
May 28, 2024

Conversation

SyntaxColoring
Copy link
Contributor

@SyntaxColoring SyntaxColoring commented May 21, 2024

Overview

Closes EXEC-458.

Test plan

  1. Push robot-server and ODD to a Flex
  2. Induce a pickUpTip failure
  3. Make sure the ODD goes into recovery mode when the pickUpTip failure happens
  4. Make sure both recovery options work

And maybe check the app or server logs to make sure it doesn't spam network requests, especially when notifications are unavailable.

Changelog

  • Generalize the ...current_command MQTT topic, which was "the equivalent of GET /runs/:runId/commands?cursor=null&pageLength=1, to ...command_links, which is the equivalent of the links field of any GET /runs/:runId/commands query.
  • Update the frontend to take advantage of that. When it sees links update with a new currentlyRecoveringFrom command ID, it will do a separate GET /runs/{id}/commands/{id} query to fetch the full details of the command.

Review requests

Several frontend questions because I don't know what I'm doing there. See my GitHub comments below.

Risk assessment

Probably at least a medium risk of breaking recent unreleased work (#15170). Although we can cover these notifications hooks with tests, it doesn't look like those tests are in a good position to make sure the UI is actually doing the correct thing overall.

* Mark `RunHooks` and `EngineStateSlice` as private.
* Rename `initialize()` to `start_publishing_for_run()`, because "initialize" was reading to me like a one-time thing for the instance.
* Remove unused attributes.
* Use "new" instead of "current" in variable names, because "current" already has a different meaning in "current command" and "currently recovering from."
For symmetry with how the field is named in the HTTP response.
@SyntaxColoring SyntaxColoring marked this pull request as ready for review May 22, 2024 20:21
@SyntaxColoring SyntaxColoring requested review from a team as code owners May 22, 2024 20:21
@SyntaxColoring SyntaxColoring requested review from ncdiehl11, mjhuff and a team and removed request for a team May 22, 2024 20:21
Copy link
Contributor

@mjhuff mjhuff left a comment

Choose a reason for hiding this comment

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

Sorry, I forgot to submit these comments!

This looks great overall. Just a few things to fix.

Copy link
Contributor

@mjhuff mjhuff left a comment

Choose a reason for hiding this comment

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

Nice job, thank you for implementing this!

@SyntaxColoring
Copy link
Contributor Author

I'll probably test this on Monday and merge it then, assuming all goes well.

@SyntaxColoring SyntaxColoring merged commit 786bcf3 into edge May 28, 2024
40 checks passed
@SyntaxColoring SyntaxColoring deleted the notify_current_recovery_target branch May 28, 2024 14:31
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