Preserve composite ConfigKit provenance
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -44,31 +43,6 @@ func finalizePipelineResolution(cfg *PipelineConfig) error {
|
||||
if cfg == nil || cfg.resolution == nil {
|
||||
return fmt.Errorf("pipeline resolution metadata is required")
|
||||
}
|
||||
declared := make(map[string][]string, len(cfg.resolution.ownership))
|
||||
for _, ownership := range cfg.resolution.ownership {
|
||||
declared[ownership.path] = append([]string(nil), ownership.sources...)
|
||||
}
|
||||
records, err := projectionValueRecords(projectEffectivePipeline(cfg, true))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ownership := make([]pipelineFieldOwnership, 0, len(records))
|
||||
for _, record := range records {
|
||||
sources := declared[record.Path]
|
||||
if len(sources) == 0 {
|
||||
sources = []string{pipelineDefaultOwnershipSource}
|
||||
}
|
||||
ownership = append(ownership, pipelineFieldOwnership{
|
||||
path: record.Path, sources: append([]string(nil), sources...),
|
||||
})
|
||||
}
|
||||
for path, sources := range declared {
|
||||
if strings.HasPrefix(path, "scriptorium.artifact_families.") {
|
||||
ownership = append(ownership, pipelineFieldOwnership{path: path, sources: append([]string(nil), sources...)})
|
||||
}
|
||||
}
|
||||
sort.Slice(ownership, func(i, j int) bool { return ownership[i].path < ownership[j].path })
|
||||
cfg.resolution.ownership = ownership
|
||||
return recomputePipelineEffectiveDigest(cfg)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user