Merge pull request #3424 from github/henrymercer/feature-skip-file-coverage-info-prs

Add feature flag to skip computing baseline file coverage information on PRs
This commit is contained in:
Henry Mercer
2026-01-27 06:49:29 -08:00
committed by GitHub
25 changed files with 370 additions and 143 deletions
+18 -12
View File
@@ -127971,6 +127971,15 @@ var featureConfig = {
legacyApi: true,
minimumVersion: void 0
},
["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS",
// For testing, this is not behind a CLI version check yet. However
// before rolling this out externally, we should set a minimum version here
// since current versions of the CodeQL CLI will log if baseline information
// cannot be found when interpreting results.
minimumVersion: void 0
},
["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API",
@@ -128188,6 +128197,10 @@ async function getCodeQLForCmd(cmd, checkVersion) {
} else if (overlayDatabaseMode === "overlay-base" /* OverlayBase */) {
extraArgs.push("--overlay-base");
}
const baselineFilesOptions = config.enableFileCoverageInformation ? [
"--calculate-language-specific-baseline",
"--sublanguage-file-coverage"
] : ["--no-calculate-baseline"];
await runCli(
cmd,
[
@@ -128197,12 +128210,14 @@ async function getCodeQLForCmd(cmd, checkVersion) {
"--db-cluster",
config.dbLocation,
`--source-root=${sourceRoot}`,
"--calculate-language-specific-baseline",
...baselineFilesOptions,
"--extractor-include-aliases",
"--sublanguage-file-coverage",
...extraArgs,
...getExtraOptionsFromEnv(["database", "init"], {
ignoringOptions: ["--overwrite"]
// Some user configs specify `--no-calculate-baseline` as an additional
// argument to `codeql database init`. Therefore ignore the baseline file
// options here to avoid specifying the same argument twice and erroring.
ignoringOptions: ["--overwrite", ...baselineFilesOptions]
})
],
{ stdin: externalRepositoryToken }
@@ -128389,15 +128404,6 @@ ${output}`
noStreamStdout: true
});
},
async databasePrintBaseline(databasePath) {
const codeqlArgs = [
"database",
"print-baseline",
...getExtraOptionsFromEnv(["database", "print-baseline"]),
databasePath
];
return await runCli(cmd, codeqlArgs);
},
async databaseCleanupCluster(config, cleanupLevel) {
const cacheCleanupFlag = await codeQlVersionAtLeast(
this,
+27 -14
View File
@@ -90723,6 +90723,15 @@ var featureConfig = {
legacyApi: true,
minimumVersion: void 0
},
["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS",
// For testing, this is not behind a CLI version check yet. However
// before rolling this out externally, we should set a minimum version here
// since current versions of the CodeQL CLI will log if baseline information
// cannot be found when interpreting results.
minimumVersion: void 0
},
["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API",
@@ -92482,6 +92491,10 @@ async function getCodeQLForCmd(cmd, checkVersion) {
} else if (overlayDatabaseMode === "overlay-base" /* OverlayBase */) {
extraArgs.push("--overlay-base");
}
const baselineFilesOptions = config.enableFileCoverageInformation ? [
"--calculate-language-specific-baseline",
"--sublanguage-file-coverage"
] : ["--no-calculate-baseline"];
await runCli(
cmd,
[
@@ -92491,12 +92504,14 @@ async function getCodeQLForCmd(cmd, checkVersion) {
"--db-cluster",
config.dbLocation,
`--source-root=${sourceRoot}`,
"--calculate-language-specific-baseline",
...baselineFilesOptions,
"--extractor-include-aliases",
"--sublanguage-file-coverage",
...extraArgs,
...getExtraOptionsFromEnv(["database", "init"], {
ignoringOptions: ["--overwrite"]
// Some user configs specify `--no-calculate-baseline` as an additional
// argument to `codeql database init`. Therefore ignore the baseline file
// options here to avoid specifying the same argument twice and erroring.
ignoringOptions: ["--overwrite", ...baselineFilesOptions]
})
],
{ stdin: externalRepositoryToken }
@@ -92683,15 +92698,6 @@ ${output}`
noStreamStdout: true
});
},
async databasePrintBaseline(databasePath) {
const codeqlArgs = [
"database",
"print-baseline",
...getExtraOptionsFromEnv(["database", "print-baseline"]),
databasePath
];
return await runCli(cmd, codeqlArgs);
},
async databaseCleanupCluster(config, cleanupLevel) {
const cacheCleanupFlag = await codeQlVersionAtLeast(
this,
@@ -93447,10 +93453,17 @@ async function runQueries(sarifFolder, memoryFlag, threadsFlag, diffRangePackDir
const endTimeInterpretResults = /* @__PURE__ */ new Date();
statusReport[`interpret_results_${language}_duration_ms`] = endTimeInterpretResults.getTime() - startTimeInterpretResults.getTime();
logger.endGroup();
logger.info(analysisSummary);
if (qualityAnalysisSummary) {
if (analysisSummary.trim()) {
logger.info(analysisSummary);
}
if (qualityAnalysisSummary?.trim()) {
logger.info(qualityAnalysisSummary);
}
if (!config.enableFileCoverageInformation) {
logger.info(
"To speed up pull request analysis, file coverage information is only enabled when analyzing the default branch and protected branches."
);
}
if (await features.getValue("qa_telemetry_enabled" /* QaTelemetryEnabled */)) {
const perQueryAlertCounts = getPerQueryAlertCounts(sarifFile);
const perQueryAlertCountEventReport = {
+18 -12
View File
@@ -87056,6 +87056,15 @@ var featureConfig = {
legacyApi: true,
minimumVersion: void 0
},
["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS",
// For testing, this is not behind a CLI version check yet. However
// before rolling this out externally, we should set a minimum version here
// since current versions of the CodeQL CLI will log if baseline information
// cannot be found when interpreting results.
minimumVersion: void 0
},
["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API",
@@ -87582,6 +87591,10 @@ async function getCodeQLForCmd(cmd, checkVersion) {
} else if (overlayDatabaseMode === "overlay-base" /* OverlayBase */) {
extraArgs.push("--overlay-base");
}
const baselineFilesOptions = config.enableFileCoverageInformation ? [
"--calculate-language-specific-baseline",
"--sublanguage-file-coverage"
] : ["--no-calculate-baseline"];
await runCli(
cmd,
[
@@ -87591,12 +87604,14 @@ async function getCodeQLForCmd(cmd, checkVersion) {
"--db-cluster",
config.dbLocation,
`--source-root=${sourceRoot}`,
"--calculate-language-specific-baseline",
...baselineFilesOptions,
"--extractor-include-aliases",
"--sublanguage-file-coverage",
...extraArgs,
...getExtraOptionsFromEnv(["database", "init"], {
ignoringOptions: ["--overwrite"]
// Some user configs specify `--no-calculate-baseline` as an additional
// argument to `codeql database init`. Therefore ignore the baseline file
// options here to avoid specifying the same argument twice and erroring.
ignoringOptions: ["--overwrite", ...baselineFilesOptions]
})
],
{ stdin: externalRepositoryToken }
@@ -87783,15 +87798,6 @@ ${output}`
noStreamStdout: true
});
},
async databasePrintBaseline(databasePath) {
const codeqlArgs = [
"database",
"print-baseline",
...getExtraOptionsFromEnv(["database", "print-baseline"]),
databasePath
];
return await runCli(cmd, codeqlArgs);
},
async databaseCleanupCluster(config, cleanupLevel) {
const cacheCleanupFlag = await codeQlVersionAtLeast(
this,
+18 -12
View File
@@ -131365,6 +131365,15 @@ var featureConfig = {
legacyApi: true,
minimumVersion: void 0
},
["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS",
// For testing, this is not behind a CLI version check yet. However
// before rolling this out externally, we should set a minimum version here
// since current versions of the CodeQL CLI will log if baseline information
// cannot be found when interpreting results.
minimumVersion: void 0
},
["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API",
@@ -132827,6 +132836,10 @@ async function getCodeQLForCmd(cmd, checkVersion) {
} else if (overlayDatabaseMode === "overlay-base" /* OverlayBase */) {
extraArgs.push("--overlay-base");
}
const baselineFilesOptions = config.enableFileCoverageInformation ? [
"--calculate-language-specific-baseline",
"--sublanguage-file-coverage"
] : ["--no-calculate-baseline"];
await runCli(
cmd,
[
@@ -132836,12 +132849,14 @@ async function getCodeQLForCmd(cmd, checkVersion) {
"--db-cluster",
config.dbLocation,
`--source-root=${sourceRoot}`,
"--calculate-language-specific-baseline",
...baselineFilesOptions,
"--extractor-include-aliases",
"--sublanguage-file-coverage",
...extraArgs,
...getExtraOptionsFromEnv(["database", "init"], {
ignoringOptions: ["--overwrite"]
// Some user configs specify `--no-calculate-baseline` as an additional
// argument to `codeql database init`. Therefore ignore the baseline file
// options here to avoid specifying the same argument twice and erroring.
ignoringOptions: ["--overwrite", ...baselineFilesOptions]
})
],
{ stdin: externalRepositoryToken }
@@ -133028,15 +133043,6 @@ ${output}`
noStreamStdout: true
});
},
async databasePrintBaseline(databasePath) {
const codeqlArgs = [
"database",
"print-baseline",
...getExtraOptionsFromEnv(["database", "print-baseline"]),
databasePath
];
return await runCli(cmd, codeqlArgs);
},
async databaseCleanupCluster(config, cleanupLevel) {
const cacheCleanupFlag = await codeQlVersionAtLeast(
this,
+39 -15
View File
@@ -88214,6 +88214,15 @@ var featureConfig = {
legacyApi: true,
minimumVersion: void 0
},
["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS",
// For testing, this is not behind a CLI version check yet. However
// before rolling this out externally, we should set a minimum version here
// since current versions of the CodeQL CLI will log if baseline information
// cannot be found when interpreting results.
minimumVersion: void 0
},
["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API",
@@ -88773,7 +88782,8 @@ async function initActionState({
features,
repositoryProperties,
analysisKinds,
logger
logger,
enableFileCoverageInformation
}, userConfig) {
const languages = await getLanguages(
codeql,
@@ -88835,7 +88845,8 @@ async function initActionState({
extraQueryExclusions: [],
overlayDatabaseMode: "none" /* None */,
useOverlayDatabaseCaching: false,
repositoryProperties
repositoryProperties,
enableFileCoverageInformation
};
}
async function downloadCacheWithTime(trapCachingEnabled, codeQL, languages, logger) {
@@ -90830,6 +90841,10 @@ async function getCodeQLForCmd(cmd, checkVersion) {
} else if (overlayDatabaseMode === "overlay-base" /* OverlayBase */) {
extraArgs.push("--overlay-base");
}
const baselineFilesOptions = config.enableFileCoverageInformation ? [
"--calculate-language-specific-baseline",
"--sublanguage-file-coverage"
] : ["--no-calculate-baseline"];
await runCli(
cmd,
[
@@ -90839,12 +90854,14 @@ async function getCodeQLForCmd(cmd, checkVersion) {
"--db-cluster",
config.dbLocation,
`--source-root=${sourceRoot}`,
"--calculate-language-specific-baseline",
...baselineFilesOptions,
"--extractor-include-aliases",
"--sublanguage-file-coverage",
...extraArgs,
...getExtraOptionsFromEnv(["database", "init"], {
ignoringOptions: ["--overwrite"]
// Some user configs specify `--no-calculate-baseline` as an additional
// argument to `codeql database init`. Therefore ignore the baseline file
// options here to avoid specifying the same argument twice and erroring.
ignoringOptions: ["--overwrite", ...baselineFilesOptions]
})
],
{ stdin: externalRepositoryToken }
@@ -91031,15 +91048,6 @@ ${output}`
noStreamStdout: true
});
},
async databasePrintBaseline(databasePath) {
const codeqlArgs = [
"database",
"print-baseline",
...getExtraOptionsFromEnv(["database", "print-baseline"]),
databasePath
];
return await runCli(cmd, codeqlArgs);
},
async databaseCleanupCluster(config, cleanupLevel) {
const cacheCleanupFlag = await codeQlVersionAtLeast(
this,
@@ -91461,6 +91469,16 @@ function cleanupDatabaseClusterDirectory(config, logger, options = {}, rmSync2 =
}
}
}
async function getFileCoverageInformationEnabled(debugMode, repositoryNwo, features) {
return (
// Always enable file coverage information in debug mode
debugMode || // We're most interested in speeding up PRs, and we want to keep
// submitting file coverage information for the default branch since
// it is used to populate the status page.
!isAnalyzingPullRequest() || // For now, restrict this feature to the GitHub org
repositoryNwo.owner !== "github" || !await features.getValue("skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */)
);
}
// src/status-report.ts
var os5 = __toESM(require("os"));
@@ -92067,6 +92085,7 @@ async function run(startedAt) {
}
}
analysisKinds = await getAnalysisKinds(logger);
const debugMode = getOptionalInput("debug") === "true" || core13.isDebug();
config = await initConfig2(features, {
analysisKinds,
languagesInput: getOptionalInput("languages"),
@@ -92083,7 +92102,7 @@ async function run(startedAt) {
// - The `init` Action is passed `debug: true`.
// - Actions step debugging is enabled (e.g. by [enabling debug logging for a rerun](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs#re-running-all-the-jobs-in-a-workflow),
// or by setting the `ACTIONS_STEP_DEBUG` secret to `true`).
debugMode: getOptionalInput("debug") === "true" || core13.isDebug(),
debugMode,
debugArtifactName: getOptionalInput("debug-artifact-name") || DEFAULT_DEBUG_ARTIFACT_NAME,
debugDatabaseName: getOptionalInput("debug-database-name") || DEFAULT_DEBUG_DATABASE_NAME,
repository: repositoryNwo,
@@ -92095,6 +92114,11 @@ async function run(startedAt) {
apiDetails,
features,
repositoryProperties,
enableFileCoverageInformation: await getFileCoverageInformationEnabled(
debugMode,
repositoryNwo,
features
),
logger
});
await checkInstallPython311(config.languages, codeql);
+18 -12
View File
@@ -87047,6 +87047,15 @@ var featureConfig = {
legacyApi: true,
minimumVersion: void 0
},
["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS",
// For testing, this is not behind a CLI version check yet. However
// before rolling this out externally, we should set a minimum version here
// since current versions of the CodeQL CLI will log if baseline information
// cannot be found when interpreting results.
minimumVersion: void 0
},
["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API",
@@ -87270,6 +87279,10 @@ async function getCodeQLForCmd(cmd, checkVersion) {
} else if (overlayDatabaseMode === "overlay-base" /* OverlayBase */) {
extraArgs.push("--overlay-base");
}
const baselineFilesOptions = config.enableFileCoverageInformation ? [
"--calculate-language-specific-baseline",
"--sublanguage-file-coverage"
] : ["--no-calculate-baseline"];
await runCli(
cmd,
[
@@ -87279,12 +87292,14 @@ async function getCodeQLForCmd(cmd, checkVersion) {
"--db-cluster",
config.dbLocation,
`--source-root=${sourceRoot}`,
"--calculate-language-specific-baseline",
...baselineFilesOptions,
"--extractor-include-aliases",
"--sublanguage-file-coverage",
...extraArgs,
...getExtraOptionsFromEnv(["database", "init"], {
ignoringOptions: ["--overwrite"]
// Some user configs specify `--no-calculate-baseline` as an additional
// argument to `codeql database init`. Therefore ignore the baseline file
// options here to avoid specifying the same argument twice and erroring.
ignoringOptions: ["--overwrite", ...baselineFilesOptions]
})
],
{ stdin: externalRepositoryToken }
@@ -87471,15 +87486,6 @@ ${output}`
noStreamStdout: true
});
},
async databasePrintBaseline(databasePath) {
const codeqlArgs = [
"database",
"print-baseline",
...getExtraOptionsFromEnv(["database", "print-baseline"]),
databasePath
];
return await runCli(cmd, codeqlArgs);
},
async databaseCleanupCluster(config, cleanupLevel) {
const cacheCleanupFlag = await codeQlVersionAtLeast(
this,
+18 -12
View File
@@ -86957,6 +86957,15 @@ var featureConfig = {
legacyApi: true,
minimumVersion: void 0
},
["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS",
// For testing, this is not behind a CLI version check yet. However
// before rolling this out externally, we should set a minimum version here
// since current versions of the CodeQL CLI will log if baseline information
// cannot be found when interpreting results.
minimumVersion: void 0
},
["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API",
@@ -88584,6 +88593,10 @@ async function getCodeQLForCmd(cmd, checkVersion) {
} else if (overlayDatabaseMode === "overlay-base" /* OverlayBase */) {
extraArgs.push("--overlay-base");
}
const baselineFilesOptions = config.enableFileCoverageInformation ? [
"--calculate-language-specific-baseline",
"--sublanguage-file-coverage"
] : ["--no-calculate-baseline"];
await runCli(
cmd,
[
@@ -88593,12 +88606,14 @@ async function getCodeQLForCmd(cmd, checkVersion) {
"--db-cluster",
config.dbLocation,
`--source-root=${sourceRoot}`,
"--calculate-language-specific-baseline",
...baselineFilesOptions,
"--extractor-include-aliases",
"--sublanguage-file-coverage",
...extraArgs,
...getExtraOptionsFromEnv(["database", "init"], {
ignoringOptions: ["--overwrite"]
// Some user configs specify `--no-calculate-baseline` as an additional
// argument to `codeql database init`. Therefore ignore the baseline file
// options here to avoid specifying the same argument twice and erroring.
ignoringOptions: ["--overwrite", ...baselineFilesOptions]
})
],
{ stdin: externalRepositoryToken }
@@ -88785,15 +88800,6 @@ ${output}`
noStreamStdout: true
});
},
async databasePrintBaseline(databasePath) {
const codeqlArgs = [
"database",
"print-baseline",
...getExtraOptionsFromEnv(["database", "print-baseline"]),
databasePath
];
return await runCli(cmd, codeqlArgs);
},
async databaseCleanupCluster(config, cleanupLevel) {
const cacheCleanupFlag = await codeQlVersionAtLeast(
this,
+9
View File
@@ -127377,6 +127377,15 @@ var featureConfig = {
legacyApi: true,
minimumVersion: void 0
},
["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS",
// For testing, this is not behind a CLI version check yet. However
// before rolling this out externally, we should set a minimum version here
// since current versions of the CodeQL CLI will log if baseline information
// cannot be found when interpreting results.
minimumVersion: void 0
},
["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API",
+9
View File
@@ -103926,6 +103926,15 @@ var featureConfig = {
legacyApi: true,
minimumVersion: void 0
},
["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS",
// For testing, this is not behind a CLI version check yet. However
// before rolling this out externally, we should set a minimum version here
// since current versions of the CodeQL CLI will log if baseline information
// cannot be found when interpreting results.
minimumVersion: void 0
},
["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API",
+18 -12
View File
@@ -90116,6 +90116,15 @@ var featureConfig = {
legacyApi: true,
minimumVersion: void 0
},
["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS",
// For testing, this is not behind a CLI version check yet. However
// before rolling this out externally, we should set a minimum version here
// since current versions of the CodeQL CLI will log if baseline information
// cannot be found when interpreting results.
minimumVersion: void 0
},
["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API",
@@ -91299,6 +91308,10 @@ async function getCodeQLForCmd(cmd, checkVersion) {
} else if (overlayDatabaseMode === "overlay-base" /* OverlayBase */) {
extraArgs.push("--overlay-base");
}
const baselineFilesOptions = config.enableFileCoverageInformation ? [
"--calculate-language-specific-baseline",
"--sublanguage-file-coverage"
] : ["--no-calculate-baseline"];
await runCli(
cmd,
[
@@ -91308,12 +91321,14 @@ async function getCodeQLForCmd(cmd, checkVersion) {
"--db-cluster",
config.dbLocation,
`--source-root=${sourceRoot}`,
"--calculate-language-specific-baseline",
...baselineFilesOptions,
"--extractor-include-aliases",
"--sublanguage-file-coverage",
...extraArgs,
...getExtraOptionsFromEnv(["database", "init"], {
ignoringOptions: ["--overwrite"]
// Some user configs specify `--no-calculate-baseline` as an additional
// argument to `codeql database init`. Therefore ignore the baseline file
// options here to avoid specifying the same argument twice and erroring.
ignoringOptions: ["--overwrite", ...baselineFilesOptions]
})
],
{ stdin: externalRepositoryToken }
@@ -91500,15 +91515,6 @@ ${output}`
noStreamStdout: true
});
},
async databasePrintBaseline(databasePath) {
const codeqlArgs = [
"database",
"print-baseline",
...getExtraOptionsFromEnv(["database", "print-baseline"]),
databasePath
];
return await runCli(cmd, codeqlArgs);
},
async databaseCleanupCluster(config, cleanupLevel) {
const cacheCleanupFlag = await codeQlVersionAtLeast(
this,
+9
View File
@@ -127539,6 +127539,15 @@ var featureConfig = {
legacyApi: true,
minimumVersion: void 0
},
["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS",
// For testing, this is not behind a CLI version check yet. However
// before rolling this out externally, we should set a minimum version here
// since current versions of the CodeQL CLI will log if baseline information
// cannot be found when interpreting results.
minimumVersion: void 0
},
["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API",
+18 -12
View File
@@ -89911,6 +89911,15 @@ var featureConfig = {
legacyApi: true,
minimumVersion: void 0
},
["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS",
// For testing, this is not behind a CLI version check yet. However
// before rolling this out externally, we should set a minimum version here
// since current versions of the CodeQL CLI will log if baseline information
// cannot be found when interpreting results.
minimumVersion: void 0
},
["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API",
@@ -91854,6 +91863,10 @@ async function getCodeQLForCmd(cmd, checkVersion) {
} else if (overlayDatabaseMode === "overlay-base" /* OverlayBase */) {
extraArgs.push("--overlay-base");
}
const baselineFilesOptions = config.enableFileCoverageInformation ? [
"--calculate-language-specific-baseline",
"--sublanguage-file-coverage"
] : ["--no-calculate-baseline"];
await runCli(
cmd,
[
@@ -91863,12 +91876,14 @@ async function getCodeQLForCmd(cmd, checkVersion) {
"--db-cluster",
config.dbLocation,
`--source-root=${sourceRoot}`,
"--calculate-language-specific-baseline",
...baselineFilesOptions,
"--extractor-include-aliases",
"--sublanguage-file-coverage",
...extraArgs,
...getExtraOptionsFromEnv(["database", "init"], {
ignoringOptions: ["--overwrite"]
// Some user configs specify `--no-calculate-baseline` as an additional
// argument to `codeql database init`. Therefore ignore the baseline file
// options here to avoid specifying the same argument twice and erroring.
ignoringOptions: ["--overwrite", ...baselineFilesOptions]
})
],
{ stdin: externalRepositoryToken }
@@ -92055,15 +92070,6 @@ ${output}`
noStreamStdout: true
});
},
async databasePrintBaseline(databasePath) {
const codeqlArgs = [
"database",
"print-baseline",
...getExtraOptionsFromEnv(["database", "print-baseline"]),
databasePath
];
return await runCli(cmd, codeqlArgs);
},
async databaseCleanupCluster(config, cleanupLevel) {
const cacheCleanupFlag = await codeQlVersionAtLeast(
this,