Unify previous source resolution
This commit is contained in:
@@ -51,6 +51,7 @@ type RestoreAction struct {
|
||||
Conflict bool
|
||||
ConflictKind RestoreConflictKind
|
||||
Reason string
|
||||
VerifiedContent []byte
|
||||
}
|
||||
|
||||
// RestorePlan is the deterministic output of restore planning.
|
||||
@@ -159,6 +160,9 @@ func buildCommittedRestoreActions(
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("classify committed object %q: %w", artifact.DestinationKey, err)
|
||||
}
|
||||
if artifact.Type == artifacts.RemoteArtifactTypeSessionManifest && artifact.DestinationKey == current.CurrentManifestKey {
|
||||
action.VerifiedContent = append([]byte(nil), current.ManifestData...)
|
||||
}
|
||||
actions = append(actions, action)
|
||||
}
|
||||
return actions, nil
|
||||
@@ -343,7 +347,7 @@ func buildPreviousCacheRestoreActions(
|
||||
if len(requirements) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
plan, err := previouscache.BuildPlan(ctx, cfg, sessionPaths, requirements, store)
|
||||
plan, err := previouscache.Resolve(ctx, cfg, sessionPaths, requirements, store)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("plan previous-session cache restore: %w", err)
|
||||
}
|
||||
@@ -355,6 +359,7 @@ func buildPreviousCacheRestoreActions(
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("classify previous-session cache object %q: %w", record.RemoteKey, err)
|
||||
}
|
||||
action.VerifiedContent = append([]byte(nil), record.VerifiedContent...)
|
||||
actions = append(actions, action)
|
||||
}
|
||||
return actions, nil
|
||||
|
||||
Reference in New Issue
Block a user