Consistently use "post-processing"

This commit is contained in:
Michael B. Gale
2025-10-24 10:20:25 +01:00
parent b9cd36824e
commit f0452d5366
12 changed files with 121 additions and 119 deletions
+18 -18
View File
@@ -95901,7 +95901,7 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo
return payloadObj;
}
async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths, category, analysis) {
logger.info(`Processing sarif files: ${JSON.stringify(sarifPaths)}`);
logger.info(`Post-processing sarif files: ${JSON.stringify(sarifPaths)}`);
const gitHubVersion = await getGitHubVersion();
let sarif;
category = analysis.fixCategory(logger, category);
@@ -95934,17 +95934,17 @@ async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths,
);
return { sarif, analysisKey, environment };
}
async function writeProcessedFiles(logger, pathInput, uploadTarget, processingResults) {
async function writePostProcessedFiles(logger, pathInput, uploadTarget, postProcessingResults) {
const outputPath = pathInput || process.env["CODEQL_ACTION_SARIF_DUMP_DIR" /* SARIF_DUMP_DIR */];
if (outputPath !== void 0) {
dumpSarifFile(
JSON.stringify(processingResults.sarif),
JSON.stringify(postProcessingResults.sarif),
outputPath,
logger,
uploadTarget
);
} else {
logger.debug(`Not writing processed SARIF files.`);
logger.debug(`Not writing post-processed SARIF files.`);
}
}
async function uploadFiles(inputSarifPath, checkoutPath, category, features, logger, uploadTarget) {
@@ -95970,16 +95970,16 @@ async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features
category,
uploadTarget
);
return uploadProcessedFiles(
return uploadPostProcessedFiles(
logger,
checkoutPath,
uploadTarget,
processingResults
);
}
async function uploadProcessedFiles(logger, checkoutPath, uploadTarget, processingResults) {
async function uploadPostProcessedFiles(logger, checkoutPath, uploadTarget, postProcessingResults) {
logger.startGroup(`Uploading ${uploadTarget.name} results`);
const sarif = processingResults.sarif;
const sarif = postProcessingResults.sarif;
const toolNames = getToolNames(sarif);
logger.debug(`Validating that each SARIF run has a unique category`);
validateUniqueCategory(sarif, uploadTarget.sentinelPrefix);
@@ -95991,13 +95991,13 @@ async function uploadProcessedFiles(logger, checkoutPath, uploadTarget, processi
const payload = buildPayload(
await getCommitOid(checkoutPath),
await getRef(),
processingResults.analysisKey,
postProcessingResults.analysisKey,
getRequiredEnvParam("GITHUB_WORKFLOW"),
zippedSarif,
getWorkflowRunID(),
getWorkflowRunAttempt(),
checkoutURI,
processingResults.environment,
postProcessingResults.environment,
toolNames,
await determineBaseBranchHeadCommitOid()
);
@@ -96191,7 +96191,7 @@ function filterAlertsByDiffRange(logger, sarif) {
}
// src/upload-sarif.ts
async function processAndUploadSarif(logger, features, uploadKind, checkoutPath, sarifPath, category, processedOutputPath) {
async function postProcessAndUploadSarif(logger, features, uploadKind, checkoutPath, sarifPath, category, postProcessedOutputPath) {
const sarifGroups = await getGroupedSarifFilePaths(
logger,
sarifPath
@@ -96201,7 +96201,7 @@ async function processAndUploadSarif(logger, features, uploadKind, checkoutPath,
sarifGroups
)) {
const analysisConfig = getAnalysisConfig(analysisKind);
const processingResults = await postProcessSarifFiles(
const postProcessingResults = await postProcessSarifFiles(
logger,
features,
checkoutPath,
@@ -96209,18 +96209,18 @@ async function processAndUploadSarif(logger, features, uploadKind, checkoutPath,
category,
analysisConfig
);
await writeProcessedFiles(
await writePostProcessedFiles(
logger,
processedOutputPath,
postProcessedOutputPath,
analysisConfig,
processingResults
postProcessingResults
);
if (uploadKind === "always") {
uploadResults[analysisKind] = await uploadProcessedFiles(
uploadResults[analysisKind] = await uploadPostProcessedFiles(
logger,
checkoutPath,
analysisConfig,
processingResults
postProcessingResults
);
}
}
@@ -96428,14 +96428,14 @@ async function run() {
const checkoutPath = getRequiredInput("checkout_path");
const category = getOptionalInput("category");
if (await features.getValue("analyze_use_new_upload" /* AnalyzeUseNewUpload */)) {
uploadResults = await processAndUploadSarif(
uploadResults = await postProcessAndUploadSarif(
logger,
features,
uploadKind,
checkoutPath,
outputDir,
category,
getOptionalInput("processed-sarif-path")
getOptionalInput("post-processed-sarif-path")
);
} else if (uploadKind === "always") {
uploadResults = {};
+6 -6
View File
@@ -133312,7 +133312,7 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo
return payloadObj;
}
async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths, category, analysis) {
logger.info(`Processing sarif files: ${JSON.stringify(sarifPaths)}`);
logger.info(`Post-processing sarif files: ${JSON.stringify(sarifPaths)}`);
const gitHubVersion = await getGitHubVersion();
let sarif;
category = analysis.fixCategory(logger, category);
@@ -133368,16 +133368,16 @@ async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features
category,
uploadTarget
);
return uploadProcessedFiles(
return uploadPostProcessedFiles(
logger,
checkoutPath,
uploadTarget,
processingResults
);
}
async function uploadProcessedFiles(logger, checkoutPath, uploadTarget, processingResults) {
async function uploadPostProcessedFiles(logger, checkoutPath, uploadTarget, postProcessingResults) {
logger.startGroup(`Uploading ${uploadTarget.name} results`);
const sarif = processingResults.sarif;
const sarif = postProcessingResults.sarif;
const toolNames = getToolNames(sarif);
logger.debug(`Validating that each SARIF run has a unique category`);
validateUniqueCategory(sarif, uploadTarget.sentinelPrefix);
@@ -133389,13 +133389,13 @@ async function uploadProcessedFiles(logger, checkoutPath, uploadTarget, processi
const payload = buildPayload(
await getCommitOid(checkoutPath),
await getRef(),
processingResults.analysisKey,
postProcessingResults.analysisKey,
getRequiredEnvParam("GITHUB_WORKFLOW"),
zippedSarif,
getWorkflowRunID(),
getWorkflowRunAttempt(),
checkoutURI,
processingResults.environment,
postProcessingResults.environment,
toolNames,
await determineBaseBranchHeadCommitOid()
);
+13 -13
View File
@@ -84855,11 +84855,11 @@ __export(upload_lib_exports, {
throwIfCombineSarifFilesDisabled: () => throwIfCombineSarifFilesDisabled,
uploadFiles: () => uploadFiles,
uploadPayload: () => uploadPayload,
uploadProcessedFiles: () => uploadProcessedFiles,
uploadPostProcessedFiles: () => uploadPostProcessedFiles,
validateSarifFileSchema: () => validateSarifFileSchema,
validateUniqueCategory: () => validateUniqueCategory,
waitForProcessing: () => waitForProcessing,
writeProcessedFiles: () => writeProcessedFiles
writePostProcessedFiles: () => writePostProcessedFiles
});
module.exports = __toCommonJS(upload_lib_exports);
var fs13 = __toESM(require("fs"));
@@ -92715,7 +92715,7 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo
return payloadObj;
}
async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths, category, analysis) {
logger.info(`Processing sarif files: ${JSON.stringify(sarifPaths)}`);
logger.info(`Post-processing sarif files: ${JSON.stringify(sarifPaths)}`);
const gitHubVersion = await getGitHubVersion();
let sarif;
category = analysis.fixCategory(logger, category);
@@ -92748,17 +92748,17 @@ async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths,
);
return { sarif, analysisKey, environment };
}
async function writeProcessedFiles(logger, pathInput, uploadTarget, processingResults) {
async function writePostProcessedFiles(logger, pathInput, uploadTarget, postProcessingResults) {
const outputPath = pathInput || process.env["CODEQL_ACTION_SARIF_DUMP_DIR" /* SARIF_DUMP_DIR */];
if (outputPath !== void 0) {
dumpSarifFile(
JSON.stringify(processingResults.sarif),
JSON.stringify(postProcessingResults.sarif),
outputPath,
logger,
uploadTarget
);
} else {
logger.debug(`Not writing processed SARIF files.`);
logger.debug(`Not writing post-processed SARIF files.`);
}
}
async function uploadFiles(inputSarifPath, checkoutPath, category, features, logger, uploadTarget) {
@@ -92784,16 +92784,16 @@ async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features
category,
uploadTarget
);
return uploadProcessedFiles(
return uploadPostProcessedFiles(
logger,
checkoutPath,
uploadTarget,
processingResults
);
}
async function uploadProcessedFiles(logger, checkoutPath, uploadTarget, processingResults) {
async function uploadPostProcessedFiles(logger, checkoutPath, uploadTarget, postProcessingResults) {
logger.startGroup(`Uploading ${uploadTarget.name} results`);
const sarif = processingResults.sarif;
const sarif = postProcessingResults.sarif;
const toolNames = getToolNames(sarif);
logger.debug(`Validating that each SARIF run has a unique category`);
validateUniqueCategory(sarif, uploadTarget.sentinelPrefix);
@@ -92805,13 +92805,13 @@ async function uploadProcessedFiles(logger, checkoutPath, uploadTarget, processi
const payload = buildPayload(
await getCommitOid(checkoutPath),
await getRef(),
processingResults.analysisKey,
postProcessingResults.analysisKey,
getRequiredEnvParam("GITHUB_WORKFLOW"),
zippedSarif,
getWorkflowRunID(),
getWorkflowRunAttempt(),
checkoutURI,
processingResults.environment,
postProcessingResults.environment,
toolNames,
await determineBaseBranchHeadCommitOid()
);
@@ -93019,11 +93019,11 @@ function filterAlertsByDiffRange(logger, sarif) {
throwIfCombineSarifFilesDisabled,
uploadFiles,
uploadPayload,
uploadProcessedFiles,
uploadPostProcessedFiles,
validateSarifFileSchema,
validateUniqueCategory,
waitForProcessing,
writeProcessedFiles
writePostProcessedFiles
});
/*! Bundled license information:
+16 -16
View File
@@ -93371,7 +93371,7 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo
return payloadObj;
}
async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths, category, analysis) {
logger.info(`Processing sarif files: ${JSON.stringify(sarifPaths)}`);
logger.info(`Post-processing sarif files: ${JSON.stringify(sarifPaths)}`);
const gitHubVersion = await getGitHubVersion();
let sarif;
category = analysis.fixCategory(logger, category);
@@ -93404,22 +93404,22 @@ async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths,
);
return { sarif, analysisKey, environment };
}
async function writeProcessedFiles(logger, pathInput, uploadTarget, processingResults) {
async function writePostProcessedFiles(logger, pathInput, uploadTarget, postProcessingResults) {
const outputPath = pathInput || process.env["CODEQL_ACTION_SARIF_DUMP_DIR" /* SARIF_DUMP_DIR */];
if (outputPath !== void 0) {
dumpSarifFile(
JSON.stringify(processingResults.sarif),
JSON.stringify(postProcessingResults.sarif),
outputPath,
logger,
uploadTarget
);
} else {
logger.debug(`Not writing processed SARIF files.`);
logger.debug(`Not writing post-processed SARIF files.`);
}
}
async function uploadProcessedFiles(logger, checkoutPath, uploadTarget, processingResults) {
async function uploadPostProcessedFiles(logger, checkoutPath, uploadTarget, postProcessingResults) {
logger.startGroup(`Uploading ${uploadTarget.name} results`);
const sarif = processingResults.sarif;
const sarif = postProcessingResults.sarif;
const toolNames = getToolNames(sarif);
logger.debug(`Validating that each SARIF run has a unique category`);
validateUniqueCategory(sarif, uploadTarget.sentinelPrefix);
@@ -93431,13 +93431,13 @@ async function uploadProcessedFiles(logger, checkoutPath, uploadTarget, processi
const payload = buildPayload(
await getCommitOid(checkoutPath),
await getRef(),
processingResults.analysisKey,
postProcessingResults.analysisKey,
getRequiredEnvParam("GITHUB_WORKFLOW"),
zippedSarif,
getWorkflowRunID(),
getWorkflowRunAttempt(),
checkoutURI,
processingResults.environment,
postProcessingResults.environment,
toolNames,
await determineBaseBranchHeadCommitOid()
);
@@ -93631,7 +93631,7 @@ function filterAlertsByDiffRange(logger, sarif) {
}
// src/upload-sarif.ts
async function processAndUploadSarif(logger, features, uploadKind, checkoutPath, sarifPath, category, processedOutputPath) {
async function postProcessAndUploadSarif(logger, features, uploadKind, checkoutPath, sarifPath, category, postProcessedOutputPath) {
const sarifGroups = await getGroupedSarifFilePaths(
logger,
sarifPath
@@ -93641,7 +93641,7 @@ async function processAndUploadSarif(logger, features, uploadKind, checkoutPath,
sarifGroups
)) {
const analysisConfig = getAnalysisConfig(analysisKind);
const processingResults = await postProcessSarifFiles(
const postProcessingResults = await postProcessSarifFiles(
logger,
features,
checkoutPath,
@@ -93649,18 +93649,18 @@ async function processAndUploadSarif(logger, features, uploadKind, checkoutPath,
category,
analysisConfig
);
await writeProcessedFiles(
await writePostProcessedFiles(
logger,
processedOutputPath,
postProcessedOutputPath,
analysisConfig,
processingResults
postProcessingResults
);
if (uploadKind === "always") {
uploadResults[analysisKind] = await uploadProcessedFiles(
uploadResults[analysisKind] = await uploadPostProcessedFiles(
logger,
checkoutPath,
analysisConfig,
processingResults
postProcessingResults
);
}
}
@@ -93714,7 +93714,7 @@ async function run() {
const sarifPath = getRequiredInput("sarif_file");
const checkoutPath = getRequiredInput("checkout_path");
const category = getOptionalInput("category");
const uploadResults = await processAndUploadSarif(
const uploadResults = await postProcessAndUploadSarif(
logger,
features,
"always",