⚠️ Remove the oldjson format from cron (#1920)

- removed the old json format from cron
fix https://github.com/ossf/scorecard/pull/1487

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
This commit is contained in:
Naveen 2022-05-17 19:31:25 -05:00 committed by GitHub
parent e7ef60d7fe
commit bbaf072dd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,7 +80,6 @@ func processRequest(ctx context.Context,
return nil
}
var buffer bytes.Buffer
var buffer2 bytes.Buffer
var rawBuffer bytes.Buffer
// TODO: run Scorecard for each repo in a separate thread.
@ -130,9 +129,6 @@ func processRequest(ctx context.Context,
logger.Info(errorMsg)
}
result.Date = batchRequest.GetJobTime().AsTime()
if err := format.AsJSON(&result, true /*showDetails*/, log.InfoLevel, &buffer); err != nil {
return fmt.Errorf("error during result.AsJSON: %w", err)
}
if err := format.AsJSON2(&result, true /*showDetails*/, log.InfoLevel, checkDocs, &buffer2); err != nil {
return fmt.Errorf("error during result.AsJSON2: %w", err)
@ -143,9 +139,6 @@ func processRequest(ctx context.Context,
return fmt.Errorf("error during result.AsRawJSON: %w", err)
}
}
if err := data.WriteToBlobStore(ctx, bucketURL, filename, buffer.Bytes()); err != nil {
return fmt.Errorf("error during WriteToBlobStore: %w", err)
}
if err := data.WriteToBlobStore(ctx, bucketURL2, filename, buffer2.Bytes()); err != nil {
return fmt.Errorf("error during WriteToBlobStore2: %w", err)