mirror of
https://github.com/github/codeql-action.git
synced 2025-12-06 07:48:17 +08:00
Compare commits
2 Commits
267c4672a5
...
hmakholm/p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff1dba567b | ||
|
|
ba2492c508 |
6
lib/environment.js
generated
6
lib/environment.js
generated
@@ -26,6 +26,12 @@ var EnvVar;
|
||||
EnvVar["FEATURE_SARIF_COMBINE"] = "CODEQL_ACTION_FEATURE_SARIF_COMBINE";
|
||||
/** Whether the CodeQL Action will upload SARIF, not the CLI. */
|
||||
EnvVar["FEATURE_WILL_UPLOAD"] = "CODEQL_ACTION_FEATURE_WILL_UPLOAD";
|
||||
/**
|
||||
* This flag tells `codeql database analyze` that the `--ram` option it gets is still
|
||||
* computed by the 2023 algorithm that leaves space for overshooting.
|
||||
* The CLI will _implicitly_ treat this flag as set if the Action version is 2.22.10 or earlier.
|
||||
*/
|
||||
EnvVar["FEATURE_RAM_2023"] = "CODEQL_ACTION_FEATURE_RAM_2023";
|
||||
/** Whether the CodeQL Action has already warned the user about low disk space. */
|
||||
EnvVar["HAS_WARNED_ABOUT_DISK_SPACE"] = "CODEQL_ACTION_HAS_WARNED_ABOUT_DISK_SPACE";
|
||||
/** UUID representing the current job run. */
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":";;;AAAA,IAAY,MAsEX;AAtED,WAAY,MAAM;IAChB,2DAA2D;IAC3D,+FAAqF,CAAA;IAErF,gEAAgE;IAChE,qEAA2D,CAAA;IAE3D;;;OAGG;IACH,yFAA+E,CAAA;IAE/E;;;OAGG;IACH,yEAA+D,CAAA;IAE/D,gFAAgF;IAChF,6DAAmD,CAAA;IAEnD;;;OAGG;IACH,uEAA6D,CAAA;IAE7D,gEAAgE;IAChE,mEAAyD,CAAA;IAEzD,kFAAkF;IAClF,mFAAyE,CAAA;IAEzE,6CAA6C;IAC7C,uCAA6B,CAAA;IAE7B,mEAAyD,CAAA;IAEzD;;;OAGG;IACH,2FAAiF,CAAA;IAEjF,mFAAmF;IACnF,6FAAmF,CAAA;IAEnF,qFAAqF;IACrF,+CAAqC,CAAA;IAErC,mEAAyD,CAAA;IAEzD,kEAAkE;IAClE,2CAAiC,CAAA;IAEjC;;;;;;OAMG;IACH,4DAAkD,CAAA;IAElD;;;OAGG;IACH,wDAA8C,CAAA;AAChD,CAAC,EAtEW,MAAM,sBAAN,MAAM,QAsEjB"}
|
||||
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":";;;AAAA,IAAY,MA6EX;AA7ED,WAAY,MAAM;IAChB,2DAA2D;IAC3D,+FAAqF,CAAA;IAErF,gEAAgE;IAChE,qEAA2D,CAAA;IAE3D;;;OAGG;IACH,yFAA+E,CAAA;IAE/E;;;OAGG;IACH,yEAA+D,CAAA;IAE/D,gFAAgF;IAChF,6DAAmD,CAAA;IAEnD;;;OAGG;IACH,uEAA6D,CAAA;IAE7D,gEAAgE;IAChE,mEAAyD,CAAA;IAEzD;;;;OAIG;IACH,6DAAmD,CAAA;IAEnD,kFAAkF;IAClF,mFAAyE,CAAA;IAEzE,6CAA6C;IAC7C,uCAA6B,CAAA;IAE7B,mEAAyD,CAAA;IAEzD;;;OAGG;IACH,2FAAiF,CAAA;IAEjF,mFAAmF;IACnF,6FAAmF,CAAA;IAEnF,qFAAqF;IACrF,+CAAqC,CAAA;IAErC,mEAAyD,CAAA;IAEzD,kEAAkE;IAClE,2CAAiC,CAAA;IAEjC;;;;;;OAMG;IACH,4DAAkD,CAAA;IAElD;;;OAGG;IACH,wDAA8C,CAAA;AAChD,CAAC,EA7EW,MAAM,sBAAN,MAAM,QA6EjB"}
|
||||
11
lib/util.js
generated
11
lib/util.js
generated
@@ -113,6 +113,16 @@ exports.withTmpDir = withTmpDir;
|
||||
* when the user doesn't explicitly specify a memory setting.
|
||||
* This is a heuristic to avoid OOM errors (exit code 137 / SIGKILL)
|
||||
* from committing too much of the available memory to CodeQL.
|
||||
*
|
||||
* BEWARE: Eventually, with new enough CLIs, this computation can be made
|
||||
* less conservative, because the CLI can now itself reserve space for memory
|
||||
* overhead of the JVM. When this happens, stop passing FEATURE_RAM_2023
|
||||
* feature variable.
|
||||
*
|
||||
* Also this rewrite cannot happen until the Action version is strictly above
|
||||
* 2.22.10, because the CLI will interpret a version of 2.22.10 or lower as
|
||||
* "old action that does not yet know to pass FEATURE_RAM_2023".
|
||||
*
|
||||
* @returns number
|
||||
*/
|
||||
function getSystemReservedMemoryMegaBytes(totalMemoryMegaBytes, platform) {
|
||||
@@ -393,6 +403,7 @@ function initializeEnvironment(version) {
|
||||
core.exportVariable(String(environment_1.EnvVar.FEATURE_SANDWICH), "false");
|
||||
core.exportVariable(String(environment_1.EnvVar.FEATURE_SARIF_COMBINE), "true");
|
||||
core.exportVariable(String(environment_1.EnvVar.FEATURE_WILL_UPLOAD), "true");
|
||||
core.exportVariable(String(environment_1.EnvVar.FEATURE_RAM_2023), "true");
|
||||
core.exportVariable(String(environment_1.EnvVar.VERSION), version);
|
||||
}
|
||||
exports.initializeEnvironment = initializeEnvironment;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -29,6 +29,13 @@ export enum EnvVar {
|
||||
/** Whether the CodeQL Action will upload SARIF, not the CLI. */
|
||||
FEATURE_WILL_UPLOAD = "CODEQL_ACTION_FEATURE_WILL_UPLOAD",
|
||||
|
||||
/**
|
||||
* This flag tells `codeql database analyze` that the `--ram` option it gets is still
|
||||
* computed by the 2023 algorithm that leaves space for overshooting.
|
||||
* The CLI will _implicitly_ treat this flag as set if the Action version is 2.22.10 or earlier.
|
||||
*/
|
||||
FEATURE_RAM_2023 = "CODEQL_ACTION_FEATURE_RAM_2023",
|
||||
|
||||
/** Whether the CodeQL Action has already warned the user about low disk space. */
|
||||
HAS_WARNED_ABOUT_DISK_SPACE = "CODEQL_ACTION_HAS_WARNED_ABOUT_DISK_SPACE",
|
||||
|
||||
|
||||
11
src/util.ts
11
src/util.ts
@@ -161,6 +161,16 @@ export async function withTmpDir<T>(
|
||||
* when the user doesn't explicitly specify a memory setting.
|
||||
* This is a heuristic to avoid OOM errors (exit code 137 / SIGKILL)
|
||||
* from committing too much of the available memory to CodeQL.
|
||||
*
|
||||
* BEWARE: Eventually, with new enough CLIs, this computation can be made
|
||||
* less conservative, because the CLI can now itself reserve space for memory
|
||||
* overhead of the JVM. When this happens, stop passing FEATURE_RAM_2023
|
||||
* feature variable.
|
||||
*
|
||||
* Also this rewrite cannot happen until the Action version is strictly above
|
||||
* 2.22.10, because the CLI will interpret a version of 2.22.10 or lower as
|
||||
* "old action that does not yet know to pass FEATURE_RAM_2023".
|
||||
*
|
||||
* @returns number
|
||||
*/
|
||||
function getSystemReservedMemoryMegaBytes(
|
||||
@@ -539,6 +549,7 @@ export function initializeEnvironment(version: string) {
|
||||
core.exportVariable(String(EnvVar.FEATURE_SANDWICH), "false");
|
||||
core.exportVariable(String(EnvVar.FEATURE_SARIF_COMBINE), "true");
|
||||
core.exportVariable(String(EnvVar.FEATURE_WILL_UPLOAD), "true");
|
||||
core.exportVariable(String(EnvVar.FEATURE_RAM_2023), "true");
|
||||
core.exportVariable(String(EnvVar.VERSION), version);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user