@@ -8,6 +8,7 @@ import * as semver from "semver";
8
8
import * as api from "./api-client" ;
9
9
import { CachingKind , getCachingKind } from "./caching-utils" ;
10
10
import { CodeQL } from "./codeql" ;
11
+ import { shouldPerformDiffInformedAnalysis } from "./diff-informed-analysis-utils" ;
11
12
import { Feature , FeatureEnablement } from "./feature-flags" ;
12
13
import { Language , parseLanguage } from "./languages" ;
13
14
import { Logger } from "./logging" ;
@@ -469,9 +470,12 @@ export async function getDefaultConfig({
469
470
) ;
470
471
471
472
const augmentationProperties = await calculateAugmentation (
473
+ codeql ,
474
+ features ,
472
475
packsInput ,
473
476
queriesInput ,
474
477
languages ,
478
+ logger ,
475
479
) ;
476
480
477
481
const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime (
@@ -575,9 +579,12 @@ async function loadConfig({
575
579
) ;
576
580
577
581
const augmentationProperties = await calculateAugmentation (
582
+ codeql ,
583
+ features ,
578
584
packsInput ,
579
585
queriesInput ,
580
586
languages ,
587
+ logger ,
581
588
) ;
582
589
583
590
const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime (
@@ -612,11 +619,14 @@ async function loadConfig({
612
619
* and the CLI does not know about these inputs so we need to inject them into
613
620
* the config file sent to the CLI.
614
621
*
622
+ * @param codeql The CodeQL object.
623
+ * @param features The feature enablement object.
615
624
* @param rawPacksInput The packs input from the action configuration.
616
625
* @param rawQueriesInput The queries input from the action configuration.
617
626
* @param languages The languages that the config file is for. If the packs input
618
627
* is non-empty, then there must be exactly one language. Otherwise, an
619
628
* error is thrown.
629
+ * @param logger The logger to use for logging.
620
630
*
621
631
* @returns The properties that need to be augmented in the config file.
622
632
*
@@ -625,9 +635,12 @@ async function loadConfig({
625
635
*/
626
636
// exported for testing.
627
637
export async function calculateAugmentation (
638
+ codeql : CodeQL ,
639
+ features : FeatureEnablement ,
628
640
rawPacksInput : string | undefined ,
629
641
rawQueriesInput : string | undefined ,
630
642
languages : Language [ ] ,
643
+ logger : Logger ,
631
644
) : Promise < AugmentationProperties > {
632
645
const packsInputCombines = shouldCombine ( rawPacksInput ) ;
633
646
const packsInput = parsePacksFromInput (
@@ -642,6 +655,9 @@ export async function calculateAugmentation(
642
655
) ;
643
656
644
657
const defaultQueryFilters : QueryFilter [ ] = [ ] ;
658
+ if ( await shouldPerformDiffInformedAnalysis ( codeql , features , logger ) ) {
659
+ defaultQueryFilters . push ( { exclude : { tags : "exclude-from-incremental" } } ) ;
660
+ }
645
661
646
662
return {
647
663
packsInputCombines,
0 commit comments