Merge pull request #2450 from paldepind/use-cache-cleanup-flag
Use cache-cleanup command line option
This commit is contained in:
commit
4ac5f37722
4 changed files with 22 additions and 4 deletions
|
|
@ -19,7 +19,7 @@ inputs:
|
|||
# If changing this, make sure to update workflow.ts accordingly.
|
||||
default: "always"
|
||||
cleanup-level:
|
||||
description: "Level of cleanup to perform on CodeQL databases at the end of the analyze step. This should either be 'none' to skip cleanup, or be a valid argument for the --mode flag of the CodeQL CLI command 'codeql database cleanup' as documented at https://codeql.github.com/docs/codeql-cli/manual/database-cleanup"
|
||||
description: "Level of cleanup to perform on CodeQL databases at the end of the analyze step. This should either be 'none' to skip cleanup, or be a valid argument for the --cache-cleanup flag of the CodeQL CLI command 'codeql database cleanup' as documented at https://codeql.github.com/docs/codeql-cli/manual/database-cleanup"
|
||||
required: false
|
||||
default: "brutal"
|
||||
ram:
|
||||
|
|
|
|||
9
lib/codeql.js
generated
9
lib/codeql.js
generated
|
|
@ -105,6 +105,10 @@ exports.CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE = "2.15.0";
|
|||
* Versions 2.15.2+ of the CodeQL CLI support the `--sarif-include-query-help` option.
|
||||
*/
|
||||
const CODEQL_VERSION_INCLUDE_QUERY_HELP = "2.15.2";
|
||||
/**
|
||||
* Versions 2.17.1+ of the CodeQL CLI support the `--cache-cleanup` option.
|
||||
*/
|
||||
const CODEQL_VERSION_CACHE_CLEANUP = "2.17.1";
|
||||
/**
|
||||
* Set up CodeQL CLI access.
|
||||
*
|
||||
|
|
@ -567,11 +571,14 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||
}
|
||||
},
|
||||
async databaseCleanup(databasePath, cleanupLevel) {
|
||||
const cacheCleanupFlag = (await util.codeQlVersionAtLeast(this, CODEQL_VERSION_CACHE_CLEANUP))
|
||||
? "--cache-cleanup"
|
||||
: "--mode";
|
||||
const codeqlArgs = [
|
||||
"database",
|
||||
"cleanup",
|
||||
databasePath,
|
||||
`--mode=${cleanupLevel}`,
|
||||
`${cacheCleanupFlag}=${cleanupLevel}`,
|
||||
...getExtraOptionsFromEnv(["database", "cleanup"]),
|
||||
];
|
||||
await runTool(cmd, codeqlArgs);
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -327,6 +327,11 @@ export const CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE = "2.15.0";
|
|||
*/
|
||||
const CODEQL_VERSION_INCLUDE_QUERY_HELP = "2.15.2";
|
||||
|
||||
/**
|
||||
* Versions 2.17.1+ of the CodeQL CLI support the `--cache-cleanup` option.
|
||||
*/
|
||||
const CODEQL_VERSION_CACHE_CLEANUP = "2.17.1";
|
||||
|
||||
/**
|
||||
* Set up CodeQL CLI access.
|
||||
*
|
||||
|
|
@ -973,11 +978,17 @@ export async function getCodeQLForCmd(
|
|||
databasePath: string,
|
||||
cleanupLevel: string,
|
||||
): Promise<void> {
|
||||
const cacheCleanupFlag = (await util.codeQlVersionAtLeast(
|
||||
this,
|
||||
CODEQL_VERSION_CACHE_CLEANUP,
|
||||
))
|
||||
? "--cache-cleanup"
|
||||
: "--mode";
|
||||
const codeqlArgs = [
|
||||
"database",
|
||||
"cleanup",
|
||||
databasePath,
|
||||
`--mode=${cleanupLevel}`,
|
||||
`${cacheCleanupFlag}=${cleanupLevel}`,
|
||||
...getExtraOptionsFromEnv(["database", "cleanup"]),
|
||||
];
|
||||
await runTool(cmd, codeqlArgs);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue