From 6f0fcbeea7bcf5fa25efa506a9eda9d1ee938488 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 22 Oct 2025 19:09:39 +0100 Subject: [PATCH] Rename `uploadSarif` --- lib/analyze-action.js | 4 ++-- lib/upload-sarif-action.js | 4 ++-- src/analyze-action.ts | 4 ++-- src/upload-sarif-action.ts | 4 ++-- src/upload-sarif.test.ts | 26 +++++++++++++------------- src/upload-sarif.ts | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/analyze-action.js b/lib/analyze-action.js index d422ad609..c5b340b28 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -96189,7 +96189,7 @@ function filterAlertsByDiffRange(logger, sarif) { } // src/upload-sarif.ts -async function uploadSarif(logger, features, uploadKind, checkoutPath, sarifPath, category, processedOutputPath) { +async function processAndUploadSarif(logger, features, uploadKind, checkoutPath, sarifPath, category, processedOutputPath) { const sarifGroups = await getGroupedSarifFilePaths( logger, sarifPath @@ -96426,7 +96426,7 @@ async function run() { const checkoutPath = getRequiredInput("checkout_path"); const category = getOptionalInput("category"); if (await features.getValue("analyze_use_new_upload" /* AnalyzeUseNewUpload */)) { - uploadResults = await uploadSarif( + uploadResults = await processAndUploadSarif( logger, features, uploadKind, diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index f7923ea81..300a18b5e 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -93629,7 +93629,7 @@ function filterAlertsByDiffRange(logger, sarif) { } // src/upload-sarif.ts -async function uploadSarif(logger, features, uploadKind, checkoutPath, sarifPath, category, processedOutputPath) { +async function processAndUploadSarif(logger, features, uploadKind, checkoutPath, sarifPath, category, processedOutputPath) { const sarifGroups = await getGroupedSarifFilePaths( logger, sarifPath @@ -93712,7 +93712,7 @@ async function run() { const sarifPath = getRequiredInput("sarif_file"); const checkoutPath = getRequiredInput("checkout_path"); const category = getOptionalInput("category"); - const uploadResults = await uploadSarif( + const uploadResults = await processAndUploadSarif( logger, features, "always", diff --git a/src/analyze-action.ts b/src/analyze-action.ts index fb510a727..f69845d2f 100644 --- a/src/analyze-action.ts +++ b/src/analyze-action.ts @@ -52,7 +52,7 @@ import { } from "./trap-caching"; import * as uploadLib from "./upload-lib"; import { UploadResult } from "./upload-lib"; -import { uploadSarif } from "./upload-sarif"; +import { processAndUploadSarif } from "./upload-sarif"; import * as util from "./util"; interface AnalysisStatusReport @@ -352,7 +352,7 @@ async function run() { const category = actionsUtil.getOptionalInput("category"); if (await features.getValue(Feature.AnalyzeUseNewUpload)) { - uploadResults = await uploadSarif( + uploadResults = await processAndUploadSarif( logger, features, uploadKind, diff --git a/src/upload-sarif-action.ts b/src/upload-sarif-action.ts index 8a8bca8b7..087179dae 100644 --- a/src/upload-sarif-action.ts +++ b/src/upload-sarif-action.ts @@ -16,7 +16,7 @@ import { isThirdPartyAnalysis, } from "./status-report"; import * as upload_lib from "./upload-lib"; -import { uploadSarif } from "./upload-sarif"; +import { processAndUploadSarif } from "./upload-sarif"; import { ConfigurationError, checkActionVersion, @@ -90,7 +90,7 @@ async function run() { const checkoutPath = actionsUtil.getRequiredInput("checkout_path"); const category = actionsUtil.getOptionalInput("category"); - const uploadResults = await uploadSarif( + const uploadResults = await processAndUploadSarif( logger, features, "always", diff --git a/src/upload-sarif.test.ts b/src/upload-sarif.test.ts index cce178060..2c0f7fc52 100644 --- a/src/upload-sarif.test.ts +++ b/src/upload-sarif.test.ts @@ -9,7 +9,7 @@ import { getRunnerLogger } from "./logging"; import { createFeatures, setupTests } from "./testing-utils"; import { UploadResult } from "./upload-lib"; import * as uploadLib from "./upload-lib"; -import { uploadSarif } from "./upload-sarif"; +import { processAndUploadSarif } from "./upload-sarif"; import * as util from "./util"; setupTests(test); @@ -39,7 +39,7 @@ function mockPostProcessSarifFiles() { return postProcessSarifFiles; } -const uploadSarifMacro = test.macro({ +const processAndUploadSarifMacro = test.macro({ exec: async ( t: ExecutionContext, sarifFiles: string[], @@ -71,7 +71,7 @@ const uploadSarifMacro = test.macro({ fs.writeFileSync(sarifFile, ""); } - const actual = await uploadSarif( + const actual = await processAndUploadSarif( logger, features, "always", @@ -116,12 +116,12 @@ const uploadSarifMacro = test.macro({ } }); }, - title: (providedTitle = "") => `uploadSarif - ${providedTitle}`, + title: (providedTitle = "") => `processAndUploadSarif - ${providedTitle}`, }); test( "SARIF file", - uploadSarifMacro, + processAndUploadSarifMacro, ["test.sarif"], (tempDir) => path.join(tempDir, "test.sarif"), { @@ -136,7 +136,7 @@ test( test( "JSON file", - uploadSarifMacro, + processAndUploadSarifMacro, ["test.json"], (tempDir) => path.join(tempDir, "test.json"), { @@ -151,7 +151,7 @@ test( test( "Code Scanning files", - uploadSarifMacro, + processAndUploadSarifMacro, ["test.json", "test.sarif"], undefined, { @@ -167,7 +167,7 @@ test( test( "Code Quality file", - uploadSarifMacro, + processAndUploadSarifMacro, ["test.quality.sarif"], (tempDir) => path.join(tempDir, "test.quality.sarif"), { @@ -182,7 +182,7 @@ test( test( "Mixed files", - uploadSarifMacro, + processAndUploadSarifMacro, ["test.sarif", "test.quality.sarif"], undefined, { @@ -203,7 +203,7 @@ test( }, ); -test("uploadSarif doesn't upload if upload is disabled", async (t) => { +test("processAndUploadSarif doesn't upload if upload is disabled", async (t) => { await util.withTmpDir(async (tempDir) => { const logger = getRunnerLogger(true); const features = createFeatures([]); @@ -216,7 +216,7 @@ test("uploadSarif doesn't upload if upload is disabled", async (t) => { fs.writeFileSync(toFullPath("test.sarif"), ""); fs.writeFileSync(toFullPath("test.quality.sarif"), ""); - const actual = await uploadSarif(logger, features, "never", "", tempDir); + const actual = await processAndUploadSarif(logger, features, "never", "", tempDir); t.truthy(actual); t.assert(postProcessSarifFiles.calledTwice); @@ -224,7 +224,7 @@ test("uploadSarif doesn't upload if upload is disabled", async (t) => { }); }); -test("uploadSarif writes processed SARIF files if output directory is provided", async (t) => { +test("processAndUploadSarif writes processed SARIF files if output directory is provided", async (t) => { await util.withTmpDir(async (tempDir) => { const logger = getRunnerLogger(true); const features = createFeatures([]); @@ -237,7 +237,7 @@ test("uploadSarif writes processed SARIF files if output directory is provided", fs.writeFileSync(toFullPath("test.quality.sarif"), ""); const processedOutPath = path.join(tempDir, "processed"); - const actual = await uploadSarif( + const actual = await processAndUploadSarif( logger, features, "never", diff --git a/src/upload-sarif.ts b/src/upload-sarif.ts index 87990089e..8774f15d7 100644 --- a/src/upload-sarif.ts +++ b/src/upload-sarif.ts @@ -23,7 +23,7 @@ export type UploadSarifResults = Partial< * * @returns A partial mapping from analysis kinds to the upload results. */ -export async function uploadSarif( +export async function processAndUploadSarif( logger: Logger, features: FeatureEnablement, uploadKind: UploadKind,