From d923a1832894a779dc350ff1069cacc2937c0d42 Mon Sep 17 00:00:00 2001 From: Constantino Antunes Date: Tue, 15 Mar 2022 14:50:15 +0000 Subject: [PATCH] AST-10757: transform report --- internal/process.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/process.go b/internal/process.go index 29ac8bc..0de33d5 100644 --- a/internal/process.go +++ b/internal/process.go @@ -478,7 +478,13 @@ func consumeReports(client rest.Client, exporter export2.Exporter, workerID int, } } // export report - exportErr := exporter.AddFile(fmt.Sprintf(scansFileName, reportJob.ProjectID), reportData) + transformedReportData, transformErr := export2.TransformScanReport(reportData) + if transformErr != nil { + l.Debug().Err(transformErr).Msg("failed transforming report data") + done <- ReportConsumeOutput{Err: transformErr, ProjectID: reportJob.ProjectID, ScanID: reportJob.ScanID} + continue + } + exportErr := exporter.AddFile(fmt.Sprintf(scansFileName, reportJob.ProjectID), transformedReportData) if exportErr != nil { l.Debug().Err(exportErr).Msg("failed saving result") done <- ReportConsumeOutput{Err: exportErr, ProjectID: reportJob.ProjectID, ScanID: reportJob.ScanID}