Skip to content

Add --dry-run flag to restore#344

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
feature/restore-dry-run
Jul 9, 2026
Merged

Add --dry-run flag to restore#344
AndreyVMarkelov merged 1 commit into
masterfrom
feature/restore-dry-run

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a --dry-run flag to dbxcli restore, matching the convention already used by mkdir, rm, mv, and cp.

  • Text output: prints Would restore <path> to revision <rev> without calling the Dropbox API.
  • JSON output: reports status planned with dry_run=true in the result input.
  • Manifest, JSON contract test, and golden schema updated in lockstep; regenerated docs/schemas show no drift.

Also extracts a small plannedMetadata(kind, path) helper into dry_run.go that synthesizes a jsonMetadata from a path/kind, and routes mkdir's planned result through it to remove duplicated literal construction.

Preview the intended restore without calling the Dropbox API: text
output prints "Would restore <path> to revision <rev>" and JSON reports
status "planned" with dry_run=true in the result input.

Extract plannedMetadata() into dry_run.go to synthesize a jsonMetadata
from a path/kind, and route mkdir's planned result through it.
@AndreyVMarkelov AndreyVMarkelov merged commit 67da8cc into master Jul 9, 2026
13 checks passed
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