FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Separate CodeQL bundle resolution from installation by henrymercer · Pull Request #4145 · github/codeql-action · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .js  (1) .ts  (3) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
91 changes: 43 additions & 48 deletions lib/entry-points.js

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

61 changes: 60 additions & 1 deletion src/codeql.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async function installIntoToolcache({
tmpDir: string;
}) {
const url = mockBundleDownloadApi({ apiDetails, isPinned, tagName });
await codeql.setupCodeQL(
return await codeql.setupCodeQL(
cliVersion !== undefined ? undefined : url,
apiDetails,
tmpDir,
Expand Down Expand Up @@ -259,6 +259,65 @@ test.serial(
},
);

for (const { cliVersion, tagName, expectedToolcacheVersion } of [
{
cliVersion: "2.21.0",
tagName: "codeql-bundle-20240101",
expectedToolcacheVersion: "2.21.0",
},
{
cliVersion: "2.21.0-rc.1",
tagName: "codeql-bundle-20240101",
expectedToolcacheVersion: "0.0.0-20240101",
},
{
cliVersion: "2.21.0+20240101",
tagName: "codeql-bundle-20240101",
expectedToolcacheVersion: "0.0.0-20240101",
},
{
cliVersion: "2.21.0",
tagName: "custom-release",
expectedToolcacheVersion: undefined,
},
]) {
test.serial(
`preserves CLI version ${cliVersion} when installing ${tagName}`,
async (t) => {
await util.withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);

const result = await installIntoToolcache({
cliVersion,
isPinned: false,
tagName,
tmpDir,
});

t.is(result.toolsVersion, cliVersion);
t.is(result.toolsSource, ToolsSource.Download);
t.true(
Number.isInteger(result.toolsDownloadStatusReport?.totalDurationMs),
);
t.deepEqual(
toolcache.findAllVersions("CodeQL"),
expectedToolcacheVersion === undefined
? []
: [expectedToolcacheVersion],
);
if (expectedToolcacheVersion !== undefined) {
const cachedFolder = toolcache.find(
"CodeQL",
expectedToolcacheVersion,
);
t.truthy(cachedFolder);
t.true(fs.existsSync(`${cachedFolder}.complete`));
}
});
},
);
}

const EXPLICITLY_REQUESTED_BUNDLE_TEST_CASES = [
{
tagName: "codeql-bundle-2.17.6",
Expand Down
Loading
Loading

Back | FazBrowse Home | New Git URL