Refactor CLI caching with in-memory and file storage

This commit is contained in:
Mario Campos
2026-06-17 23:45:01 -05:00
parent dc8e1e9aa0
commit a602287f73
8 changed files with 432 additions and 262 deletions

View File

@@ -14,6 +14,7 @@ import { ActionsEnv, getActionVersion } from "./actions-util";
import { AnalysisKind } from "./analyses";
import * as apiClient from "./api-client";
import { GitHubApiDetails } from "./api-client";
import { resetCachedCommandOutputs } from "./cache";
import { CachingKind } from "./caching-utils";
import * as codeql from "./codeql";
import { Config } from "./config-utils";
@@ -32,7 +33,6 @@ import {
GitHubVariant,
GitHubVersion,
HTTPError,
resetCachedCodeQlVersion,
} from "./util";
export const SAMPLE_DOTCOM_API_DETAILS = {
@@ -102,9 +102,9 @@ export function setupTests(testFn: TestFn<any>) {
// unless the test explicitly sets one up.
codeql.setCodeQL({});
// Reset the in-process CodeQL version cache so that it doesn't leak between
// tests, which each represent a separate Actions step in production.
resetCachedCodeQlVersion();
// Reset the in-process CodeQL command-output cache so that it doesn't leak
// between tests, which each represent a separate Actions step in production.
resetCachedCommandOutputs();
// Replace stdout and stderr so we can record output during tests
t.context.testOutput = "";