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(api): Split CommandStore #14647

Closed
wants to merge 13 commits into from

Conversation

SyntaxColoring
Copy link
Contributor

@SyntaxColoring SyntaxColoring commented Mar 13, 2024

Background

This file has been a bit uncomfortably bloated for a while. It's responsible for at least two broad areas:

  1. Run-level concerns, like getting "the overall run error," or choosing "the next command to execute."
  2. Lower-level data organization concerns, to support stuff like O(1) retrieval of a command by its ID, or O(1) retrieval of the next queued command.

The other problem is that it uses the old test style of splitting the store from the view. This creates thousands of lines of tests that don't pull their weight in catching bugs, and, I find, make it harder to work on this file.

All of this has contributed to maintenance problems (here are apparently two different ways of computing the same thing, for example), and performance problems past and ongoing.

This is going to get worse because of error recovery, which will add new run states and maybe command states.

So, the plan here is:

  • Pull the lower-level data organization stuff out into its own data structure. Its responsibility will be to provide O(1) access to commands, without relying on knowledge of higher-level things like runs.
  • That single type will take over for at least these fields in CommandState.
  • Unit-test as a pure functional black box.

Test Plan

Changelog

Review requests

Risk assessment

@SyntaxColoring
Copy link
Contributor Author

Closing for now to prioritize other things.

@SyntaxColoring SyntaxColoring deleted the refactor_command_data_structures branch August 2, 2024 16:41
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.

1 participant