Resolve supplied products from local records

This commit is contained in:
2026-12-02 15:13:04 +00:00
parent eb146d3298
commit 93c8695250
10 changed files with 235 additions and 12 deletions

View File

@@ -187,6 +187,14 @@ func ResolveSessionArtifact(paths SessionPaths, m *manifest.Manifest, source str
return ResolvedSessionArtifact{}, err
}
spec := artifactRegistry[id]
if m != nil && m.SuppliedProducts != nil {
if record, ok := m.SuppliedProducts.Products[id]; ok {
if err := ValidateSuppliedProduct(paths, id, spec.CanonicalRelPath, record); err != nil {
return ResolvedSessionArtifact{}, fmt.Errorf("validate supplied %q: %w", id, err)
}
return ResolvedSessionArtifact{ID: id, Path: filepath.Join(paths.Root, filepath.FromSlash(record.Path)), ProducerStage: spec.ProducerStage, OutputKind: spec.OutputKind, Provenance: ArtifactProvenanceSupplied, Contract: cloneArtifactContract(record.Contract), Checksum: record.Checksum, Size: record.Size}, nil
}
}
candidate, err := manifestArtifactCandidate(paths, m, spec)
if err != nil {