Skip to content

refactor(rds): extract build_restored_instance from restore_db_instance_from_db_snapshot#348

Merged
vieiralucas merged 1 commit intomainfrom
worktree-cleanup-rds-restore-from-snapshot
Apr 13, 2026
Merged

refactor(rds): extract build_restored_instance from restore_db_instance_from_db_snapshot#348
vieiralucas merged 1 commit intomainfrom
worktree-cleanup-rds-restore-from-snapshot

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 13, 2026

Summary

Mirror of PR #347's `build_read_replica_instance` extraction for the restore-from-snapshot path. The 30-field `DbInstance` literal inside `restore_db_instance_from_db_snapshot` was the one block not belonging in the async flow (snapshot lookup → ensure container → restore dump → register in state); extract it as `build_restored_instance` so the outer function reads as the sequence of phases it actually is.

Test plan

  • `cargo fmt`
  • `cargo clippy --workspace --all-targets -- -D warnings`
  • `cargo test --workspace --exclude fakecloud-e2e --exclude fakecloud-conformance`

Summary by cubic

Extracted build_restored_instance from restore_db_instance_from_db_snapshot to encapsulate building a restored DbInstance from a snapshot and running container. Mirrors build_read_replica_instance and simplifies the async restore flow with no behavior changes.

Written for commit b288db7. Summary will update on new commits.

Mirror the build_read_replica_instance extraction from PR #347 for the
restore-from-snapshot path. The 30-field DbInstance literal inside
restore_db_instance_from_db_snapshot no longer interrupts the async
control flow (snapshot lookup → spin up container → restore dump →
register in state).
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@vieiralucas vieiralucas merged commit 063499c into main Apr 13, 2026
22 checks passed
@vieiralucas vieiralucas deleted the worktree-cleanup-rds-restore-from-snapshot branch April 13, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant