Skip to content

Merge main into releases/v3 #2478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e4525ac
Use cache-cleanup command line option
paldepind Aug 28, 2024
0f99b63
Use GitHub App for authz
rvermeulen Aug 28, 2024
8fdccc5
Update changelog and version after v3.26.6
github-actions[bot] Aug 29, 2024
d905212
Update checked-in dependencies
github-actions[bot] Aug 29, 2024
b43ac1c
Merge pull request #2453 from github/mergeback/v3.26.6-to-main-4dd16135
henrymercer Aug 29, 2024
f3f8576
Go: Bump Go version to 1.23
mbg Aug 29, 2024
e257226
Experiment with asking tar to figure out the decompression method
henrymercer Aug 13, 2024
cf64c3e
Add telemetry for compression method
henrymercer Aug 13, 2024
ffa1b05
Only try zstd for specified version ranges of tar
henrymercer Aug 16, 2024
335044a
Add detected tar version to telemetry
henrymercer Aug 16, 2024
6240306
Download zstd nightly bundles in PR checks
henrymercer Aug 23, 2024
379271d
Support passing local zstd-compressed bundles
henrymercer Aug 23, 2024
27dbb1a
Infer compression method from URL
henrymercer Aug 23, 2024
c283379
Change "recommended" to "minimum"
aeisenberg Aug 28, 2024
821ab42
Merge pull request #2442 from github/henrymercer/zstd-bundles
henrymercer Aug 30, 2024
693677d
Update README.md
aeisenberg Aug 30, 2024
9a16e92
Guard usage of cache-cleanup option by version check
paldepind Sep 2, 2024
878047b
Merge branch 'main' into use-cache-cleanup-flag
paldepind Sep 2, 2024
52df12d
Bump the npm group with 3 updates
dependabot[bot] Sep 2, 2024
294a6ed
Update checked-in dependencies
github-actions[bot] Sep 2, 2024
b4a8631
Merge pull request #2457 from github/dependabot/npm_and_yarn/npm-689a…
henrymercer Sep 3, 2024
4ac5f37
Merge pull request #2450 from paldepind/use-cache-cleanup-flag
paldepind Sep 4, 2024
889597e
Merge pull request #2451 from github/aeisenberg/recommended
aeisenberg Sep 4, 2024
77f9025
Fix formatting issue with GHES compatibility table
henrymercer Sep 5, 2024
de6fe7e
Add job run UUID to SARIF output
henrymercer Sep 5, 2024
90cf3d2
Add PR check for job run UUID
henrymercer Sep 5, 2024
3b0aa30
Merge pull request #2462 from github/henrymercer/fix-ghes-table
henrymercer Sep 5, 2024
ad5c608
Merge pull request #2463 from github/henrymercer/job-uuid-in-sarif
henrymercer Sep 5, 2024
0aafba9
Add standard tools URLs to status report
henrymercer Sep 5, 2024
9b41ced
Merge pull request #2464 from github/henrymercer/tools-url-status-report
henrymercer Sep 5, 2024
d8b1697
Merge pull request #2455 from github/mbg/go/1.23
mbg Sep 6, 2024
55c72b9
Upload sarif for eslint results
aeisenberg Sep 9, 2024
c00e239
Update setup-swift version
aeisenberg Sep 9, 2024
8fd294e
Merge pull request #2470 from github/aeisenberg/update-setup-swift
aeisenberg Sep 9, 2024
5c9d953
Merge branch 'main' into aeisenberg/upload-eslint-sarif
aeisenberg Sep 9, 2024
2a9bba1
Update default bundle to codeql-bundle-v2.18.4
github-actions[bot] Sep 10, 2024
8d9ed0b
Add changelog note
github-actions[bot] Sep 10, 2024
f824adb
Merge branch 'main' into rvermeulen/update-release-branch-authz
rvermeulen Sep 10, 2024
56b8418
Ignore suppressed alerts
aeisenberg Sep 9, 2024
49021ad
Merge pull request #2472 from rvermeulen/rvermeulen/update-release-br…
rvermeulen Sep 10, 2024
e817992
Merge pull request #2469 from github/aeisenberg/upload-eslint-sarif
aeisenberg Sep 10, 2024
0d0f998
Always upload eslint.sarif
aeisenberg Sep 10, 2024
762dbae
Merge pull request #2471 from github/update-bundle/codeql-bundle-v2.18.4
Sep 12, 2024
4a01ec7
Merge pull request #2474 from github/aeisenberg/always-upload-eslint-…
aeisenberg Sep 12, 2024
a3b3e07
Update changelog for v3.26.7
github-actions[bot] Sep 13, 2024
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
Add telemetry for compression method
  • Loading branch information
henrymercer committed Aug 29, 2024
commit cf64c3e3a348cead50c1f6173220fdcee06f49f8
1 change: 1 addition & 0 deletions lib/codeql.js

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

2 changes: 1 addition & 1 deletion lib/codeql.js.map

Large diffs are not rendered by default.

26 changes: 15 additions & 11 deletions lib/setup-codeql.js

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

2 changes: 1 addition & 1 deletion lib/setup-codeql.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions lib/setup-codeql.test.js

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

2 changes: 1 addition & 1 deletion lib/setup-codeql.test.js.map

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

7 changes: 7 additions & 0 deletions src/codeql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,13 @@ export async function setupCodeQL(
defaultCliVersion,
logger,
);

logger.debug(
`Bundle download status report: ${JSON.stringify(
toolsDownloadStatusReport,
)}`,
);

let codeqlCmd = path.join(codeqlFolder, "codeql", "codeql");
if (process.platform === "win32") {
codeqlCmd += ".exe";
Expand Down
2 changes: 2 additions & 0 deletions src/setup-codeql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ test("setupCodeQLBundle logs the CodeQL CLI version being used when asked to use
sinon.stub(setupCodeql, "downloadCodeQL").resolves({
codeqlFolder: "codeql",
statusReport: {
compressionMethod: "gzip",
downloadDurationMs: 200,
extractionDurationMs: 300,
},
Expand Down Expand Up @@ -200,6 +201,7 @@ test("setupCodeQLBundle logs the CodeQL CLI version being used when asked to dow
sinon.stub(setupCodeql, "downloadCodeQL").resolves({
codeqlFolder: "codeql",
statusReport: {
compressionMethod: "gzip",
downloadDurationMs: 200,
extractionDurationMs: 300,
},
Expand Down
54 changes: 36 additions & 18 deletions src/setup-codeql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,10 @@ export async function tryGetFallbackToolcacheVersion(
return fallbackVersion;
}

type CompressionMethod = "gzip" | "zstd";

export interface ToolsDownloadStatusReport {
compressionMethod: CompressionMethod;
downloadDurationMs: number;
extractionDurationMs: number;
}
Expand Down Expand Up @@ -526,7 +529,9 @@ export const downloadCodeQL = async function (

logger.debug("Extracting CodeQL bundle.");
const extractionStart = performance.now();
const extractedBundlePath = await extractBundle(archivedBundlePath);
const { extractedBundlePath, compressionMethod } = await extractBundle(
archivedBundlePath,
);
const extractionDurationMs = Math.round(performance.now() - extractionStart);
logger.debug(
`Finished extracting CodeQL bundle to ${extractedBundlePath} (${extractionDurationMs} ms).`,
Expand All @@ -544,6 +549,7 @@ export const downloadCodeQL = async function (
return {
codeqlFolder: extractedBundlePath,
statusReport: {
compressionMethod,
downloadDurationMs,
extractionDurationMs,
},
Expand Down Expand Up @@ -575,6 +581,7 @@ export const downloadCodeQL = async function (
return {
codeqlFolder: toolcachedBundlePath,
statusReport: {
compressionMethod,
downloadDurationMs,
extractionDurationMs,
},
Expand Down Expand Up @@ -619,17 +626,16 @@ function getCanonicalToolcacheVersion(
return cliVersion;
}

export interface SetupCodeQLResult {
codeqlFolder: string;
toolsDownloadStatusReport?: ToolsDownloadStatusReport;
toolsSource: ToolsSource;
toolsVersion: string;
}

/**
* Obtains the CodeQL bundle, installs it in the toolcache if appropriate, and extracts it.
*
* @param toolsInput
* @param apiDetails
* @param tempDir
* @param variant
* @param defaultCliVersion
* @param logger
* @param checkVersion Whether to check that CodeQL CLI meets the minimum
* version requirement. Must be set to true outside tests.
* @returns the path to the extracted bundle, and the version of the tools
*/
export async function setupCodeQLBundle(
Expand All @@ -639,12 +645,7 @@ export async function setupCodeQLBundle(
variant: util.GitHubVariant,
defaultCliVersion: CodeQLDefaultVersionInfo,
logger: Logger,
): Promise<{
codeqlFolder: string;
toolsDownloadStatusReport?: ToolsDownloadStatusReport;
toolsSource: ToolsSource;
toolsVersion: string;
}> {
): Promise<SetupCodeQLResult> {
const source = await getCodeQLSource(
toolsInput,
defaultCliVersion,
Expand Down Expand Up @@ -706,9 +707,26 @@ async function cleanUpGlob(glob: string, name: string, logger: Logger) {
}
}

async function extractBundle(archivedBundlePath: string): Promise<string> {
async function extractBundle(archivedBundlePath: string): Promise<{
compressionMethod: CompressionMethod;
extractedBundlePath: string;
}> {
if (archivedBundlePath.endsWith(".tar.gz")) {
return await toolcache.extractTar(archivedBundlePath);
return {
compressionMethod: "gzip",
// While we could also ask tar to autodetect the compression method,
// we defensively keep the gzip call identical as requesting a gzipped
// bundle will soon be a fallback option.
extractedBundlePath: await toolcache.extractTar(archivedBundlePath),
};
}
return await toolcache.extractTar(archivedBundlePath, undefined, "x");
return {
compressionMethod: "zstd",
// tar will autodetect the compression method
extractedBundlePath: await toolcache.extractTar(
archivedBundlePath,
undefined,
"x",
),
};
}
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy