mirror of
https://github.com/github/codeql-action.git
synced 2026-10-31 09:59:43 +00:00
Add explicit field for extraction streaming
This commit is contained in:
@@ -165,6 +165,7 @@ test("setupCodeQLBundle logs the CodeQL CLI version being used when asked to use
|
||||
compressionMethod: "gzip",
|
||||
downloadDurationMs: 200,
|
||||
extractionDurationMs: 300,
|
||||
streamExtraction: false,
|
||||
toolsUrl: "toolsUrl",
|
||||
},
|
||||
toolsVersion: LINKED_CLI_VERSION.cliVersion,
|
||||
@@ -215,6 +216,7 @@ test("setupCodeQLBundle logs the CodeQL CLI version being used when asked to dow
|
||||
compressionMethod: "gzip",
|
||||
downloadDurationMs: 200,
|
||||
extractionDurationMs: 300,
|
||||
streamExtraction: false,
|
||||
toolsUrl: bundleUrl,
|
||||
},
|
||||
toolsVersion: expectedVersion,
|
||||
|
||||
@@ -19,8 +19,21 @@ type DownloadFirstToolsDownloadDurations = {
|
||||
combinedDurationMs: number;
|
||||
downloadDurationMs: number;
|
||||
extractionDurationMs: number;
|
||||
streamExtraction: false;
|
||||
};
|
||||
|
||||
function makeDownloadFirstToolsDownloadDurations(
|
||||
downloadDurationMs: number,
|
||||
extractionDurationMs: number,
|
||||
): DownloadFirstToolsDownloadDurations {
|
||||
return {
|
||||
combinedDurationMs: downloadDurationMs + extractionDurationMs,
|
||||
downloadDurationMs,
|
||||
extractionDurationMs,
|
||||
streamExtraction: false,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Timing information for the download and extraction of the CodeQL tools when
|
||||
* we stream the download and extraction of the bundle.
|
||||
@@ -29,8 +42,20 @@ type StreamedToolsDownloadDurations = {
|
||||
combinedDurationMs: number;
|
||||
downloadDurationMs: undefined;
|
||||
extractionDurationMs: undefined;
|
||||
streamExtraction: true;
|
||||
};
|
||||
|
||||
function makeStreamedToolsDownloadDurations(
|
||||
combinedDurationMs: number,
|
||||
): StreamedToolsDownloadDurations {
|
||||
return {
|
||||
combinedDurationMs,
|
||||
downloadDurationMs: undefined,
|
||||
extractionDurationMs: undefined,
|
||||
streamExtraction: true,
|
||||
};
|
||||
}
|
||||
|
||||
type ToolsDownloadDurations =
|
||||
| DownloadFirstToolsDownloadDurations
|
||||
| StreamedToolsDownloadDurations;
|
||||
@@ -86,11 +111,9 @@ export async function downloadAndExtract(
|
||||
return {
|
||||
extractedBundlePath,
|
||||
statusReport: {
|
||||
combinedDurationMs,
|
||||
compressionMethod,
|
||||
downloadDurationMs: undefined,
|
||||
extractionDurationMs: undefined,
|
||||
toolsUrl: sanitizeUrlForStatusReport(codeqlURL),
|
||||
...makeStreamedToolsDownloadDurations(combinedDurationMs),
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -138,10 +161,11 @@ export async function downloadAndExtract(
|
||||
extractedBundlePath,
|
||||
statusReport: {
|
||||
compressionMethod,
|
||||
combinedDurationMs: downloadDurationMs + extractionDurationMs,
|
||||
downloadDurationMs,
|
||||
extractionDurationMs,
|
||||
toolsUrl: sanitizeUrlForStatusReport(codeqlURL),
|
||||
...makeDownloadFirstToolsDownloadDurations(
|
||||
downloadDurationMs,
|
||||
extractionDurationMs,
|
||||
),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user