Skip to content

Commit caa2cae

Browse files
henrymercerCopilot
andcommitted
Record per-language bundle fallbacks on the download source
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent ffc4532 commit caa2cae

4 files changed

Lines changed: 16 additions & 5 deletions

File tree

‎lib/entry-points.js‎

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

‎src/codeql-bundle.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export interface CodeQLDownloadSource {
2727
cliVersion?: string;
2828
/** Resolved version for telemetry, independent of whether the bundle can be cached. */
2929
toolsVersion: string;
30+
/** The release lacks the eligible per-language bundle, so we selected the combined bundle. */
31+
perLanguageBundleFallback?: true;
3032
}
3133

3234
/** Returns the exact bundle asset name for a platform and optional language. */

‎src/setup-codeql.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,6 +1420,7 @@ for (const bundle of ["per-language", "combined", "fallback"] as const) {
14201420
t.deepEqual(downloadSpy.secondCall.args[0], {
14211421
...source,
14221422
bundle: { kind: "combined", url: combinedURL },
1423+
perLanguageBundleFallback: true,
14231424
});
14241425
checkExpectedLogMessages(t, loggedMessages, [
14251426
`Expected a per-language CodeQL bundle for 'javascript' at ${perLanguageURL}`,

‎src/setup-codeql.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,12 @@ export const downloadCodeQL = async function (
888888
...statusReport,
889889
perLanguage: { tools_bundle_language: bundle.language },
890890
}
891-
: statusReport,
891+
: source.perLanguageBundleFallback
892+
? {
893+
...statusReport,
894+
perLanguage: { tools_per_language_bundle_fallback: true },
895+
}
896+
: statusReport,
892897
};
893898
};
894899

@@ -1139,6 +1144,7 @@ export async function downloadCodeQLBundle(
11391144
{
11401145
...source,
11411146
bundle: { kind: "combined", url: bundle.combinedBundleURL },
1147+
perLanguageBundleFallback: true,
11421148
},
11431149
apiDetails,
11441150
tarVersion,
@@ -1150,7 +1156,6 @@ export async function downloadCodeQLBundle(
11501156
statusReport: {
11511157
...result.statusReport,
11521158
totalDurationMs: util.durationMsSince(startTime),
1153-
perLanguage: { tools_per_language_bundle_fallback: true },
11541159
},
11551160
};
11561161
}

0 commit comments

Comments
 (0)