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

refactor(app): refactor command text out of CommandText #15708

Merged
merged 3 commits into from
Jul 19, 2024

Conversation

mjhuff
Copy link
Contributor

@mjhuff mjhuff commented Jul 18, 2024

Closes EXEC-575

Overview

Works towards EXEC-574.

Decouple the logic that generates command text from the component that renders it. There was a good bit of cruft, translation files were in different places instead of the correct place, and a large number of missing string generator util functions were missing, so this PR adds/cleans up those instances.

There's one small non-functional change: the primary string generator hook, useCommandTextString, now supports an optional CommandTextData, whereas this variable was required before. Half the time we were accounting for the null case when string building, and half the time we weren't, so let's just make all string builders handle the null case and make useCommandTextString a bit more flexible (which will come in handy with Error Recovery, soon!) .

Test Plan

  • We're covered by existing tests. These tests exist in CommandText, which is not the best place for them now, but I've added a TODO to clean up the testing later.
  • Smoke tested a protocol and everything looks nice.
  • Looked at a lot of active runs on robots around the office and ensured command text was correct.

Risk assessment

low

Decouple the logic that generates command text from the component that renders it.
@mjhuff mjhuff requested a review from a team July 18, 2024 19:43
@mjhuff mjhuff requested a review from a team as a code owner July 18, 2024 19:43
@mjhuff mjhuff requested review from jerader, a team, jbleon95, Elyorcv, koji and ncdiehl11 and removed request for a team, jerader, jbleon95 and Elyorcv July 18, 2024 19:43
@mjhuff
Copy link
Contributor Author

mjhuff commented Jul 18, 2024

Tagging auth for visibility as well, since this impacts run preview stuff (which maybe is AUTH or maybe it's EXEC idk)...I eventually figured out how to tag them 😎

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 really good but I think we can enhance the types even farther

Copy link
Collaborator

@jerader jerader left a comment

Choose a reason for hiding this comment

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

i like it

@mjhuff mjhuff force-pushed the app_refactor-command-text branch from f7936ca to b8e53a1 Compare July 19, 2024 13:30
@mjhuff mjhuff merged commit fdbf10c into edge Jul 19, 2024
30 checks passed
@mjhuff mjhuff deleted the app_refactor-command-text branch July 19, 2024 13:50
mjhuff added a commit that referenced this pull request Jul 31, 2024
Explicitly handle the null command case to prevent warnings. The intention of useCommandTextString after #15708 is to support null commands, so this change genuinely implements the desired behavior.
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.

3 participants