Reject unsupported session state before execution and restore
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/artifacts"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/config"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/manifest"
|
||||
"go.maximumdirect.net/commandkit"
|
||||
)
|
||||
|
||||
@@ -59,6 +60,10 @@ func restoreSessionState(ctx context.Context, cfg *config.Config, opts RestorePl
|
||||
if err != nil {
|
||||
return diagnostic, fmt.Errorf("restore: %w", err)
|
||||
}
|
||||
manifestPath := artifacts.SessionManifestPathForCampaign(cfg.Pipeline.Workspace.Root, cfg.Session.Campaign, cfg.Session.SessionID)
|
||||
if _, _, err := loadManifestAtPathIfPresent(ctx, &manifest.LocalStore{}, manifestPath); err != nil {
|
||||
return diagnostic, fmt.Errorf("restore: %w", err)
|
||||
}
|
||||
if opts.DryRun {
|
||||
plan, err := deps.buildRestorePlan(ctx, cfg, current, objectStore, RestorePlanOptions{
|
||||
IncludeAudio: opts.IncludeAudio,
|
||||
@@ -97,6 +102,9 @@ func restoreSessionState(ctx context.Context, cfg *config.Config, opts RestorePl
|
||||
}
|
||||
}
|
||||
}()
|
||||
if _, _, err := loadManifestAtPathIfPresent(ctx, &manifest.LocalStore{}, manifestPath); err != nil {
|
||||
return diagnostic, fmt.Errorf("restore: %w", err)
|
||||
}
|
||||
|
||||
// Classification and installation share the same transition lock as a
|
||||
// runner. This prevents a runner from making reuse decisions against state
|
||||
|
||||
Reference in New Issue
Block a user