@@ -195,7 +195,7 @@ export interface AugmentationProperties {
195
195
/**
196
196
* Extra query exclusions to append to the config.
197
197
*/
198
- extraQueryExclusions ? : ExcludeQueryFilter [ ] ;
198
+ extraQueryExclusions : ExcludeQueryFilter [ ] ;
199
199
200
200
/**
201
201
* The overlay database mode to use.
@@ -496,13 +496,10 @@ export async function getDefaultConfig({
496
496
) ;
497
497
498
498
const augmentationProperties = await calculateAugmentation (
499
- codeql ,
500
- features ,
501
499
packsInput ,
502
500
queriesInput ,
503
501
qualityQueriesInput ,
504
502
languages ,
505
- logger ,
506
503
) ;
507
504
508
505
const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime (
@@ -579,14 +576,11 @@ async function loadUserConfig(
579
576
* and the CLI does not know about these inputs so we need to inject them into
580
577
* the config file sent to the CLI.
581
578
*
582
- * @param codeql The CodeQL object.
583
- * @param features The feature enablement object.
584
579
* @param rawPacksInput The packs input from the action configuration.
585
580
* @param rawQueriesInput The queries input from the action configuration.
586
581
* @param languages The languages that the config file is for. If the packs input
587
582
* is non-empty, then there must be exactly one language. Otherwise, an
588
583
* error is thrown.
589
- * @param logger The logger to use for logging.
590
584
*
591
585
* @returns The properties that need to be augmented in the config file.
592
586
*
@@ -595,13 +589,10 @@ async function loadUserConfig(
595
589
*/
596
590
// exported for testing.
597
591
export async function calculateAugmentation (
598
- codeql : CodeQL ,
599
- features : FeatureEnablement ,
600
592
rawPacksInput : string | undefined ,
601
593
rawQueriesInput : string | undefined ,
602
594
rawQualityQueriesInput : string | undefined ,
603
595
languages : Language [ ] ,
604
- logger : Logger ,
605
596
) : Promise < AugmentationProperties > {
606
597
const packsInputCombines = shouldCombine ( rawPacksInput ) ;
607
598
const packsInput = parsePacksFromInput (
@@ -620,20 +611,13 @@ export async function calculateAugmentation(
620
611
false ,
621
612
) ;
622
613
623
- const extraQueryExclusions : ExcludeQueryFilter [ ] = [ ] ;
624
- if ( await shouldPerformDiffInformedAnalysis ( codeql , features , logger ) ) {
625
- extraQueryExclusions . push ( {
626
- exclude : { tags : "exclude-from-incremental" } ,
627
- } ) ;
628
- }
629
-
630
614
return {
631
615
packsInputCombines,
632
616
packsInput : packsInput ?. [ languages [ 0 ] ] ,
633
617
queriesInput,
634
618
queriesInputCombines,
635
619
qualityQueriesInput,
636
- extraQueryExclusions,
620
+ extraQueryExclusions : [ ] ,
637
621
overlayDatabaseMode : OverlayDatabaseMode . None ,
638
622
useOverlayDatabaseCaching : false ,
639
623
} ;
@@ -999,6 +983,19 @@ export async function initConfig(inputs: InitConfigInputs): Promise<Config> {
999
983
augmentationProperties . overlayDatabaseMode = overlayDatabaseMode ;
1000
984
augmentationProperties . useOverlayDatabaseCaching = useOverlayDatabaseCaching ;
1001
985
986
+ if (
987
+ overlayDatabaseMode === OverlayDatabaseMode . Overlay ||
988
+ ( await shouldPerformDiffInformedAnalysis (
989
+ inputs . codeql ,
990
+ inputs . features ,
991
+ logger ,
992
+ ) )
993
+ ) {
994
+ augmentationProperties . extraQueryExclusions . push ( {
995
+ exclude : { tags : "exclude-from-incremental" } ,
996
+ } ) ;
997
+ }
998
+
1002
999
// Save the config so we can easily access it again in the future
1003
1000
await saveConfig ( config , logger ) ;
1004
1001
return config ;
0 commit comments