Skip to content

Commit 455a24e

Browse files
committed
Override cleanup-level for overlay-base database
1 parent 030a42a commit 455a24e

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

src/analyze-action-env.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ test("analyze action with RAM & threads from environment variables", async (t) =
3939
};
4040
sinon.stub(configUtils, "getConfig").resolves({
4141
gitHubVersion,
42+
augmentationProperties: {},
4243
languages: [],
4344
packs: [],
4445
trapCaches: {},

src/analyze-action-input.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ test("analyze action with RAM & threads from action inputs", async (t) => {
3737
};
3838
sinon.stub(configUtils, "getConfig").resolves({
3939
gitHubVersion,
40+
augmentationProperties: {},
4041
languages: [],
4142
packs: [],
4243
trapCaches: {},

src/analyze-action.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ import { EnvVar } from "./environment";
2727
import { Features } from "./feature-flags";
2828
import { Language } from "./languages";
2929
import { getActionsLogger, Logger } from "./logging";
30-
import { uploadOverlayBaseDatabaseToCache } from "./overlay-database-utils";
30+
import {
31+
OverlayDatabaseMode,
32+
uploadOverlayBaseDatabaseToCache,
33+
} from "./overlay-database-utils";
3134
import { getRepositoryNwo } from "./repository";
3235
import * as statusReport from "./status-report";
3336
import {
@@ -292,8 +295,15 @@ async function run() {
292295
logger,
293296
);
294297

298+
// An overlay-base database should always use the 'overlay' cleanup level
299+
// to preserve the cached intermediate results.
300+
//
301+
// Note that we may be overriding the 'cleanup-level' input parameter.
295302
const cleanupLevel =
296-
actionsUtil.getOptionalInput("cleanup-level") || "brutal";
303+
config.augmentationProperties.overlayDatabaseMode ===
304+
OverlayDatabaseMode.OverlayBase
305+
? "overlay"
306+
: actionsUtil.getOptionalInput("cleanup-level") || "brutal";
297307

298308
if (actionsUtil.getRequiredInput("skip-queries") !== "true") {
299309
runStats = await runQueries(

0 commit comments

Comments
 (0)