From e7ce43a4dc692cf703df2389513106a0bd62134e Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 3 Nov 2026 13:33:07 +0000 Subject: [PATCH 1/6] Log how long deleting each CodeQL version from the toolcache takes Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- lib/entry-points.js | 5 ++++- src/tools-download.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/entry-points.js b/lib/entry-points.js index 952c61541..0d97fe424 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -184864,13 +184864,16 @@ async function deleteToolcacheBundles({ } const versionDirectory = path12.join(toolDirectory, entry.name); try { + const deletionStart = import_perf_hooks3.performance.now(); await fs15.promises.rm(versionDirectory, { force: true, recursive: true }); deletedVersions.push(entry.name); logger2.info( - `Deleted the CodeQL tools at '${versionDirectory}' from the toolcache to free up disk space.` + `Deleted the CodeQL tools at '${versionDirectory}' from the toolcache to free up disk space (${formatDuration( + durationMsSince(deletionStart) + )}).` ); } catch (e) { failed = true; diff --git a/src/tools-download.ts b/src/tools-download.ts index a92dad0ac..a5b5a5a0d 100644 --- a/src/tools-download.ts +++ b/src/tools-download.ts @@ -342,13 +342,16 @@ export async function deleteToolcacheBundles({ const versionDirectory = path.join(toolDirectory, entry.name); try { + const deletionStart = performance.now(); await fs.promises.rm(versionDirectory, { force: true, recursive: true, }); deletedVersions.push(entry.name); logger.info( - `Deleted the CodeQL tools at '${versionDirectory}' from the toolcache to free up disk space.`, + `Deleted the CodeQL tools at '${versionDirectory}' from the toolcache to free up disk space (${formatDuration( + durationMsSince(deletionStart), + )}).`, ); } catch (e) { failed = true; From e70c0414bf2f50ae4617cac7ffe7db16cd2bf06b Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 4 Nov 2026 14:31:49 +0000 Subject: [PATCH 2/6] Record how long the toolcache cleanup takes in telemetry Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- lib/entry-points.js | 3 ++- src/setup-codeql.test.ts | 53 +++++++++++++++++++++++++++++++++++----- src/setup-codeql.ts | 3 ++- 3 files changed, 51 insertions(+), 8 deletions(-) diff --git a/lib/entry-points.js b/lib/entry-points.js index 0d97fe424..0bceda727 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -185372,13 +185372,14 @@ async function tryDeleteToolcacheBundles({ if (!isGitHubHostedRunner(env) || !isToolcacheOnWorkspaceFilesystem(logger2)) { return; } + const startTime = import_perf_hooks4.performance.now(); const result = await deleteToolcacheBundles({ env, logger: logger2 }); addNoLanguageDiagnostic( void 0, makeTelemetryDiagnostic( "codeql-action/toolcache-bundle-cleanup", "Toolcache CodeQL bundle cleanup", - { ...result } + { ...result, durationMs: durationMsSince(startTime) } ) ); } diff --git a/src/setup-codeql.test.ts b/src/setup-codeql.test.ts index a244501c3..e8c64c616 100644 --- a/src/setup-codeql.test.ts +++ b/src/setup-codeql.test.ts @@ -1821,7 +1821,8 @@ function createToolcacheEntry( /** * Stubs out the download and the diagnostic sink, then downloads the CodeQL tools. * - * @returns the extraction directory and the toolcache cleanup diagnostic, if emitted. + * @returns the extraction directory and, if the toolcache cleanup diagnostic was emitted, the + * cleanup duration it reports and its other attributes. */ async function runDownloadCodeQL( toolcacheRoot: string, @@ -1837,6 +1838,7 @@ async function runDownloadCodeQL( ): Promise<{ codeqlFolder: string; cleanupDiagnostic: toolsDownload.ToolcacheCleanupResult | undefined; + cleanupDurationMs: number | undefined; }> { stubDownloadAndExtract(); const addDiagnostic = sinon.stub(diagnostics, "addNoLanguageDiagnostic"); @@ -1866,11 +1868,21 @@ async function runDownloadCodeQL( .map((call) => call.args[1]) .find((d) => d.source?.id === "codeql-action/toolcache-bundle-cleanup"); - return { - codeqlFolder, - cleanupDiagnostic: diagnostic?.attributes as - toolsDownload.ToolcacheCleanupResult | undefined, - }; + if (diagnostic === undefined) { + return { + codeqlFolder, + cleanupDiagnostic: undefined, + cleanupDurationMs: undefined, + }; + } + + // The duration varies between runs, so split it out to let tests compare the other attributes + // exactly. + const { durationMs, ...cleanupDiagnostic } = + diagnostic.attributes as toolsDownload.ToolcacheCleanupResult & { + durationMs: number; + }; + return { codeqlFolder, cleanupDiagnostic, cleanupDurationMs: durationMs }; } /** @@ -1991,6 +2003,35 @@ test.serial( }, ); +test.serial( + "downloadCodeQLBundle reports the total time taken to clean up the toolcache", + async (t) => { + await withTmpDir(async (tmpDir) => { + setupActionsVars(tmpDir, tmpDir); + + createToolcacheEntry(tmpDir, "CodeQL", CLEANUP_CLI_VERSION); + createToolcacheEntry(tmpDir, "CodeQL", CLEANUP_STALE_VERSION); + + // Advance the clock by 1.5s each time a path is deleted, so that deleting both versions + // takes 3s. + let elapsedMs = 1000; + sinon.stub(performance, "now").callsFake(() => elapsedMs); + const rm = fs.promises.rm; + sinon.stub(fs.promises, "rm").callsFake(async (...args) => { + elapsedMs += 1500; + await rm(...args); + }); + + const { cleanupDurationMs } = await runDownloadCodeQL( + tmpDir, + CLEANUP_BUNDLE_VERSION, + ); + + t.is(cleanupDurationMs, 3000); + }); + }, +); + test.serial( "downloadCodeQLBundle reports no deleted versions when the toolcache has no CodeQL bundles", async (t) => { diff --git a/src/setup-codeql.ts b/src/setup-codeql.ts index d70e1f508..b87b81bdc 100644 --- a/src/setup-codeql.ts +++ b/src/setup-codeql.ts @@ -814,6 +814,7 @@ async function tryDeleteToolcacheBundles({ return; } + const startTime = performance.now(); const result = await deleteToolcacheBundles({ env, logger }); addNoLanguageDiagnostic( @@ -821,7 +822,7 @@ async function tryDeleteToolcacheBundles({ makeTelemetryDiagnostic( "codeql-action/toolcache-bundle-cleanup", "Toolcache CodeQL bundle cleanup", - { ...result }, + { ...result, durationMs: util.durationMsSince(startTime) }, ), ); } From 24393f8692ae5a8fb94c4f5829ffa08cea01bd1b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 4 Nov 2026 15:21:56 +0000 Subject: [PATCH 3/6] Update changelog for v4.39.3 --- CHANGELOG.md | 4 ++-- unreleased-change-notes/decode-diff-informed-sarif-uris.md | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 unreleased-change-notes/decode-diff-informed-sarif-uris.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 2aa6b37e6..b9c1382c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,9 @@ See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs. -## [UNRELEASED] +## 4.39.3 - 04 Nov 2026 -No user facing changes. +- 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) ## 4.39.2 - 03 Nov 2026 diff --git a/unreleased-change-notes/decode-diff-informed-sarif-uris.md b/unreleased-change-notes/decode-diff-informed-sarif-uris.md deleted file mode 100644 index b233ef437..000000000 --- a/unreleased-change-notes/decode-diff-informed-sarif-uris.md +++ /dev/null @@ -1 +0,0 @@ -- 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) From 8e42d3873f0cc4a734ca710926d6d7a69713262e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 4 Nov 2026 16:49:21 +0000 Subject: [PATCH 4/6] Update changelog and version after v4.39.3 --- CHANGELOG.md | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9c1382c3..091c04cd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ 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.39.3 - 04 Nov 2026 - 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) diff --git a/package-lock.json b/package-lock.json index ca703da54..12306cdd7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "codeql", - "version": "4.39.3", + "version": "4.39.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "codeql", - "version": "4.39.3", + "version": "4.39.4", "license": "MIT", "workspaces": [ "pr-checks" diff --git a/package.json b/package.json index 8d917bf06..5fed5cccd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codeql", - "version": "4.39.3", + "version": "4.39.4", "private": true, "description": "CodeQL action", "scripts": { From d11b2246b19550e36c2fc335ba4a40632d6bc2ca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 4 Nov 2026 16:49:37 +0000 Subject: [PATCH 5/6] Rebuild --- lib/entry-points.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/entry-points.js b/lib/entry-points.js index 952c61541..9297a8784 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -178724,7 +178724,7 @@ function getDiffRangesJsonFilePath(env = getEnv()) { return path2.join(getTemporaryDirectory(env), PR_DIFF_RANGE_JSON_FILENAME); } function getActionVersion() { - return "4.39.3"; + return "4.39.4"; } function getWorkflowEventName(env = getEnv()) { return env.getRequired("GITHUB_EVENT_NAME" /* GITHUB_EVENT_NAME */); From d2a785ca9cadb30d186f903821b162c12686db95 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Fri, 6 Nov 2026 16:58:25 +0000 Subject: [PATCH 6/6] Remove `macos-14-xlarge` from `codeql` workflow Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/workflows/codeql.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index efbb246fc..cc7d3de99 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -79,7 +79,6 @@ jobs: - ubuntu-24.04 - windows-2022 - windows-2025 - - macos-14-xlarge - macos-15-xlarge tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }} runs-on: ${{ matrix.os }}