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

6 files changed

+24
-2
lines changed

Diff for: lib/setup-codeql.js

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: lib/setup-codeql.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: lib/setup-codeql.test.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: lib/setup-codeql.test.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/setup-codeql.test.ts

+2
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
});

Diff for: src/setup-codeql.ts

+11
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)