Add standard tools URLs to status report
This commit is contained in:
parent
3b0aa30bb7
commit
0aafba91ba
6 changed files with 24 additions and 2 deletions
7
lib/setup-codeql.js
generated
7
lib/setup-codeql.js
generated
|
|
@ -413,6 +413,7 @@ const downloadCodeQL = async function (codeqlURL, maybeBundleVersion, maybeCliVe
|
|||
compressionMethod,
|
||||
downloadDurationMs,
|
||||
extractionDurationMs,
|
||||
toolsUrl: sanitizeUrlForStatusReport(codeqlURL),
|
||||
},
|
||||
toolsVersion: maybeCliVersion ?? "unknown",
|
||||
};
|
||||
|
|
@ -430,6 +431,7 @@ const downloadCodeQL = async function (codeqlURL, maybeBundleVersion, maybeCliVe
|
|||
compressionMethod,
|
||||
downloadDurationMs,
|
||||
extractionDurationMs,
|
||||
toolsUrl: sanitizeUrlForStatusReport(codeqlURL),
|
||||
},
|
||||
toolsVersion: maybeCliVersion ?? toolcacheVersion,
|
||||
};
|
||||
|
|
@ -518,4 +520,9 @@ async function cleanUpGlob(glob, name, logger) {
|
|||
logger.warning(`Failed to clean up ${name}: ${e}.`);
|
||||
}
|
||||
}
|
||||
function sanitizeUrlForStatusReport(url) {
|
||||
return ["github/codeql-action", "dsp-testing/codeql-cli-nightlies"].some((repo) => url.startsWith(`https://github.com/${repo}/releases/download/`))
|
||||
? url
|
||||
: "sanitized-value";
|
||||
}
|
||||
//# sourceMappingURL=setup-codeql.js.map
|
||||
File diff suppressed because one or more lines are too long
2
lib/setup-codeql.test.js
generated
2
lib/setup-codeql.test.js
generated
|
|
@ -119,6 +119,7 @@ ava_1.default.beforeEach(() => {
|
|||
compressionMethod: "gzip",
|
||||
downloadDurationMs: 200,
|
||||
extractionDurationMs: 300,
|
||||
toolsUrl: "toolsUrl",
|
||||
},
|
||||
toolsVersion: testing_utils_1.LINKED_CLI_VERSION.cliVersion,
|
||||
});
|
||||
|
|
@ -147,6 +148,7 @@ ava_1.default.beforeEach(() => {
|
|||
compressionMethod: "gzip",
|
||||
downloadDurationMs: 200,
|
||||
extractionDurationMs: 300,
|
||||
toolsUrl: bundleUrl,
|
||||
},
|
||||
toolsVersion: expectedVersion,
|
||||
});
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -157,6 +157,7 @@ test("setupCodeQLBundle logs the CodeQL CLI version being used when asked to use
|
|||
compressionMethod: "gzip",
|
||||
downloadDurationMs: 200,
|
||||
extractionDurationMs: 300,
|
||||
toolsUrl: "toolsUrl",
|
||||
},
|
||||
toolsVersion: LINKED_CLI_VERSION.cliVersion,
|
||||
});
|
||||
|
|
@ -204,6 +205,7 @@ test("setupCodeQLBundle logs the CodeQL CLI version being used when asked to dow
|
|||
compressionMethod: "gzip",
|
||||
downloadDurationMs: 200,
|
||||
extractionDurationMs: 300,
|
||||
toolsUrl: bundleUrl,
|
||||
},
|
||||
toolsVersion: expectedVersion,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -466,6 +466,7 @@ export interface ToolsDownloadStatusReport {
|
|||
compressionMethod: tar.CompressionMethod;
|
||||
downloadDurationMs: number;
|
||||
extractionDurationMs: number;
|
||||
toolsUrl: string;
|
||||
}
|
||||
|
||||
// Exported using `export const` for testing purposes. Specifically, we want to
|
||||
|
|
@ -553,6 +554,7 @@ export const downloadCodeQL = async function (
|
|||
compressionMethod,
|
||||
downloadDurationMs,
|
||||
extractionDurationMs,
|
||||
toolsUrl: sanitizeUrlForStatusReport(codeqlURL),
|
||||
},
|
||||
toolsVersion: maybeCliVersion ?? "unknown",
|
||||
};
|
||||
|
|
@ -585,6 +587,7 @@ export const downloadCodeQL = async function (
|
|||
compressionMethod,
|
||||
downloadDurationMs,
|
||||
extractionDurationMs,
|
||||
toolsUrl: sanitizeUrlForStatusReport(codeqlURL),
|
||||
},
|
||||
toolsVersion: maybeCliVersion ?? toolcacheVersion,
|
||||
};
|
||||
|
|
@ -711,3 +714,11 @@ async function cleanUpGlob(glob: string, name: string, logger: Logger) {
|
|||
logger.warning(`Failed to clean up ${name}: ${e}.`);
|
||||
}
|
||||
}
|
||||
|
||||
function sanitizeUrlForStatusReport(url: string): string {
|
||||
return ["github/codeql-action", "dsp-testing/codeql-cli-nightlies"].some(
|
||||
(repo) => url.startsWith(`https://github.com/${repo}/releases/download/`),
|
||||
)
|
||||
? url
|
||||
: "sanitized-value";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue