Skip to content

Commit c6db2d9

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 a3030a4 commit c6db2d9

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
@@ -870,7 +870,12 @@ export const downloadCodeQL = async function (
870870
...statusReport,
871871
perLanguage: { tools_bundle_language: bundle.language },
872872
}
873-
: statusReport,
873+
: source.perLanguageBundleFallback
874+
? {
875+
...statusReport,
876+
perLanguage: { tools_per_language_bundle_fallback: true },
877+
}
878+
: statusReport,
874879
};
875880
};
876881

@@ -1121,6 +1126,7 @@ export async function downloadCodeQLBundle(
11211126
{
11221127
...source,
11231128
bundle: { kind: "combined", url: bundle.combinedBundleURL },
1129+
perLanguageBundleFallback: true,
11241130
},
11251131
apiDetails,
11261132
tarVersion,
@@ -1132,7 +1138,6 @@ export async function downloadCodeQLBundle(
11321138
statusReport: {
11331139
...result.statusReport,
11341140
totalDurationMs: util.durationMsSince(startTime),
1135-
perLanguage: { tools_per_language_bundle_fallback: true },
11361141
},
11371142
};
11381143
}

0 commit comments

Comments
 (0)