Skip to content

Commit 8d623f4

Browse files
committed
Populate computedConfig in getDefaultConfig
1 parent 0fb047d commit 8d623f4

File tree

3 files changed

+25
-36
lines changed

3 files changed

+25
-36
lines changed

lib/init-action.js

Lines changed: 6 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config-utils.test.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,15 @@ test("load empty config", async (t) => {
157157
}),
158158
);
159159

160-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
161-
const { augmentationProperties, ...expectedConfig } =
162-
await configUtils.getDefaultConfig(
163-
createTestInitConfigInputs({
164-
languagesInput: languages,
165-
tempDir,
166-
codeql,
167-
logger,
168-
}),
169-
{},
170-
);
160+
const expectedConfig = await configUtils.getDefaultConfig(
161+
createTestInitConfigInputs({
162+
languagesInput: languages,
163+
tempDir,
164+
codeql,
165+
logger,
166+
}),
167+
{},
168+
);
171169

172170
t.deepEqual(config, expectedConfig);
173171
});

src/config-utils.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ export async function getDefaultConfig(
533533
logger,
534534
}: InitConfigInputs,
535535
userConfig: UserConfig,
536-
): Promise<Config & { augmentationProperties: AugmentationProperties }> {
536+
): Promise<Config> {
537537
const analysisKinds = await parseAnalysisKinds(analysisKindsInput);
538538

539539
// For backwards compatibility, add Code Quality to the enabled analysis kinds
@@ -574,20 +574,26 @@ export async function getDefaultConfig(
574574
logger,
575575
);
576576

577+
// Compute the full Code Scanning configuration that combines the configuration from the
578+
// configuration file / `config` input with other inputs, such as `queries`.
579+
const computedConfig = generateCodeScanningConfig(
580+
userConfig,
581+
augmentationProperties,
582+
);
583+
577584
return {
578585
analysisKinds,
579586
languages,
580587
buildMode,
581588
originalUserInput: userConfig,
582-
computedConfig: {},
589+
computedConfig,
583590
tempDir,
584591
codeQLCmd: codeql.getPath(),
585592
gitHubVersion: githubVersion,
586593
dbLocation: dbLocationOrDefault(dbLocation, tempDir),
587594
debugMode,
588595
debugArtifactName,
589596
debugDatabaseName,
590-
augmentationProperties,
591597
trapCaches,
592598
trapCacheDownloadTime,
593599
dependencyCachingEnabled: getCachingKind(dependencyCachingEnabled),
@@ -1101,17 +1107,7 @@ export async function initConfig(inputs: InitConfigInputs): Promise<Config> {
11011107
);
11021108
}
11031109

1104-
const { augmentationProperties, ...config } = await getDefaultConfig(
1105-
inputs,
1106-
userConfig,
1107-
);
1108-
1109-
// Compute the full Code Scanning configuration that combines the configuration from the
1110-
// configuration file / `config` input with other inputs, such as `queries`.
1111-
config.computedConfig = generateCodeScanningConfig(
1112-
userConfig,
1113-
augmentationProperties,
1114-
);
1110+
const config = await getDefaultConfig(inputs, userConfig);
11151111

11161112
// The choice of overlay database mode depends on the selection of languages
11171113
// and queries, which in turn depends on the user config and the augmentation

0 commit comments

Comments
 (0)