Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ec5eecb
Use per-language CodeQL bundles
henrymercer Sep 15, 2026
eb76062
Include failed bundle attempts in fallback timing
henrymercer Sep 15, 2026
289376d
Use per-language CodeQL bundles
henrymercer Sep 15, 2026
59ce3a2
Include failed bundle attempts in fallback timing
henrymercer Sep 15, 2026
2d47caf
Isolate per-language bundle eligibility state
henrymercer Sep 16, 2026
dfb9bf5
Share CodeQL bundle platform definitions
henrymercer Sep 16, 2026
f536ef4
Centralize CodeQL download telemetry fields
henrymercer Sep 16, 2026
2f552a9
Clarify bundle resolution and latest-nightly selection
henrymercer Sep 16, 2026
bd2ddba
Extract explicit CodeQL bundle URL classification
henrymercer Sep 16, 2026
89606bb
Return toolcache rejection reasons with Result
henrymercer Sep 16, 2026
f4fa111
Share elapsed-time rounding for bundle downloads
henrymercer Sep 16, 2026
69f4715
Use Result.orElse for bundle extraction paths
henrymercer Sep 16, 2026
5a2f29e
Merge published per-language bundle history
henrymercer Sep 16, 2026
28b8f59
Use shared test state for bundle eligibility
henrymercer Sep 17, 2026
ed3a24c
Group bundle eligibility test state overrides
henrymercer Sep 17, 2026
549d498
Simplify per-language platform eligibility checks
henrymercer Sep 17, 2026
ead1f7d
Rename the platform module
henrymercer Sep 17, 2026
79fe3a1
Move download telemetry into the status-report directory
henrymercer Sep 17, 2026
ecec9b5
Share per-language telemetry fields without renaming
henrymercer Sep 17, 2026
f18f353
Describe the bundle URL resolver
henrymercer Sep 17, 2026
07fa87d
Clarify the latest-nightly eligibility exception
henrymercer Sep 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/__bundle-toolcache.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 20 additions & 13 deletions lib/entry-points.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pr-checks/checks/bundle-toolcache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ steps:
- id: init
uses: ./../action/init
with:
# Request multiple languages so this check uses the combined bundle.
languages: javascript,python
Comment thread
mbg marked this conversation as resolved.
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
Expand Down
4 changes: 2 additions & 2 deletions src/per-language-bundles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ test("getPerLanguageBundleLanguage explains a disabled feature before checking e
);
});

test("getPerLanguageBundleLanguage skips only the release version check for nightlies", async (t) => {
const nightly = { isNightly: true, cliVersion: undefined };
test("getPerLanguageBundleLanguage skips only the release version check for the latest nightly", async (t) => {
const nightly = { isLatestNightly: true, cliVersion: undefined };
t.is(await checkEligibility(nightly), BuiltInLanguage.java);

for (const overrides of [
Expand Down
22 changes: 12 additions & 10 deletions src/per-language-bundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const MIN_PER_LANGUAGE_BUNDLE_CLI_VERSION = "2.27.1";
const PER_LANGUAGE_BUNDLE_NAME =
/^codeql-bundle-(.+)-(?:linux64|osx64|win64)\.tar\.(?:gz|zst)$/;

/** Identifies per-language tools URLs that must not populate the toolcache. */
/** Returns the language in a per-language tools URL, or undefined for other URLs. */
export function tryGetBundleLanguageFromUrl(
url: string,
): BuiltInLanguage | undefined {
Expand Down Expand Up @@ -55,13 +55,14 @@ const PER_LANGUAGE_BUNDLE_LANGUAGES: Readonly<
export interface PerLanguageBundleOptions {
/** Explicit input only: autodetection needs a CLI instance. */
rawLanguages: string[] | undefined;
/** CLI version, if known. Ignored for nightly bundles. */
/** Requested CLI version, if known. Ignored when requesting the latest nightly. */
cliVersion: string | undefined;
compressionMethod: tar.CompressionMethod;
/** Platform for which the bundle is requested. */
platform: BundlePlatform | undefined;
variant: GitHubVariant;
isNightly?: boolean;
/** Whether the Action is selecting the latest nightly rather than a release version. */
isLatestNightly?: boolean;
}

/** Returns the eligible bundle language, or undefined for the combined bundle. */
Expand All @@ -79,7 +80,7 @@ export async function getPerLanguageBundleLanguage(
compressionMethod,
platform,
variant,
isNightly,
isLatestNightly,
} = options;

const explain = (reason: string) => {
Expand All @@ -106,7 +107,7 @@ export async function getPerLanguageBundleLanguage(

if (compressionMethod !== "zstd") {
// Per-language bundles are only published as zstd archives.
return explain(`the bundle would be downloaded as ${compressionMethod}`);
return explain(`the bundle would be downloaded as '${compressionMethod}'`);
}

if (variant !== GitHubVariant.DOTCOM) {
Expand All @@ -121,16 +122,17 @@ export async function getPerLanguageBundleLanguage(
return explain("the job is not running on a GitHub-hosted runner");
}

// Nightly tags contain dates rather than comparable CLI versions.
if (!isNightly) {
// Check whether per-language bundles are published for the requested CLI version.
// Skip this for the latest nightly, whose tag contains a date rather than a CLI version.
Comment thread
mbg marked this conversation as resolved.
Outdated
if (!isLatestNightly) {
if (cliVersion === undefined) {
return explain("the CLI version of the bundle is unknown");
return explain("the requested CLI version is unknown");
}

if (!semver.gte(cliVersion, MIN_PER_LANGUAGE_BUNDLE_CLI_VERSION)) {
return explain(
`CodeQL ${cliVersion} is older than ${MIN_PER_LANGUAGE_BUNDLE_CLI_VERSION}, which is the ` +
"first version that publishes per-language bundles",
`the requested CodeQL version ${cliVersion} is older than ${MIN_PER_LANGUAGE_BUNDLE_CLI_VERSION}, which is the ` +
"first version for which per-language bundles are published",
);
}
}
Expand Down
Loading