mirror of
https://github.com/github/codeql-action.git
synced 2026-01-06 22:50:17 +08:00
Remove augmentationProperties from Config
This commit is contained in:
@@ -503,11 +503,10 @@ const injectedConfigMacro = test.macro({
|
||||
...stubConfig,
|
||||
...configOverride,
|
||||
tempDir,
|
||||
augmentationProperties,
|
||||
};
|
||||
thisStubConfig.computedConfig = generateCodeScanningConfig(
|
||||
thisStubConfig.originalUserInput,
|
||||
thisStubConfig.augmentationProperties,
|
||||
augmentationProperties,
|
||||
);
|
||||
|
||||
await codeqlObject.databaseInitCluster(
|
||||
|
||||
@@ -157,8 +157,8 @@ test("load empty config", async (t) => {
|
||||
}),
|
||||
);
|
||||
|
||||
t.deepEqual(
|
||||
config,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { augmentationProperties, ...expectedConfig } =
|
||||
await configUtils.getDefaultConfig(
|
||||
createTestInitConfigInputs({
|
||||
languagesInput: languages,
|
||||
@@ -166,8 +166,9 @@ test("load empty config", async (t) => {
|
||||
codeql,
|
||||
logger,
|
||||
}),
|
||||
),
|
||||
);
|
||||
);
|
||||
|
||||
t.deepEqual(config, expectedConfig);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -344,7 +345,6 @@ test("load non-empty input", async (t) => {
|
||||
debugMode: false,
|
||||
debugArtifactName: "my-artifact",
|
||||
debugDatabaseName: "my-db",
|
||||
augmentationProperties: configUtils.defaultAugmentationProperties,
|
||||
trapCaches: {},
|
||||
trapCacheDownloadTime: 0,
|
||||
dependencyCachingEnabled: CachingKind.None,
|
||||
|
||||
@@ -144,12 +144,6 @@ export interface Config {
|
||||
* Specifies the name of the database in the debugging artifact.
|
||||
*/
|
||||
debugDatabaseName: string;
|
||||
|
||||
/**
|
||||
* Describes how to augment the user configuration with inputs from the action.
|
||||
*/
|
||||
augmentationProperties: AugmentationProperties;
|
||||
|
||||
/**
|
||||
* The configuration we computed by combining `originalUserInput` with `augmentationProperties`,
|
||||
* as well as adjustments made to it based on unsupported or required options.
|
||||
@@ -536,7 +530,9 @@ export async function getDefaultConfig({
|
||||
githubVersion,
|
||||
features,
|
||||
logger,
|
||||
}: InitConfigInputs): Promise<Config> {
|
||||
}: InitConfigInputs): Promise<
|
||||
Config & { augmentationProperties: AugmentationProperties }
|
||||
> {
|
||||
const analysisKinds = await parseAnalysisKinds(analysisKindsInput);
|
||||
|
||||
// For backwards compatibility, add Code Quality to the enabled analysis kinds
|
||||
@@ -1104,14 +1100,14 @@ export async function initConfig(inputs: InitConfigInputs): Promise<Config> {
|
||||
);
|
||||
}
|
||||
|
||||
const config = await getDefaultConfig(inputs);
|
||||
const { augmentationProperties, ...config } = await getDefaultConfig(inputs);
|
||||
config.originalUserInput = userConfig;
|
||||
|
||||
// Compute the full Code Scanning configuration that combines the configuration from the
|
||||
// configuration file / `config` input with other inputs, such as `queries`.
|
||||
config.computedConfig = generateCodeScanningConfig(
|
||||
userConfig,
|
||||
config.augmentationProperties,
|
||||
augmentationProperties,
|
||||
);
|
||||
|
||||
// The choice of overlay database mode depends on the selection of languages
|
||||
|
||||
@@ -11,7 +11,7 @@ import * as apiClient from "./api-client";
|
||||
import { GitHubApiDetails } from "./api-client";
|
||||
import { CachingKind } from "./caching-utils";
|
||||
import * as codeql from "./codeql";
|
||||
import { AugmentationProperties, Config } from "./config-utils";
|
||||
import { Config } from "./config-utils";
|
||||
import * as defaults from "./defaults.json";
|
||||
import {
|
||||
CodeQLDefaultVersionInfo,
|
||||
@@ -370,10 +370,6 @@ export function createTestConfig(overrides: Partial<Config>): Config {
|
||||
debugMode: false,
|
||||
debugArtifactName: DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: {
|
||||
packsInputCombines: false,
|
||||
queriesInputCombines: false,
|
||||
} satisfies AugmentationProperties,
|
||||
trapCaches: {},
|
||||
trapCacheDownloadTime: 0,
|
||||
dependencyCachingEnabled: CachingKind.None,
|
||||
|
||||
Reference in New Issue
Block a user