Reuse supplied artifacts during incremental analysis

This commit is contained in:
2026-12-02 15:16:40 +00:00
parent 93c8695250
commit 9367c7b713
8 changed files with 161 additions and 7 deletions

View File

@@ -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
}