MCPcopy Create free account
hub / github.com/conforma/cli / buildVSAReport

Function buildVSAReport

cmd/validate/vsa.go:1529–1548  ·  view source on GitHub ↗

buildVSAReport creates a VSAReport with optional fallback

(display ComponentResultsDisplay, allData AllSectionsData, data *validateVSAData)

Source from the content-addressed store, hash-verified

1527
1528// buildVSAReport creates a VSAReport with optional fallback
1529func buildVSAReport(display ComponentResultsDisplay, allData AllSectionsData, data *validateVSAData) (VSAReport, error) {
1530 vsaSections := display.toVSASectionsReport()
1531 report := VSAReport{
1532 Header: vsaSections.Header,
1533 Result: vsaSections.Result,
1534 VSASummary: vsaSections.VSASummary,
1535 PolicyDiff: vsaSections.PolicyDiff,
1536 Fallback: nil,
1537 }
1538
1539 if allData.FallbackUsed {
1540 fallbackReport, err := createFallbackReport(allData, data)
1541 if err != nil {
1542 return VSAReport{}, fmt.Errorf("failed to create fallback report: %w", err)
1543 }
1544 report.Fallback = fallbackReport
1545 }
1546
1547 return report, nil
1548}
1549
1550// writeSeparateOutputToStdout writes VSA and fallback results separately to stdout
1551func writeSeparateOutputToStdout(display ComponentResultsDisplay, allData AllSectionsData, data *validateVSAData, outputFormats []string, cmd *cobra.Command) error {

Callers 1

Calls 3

createFallbackReportFunction · 0.85
toVSASectionsReportMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected