diff --git a/lib/analyze-action-post.js b/lib/analyze-action-post.js index d815da082f..5b6284cba0 100644 --- a/lib/analyze-action-post.js +++ b/lib/analyze-action-post.js @@ -119915,11 +119915,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 5dcfd5062e..9e58b5b809 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -88645,11 +88645,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", @@ -93301,23 +93296,6 @@ function findSarifFilesInDir(sarifPath, isSarif) { walkSarifFiles(sarifPath); return sarifFiles; } -function getSarifFilePaths(sarifPath, isSarif) { - if (!fs15.existsSync(sarifPath)) { - throw new ConfigurationError(`Path does not exist: ${sarifPath}`); - } - let sarifFiles; - if (fs15.lstatSync(sarifPath).isDirectory()) { - sarifFiles = findSarifFilesInDir(sarifPath, isSarif); - if (sarifFiles.length === 0) { - throw new ConfigurationError( - `No SARIF files found to upload in "${sarifPath}".` - ); - } - } else { - sarifFiles = [sarifPath]; - } - return sarifFiles; -} async function getGroupedSarifFilePaths(logger, sarifPath) { const stats = fs15.statSync(sarifPath, { throwIfNoEntry: false }); if (stats === void 0) { @@ -93508,36 +93486,6 @@ async function writePostProcessedFiles(logger, pathInput, uploadTarget, postProc logger.debug(`Not writing post-processed SARIF files.`); } } -async function uploadFiles(inputSarifPath, checkoutPath, category, features, logger, uploadTarget) { - const sarifPaths = getSarifFilePaths( - inputSarifPath, - uploadTarget.sarifPredicate - ); - return uploadSpecifiedFiles( - sarifPaths, - checkoutPath, - category, - features, - logger, - uploadTarget - ); -} -async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features, logger, uploadTarget) { - const processingResults = await postProcessSarifFiles( - logger, - features, - checkoutPath, - sarifPaths, - category, - uploadTarget - ); - return uploadPostProcessedFiles( - logger, - checkoutPath, - uploadTarget, - processingResults - ); -} async function uploadPostProcessedFiles(logger, checkoutPath, uploadTarget, postProcessingResults) { logger.startGroup(`Uploading ${uploadTarget.name} results`); const sarif = postProcessingResults.sarif; @@ -93992,42 +93940,15 @@ async function run() { if (runStats) { const checkoutPath = getRequiredInput("checkout_path"); const category = getOptionalInput("category"); - if (await features.getValue("analyze_use_new_upload" /* AnalyzeUseNewUpload */)) { - uploadResults = await postProcessAndUploadSarif( - logger, - features, - uploadKind, - checkoutPath, - outputDir, - category, - getOptionalInput("post-processed-sarif-path") - ); - } else if (uploadKind === "always") { - uploadResults = {}; - if (isCodeScanningEnabled(config)) { - uploadResults["code-scanning" /* CodeScanning */] = await uploadFiles( - outputDir, - checkoutPath, - category, - features, - logger, - CodeScanning - ); - } - if (isCodeQualityEnabled(config)) { - uploadResults["code-quality" /* CodeQuality */] = await uploadFiles( - outputDir, - checkoutPath, - category, - features, - logger, - CodeQuality - ); - } - } else { - uploadResults = {}; - logger.info("Not uploading results"); - } + uploadResults = await postProcessAndUploadSarif( + logger, + features, + uploadKind, + checkoutPath, + outputDir, + category, + getOptionalInput("post-processed-sarif-path") + ); if (uploadResults["code-scanning" /* CodeScanning */] !== void 0) { core14.setOutput( "sarif-id", diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 2655e43157..76ff45ae37 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -83964,11 +83964,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", diff --git a/lib/init-action-post.js b/lib/init-action-post.js index c238f7d069..1ab02e070f 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -123296,11 +123296,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", diff --git a/lib/init-action.js b/lib/init-action.js index 6de0e4e2db..a27027a365 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -86059,11 +86059,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index 8a757d8c61..a65c4de5ea 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -83955,11 +83955,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 31f135f53c..3b4e0ea254 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -83867,11 +83867,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", diff --git a/lib/start-proxy-action-post.js b/lib/start-proxy-action-post.js index 86991078ab..d05099d039 100644 --- a/lib/start-proxy-action-post.js +++ b/lib/start-proxy-action-post.js @@ -119321,11 +119321,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index 3b6d4deca5..807fea1a5c 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -99983,11 +99983,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", diff --git a/lib/upload-lib.js b/lib/upload-lib.js index e9e0a6747c..90c1ac93b8 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -87021,11 +87021,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", diff --git a/lib/upload-sarif-action-post.js b/lib/upload-sarif-action-post.js index 96a6bc64be..3cfb34feb6 100644 --- a/lib/upload-sarif-action-post.js +++ b/lib/upload-sarif-action-post.js @@ -119487,11 +119487,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 6db9c67bdf..3599423934 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -86817,11 +86817,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", diff --git a/src/analyze-action.ts b/src/analyze-action.ts index 3ab1dd1321..4bc9879d3e 100644 --- a/src/analyze-action.ts +++ b/src/analyze-action.ts @@ -19,12 +19,7 @@ import { getApiDetails, getGitHubVersion } from "./api-client"; import { runAutobuild } from "./autobuild"; import { getTotalCacheSize, shouldStoreCache } from "./caching-utils"; import { getCodeQL } from "./codeql"; -import { - Config, - getConfig, - isCodeQualityEnabled, - isCodeScanningEnabled, -} from "./config-utils"; +import { Config, getConfig } from "./config-utils"; import { uploadDatabases } from "./database-upload"; import { DependencyCacheUploadStatusReport, @@ -32,7 +27,7 @@ import { } from "./dependency-caching"; import { getDiffInformedAnalysisBranches } from "./diff-informed-analysis-utils"; import { EnvVar } from "./environment"; -import { Feature, Features } from "./feature-flags"; +import { Features } from "./feature-flags"; import { KnownLanguage } from "./languages"; import { getActionsLogger, Logger } from "./logging"; import { uploadOverlayBaseDatabaseToCache } from "./overlay-database-utils"; @@ -357,46 +352,15 @@ async function run() { const checkoutPath = actionsUtil.getRequiredInput("checkout_path"); const category = actionsUtil.getOptionalInput("category"); - if (await features.getValue(Feature.AnalyzeUseNewUpload)) { - uploadResults = await postProcessAndUploadSarif( - logger, - features, - uploadKind, - checkoutPath, - outputDir, - category, - actionsUtil.getOptionalInput("post-processed-sarif-path"), - ); - } else if (uploadKind === "always") { - uploadResults = {}; - - if (isCodeScanningEnabled(config)) { - uploadResults[analyses.AnalysisKind.CodeScanning] = - await uploadLib.uploadFiles( - outputDir, - checkoutPath, - category, - features, - logger, - analyses.CodeScanning, - ); - } - - if (isCodeQualityEnabled(config)) { - uploadResults[analyses.AnalysisKind.CodeQuality] = - await uploadLib.uploadFiles( - outputDir, - checkoutPath, - category, - features, - logger, - analyses.CodeQuality, - ); - } - } else { - uploadResults = {}; - logger.info("Not uploading results"); - } + uploadResults = await postProcessAndUploadSarif( + logger, + features, + uploadKind, + checkoutPath, + outputDir, + category, + actionsUtil.getOptionalInput("post-processed-sarif-path"), + ); // Set the SARIF id outputs only if we have results for them, to avoid // having keys with empty values in the action output. diff --git a/src/feature-flags.ts b/src/feature-flags.ts index 1334969795..f39544e78d 100644 --- a/src/feature-flags.ts +++ b/src/feature-flags.ts @@ -44,7 +44,6 @@ export interface FeatureEnablement { */ export enum Feature { AllowToolcacheInput = "allow_toolcache_input", - AnalyzeUseNewUpload = "analyze_use_new_upload", CleanupTrapCaches = "cleanup_trap_caches", CppDependencyInstallation = "cpp_dependency_installation_enabled", CsharpNewCacheKey = "csharp_new_cache_key", @@ -117,11 +116,6 @@ export const featureConfig: Record< envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: undefined, }, - [Feature.AnalyzeUseNewUpload]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: undefined, - }, [Feature.CleanupTrapCaches]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES",