-
Notifications
You must be signed in to change notification settings - Fork 65
[3/n] [reconfigurator-sim] add an operation log #9365
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
[3/n] [reconfigurator-sim] add an operation log #9365
Conversation
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
| /// | ||
| /// Clears all operation history and resets to just the root operation. | ||
| /// This is the only operation that violates the append-only principle. | ||
| Wipe, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking my understanding: Is the difference between op wipe and wipe {system,all} that the latter two are themselves operations appended to the log (that wipe the simulated state but can be undone/redone), and the former erases the log itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, yeah. The operation log is the root of everything so this is a higher-level wipe.
| } | ||
|
|
||
| // Invariant: the ID should be not present in the store, having been | ||
| // generated by next_sim_uuid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still required, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, good catch.
Created using spr 1.3.6-beta.1
Add an operation log to the simulator, as well as ways to undo, redo and restore to the last operation. Modeled pretty directly after how Jujutsu's operation log works.
The biggest change here is that the current pointer is now managed by the simulator rather than reconfigurator-cli, so that it can be versioned as part of the operation.
Depends on: