Run report generation through module snapshots

This commit is contained in:
2026-06-09 21:12:13 +00:00
parent 0b516d9762
commit 479d144592
4 changed files with 121 additions and 31 deletions

View File

@@ -35,22 +35,26 @@ type Metadata struct {
}
func BuildMetadata(resolved report.Resolved, briefingPackage briefing.Package, paths ArtifactPaths) Metadata {
return BuildMetadataFromBriefingMetadata(resolved, briefingPackage.Metadata, paths)
}
func BuildMetadataFromBriefingMetadata(resolved report.Resolved, briefingMetadata briefing.Metadata, paths ArtifactPaths) Metadata {
metadata := resolved.Metadata()
return Metadata{
SchemaVersion: MetadataSchemaVersion,
RunID: metadata.RunID,
MetadataPath: paths.Metadata,
ReportID: metadata.ReportID,
Variant: briefingPackage.Metadata.Variant,
Variant: briefingMetadata.Variant,
PromptID: metadata.PromptID,
GeneratedAt: metadata.GeneratedAt,
Timezone: metadata.Timezone,
ValidPeriod: metadata.ValidPeriod,
Location: copyLocation(briefingPackage.Metadata.Location),
SourceLocationID: briefingPackage.Metadata.SourceLocationID,
SourceLocation: briefingPackage.Metadata.SourceLocation,
Sources: briefingPackage.Metadata.Sources,
SourceWarnings: briefingPackage.Metadata.SourceWarnings,
Location: copyLocation(briefingMetadata.Location),
SourceLocationID: briefingMetadata.SourceLocationID,
SourceLocation: briefingMetadata.SourceLocation,
Sources: briefingMetadata.Sources,
SourceWarnings: briefingMetadata.SourceWarnings,
BriefingPath: paths.Briefing,
ModuleSnapshotPath: paths.ModuleSnapshot,
DataPackagePath: paths.DataPackage,