Override cleanup-level for overlay-base database

This commit is contained in:
Chuan-kai Lin
2025-06-20 11:47:09 -07:00
parent 2fc04c80cc
commit 42835b3971
3 changed files with 14 additions and 2 deletions

View File

@@ -39,6 +39,7 @@ test("analyze action with RAM & threads from environment variables", async (t) =
};
sinon.stub(configUtils, "getConfig").resolves({
gitHubVersion,
augmentationProperties: {},
languages: [],
packs: [],
trapCaches: {},

View File

@@ -37,6 +37,7 @@ test("analyze action with RAM & threads from action inputs", async (t) => {
};
sinon.stub(configUtils, "getConfig").resolves({
gitHubVersion,
augmentationProperties: {},
languages: [],
packs: [],
trapCaches: {},

View File

@@ -27,7 +27,10 @@ import { EnvVar } from "./environment";
import { Features } from "./feature-flags";
import { Language } from "./languages";
import { getActionsLogger, Logger } from "./logging";
import { uploadOverlayBaseDatabaseToCache } from "./overlay-database-utils";
import {
OverlayDatabaseMode,
uploadOverlayBaseDatabaseToCache,
} from "./overlay-database-utils";
import { getRepositoryNwo } from "./repository";
import * as statusReport from "./status-report";
import {
@@ -292,8 +295,15 @@ async function run() {
logger,
);
// An overlay-base database should always use the 'overlay' cleanup level
// to preserve the cached intermediate results.
//
// Note that we may be overriding the 'cleanup-level' input parameter.
const cleanupLevel =
actionsUtil.getOptionalInput("cleanup-level") || "brutal";
config.augmentationProperties.overlayDatabaseMode ===
OverlayDatabaseMode.OverlayBase
? "overlay"
: actionsUtil.getOptionalInput("cleanup-level") || "brutal";
if (actionsUtil.getRequiredInput("skip-queries") !== "true") {
runStats = await runQueries(