Repository navigation
[03/03] service-backup: stage and restore BackupSets idempotently with service-owned validation - #64
Open
chrischeng-c4 wants to merge 1 commit into
Open
chrischeng-c4 wants to merge 1 commit into
chrischeng-c4 wants to merge 1 commit into
Conversation
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.
Closes #18
Summary of Changes
Implement the pure domain logic for BackupSet restore progress tracking as scoped in #18:
RestoreLedger): AddedRestoreLedger,ArtifactStage(Pending,Verified,Applied),RestorePhase(Staging,Applying,Committed),ResumePoint(Fresh,Continue,AlreadyCommitted), andArtifactEntryundercrates/service-backup/src/domain/restore_ledger.rs.RestoreLedgerError): Added typed error enumRestoreLedgerErrorundercrates/service-backup/src/domain/restore_ledger_error.rscovering invalid input, illegal artifact and phase transitions, unverified/unapplied sets,ConflictingSetconflicts carrying both IDs, and inconsistent deserialized phases.crates/service-backup/src/domain.rsandcrates/service-backup/src/lib.rs.RestoreLedger::beginvalidates set ID, manifest digest format, and artifact bounds.mark_verified,begin_apply,mark_applied, andcommitleave state unchanged on error and allow idempotent repeats.resumeandresume_or_beginidentify matching vs conflicting sets."version": 1, 1 MiB limit, camelCase fields, anddeny_unknown_fields.crates/service-backup/tests/it/restore_ledger.rsregistered intests/it/main.rs..as_bytes().len()call intests/it/projected_admin_transport.rsto satisfy clippy warnings.Local Test Results
cargo fmt -p service-backup -- --check: passedcargo clippy --locked -p service-backup --all-features --all-targets --no-deps -- -D warnings: passed (0 warnings)cargo check --locked -p service-backup --all-features --all-targets: passedcargo test --locked -p service-backup --test it restore_ledger: 9 passed, 0 failed, 0 ignoredcargo test --locked -p service-backup --test it: 25 passed, 0 failedCloud CI Status (MR Gates)
crate-gates(cargo test --locked -p service-backup --features http-client): PENDING cloud CI runner execution on PR head