Skip to content

Commit 49cca89

Browse files
authored
Merge branch 'main' into mbg/clean-up-diff-informed-utils
2 parents c29d405 + fbfa9f3 commit 49cca89

10 files changed

Lines changed: 2167 additions & 1629 deletions

File tree

‎.github/workflows/codeql.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ jobs:
7979
- ubuntu-24.04
8080
- windows-2022
8181
- windows-2025
82-
- macos-14-xlarge
8382
- macos-15-xlarge
8483
tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }}
8584
runs-on: ${{ matrix.os }}

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
66

77
No user facing changes.
88

9+
## 4.39.3 - 04 Nov 2026
10+
11+
- Fixed diff-informed alert filtering incorrectly removing alerts in changed files whose paths contain spaces, special characters, or non-ASCII characters. [#4283](https://github.com/github/codeql-action/pull/4283)
12+
913
## 4.39.2 - 03 Nov 2026
1014

1115
- Update default CodeQL bundle version to [2.27.4](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.27.4). [#4284](https://github.com/github/codeql-action/pull/4284)

‎lib/entry-points.js‎

Lines changed: 2080 additions & 1583 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package-lock.json‎

Lines changed: 25 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeql",
3-
"version": "4.39.3",
3+
"version": "4.39.4",
44
"private": true,
55
"description": "CodeQL action",
66
"scripts": {
@@ -69,7 +69,7 @@
6969
"eslint-plugin-import-x": "^4.17.1",
7070
"eslint-plugin-jsdoc": "^65.4.0",
7171
"eslint-plugin-no-async-foreach": "^0.1.1",
72-
"glob": "^13.0.6",
72+
"glob": "^14.0.3",
7373
"globals": "^17.13.0",
7474
"nock": "^14.0.17",
7575
"prettier": "^3.9.10",
@@ -96,7 +96,7 @@
9696
"eslint-plugin-jsx-a11y": {
9797
"semver": ">=6.3.1"
9898
},
99-
"glob": "^13.0.6",
99+
"glob": "^14.0.3",
100100
"undici": "^7.30.1"
101101
}
102102
}

‎pr-checks/excluded.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ is:
2424
# PRs), so requiring them would block the PRs they don't run on.
2525
- "github-advanced-security"
2626
- "License compliance check"
27+
# Only runs when a PR is removed from the merge queue.
28+
- "Notify"

‎src/setup-codeql.test.ts‎

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,8 @@ function createToolcacheEntry(
18211821
/**
18221822
* Stubs out the download and the diagnostic sink, then downloads the CodeQL tools.
18231823
*
1824-
* @returns the extraction directory and the toolcache cleanup diagnostic, if emitted.
1824+
* @returns the extraction directory and, if the toolcache cleanup diagnostic was emitted, the
1825+
* cleanup duration it reports and its other attributes.
18251826
*/
18261827
async function runDownloadCodeQL(
18271828
toolcacheRoot: string,
@@ -1837,6 +1838,7 @@ async function runDownloadCodeQL(
18371838
): Promise<{
18381839
codeqlFolder: string;
18391840
cleanupDiagnostic: toolsDownload.ToolcacheCleanupResult | undefined;
1841+
cleanupDurationMs: number | undefined;
18401842
}> {
18411843
stubDownloadAndExtract();
18421844
const addDiagnostic = sinon.stub(diagnostics, "addNoLanguageDiagnostic");
@@ -1866,11 +1868,21 @@ async function runDownloadCodeQL(
18661868
.map((call) => call.args[1])
18671869
.find((d) => d.source?.id === "codeql-action/toolcache-bundle-cleanup");
18681870

1869-
return {
1870-
codeqlFolder,
1871-
cleanupDiagnostic: diagnostic?.attributes as
1872-
toolsDownload.ToolcacheCleanupResult | undefined,
1873-
};
1871+
if (diagnostic === undefined) {
1872+
return {
1873+
codeqlFolder,
1874+
cleanupDiagnostic: undefined,
1875+
cleanupDurationMs: undefined,
1876+
};
1877+
}
1878+
1879+
// The duration varies between runs, so split it out to let tests compare the other attributes
1880+
// exactly.
1881+
const { durationMs, ...cleanupDiagnostic } =
1882+
diagnostic.attributes as toolsDownload.ToolcacheCleanupResult & {
1883+
durationMs: number;
1884+
};
1885+
return { codeqlFolder, cleanupDiagnostic, cleanupDurationMs: durationMs };
18741886
}
18751887

18761888
/**
@@ -1991,6 +2003,35 @@ test.serial(
19912003
},
19922004
);
19932005

2006+
test.serial(
2007+
"downloadCodeQLBundle reports the total time taken to clean up the toolcache",
2008+
async (t) => {
2009+
await withTmpDir(async (tmpDir) => {
2010+
setupActionsVars(tmpDir, tmpDir);
2011+
2012+
createToolcacheEntry(tmpDir, "CodeQL", CLEANUP_CLI_VERSION);
2013+
createToolcacheEntry(tmpDir, "CodeQL", CLEANUP_STALE_VERSION);
2014+
2015+
// Advance the clock by 1.5s each time a path is deleted, so that deleting both versions
2016+
// takes 3s.
2017+
let elapsedMs = 1000;
2018+
sinon.stub(performance, "now").callsFake(() => elapsedMs);
2019+
const rm = fs.promises.rm;
2020+
sinon.stub(fs.promises, "rm").callsFake(async (...args) => {
2021+
elapsedMs += 1500;
2022+
await rm(...args);
2023+
});
2024+
2025+
const { cleanupDurationMs } = await runDownloadCodeQL(
2026+
tmpDir,
2027+
CLEANUP_BUNDLE_VERSION,
2028+
);
2029+
2030+
t.is(cleanupDurationMs, 3000);
2031+
});
2032+
},
2033+
);
2034+
19942035
test.serial(
19952036
"downloadCodeQLBundle reports no deleted versions when the toolcache has no CodeQL bundles",
19962037
async (t) => {

‎src/setup-codeql.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,14 +814,15 @@ async function tryDeleteToolcacheBundles({
814814
return;
815815
}
816816

817+
const startTime = performance.now();
817818
const result = await deleteToolcacheBundles({ env, logger });
818819

819820
addNoLanguageDiagnostic(
820821
undefined,
821822
makeTelemetryDiagnostic(
822823
"codeql-action/toolcache-bundle-cleanup",
823824
"Toolcache CodeQL bundle cleanup",
824-
{ ...result },
825+
{ ...result, durationMs: util.durationMsSince(startTime) },
825826
),
826827
);
827828
}

‎src/tools-download.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,16 @@ export async function deleteToolcacheBundles({
342342
const versionDirectory = path.join(toolDirectory, entry.name);
343343

344344
try {
345+
const deletionStart = performance.now();
345346
await fs.promises.rm(versionDirectory, {
346347
force: true,
347348
recursive: true,
348349
});
349350
deletedVersions.push(entry.name);
350351
logger.info(
351-
`Deleted the CodeQL tools at '${versionDirectory}' from the toolcache to free up disk space.`,
352+
`Deleted the CodeQL tools at '${versionDirectory}' from the toolcache to free up disk space (${formatDuration(
353+
durationMsSince(deletionStart),
354+
)}).`,
352355
);
353356
} catch (e) {
354357
failed = true;

‎unreleased-change-notes/decode-diff-informed-sarif-uris.md‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)