From f6a7f00613135d9752f3c30b62ed48479c534503 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Fri, 2 Oct 2026 14:30:02 +0100 Subject: [PATCH] Point to the Default Setup config schema from the per-language bundle check Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- src/config/db-config.ts | 6 +++++- src/per-language-bundles.ts | 9 +++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/config/db-config.ts b/src/config/db-config.ts index e7924bf02..eb2cf15eb 100644 --- a/src/config/db-config.ts +++ b/src/config/db-config.ts @@ -86,7 +86,11 @@ export interface UserConfig { "default-setup"?: DefaultSetupConfig; } -/** A subset of the `UserConfig` schema that is used by Default Setup. */ +/** + * A subset of the `UserConfig` schema that is used by Default Setup. None of these properties may + * add queries, since a per-language CodeQL bundle can be used with a `config` input that only sets + * them. + */ const DEFAULT_SETUP_CONFIG_SCHEMA = { "threat-models": json.optional(json.array(json.string)), "default-setup": json.optional( diff --git a/src/per-language-bundles.ts b/src/per-language-bundles.ts index 3a481c244..9a46d2df6 100644 --- a/src/per-language-bundles.ts +++ b/src/per-language-bundles.ts @@ -58,8 +58,8 @@ export interface QueryConfigInputs { * query packs are downloaded together with their dependencies. * * Any configuration file is assumed to configure such queries, since reading it may need file or API - * access. The `config` input is only assumed to if it sets anything other than valid threat models - * and model packs, which are the properties that default setup uses. + * access. So is the `config` input, unless it only sets the properties that default setup sets (see + * `matchesDefaultSetupConfigSchema`). * * @throws A `ConfigurationError` if the `queries` input or the `github-codeql-extra-queries` * repository property is a '+' with no queries after it, unless an input that's checked earlier @@ -75,8 +75,9 @@ export function getOtherLanguagePacksReason( ); } - // The `config` input can configure queries in the same way as a configuration file. Default - // setup only uses it for threat models and model packs, neither of which adds queries. + // The `config` input can configure queries in the same way as a configuration file. The + // properties that default setup sets, listed in `DEFAULT_SETUP_CONFIG_SCHEMA` in + // `config/db-config.ts`, don't add queries. if ( inputs.configInput !== undefined && !matchesDefaultSetupConfigSchema(inputs.configInput)