[0 BOUNTY] [Python] Add dry-run restore validation to legacy migration tool - #133
Open
Saiaaax wants to merge 2 commits into
Open
[0 BOUNTY] [Python] Add dry-run restore validation to legacy migration tool#133Saiaaax wants to merge 2 commits into
Saiaaax wants to merge 2 commits into
Conversation
…n tool - Add DryRunRestoreResult dataclass with structured error reporting - Implement dry_run_restore_validation() function with checks for: - Backup directory presence (BACKUP_NOT_FOUND) - Manifest file presence (MANIFEST_MISSING) - Valid manifest JSON (MANIFEST_INVALID) - Schema version compatibility (SCHEMA_MISMATCH, SCHEMA_UNKNOWN, SCHEMA_UNSUPPORTED) - Referenced data file existence (DATA_FILES_MISSING) - Row-count and checksum metadata extraction - Add 'dry-run-restore' CLI subcommand - Add 12 unit tests covering all acceptance criteria - Update OPERATIONS.md with dry-run restore validation docs Closes #20
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.
Summary
Implements a dry-run restore validation path for the legacy migration tool (
tools/legacy_migration.py) that checks backup presence, target compatibility, and expected row-count/checksum metadata without modifying production data.Closes #20
Changes
DryRunRestoreResultdataclass — Structured result withvalid,errors,warnings,row_counts,checksums,schema_version,target_compatible,backup_present, andmetadatafieldsdry_run_restore_validation()function — Performs 5 validation checks:BACKUP_NOT_FOUND)MANIFEST_MISSING,MANIFEST_INVALID)SCHEMA_MISMATCH,SCHEMA_UNKNOWN,SCHEMA_UNSUPPORTED)DATA_FILES_MISSING)dry-run-restoreCLI subcommand —python3 legacy_migration.py dry-run-restore --backup-dir DIR --migration-id ID [--target-schema-version VER]tests/test_dryrun_restore.py— 12 unit tests covering:docs/OPERATIONS.md— Added "Dry-Run Restore Validation" section with usage, validation checks table, and supported schema versionsTesting
Build diagnostic:
python3 build.py -m backend,market,frailbox # diagnostic/build-db991709.logd generatedChecklist
Payout address: 0x5253757322092903C2F0a8EfEed592344216CC7E
Diagnostic artifact reference: diagnostic/build-db991709.logd