@@ -8,6 +8,7 @@ import * as semver from "semver";
88import * as api from "./api-client" ;
99import { CachingKind , getCachingKind } from "./caching-utils" ;
1010import { CodeQL } from "./codeql" ;
11+ import { shouldPerformDiffInformedAnalysis } from "./diff-informed-analysis-utils" ;
1112import { Feature , FeatureEnablement } from "./feature-flags" ;
1213import { Language , parseLanguage } from "./languages" ;
1314import { Logger } from "./logging" ;
@@ -469,9 +470,12 @@ export async function getDefaultConfig({
469470 ) ;
470471
471472 const augmentationProperties = await calculateAugmentation (
473+ codeql ,
474+ features ,
472475 packsInput ,
473476 queriesInput ,
474477 languages ,
478+ logger ,
475479 ) ;
476480
477481 const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime (
@@ -575,9 +579,12 @@ async function loadConfig({
575579 ) ;
576580
577581 const augmentationProperties = await calculateAugmentation (
582+ codeql ,
583+ features ,
578584 packsInput ,
579585 queriesInput ,
580586 languages ,
587+ logger ,
581588 ) ;
582589
583590 const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime (
@@ -612,11 +619,14 @@ async function loadConfig({
612619 * and the CLI does not know about these inputs so we need to inject them into
613620 * the config file sent to the CLI.
614621 *
622+ * @param codeql The CodeQL object.
623+ * @param features The feature enablement object.
615624 * @param rawPacksInput The packs input from the action configuration.
616625 * @param rawQueriesInput The queries input from the action configuration.
617626 * @param languages The languages that the config file is for. If the packs input
618627 * is non-empty, then there must be exactly one language. Otherwise, an
619628 * error is thrown.
629+ * @param logger The logger to use for logging.
620630 *
621631 * @returns The properties that need to be augmented in the config file.
622632 *
@@ -625,9 +635,12 @@ async function loadConfig({
625635 */
626636// exported for testing.
627637export async function calculateAugmentation (
638+ codeql : CodeQL ,
639+ features : FeatureEnablement ,
628640 rawPacksInput : string | undefined ,
629641 rawQueriesInput : string | undefined ,
630642 languages : Language [ ] ,
643+ logger : Logger ,
631644) : Promise < AugmentationProperties > {
632645 const packsInputCombines = shouldCombine ( rawPacksInput ) ;
633646 const packsInput = parsePacksFromInput (
@@ -642,6 +655,9 @@ export async function calculateAugmentation(
642655 ) ;
643656
644657 const defaultQueryFilters : QueryFilter [ ] = [ ] ;
658+ if ( await shouldPerformDiffInformedAnalysis ( codeql , features , logger ) ) {
659+ defaultQueryFilters . push ( { exclude : { tags : "exclude-from-incremental" } } ) ;
660+ }
645661
646662 return {
647663 packsInputCombines,
0 commit comments