-
Notifications
You must be signed in to change notification settings - Fork 558
StagingMode: Checkpoints for partial rollbacks #25817
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR implements checkpoint functionality within staging mode, enabling granular rollback control for staged changes. Checkpoints allow users to mark specific points in their staged changes and selectively roll back to the most recent checkpoint using a stack-based (LIFO) approach.
- Adds
checkpoint(),rollbackCheckpoint(), andcheckpointCountto theStageControlsAlphainterface - Implements checkpoint management using a message count-based tracking system
- Updates
orderSequentiallyto use the new checkpoint-based rollback instead of the previousIBatchCheckpointapproach
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/runtime/runtime-definitions/src/stagingMode.ts | Adds comprehensive API documentation for checkpoint methods on StageControlsAlpha interface |
| packages/runtime/runtime-definitions/api-report/runtime-definitions.legacy.alpha.api.md | Updates API surface to include new checkpoint properties and methods |
| packages/runtime/container-runtime/src/containerRuntime.ts | Implements checkpoint/rollback logic using a stack-based message count tracking system |
| packages/runtime/container-runtime/src/pendingStateManager.ts | Adds popStagedMessagesUpToCount method to support partial rollback of staged messages |
| packages/runtime/container-runtime/src/test/containerRuntime.spec.ts | Adds comprehensive unit tests for checkpoint creation, tracking, and rollback scenarios |
| packages/test/local-server-tests/src/test/stagingMode.spec.ts | Adds integration tests covering checkpoint usage with DDS operations, remote changes, and disconnection scenarios |
| packages/test/local-server-stress-tests/src/stressDataObject.ts | Adds checkpoint operation interfaces and methods to support stress testing |
| packages/test/local-server-stress-tests/src/baseModel.ts | Integrates checkpoint operations into the stress test model with appropriate preconditions |
…to sm-checkpoints
…to sm-checkpoints
|
🔗 Found some broken links! 💔 Run a link check locally to find them. See linkcheck output |
This pull request introduces granular checkpointing and rollback capabilities to the container runtime's staging mode, allowing developers to mark, track, and selectively revert sets of staged changes. It also adds comprehensive tests and updates the staging mode interface and stress test infrastructure to support these new features.
New checkpointing and rollback functionality in staging mode:
StageControlsAlphaand its implementations, allowing users to create, count, and roll back to specific checkpoints within a staging session. Checkpoints are managed as a stack, enabling LIFO rollback of staged changes. Empty and duplicate checkpoints are avoided, and all are cleared when staging mode is exited.ContainerRuntime, including flushing outbox messages to the PendingStateManager and rolling back only the changes made after the most recent checkpoint.popStagedMessagesUpToCounttoPendingStateManagerto efficiently revert only the staged messages added since a checkpoint.Testing and validation:
containerRuntime.spec.ts. These tests ensure correct checkpointing, rollback order, stack size, and robustness to no-ops or empty checkpoints.Stress test infrastructure updates:
API and type updates:
StageControlsAlphaand related types with new methods and detailed documentation for checkpointing and rollback, clarifying their intended use and behavior.