Skip to content

Commit abed378

Browse files
committed
Add "overlay" to SARIF incrementalMode run property
1 parent a2d55c4 commit abed378

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/analyze.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { EnvVar } from "./environment";
2525
import { FeatureEnablement, Feature } from "./feature-flags";
2626
import { isScannedLanguage, Language } from "./languages";
2727
import { Logger, withGroupAsync } from "./logging";
28+
import { OverlayDatabaseMode } from "./overlay-database-utils";
2829
import { getRepositoryNwoFromEnv } from "./repository";
2930
import { DatabaseCreationTimings, EventReport } from "./status-report";
3031
import { endTracingForCluster } from "./tracer-config";
@@ -604,6 +605,7 @@ export async function runQueries(
604605
): Promise<QueriesStatusReport> {
605606
const statusReport: QueriesStatusReport = {};
606607
const queryFlags = [memoryFlag, threadsFlag];
608+
const incrementalMode: string[] = [];
607609

608610
if (cleanupLevel !== "overlay") {
609611
queryFlags.push("--expect-discarded-cache");
@@ -613,10 +615,18 @@ export async function runQueries(
613615
if (diffRangePackDir) {
614616
queryFlags.push(`--additional-packs=${diffRangePackDir}`);
615617
queryFlags.push("--extension-packs=codeql-action/pr-diff-range");
618+
incrementalMode.push("diff-informed");
616619
}
617-
const sarifRunPropertyFlag = diffRangePackDir
618-
? "--sarif-run-property=incrementalMode=diff-informed"
619-
: undefined;
620+
if (
621+
config.augmentationProperties.overlayDatabaseMode ===
622+
OverlayDatabaseMode.Overlay
623+
) {
624+
incrementalMode.push("overlay");
625+
}
626+
const sarifRunPropertyFlag =
627+
incrementalMode.length > 0
628+
? `--sarif-run-property=incrementalMode=${incrementalMode.join(",")}`
629+
: undefined;
620630

621631
const codeql = await getCodeQL(config.codeQLCmd);
622632

0 commit comments

Comments
 (0)