From caa2cae2fbc818364c752e995bdf1e84998dd673 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Thu, 24 Sep 2026 15:23:35 +0100 Subject: [PATCH] Record per-language bundle fallbacks on the download source Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- lib/entry-points.js | 9 ++++++--- src/codeql-bundle.ts | 2 ++ src/setup-codeql.test.ts | 1 + src/setup-codeql.ts | 9 +++++++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/entry-points.js b/lib/entry-points.js index 3c8e6bce3..ecba603a6 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -152647,6 +152647,9 @@ var downloadCodeQL = async function(source, apiDetails, tarVersion, tempDir, log statusReport: bundle.kind === "per-language" ? { ...statusReport, perLanguage: { tools_bundle_language: bundle.language } + } : source.perLanguageBundleFallback ? { + ...statusReport, + perLanguage: { tools_per_language_bundle_fallback: true } } : statusReport }; }; @@ -152784,7 +152787,8 @@ async function downloadCodeQLBundle(action, source, apiDetails, tarVersion, temp const result = await downloadCodeQL( { ...source, - bundle: { kind: "combined", url: bundle.combinedBundleURL } + bundle: { kind: "combined", url: bundle.combinedBundleURL }, + perLanguageBundleFallback: true }, apiDetails, tarVersion, @@ -152795,8 +152799,7 @@ async function downloadCodeQLBundle(action, source, apiDetails, tarVersion, temp ...result, statusReport: { ...result.statusReport, - totalDurationMs: durationMsSince(startTime), - perLanguage: { tools_per_language_bundle_fallback: true } + totalDurationMs: durationMsSince(startTime) } }; } diff --git a/src/codeql-bundle.ts b/src/codeql-bundle.ts index 2d262c848..99481834d 100644 --- a/src/codeql-bundle.ts +++ b/src/codeql-bundle.ts @@ -27,6 +27,8 @@ export interface CodeQLDownloadSource { cliVersion?: string; /** Resolved version for telemetry, independent of whether the bundle can be cached. */ toolsVersion: string; + /** The release lacks the eligible per-language bundle, so we selected the combined bundle. */ + perLanguageBundleFallback?: true; } /** Returns the exact bundle asset name for a platform and optional language. */ diff --git a/src/setup-codeql.test.ts b/src/setup-codeql.test.ts index 608c36949..d5778f71e 100644 --- a/src/setup-codeql.test.ts +++ b/src/setup-codeql.test.ts @@ -1420,6 +1420,7 @@ for (const bundle of ["per-language", "combined", "fallback"] as const) { t.deepEqual(downloadSpy.secondCall.args[0], { ...source, bundle: { kind: "combined", url: combinedURL }, + perLanguageBundleFallback: true, }); checkExpectedLogMessages(t, loggedMessages, [ `Expected a per-language CodeQL bundle for 'javascript' at ${perLanguageURL}`, diff --git a/src/setup-codeql.ts b/src/setup-codeql.ts index a0cfacb7b..63a4e28e9 100644 --- a/src/setup-codeql.ts +++ b/src/setup-codeql.ts @@ -888,7 +888,12 @@ export const downloadCodeQL = async function ( ...statusReport, perLanguage: { tools_bundle_language: bundle.language }, } - : statusReport, + : source.perLanguageBundleFallback + ? { + ...statusReport, + perLanguage: { tools_per_language_bundle_fallback: true }, + } + : statusReport, }; }; @@ -1139,6 +1144,7 @@ export async function downloadCodeQLBundle( { ...source, bundle: { kind: "combined", url: bundle.combinedBundleURL }, + perLanguageBundleFallback: true, }, apiDetails, tarVersion, @@ -1150,7 +1156,6 @@ export async function downloadCodeQLBundle( statusReport: { ...result.statusReport, totalDurationMs: util.durationMsSince(startTime), - perLanguage: { tools_per_language_bundle_fallback: true }, }, }; }