Reuse supplied artifacts during incremental analysis
This commit is contained in:
@@ -17,6 +17,18 @@ func checkpointStageCollection(
|
||||
live *manifest.Manifest,
|
||||
stageName string,
|
||||
update func(*manifest.StageRecord) error,
|
||||
) error {
|
||||
return checkpointStageCollectionRetiring(ctx, store, path, live, stageName, nil, update)
|
||||
}
|
||||
|
||||
func checkpointStageCollectionRetiring(
|
||||
ctx context.Context,
|
||||
store manifest.Store,
|
||||
path string,
|
||||
live *manifest.Manifest,
|
||||
stageName string,
|
||||
retired []string,
|
||||
update func(*manifest.StageRecord) error,
|
||||
) error {
|
||||
if live == nil {
|
||||
return fmt.Errorf("session manifest is required")
|
||||
@@ -29,6 +41,11 @@ func checkpointStageCollection(
|
||||
}
|
||||
|
||||
candidate := cloneManifestForCheckpoint(live)
|
||||
if candidate.SuppliedProducts != nil {
|
||||
for _, source := range retired {
|
||||
delete(candidate.SuppliedProducts.Products, source)
|
||||
}
|
||||
}
|
||||
if candidate.Stages == nil {
|
||||
candidate.Stages = make(map[string]*manifest.StageRecord)
|
||||
}
|
||||
@@ -63,6 +80,9 @@ func checkpointStageCollection(
|
||||
live.Stages = map[string]*manifest.StageRecord{stageName: savedRecord}
|
||||
}
|
||||
live.UpdatedAt = candidate.UpdatedAt
|
||||
if len(retired) != 0 {
|
||||
live.SuppliedProducts = manifest.CloneSuppliedProducts(candidate.SuppliedProducts)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user