Implement remote current-state discovery for the restore subcommand
This commit is contained in:
@@ -11,6 +11,9 @@ import (
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/config"
|
||||
)
|
||||
|
||||
var newObjectStoreFromConfigFn = storage.NewObjectStoreFromConfig
|
||||
var discoverRemoteCurrentStateFn = discoverRemoteCurrentState
|
||||
|
||||
// Restore validates restore CLI/config inputs and storage preflight for future restore phases.
|
||||
func Restore(ctx context.Context, args []string, out io.Writer) error {
|
||||
fs := flag.NewFlagSet("restore", flag.ContinueOnError)
|
||||
@@ -63,14 +66,23 @@ func Restore(ctx context.Context, args []string, out io.Writer) error {
|
||||
return fmt.Errorf("restore: %w", err)
|
||||
}
|
||||
|
||||
_, err = storage.NewObjectStoreFromConfig(ctx, cfg)
|
||||
objectStore, err := newObjectStoreFromConfigFn(ctx, cfg)
|
||||
if err != nil {
|
||||
return fmt.Errorf("restore: %w", err)
|
||||
}
|
||||
current, err := discoverRemoteCurrentStateFn(ctx, cfg, objectStore)
|
||||
if err != nil {
|
||||
return fmt.Errorf("restore: %w", err)
|
||||
}
|
||||
|
||||
// Phase 2 boundary: command wiring and preflight only.
|
||||
// Phase 3 boundary: discovery is implemented; planning/execution is deferred.
|
||||
_ = dryRun
|
||||
_ = force
|
||||
_ = includeAudio
|
||||
return fmt.Errorf("restore: not yet implemented (phase 3: remote current-state discovery)")
|
||||
return fmt.Errorf(
|
||||
"restore: discovered remote current state for %s/%s (run %s); not yet implemented (phase 3: remote current-state discovery)",
|
||||
current.Campaign,
|
||||
current.SessionID,
|
||||
current.RunID,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user