Merge remote-tracking branch 'origin/main' into mbg/refactor-util/errors

This commit is contained in:
Michael B. Gale
2026-10-30 16:50:30 +00:00
160 changed files with 18861 additions and 8747 deletions

View File

@@ -11,9 +11,9 @@ import { AnalysisKind, CodeQuality, CodeScanning } from "./analyses";
import * as api from "./api-client";
import * as diffUtils from "./diff-informed-analysis-utils";
import { getEnv } from "./environment";
import { getRunnerLogger, Logger } from "./logging";
import { Logger } from "./logging";
import * as sarif from "./sarif";
import { setupTests } from "./testing-utils";
import { RecordingLogger, setupTests } from "./testing-utils";
import * as uploadLib from "./upload-lib";
import { UploadPayload } from "./upload-lib/types";
import { GitHubVariant, withTmpDir } from "./util";
@@ -30,7 +30,7 @@ test.serial("validateSarifFileSchema - valid", (t) => {
uploadLib.validateSarifFileSchema(
uploadLib.readSarifFileOrThrow(inputFile),
inputFile,
getRunnerLogger(true),
new RecordingLogger(),
),
);
});
@@ -41,7 +41,7 @@ test.serial("validateSarifFileSchema - invalid", (t) => {
uploadLib.validateSarifFileSchema(
uploadLib.readSarifFileOrThrow(inputFile),
inputFile,
getRunnerLogger(true),
new RecordingLogger(),
),
);
});
@@ -180,7 +180,7 @@ test.serial("finding SARIF files", async (t) => {
}
const groupedSarifFiles = await uploadLib.getGroupedSarifFilePaths(
getRunnerLogger(true),
new RecordingLogger(),
tmpDir,
);
@@ -201,7 +201,7 @@ test.serial("getGroupedSarifFilePaths - Risk Assessment files", async (t) => {
fs.writeFileSync(sarifPath, "");
const groupedSarifFiles = await uploadLib.getGroupedSarifFilePaths(
getRunnerLogger(true),
new RecordingLogger(),
sarifPath,
);
@@ -219,7 +219,7 @@ test.serial("getGroupedSarifFilePaths - Code Quality file", async (t) => {
fs.writeFileSync(sarifPath, "");
const groupedSarifFiles = await uploadLib.getGroupedSarifFilePaths(
getRunnerLogger(true),
new RecordingLogger(),
sarifPath,
);
@@ -237,7 +237,7 @@ test.serial("getGroupedSarifFilePaths - Code Scanning file", async (t) => {
fs.writeFileSync(sarifPath, "");
const groupedSarifFiles = await uploadLib.getGroupedSarifFilePaths(
getRunnerLogger(true),
new RecordingLogger(),
sarifPath,
);
@@ -255,7 +255,7 @@ test.serial("getGroupedSarifFilePaths - Other file", async (t) => {
fs.writeFileSync(sarifPath, "");
const groupedSarifFiles = await uploadLib.getGroupedSarifFilePaths(
getRunnerLogger(true),
new RecordingLogger(),
sarifPath,
);
@@ -933,7 +933,7 @@ function uploadPayloadFixtures(analysis: analyses.AnalysisConfig) {
owner: mockData.owner,
repo: mockData.repo,
},
getRunnerLogger(true),
new RecordingLogger(),
analysis,
);
@@ -1020,7 +1020,7 @@ function runFilterAlertsByDiffRange(
diffRanges: diffUtils.DiffThunkRange[],
): Partial<sarif.Log> {
sinon.stub(diffUtils, "readDiffRangesJsonFile").returns(diffRanges);
return uploadLib.filterAlertsByDiffRange(getRunnerLogger(true), input);
return uploadLib.filterAlertsByDiffRange(new RecordingLogger(), input);
}
test.serial(