Skip to content

Commit f6a7f00

Browse files
henrymercerCopilot
andcommitted
Point to the Default Setup config schema from the per-language bundle check
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 113b18e commit f6a7f00

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

‎src/config/db-config.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ export interface UserConfig {
8686
"default-setup"?: DefaultSetupConfig;
8787
}
8888

89-
/** A subset of the `UserConfig` schema that is used by Default Setup. */
89+
/**
90+
* A subset of the `UserConfig` schema that is used by Default Setup. None of these properties may
91+
* add queries, since a per-language CodeQL bundle can be used with a `config` input that only sets
92+
* them.
93+
*/
9094
const DEFAULT_SETUP_CONFIG_SCHEMA = {
9195
"threat-models": json.optional(json.array(json.string)),
9296
"default-setup": json.optional<DefaultSetupConfig>(

‎src/per-language-bundles.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ export interface QueryConfigInputs {
5858
* query packs are downloaded together with their dependencies.
5959
*
6060
* Any configuration file is assumed to configure such queries, since reading it may need file or API
61-
* access. The `config` input is only assumed to if it sets anything other than valid threat models
62-
* and model packs, which are the properties that default setup uses.
61+
* access. So is the `config` input, unless it only sets the properties that default setup sets (see
62+
* `matchesDefaultSetupConfigSchema`).
6363
*
6464
* @throws A `ConfigurationError` if the `queries` input or the `github-codeql-extra-queries`
6565
* repository property is a '+' with no queries after it, unless an input that's checked earlier
@@ -75,8 +75,9 @@ export function getOtherLanguagePacksReason(
7575
);
7676
}
7777

78-
// The `config` input can configure queries in the same way as a configuration file. Default
79-
// setup only uses it for threat models and model packs, neither of which adds queries.
78+
// The `config` input can configure queries in the same way as a configuration file. The
79+
// properties that default setup sets, listed in `DEFAULT_SETUP_CONFIG_SCHEMA` in
80+
// `config/db-config.ts`, don't add queries.
8081
if (
8182
inputs.configInput !== undefined &&
8283
!matchesDefaultSetupConfigSchema(inputs.configInput)

0 commit comments

Comments
 (0)