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
Prev Previous commit
Next Next commit
Include failed bundle attempts in fallback timing
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
  • Loading branch information
henrymercer and Copilot committed Sep 15, 2026
commit eb76062ef27575487f2ed7de1a0cfa2969dd60ae
23 changes: 13 additions & 10 deletions lib/entry-points.js

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

28 changes: 24 additions & 4 deletions src/setup-codeql.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as fs from "fs";
import * as os from "os";
import * as path from "path";
import { performance } from "perf_hooks";

import * as github from "@actions/github";
import * as toolcache from "@actions/tool-cache";
Expand Down Expand Up @@ -1221,10 +1222,23 @@ for (const bundle of ["per-language", "combined", "fallback"] as const) {
delete process.env[EnvVar.HAS_SET_UP_CODEQL];

const downloadSpy = sinon.spy(setupCodeql, "downloadCodeQL");
const extractStub = stubDownloadAndExtract();
if (bundle === "fallback") {
extractStub.onFirstCall().rejects(new HTTPError("Not Found", 404));
}
let elapsedMs = 1000;
sinon.stub(performance, "now").callsFake(() => elapsedMs);
const extractStub = sinon
.stub(toolsDownload, "downloadAndExtract")
.callsFake(async (_url, _compressionMethod, dest) => {
if (bundle === "fallback" && extractStub.callCount === 1) {
elapsedMs += 700.2;
throw new HTTPError("Not Found", 404);
}
elapsedMs += 300.2;
fs.mkdirSync(dest, { recursive: true });
return {
downloadDurationMs: 200,
extractionDurationMs: 100,
totalDurationMs: 300,
};
});
const addDiagnostic = sinon.stub(diagnostics, "addNoLanguageDiagnostic");
const features = createFeatures([
Feature.PerLanguageBundles,
Expand Down Expand Up @@ -1253,6 +1267,12 @@ for (const bundle of ["per-language", "combined", "fallback"] as const) {
bundle === "combined" ? "combined" : "per-language",
);
t.is(result.codeqlFolder, extractStub.lastCall.args[2]);
t.is(
result.toolsDownloadStatusReport?.totalDurationMs,
bundle === "fallback" ? 1000 : 300,
);
t.is(result.toolsDownloadStatusReport?.downloadDurationMs, 200);
t.is(result.toolsDownloadStatusReport?.extractionDurationMs, 100);
t.is(extractStub.callCount, bundle === "fallback" ? 2 : 1);
t.is(downloadSpy.callCount, extractStub.callCount);
t.is(
Expand Down
3 changes: 3 additions & 0 deletions src/setup-codeql.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as fs from "fs";
import { OutgoingHttpHeaders } from "http";
import * as path from "path";
import { performance } from "perf_hooks";

import * as core from "@actions/core";
import * as toolcache from "@actions/tool-cache";
Expand Down Expand Up @@ -1135,6 +1136,7 @@ export async function downloadCodeQLBundle(

await tryDeleteToolcacheBundles({ env: getEnv(), features, logger });

const startTime = performance.now();
try {
const result = await downloadCodeQL(
source,
Expand Down Expand Up @@ -1180,6 +1182,7 @@ export async function downloadCodeQLBundle(
...result,
statusReport: {
...result.statusReport,
totalDurationMs: Math.round(performance.now() - startTime),
Comment thread
mbg marked this conversation as resolved.
Outdated
perLanguageBundleFallback: true,
},
};
Expand Down
Loading