@@ -195,7 +195,7 @@ export interface AugmentationProperties {
195195 /**
196196 * Extra query exclusions to append to the config.
197197 */
198- extraQueryExclusions ? : ExcludeQueryFilter [ ] ;
198+ extraQueryExclusions : ExcludeQueryFilter [ ] ;
199199
200200 /**
201201 * The overlay database mode to use.
@@ -496,13 +496,10 @@ export async function getDefaultConfig({
496496 ) ;
497497
498498 const augmentationProperties = await calculateAugmentation (
499- codeql ,
500- features ,
501499 packsInput ,
502500 queriesInput ,
503501 qualityQueriesInput ,
504502 languages ,
505- logger ,
506503 ) ;
507504
508505 const { trapCaches, trapCacheDownloadTime } = await downloadCacheWithTime (
@@ -579,14 +576,11 @@ async function loadUserConfig(
579576 * and the CLI does not know about these inputs so we need to inject them into
580577 * the config file sent to the CLI.
581578 *
582- * @param codeql The CodeQL object.
583- * @param features The feature enablement object.
584579 * @param rawPacksInput The packs input from the action configuration.
585580 * @param rawQueriesInput The queries input from the action configuration.
586581 * @param languages The languages that the config file is for. If the packs input
587582 * is non-empty, then there must be exactly one language. Otherwise, an
588583 * error is thrown.
589- * @param logger The logger to use for logging.
590584 *
591585 * @returns The properties that need to be augmented in the config file.
592586 *
@@ -595,13 +589,10 @@ async function loadUserConfig(
595589 */
596590// exported for testing.
597591export async function calculateAugmentation (
598- codeql : CodeQL ,
599- features : FeatureEnablement ,
600592 rawPacksInput : string | undefined ,
601593 rawQueriesInput : string | undefined ,
602594 rawQualityQueriesInput : string | undefined ,
603595 languages : Language [ ] ,
604- logger : Logger ,
605596) : Promise < AugmentationProperties > {
606597 const packsInputCombines = shouldCombine ( rawPacksInput ) ;
607598 const packsInput = parsePacksFromInput (
@@ -620,20 +611,13 @@ export async function calculateAugmentation(
620611 false ,
621612 ) ;
622613
623- const extraQueryExclusions : ExcludeQueryFilter [ ] = [ ] ;
624- if ( await shouldPerformDiffInformedAnalysis ( codeql , features , logger ) ) {
625- extraQueryExclusions . push ( {
626- exclude : { tags : "exclude-from-incremental" } ,
627- } ) ;
628- }
629-
630614 return {
631615 packsInputCombines,
632616 packsInput : packsInput ?. [ languages [ 0 ] ] ,
633617 queriesInput,
634618 queriesInputCombines,
635619 qualityQueriesInput,
636- extraQueryExclusions,
620+ extraQueryExclusions : [ ] ,
637621 overlayDatabaseMode : OverlayDatabaseMode . None ,
638622 useOverlayDatabaseCaching : false ,
639623 } ;
@@ -999,6 +983,19 @@ export async function initConfig(inputs: InitConfigInputs): Promise<Config> {
999983 augmentationProperties . overlayDatabaseMode = overlayDatabaseMode ;
1000984 augmentationProperties . useOverlayDatabaseCaching = useOverlayDatabaseCaching ;
1001985
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+
1002999 // Save the config so we can easily access it again in the future
10031000 await saveConfig ( config , logger ) ;
10041001 return config ;
0 commit comments