Closes #687 - #841
Open
mansur-codes wants to merge 2 commits into
Open
Conversation
…able - Add DeploymentCheckpointManager with atomic JSON persistence - Add session key derivation with WASM content hash for staleness detection - Add corrupted/schema-mismatch checkpoint recovery - Add file locking to prevent concurrent deployment runs - Add --fresh/--force flags to deployment-automate run command - Add resumability to deploy_orchestrator for multi-contract stacks - Add 9 automated tests covering primary flow, resume, idempotency, and failure cases - Add docs/DEPLOYMENT_CHECKPOINTS.md - Fix pre-existing formatting issues across codebase (cargo fmt)
|
@mansur-codes Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements idempotent and resumable deployment operations for StarForge. Deployment pipelines now persist checkpoints after each successful step, allowing interrupted deployments to safely resume from the last completed step without repeating already-succeeded work. Re-running a fully completed deployment is a safe no-op.
Closes #687
Type of Change
Changes Made
DeploymentCheckpointManagerwith atomic JSON persistence (temp-file + rename) to prevent corruption on interruptschema_versionfield to checkpoint files for forward compatibility and migration detection.lockfiles with 10-minute staleness detection) to prevent concurrent deployment runs--fresh/--forceflags tostarforge deployment-automate runto bypass existing checkpointsdeployment_automation.rs— each of the 5 pipeline steps checks the checkpoint before executingdeploy_orchestrator.rsfor multi-contract stack deploymentsdocs/DEPLOYMENT_CHECKPOINTS.md— full user and developer guide covering architecture, CLI flags, security, and schema versioningcargo fmt)Testing
How has this been tested?
Test Coverage
New test file:
tests/deployment_checkpoint_resumability.rs— 9 tests covering:test_primary_deployment_flow_creates_checkpoint— full run creates valid checkpoint;test_idempotent_reexecution— re-running a completed deployment returns immediately as no-optest_interrupted_deployment_resumes_from_checkpoint— steps 1 & 2 pre-populated, pipeline resumes at step 3 without re-running completed steps;test_wasm_content_change_triggers_staleness_reset— modified WASM binary invalidates existing checkpoint;test_orchestrate_resumability_and_idempotency— multi-contract stack skips already-deployed contractstest_fast_fail_invalid_inputs_and_unsupported_network— invalid WASM path or unsupported network fails fast before touching checkpoint state;test_corrupted_checkpoint_recovery— invalid JSON in checkpoint file is discarded and treated as fresh run;test_schema_version_mismatch_resets— unknown schema version triggers fresh run with warning;test_concurrency_lock_prevents_duplicate_run— second process attempting same session is rejected with clear errorCode Quality Checklist
cargo fmt)cargo clippy -- -D warnings)Breaking Changes
Documentation
docs/DEPLOYMENT_CHECKPOINTS.mdadded covering architecture, CLI usage, security notes, and schema versioningAdditional Context
Checkpoint files are persisted under
~/.starforge/checkpoints/<session_key>.json. Sensitive data (private keys, seed phrases) is explicitly excluded from checkpoint state. Checkpoint directory is created with0700permissions and individual files with0600permissions on Unix systems.The
--freshand--forceflags are aliases — both force a clean run ignoring any existing checkpoint for the session.