Assume small bundles are available in the official repo

This commit is contained in:
Marco Gario
2020-09-17 17:47:01 +02:00
parent c25320cfef
commit 1157017557
6 changed files with 12 additions and 10 deletions
Generated
+3 -4
View File
@@ -67,11 +67,10 @@ async function getCodeQLBundleDownloadURL(bundleNames, githubAuth, githubUrl, mo
const uniqueDownloadSources = potentialDownloadSources.filter((url, index, self) => index === self.indexOf(url));
for (const downloadSource of uniqueDownloadSources) {
const [apiURL, repository] = downloadSource;
// If we've reached the final case, short-circuit the API check since we know the bundle exists and is public.
// If we've reached the final case, short-circuit the API check since we know the bundles exist and are public.
if (apiURL === util.GITHUB_DOTCOM_URL &&
repository === CODEQL_DEFAULT_ACTION_REPOSITORY &&
bundleNames[0] === CODEQL_BUNDLE_NAME) {
break;
repository === CODEQL_DEFAULT_ACTION_REPOSITORY) {
return `https://github.com/${CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${CODEQL_BUNDLE_VERSION}/${bundleNames[0]}`;
}
const [repositoryOwner, repositoryName] = repository.split("/");
try {
+1 -1
View File
File diff suppressed because one or more lines are too long
+2
View File
@@ -55,6 +55,8 @@ ava_1.default("download and populate codeql bundle cache", async (t) => {
}
}
const cachedVersions = toolcache.findAllVersions("CodeQL");
// We should now have 4 cached versions: e.g.,
// 20200601, 20200601-linux64-cpp, 20200610, 20200610-linux64-cpp
t.is(cachedVersions.length, 4);
});
});
File diff suppressed because one or more lines are too long
+2
View File
@@ -69,6 +69,8 @@ test("download and populate codeql bundle cache", async (t) => {
}
const cachedVersions = toolcache.findAllVersions("CodeQL");
// We should now have 4 cached versions: e.g.,
// 20200601, 20200601-linux64-cpp, 20200610, 20200610-linux64-cpp
t.is(cachedVersions.length, 4);
});
});
+3 -4
View File
@@ -164,13 +164,12 @@ export async function getCodeQLBundleDownloadURL(
);
for (const downloadSource of uniqueDownloadSources) {
const [apiURL, repository] = downloadSource;
// If we've reached the final case, short-circuit the API check since we know the bundle exists and is public.
// If we've reached the final case, short-circuit the API check since we know the bundles exist and are public.
if (
apiURL === util.GITHUB_DOTCOM_URL &&
repository === CODEQL_DEFAULT_ACTION_REPOSITORY &&
bundleNames[0] === CODEQL_BUNDLE_NAME
repository === CODEQL_DEFAULT_ACTION_REPOSITORY
) {
break;
return `https://github.com/${CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${CODEQL_BUNDLE_VERSION}/${bundleNames[0]}`;
}
const [repositoryOwner, repositoryName] = repository.split("/");
try {