Compare commits

...

27 Commits

Author SHA1 Message Date
Henry Mercer 794f5bc385 Fix the memory check debug message at equality
The comparison accepts exactly the minimum, so say "at or above", to
match the wording of the disk space check.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-06 16:48:44 +01:00
Henry Mercer 54109818e0 Address review feedback on the disk space check
Say "at or above" in the debug message logged when the check passes,
since the comparison accepts exactly the minimum.

Check each feature flag against the threshold its name declares, rather
than only exercising a few of them, so that a mistake in one of the
mappings cannot go unnoticed. Both sides of the boundary are needed to
pin a threshold down: a mapping to a lower value would still pass the
case at the limit, and one to a higher value would still fail the case
below it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-06 16:41:48 +01:00
Henry Mercer 99caaa8b90 Remove the overlay_analysis_resource_checks_v2 feature flag
The flag no longer has any effect now that its 14 GB threshold is the
unconditional default, so remove it. Setting
CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2 no longer does
anything.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-06 16:38:34 +01:00
Henry Mercer 6117bb503a Derive overlay minimum disk space from feature flags
Overlay analysis required 20 GB of available disk space, lowered to
14 GB when overlay_analysis_resource_checks_v2 was enabled. That gave
us a single step to roll out, and any further reduction needed another
flag and another release.

Determine the threshold from the new overlay_analysis_min_disk_N_gb
flags instead, taking the lowest one that is enabled so that a lower
limit can be rolled out to a subset of repositories without first
disabling the flag above it. When none are enabled, the 14 GB limit
now applies unconditionally, replacing the 20 GB default.

Thresholds remain in decimal MB, matching the bytes-per-MB convention
the disk check already used, so the effective byte values are unchanged
from the previous 14 GB path. Also log the available and required space
at debug level when the check passes, so that run logs show which
threshold took effect.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-06 16:38:33 +01:00
Henry Mercer af767ec1f6 Add overlay_analysis_min_disk_N_gb feature flags
Add six feature flags, overlay_analysis_min_disk_8_gb through
overlay_analysis_min_disk_13_gb, which will be used to control the
amount of available disk space that overlay analysis requires.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-06 16:38:33 +01:00
Henry Mercer 7d9249f5a5 Merge pull request #4076 from github/dependabot/npm_and_yarn/npm-minor-b3aad9cfa5
Bump globals from 17.7.0 to 17.8.0 in the npm-minor group across 1 directory
2026-08-06 11:26:17 +00:00
Henry Mercer 8ebf1091b0 Merge pull request #4077 from github/dependabot/github_actions/dot-github/workflows/actions-minor-6bc1927ba3
Bump actions/setup-java from 5.6.0 to 5.7.0 in /.github/workflows in the actions-minor group across 1 directory
2026-08-06 11:25:11 +00:00
github-actions[bot] bdf39710a2 Rebuild 2026-08-05 17:59:47 +00:00
dependabot[bot] 74cfae9be6 Bump actions/setup-java
Bumps the actions-minor group with 1 update in the /.github/workflows directory: [actions/setup-java](https://github.com/actions/setup-java).


Updates `actions/setup-java` from 5.6.0 to 5.7.0
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/03ad4de0992f5dab5e18fcb136590ce7c4a0ac95...b6effb05e454b25005698d916606bdc6ffcbf961)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 5.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-05 17:56:46 +00:00
dependabot[bot] 47a0a833bb Bump globals in the npm-minor group across 1 directory
Bumps the npm-minor group with 1 update in the / directory: [globals](https://github.com/sindresorhus/globals).


Updates `globals` from 17.7.0 to 17.8.0
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](https://github.com/sindresorhus/globals/compare/v17.7.0...v17.8.0)

---
updated-dependencies:
- dependency-name: globals
  dependency-version: 17.8.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-05 17:54:39 +00:00
Michael B. Gale 6a90bf1f54 Merge pull request #4075 from github/dependabot/npm_and_yarn/brace-expansion-1.1.18
Bump brace-expansion from 1.1.16 to 1.1.18
2026-08-04 14:52:59 +00:00
github-actions[bot] c5995f544d Rebuild 2026-08-04 14:19:52 +00:00
dependabot[bot] 76c44396d3 Bump brace-expansion from 1.1.16 to 1.1.18
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.16 to 1.1.18.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v1.1.16...v1.1.18)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.18
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-04 14:18:04 +00:00
Michael B. Gale fad141fa6c Merge pull request #4073 from github/mergeback/v4.37.6-to-main-5595ccaf
Mergeback v4.37.6 refs/heads/releases/v4 into main
2026-08-04 14:03:40 +00:00
github-actions[bot] 7d82f1132f Rebuild 2026-08-04 13:34:54 +00:00
github-actions[bot] 37bdbde050 Update changelog and version after v4.37.6 2026-08-04 13:34:41 +00:00
Michael B. Gale 5595ccaf91 Merge pull request #4071 from github/update-v4.37.6-6a9359a1b
Merge main into releases/v4
2026-08-04 14:33:02 +01:00
Michael B. Gale ec9c75796a Add change note for PR 4070 2026-08-04 14:19:36 +01:00
github-actions[bot] 45c8742e17 Update changelog for v4.37.6 2026-08-04 13:15:26 +00:00
Michael B. Gale 6a9359a1bd Merge pull request #4070 from github/mbg/remote-address/change-file-default
Change `DEFAULT_CONFIG_FILE_NAME`
2026-08-03 14:18:48 +00:00
Michael B. Gale 065cdc0394 Change DEFAULT_CONFIG_FILE_NAME 2026-08-03 15:02:48 +01:00
Michael B. Gale f99dd5aeee Merge pull request #4066 from github/dependabot/npm_and_yarn/js-yaml-5.2.2
Bump js-yaml from 5.2.1 to 5.2.2
2026-08-03 13:26:42 +00:00
Henry Mercer 1804b211a3 Merge pull request #4068 from github/mergeback/v4.37.5-to-main-d1ba80a1
Mergeback v4.37.5 refs/heads/releases/v4 into main
2026-08-03 11:43:09 +00:00
github-actions[bot] 3020a2f462 Rebuild 2026-08-03 11:03:06 +00:00
github-actions[bot] 93c3a5a40b Update changelog and version after v4.37.5 2026-08-03 11:02:52 +00:00
github-actions[bot] 266c7bdbd2 Rebuild 2026-08-01 14:26:29 +00:00
dependabot[bot] daa7fe6fba Bump js-yaml from 5.2.1 to 5.2.2
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 5.2.1 to 5.2.2.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/5.2.1...5.2.2)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 5.2.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-01 14:24:54 +00:00
11 changed files with 708 additions and 321 deletions
@@ -63,7 +63,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Java
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
java-version: ${{ inputs.java-version || '17' }}
distribution: temurin
+1 -1
View File
@@ -63,7 +63,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Java
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
java-version: ${{ inputs.java-version || '17' }}
distribution: temurin
+8
View File
@@ -2,6 +2,14 @@
See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs.
## [UNRELEASED]
No user facing changes.
## 4.37.6 - 04 Aug 2026
- Changed the default filepath for the new remote file address format that was introduced in CodeQL Action 4.37.0 / 3.37.0 to `.github/codeql-config.yml` to align it with the suggested path that is used elsewhere. [#4070](https://github.com/github/codeql-action/pull/4070)
## 4.37.5 - 03 Aug 2026
- Fixed a bug where a network error while streaming the download of the CodeQL bundle could terminate the `init` Action instead of falling back to downloading the bundle before extracting it. [#4061](https://github.com/github/codeql-action/pull/4061)
+476 -228
View File
@@ -31227,6 +31227,8 @@ var require_brace_expansion = __commonJS({
var escClose2 = "\0CLOSE" + Math.random() + "\0";
var escComma2 = "\0COMMA" + Math.random() + "\0";
var escPeriod2 = "\0PERIOD" + Math.random() + "\0";
var EXPANSION_MAX2 = 1e5;
var EXPANSION_MAX_LENGTH2 = 4e6;
function numeric2(str) {
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
}
@@ -31260,11 +31262,12 @@ var require_brace_expansion = __commonJS({
if (!str)
return [];
options = options || {};
var max = options.max == null ? Infinity : options.max;
var max = options.max == null ? EXPANSION_MAX2 : options.max;
var maxLength = options.maxLength == null ? EXPANSION_MAX_LENGTH2 : options.maxLength;
if (str.substr(0, 2) === "{}") {
str = "\\{\\}" + str.substr(2);
}
return expand3(escapeBraces2(str), max, true).map(unescapeBraces2);
return expand3(escapeBraces2(str), max, maxLength, true).map(unescapeBraces2);
}
function embrace2(str) {
return "{" + str + "}";
@@ -31278,11 +31281,82 @@ var require_brace_expansion = __commonJS({
function gte7(i, y) {
return i >= y;
}
function expand3(str, max, isTop) {
var expansions = [];
function combine2(acc, base, pre, values, max, maxLength, dropEmpties, outBase) {
var out = [];
var length = 0;
for (var a = 0; a < acc.length; a++) {
for (var v = 0; v < values.length; v++) {
if (out.length >= max) return out;
var expansion = acc[a] + pre + values[v];
if (dropEmpties && expansion.length === base[a]) continue;
if (length + expansion.length > maxLength) return out;
out.push(expansion);
outBase.push(base[a]);
length += expansion.length;
}
}
return out;
}
function expandSequence2(body, isAlphaSequence, max, maxLength) {
var n = body.split(/\.\./);
var N = [];
if (n[0] === void 0 || n[1] === void 0) {
return N;
}
var x = numeric2(n[0]);
var y = numeric2(n[1]);
var width = Math.max(n[0].length, n[1].length);
var incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric2(n[2])), 1) : 1;
var test = lte2;
var reverse = y < x;
if (reverse) {
incr *= -1;
test = gte7;
}
var pad = n.some(isPadded2);
var length = 0;
for (var i = x; test(i, y) && N.length < max; i += incr) {
var c;
if (isAlphaSequence) {
c = String.fromCharCode(i);
if (c === "\\") {
c = "";
}
} else {
c = String(i);
if (pad) {
var need = width - c.length;
if (need > 0) {
var z = new Array(need + 1).join("0");
if (i < 0) {
c = "-" + z + c.slice(1);
} else {
c = z + c;
}
}
}
}
if (length + c.length > maxLength) break;
N.push(c);
length += c.length;
}
return N;
}
function expand3(str, max, maxLength, isTop) {
var acc = [""];
var accBase = [0];
var dropEmpties = false;
var firstGroup = true;
var nextBase;
for (; ; ) {
var m = balanced2("{", "}", str);
if (!m || /\$$/.test(m.pre)) return [str];
if (!m) {
return combine2(acc, accBase, str, [""], max, maxLength, dropEmpties, []);
}
var pre = m.pre;
if (/\$$/.test(pre)) {
return combine2(acc, accBase, str, [""], max, maxLength, dropEmpties, []);
}
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
var isSequence = isNumericSequence || isAlphaSequence;
@@ -31291,76 +31365,91 @@ var require_brace_expansion = __commonJS({
if (m.post.match(/,(?!,).*\}/)) {
str = m.pre + "{" + m.body + escClose2 + m.post;
isTop = true;
firstGroup = true;
dropEmpties = false;
accBase = [];
for (var b = 0; b < acc.length; b++) {
accBase.push(acc[b].length);
}
continue;
}
return [str];
return combine2(
acc,
accBase,
pre + "{" + m.body + "}" + m.post,
[""],
max,
maxLength,
dropEmpties,
[]
);
}
var n;
if (firstGroup) {
dropEmpties = isTop && !isSequence;
firstGroup = false;
}
var values;
if (isSequence) {
n = m.body.split(/\.\./);
values = expandSequence2(m.body, isAlphaSequence, max, maxLength);
} else {
n = parseCommaParts2(m.body);
if (n.length === 1) {
n = expand3(n[0], max, false).map(embrace2);
var n = parseCommaParts2(m.body);
if (n.length === 1 && n[0] !== void 0) {
n = expand3(n[0], max, maxLength, false).map(embrace2);
if (n.length === 1) {
var post = m.post.length ? expand3(m.post, max, false) : [""];
return post.map(function(p) {
return m.pre + n[0] + p;
});
nextBase = [];
acc = combine2(
acc,
accBase,
pre + n[0],
[""],
max,
maxLength,
dropEmpties && !m.post.length,
nextBase
);
accBase = nextBase;
if (!m.post.length) break;
str = m.post;
continue;
}
}
}
var pre = m.pre;
var post = m.post.length ? expand3(m.post, max, false) : [""];
var N;
if (isSequence) {
var x = numeric2(n[0]);
var y = numeric2(n[1]);
var width = Math.max(n[0].length, n[1].length);
var incr = n.length == 3 ? Math.max(Math.abs(numeric2(n[2])), 1) : 1;
var test = lte2;
var reverse = y < x;
if (reverse) {
incr *= -1;
test = gte7;
var dropsEmpties = dropEmpties && !m.post.length && !pre;
for (var d = 0; dropsEmpties && d < acc.length; d++) {
if (acc[d].length !== accBase[d]) {
dropsEmpties = false;
}
}
var pad = n.some(isPadded2);
N = [];
for (var i = x; test(i, y) && N.length < max; i += incr) {
var c;
if (isAlphaSequence) {
c = String.fromCharCode(i);
if (c === "\\")
c = "";
} else {
c = String(i);
if (pad) {
var need = width - c.length;
if (need > 0) {
var z = new Array(need + 1).join("0");
if (i < 0)
c = "-" + z + c.slice(1);
else
c = z + c;
}
values = [];
var valuesLength = 0;
outer: for (var j = 0; j < n.length; j++) {
var expanded = expand3(n[j], max, maxLength, false);
for (var k = 0; k < expanded.length; k++) {
var v = expanded[k];
if (dropsEmpties && !v) continue;
if (values.length >= max || valuesLength + v.length > maxLength) {
break outer;
}
values.push(v);
valuesLength += v.length;
}
N.push(c);
}
} else {
N = concatMap(n, function(el) {
return expand3(el, max, false);
});
}
for (var j = 0; j < N.length; j++) {
for (var k = 0; k < post.length && expansions.length < max; k++) {
var expansion = pre + N[j] + post[k];
if (!isTop || isSequence || expansion)
expansions.push(expansion);
}
}
return expansions;
nextBase = [];
acc = combine2(
acc,
accBase,
pre,
values,
max,
maxLength,
dropEmpties && !m.post.length,
nextBase
);
accBase = nextBase;
if (!m.post.length) break;
str = m.post;
}
return acc;
}
}
});
@@ -89012,6 +89101,8 @@ var require_brace_expansion2 = __commonJS({
var escClose2 = "\0CLOSE" + Math.random() + "\0";
var escComma2 = "\0COMMA" + Math.random() + "\0";
var escPeriod2 = "\0PERIOD" + Math.random() + "\0";
var EXPANSION_MAX2 = 1e5;
var EXPANSION_MAX_LENGTH2 = 4e6;
function numeric2(str) {
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
}
@@ -89045,11 +89136,12 @@ var require_brace_expansion2 = __commonJS({
if (!str)
return [];
options = options || {};
var max = options.max == null ? Infinity : options.max;
var max = options.max == null ? EXPANSION_MAX2 : options.max;
var maxLength = options.maxLength == null ? EXPANSION_MAX_LENGTH2 : options.maxLength;
if (str.substr(0, 2) === "{}") {
str = "\\{\\}" + str.substr(2);
}
return expand3(escapeBraces2(str), max, true).map(unescapeBraces2);
return expand3(escapeBraces2(str), max, maxLength, true).map(unescapeBraces2);
}
function embrace2(str) {
return "{" + str + "}";
@@ -89063,19 +89155,89 @@ var require_brace_expansion2 = __commonJS({
function gte7(i, y) {
return i >= y;
}
function expand3(str, max, isTop) {
var expansions = [];
function combine2(acc, pre, values, max, maxLength, dropEmpties) {
var out = [];
var length = 0;
for (var a = 0; a < acc.length; a++) {
for (var v = 0; v < values.length; v++) {
if (out.length >= max) return out;
var expansion = acc[a] + pre + values[v];
if (dropEmpties && !expansion) continue;
if (length + expansion.length > maxLength) return out;
out.push(expansion);
length += expansion.length;
}
}
return out;
}
function expandSequence2(body, isAlphaSequence, max, maxLength) {
var n = body.split(/\.\./);
var N = [];
if (n[0] === void 0 || n[1] === void 0) {
return N;
}
var x = numeric2(n[0]);
var y = numeric2(n[1]);
var width = Math.max(n[0].length, n[1].length);
var incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric2(n[2])), 1) : 1;
var test = lte2;
var reverse = y < x;
if (reverse) {
incr *= -1;
test = gte7;
}
var pad = n.some(isPadded2);
var length = 0;
for (var i = x; test(i, y) && N.length < max; i += incr) {
var c;
if (isAlphaSequence) {
c = String.fromCharCode(i);
if (c === "\\") {
c = "";
}
} else {
c = String(i);
if (pad) {
var need = width - c.length;
if (need > 0) {
var z = new Array(need + 1).join("0");
if (i < 0) {
c = "-" + z + c.slice(1);
} else {
c = z + c;
}
}
}
}
if (length + c.length > maxLength) break;
N.push(c);
length += c.length;
}
return N;
}
function expand3(str, max, maxLength, isTop) {
var acc = [""];
var dropEmpties = false;
var firstGroup = true;
for (; ; ) {
const m = balanced2("{", "}", str);
if (!m) return [str];
if (!m) {
return combine2(acc, str, [""], max, maxLength, dropEmpties);
}
const pre = m.pre;
if (/\$$/.test(m.pre)) {
const post2 = m.post.length ? expand3(m.post, max, false) : [""];
for (let k2 = 0; k2 < post2.length && k2 < max; k2++) {
const expansion2 = pre + "{" + m.body + "}" + post2[k2];
expansions.push(expansion2);
}
return expansions;
if (/\$$/.test(pre)) {
acc = combine2(
acc,
pre + "{" + m.body + "}",
[""],
max,
maxLength,
dropEmpties && !m.post.length
);
firstGroup = false;
if (!m.post.length) break;
str = m.post;
continue;
}
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
@@ -89087,73 +89249,66 @@ var require_brace_expansion2 = __commonJS({
isTop = true;
continue;
}
return [str];
return combine2(
acc,
pre + "{" + m.body + "}" + m.post,
[""],
max,
maxLength,
dropEmpties
);
}
const post = m.post.length ? expand3(m.post, max, false) : [""];
var n;
if (firstGroup) {
dropEmpties = isTop && !isSequence;
firstGroup = false;
}
var values;
if (isSequence) {
n = m.body.split(/\.\./);
values = expandSequence2(m.body, isAlphaSequence, max, maxLength);
} else {
n = parseCommaParts2(m.body);
if (n.length === 1) {
n = expand3(n[0], max, false).map(embrace2);
var n = parseCommaParts2(m.body);
if (n.length === 1 && n[0] !== void 0) {
n = expand3(n[0], max, maxLength, false).map(embrace2);
if (n.length === 1) {
return post.map(function(p) {
return m.pre + n[0] + p;
});
acc = combine2(
acc,
pre + n[0],
[""],
max,
maxLength,
dropEmpties && !m.post.length
);
if (!m.post.length) break;
str = m.post;
continue;
}
}
}
var N;
if (isSequence) {
var x = numeric2(n[0]);
var y = numeric2(n[1]);
var width = Math.max(n[0].length, n[1].length);
var incr = n.length == 3 ? Math.max(Math.abs(numeric2(n[2])), 1) : 1;
var test = lte2;
var reverse = y < x;
if (reverse) {
incr *= -1;
test = gte7;
var dropsEmpties = dropEmpties && !m.post.length && !pre;
for (var d = 0; dropsEmpties && d < acc.length; d++) {
if (acc[d]) {
dropsEmpties = false;
}
}
var pad = n.some(isPadded2);
N = [];
for (var i = x; test(i, y) && N.length < max; i += incr) {
var c;
if (isAlphaSequence) {
c = String.fromCharCode(i);
if (c === "\\")
c = "";
} else {
c = String(i);
if (pad) {
var need = width - c.length;
if (need > 0) {
var z = new Array(need + 1).join("0");
if (i < 0)
c = "-" + z + c.slice(1);
else
c = z + c;
}
values = [];
var valuesLength = 0;
outer: for (var j = 0; j < n.length; j++) {
var expanded = expand3(n[j], max, maxLength, false);
for (var k = 0; k < expanded.length; k++) {
var v = expanded[k];
if (dropsEmpties && !v) continue;
if (values.length >= max || valuesLength + v.length > maxLength) {
break outer;
}
values.push(v);
valuesLength += v.length;
}
N.push(c);
}
} else {
N = [];
for (var j = 0; j < n.length; j++) {
N.push.apply(N, expand3(n[j], max, false));
}
}
for (var j = 0; j < N.length; j++) {
for (var k = 0; k < post.length && expansions.length < max; k++) {
var expansion = pre + N[j] + post[k];
if (!isTop || isSequence || expansion)
expansions.push(expansion);
}
}
return expansions;
acc = combine2(acc, pre, values, max, maxLength, dropEmpties && !m.post.length);
if (!m.post.length) break;
str = m.post;
}
return acc;
}
}
});
@@ -143051,6 +143206,17 @@ function addMappingEvent(state, start, anchorStart, anchorEnd, tagStart, tagEnd,
style
});
}
function insertFlowPairMappingEvent(state, snapshot) {
state.events.splice(snapshot.eventsLength, 0, {
type: 3,
start: snapshot.position,
anchorStart: NO_RANGE$1,
anchorEnd: NO_RANGE$1,
tagStart: NO_RANGE$1,
tagEnd: NO_RANGE$1,
style: 2
});
}
function addScalarEvent(state, valueStart, valueEnd, anchorStart, anchorEnd, tagStart, tagEnd, style, chomping = 1, indent = -1, fast = false) {
state.events.push({
type: 4,
@@ -143494,12 +143660,8 @@ function readFlowCollection(state, nodeIndent, props) {
state.position++;
skipFlowSeparationSpace(state, nodeIndent);
if (!isMapping) {
restoreState(state, entryStart);
addMappingEvent(state, entryStart.position, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, 2);
if (!parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)) addEmptyScalarEvent(state);
skipFlowSeparationSpace(state, nodeIndent);
state.position++;
skipFlowSeparationSpace(state, nodeIndent);
insertFlowPairMappingEvent(state, entryStart);
if (!keyWasRead) addEmptyScalarEvent(state);
} else if (!keyWasRead) addEmptyScalarEvent(state);
if (!parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)) addEmptyScalarEvent(state);
skipFlowSeparationSpace(state, nodeIndent);
@@ -143509,9 +143671,8 @@ function readFlowCollection(state, nodeIndent, props) {
addEmptyScalarEvent(state);
} else if (isMapping) addEmptyScalarEvent(state);
else if (isPair) {
restoreState(state, entryStart);
addMappingEvent(state, entryStart.position, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, 2);
parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
insertFlowPairMappingEvent(state, entryStart);
if (!keyWasRead) addEmptyScalarEvent(state);
addEmptyScalarEvent(state);
addPopEvent(state);
}
@@ -144148,7 +144309,7 @@ function isNsCharOrWhitespace(c) {
function isPlainSafe(c, prev, inblock) {
const cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
const cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar;
return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar && (inblock || c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET);
}
function isPlainSafeFirst(c) {
return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
@@ -145420,7 +145581,7 @@ function getDiffRangesJsonFilePath(env = getEnv()) {
return path2.join(getTemporaryDirectory(env), PR_DIFF_RANGE_JSON_FILENAME);
}
function getActionVersion() {
return "4.37.5";
return "4.37.7";
}
function getWorkflowEventName(env = getEnv()) {
return env.getRequired("GITHUB_EVENT_NAME" /* GITHUB_EVENT_NAME */);
@@ -147221,9 +147382,34 @@ var featureConfig = {
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MATCH_CODEQL_VERSION_DRY_RUN",
minimumVersion: void 0
},
["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: {
["overlay_analysis_min_disk_8_gb" /* OverlayAnalysisMinDisk8Gb */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2",
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MIN_DISK_8_GB",
minimumVersion: void 0
},
["overlay_analysis_min_disk_9_gb" /* OverlayAnalysisMinDisk9Gb */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MIN_DISK_9_GB",
minimumVersion: void 0
},
["overlay_analysis_min_disk_10_gb" /* OverlayAnalysisMinDisk10Gb */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MIN_DISK_10_GB",
minimumVersion: void 0
},
["overlay_analysis_min_disk_11_gb" /* OverlayAnalysisMinDisk11Gb */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MIN_DISK_11_GB",
minimumVersion: void 0
},
["overlay_analysis_min_disk_12_gb" /* OverlayAnalysisMinDisk12Gb */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MIN_DISK_12_GB",
minimumVersion: void 0
},
["overlay_analysis_min_disk_13_gb" /* OverlayAnalysisMinDisk13Gb */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MIN_DISK_13_GB",
minimumVersion: void 0
},
["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: {
@@ -148678,7 +148864,7 @@ function parseUserConfig(logger, pathInput, contents, validateConfig) {
}
// src/config/remote-file.ts
var DEFAULT_CONFIG_FILE_NAME = ".github/codeql-action.yaml";
var DEFAULT_CONFIG_FILE_NAME = ".github/codeql-config.yml";
var DEFAULT_CONFIG_FILE_REF = "main";
function getDefaultOwner(env) {
const currentRepoNwo = env.getRequired("GITHUB_REPOSITORY" /* GITHUB_REPOSITORY */);
@@ -149456,10 +149642,15 @@ async function cachePrefix(codeql, language) {
}
// src/config-utils.ts
var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 2e4;
var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1e6;
var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB = 14e3;
var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6;
var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 14e3;
var OVERLAY_MINIMUM_DISK_SPACE_FEATURES = [
["overlay_analysis_min_disk_8_gb" /* OverlayAnalysisMinDisk8Gb */, 8e3],
["overlay_analysis_min_disk_9_gb" /* OverlayAnalysisMinDisk9Gb */, 9e3],
["overlay_analysis_min_disk_10_gb" /* OverlayAnalysisMinDisk10Gb */, 1e4],
["overlay_analysis_min_disk_11_gb" /* OverlayAnalysisMinDisk11Gb */, 11e3],
["overlay_analysis_min_disk_12_gb" /* OverlayAnalysisMinDisk12Gb */, 12e3],
["overlay_analysis_min_disk_13_gb" /* OverlayAnalysisMinDisk13Gb */, 13e3]
];
var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024;
var CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE = "2.24.3";
async function getSupportedLanguageMap(codeql, logger) {
@@ -149709,16 +149900,26 @@ async function checkOverlayAnalysisFeatureEnabled(features, codeql, languages, c
}
return new Success(void 0);
}
function runnerHasSufficientDiskSpace(diskUsage, logger, useV2ResourceChecks) {
const minimumDiskSpaceBytes = useV2ResourceChecks ? OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES : OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES;
if (diskUsage.numAvailableBytes < minimumDiskSpaceBytes) {
const diskSpaceMb = Math.round(diskUsage.numAvailableBytes / 1e6);
const minimumDiskSpaceMb = Math.round(minimumDiskSpaceBytes / 1e6);
async function getMinimumDiskSpaceMb(features) {
let minimumMb = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB;
for (const [feature, thresholdMb] of OVERLAY_MINIMUM_DISK_SPACE_FEATURES) {
if (await features.getValue(feature)) {
minimumMb = Math.min(minimumMb, thresholdMb);
}
}
return minimumMb;
}
function runnerHasSufficientDiskSpace(diskUsage, logger, minimumDiskSpaceMb) {
const diskSpaceMb = Math.round(diskUsage.numAvailableBytes / 1e6);
if (diskUsage.numAvailableBytes < minimumDiskSpaceMb * 1e6) {
logger.info(
`Setting overlay database mode to ${"none" /* None */} due to insufficient disk space (${diskSpaceMb} MB, needed ${minimumDiskSpaceMb} MB).`
);
return false;
}
logger.debug(
`Disk space available for CodeQL analysis is ${diskSpaceMb} MB, which is at or above the minimum of ${minimumDiskSpaceMb} MB.`
);
return true;
}
async function runnerHasSufficientMemory(codeql, ramInput, logger) {
@@ -149739,12 +149940,13 @@ async function runnerHasSufficientMemory(codeql, ramInput, logger) {
return false;
}
logger.debug(
`Memory available for CodeQL analysis is ${memoryFlagValue} MB, which is above the minimum of ${OVERLAY_MINIMUM_MEMORY_MB} MB.`
`Memory available for CodeQL analysis is ${memoryFlagValue} MB, which is at or above the minimum of ${OVERLAY_MINIMUM_MEMORY_MB} MB.`
);
return true;
}
async function checkRunnerResources(codeql, diskUsage, ramInput, logger, useV2ResourceChecks) {
if (!runnerHasSufficientDiskSpace(diskUsage, logger, useV2ResourceChecks)) {
async function checkRunnerResources(codeql, features, diskUsage, ramInput, logger) {
const minimumDiskSpaceMb = await getMinimumDiskSpaceMb(features);
if (!runnerHasSufficientDiskSpace(diskUsage, logger, minimumDiskSpaceMb)) {
return new Failure("insufficient-disk-space" /* InsufficientDiskSpace */);
}
if (!await runnerHasSufficientMemory(codeql, ramInput, logger)) {
@@ -149792,9 +149994,6 @@ async function checkOverlayEnablement(codeql, features, languages, sourceRoot, b
"overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */,
codeql
);
const useV2ResourceChecks = await features.getValue(
"overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */
);
const checkOverlayStatus = await features.getValue(
"overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */
);
@@ -149808,10 +150007,10 @@ async function checkOverlayEnablement(codeql, features, languages, sourceRoot, b
}
const resourceResult = performResourceChecks && diskUsage !== void 0 ? await checkRunnerResources(
codeql,
features,
diskUsage,
ramInput,
logger,
useV2ResourceChecks
logger
) : new Success(void 0);
if (resourceResult.isFailure()) {
return resourceResult;
@@ -155673,6 +155872,7 @@ var closePattern = /\\}/g;
var commaPattern = /\\,/g;
var periodPattern = /\\\./g;
var EXPANSION_MAX = 1e5;
var EXPANSION_MAX_LENGTH = 4e6;
function numeric(str) {
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
}
@@ -155707,11 +155907,11 @@ function expand2(str, options = {}) {
if (!str) {
return [];
}
const { max = EXPANSION_MAX } = options;
const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options;
if (str.slice(0, 2) === "{}") {
str = "\\{\\}" + str.slice(2);
}
return expand_(escapeBraces(str), max, true).map(unescapeBraces);
return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces);
}
function embrace(str) {
return "{" + str + "}";
@@ -155725,20 +155925,87 @@ function lte(i, y) {
function gte6(i, y) {
return i >= y;
}
function expand_(str, max, isTop) {
const expansions = [];
function combine(acc, pre, values, max, maxLength, dropEmpties) {
const out = [];
let length = 0;
for (let a = 0; a < acc.length; a++) {
for (let v = 0; v < values.length; v++) {
if (out.length >= max)
return out;
const expansion = acc[a] + pre + values[v];
if (dropEmpties && !expansion)
continue;
if (length + expansion.length > maxLength)
return out;
out.push(expansion);
length += expansion.length;
}
}
return out;
}
function expandSequence(body, isAlphaSequence, max, maxLength) {
const n = body.split(/\.\./);
const N = [];
if (n[0] === void 0 || n[1] === void 0) {
return N;
}
const x = numeric(n[0]);
const y = numeric(n[1]);
const width = Math.max(n[0].length, n[1].length);
let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
let test = lte;
const reverse = y < x;
if (reverse) {
incr *= -1;
test = gte6;
}
const pad = n.some(isPadded);
let length = 0;
for (let i = x; test(i, y) && N.length < max; i += incr) {
let c;
if (isAlphaSequence) {
c = String.fromCharCode(i);
if (c === "\\") {
c = "";
}
} else {
c = String(i);
if (pad) {
const need = width - c.length;
if (need > 0) {
const z = new Array(need + 1).join("0");
if (i < 0) {
c = "-" + z + c.slice(1);
} else {
c = z + c;
}
}
}
}
if (length + c.length > maxLength)
break;
N.push(c);
length += c.length;
}
return N;
}
function expand_(str, max, maxLength, isTop) {
let acc = [""];
let dropEmpties = false;
let firstGroup = true;
for (; ; ) {
const m = balanced("{", "}", str);
if (!m)
return [str];
if (!m) {
return combine(acc, str, [""], max, maxLength, dropEmpties);
}
const pre = m.pre;
if (/\$$/.test(m.pre)) {
const post2 = m.post.length ? expand_(m.post, max, false) : [""];
for (let k = 0; k < post2.length && k < max; k++) {
const expansion = pre + "{" + m.body + "}" + post2[k];
expansions.push(expansion);
}
return expansions;
if (/\$$/.test(pre)) {
acc = combine(acc, pre + "{" + m.body + "}", [""], max, maxLength, dropEmpties && !m.post.length);
firstGroup = false;
if (!m.post.length)
break;
str = m.post;
continue;
}
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
@@ -155750,74 +156017,55 @@ function expand_(str, max, isTop) {
isTop = true;
continue;
}
return [str];
return combine(acc, pre + "{" + m.body + "}" + m.post, [""], max, maxLength, dropEmpties);
}
const post = m.post.length ? expand_(m.post, max, false) : [""];
let n;
if (firstGroup) {
dropEmpties = isTop && !isSequence;
firstGroup = false;
}
let values;
if (isSequence) {
n = m.body.split(/\.\./);
values = expandSequence(m.body, isAlphaSequence, max, maxLength);
} else {
n = parseCommaParts(m.body);
let n = parseCommaParts(m.body);
if (n.length === 1 && n[0] !== void 0) {
n = expand_(n[0], max, false).map(embrace);
n = expand_(n[0], max, maxLength, false).map(embrace);
if (n.length === 1) {
return post.map((p) => m.pre + n[0] + p);
acc = combine(acc, pre + n[0], [""], max, maxLength, dropEmpties && !m.post.length);
if (!m.post.length)
break;
str = m.post;
continue;
}
}
}
let N;
if (isSequence && n[0] !== void 0 && n[1] !== void 0) {
const x = numeric(n[0]);
const y = numeric(n[1]);
const width = Math.max(n[0].length, n[1].length);
let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
let test = lte;
const reverse = y < x;
if (reverse) {
incr *= -1;
test = gte6;
let dropsEmpties = dropEmpties && !m.post.length && !pre;
for (let d = 0; dropsEmpties && d < acc.length; d++) {
if (acc[d]) {
dropsEmpties = false;
}
}
const pad = n.some(isPadded);
N = [];
for (let i = x; test(i, y) && N.length < max; i += incr) {
let c;
if (isAlphaSequence) {
c = String.fromCharCode(i);
if (c === "\\") {
c = "";
values = [];
let valuesLength = 0;
outer: for (let j = 0; j < n.length; j++) {
const expanded = expand_(n[j], max, maxLength, false);
for (let k = 0; k < expanded.length; k++) {
const v = expanded[k];
if (dropsEmpties && !v)
continue;
if (values.length >= max || valuesLength + v.length > maxLength) {
break outer;
}
} else {
c = String(i);
if (pad) {
const need = width - c.length;
if (need > 0) {
const z = new Array(need + 1).join("0");
if (i < 0) {
c = "-" + z + c.slice(1);
} else {
c = z + c;
}
}
}
}
N.push(c);
}
} else {
N = [];
for (let j = 0; j < n.length; j++) {
N.push.apply(N, expand_(n[j], max, false));
}
}
for (let j = 0; j < N.length; j++) {
for (let k = 0; k < post.length && expansions.length < max; k++) {
const expansion = pre + N[j] + post[k];
if (!isTop || isSequence || expansion) {
expansions.push(expansion);
values.push(v);
valuesLength += v.length;
}
}
}
return expansions;
acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length);
if (!m.post.length)
break;
str = m.post;
}
return acc;
}
// node_modules/readdir-glob/node_modules/minimatch/dist/esm/assert-valid-pattern.js
@@ -163165,7 +163413,7 @@ tmp/lib/tmp.js:
*)
js-yaml/dist/js-yaml.mjs:
(*! js-yaml 5.2.1 https://github.com/nodeca/js-yaml @license MIT *)
(*! js-yaml 5.2.2 https://github.com/nodeca/js-yaml @license MIT *)
long/index.js:
(**
+31 -31
View File
@@ -1,12 +1,12 @@
{
"name": "codeql",
"version": "4.37.5",
"version": "4.37.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "codeql",
"version": "4.37.5",
"version": "4.37.7",
"license": "MIT",
"workspaces": [
"pr-checks"
@@ -31,7 +31,7 @@
"follow-redirects": "^1.16.0",
"get-folder-size": "^5.0.0",
"https-proxy-agent": "^7.0.6",
"js-yaml": "^5.2.1",
"js-yaml": "^5.2.2",
"jsonschema": "1.5.0",
"long": "^5.3.2",
"node-forge": "^1.4.0",
@@ -61,7 +61,7 @@
"eslint-plugin-jsdoc": "^62.9.0",
"eslint-plugin-no-async-foreach": "^0.1.1",
"glob": "^13.0.6",
"globals": "^17.7.0",
"globals": "^17.8.0",
"nock": "^14.0.16",
"sinon": "^22.1.0",
"typescript": "^6.0.3",
@@ -374,9 +374,9 @@
"license": "Apache-2.0"
},
"node_modules/@actions/artifact/node_modules/brace-expansion": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.2.tgz",
"integrity": "sha512-w5JZcKgdhDOgOwm8H+KgbosopHMuGcl6qbulwjtz3SM7I7P3yW1eAjzMPLrIE+NQ9vjgANKHWeMHnrT0OXW1oA==",
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0"
@@ -2843,9 +2843,9 @@
}
},
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.8.tgz",
"integrity": "sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==",
"version": "5.0.9",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
"integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -3864,9 +3864,9 @@
"license": "MIT"
},
"node_modules/brace-expansion": {
"version": "1.1.16",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.16.tgz",
"integrity": "sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==",
"version": "1.1.18",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",
"integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==",
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0",
@@ -5115,16 +5115,16 @@
}
},
"node_modules/eslint-plugin-import-x/node_modules/brace-expansion": {
"version": "5.0.7",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz",
"integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==",
"version": "5.0.9",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
"integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
"dev": true,
"license": "MIT",
"dependencies": {
"balanced-match": "^4.0.2"
},
"engines": {
"node": "18 || 20 || >=22"
"node": "20 || >=22"
}
},
"node_modules/eslint-plugin-import-x/node_modules/minimatch": {
@@ -6111,15 +6111,15 @@
}
},
"node_modules/glob/node_modules/brace-expansion": {
"version": "5.0.7",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz",
"integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==",
"version": "5.0.9",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
"integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
"license": "MIT",
"dependencies": {
"balanced-match": "^4.0.2"
},
"engines": {
"node": "18 || 20 || >=22"
"node": "20 || >=22"
}
},
"node_modules/glob/node_modules/minimatch": {
@@ -6138,9 +6138,9 @@
}
},
"node_modules/globals": {
"version": "17.7.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-17.7.0.tgz",
"integrity": "sha512-Czmyns5dUsq4seFBR/Kdydhmo8y9kC79hiSkPn0YcGtNnYWnrgt0vjrSjx9tspoDGWm2CMarffRuLjM4xUz8xg==",
"version": "17.8.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-17.8.0.tgz",
"integrity": "sha512-Zz/LMDZScFmkakeL2cTHzf+PbWKdpU3uclqkZT7TjDG58j5WPt0PpA+n9uPI24fZtlw07q0OtEi84K+umsRzqQ==",
"dev": true,
"license": "MIT",
"engines": {
@@ -6981,9 +6981,9 @@
}
},
"node_modules/js-yaml": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.1.tgz",
"integrity": "sha512-zfLtNfQqxVqq3uaTqSkh4x4hZw3KHobGUA0fJUj4wawW8bsQLTVqpHdXSIzidh7o+4lEW36tANuAGdaFx6Zgnw==",
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.2.tgz",
"integrity": "sha512-dayzUzKkJ1MkuUtZglSebU43utNXH0OWQByK9rKOOuYIO8M5TV1y+n8ALMdG0rdzBnfNkOmZEqrURepb0ejqBw==",
"funding": [
{
"type": "github",
@@ -8090,15 +8090,15 @@
}
},
"node_modules/readdir-glob/node_modules/brace-expansion": {
"version": "5.0.7",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz",
"integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==",
"version": "5.0.9",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
"integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
"license": "MIT",
"dependencies": {
"balanced-match": "^4.0.2"
},
"engines": {
"node": "18 || 20 || >=22"
"node": "20 || >=22"
}
},
"node_modules/readdir-glob/node_modules/minimatch": {
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "4.37.5",
"version": "4.37.7",
"private": true,
"description": "CodeQL action",
"scripts": {
@@ -39,7 +39,7 @@
"follow-redirects": "^1.16.0",
"get-folder-size": "^5.0.0",
"https-proxy-agent": "^7.0.6",
"js-yaml": "^5.2.1",
"js-yaml": "^5.2.2",
"jsonschema": "1.5.0",
"long": "^5.3.2",
"node-forge": "^1.4.0",
@@ -69,7 +69,7 @@
"eslint-plugin-jsdoc": "^62.9.0",
"eslint-plugin-no-async-foreach": "^0.1.1",
"glob": "^13.0.6",
"globals": "^17.7.0",
"globals": "^17.8.0",
"nock": "^14.0.16",
"sinon": "^22.1.0",
"typescript": "^6.0.3",
+2 -2
View File
@@ -253,8 +253,8 @@ const languageSetups: LanguageSetups = {
name: "Install Java",
uses: pinnedUses(
"actions/setup-java",
"03ad4de0992f5dab5e18fcb136590ce7c4a0ac95",
"v5.6.0",
"b6effb05e454b25005698d916606bdc6ffcbf961",
"v5.7.0",
),
with: {
"java-version": `\${{ inputs.java-version || '${defaultLanguageVersions.java}' }}`,
+98 -24
View File
@@ -1295,33 +1295,12 @@ checkOverlayEnablementMacro.serial(
);
checkOverlayEnablementMacro.serial(
"No overlay-base database on default branch if runner disk space is below v2 limit and v2 resource checks enabled",
"Overlay-base database on default branch if runner disk space is above the default limit",
{
languages: [BuiltInLanguage.javascript],
features: [
Feature.OverlayAnalysis,
Feature.OverlayAnalysisCodeScanningJavascript,
Feature.OverlayAnalysisResourceChecksV2,
],
isDefaultBranch: true,
diskUsage: {
numAvailableBytes: 5_000_000_000,
numTotalBytes: 100_000_000_000,
},
},
{
disabledReason: OverlayDisabledReason.InsufficientDiskSpace,
},
);
checkOverlayEnablementMacro.serial(
"Overlay-base database on default branch if runner disk space is between v2 and v1 limits and v2 resource checks enabled",
{
languages: [BuiltInLanguage.javascript],
features: [
Feature.OverlayAnalysis,
Feature.OverlayAnalysisCodeScanningJavascript,
Feature.OverlayAnalysisResourceChecksV2,
],
isDefaultBranch: true,
diskUsage: {
@@ -1336,7 +1315,7 @@ checkOverlayEnablementMacro.serial(
);
checkOverlayEnablementMacro.serial(
"No overlay-base database on default branch if runner disk space is between v2 and v1 limits and v2 resource checks not enabled",
"No overlay-base database on default branch if runner disk space is below the default limit",
{
languages: [BuiltInLanguage.javascript],
features: [
@@ -1345,7 +1324,102 @@ checkOverlayEnablementMacro.serial(
],
isDefaultBranch: true,
diskUsage: {
numAvailableBytes: 15_000_000_000,
numAvailableBytes: 10_000_000_000,
numTotalBytes: 100_000_000_000,
},
},
{
disabledReason: OverlayDisabledReason.InsufficientDiskSpace,
},
);
// Check that each feature flag lowers the limit to the threshold that its name
// declares. Both sides of the boundary are needed to pin the threshold down: a
// mapping to a lower value would still pass the case at the limit, and one to a
// higher value would still fail the case below it.
for (const [feature, thresholdGb] of [
[Feature.OverlayAnalysisMinDisk8Gb, 8],
[Feature.OverlayAnalysisMinDisk9Gb, 9],
[Feature.OverlayAnalysisMinDisk10Gb, 10],
[Feature.OverlayAnalysisMinDisk11Gb, 11],
[Feature.OverlayAnalysisMinDisk12Gb, 12],
[Feature.OverlayAnalysisMinDisk13Gb, 13],
] as Array<[Feature, number]>) {
const features = [
Feature.OverlayAnalysis,
Feature.OverlayAnalysisCodeScanningJavascript,
feature,
];
checkOverlayEnablementMacro.serial(
`Overlay-base database on default branch if ${feature} is enabled and runner disk space is at its limit`,
{
languages: [BuiltInLanguage.javascript],
features,
isDefaultBranch: true,
diskUsage: {
numAvailableBytes: thresholdGb * 1_000_000_000,
numTotalBytes: 100_000_000_000,
},
},
{
overlayDatabaseMode: OverlayDatabaseMode.OverlayBase,
useOverlayDatabaseCaching: true,
},
);
checkOverlayEnablementMacro.serial(
`No overlay-base database on default branch if ${feature} is enabled and runner disk space is below its limit`,
{
languages: [BuiltInLanguage.javascript],
features,
isDefaultBranch: true,
diskUsage: {
numAvailableBytes: thresholdGb * 1_000_000_000 - 1_000_000,
numTotalBytes: 100_000_000_000,
},
},
{
disabledReason: OverlayDisabledReason.InsufficientDiskSpace,
},
);
}
checkOverlayEnablementMacro.serial(
"Overlay-base database on default branch if runner disk space is exactly at the lowest limit enabled by a feature flag",
{
languages: [BuiltInLanguage.javascript],
features: [
Feature.OverlayAnalysis,
Feature.OverlayAnalysisCodeScanningJavascript,
Feature.OverlayAnalysisMinDisk9Gb,
Feature.OverlayAnalysisMinDisk12Gb,
],
isDefaultBranch: true,
diskUsage: {
numAvailableBytes: 9_000_000_000,
numTotalBytes: 100_000_000_000,
},
},
{
overlayDatabaseMode: OverlayDatabaseMode.OverlayBase,
useOverlayDatabaseCaching: true,
},
);
checkOverlayEnablementMacro.serial(
"No overlay-base database on default branch if runner disk space is below the lowest limit enabled by a feature flag",
{
languages: [BuiltInLanguage.javascript],
features: [
Feature.OverlayAnalysis,
Feature.OverlayAnalysisCodeScanningJavascript,
Feature.OverlayAnalysisMinDisk9Gb,
Feature.OverlayAnalysisMinDisk12Gb,
],
isDefaultBranch: true,
diskUsage: {
numAvailableBytes: 8_500_000_000,
numTotalBytes: 100_000_000_000,
},
},
+49 -24
View File
@@ -48,7 +48,7 @@ import {
import { prepareDiffInformedAnalysis } from "./diff-informed-analysis-utils";
import { EnvVar } from "./environment";
import * as errorMessages from "./error-messages";
import { Feature, FeatureEnablement } from "./feature-flags";
import { Feature, FeatureEnablement, FeatureWithoutCLI } from "./feature-flags";
import {
RepositoryProperties,
RepositoryPropertyName,
@@ -101,19 +101,28 @@ export { type Config } from "./config/action-config";
* whether to perform overlay analysis, then the action will not perform overlay
* analysis unless overlay analysis has been explicitly enabled via environment
* variable.
*
* This threshold can be lowered by the feature flags in
* `OVERLAY_MINIMUM_DISK_SPACE_FEATURES`.
*/
const OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 20000;
const OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES =
OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1_000_000;
const OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 14000;
/**
* The v2 minimum available disk space (in MB) required to perform overlay
* analysis. This is a lower threshold than the v1 limit, allowing overlay
* analysis to run on runners with less available disk space.
* Feature flags that lower the minimum available disk space required to perform
* overlay analysis, paired with the threshold (in MB) that each one enables.
*
* If several of these are enabled, the lowest threshold takes effect.
*/
const OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB = 14000;
const OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES =
OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1_000_000;
const OVERLAY_MINIMUM_DISK_SPACE_FEATURES: ReadonlyArray<
[FeatureWithoutCLI, number]
> = [
[Feature.OverlayAnalysisMinDisk8Gb, 8000],
[Feature.OverlayAnalysisMinDisk9Gb, 9000],
[Feature.OverlayAnalysisMinDisk10Gb, 10000],
[Feature.OverlayAnalysisMinDisk11Gb, 11000],
[Feature.OverlayAnalysisMinDisk12Gb, 12000],
[Feature.OverlayAnalysisMinDisk13Gb, 13000],
];
/**
* The minimum memory (in MB) that must be available for CodeQL to perform overlay analysis. If
@@ -588,24 +597,42 @@ async function checkOverlayAnalysisFeatureEnabled(
return new Success(undefined);
}
/**
* Returns the minimum available disk space (in MB) required to perform overlay
* analysis, which is the lowest threshold enabled by a feature flag, or the
* default threshold if no such feature flag is enabled.
*/
async function getMinimumDiskSpaceMb(
features: FeatureEnablement,
): Promise<number> {
let minimumMb = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB;
for (const [feature, thresholdMb] of OVERLAY_MINIMUM_DISK_SPACE_FEATURES) {
if (await features.getValue(feature)) {
minimumMb = Math.min(minimumMb, thresholdMb);
}
}
return minimumMb;
}
/** Checks if the runner has enough disk space for overlay analysis. */
function runnerHasSufficientDiskSpace(
diskUsage: DiskUsage,
logger: Logger,
useV2ResourceChecks: boolean,
minimumDiskSpaceMb: number,
): boolean {
const minimumDiskSpaceBytes = useV2ResourceChecks
? OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES
: OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES;
if (diskUsage.numAvailableBytes < minimumDiskSpaceBytes) {
const diskSpaceMb = Math.round(diskUsage.numAvailableBytes / 1_000_000);
const minimumDiskSpaceMb = Math.round(minimumDiskSpaceBytes / 1_000_000);
const diskSpaceMb = Math.round(diskUsage.numAvailableBytes / 1_000_000);
if (diskUsage.numAvailableBytes < minimumDiskSpaceMb * 1_000_000) {
logger.info(
`Setting overlay database mode to ${OverlayDatabaseMode.None} ` +
`due to insufficient disk space (${diskSpaceMb} MB, needed ${minimumDiskSpaceMb} MB).`,
);
return false;
}
logger.debug(
`Disk space available for CodeQL analysis is ${diskSpaceMb} MB, which is at or above the ` +
`minimum of ${minimumDiskSpaceMb} MB.`,
);
return true;
}
@@ -637,7 +664,7 @@ async function runnerHasSufficientMemory(
}
logger.debug(
`Memory available for CodeQL analysis is ${memoryFlagValue} MB, which is above the minimum of ${OVERLAY_MINIMUM_MEMORY_MB} MB.`,
`Memory available for CodeQL analysis is ${memoryFlagValue} MB, which is at or above the minimum of ${OVERLAY_MINIMUM_MEMORY_MB} MB.`,
);
return true;
}
@@ -648,12 +675,13 @@ async function runnerHasSufficientMemory(
*/
async function checkRunnerResources(
codeql: CodeQL,
features: FeatureEnablement,
diskUsage: DiskUsage,
ramInput: string | undefined,
logger: Logger,
useV2ResourceChecks: boolean,
): Promise<Result<void, OverlayDisabledReason>> {
if (!runnerHasSufficientDiskSpace(diskUsage, logger, useV2ResourceChecks)) {
const minimumDiskSpaceMb = await getMinimumDiskSpaceMb(features);
if (!runnerHasSufficientDiskSpace(diskUsage, logger, minimumDiskSpaceMb)) {
return new Failure(OverlayDisabledReason.InsufficientDiskSpace);
}
if (!(await runnerHasSufficientMemory(codeql, ramInput, logger))) {
@@ -752,9 +780,6 @@ export async function checkOverlayEnablement(
Feature.OverlayAnalysisSkipResourceChecks,
codeql,
));
const useV2ResourceChecks = await features.getValue(
Feature.OverlayAnalysisResourceChecksV2,
);
const checkOverlayStatus = await features.getValue(
Feature.OverlayAnalysisStatusCheck,
);
@@ -770,10 +795,10 @@ export async function checkOverlayEnablement(
performResourceChecks && diskUsage !== undefined
? await checkRunnerResources(
codeql,
features,
diskUsage,
ramInput,
logger,
useV2ResourceChecks,
)
: new Success<void>(undefined);
if (resourceResult.isFailure()) {
+1 -1
View File
@@ -16,7 +16,7 @@ export interface RemoteFileAddress {
}
/** The default file path to use in configuration file shorthands. */
export const DEFAULT_CONFIG_FILE_NAME = ".github/codeql-action.yaml";
export const DEFAULT_CONFIG_FILE_NAME = ".github/codeql-config.yml";
/** The default ref to use in configuration file shorthands. */
export const DEFAULT_CONFIG_FILE_REF = "main";
+38 -6
View File
@@ -121,12 +121,19 @@ export enum Feature {
* `OverlayAnalysisMatchCodeqlVersion` overrides this flag.
*/
OverlayAnalysisMatchCodeqlVersionDryRun = "overlay_analysis_match_codeql_version_dry_run",
OverlayAnalysisPython = "overlay_analysis_python",
/**
* Controls whether lower disk space requirements are used for overlay hardware checks.
* Has no effect if `OverlayAnalysisSkipResourceChecks` is enabled.
* Feature flags that lower the amount of available disk space that the overlay hardware check
* requires. The lowest threshold that is enabled takes effect; if none are enabled, the default
* threshold applies. These flags have no effect if `OverlayAnalysisSkipResourceChecks` is
* enabled.
*/
OverlayAnalysisResourceChecksV2 = "overlay_analysis_resource_checks_v2",
OverlayAnalysisMinDisk8Gb = "overlay_analysis_min_disk_8_gb",
OverlayAnalysisMinDisk9Gb = "overlay_analysis_min_disk_9_gb",
OverlayAnalysisMinDisk10Gb = "overlay_analysis_min_disk_10_gb",
OverlayAnalysisMinDisk11Gb = "overlay_analysis_min_disk_11_gb",
OverlayAnalysisMinDisk12Gb = "overlay_analysis_min_disk_12_gb",
OverlayAnalysisMinDisk13Gb = "overlay_analysis_min_disk_13_gb",
OverlayAnalysisPython = "overlay_analysis_python",
OverlayAnalysisRuby = "overlay_analysis_ruby",
/** Controls whether hardware checks are skipped for overlay analysis. */
OverlayAnalysisSkipResourceChecks = "overlay_analysis_skip_resource_checks",
@@ -354,9 +361,34 @@ export const featureConfig = {
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MATCH_CODEQL_VERSION_DRY_RUN",
minimumVersion: undefined,
},
[Feature.OverlayAnalysisResourceChecksV2]: {
[Feature.OverlayAnalysisMinDisk8Gb]: {
defaultValue: false,
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2",
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MIN_DISK_8_GB",
minimumVersion: undefined,
},
[Feature.OverlayAnalysisMinDisk9Gb]: {
defaultValue: false,
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MIN_DISK_9_GB",
minimumVersion: undefined,
},
[Feature.OverlayAnalysisMinDisk10Gb]: {
defaultValue: false,
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MIN_DISK_10_GB",
minimumVersion: undefined,
},
[Feature.OverlayAnalysisMinDisk11Gb]: {
defaultValue: false,
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MIN_DISK_11_GB",
minimumVersion: undefined,
},
[Feature.OverlayAnalysisMinDisk12Gb]: {
defaultValue: false,
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MIN_DISK_12_GB",
minimumVersion: undefined,
},
[Feature.OverlayAnalysisMinDisk13Gb]: {
defaultValue: false,
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_MIN_DISK_13_GB",
minimumVersion: undefined,
},
[Feature.OverlayAnalysisStatusCheck]: {