Reuse party provenance within each inspection

This commit is contained in:
2026-11-18 04:10:29 +00:00
parent 0e34ea1d48
commit f85f93bdfb
3 changed files with 55 additions and 36 deletions

View File

@@ -122,6 +122,7 @@ func EffectivePipelineSources(cfg *PipelineConfig, party ResolvedParty) ([]Effec
return nil, err
}
families := ArtifactFamilies(cfg)
partySources := partyCharacterSourceLookup(party)
publishCount := 0
if cfg.Publish != nil {
publishCount = len(cfg.Publish.Outputs)
@@ -132,7 +133,7 @@ func EffectivePipelineSources(cfg *PipelineConfig, party ResolvedParty) ([]Effec
continue
}
if familyKey, ok := generatedArtifactFamilyForPath(path, families); ok {
records = appendGeneratedArtifactSources(records, path, familyKey, families, owners, party)
records = appendGeneratedArtifactSources(records, path, familyKey, families, owners, partySources)
continue
}
records = appendPipelineOwners(records, path, owners[path], cfg)
@@ -334,7 +335,7 @@ func generatedArtifactFamilyForPath(path string, families ArtifactFamilyCatalog)
return member.Family, exists
}
func appendGeneratedArtifactSources(records []EffectivePipelineSourceRecord, path, familyKey string, families ArtifactFamilyCatalog, owners map[string][]string, party ResolvedParty) []EffectivePipelineSourceRecord {
func appendGeneratedArtifactSources(records []EffectivePipelineSourceRecord, path, familyKey string, families ArtifactFamilyCatalog, owners map[string][]string, partySources func(string) []string) []EffectivePipelineSourceRecord {
for _, source := range generatedArtifactSources(path, familyKey, families, owners) {
role := "family"
if source == pipelineDefaultOwnershipSource {
@@ -344,7 +345,7 @@ func appendGeneratedArtifactSources(records []EffectivePipelineSourceRecord, pat
}
memberPath := strings.TrimPrefix(path, "scriptorium.artifacts.")
memberKey, _, _ := strings.Cut(memberPath, ".")
for _, source := range partyCharacterSources(party, families.Members[memberKey].CharacterID) {
for _, source := range partySources(families.Members[memberKey].CharacterID) {
records = append(records, EffectivePipelineSourceRecord{Path: path, Role: "party", Source: normalizedProvenancePath(source)})
}
return records