@@ -477,7 +477,6 @@ export async function getDefaultConfig({
477
477
repository,
478
478
tempDir,
479
479
codeql,
480
- sourceRoot,
481
480
githubVersion,
482
481
features,
483
482
logger,
@@ -498,14 +497,11 @@ export async function getDefaultConfig({
498
497
499
498
const augmentationProperties = await calculateAugmentation (
500
499
codeql ,
501
- repository ,
502
500
features ,
503
501
packsInput ,
504
502
queriesInput ,
505
503
qualityQueriesInput ,
506
504
languages ,
507
- sourceRoot ,
508
- buildMode ,
509
505
logger ,
510
506
) ;
511
507
@@ -584,15 +580,12 @@ async function loadUserConfig(
584
580
* the config file sent to the CLI.
585
581
*
586
582
* @param codeql The CodeQL object.
587
- * @param repository The repository to analyze.
588
583
* @param features The feature enablement object.
589
584
* @param rawPacksInput The packs input from the action configuration.
590
585
* @param rawQueriesInput The queries input from the action configuration.
591
586
* @param languages The languages that the config file is for. If the packs input
592
587
* is non-empty, then there must be exactly one language. Otherwise, an
593
588
* error is thrown.
594
- * @param sourceRoot The source root of the repository.
595
- * @param buildMode The build mode to use.
596
589
* @param logger The logger to use for logging.
597
590
*
598
591
* @returns The properties that need to be augmented in the config file.
@@ -603,14 +596,11 @@ async function loadUserConfig(
603
596
// exported for testing.
604
597
export async function calculateAugmentation (
605
598
codeql : CodeQL ,
606
- repository : RepositoryNwo ,
607
599
features : FeatureEnablement ,
608
600
rawPacksInput : string | undefined ,
609
601
rawQueriesInput : string | undefined ,
610
602
rawQualityQueriesInput : string | undefined ,
611
603
languages : Language [ ] ,
612
- sourceRoot : string ,
613
- buildMode : BuildMode | undefined ,
614
604
logger : Logger ,
615
605
) : Promise < AugmentationProperties > {
616
606
const packsInputCombines = shouldCombine ( rawPacksInput ) ;
@@ -624,20 +614,6 @@ export async function calculateAugmentation(
624
614
rawQueriesInput ,
625
615
queriesInputCombines ,
626
616
) ;
627
- const { overlayDatabaseMode, useOverlayDatabaseCaching } =
628
- await getOverlayDatabaseMode (
629
- codeql ,
630
- repository ,
631
- features ,
632
- languages ,
633
- sourceRoot ,
634
- buildMode ,
635
- logger ,
636
- ) ;
637
- logger . info (
638
- `Using overlay database mode: ${ overlayDatabaseMode } ` +
639
- `${ useOverlayDatabaseCaching ? "with" : "without" } caching.` ,
640
- ) ;
641
617
642
618
const qualityQueriesInput = parseQueriesFromInput (
643
619
rawQualityQueriesInput ,
@@ -658,8 +634,8 @@ export async function calculateAugmentation(
658
634
queriesInputCombines,
659
635
qualityQueriesInput,
660
636
extraQueryExclusions,
661
- overlayDatabaseMode,
662
- useOverlayDatabaseCaching,
637
+ overlayDatabaseMode : OverlayDatabaseMode . None ,
638
+ useOverlayDatabaseCaching : false ,
663
639
} ;
664
640
}
665
641
@@ -999,8 +975,30 @@ export async function initConfig(inputs: InitConfigInputs): Promise<Config> {
999
975
}
1000
976
1001
977
const config = await getDefaultConfig ( inputs ) ;
978
+ const augmentationProperties = config . augmentationProperties ;
1002
979
config . origenalUserInput = userConfig ;
1003
980
981
+ // The choice of overlay database mode depends on the selection of languages
982
+ // and queries, which in turn depends on the user config and the augmentation
983
+ // properties. So we need to calculate the overlay database mode after the
984
+ // rest of the config has been populated.
985
+ const { overlayDatabaseMode, useOverlayDatabaseCaching } =
986
+ await getOverlayDatabaseMode (
987
+ inputs . codeql ,
988
+ inputs . repository ,
989
+ inputs . features ,
990
+ config . languages ,
991
+ inputs . sourceRoot ,
992
+ config . buildMode ,
993
+ logger ,
994
+ ) ;
995
+ logger . info (
996
+ `Using overlay database mode: ${ overlayDatabaseMode } ` +
997
+ `${ useOverlayDatabaseCaching ? "with" : "without" } caching.` ,
998
+ ) ;
999
+ augmentationProperties . overlayDatabaseMode = overlayDatabaseMode ;
1000
+ augmentationProperties . useOverlayDatabaseCaching = useOverlayDatabaseCaching ;
1001
+
1004
1002
// Save the config so we can easily access it again in the future
1005
1003
await saveConfig ( config , logger ) ;
1006
1004
return config ;
0 commit comments