Skip to content

Commit 9b41ced

Browse files
authored
Merge pull request #2464 from github/henrymercer/tools-url-status-report
Add standard tools URLs to status report
2 parents ad5c608 + 0aafba9 commit 9b41ced

File tree

6 files changed

+24
-2
lines changed

6 files changed

+24
-2
lines changed

lib/setup-codeql.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/setup-codeql.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/setup-codeql.test.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/setup-codeql.test.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/setup-codeql.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ test("setupCodeQLBundle logs the CodeQL CLI version being used when asked to use
157157
compressionMethod: "gzip",
158158
downloadDurationMs: 200,
159159
extractionDurationMs: 300,
160+
toolsUrl: "toolsUrl",
160161
},
161162
toolsVersion: LINKED_CLI_VERSION.cliVersion,
162163
});
@@ -204,6 +205,7 @@ test("setupCodeQLBundle logs the CodeQL CLI version being used when asked to dow
204205
compressionMethod: "gzip",
205206
downloadDurationMs: 200,
206207
extractionDurationMs: 300,
208+
toolsUrl: bundleUrl,
207209
},
208210
toolsVersion: expectedVersion,
209211
});

src/setup-codeql.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ export interface ToolsDownloadStatusReport {
466466
compressionMethod: tar.CompressionMethod;
467467
downloadDurationMs: number;
468468
extractionDurationMs: number;
469+
toolsUrl: string;
469470
}
470471

471472
// Exported using `export const` for testing purposes. Specifically, we want to
@@ -553,6 +554,7 @@ export const downloadCodeQL = async function (
553554
compressionMethod,
554555
downloadDurationMs,
555556
extractionDurationMs,
557+
toolsUrl: sanitizeUrlForStatusReport(codeqlURL),
556558
},
557559
toolsVersion: maybeCliVersion ?? "unknown",
558560
};
@@ -585,6 +587,7 @@ export const downloadCodeQL = async function (
585587
compressionMethod,
586588
downloadDurationMs,
587589
extractionDurationMs,
590+
toolsUrl: sanitizeUrlForStatusReport(codeqlURL),
588591
},
589592
toolsVersion: maybeCliVersion ?? toolcacheVersion,
590593
};
@@ -711,3 +714,11 @@ async function cleanUpGlob(glob: string, name: string, logger: Logger) {
711714
logger.warning(`Failed to clean up ${name}: ${e}.`);
712715
}
713716
}
717+
718+
function sanitizeUrlForStatusReport(url: string): string {
719+
return ["github/codeql-action", "dsp-testing/codeql-cli-nightlies"].some(
720+
(repo) => url.startsWith(`https://github.com/${repo}/releases/download/`),
721+
)
722+
? url
723+
: "sanitized-value";
724+
}

0 commit comments

Comments
 (0)
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