renovate 43.263.0 → 43.263.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/app-strings.js +1 -1
- package/dist/config/app-strings.js.map +1 -1
- package/dist/config/decrypt/bcpgp.js +7 -4
- package/dist/config/decrypt/bcpgp.js.map +1 -1
- package/dist/config/migration.js +4 -6
- package/dist/config/migration.js.map +1 -1
- package/dist/config/options/index.js +1 -1
- package/dist/config/options/index.js.map +1 -1
- package/dist/config/validation-helpers/match-base-branches.js +4 -6
- package/dist/config/validation-helpers/match-base-branches.js.map +1 -1
- package/dist/config/validation-helpers/regex-glob-matchers.js +4 -6
- package/dist/config/validation-helpers/regex-glob-matchers.js.map +1 -1
- package/dist/config/validation-helpers/utils.js +2 -4
- package/dist/config/validation-helpers/utils.js.map +1 -1
- package/dist/config/validation.js +4 -6
- package/dist/config/validation.js.map +1 -1
- package/dist/config-validator.js +1 -3
- package/dist/config-validator.js.map +1 -1
- package/dist/global-config-option-defaults.generated.js +1 -1
- package/dist/global-config-option-defaults.generated.js.map +1 -1
- package/dist/modules/datasource/artifactory/index.js +6 -8
- package/dist/modules/datasource/artifactory/index.js.map +1 -1
- package/dist/modules/datasource/aws-machine-image/index.js +1 -2
- package/dist/modules/datasource/aws-machine-image/index.js.map +1 -1
- package/dist/modules/datasource/azure-pipelines-tasks/index.js +2 -3
- package/dist/modules/datasource/azure-pipelines-tasks/index.js.map +1 -1
- package/dist/modules/datasource/conda/index.js +1 -3
- package/dist/modules/datasource/conda/index.js.map +1 -1
- package/dist/modules/datasource/dart-version/index.js +1 -2
- package/dist/modules/datasource/dart-version/index.js.map +1 -1
- package/dist/modules/datasource/datasource.js +1 -3
- package/dist/modules/datasource/datasource.js.map +1 -1
- package/dist/modules/datasource/devbox/index.js +1 -3
- package/dist/modules/datasource/devbox/index.js.map +1 -1
- package/dist/modules/datasource/docker/ecr.js +2 -1
- package/dist/modules/datasource/docker/ecr.js.map +1 -1
- package/dist/modules/datasource/docker/index.js +1 -1
- package/dist/modules/datasource/docker/index.js.map +1 -1
- package/dist/modules/datasource/galaxy-collection/index.js +1 -1
- package/dist/modules/datasource/galaxy-collection/index.js.map +1 -1
- package/dist/modules/datasource/go/releases-goproxy.js +2 -2
- package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
- package/dist/modules/datasource/java-version/index.js +1 -3
- package/dist/modules/datasource/java-version/index.js.map +1 -1
- package/dist/modules/datasource/maven/util.js +2 -1
- package/dist/modules/datasource/maven/util.js.map +1 -1
- package/dist/modules/datasource/nuget/common.js +6 -4
- package/dist/modules/datasource/nuget/common.js.map +1 -1
- package/dist/modules/datasource/util.js +3 -2
- package/dist/modules/datasource/util.js.map +1 -1
- package/dist/modules/manager/azure-pipelines/extract.js +1 -1
- package/dist/modules/manager/azure-pipelines/extract.js.map +1 -1
- package/dist/modules/manager/bazel/extract.js +1 -3
- package/dist/modules/manager/bazel/extract.js.map +1 -1
- package/dist/modules/manager/bazel/parser.js +1 -1
- package/dist/modules/manager/bazel/parser.js.map +1 -1
- package/dist/modules/manager/buildpacks/extract.js +1 -1
- package/dist/modules/manager/buildpacks/extract.js.map +1 -1
- package/dist/modules/manager/bundler/common.js +23 -25
- package/dist/modules/manager/bundler/common.js.map +1 -1
- package/dist/modules/manager/bundler/extract.js +2 -6
- package/dist/modules/manager/bundler/extract.js.map +1 -1
- package/dist/modules/manager/cargo/extract.js +4 -6
- package/dist/modules/manager/cargo/extract.js.map +1 -1
- package/dist/modules/manager/dockerfile/extract.js +3 -3
- package/dist/modules/manager/dockerfile/extract.js.map +1 -1
- package/dist/modules/manager/fingerprint.generated.js +13 -13
- package/dist/modules/manager/fingerprint.generated.js.map +1 -1
- package/dist/modules/manager/flux/extract.js +2 -1
- package/dist/modules/manager/flux/extract.js.map +1 -1
- package/dist/modules/manager/github-actions/parse.js +1 -1
- package/dist/modules/manager/github-actions/parse.js.map +1 -1
- package/dist/modules/manager/gradle/extract/catalog.js +4 -3
- package/dist/modules/manager/gradle/extract/catalog.js.map +1 -1
- package/dist/modules/manager/gradle/extract.js +2 -2
- package/dist/modules/manager/gradle/extract.js.map +1 -1
- package/dist/modules/manager/gradle/parser/common.js +1 -1
- package/dist/modules/manager/gradle/parser/common.js.map +1 -1
- package/dist/modules/manager/gradle/parser/handlers.js +1 -1
- package/dist/modules/manager/gradle/parser/handlers.js.map +1 -1
- package/dist/modules/manager/helm-values/extract.js.map +1 -1
- package/dist/modules/manager/helmfile/extract.js +1 -1
- package/dist/modules/manager/helmfile/extract.js.map +1 -1
- package/dist/modules/manager/maven/extract.js.map +1 -1
- package/dist/modules/manager/maven/update.js +2 -1
- package/dist/modules/manager/maven/update.js.map +1 -1
- package/dist/modules/manager/mise/utils.js +5 -7
- package/dist/modules/manager/mise/utils.js.map +1 -1
- package/dist/modules/manager/mix/extract.js +3 -6
- package/dist/modules/manager/mix/extract.js.map +1 -1
- package/dist/modules/manager/npm/extract/common/overrides.js +1 -1
- package/dist/modules/manager/npm/extract/common/overrides.js.map +1 -1
- package/dist/modules/manager/npm/extract/yarn.js +1 -1
- package/dist/modules/manager/npm/extract/yarn.js.map +1 -1
- package/dist/modules/manager/npm/npmrc.js +1 -3
- package/dist/modules/manager/npm/npmrc.js.map +1 -1
- package/dist/modules/manager/npm/update/dependency/common.js +2 -3
- package/dist/modules/manager/npm/update/dependency/common.js.map +1 -1
- package/dist/modules/manager/npm/update/dependency/index.js +1 -1
- package/dist/modules/manager/npm/update/dependency/index.js.map +1 -1
- package/dist/modules/manager/npm/update/dependency/pnpm.js +1 -1
- package/dist/modules/manager/npm/update/dependency/pnpm.js.map +1 -1
- package/dist/modules/manager/npm/update/dependency/yarn.js +1 -1
- package/dist/modules/manager/npm/update/dependency/yarn.js.map +1 -1
- package/dist/modules/manager/osgi/extract.js +1 -1
- package/dist/modules/manager/osgi/extract.js.map +1 -1
- package/dist/modules/manager/pep621/processors/uv.js +1 -1
- package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
- package/dist/modules/manager/pep621/schema.js.map +1 -1
- package/dist/modules/manager/pip_setup/extract.js +1 -1
- package/dist/modules/manager/pip_setup/extract.js.map +1 -1
- package/dist/modules/manager/pipenv/artifacts.js.map +1 -1
- package/dist/modules/manager/poetry/schema.js +2 -2
- package/dist/modules/manager/poetry/schema.js.map +1 -1
- package/dist/modules/manager/pub/artifacts.js +4 -6
- package/dist/modules/manager/pub/artifacts.js.map +1 -1
- package/dist/modules/manager/pub/utils.js +2 -2
- package/dist/modules/manager/pub/utils.js.map +1 -1
- package/dist/modules/manager/puppet/common.js +4 -6
- package/dist/modules/manager/puppet/common.js.map +1 -1
- package/dist/modules/manager/sbt/extract.js +1 -1
- package/dist/modules/manager/sbt/extract.js.map +1 -1
- package/dist/modules/manager/sbt/util.js +4 -2
- package/dist/modules/manager/sbt/util.js.map +1 -1
- package/dist/modules/manager/terraform/lockfile/util.js +1 -1
- package/dist/modules/manager/terraform/lockfile/util.js.map +1 -1
- package/dist/modules/platform/azure/index.js +15 -19
- package/dist/modules/platform/azure/index.js.map +1 -1
- package/dist/modules/platform/azure/issue.js +67 -17
- package/dist/modules/platform/azure/issue.js.map +1 -1
- package/dist/modules/platform/bitbucket/index.js +1 -3
- package/dist/modules/platform/bitbucket/index.js.map +1 -1
- package/dist/modules/platform/forgejo/index.js +5 -3
- package/dist/modules/platform/forgejo/index.js.map +1 -1
- package/dist/modules/platform/forgejo/utils.js +1 -1
- package/dist/modules/platform/forgejo/utils.js.map +1 -1
- package/dist/modules/platform/gerrit/scm.js +5 -7
- package/dist/modules/platform/gerrit/scm.js.map +1 -1
- package/dist/modules/platform/gitea/index.js +5 -3
- package/dist/modules/platform/gitea/index.js.map +1 -1
- package/dist/modules/platform/gitea/utils.js +1 -1
- package/dist/modules/platform/gitea/utils.js.map +1 -1
- package/dist/modules/platform/github/index.js +5 -7
- package/dist/modules/platform/github/index.js.map +1 -1
- package/dist/modules/platform/github/pr.js +1 -1
- package/dist/modules/platform/github/pr.js.map +1 -1
- package/dist/modules/platform/gitlab/index.js +2 -1
- package/dist/modules/platform/gitlab/index.js.map +1 -1
- package/dist/modules/platform/utils/pr-body.js +2 -1
- package/dist/modules/platform/utils/pr-body.js.map +1 -1
- package/dist/modules/versioning/apk/index.js +3 -3
- package/dist/modules/versioning/apk/index.js.map +1 -1
- package/dist/modules/versioning/composer/index.js +4 -7
- package/dist/modules/versioning/composer/index.js.map +1 -1
- package/dist/modules/versioning/conan/common.js +4 -6
- package/dist/modules/versioning/conan/common.js.map +1 -1
- package/dist/modules/versioning/conan/index.js +1 -3
- package/dist/modules/versioning/conan/index.js.map +1 -1
- package/dist/modules/versioning/conan/range.js +4 -5
- package/dist/modules/versioning/conan/range.js.map +1 -1
- package/dist/modules/versioning/conda/index.js +1 -1
- package/dist/modules/versioning/conda/index.js.map +1 -1
- package/dist/modules/versioning/gradle/index.js +7 -3
- package/dist/modules/versioning/gradle/index.js.map +1 -1
- package/dist/modules/versioning/hermit/index.js +2 -2
- package/dist/modules/versioning/hermit/index.js.map +1 -1
- package/dist/modules/versioning/ivy/index.js +1 -1
- package/dist/modules/versioning/ivy/index.js.map +1 -1
- package/dist/modules/versioning/maven/compare.js +4 -6
- package/dist/modules/versioning/maven/compare.js.map +1 -1
- package/dist/modules/versioning/npm/range.js +5 -7
- package/dist/modules/versioning/npm/range.js.map +1 -1
- package/dist/modules/versioning/nuget/version.js +6 -6
- package/dist/modules/versioning/nuget/version.js.map +1 -1
- package/dist/modules/versioning/pep440/index.js +1 -1
- package/dist/modules/versioning/pep440/index.js.map +1 -1
- package/dist/modules/versioning/pep440/range.js +2 -6
- package/dist/modules/versioning/pep440/range.js.map +1 -1
- package/dist/modules/versioning/poetry/index.js +1 -1
- package/dist/modules/versioning/poetry/index.js.map +1 -1
- package/dist/modules/versioning/pvp/index.js +2 -2
- package/dist/modules/versioning/pvp/index.js.map +1 -1
- package/dist/modules/versioning/rpm/index.js +4 -3
- package/dist/modules/versioning/rpm/index.js.map +1 -1
- package/dist/modules/versioning/ruby/range.js +2 -2
- package/dist/modules/versioning/ruby/range.js.map +1 -1
- package/dist/modules/versioning/ruby/strategies/bump.js +1 -1
- package/dist/modules/versioning/ruby/strategies/bump.js.map +1 -1
- package/dist/modules/versioning/ruby/strategies/replace.js +13 -12
- package/dist/modules/versioning/ruby/strategies/replace.js.map +1 -1
- package/dist/modules/versioning/ruby/version.js +1 -1
- package/dist/modules/versioning/ruby/version.js.map +1 -1
- package/dist/modules/versioning/rust-release-channel/index.js +1 -1
- package/dist/modules/versioning/rust-release-channel/index.js.map +1 -1
- package/dist/modules/versioning/rust-release-channel/util.js +4 -4
- package/dist/modules/versioning/rust-release-channel/util.js.map +1 -1
- package/dist/util/common.js +1 -3
- package/dist/util/common.js.map +1 -1
- package/dist/util/exec/common.js +4 -6
- package/dist/util/exec/common.js.map +1 -1
- package/dist/util/exec/containerbase.js +1 -3
- package/dist/util/exec/containerbase.js.map +1 -1
- package/dist/util/git/instrument.js +3 -3
- package/dist/util/git/instrument.js.map +1 -1
- package/dist/util/github/graphql/datasource-fetcher.js +5 -4
- package/dist/util/github/graphql/datasource-fetcher.js.map +1 -1
- package/dist/util/http/cache/package-http-cache-provider.js.map +1 -1
- package/dist/util/http/github.js +3 -2
- package/dist/util/http/github.js.map +1 -1
- package/dist/util/http/http.d.ts +1 -1
- package/dist/util/http/http.js.map +1 -1
- package/dist/util/result.d.ts +8 -8
- package/dist/util/result.js +1 -1
- package/dist/util/result.js.map +1 -1
- package/dist/util/url.js +2 -2
- package/dist/util/url.js.map +1 -1
- package/dist/workers/global/config/parse/cli.js +18 -20
- package/dist/workers/global/config/parse/cli.js.map +1 -1
- package/dist/workers/global/config/parse/env.js +3 -5
- package/dist/workers/global/config/parse/env.js.map +1 -1
- package/dist/workers/repository/config-migration/branch/index.js +3 -5
- package/dist/workers/repository/config-migration/branch/index.js.map +1 -1
- package/dist/workers/repository/init/merge.js +2 -3
- package/dist/workers/repository/init/merge.js.map +1 -1
- package/dist/workers/repository/onboarding/branch/check.js +7 -9
- package/dist/workers/repository/onboarding/branch/check.js.map +1 -1
- package/dist/workers/repository/onboarding/branch/index.js +4 -8
- package/dist/workers/repository/onboarding/branch/index.js.map +1 -1
- package/dist/workers/repository/onboarding/branch/onboarding-branch-cache.js +2 -2
- package/dist/workers/repository/onboarding/branch/onboarding-branch-cache.js.map +1 -1
- package/dist/workers/repository/process/extract-update.js.map +1 -1
- package/dist/workers/repository/process/fetch.js.map +1 -1
- package/dist/workers/repository/process/libyear.js +1 -3
- package/dist/workers/repository/process/libyear.js.map +1 -1
- package/dist/workers/repository/process/lookup/filter-checks.js +9 -11
- package/dist/workers/repository/process/lookup/filter-checks.js.map +1 -1
- package/dist/workers/repository/process/lookup/index.js +5 -8
- package/dist/workers/repository/process/lookup/index.js.map +1 -1
- package/dist/workers/repository/process/vulnerabilities.js +3 -3
- package/dist/workers/repository/process/vulnerabilities.js.map +1 -1
- package/dist/workers/repository/reconfigure/index.js +3 -5
- package/dist/workers/repository/reconfigure/index.js.map +1 -1
- package/dist/workers/repository/update/branch/bump-versions.js +1 -1
- package/dist/workers/repository/update/branch/bump-versions.js.map +1 -1
- package/dist/workers/repository/update/branch/get-updated.js +3 -5
- package/dist/workers/repository/update/branch/get-updated.js.map +1 -1
- package/dist/workers/repository/update/pr/body/updates-table.js +1 -3
- package/dist/workers/repository/update/pr/body/updates-table.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/common.js +1 -1
- package/dist/workers/repository/update/pr/changelog/common.js.map +1 -1
- package/dist/workers/repository/update/pr/index.js +6 -7
- package/dist/workers/repository/update/pr/index.js.map +1 -1
- package/dist/workers/repository/updates/flatten.js +1 -1
- package/dist/workers/repository/updates/flatten.js.map +1 -1
- package/dist/workers/repository/updates/generate.js +1 -1
- package/dist/workers/repository/updates/generate.js.map +1 -1
- package/package.json +2 -2
- package/renovate-schema.json +2 -2
|
@@ -5,12 +5,10 @@ import { isNonEmptyArray } from "@sindresorhus/is";
|
|
|
5
5
|
*/
|
|
6
6
|
function check({ resolvedRule, currentPath, baseBranchPatterns }) {
|
|
7
7
|
const warnings = [];
|
|
8
|
-
if (Array.isArray(resolvedRule.matchBaseBranches)) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
});
|
|
13
|
-
}
|
|
8
|
+
if (Array.isArray(resolvedRule.matchBaseBranches) && !isNonEmptyArray(baseBranchPatterns)) warnings.push({
|
|
9
|
+
topic: "Configuration Error",
|
|
10
|
+
message: `${currentPath}: You must configure baseBranchPatterns in order to use them inside matchBaseBranches.`
|
|
11
|
+
});
|
|
14
12
|
return warnings;
|
|
15
13
|
}
|
|
16
14
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"match-base-branches.js","names":[],"sources":["../../../lib/config/validation-helpers/match-base-branches.ts"],"sourcesContent":["import { isNonEmptyArray } from '@sindresorhus/is';\nimport type { ValidationMessage } from '../types.ts';\nimport type { CheckBaseBranchesArgs } from './types.ts';\n\n/**\n * Only if type condition or context condition violated then errors array will be mutated to store metadata\n */\nexport function check({\n resolvedRule,\n currentPath,\n baseBranchPatterns,\n}: CheckBaseBranchesArgs): ValidationMessage[] {\n const warnings: ValidationMessage[] = [];\n if (Array.isArray(resolvedRule.matchBaseBranches)
|
|
1
|
+
{"version":3,"file":"match-base-branches.js","names":[],"sources":["../../../lib/config/validation-helpers/match-base-branches.ts"],"sourcesContent":["import { isNonEmptyArray } from '@sindresorhus/is';\nimport type { ValidationMessage } from '../types.ts';\nimport type { CheckBaseBranchesArgs } from './types.ts';\n\n/**\n * Only if type condition or context condition violated then errors array will be mutated to store metadata\n */\nexport function check({\n resolvedRule,\n currentPath,\n baseBranchPatterns,\n}: CheckBaseBranchesArgs): ValidationMessage[] {\n const warnings: ValidationMessage[] = [];\n if (\n Array.isArray(resolvedRule.matchBaseBranches) &&\n !isNonEmptyArray(baseBranchPatterns)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `${currentPath}: You must configure baseBranchPatterns in order to use them inside matchBaseBranches.`,\n });\n }\n\n return warnings;\n}\n"],"mappings":";;;;;AAOA,SAAgB,MAAM,EACpB,cACA,aACA,sBAC6C;CAC7C,MAAM,WAAgC,CAAC;CACvC,IACE,MAAM,QAAQ,aAAa,iBAAiB,KAC5C,CAAC,gBAAgB,kBAAkB,GAEnC,SAAS,KAAK;EACZ,OAAO;EACP,SAAS,GAAG,YAAY;CAC1B,CAAC;CAGH,OAAO;AACT"}
|
|
@@ -11,12 +11,10 @@ function check({ val: matchers, currentPath }) {
|
|
|
11
11
|
topic: "Configuration Error",
|
|
12
12
|
message: `${currentPath}: Your input contains * or ** along with other patterns. Please remove them, as * or ** matches all patterns.`
|
|
13
13
|
});
|
|
14
|
-
for (const matcher of matchers) if (isRegexMatch(matcher)) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
-
}
|
|
14
|
+
for (const matcher of matchers) if (isRegexMatch(matcher) && !getRegexPredicate(matcher)) res.push({
|
|
15
|
+
topic: "Configuration Error",
|
|
16
|
+
message: `Failed to parse regex pattern for ${currentPath}: ${matcher}`
|
|
17
|
+
});
|
|
20
18
|
} else res.push({
|
|
21
19
|
topic: "Configuration Error",
|
|
22
20
|
message: `${currentPath}: should be an array of strings. You have included ${typeof matchers}.`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regex-glob-matchers.js","names":[],"sources":["../../../lib/config/validation-helpers/regex-glob-matchers.ts"],"sourcesContent":["import { isArray, isString } from '@sindresorhus/is';\nimport { getRegexPredicate, isRegexMatch } from '../../util/string-match.ts';\nimport type { ValidationMessage } from '../types.ts';\nimport type { CheckMatcherArgs } from './types.ts';\n\n/**\n * Only if type condition or context condition violated then errors array will be mutated to store metadata\n */\nexport function check({\n val: matchers,\n currentPath,\n}: CheckMatcherArgs): ValidationMessage[] {\n const res: ValidationMessage[] = [];\n\n if (isArray(matchers, isString)) {\n if (\n (matchers.includes('*') || matchers.includes('**')) &&\n matchers.length > 1\n ) {\n res.push({\n topic: 'Configuration Error',\n message: `${currentPath}: Your input contains * or ** along with other patterns. Please remove them, as * or ** matches all patterns.`,\n });\n }\n for (const matcher of matchers) {\n // Validate regex pattern\n // No need to validate if the string is a glob\n // minimatch allows any string as glob\n if (isRegexMatch(matcher)
|
|
1
|
+
{"version":3,"file":"regex-glob-matchers.js","names":[],"sources":["../../../lib/config/validation-helpers/regex-glob-matchers.ts"],"sourcesContent":["import { isArray, isString } from '@sindresorhus/is';\nimport { getRegexPredicate, isRegexMatch } from '../../util/string-match.ts';\nimport type { ValidationMessage } from '../types.ts';\nimport type { CheckMatcherArgs } from './types.ts';\n\n/**\n * Only if type condition or context condition violated then errors array will be mutated to store metadata\n */\nexport function check({\n val: matchers,\n currentPath,\n}: CheckMatcherArgs): ValidationMessage[] {\n const res: ValidationMessage[] = [];\n\n if (isArray(matchers, isString)) {\n if (\n (matchers.includes('*') || matchers.includes('**')) &&\n matchers.length > 1\n ) {\n res.push({\n topic: 'Configuration Error',\n message: `${currentPath}: Your input contains * or ** along with other patterns. Please remove them, as * or ** matches all patterns.`,\n });\n }\n for (const matcher of matchers) {\n // Validate regex pattern\n // No need to validate if the string is a glob\n // minimatch allows any string as glob\n if (isRegexMatch(matcher) && !getRegexPredicate(matcher)) {\n res.push({\n topic: 'Configuration Error',\n message: `Failed to parse regex pattern for ${currentPath}: ${matcher}`,\n });\n }\n }\n } else {\n res.push({\n topic: 'Configuration Error',\n message: `${currentPath}: should be an array of strings. You have included ${typeof matchers}.`,\n });\n }\n\n return res;\n}\n"],"mappings":";;;;;;AAQA,SAAgB,MAAM,EACpB,KAAK,UACL,eACwC;CACxC,MAAM,MAA2B,CAAC;CAElC,IAAI,QAAQ,UAAU,QAAQ,GAAG;EAC/B,KACG,SAAS,SAAS,GAAG,KAAK,SAAS,SAAS,IAAI,MACjD,SAAS,SAAS,GAElB,IAAI,KAAK;GACP,OAAO;GACP,SAAS,GAAG,YAAY;EAC1B,CAAC;EAEH,KAAK,MAAM,WAAW,UAIpB,IAAI,aAAa,OAAO,KAAK,CAAC,kBAAkB,OAAO,GACrD,IAAI,KAAK;GACP,OAAO;GACP,SAAS,qCAAqC,YAAY,IAAI;EAChE,CAAC;CAGP,OACE,IAAI,KAAK;EACP,OAAO;EACP,SAAS,GAAG,YAAY,qDAAqD,OAAO,SAAS;CAC/F,CAAC;CAGH,OAAO;AACT"}
|
|
@@ -30,10 +30,8 @@ function validateNumber(key, val, allowsNegative, currentPath, subKey) {
|
|
|
30
30
|
* also it can be the token used for a platform inside the hostRules configuration
|
|
31
31
|
*/
|
|
32
32
|
function isFalseGlobal(optionName, parentPath) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (optionName === "token" || optionName === "username" || optionName === "password") return true;
|
|
36
|
-
}
|
|
33
|
+
// v8 ignore else -- TODO: add test #40625
|
|
34
|
+
if (parentPath?.includes("hostRules") && (optionName === "token" || optionName === "username" || optionName === "password")) return true;
|
|
37
35
|
return false;
|
|
38
36
|
}
|
|
39
37
|
function hasField(customManager, field) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../../lib/config/validation-helpers/utils.ts"],"sourcesContent":["import {\n isNonEmptyArray,\n isNonEmptyString,\n isNumber,\n isString,\n} from '@sindresorhus/is';\nimport jsonata from 'jsonata';\nimport { logger } from '../../logger/index.ts';\nimport type { RegexManagerTemplates } from '../../modules/manager/custom/regex/types.ts';\nimport type { CustomManager } from '../../modules/manager/custom/types.ts';\nimport { regEx } from '../../util/regex.ts';\nimport type { ValidationMessage } from '../types.ts';\n\nexport function getParentName(parentPath: string | undefined): string {\n return parentPath\n ? parentPath\n .replace(regEx(/\\.?encrypted$/), '')\n .replace(regEx(/\\[\\d+\\]$/), '')\n .split('.')\n .pop()!\n : '.';\n}\n\nexport function validatePlainObject(\n val: Record<string, unknown>,\n): true | string {\n for (const [key, value] of Object.entries(val)) {\n if (!isString(value)) {\n return key;\n }\n }\n return true;\n}\n\nexport function validateNumber(\n key: string,\n val: unknown,\n allowsNegative: boolean,\n currentPath?: string,\n subKey?: string,\n): ValidationMessage[] {\n const errors: ValidationMessage[] = [];\n const path = `${currentPath}${subKey ? `.${subKey}` : ''}`;\n if (isNumber(val)) {\n if (val < 0 && !allowsNegative) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${path}\\` should be a positive integer. Found negative value instead.`,\n });\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${path}\\` should be an integer. Found: ${JSON.stringify(\n val,\n )} (${typeof val}).`,\n });\n }\n\n return errors;\n}\n\n/** An option is a false global if it has the same name as a global only option\n * but is actually just the field of a non global option or field an children of the non global option\n * eg. token: it's global option used as the bot's token as well and\n * also it can be the token used for a platform inside the hostRules configuration\n */\nexport function isFalseGlobal(\n optionName: string,\n parentPath?: string,\n): boolean {\n
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../../lib/config/validation-helpers/utils.ts"],"sourcesContent":["import {\n isNonEmptyArray,\n isNonEmptyString,\n isNumber,\n isString,\n} from '@sindresorhus/is';\nimport jsonata from 'jsonata';\nimport { logger } from '../../logger/index.ts';\nimport type { RegexManagerTemplates } from '../../modules/manager/custom/regex/types.ts';\nimport type { CustomManager } from '../../modules/manager/custom/types.ts';\nimport { regEx } from '../../util/regex.ts';\nimport type { ValidationMessage } from '../types.ts';\n\nexport function getParentName(parentPath: string | undefined): string {\n return parentPath\n ? parentPath\n .replace(regEx(/\\.?encrypted$/), '')\n .replace(regEx(/\\[\\d+\\]$/), '')\n .split('.')\n .pop()!\n : '.';\n}\n\nexport function validatePlainObject(\n val: Record<string, unknown>,\n): true | string {\n for (const [key, value] of Object.entries(val)) {\n if (!isString(value)) {\n return key;\n }\n }\n return true;\n}\n\nexport function validateNumber(\n key: string,\n val: unknown,\n allowsNegative: boolean,\n currentPath?: string,\n subKey?: string,\n): ValidationMessage[] {\n const errors: ValidationMessage[] = [];\n const path = `${currentPath}${subKey ? `.${subKey}` : ''}`;\n if (isNumber(val)) {\n if (val < 0 && !allowsNegative) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${path}\\` should be a positive integer. Found negative value instead.`,\n });\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${path}\\` should be an integer. Found: ${JSON.stringify(\n val,\n )} (${typeof val}).`,\n });\n }\n\n return errors;\n}\n\n/** An option is a false global if it has the same name as a global only option\n * but is actually just the field of a non global option or field an children of the non global option\n * eg. token: it's global option used as the bot's token as well and\n * also it can be the token used for a platform inside the hostRules configuration\n */\nexport function isFalseGlobal(\n optionName: string,\n parentPath?: string,\n): boolean {\n // v8 ignore else -- TODO: add test #40625\n if (\n parentPath?.includes('hostRules') &&\n (optionName === 'token' ||\n optionName === 'username' ||\n optionName === 'password')\n ) {\n return true;\n }\n\n return false;\n}\n\nfunction hasField(customManager: CustomManager, field: string): boolean {\n const templateField = `${field}Template` as keyof RegexManagerTemplates;\n const fieldStr =\n customManager.customType === 'regex' ? `(?<${field}>` : field;\n return !!(\n customManager[templateField] ??\n customManager.matchStrings?.some((matchString) =>\n matchString.includes(fieldStr),\n )\n );\n}\n\nexport function validateRegexManagerFields(\n customManager: CustomManager,\n currentPath: string,\n errors: ValidationMessage[],\n): void {\n if (isNonEmptyArray(customManager.matchStrings)) {\n for (const matchString of customManager.matchStrings) {\n try {\n regEx(matchString);\n } catch (err) {\n logger.debug(\n { err },\n 'customManager.matchStrings regEx validation error',\n );\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${matchString}\\``,\n });\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message:\n 'Each Custom Manager `matchStrings` array must have at least one item.',\n });\n }\n\n const mandatoryFields = ['currentValue', 'datasource'];\n for (const field of mandatoryFields) {\n if (!hasField(customManager, field)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Regex Managers must contain ${field}Template configuration or regex group named ${field}`,\n });\n }\n }\n\n const nameFields = ['depName', 'packageName'];\n if (!nameFields.some((field) => hasField(customManager, field))) {\n errors.push({\n topic: 'Configuration Error',\n message: `Regex Managers must contain depName or packageName regex groups or templates`,\n });\n }\n}\n\nexport function validateJSONataManagerFields(\n customManager: CustomManager,\n currentPath: string,\n errors: ValidationMessage[],\n): void {\n if (!isNonEmptyString(customManager.fileFormat)) {\n errors.push({\n topic: 'Configuration Error',\n message: 'Each JSONata manager must contain a fileFormat field.',\n });\n }\n\n if (isNonEmptyArray(customManager.matchStrings)) {\n for (const matchString of customManager.matchStrings) {\n try {\n jsonata(matchString);\n } catch (err) {\n logger.debug(\n { err },\n 'customManager.matchStrings JSONata query validation error',\n );\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid JSONata query for ${currentPath}: \\`${matchString}\\``,\n });\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Each Custom Manager must contain a non-empty matchStrings array`,\n });\n }\n\n const mandatoryFields = ['currentValue', 'datasource'];\n for (const field of mandatoryFields) {\n if (!hasField(customManager, field)) {\n errors.push({\n topic: 'Configuration Error',\n message: `JSONata Managers must contain ${field}Template configuration or ${field} in the query `,\n });\n }\n }\n\n const nameFields = ['depName', 'packageName'];\n if (!nameFields.some((field) => hasField(customManager, field))) {\n errors.push({\n topic: 'Configuration Error',\n message: `JSONata Managers must contain depName or packageName in the query or their templates`,\n });\n }\n}\n"],"mappings":";;;;;AAaA,SAAgB,cAAc,YAAwC;CACpE,OAAO,aACH,WACG,QAAQ,MAAM,eAAe,GAAG,EAAE,CAAC,CACnC,QAAQ,MAAM,UAAU,GAAG,EAAE,CAAC,CAC9B,MAAM,GAAG,CAAC,CACV,IAAI,IACP;AACN;AAEA,SAAgB,oBACd,KACe;CACf,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,GAAG,GAC3C,IAAI,CAAC,SAAS,KAAK,GACjB,OAAO;CAGX,OAAO;AACT;AAEA,SAAgB,eACd,KACA,KACA,gBACA,aACA,QACqB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OAAO,KAAK;EACV,OAAO;EACP,SAAS;CACX,CAAC;AAEL;AAEA,SAAgB,6BACd,eACA,aACA,QACM;CACN,IAAI,CAAC,iBAAiB,cAAc,UAAU,GAC5C,OAAO,KAAK;EACV,OAAO;EACP,SAAS;CACX,CAAC;CAGH,IAAI,gBAAgB,cAAc,YAAY,GAC5C,KAAK,MAAM,eAAe,cAAc,cACtC,IAAI;EACF,QAAQ,WAAW;CACrB,SAAS,KAAK;EACZ,OAAO,MACL,EAAE,IAAI,GACN,2DACF;EACA,OAAO,KAAK;GACV,OAAO;GACP,SAAS,6BAA6B,YAAY,MAAM,YAAY;EACtE,CAAC;CACH;MAGF,OAAO,KAAK;EACV,OAAO;EACP,SAAS;CACX,CAAC;CAIH,KAAK,MAAM,SAAS,CADK,gBAAgB,YACP,GAChC,IAAI,CAAC,SAAS,eAAe,KAAK,GAChC,OAAO,KAAK;EACV,OAAO;EACP,SAAS,iCAAiC,MAAM,4BAA4B,MAAM;CACpF,CAAC;CAKL,IAAI,CAAC,CADe,WAAW,aACjB,CAAC,CAAC,MAAM,UAAU,SAAS,eAAe,KAAK,CAAC,GAC5D,OAAO,KAAK;EACV,OAAO;EACP,SAAS;CACX,CAAC;AAEL"}
|
|
@@ -547,12 +547,10 @@ async function validateConfig(configType, config, isPreset, parentPath) {
|
|
|
547
547
|
const allowedHeaders = configType === "global" ? config.allowedHeaders ?? [] : GlobalConfig.get("allowedHeaders");
|
|
548
548
|
for (const rule of val) {
|
|
549
549
|
if (isNonEmptyString(rule.matchHost)) {
|
|
550
|
-
if (rule.matchHost.includes("://")) {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
});
|
|
555
|
-
}
|
|
550
|
+
if (rule.matchHost.includes("://") && parseUrl(rule.matchHost) === null) errors.push({
|
|
551
|
+
topic: "Configuration Error",
|
|
552
|
+
message: `hostRules matchHost \`${rule.matchHost}\` is not a valid URL.`
|
|
553
|
+
});
|
|
556
554
|
} else if (isEmptyString(rule.matchHost)) errors.push({
|
|
557
555
|
topic: "Configuration Error",
|
|
558
556
|
message: "Invalid value for hostRules matchHost. It cannot be an empty string."
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","names":["regexOrGlobValidator.check","matchBaseBranchesValidator.check"],"sources":["../../lib/config/validation.ts"],"sourcesContent":["import is, {\n isArray,\n isEmptyString,\n isNonEmptyArray,\n isNonEmptyString,\n isObject,\n isPlainObject,\n isString,\n isUndefined,\n} from '@sindresorhus/is';\nimport type { PlatformId } from '../constants/index.ts';\nimport { instrument } from '../instrumentation/index.ts';\nimport { logger } from '../logger/index.ts';\nimport {\n AllManagersListLiteral,\n CustomManagersListLiteral,\n} from '../manager-list.generated.ts';\nimport { isCustomManager } from '../modules/manager/custom/index.ts';\nimport type { CustomManager } from '../modules/manager/custom/types.ts';\nimport type { HostRule } from '../types/index.ts';\nimport { packageCacheNamespaces } from '../util/cache/package/namespaces.ts';\nimport { getToolConfig } from '../util/exec/containerbase.ts';\nimport { isConstraintName, isToolName } from '../util/exec/types.ts';\nimport { getExpression } from '../util/jsonata.ts';\nimport { regEx } from '../util/regex.ts';\nimport {\n anyMatchRegexOrGlobList,\n getRegexPredicate,\n isRegexMatch,\n matchRegexOrGlobList,\n} from '../util/string-match.ts';\nimport * as template from '../util/template/index.ts';\nimport { parseUrl } from '../util/url.ts';\nimport {\n AllVersioningsListLiteral,\n type VersioningName,\n} from '../versioning-list.generated.ts';\nimport {\n hasValidSchedule,\n hasValidTimezone,\n} from '../workers/repository/update/branch/schedule.ts';\nimport { getConfigFileNames } from './app-strings.ts';\nimport { GlobalConfig } from './global.ts';\nimport { migrateConfig } from './migration.ts';\nimport { getOptions } from './options/index.ts';\nimport { resolveConfigPresets } from './presets/index.ts';\nimport { supportedDatasources } from './presets/internal/merge-confidence.preset.ts';\nimport { parsePreset } from './presets/parse.ts';\nimport type {\n AllConfig,\n AllowedParents,\n RenovateConfig,\n RenovateOptions,\n StatusCheckKey,\n ValidationMessage,\n ValidationResult,\n} from './types.ts';\nimport { allowedStatusCheckStrings } from './types.ts';\nimport * as matchBaseBranchesValidator from './validation-helpers/match-base-branches.ts';\nimport * as regexOrGlobValidator from './validation-helpers/regex-glob-matchers.ts';\nimport {\n getParentName,\n isFalseGlobal,\n validateJSONataManagerFields,\n validateNumber,\n validatePlainObject,\n validateRegexManagerFields,\n} from './validation-helpers/utils.ts';\n\nconst options = getOptions();\n\nlet optionsInitialized = false;\nlet optionTypes: Record<string, RenovateOptions['type']>;\nlet optionParents: Record<string, AllowedParents[]>;\nlet optionGlobals: Set<string>;\nlet optionInherits: Set<string>;\nlet optionRegexOrGlob: Set<string>;\nlet optionAllowsNegativeIntegers: Set<string>;\nlet optionSupportsTemplating: Set<string>;\n\nconst managerList: readonly string[] = AllManagersListLiteral;\n\nconst allManagersList: readonly string[] = [\n ...AllManagersListLiteral,\n ...CustomManagersListLiteral,\n];\n\nconst topLevelObjects = [...managerList, 'env'];\n\nconst ignoredNodes = [\n '$schema',\n 'headers',\n 'depType',\n 'npmToken',\n 'packageFile',\n 'forkToken',\n 'repository',\n 'vulnerabilityAlertsOnly',\n 'vulnerabilityAlert',\n 'isVulnerabilityAlert',\n 'vulnerabilityFixVersion', // not intended to be used by end users but may be by Mend apps\n 'copyLocalLibs', // deprecated - functionality is now enabled by default\n 'prBody', // deprecated\n 'minimumConfidence', // undocumented feature flag\n];\nconst tzRe = regEx(/^:timezone\\((.+)\\)$/);\nconst rulesRe = regEx(/p.*Rules\\[\\d+\\]$/);\n\nfunction isIgnored(key: string): boolean {\n return ignoredNodes.includes(key);\n}\n\nfunction getUnsupportedEnabledManagers(enabledManagers: string[]): string[] {\n return enabledManagers.filter(\n (manager) => !allManagersList.includes(manager.replace('custom.', '')),\n );\n}\n\nfunction getDeprecationMessage(option: string): string | undefined {\n const deprecatedOptions: Record<string, string | undefined> = {\n branchName: `Direct editing of branchName is now deprecated. Please edit branchPrefix, additionalBranchPrefix, or branchTopic instead`,\n commitMessage: `Direct editing of commitMessage is now deprecated. Please edit commitMessage's subcomponents instead.`,\n prTitle: `Direct editing of prTitle is now deprecated. Please edit commitMessage subcomponents instead as they will be passed through to prTitle.`,\n };\n if (deprecatedOptions[option]) {\n return deprecatedOptions[option];\n }\n\n const found = options.find((o) => o.name === option);\n if (!found) {\n return undefined;\n }\n\n if (!found.deprecationMsg) {\n return undefined;\n }\n\n return `The '${option}' option is deprecated: ${found.deprecationMsg}`;\n}\n\nfunction isInhertConfigOption(key: string): boolean {\n return optionInherits.has(key);\n}\n\nfunction isRegexOrGlobOption(key: string): boolean {\n return optionRegexOrGlob.has(key);\n}\n\nfunction isGlobalOption(key: string): boolean {\n return optionGlobals.has(key);\n}\n\nfunction initOptions(): void {\n if (optionsInitialized) {\n return;\n }\n\n optionParents = {};\n optionInherits = new Set();\n optionTypes = {};\n optionRegexOrGlob = new Set();\n optionGlobals = new Set();\n optionAllowsNegativeIntegers = new Set();\n optionSupportsTemplating = new Set();\n\n for (const option of options) {\n optionTypes[option.name] = option.type;\n\n if (option.parents) {\n optionParents[option.name] = option.parents;\n }\n\n if (option.inheritConfigSupport) {\n optionInherits.add(option.name);\n }\n\n if (option.patternMatch) {\n optionRegexOrGlob.add(option.name);\n }\n\n if (option.globalOnly) {\n optionGlobals.add(option.name);\n }\n\n if (option.allowNegative) {\n optionAllowsNegativeIntegers.add(option.name);\n }\n\n if (option.supportsTemplating) {\n optionSupportsTemplating.add(option.name);\n }\n }\n\n optionsInitialized = true;\n}\n\nexport async function validateConfig(\n configType: 'global' | 'inherit' | 'repo',\n config: AllConfig,\n isPreset?: boolean,\n parentPath?: string,\n): Promise<ValidationResult> {\n return instrument(\n `validateConfig(${configType}, ${JSON.stringify(parentPath)})`,\n async () => {\n initOptions();\n\n let errors: ValidationMessage[] = [];\n let warnings: ValidationMessage[] = [];\n\n for (const [key, val] of Object.entries(config)) {\n const currentPath = parentPath ? `${parentPath}.${key}` : key;\n /* v8 ignore next 7 -- TODO: add test */\n if (key === '__proto__') {\n errors.push({\n topic: 'Config security error',\n message: '__proto__',\n });\n continue;\n }\n if (\n parentPath &&\n parentPath !== 'onboardingConfig' &&\n topLevelObjects.includes(key)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `The \"${key}\" object can only be configured at the top level of a config but was found inside \"${parentPath}\"`,\n });\n }\n\n if (isGlobalOption(key)) {\n if (configType === 'global') {\n await validateGlobalConfig(\n key,\n val,\n optionTypes[key],\n warnings,\n errors,\n currentPath,\n config,\n );\n continue;\n } else if (\n !isFalseGlobal(key, parentPath) &&\n !(configType === 'inherit' && isInhertConfigOption(key))\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `The \"${key}\" option is a global option reserved only for Renovate's global configuration and cannot be configured within a repository's config file.`,\n });\n continue;\n }\n }\n if (key === 'enabledManagers' && val) {\n const unsupportedManagers = getUnsupportedEnabledManagers(\n val as string[],\n );\n if (isNonEmptyArray(unsupportedManagers)) {\n errors.push({\n topic: 'Configuration Error',\n message: `The following managers configured in enabledManagers are not supported: \"${unsupportedManagers.join(\n ', ',\n )}\"`,\n });\n }\n }\n if (key === 'registryUrls' && !parentPath && isNonEmptyArray(val)) {\n warnings.push({\n topic: 'Configuration Warning',\n message:\n 'Setting `registryUrls` at the top level of your config will apply it to all managers and datasources, which can cause the wrong registry URL to be used for some packages. Use `registryUrls` inside `packageRules` to target specific managers or packages.',\n });\n }\n if (\n key === 'defaultRegistryUrls' &&\n !parentPath &&\n isNonEmptyArray(val)\n ) {\n warnings.push({\n topic: 'Configuration Warning',\n message:\n 'Setting `defaultRegistryUrls` at the top level of your config will apply it to all managers and datasources, which can cause the wrong registry URL to be used for some packages. Use `defaultRegistryUrls` inside `packageRules` to target specific managers or packages.',\n });\n }\n if (\n !isIgnored(key) && // We need to ignore some reserved keys\n !(is as any).function(val) // Ignore all functions\n ) {\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: 'Deprecation Warning',\n message: getDeprecationMessage(key)!,\n });\n }\n if (optionSupportsTemplating.has(key) && val) {\n try {\n // TODO: types (#22198)\n template.validate((val as string).toString());\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid template in config path: ${currentPath}`,\n });\n }\n }\n const parentName = getParentName(parentPath);\n if (\n !isPreset &&\n optionParents[key] &&\n !optionParents[key].includes(parentName as AllowedParents)\n ) {\n // TODO: types (#22198)\n const options = optionParents[key]?.toSorted().join(', ');\n const message = `\"${key}\" can't be used in \"${parentName}\". Allowed objects: ${options}.`;\n warnings.push({\n topic: `${parentPath ? `${parentPath}.` : ''}${key}`,\n message,\n });\n }\n\n // v8 ignore else -- intentionally unhandled - if we knew what was to be covered here, we'd add validation\n if (!optionTypes[key]) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid configuration option: ${currentPath}`,\n });\n } else if (key === 'schedule') {\n const [validSchedule, errorMessage] = hasValidSchedule(\n val as string[],\n );\n if (!validSchedule) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid ${currentPath}: \\`${errorMessage}\\``,\n });\n }\n } else if (\n [\n 'allowedVersions',\n 'matchCurrentVersion',\n 'matchCurrentValue',\n 'matchNewValue',\n ].includes(key) &&\n isRegexMatch(val)\n ) {\n if (!getRegexPredicate(val)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${val}\\``,\n });\n }\n } else if (key === 'timezone' && val !== null) {\n const [validTimezone, errorMessage] = hasValidTimezone(\n val as string,\n );\n if (!validTimezone) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n } else if (val !== null) {\n const type = optionTypes[key];\n if (type === 'boolean') {\n if (val !== true && val !== false) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val})`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n errors.push(\n ...validateNumber(key, val, allowsNegative, currentPath),\n );\n } else if (type === 'array' && val) {\n if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n configType,\n subval as RenovateConfig,\n isPreset,\n `${currentPath}[${subIndex}]`,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n if (isRegexOrGlobOption(key)) {\n errors.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath,\n }),\n );\n }\n if (key === 'extends') {\n for (const subval of val) {\n if (isString(subval)) {\n if (\n configType !== 'global' &&\n subval.startsWith('global:')\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: you cannot extend from \"global:\" presets in a repository config's \"extends\"`,\n });\n }\n\n if (\n parentName === 'packageRules' &&\n subval.startsWith('group:')\n ) {\n warnings.push({\n topic: 'Configuration Warning',\n message: `${currentPath}: you should not extend \"group:\" presets`,\n });\n }\n if (tzRe.test(subval)) {\n const [, timezone] = tzRe.exec(subval)!;\n const [validTimezone, errorMessage] =\n hasValidTimezone(timezone);\n if (!validTimezone) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n }\n if (!subval.includes('{{')) {\n try {\n parsePreset(subval);\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: preset \"${subval}\" is not valid`,\n });\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: preset value is not a string`,\n });\n }\n }\n }\n\n const selectors = [\n 'matchFileNames',\n 'matchLanguages',\n 'matchCategories',\n 'matchBaseBranches',\n 'matchManagers',\n 'matchDatasources',\n 'matchDepTypes',\n 'matchDepNames',\n 'matchPackageNames',\n 'matchCurrentValue',\n 'matchCurrentVersion',\n 'matchSourceUrls',\n 'matchRegistryUrls',\n 'matchUpdateTypes',\n 'matchConfidence',\n 'matchCurrentAge',\n 'matchRepositories',\n 'matchNewValue',\n 'matchJsonata',\n ];\n if (key === 'packageRules') {\n for (const [subIndex, packageRule] of val.entries()) {\n if (isObject(packageRule)) {\n const { config: resolved } = await resolveConfigPresets(\n packageRule as RenovateConfig,\n config,\n );\n const resolvedRule = migrateConfig({\n packageRules: [resolved],\n }).migratedConfig.packageRules![0];\n warnings.push(\n ...matchBaseBranchesValidator.check({\n resolvedRule,\n currentPath: `${currentPath}[${subIndex}]`,\n baseBranchPatterns: config.baseBranchPatterns!,\n }),\n );\n const selectorLength = Object.keys(resolvedRule).filter(\n (ruleKey) => selectors.includes(ruleKey),\n ).length;\n if (!selectorLength) {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one match* or exclude* selector. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: 'Configuration Error',\n message,\n });\n }\n if (selectorLength === Object.keys(resolvedRule).length) {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one non-match* or non-exclude* field. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n warnings.push({\n topic: 'Configuration Error',\n message,\n });\n }\n // It's too late to apply any of these options once you already have updates determined\n const preLookupOptions = [\n 'allowedVersions',\n 'extractVersion',\n 'followTag',\n 'ignoreDeps',\n 'ignoreUnstable',\n 'rangeStrategy',\n 'registryUrls',\n 'respectLatest',\n 'rollbackPrs',\n 'separateMajorMinor',\n 'separateMinorPatch',\n 'separateMultipleMajor',\n 'separateMultipleMinor',\n 'versioning',\n ] as const;\n if (isNonEmptyArray(resolvedRule.matchUpdateTypes)) {\n for (const option of preLookupOptions) {\n if (resolvedRule[option] !== undefined) {\n const message = `${currentPath}[${subIndex}]: packageRules cannot combine both matchUpdateTypes and ${option}. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: 'Configuration Error',\n message,\n });\n }\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath} must contain JSON objects`,\n });\n }\n }\n }\n if (key === 'customManagers') {\n const allowedKeys = [\n 'customType',\n 'description',\n 'fileFormat',\n 'managerFilePatterns',\n 'matchStrings',\n 'matchStringsStrategy',\n 'depNameTemplate',\n 'packageNameTemplate',\n 'datasourceTemplate',\n 'versioningTemplate',\n 'registryUrlTemplate',\n 'currentValueTemplate',\n 'extractVersionTemplate',\n 'autoReplaceStringTemplate',\n 'depTypeTemplate',\n ];\n for (const customManager of val as CustomManager[]) {\n if (\n Object.keys(customManager).some(\n (k) => !allowedKeys.includes(k),\n )\n ) {\n const disallowedKeys = Object.keys(customManager).filter(\n (k) => !allowedKeys.includes(k),\n );\n errors.push({\n topic: 'Configuration Error',\n message: `Custom Manager contains disallowed fields: ${disallowedKeys.join(\n ', ',\n )}`,\n });\n } else if (\n isNonEmptyString(customManager.customType) &&\n isCustomManager(customManager.customType)\n ) {\n if (isNonEmptyArray(customManager.managerFilePatterns)) {\n switch (customManager.customType) {\n case 'regex':\n validateRegexManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n case 'jsonata':\n validateJSONataManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Each Custom Manager must contain a non-empty managerFilePatterns array`,\n });\n }\n } else {\n if (\n isEmptyString(customManager.customType) ||\n isUndefined(customManager.customType)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Each Custom Manager must contain a non-empty customType string`,\n });\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid customType: ${customManager.customType}. Key is not a custom manager`,\n });\n }\n }\n }\n }\n if (['matchPackageNames', 'matchDepNames'].includes(key)) {\n const startPattern = regEx(/!?\\//);\n const endPattern = regEx(/\\/g?i?$/);\n for (const pattern of val as string[]) {\n if (\n startPattern.test(pattern) &&\n endPattern.test(pattern)\n ) {\n try {\n // regEx isn't aware of our !/ prefix but can handle the suffix\n regEx(pattern.replace(startPattern, '/'));\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${pattern}\\``,\n });\n }\n }\n }\n }\n if (key === 'baseBranchPatterns') {\n for (const baseBranchPattern of val as string[]) {\n if (\n isRegexMatch(baseBranchPattern) &&\n !getRegexPredicate(baseBranchPattern)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${baseBranchPattern}\\``,\n });\n }\n }\n }\n if (\n (selectors.includes(key) ||\n key === 'matchCurrentVersion' ||\n key === 'matchCurrentValue') &&\n // TODO: can be undefined ? #22198\n !rulesRe.test(parentPath!) && // Inside a packageRule\n (isString(parentPath) || !isPreset) // top level in a preset\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${key} should be inside a \\`packageRule\\` only`,\n });\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a list (Array)`,\n });\n }\n } else if (type === 'string') {\n if (!isString(val)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a string`,\n });\n }\n } else if (type === 'object') {\n if (isPlainObject(val)) {\n if (key === 'registryAliases') {\n const res = validatePlainObject(val);\n if (res !== true) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${res}\\` configuration: value is not a string`,\n });\n }\n } else if (key === 'env') {\n const allowedEnvVars =\n configType === 'global'\n ? (config.allowedEnv ?? [])\n : GlobalConfig.get('allowedEnv');\n for (const [envVarName, envVarValue] of Object.entries(val)) {\n if (!isString(envVarValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid env variable value: \\`${currentPath}.${envVarName}\\` must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(envVarName, allowedEnvVars)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Env variable name \\`${envVarName}\\` is not allowed by this bot's \\`allowedEnv\\`.`,\n });\n }\n }\n } else if (key === 'statusCheckNames') {\n for (const [\n statusCheckKey,\n statusCheckValue,\n ] of Object.entries(val)) {\n if (\n !allowedStatusCheckStrings.includes(\n statusCheckKey as StatusCheckKey,\n )\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${statusCheckKey}\\` configuration: key is not allowed.`,\n });\n }\n if (\n !(isString(statusCheckValue) || null === statusCheckValue)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${statusCheckKey}\\` configuration: status check is not a string.`,\n });\n continue;\n }\n }\n } else if (key === 'statusCheckWhen') {\n const allowedWhenValues = ['always', 'never', 'failed'];\n for (const [\n statusCheckKey,\n statusCheckValue,\n ] of Object.entries(val)) {\n if (\n !allowedStatusCheckStrings.includes(\n statusCheckKey as StatusCheckKey,\n )\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${statusCheckKey}\\` configuration: key is not allowed.`,\n });\n }\n if (\n !isString(statusCheckValue) ||\n !allowedWhenValues.includes(statusCheckValue)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${statusCheckKey}\\` configuration: value must be one of \"always\", \"never\", or \"failed\".`,\n });\n continue;\n }\n }\n } else if (key === 'customDatasources') {\n const allowedKeys = [\n 'description',\n 'defaultRegistryUrlTemplate',\n 'format',\n 'transformTemplates',\n ];\n for (const [\n customDatasourceName,\n customDatasourceValue,\n ] of Object.entries(val)) {\n if (!isPlainObject(customDatasourceValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${customDatasourceName}\\` configuration: customDatasource is not an object`,\n });\n continue;\n }\n for (const [subKey, subValue] of Object.entries(\n customDatasourceValue,\n )) {\n if (!allowedKeys.includes(subKey)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: key is not allowed`,\n });\n } else if (subKey === 'transformTemplates') {\n if (!isArray(subValue, isString)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of string`,\n });\n }\n } else if (subKey === 'description') {\n if (\n !(isString(subValue) || isArray(subValue, isString))\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of strings`,\n });\n }\n } else if (!isString(subValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is a string`,\n });\n }\n }\n }\n } else if (key === 'installTools') {\n for (const toolName of Object.keys(val)) {\n if (!isToolName(toolName)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${toolName}\\` configuration: not a valid tool name.`,\n });\n }\n }\n } else if (key === 'constraints') {\n const { get: getVersioning } =\n await import('../modules/versioning/index.ts');\n for (const [k, v] of Object.entries(val)) {\n if (!isString(v)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\` should be an object of key-value pairs of constraints and their value`,\n });\n break;\n }\n\n if (!isConstraintName(k)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\`: \\`${k}\\` is not a supported constraint name`,\n });\n } else if (isToolName(k)) {\n // TODO: #31831\n const versioningId = getToolConfig(k).versioning;\n const versioning = getVersioning(versioningId);\n if (!versioning.isValid(v)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}=${v}\\` is not a valid tool version constraint, according to \\`${versioningId}\\` versioning`,\n });\n }\n }\n }\n } else if (key === 'constraintsVersioning') {\n for (const [k, v] of Object.entries(val)) {\n if (!isString(v)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\` should be an object of key-value pairs of additional constraint names and their versioning`,\n });\n break;\n }\n\n if (isToolName(k)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\` is not a valid additional constraint name, as \\`${k}\\` is a tool name, and \\`constraintsVersioning\\` can only override the versioning for a non-tool constraint`,\n });\n } else if (isConstraintName(k)) {\n const versioningName = v.split(':')[0];\n if (\n !AllVersioningsListLiteral.includes(\n versioningName as VersioningName,\n )\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}=${v}\\`: \\`${v}\\` is not a valid versioning scheme`,\n });\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\`: \\`${k}\\` is not a known additional constraint name`,\n });\n }\n }\n } else {\n const ignoredObjects = options\n .filter((option) => option.freeChoice)\n .map((option) => option.name);\n if (!ignoredObjects.includes(key)) {\n const subValidation = await validateConfig(\n configType,\n val,\n isPreset,\n currentPath,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a json object`,\n });\n }\n } else {\n // v8 ignore next -- intentionally unhandled - if we knew what was to be covered here, we'd add validation\n logger.debug(\n {},\n `Unhandled validation for ${type} at \\`${currentPath}\\``,\n );\n }\n }\n }\n\n if (key === 'hostRules' && isArray(val)) {\n const allowedHeaders =\n configType === 'global'\n ? (config.allowedHeaders ?? [])\n : GlobalConfig.get('allowedHeaders');\n for (const rule of val as HostRule[]) {\n if (isNonEmptyString(rule.matchHost)) {\n if (rule.matchHost.includes('://')) {\n if (parseUrl(rule.matchHost) === null) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules matchHost \\`${rule.matchHost}\\` is not a valid URL.`,\n });\n }\n }\n } else if (isEmptyString(rule.matchHost)) {\n errors.push({\n topic: 'Configuration Error',\n message:\n 'Invalid value for hostRules matchHost. It cannot be an empty string.',\n });\n }\n\n if (!rule.headers) {\n continue;\n }\n for (const [header, value] of Object.entries(rule.headers)) {\n if (!isString(value)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid hostRules headers value configuration: header must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(header, allowedHeaders)) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules header \\`${header}\\` is not allowed by this bot's \\`allowedHeaders\\`.`,\n });\n }\n }\n }\n }\n\n if (key === 'matchJsonata' && isArray(val, isString)) {\n for (const expression of val) {\n const res = getExpression(expression);\n if (res instanceof Error) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid JSONata expression for ${currentPath}: ${res.message}`,\n });\n }\n }\n }\n }\n\n function sortAll(a: ValidationMessage, b: ValidationMessage): number {\n if (a.topic === b.topic) {\n return a.message > b.message ? 1 : -1;\n }\n return a.topic > b.topic ? 1 : -1;\n }\n\n errors.sort(sortAll);\n warnings.sort(sortAll);\n return { errors, warnings };\n },\n );\n}\n\n/**\n * Basic validation for global config options\n */\nasync function validateGlobalConfig(\n key: string,\n val: unknown,\n type: string,\n warnings: ValidationMessage[],\n errors: ValidationMessage[],\n currentPath: string | undefined,\n config: AllConfig,\n): Promise<void> {\n /* v8 ignore next 5 -- not testable yet */\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: 'Deprecation Warning',\n message: getDeprecationMessage(key)!,\n });\n }\n\n if (key === 'binarySource' && val === 'docker') {\n warnings.push({\n topic: 'Deprecation Warning',\n message:\n 'Usage of `binarySource=docker` is deprecated, and will be removed in the future. Please migrate to `binarySource=install`. Feedback on the usage of `binarySource=docker` is welcome at https://github.com/renovatebot/renovate/discussions/40742',\n });\n }\n\n if (val !== null) {\n // v8 ignore else -- TODO: add test #40625\n if (type === 'string') {\n if (isString(val)) {\n if (\n key === 'onboardingConfigFileName' &&\n !getPossibleConfigFileNames({\n configFileNames: config.configFileNames,\n platform: config.platform,\n }).includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${getPossibleConfigFileNames(\n {\n configFileNames: config.configFileNames,\n platform: config.platform,\n },\n ).join(', ')}.`,\n });\n } else if (\n key === 'repositoryCache' &&\n !['enabled', 'disabled', 'reset'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['enabled', 'disabled', 'reset'].join(', ')}.`,\n });\n } else if (\n key === 'dryRun' &&\n !['extract', 'lookup', 'full'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['extract', 'lookup', 'full'].join(', ')}.`,\n });\n } else if (\n key === 'binarySource' &&\n !['docker', 'global', 'install', 'hermit'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['docker', 'global', 'install', 'hermit'].join(', ')}.`,\n });\n } else if (\n key === 'requireConfig' &&\n !['required', 'optional', 'ignored'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['required', 'optional', 'ignored'].join(', ')}.`,\n });\n } else if (\n key === 'gitUrl' &&\n !['default', 'ssh', 'endpoint'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['default', 'ssh', 'endpoint'].join(', ')}.`,\n });\n }\n\n if (\n key === 'reportType' &&\n ['s3', 'file'].includes(val) &&\n !isString(config.reportPath)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `reportType '${val}' requires a configured reportPath`,\n });\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a string.`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(...validateNumber(key, val, allowsNegative, currentPath));\n } else if (type === 'boolean') {\n if (val !== true && val !== false) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val}).`,\n });\n }\n } else if (type === 'array') {\n if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n 'global',\n subval as AllConfig,\n false,\n `${currentPath}[${subIndex}]`,\n );\n warnings.push(...subValidation.warnings);\n errors.push(...subValidation.errors);\n }\n }\n\n if (isRegexOrGlobOption(key)) {\n warnings.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath: currentPath!,\n }),\n );\n }\n if (key === 'gitNoVerify') {\n const allowedValues = ['commit', 'push'];\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n if (key === 'mergeConfidenceDatasources') {\n const allowedValues = supportedDatasources;\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${value}\\` for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a list (Array).`,\n });\n }\n } else if (type === 'object') {\n if (isPlainObject(val)) {\n if (key === 'onboardingConfig') {\n const subValidation = await validateConfig('repo', val);\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'force') {\n const subValidation = await validateConfig('global', val);\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'cacheTtlOverride') {\n for (const [subKey, subValue] of Object.entries(val)) {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(\n ...validateNumber(\n key,\n subValue,\n allowsNegative,\n currentPath,\n subKey,\n ),\n );\n\n if (\n !(packageCacheNamespaces as readonly string[]).includes(subKey) &&\n !anyMatchRegexOrGlobList(\n packageCacheNamespaces as unknown as string[],\n [subKey],\n )\n ) {\n errors.push({\n message: `${currentPath}: namespace \\`${subKey}\\` does not exist`,\n topic: 'Configuration Error',\n });\n }\n }\n } else {\n const res = validatePlainObject(val);\n if (res !== true) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${res}\\` configuration: value must be a string.`,\n });\n }\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a JSON object.`,\n });\n }\n }\n }\n}\n\nfunction getPossibleConfigFileNames({\n configFileNames,\n platform,\n}: {\n configFileNames?: string[];\n platform?: PlatformId;\n}): string[] {\n const filenames = getConfigFileNames(platform);\n if (isNonEmptyArray(configFileNames)) {\n return filenames.concat(configFileNames);\n }\n\n return filenames;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,MAAM,UAAU,WAAW;AAE3B,IAAI,qBAAqB;AACzB,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AAEJ,MAAM,cAAiC;AAEvC,MAAM,kBAAqC,CACzC,GAAG,wBACH,GAAG,yBACL;AAEA,MAAM,kBAAkB,CAAC,GAAG,aAAa,KAAK;AAE9C,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,MAAM,OAAO,MAAM,qBAAqB;AACxC,MAAM,UAAU,MAAM,kBAAkB;AAExC,SAAS,UAAU,KAAsB;CACvC,OAAO,aAAa,SAAS,GAAG;AAClC;AAEA,SAAS,8BAA8B,iBAAqC;CAC1E,OAAO,gBAAgB,QACpB,YAAY,CAAC,gBAAgB,SAAS,QAAQ,QAAQ,WAAW,EAAE,CAAC,CACvE;AACF;AAEA,SAAS,sBAAsB,QAAoC;CACjE,MAAM,oBAAwD;EAC5D,YAAY;EACZ,eAAe;EACf,SAAS;CACX;CACA,IAAI,kBAAkB,SACpB,OAAO,kBAAkB;CAG3B,MAAM,QAAQ,QAAQ,MAAM,MAAM,EAAE,SAAS,MAAM;CACnD,IAAI,CAAC,OACH;CAGF,IAAI,CAAC,MAAM,g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BranchesValidator.check"],"sources":["../../lib/config/validation.ts"],"sourcesContent":["import is, {\n isArray,\n isEmptyString,\n isNonEmptyArray,\n isNonEmptyString,\n isObject,\n isPlainObject,\n isString,\n isUndefined,\n} from '@sindresorhus/is';\nimport type { PlatformId } from '../constants/index.ts';\nimport { instrument } from '../instrumentation/index.ts';\nimport { logger } from '../logger/index.ts';\nimport {\n AllManagersListLiteral,\n CustomManagersListLiteral,\n} from '../manager-list.generated.ts';\nimport { isCustomManager } from '../modules/manager/custom/index.ts';\nimport type { CustomManager } from '../modules/manager/custom/types.ts';\nimport type { HostRule } from '../types/index.ts';\nimport { packageCacheNamespaces } from '../util/cache/package/namespaces.ts';\nimport { getToolConfig } from '../util/exec/containerbase.ts';\nimport { isConstraintName, isToolName } from '../util/exec/types.ts';\nimport { getExpression } from '../util/jsonata.ts';\nimport { regEx } from '../util/regex.ts';\nimport {\n anyMatchRegexOrGlobList,\n getRegexPredicate,\n isRegexMatch,\n matchRegexOrGlobList,\n} from '../util/string-match.ts';\nimport * as template from '../util/template/index.ts';\nimport { parseUrl } from '../util/url.ts';\nimport {\n AllVersioningsListLiteral,\n type VersioningName,\n} from '../versioning-list.generated.ts';\nimport {\n hasValidSchedule,\n hasValidTimezone,\n} from '../workers/repository/update/branch/schedule.ts';\nimport { getConfigFileNames } from './app-strings.ts';\nimport { GlobalConfig } from './global.ts';\nimport { migrateConfig } from './migration.ts';\nimport { getOptions } from './options/index.ts';\nimport { resolveConfigPresets } from './presets/index.ts';\nimport { supportedDatasources } from './presets/internal/merge-confidence.preset.ts';\nimport { parsePreset } from './presets/parse.ts';\nimport type {\n AllConfig,\n AllowedParents,\n RenovateConfig,\n RenovateOptions,\n StatusCheckKey,\n ValidationMessage,\n ValidationResult,\n} from './types.ts';\nimport { allowedStatusCheckStrings } from './types.ts';\nimport * as matchBaseBranchesValidator from './validation-helpers/match-base-branches.ts';\nimport * as regexOrGlobValidator from './validation-helpers/regex-glob-matchers.ts';\nimport {\n getParentName,\n isFalseGlobal,\n validateJSONataManagerFields,\n validateNumber,\n validatePlainObject,\n validateRegexManagerFields,\n} from './validation-helpers/utils.ts';\n\nconst options = getOptions();\n\nlet optionsInitialized = false;\nlet optionTypes: Record<string, RenovateOptions['type']>;\nlet optionParents: Record<string, AllowedParents[]>;\nlet optionGlobals: Set<string>;\nlet optionInherits: Set<string>;\nlet optionRegexOrGlob: Set<string>;\nlet optionAllowsNegativeIntegers: Set<string>;\nlet optionSupportsTemplating: Set<string>;\n\nconst managerList: readonly string[] = AllManagersListLiteral;\n\nconst allManagersList: readonly string[] = [\n ...AllManagersListLiteral,\n ...CustomManagersListLiteral,\n];\n\nconst topLevelObjects = [...managerList, 'env'];\n\nconst ignoredNodes = [\n '$schema',\n 'headers',\n 'depType',\n 'npmToken',\n 'packageFile',\n 'forkToken',\n 'repository',\n 'vulnerabilityAlertsOnly',\n 'vulnerabilityAlert',\n 'isVulnerabilityAlert',\n 'vulnerabilityFixVersion', // not intended to be used by end users but may be by Mend apps\n 'copyLocalLibs', // deprecated - functionality is now enabled by default\n 'prBody', // deprecated\n 'minimumConfidence', // undocumented feature flag\n];\nconst tzRe = regEx(/^:timezone\\((.+)\\)$/);\nconst rulesRe = regEx(/p.*Rules\\[\\d+\\]$/);\n\nfunction isIgnored(key: string): boolean {\n return ignoredNodes.includes(key);\n}\n\nfunction getUnsupportedEnabledManagers(enabledManagers: string[]): string[] {\n return enabledManagers.filter(\n (manager) => !allManagersList.includes(manager.replace('custom.', '')),\n );\n}\n\nfunction getDeprecationMessage(option: string): string | undefined {\n const deprecatedOptions: Record<string, string | undefined> = {\n branchName: `Direct editing of branchName is now deprecated. Please edit branchPrefix, additionalBranchPrefix, or branchTopic instead`,\n commitMessage: `Direct editing of commitMessage is now deprecated. Please edit commitMessage's subcomponents instead.`,\n prTitle: `Direct editing of prTitle is now deprecated. Please edit commitMessage subcomponents instead as they will be passed through to prTitle.`,\n };\n if (deprecatedOptions[option]) {\n return deprecatedOptions[option];\n }\n\n const found = options.find((o) => o.name === option);\n if (!found) {\n return undefined;\n }\n\n if (!found.deprecationMsg) {\n return undefined;\n }\n\n return `The '${option}' option is deprecated: ${found.deprecationMsg}`;\n}\n\nfunction isInhertConfigOption(key: string): boolean {\n return optionInherits.has(key);\n}\n\nfunction isRegexOrGlobOption(key: string): boolean {\n return optionRegexOrGlob.has(key);\n}\n\nfunction isGlobalOption(key: string): boolean {\n return optionGlobals.has(key);\n}\n\nfunction initOptions(): void {\n if (optionsInitialized) {\n return;\n }\n\n optionParents = {};\n optionInherits = new Set();\n optionTypes = {};\n optionRegexOrGlob = new Set();\n optionGlobals = new Set();\n optionAllowsNegativeIntegers = new Set();\n optionSupportsTemplating = new Set();\n\n for (const option of options) {\n optionTypes[option.name] = option.type;\n\n if (option.parents) {\n optionParents[option.name] = option.parents;\n }\n\n if (option.inheritConfigSupport) {\n optionInherits.add(option.name);\n }\n\n if (option.patternMatch) {\n optionRegexOrGlob.add(option.name);\n }\n\n if (option.globalOnly) {\n optionGlobals.add(option.name);\n }\n\n if (option.allowNegative) {\n optionAllowsNegativeIntegers.add(option.name);\n }\n\n if (option.supportsTemplating) {\n optionSupportsTemplating.add(option.name);\n }\n }\n\n optionsInitialized = true;\n}\n\nexport async function validateConfig(\n configType: 'global' | 'inherit' | 'repo',\n config: AllConfig,\n isPreset?: boolean,\n parentPath?: string,\n): Promise<ValidationResult> {\n return instrument(\n `validateConfig(${configType}, ${JSON.stringify(parentPath)})`,\n async () => {\n initOptions();\n\n let errors: ValidationMessage[] = [];\n let warnings: ValidationMessage[] = [];\n\n for (const [key, val] of Object.entries(config)) {\n const currentPath = parentPath ? `${parentPath}.${key}` : key;\n /* v8 ignore next 7 -- TODO: add test */\n if (key === '__proto__') {\n errors.push({\n topic: 'Config security error',\n message: '__proto__',\n });\n continue;\n }\n if (\n parentPath &&\n parentPath !== 'onboardingConfig' &&\n topLevelObjects.includes(key)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `The \"${key}\" object can only be configured at the top level of a config but was found inside \"${parentPath}\"`,\n });\n }\n\n if (isGlobalOption(key)) {\n if (configType === 'global') {\n await validateGlobalConfig(\n key,\n val,\n optionTypes[key],\n warnings,\n errors,\n currentPath,\n config,\n );\n continue;\n } else if (\n !isFalseGlobal(key, parentPath) &&\n !(configType === 'inherit' && isInhertConfigOption(key))\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `The \"${key}\" option is a global option reserved only for Renovate's global configuration and cannot be configured within a repository's config file.`,\n });\n continue;\n }\n }\n if (key === 'enabledManagers' && val) {\n const unsupportedManagers = getUnsupportedEnabledManagers(\n val as string[],\n );\n if (isNonEmptyArray(unsupportedManagers)) {\n errors.push({\n topic: 'Configuration Error',\n message: `The following managers configured in enabledManagers are not supported: \"${unsupportedManagers.join(\n ', ',\n )}\"`,\n });\n }\n }\n if (key === 'registryUrls' && !parentPath && isNonEmptyArray(val)) {\n warnings.push({\n topic: 'Configuration Warning',\n message:\n 'Setting `registryUrls` at the top level of your config will apply it to all managers and datasources, which can cause the wrong registry URL to be used for some packages. Use `registryUrls` inside `packageRules` to target specific managers or packages.',\n });\n }\n if (\n key === 'defaultRegistryUrls' &&\n !parentPath &&\n isNonEmptyArray(val)\n ) {\n warnings.push({\n topic: 'Configuration Warning',\n message:\n 'Setting `defaultRegistryUrls` at the top level of your config will apply it to all managers and datasources, which can cause the wrong registry URL to be used for some packages. Use `defaultRegistryUrls` inside `packageRules` to target specific managers or packages.',\n });\n }\n if (\n !isIgnored(key) && // We need to ignore some reserved keys\n !(is as any).function(val) // Ignore all functions\n ) {\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: 'Deprecation Warning',\n message: getDeprecationMessage(key)!,\n });\n }\n if (optionSupportsTemplating.has(key) && val) {\n try {\n // TODO: types (#22198)\n template.validate((val as string).toString());\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid template in config path: ${currentPath}`,\n });\n }\n }\n const parentName = getParentName(parentPath);\n if (\n !isPreset &&\n optionParents[key] &&\n !optionParents[key].includes(parentName as AllowedParents)\n ) {\n // TODO: types (#22198)\n const options = optionParents[key]?.toSorted().join(', ');\n const message = `\"${key}\" can't be used in \"${parentName}\". Allowed objects: ${options}.`;\n warnings.push({\n topic: `${parentPath ? `${parentPath}.` : ''}${key}`,\n message,\n });\n }\n\n // v8 ignore else -- intentionally unhandled - if we knew what was to be covered here, we'd add validation\n if (!optionTypes[key]) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid configuration option: ${currentPath}`,\n });\n } else if (key === 'schedule') {\n const [validSchedule, errorMessage] = hasValidSchedule(\n val as string[],\n );\n if (!validSchedule) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid ${currentPath}: \\`${errorMessage}\\``,\n });\n }\n } else if (\n [\n 'allowedVersions',\n 'matchCurrentVersion',\n 'matchCurrentValue',\n 'matchNewValue',\n ].includes(key) &&\n isRegexMatch(val)\n ) {\n if (!getRegexPredicate(val)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${val}\\``,\n });\n }\n } else if (key === 'timezone' && val !== null) {\n const [validTimezone, errorMessage] = hasValidTimezone(\n val as string,\n );\n if (!validTimezone) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n } else if (val !== null) {\n const type = optionTypes[key];\n if (type === 'boolean') {\n if (val !== true && val !== false) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val})`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n errors.push(\n ...validateNumber(key, val, allowsNegative, currentPath),\n );\n } else if (type === 'array' && val) {\n if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n configType,\n subval as RenovateConfig,\n isPreset,\n `${currentPath}[${subIndex}]`,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n if (isRegexOrGlobOption(key)) {\n errors.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath,\n }),\n );\n }\n if (key === 'extends') {\n for (const subval of val) {\n if (isString(subval)) {\n if (\n configType !== 'global' &&\n subval.startsWith('global:')\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: you cannot extend from \"global:\" presets in a repository config's \"extends\"`,\n });\n }\n\n if (\n parentName === 'packageRules' &&\n subval.startsWith('group:')\n ) {\n warnings.push({\n topic: 'Configuration Warning',\n message: `${currentPath}: you should not extend \"group:\" presets`,\n });\n }\n if (tzRe.test(subval)) {\n const [, timezone] = tzRe.exec(subval)!;\n const [validTimezone, errorMessage] =\n hasValidTimezone(timezone);\n if (!validTimezone) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n }\n if (!subval.includes('{{')) {\n try {\n parsePreset(subval);\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: preset \"${subval}\" is not valid`,\n });\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: preset value is not a string`,\n });\n }\n }\n }\n\n const selectors = [\n 'matchFileNames',\n 'matchLanguages',\n 'matchCategories',\n 'matchBaseBranches',\n 'matchManagers',\n 'matchDatasources',\n 'matchDepTypes',\n 'matchDepNames',\n 'matchPackageNames',\n 'matchCurrentValue',\n 'matchCurrentVersion',\n 'matchSourceUrls',\n 'matchRegistryUrls',\n 'matchUpdateTypes',\n 'matchConfidence',\n 'matchCurrentAge',\n 'matchRepositories',\n 'matchNewValue',\n 'matchJsonata',\n ];\n if (key === 'packageRules') {\n for (const [subIndex, packageRule] of val.entries()) {\n if (isObject(packageRule)) {\n const { config: resolved } = await resolveConfigPresets(\n packageRule as RenovateConfig,\n config,\n );\n const resolvedRule = migrateConfig({\n packageRules: [resolved],\n }).migratedConfig.packageRules![0];\n warnings.push(\n ...matchBaseBranchesValidator.check({\n resolvedRule,\n currentPath: `${currentPath}[${subIndex}]`,\n baseBranchPatterns: config.baseBranchPatterns!,\n }),\n );\n const selectorLength = Object.keys(resolvedRule).filter(\n (ruleKey) => selectors.includes(ruleKey),\n ).length;\n if (!selectorLength) {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one match* or exclude* selector. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: 'Configuration Error',\n message,\n });\n }\n if (selectorLength === Object.keys(resolvedRule).length) {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one non-match* or non-exclude* field. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n warnings.push({\n topic: 'Configuration Error',\n message,\n });\n }\n // It's too late to apply any of these options once you already have updates determined\n const preLookupOptions = [\n 'allowedVersions',\n 'extractVersion',\n 'followTag',\n 'ignoreDeps',\n 'ignoreUnstable',\n 'rangeStrategy',\n 'registryUrls',\n 'respectLatest',\n 'rollbackPrs',\n 'separateMajorMinor',\n 'separateMinorPatch',\n 'separateMultipleMajor',\n 'separateMultipleMinor',\n 'versioning',\n ] as const;\n if (isNonEmptyArray(resolvedRule.matchUpdateTypes)) {\n for (const option of preLookupOptions) {\n if (resolvedRule[option] !== undefined) {\n const message = `${currentPath}[${subIndex}]: packageRules cannot combine both matchUpdateTypes and ${option}. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: 'Configuration Error',\n message,\n });\n }\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath} must contain JSON objects`,\n });\n }\n }\n }\n if (key === 'customManagers') {\n const allowedKeys = [\n 'customType',\n 'description',\n 'fileFormat',\n 'managerFilePatterns',\n 'matchStrings',\n 'matchStringsStrategy',\n 'depNameTemplate',\n 'packageNameTemplate',\n 'datasourceTemplate',\n 'versioningTemplate',\n 'registryUrlTemplate',\n 'currentValueTemplate',\n 'extractVersionTemplate',\n 'autoReplaceStringTemplate',\n 'depTypeTemplate',\n ];\n for (const customManager of val as CustomManager[]) {\n if (\n Object.keys(customManager).some(\n (k) => !allowedKeys.includes(k),\n )\n ) {\n const disallowedKeys = Object.keys(customManager).filter(\n (k) => !allowedKeys.includes(k),\n );\n errors.push({\n topic: 'Configuration Error',\n message: `Custom Manager contains disallowed fields: ${disallowedKeys.join(\n ', ',\n )}`,\n });\n } else if (\n isNonEmptyString(customManager.customType) &&\n isCustomManager(customManager.customType)\n ) {\n if (isNonEmptyArray(customManager.managerFilePatterns)) {\n switch (customManager.customType) {\n case 'regex':\n validateRegexManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n case 'jsonata':\n validateJSONataManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Each Custom Manager must contain a non-empty managerFilePatterns array`,\n });\n }\n } else {\n if (\n isEmptyString(customManager.customType) ||\n isUndefined(customManager.customType)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Each Custom Manager must contain a non-empty customType string`,\n });\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid customType: ${customManager.customType}. Key is not a custom manager`,\n });\n }\n }\n }\n }\n if (['matchPackageNames', 'matchDepNames'].includes(key)) {\n const startPattern = regEx(/!?\\//);\n const endPattern = regEx(/\\/g?i?$/);\n for (const pattern of val as string[]) {\n if (\n startPattern.test(pattern) &&\n endPattern.test(pattern)\n ) {\n try {\n // regEx isn't aware of our !/ prefix but can handle the suffix\n regEx(pattern.replace(startPattern, '/'));\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${pattern}\\``,\n });\n }\n }\n }\n }\n if (key === 'baseBranchPatterns') {\n for (const baseBranchPattern of val as string[]) {\n if (\n isRegexMatch(baseBranchPattern) &&\n !getRegexPredicate(baseBranchPattern)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${baseBranchPattern}\\``,\n });\n }\n }\n }\n if (\n (selectors.includes(key) ||\n key === 'matchCurrentVersion' ||\n key === 'matchCurrentValue') &&\n // TODO: can be undefined ? #22198\n !rulesRe.test(parentPath!) && // Inside a packageRule\n (isString(parentPath) || !isPreset) // top level in a preset\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${key} should be inside a \\`packageRule\\` only`,\n });\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a list (Array)`,\n });\n }\n } else if (type === 'string') {\n if (!isString(val)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a string`,\n });\n }\n } else if (type === 'object') {\n if (isPlainObject(val)) {\n if (key === 'registryAliases') {\n const res = validatePlainObject(val);\n if (res !== true) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${res}\\` configuration: value is not a string`,\n });\n }\n } else if (key === 'env') {\n const allowedEnvVars =\n configType === 'global'\n ? (config.allowedEnv ?? [])\n : GlobalConfig.get('allowedEnv');\n for (const [envVarName, envVarValue] of Object.entries(val)) {\n if (!isString(envVarValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid env variable value: \\`${currentPath}.${envVarName}\\` must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(envVarName, allowedEnvVars)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Env variable name \\`${envVarName}\\` is not allowed by this bot's \\`allowedEnv\\`.`,\n });\n }\n }\n } else if (key === 'statusCheckNames') {\n for (const [\n statusCheckKey,\n statusCheckValue,\n ] of Object.entries(val)) {\n if (\n !allowedStatusCheckStrings.includes(\n statusCheckKey as StatusCheckKey,\n )\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${statusCheckKey}\\` configuration: key is not allowed.`,\n });\n }\n if (\n !(isString(statusCheckValue) || null === statusCheckValue)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${statusCheckKey}\\` configuration: status check is not a string.`,\n });\n continue;\n }\n }\n } else if (key === 'statusCheckWhen') {\n const allowedWhenValues = ['always', 'never', 'failed'];\n for (const [\n statusCheckKey,\n statusCheckValue,\n ] of Object.entries(val)) {\n if (\n !allowedStatusCheckStrings.includes(\n statusCheckKey as StatusCheckKey,\n )\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${statusCheckKey}\\` configuration: key is not allowed.`,\n });\n }\n if (\n !isString(statusCheckValue) ||\n !allowedWhenValues.includes(statusCheckValue)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${statusCheckKey}\\` configuration: value must be one of \"always\", \"never\", or \"failed\".`,\n });\n continue;\n }\n }\n } else if (key === 'customDatasources') {\n const allowedKeys = [\n 'description',\n 'defaultRegistryUrlTemplate',\n 'format',\n 'transformTemplates',\n ];\n for (const [\n customDatasourceName,\n customDatasourceValue,\n ] of Object.entries(val)) {\n if (!isPlainObject(customDatasourceValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${customDatasourceName}\\` configuration: customDatasource is not an object`,\n });\n continue;\n }\n for (const [subKey, subValue] of Object.entries(\n customDatasourceValue,\n )) {\n if (!allowedKeys.includes(subKey)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: key is not allowed`,\n });\n } else if (subKey === 'transformTemplates') {\n if (!isArray(subValue, isString)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of string`,\n });\n }\n } else if (subKey === 'description') {\n if (\n !(isString(subValue) || isArray(subValue, isString))\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of strings`,\n });\n }\n } else if (!isString(subValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is a string`,\n });\n }\n }\n }\n } else if (key === 'installTools') {\n for (const toolName of Object.keys(val)) {\n if (!isToolName(toolName)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${toolName}\\` configuration: not a valid tool name.`,\n });\n }\n }\n } else if (key === 'constraints') {\n const { get: getVersioning } =\n await import('../modules/versioning/index.ts');\n for (const [k, v] of Object.entries(val)) {\n if (!isString(v)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\` should be an object of key-value pairs of constraints and their value`,\n });\n break;\n }\n\n if (!isConstraintName(k)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\`: \\`${k}\\` is not a supported constraint name`,\n });\n } else if (isToolName(k)) {\n // TODO: #31831\n const versioningId = getToolConfig(k).versioning;\n const versioning = getVersioning(versioningId);\n if (!versioning.isValid(v)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}=${v}\\` is not a valid tool version constraint, according to \\`${versioningId}\\` versioning`,\n });\n }\n }\n }\n } else if (key === 'constraintsVersioning') {\n for (const [k, v] of Object.entries(val)) {\n if (!isString(v)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\` should be an object of key-value pairs of additional constraint names and their versioning`,\n });\n break;\n }\n\n if (isToolName(k)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\` is not a valid additional constraint name, as \\`${k}\\` is a tool name, and \\`constraintsVersioning\\` can only override the versioning for a non-tool constraint`,\n });\n } else if (isConstraintName(k)) {\n const versioningName = v.split(':')[0];\n if (\n !AllVersioningsListLiteral.includes(\n versioningName as VersioningName,\n )\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}=${v}\\`: \\`${v}\\` is not a valid versioning scheme`,\n });\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\`: \\`${k}\\` is not a known additional constraint name`,\n });\n }\n }\n } else {\n const ignoredObjects = options\n .filter((option) => option.freeChoice)\n .map((option) => option.name);\n if (!ignoredObjects.includes(key)) {\n const subValidation = await validateConfig(\n configType,\n val,\n isPreset,\n currentPath,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a json object`,\n });\n }\n } else {\n // v8 ignore next -- intentionally unhandled - if we knew what was to be covered here, we'd add validation\n logger.debug(\n {},\n `Unhandled validation for ${type} at \\`${currentPath}\\``,\n );\n }\n }\n }\n\n if (key === 'hostRules' && isArray(val)) {\n const allowedHeaders =\n configType === 'global'\n ? (config.allowedHeaders ?? [])\n : GlobalConfig.get('allowedHeaders');\n for (const rule of val as HostRule[]) {\n if (isNonEmptyString(rule.matchHost)) {\n if (\n rule.matchHost.includes('://') &&\n parseUrl(rule.matchHost) === null\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules matchHost \\`${rule.matchHost}\\` is not a valid URL.`,\n });\n }\n } else if (isEmptyString(rule.matchHost)) {\n errors.push({\n topic: 'Configuration Error',\n message:\n 'Invalid value for hostRules matchHost. It cannot be an empty string.',\n });\n }\n\n if (!rule.headers) {\n continue;\n }\n for (const [header, value] of Object.entries(rule.headers)) {\n if (!isString(value)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid hostRules headers value configuration: header must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(header, allowedHeaders)) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules header \\`${header}\\` is not allowed by this bot's \\`allowedHeaders\\`.`,\n });\n }\n }\n }\n }\n\n if (key === 'matchJsonata' && isArray(val, isString)) {\n for (const expression of val) {\n const res = getExpression(expression);\n if (res instanceof Error) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid JSONata expression for ${currentPath}: ${res.message}`,\n });\n }\n }\n }\n }\n\n function sortAll(a: ValidationMessage, b: ValidationMessage): number {\n if (a.topic === b.topic) {\n return a.message > b.message ? 1 : -1;\n }\n return a.topic > b.topic ? 1 : -1;\n }\n\n errors.sort(sortAll);\n warnings.sort(sortAll);\n return { errors, warnings };\n },\n );\n}\n\n/**\n * Basic validation for global config options\n */\nasync function validateGlobalConfig(\n key: string,\n val: unknown,\n type: string,\n warnings: ValidationMessage[],\n errors: ValidationMessage[],\n currentPath: string | undefined,\n config: AllConfig,\n): Promise<void> {\n /* v8 ignore next 5 -- not testable yet */\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: 'Deprecation Warning',\n message: getDeprecationMessage(key)!,\n });\n }\n\n if (key === 'binarySource' && val === 'docker') {\n warnings.push({\n topic: 'Deprecation Warning',\n message:\n 'Usage of `binarySource=docker` is deprecated, and will be removed in the future. Please migrate to `binarySource=install`. Feedback on the usage of `binarySource=docker` is welcome at https://github.com/renovatebot/renovate/discussions/40742',\n });\n }\n\n if (val !== null) {\n // v8 ignore else -- TODO: add test #40625\n if (type === 'string') {\n if (isString(val)) {\n if (\n key === 'onboardingConfigFileName' &&\n !getPossibleConfigFileNames({\n configFileNames: config.configFileNames,\n platform: config.platform,\n }).includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${getPossibleConfigFileNames(\n {\n configFileNames: config.configFileNames,\n platform: config.platform,\n },\n ).join(', ')}.`,\n });\n } else if (\n key === 'repositoryCache' &&\n !['enabled', 'disabled', 'reset'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['enabled', 'disabled', 'reset'].join(', ')}.`,\n });\n } else if (\n key === 'dryRun' &&\n !['extract', 'lookup', 'full'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['extract', 'lookup', 'full'].join(', ')}.`,\n });\n } else if (\n key === 'binarySource' &&\n !['docker', 'global', 'install', 'hermit'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['docker', 'global', 'install', 'hermit'].join(', ')}.`,\n });\n } else if (\n key === 'requireConfig' &&\n !['required', 'optional', 'ignored'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['required', 'optional', 'ignored'].join(', ')}.`,\n });\n } else if (\n key === 'gitUrl' &&\n !['default', 'ssh', 'endpoint'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['default', 'ssh', 'endpoint'].join(', ')}.`,\n });\n }\n\n if (\n key === 'reportType' &&\n ['s3', 'file'].includes(val) &&\n !isString(config.reportPath)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `reportType '${val}' requires a configured reportPath`,\n });\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a string.`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(...validateNumber(key, val, allowsNegative, currentPath));\n } else if (type === 'boolean') {\n if (val !== true && val !== false) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val}).`,\n });\n }\n } else if (type === 'array') {\n if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n 'global',\n subval as AllConfig,\n false,\n `${currentPath}[${subIndex}]`,\n );\n warnings.push(...subValidation.warnings);\n errors.push(...subValidation.errors);\n }\n }\n\n if (isRegexOrGlobOption(key)) {\n warnings.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath: currentPath!,\n }),\n );\n }\n if (key === 'gitNoVerify') {\n const allowedValues = ['commit', 'push'];\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n if (key === 'mergeConfidenceDatasources') {\n const allowedValues = supportedDatasources;\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${value}\\` for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a list (Array).`,\n });\n }\n } else if (type === 'object') {\n if (isPlainObject(val)) {\n if (key === 'onboardingConfig') {\n const subValidation = await validateConfig('repo', val);\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'force') {\n const subValidation = await validateConfig('global', val);\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'cacheTtlOverride') {\n for (const [subKey, subValue] of Object.entries(val)) {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(\n ...validateNumber(\n key,\n subValue,\n allowsNegative,\n currentPath,\n subKey,\n ),\n );\n\n if (\n !(packageCacheNamespaces as readonly string[]).includes(subKey) &&\n !anyMatchRegexOrGlobList(\n packageCacheNamespaces as unknown as string[],\n [subKey],\n )\n ) {\n errors.push({\n message: `${currentPath}: namespace \\`${subKey}\\` does not exist`,\n topic: 'Configuration Error',\n });\n }\n }\n } else {\n const res = validatePlainObject(val);\n if (res !== true) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${res}\\` configuration: value must be a string.`,\n });\n }\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a JSON object.`,\n });\n }\n }\n }\n}\n\nfunction getPossibleConfigFileNames({\n configFileNames,\n platform,\n}: {\n configFileNames?: string[];\n platform?: PlatformId;\n}): string[] {\n const filenames = getConfigFileNames(platform);\n if (isNonEmptyArray(configFileNames)) {\n return filenames.concat(configFileNames);\n }\n\n return filenames;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,MAAM,UAAU,WAAW;AAE3B,IAAI,qBAAqB;AACzB,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AAEJ,MAAM,cAAiC;AAEvC,MAAM,kBAAqC,CACzC,GAAG,wBACH,GAAG,yBACL;AAEA,MAAM,kBAAkB,CAAC,GAAG,aAAa,KAAK;AAE9C,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,MAAM,OAAO,MAAM,qBAAqB;AACxC,MAAM,UAAU,MAAM,kBAAkB;AAExC,SAAS,UAAU,KAAsB;CACvC,OAAO,aAAa,SAAS,GAAG;AAClC;AAEA,SAAS,8BAA8B,iBAAqC;CAC1E,OAAO,gBAAgB,QACpB,YAAY,CAAC,gBAAgB,SAAS,QAAQ,QAAQ,WAAW,EAAE,CAAC,CACvE;AACF;AAEA,SAAS,sBAAsB,QAAoC;CACjE,MAAM,oBAAwD;EAC5D,YAAY;EACZ,eAAe;EACf,SAAS;CACX;CACA,IAAI,kBAAkB,SACpB,OAAO,kBAAkB;CAG3B,MAAM,QAAQ,QAAQ,MAAM,MAAM,EAAE,SAAS,MAAM;CACnD,IAAI,CAAC,OACH;CAGF,IAAI,CAAC,MAAM,gBACT;CAGF,OAAO,QAAQ,OAAO,0BAA0B,MAAM;AACxD;AAEA,SAAS,qBAAqB,KAAsB;CAClD,OAAO,eAAe,IAAI,GAAG;AAC/B;AAEA,SAAS,oBAAoB,KAAsB;CACjD,OAAO,kBAAkB,I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oB;GAC9B,MAAM,gBAAgB,MAAM,eAAe,QAAQ,GAAG;GACtD,KAAK,MAAM,WAAW,cAAc,SAAS,OAC3C,cAAc,MAChB,GACE,SAAS,KAAK,OAAO;EAEzB,OAAO,IAAI,QAAQ,SAAS;GAC1B,MAAM,gBAAgB,MAAM,eAAe,UAAU,GAAG;GACxD,KAAK,MAAM,WAAW,cAAc,SAAS,OAC3C,cAAc,MAChB,GACE,SAAS,KAAK,OAAO;EAEzB,OAAO,IAAI,QAAQ,oBACjB,KAAK,MAAM,CAAC,QAAQ,aAAa,OAAO,QAAQ,GAAG,GAAG;GACpD,MAAM,iBAAiB,6BAA6B,IAAI,GAAG;GAC3D,SAAS,KACP,GAAG,eACD,KACA,UACA,gBACA,aACA,MACF,CACF;GAEA,IACE,CAAE,uBAA6C,SAAS,MAAM,KAC9D,CAAC,wBACC,wBACA,CAAC,MAAM,CACT,GAEA,OAAO,KAAK;IACV,SAAS,GAAG,YAAY,gBAAgB,OAAO;IAC/C,OAAO;GACT,CAAC;EAEL;OACK;GACL,MAAM,MAAM,oBAAoB,GAAG;GACnC,IAAI,QAAQ,MACV,SAAS,KAAK;IACZ,OAAO;IACP,SAAS,aAAa,YAAY,GAAG,IAAI;GAC3C,CAAC;EAEL;OAEA,SAAS,KAAK;GACZ,OAAO;GACP,SAAS,0BAA0B,YAAY;EACjD,CAAC;CAAA;AAIT;AAEA,SAAS,2BAA2B,EAClC,iBACA,YAIW;CACX,MAAM,YAAY,mBAAmB,QAAQ;CAC7C,IAAI,gBAAgB,eAAe,GACjC,OAAO,UAAU,OAAO,eAAe;CAGzC,OAAO;AACT"}
|
package/dist/config-validator.js
CHANGED
|
@@ -195,9 +195,7 @@ If you have specified global self-hosted configuration (https://docs.renovatebot
|
|
|
195
195
|
});
|
|
196
196
|
await program.parseAsync();
|
|
197
197
|
})().catch((e) => {
|
|
198
|
-
if (e instanceof CommanderError)
|
|
199
|
-
if (e.code === "commander.helpDisplayed" || e.code === "commander.version") return;
|
|
200
|
-
}
|
|
198
|
+
if (e instanceof CommanderError && (e.code === "commander.helpDisplayed" || e.code === "commander.version")) return;
|
|
201
199
|
console.error(e);
|
|
202
200
|
process.exit(99);
|
|
203
201
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-validator.js","names":["getFileConfig"],"sources":["../lib/config-validator.ts"],"sourcesContent":["#!/usr/bin/env node\nimport 'source-map-support/register.js';\nimport './punycode.cjs';\n\nimport { styleText } from 'node:util';\nimport { isNonEmptyStringAndNotWhitespace } from '@sindresorhus/is';\nimport { Command, CommanderError } from 'commander';\nimport { dequal } from 'dequal';\nimport { diffLines } from 'diff';\nimport fs from 'fs-extra';\nimport { getConfigFileNames } from './config/app-strings.ts';\nimport { GlobalConfig } from './config/global.ts';\nimport { massageConfig } from './config/massage.ts';\nimport { migrateConfig } from './config/migration.ts';\nimport type { RenovateConfig } from './config/types.ts';\nimport { validateConfig } from './config/validation.ts';\nimport { pkg } from './expose.ts';\nimport { init, logger } from './logger/index.ts';\nimport { getEnv } from './util/env.ts';\nimport { add as addHostRule } from './util/host-rules.ts';\nimport { regEx } from './util/regex.ts';\nimport { getConfig as getFileConfig } from './workers/global/config/parse/file.ts';\nimport { parseConfigs } from './workers/global/config/parse/index.ts';\nimport { getParsedContent } from './workers/global/config/parse/util.ts';\n\nawait init();\n\nconst { pathExists, readFile } = fs;\n\nlet returnVal = 0;\n\n/**\n * Make sure that we've resolved configuration from the different places that Renovate users would expect them to be specified\n *\n * This then allows a `configType=repo` config to i.e. be validated alongside a `config.js` or `env RENOVATE_ALLOWED_COMMANDS=...`\n *\n * Note that we intentionally don't fully initialize Renovate and its modules, as we're not fully running, and it would require a Platform to be configured\n * */\nasync function partiallyGlobalInitialize(): Promise<void> {\n // NOTE that this doesn't allow command-line arguments\n const globalConfig = await parseConfigs(getEnv(), []);\n GlobalConfig.set(globalConfig);\n\n if (globalConfig.hostRules) {\n for (const hostRule of globalConfig.hostRules) {\n addHostRule(hostRule);\n }\n }\n}\n\nasync function validate(\n configType: 'global' | 'repo',\n desc: string,\n config: RenovateConfig,\n strict: boolean,\n isPreset = false,\n): Promise<void> {\n if (config.hostRules) {\n for (const hostRule of config.hostRules) {\n addHostRule(hostRule);\n }\n }\n const { isMigrated, migratedConfig } = migrateConfig(config);\n if (isMigrated) {\n logger.warn(\n {\n oldConfig: config,\n newConfig: migratedConfig,\n },\n 'Config migration necessary',\n );\n const changedObjects = diffLines(\n JSON.stringify(config, null, 2),\n JSON.stringify(migratedConfig, null, 2),\n { ignoreWhitespace: false, newlineIsToken: false },\n );\n const added = styleText('green', '+ ');\n const removed = styleText('red', '- ');\n const msg = changedObjects\n .flatMap((part) => {\n let linePrefix: string;\n if (part.added) {\n linePrefix = added;\n } else if (part.removed) {\n linePrefix = removed;\n } else {\n linePrefix = ' ';\n }\n return part.value\n .split('\\n')\n .filter(isNonEmptyStringAndNotWhitespace)\n .map((line) =>\n line.replace(regEx(/^(?<ws> *)/), `${linePrefix}$<ws>`),\n );\n })\n .join('\\n');\n logger.warn(`Config migration diff:\\n${msg}`);\n if (strict) {\n returnVal = 1;\n }\n }\n const massagedConfig = massageConfig(migratedConfig);\n const res = await validateConfig(configType, massagedConfig, isPreset);\n if (res.errors.length) {\n logger.error(\n { file: desc, errors: res.errors },\n 'Found errors in configuration',\n );\n returnVal = 1;\n }\n if (res.warnings.length) {\n logger.warn(\n { file: desc, warnings: res.warnings },\n 'Found errors in configuration',\n );\n returnVal = 1;\n }\n}\n\ninterface PackageJson {\n renovate?: RenovateConfig;\n 'renovate-config'?: Record<string, RenovateConfig>;\n}\n\n(async () => {\n await partiallyGlobalInitialize();\n\n const program = new Command('renovate-config-validator')\n .summary('Validate Renovate configuration files')\n .description(\n `Validate your Renovate configuration (repo config, shared presets or global configuration) files\\n` +\n // oxlint-disable-next-line renovate/no-hardcoded-docs-url -- CLI help text, no config available\n 'If no [config-files...] are given, renovate-config-validator will look at the default config file locations (https://docs.renovatebot.com/configuration-options/)',\n )\n .addHelpText(\n 'after',\n // oxlint-disable-next-line renovate/no-hardcoded-docs-url -- CLI help text, no config available\n `\nWhen specifying [config-files...], Renovate will treat them as global self-hosted configuration files. You can disable this behaviour with --no-global\n\nExamples:\n\n $ renovate-config-validator\n $ renovate-config-validator --strict\n $ renovate-config-validator first_config.json\n $ renovate-config-validator --strict config.js\n $ renovate-config-validator --no-global renovate.json5\n $ env RENOVATE_CONFIG_FILE=obscure-name.json renovate-config-validator\n\nGlobal configuration:\n\nIf you have specified global self-hosted configuration (https://docs.renovatebot.com/self-hosted-configuration/) in environment variables or in a \\`config.js\\`, this will be detected:\n\n $ env RENOVATE_ALLOWED_ENV='[\"GO*\"]' renovate-config-validator\n # if passing the filename, make sure it's not validating as a global config\n $ env RENOVATE_ALLOWED_ENV='[\"GO*\"]' renovate-config-validator --no-global renovate.json`,\n )\n .argument('[config-files...]')\n .version(pkg.version, '-v, --version')\n .option(\n '--strict',\n 'Fail command if any configuration warnings, errors, or a migration is needed',\n )\n .option(\n '--no-global',\n 'When specifying [config-files], do not treat them as global self-hosted configuration file(s)',\n true,\n )\n // allow us to manage the exit code\n .exitOverride();\n\n program.action(async (files, opts) => {\n const strict = opts.strict ?? false;\n let filesValidated = 0;\n\n if (files.length) {\n let isGlobalConfig = true;\n if (opts.global === false) {\n isGlobalConfig = false;\n }\n const configType = isGlobalConfig ? 'global' : 'repo';\n for (const file of files) {\n try {\n if (!(await pathExists(file))) {\n returnVal = 1;\n logger.error({ file }, 'File does not exist');\n break;\n }\n const parsedContent = await getParsedContent(file);\n try {\n logger.info(`Validating ${file} as ${configType} config`);\n await validate(configType, file, parsedContent, strict);\n } catch (err) {\n logger.warn({ file, err }, 'File is not valid Renovate config');\n returnVal = 1;\n }\n } catch (err) {\n logger.warn({ file, err }, 'File could not be parsed');\n returnVal = 1;\n }\n\n filesValidated++;\n }\n } else {\n for (const file of getConfigFileNames().filter(\n (name) => name !== 'package.json',\n )) {\n try {\n if (!(await pathExists(file))) {\n continue;\n }\n const parsedContent = await getParsedContent(file);\n try {\n logger.info(`Validating ${file}`);\n await validate('repo', file, parsedContent, strict);\n } catch (err) {\n logger.warn({ file, err }, 'File is not valid Renovate config');\n returnVal = 1;\n }\n } catch (err) {\n logger.warn({ file, err }, 'File could not be parsed');\n returnVal = 1;\n }\n\n filesValidated++;\n }\n try {\n const pkgJson = JSON.parse(\n await readFile('package.json', 'utf8'),\n ) as PackageJson;\n if (pkgJson.renovate) {\n logger.info(`Validating package.json > renovate`);\n await validate(\n 'repo',\n 'package.json > renovate',\n pkgJson.renovate,\n strict,\n );\n\n filesValidated++;\n }\n if (pkgJson['renovate-config']) {\n logger.info(`Validating package.json > renovate-config`);\n for (const presetConfig of Object.values(\n pkgJson['renovate-config'],\n )) {\n await validate(\n 'repo',\n 'package.json > renovate-config',\n presetConfig,\n strict,\n true,\n );\n\n filesValidated++;\n }\n }\n } catch {\n // ignore\n }\n try {\n const env = getEnv();\n const fileConfig = await getFileConfig(env);\n if (!dequal(fileConfig, {})) {\n const file = env.RENOVATE_CONFIG_FILE ?? 'config.js';\n logger.info(`Validating ${file}`);\n try {\n await validate('global', file, fileConfig, strict);\n } catch (err) {\n logger.error({ file, err }, 'File is not valid Renovate config');\n returnVal = 1;\n }\n filesValidated++;\n }\n } catch {\n // ignore\n }\n }\n if (returnVal === 0 && filesValidated) {\n logger.info(\n `Config validated successfully against ${filesValidated} file(s)`,\n );\n } else if (!filesValidated) {\n logger.warn(`No files to perform configuration validation against`);\n }\n // Use exitCode (not process.exit) so async log streams can flush\n process.exitCode = returnVal;\n });\n\n await program.parseAsync();\n})().catch((e) => {\n if (e instanceof CommanderError) {\n // Commander throws an error at the end of Action execution i.e. as part of the `help` and `version` commands, and so we don't want to return an error code in this case\n if (\n e.code === 'commander.helpDisplayed' ||\n e.code === 'commander.version'\n ) {\n return;\n }\n }\n\n // oxlint-disable-next-line no-console -- intentional: display critical error on CLI\n console.error(e);\n process.exit(99);\n});\n"],"mappings":";;;;;;;;;;;;;;;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,CAAC,CAAC,OAAO,MAAM;CAChB,IAAI,aAAa;MAGb,EAAE,SAAS,6BACX,EAAE,SAAS,qBAEX;CAAA;CAKJ,QAAQ,MAAM,CAAC;CACf,QAAQ,KAAK,EAAE;AACjB,CAAC"}
|
|
1
|
+
{"version":3,"file":"config-validator.js","names":["getFileConfig"],"sources":["../lib/config-validator.ts"],"sourcesContent":["#!/usr/bin/env node\nimport 'source-map-support/register.js';\nimport './punycode.cjs';\n\nimport { styleText } from 'node:util';\nimport { isNonEmptyStringAndNotWhitespace } from '@sindresorhus/is';\nimport { Command, CommanderError } from 'commander';\nimport { dequal } from 'dequal';\nimport { diffLines } from 'diff';\nimport fs from 'fs-extra';\nimport { getConfigFileNames } from './config/app-strings.ts';\nimport { GlobalConfig } from './config/global.ts';\nimport { massageConfig } from './config/massage.ts';\nimport { migrateConfig } from './config/migration.ts';\nimport type { RenovateConfig } from './config/types.ts';\nimport { validateConfig } from './config/validation.ts';\nimport { pkg } from './expose.ts';\nimport { init, logger } from './logger/index.ts';\nimport { getEnv } from './util/env.ts';\nimport { add as addHostRule } from './util/host-rules.ts';\nimport { regEx } from './util/regex.ts';\nimport { getConfig as getFileConfig } from './workers/global/config/parse/file.ts';\nimport { parseConfigs } from './workers/global/config/parse/index.ts';\nimport { getParsedContent } from './workers/global/config/parse/util.ts';\n\nawait init();\n\nconst { pathExists, readFile } = fs;\n\nlet returnVal = 0;\n\n/**\n * Make sure that we've resolved configuration from the different places that Renovate users would expect them to be specified\n *\n * This then allows a `configType=repo` config to i.e. be validated alongside a `config.js` or `env RENOVATE_ALLOWED_COMMANDS=...`\n *\n * Note that we intentionally don't fully initialize Renovate and its modules, as we're not fully running, and it would require a Platform to be configured\n * */\nasync function partiallyGlobalInitialize(): Promise<void> {\n // NOTE that this doesn't allow command-line arguments\n const globalConfig = await parseConfigs(getEnv(), []);\n GlobalConfig.set(globalConfig);\n\n if (globalConfig.hostRules) {\n for (const hostRule of globalConfig.hostRules) {\n addHostRule(hostRule);\n }\n }\n}\n\nasync function validate(\n configType: 'global' | 'repo',\n desc: string,\n config: RenovateConfig,\n strict: boolean,\n isPreset = false,\n): Promise<void> {\n if (config.hostRules) {\n for (const hostRule of config.hostRules) {\n addHostRule(hostRule);\n }\n }\n const { isMigrated, migratedConfig } = migrateConfig(config);\n if (isMigrated) {\n logger.warn(\n {\n oldConfig: config,\n newConfig: migratedConfig,\n },\n 'Config migration necessary',\n );\n const changedObjects = diffLines(\n JSON.stringify(config, null, 2),\n JSON.stringify(migratedConfig, null, 2),\n { ignoreWhitespace: false, newlineIsToken: false },\n );\n const added = styleText('green', '+ ');\n const removed = styleText('red', '- ');\n const msg = changedObjects\n .flatMap((part) => {\n let linePrefix: string;\n if (part.added) {\n linePrefix = added;\n } else if (part.removed) {\n linePrefix = removed;\n } else {\n linePrefix = ' ';\n }\n return part.value\n .split('\\n')\n .filter(isNonEmptyStringAndNotWhitespace)\n .map((line) =>\n line.replace(regEx(/^(?<ws> *)/), `${linePrefix}$<ws>`),\n );\n })\n .join('\\n');\n logger.warn(`Config migration diff:\\n${msg}`);\n if (strict) {\n returnVal = 1;\n }\n }\n const massagedConfig = massageConfig(migratedConfig);\n const res = await validateConfig(configType, massagedConfig, isPreset);\n if (res.errors.length) {\n logger.error(\n { file: desc, errors: res.errors },\n 'Found errors in configuration',\n );\n returnVal = 1;\n }\n if (res.warnings.length) {\n logger.warn(\n { file: desc, warnings: res.warnings },\n 'Found errors in configuration',\n );\n returnVal = 1;\n }\n}\n\ninterface PackageJson {\n renovate?: RenovateConfig;\n 'renovate-config'?: Record<string, RenovateConfig>;\n}\n\n(async () => {\n await partiallyGlobalInitialize();\n\n const program = new Command('renovate-config-validator')\n .summary('Validate Renovate configuration files')\n .description(\n `Validate your Renovate configuration (repo config, shared presets or global configuration) files\\n` +\n // oxlint-disable-next-line renovate/no-hardcoded-docs-url -- CLI help text, no config available\n 'If no [config-files...] are given, renovate-config-validator will look at the default config file locations (https://docs.renovatebot.com/configuration-options/)',\n )\n .addHelpText(\n 'after',\n // oxlint-disable-next-line renovate/no-hardcoded-docs-url -- CLI help text, no config available\n `\nWhen specifying [config-files...], Renovate will treat them as global self-hosted configuration files. You can disable this behaviour with --no-global\n\nExamples:\n\n $ renovate-config-validator\n $ renovate-config-validator --strict\n $ renovate-config-validator first_config.json\n $ renovate-config-validator --strict config.js\n $ renovate-config-validator --no-global renovate.json5\n $ env RENOVATE_CONFIG_FILE=obscure-name.json renovate-config-validator\n\nGlobal configuration:\n\nIf you have specified global self-hosted configuration (https://docs.renovatebot.com/self-hosted-configuration/) in environment variables or in a \\`config.js\\`, this will be detected:\n\n $ env RENOVATE_ALLOWED_ENV='[\"GO*\"]' renovate-config-validator\n # if passing the filename, make sure it's not validating as a global config\n $ env RENOVATE_ALLOWED_ENV='[\"GO*\"]' renovate-config-validator --no-global renovate.json`,\n )\n .argument('[config-files...]')\n .version(pkg.version, '-v, --version')\n .option(\n '--strict',\n 'Fail command if any configuration warnings, errors, or a migration is needed',\n )\n .option(\n '--no-global',\n 'When specifying [config-files], do not treat them as global self-hosted configuration file(s)',\n true,\n )\n // allow us to manage the exit code\n .exitOverride();\n\n program.action(async (files, opts) => {\n const strict = opts.strict ?? false;\n let filesValidated = 0;\n\n if (files.length) {\n let isGlobalConfig = true;\n if (opts.global === false) {\n isGlobalConfig = false;\n }\n const configType = isGlobalConfig ? 'global' : 'repo';\n for (const file of files) {\n try {\n if (!(await pathExists(file))) {\n returnVal = 1;\n logger.error({ file }, 'File does not exist');\n break;\n }\n const parsedContent = await getParsedContent(file);\n try {\n logger.info(`Validating ${file} as ${configType} config`);\n await validate(configType, file, parsedContent, strict);\n } catch (err) {\n logger.warn({ file, err }, 'File is not valid Renovate config');\n returnVal = 1;\n }\n } catch (err) {\n logger.warn({ file, err }, 'File could not be parsed');\n returnVal = 1;\n }\n\n filesValidated++;\n }\n } else {\n for (const file of getConfigFileNames().filter(\n (name) => name !== 'package.json',\n )) {\n try {\n if (!(await pathExists(file))) {\n continue;\n }\n const parsedContent = await getParsedContent(file);\n try {\n logger.info(`Validating ${file}`);\n await validate('repo', file, parsedContent, strict);\n } catch (err) {\n logger.warn({ file, err }, 'File is not valid Renovate config');\n returnVal = 1;\n }\n } catch (err) {\n logger.warn({ file, err }, 'File could not be parsed');\n returnVal = 1;\n }\n\n filesValidated++;\n }\n try {\n const pkgJson = JSON.parse(\n await readFile('package.json', 'utf8'),\n ) as PackageJson;\n if (pkgJson.renovate) {\n logger.info(`Validating package.json > renovate`);\n await validate(\n 'repo',\n 'package.json > renovate',\n pkgJson.renovate,\n strict,\n );\n\n filesValidated++;\n }\n if (pkgJson['renovate-config']) {\n logger.info(`Validating package.json > renovate-config`);\n for (const presetConfig of Object.values(\n pkgJson['renovate-config'],\n )) {\n await validate(\n 'repo',\n 'package.json > renovate-config',\n presetConfig,\n strict,\n true,\n );\n\n filesValidated++;\n }\n }\n } catch {\n // ignore\n }\n try {\n const env = getEnv();\n const fileConfig = await getFileConfig(env);\n if (!dequal(fileConfig, {})) {\n const file = env.RENOVATE_CONFIG_FILE ?? 'config.js';\n logger.info(`Validating ${file}`);\n try {\n await validate('global', file, fileConfig, strict);\n } catch (err) {\n logger.error({ file, err }, 'File is not valid Renovate config');\n returnVal = 1;\n }\n filesValidated++;\n }\n } catch {\n // ignore\n }\n }\n if (returnVal === 0 && filesValidated) {\n logger.info(\n `Config validated successfully against ${filesValidated} file(s)`,\n );\n } else if (!filesValidated) {\n logger.warn(`No files to perform configuration validation against`);\n }\n // Use exitCode (not process.exit) so async log streams can flush\n process.exitCode = returnVal;\n });\n\n await program.parseAsync();\n})().catch((e) => {\n // Commander throws an error at the end of Action execution i.e. as part of the `help` and `version` commands, and so we don't want to return an error code in this case\n if (\n e instanceof CommanderError &&\n (e.code === 'commander.helpDisplayed' || e.code === 'commander.version')\n ) {\n return;\n }\n\n // oxlint-disable-next-line no-console -- intentional: display critical error on CLI\n console.error(e);\n process.exit(99);\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;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,CAAC,OAAO,MAAM;CAEhB,IACE,aAAa,mBACZ,EAAE,SAAS,6BAA6B,EAAE,SAAS,sBAEpD;CAIF,QAAQ,MAAM,CAAC;CACf,QAAQ,KAAK,EAAE;AACjB,CAAC"}
|
|
@@ -23,7 +23,7 @@ const globalConfigOptionDefaults = {
|
|
|
23
23
|
"detectHostRulesFromEnv": false,
|
|
24
24
|
"dockerChildPrefix": "renovate_",
|
|
25
25
|
"dockerMaxPages": 20,
|
|
26
|
-
"dockerSidecarImage": "ghcr.io/renovatebot/base-image:13.75.
|
|
26
|
+
"dockerSidecarImage": "ghcr.io/renovatebot/base-image:13.75.1",
|
|
27
27
|
"dockerUser": "12021",
|
|
28
28
|
"executionTimeout": 15,
|
|
29
29
|
"exposeAllEnv": false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-config-option-defaults.generated.js","names":[],"sources":["../lib/global-config-option-defaults.generated.ts"],"sourcesContent":["\nexport const globalConfigOptionDefaults: Record<string, unknown> = {\n \"allowCustomCrateRegistries\": false,\n \"allowedCommands\": [],\n \"allowedEnv\": [],\n \"allowedHeaders\": [\n \"X-*\"\n ],\n \"allowedUnsafeExecutions\": [],\n \"allowPlugins\": false,\n \"allowScripts\": false,\n \"allowShellExecutorForPostUpgradeCommands\": false,\n \"autodiscover\": false,\n \"bbUseDevelopmentBranch\": false,\n \"binarySource\": \"install\",\n \"cacheHardTtlMinutes\": 10080,\n \"cachePrivatePackages\": false,\n \"cacheTtlOverride\": {},\n \"checkedBranches\": [],\n \"configValidationError\": false,\n \"customEnvVariables\": {},\n \"deleteAdditionalConfigFile\": false,\n \"deleteConfigFile\": false,\n \"detectGlobalManagerConfig\": false,\n \"detectHostRulesFromEnv\": false,\n \"dockerChildPrefix\": \"renovate_\",\n \"dockerMaxPages\": 20,\n \"dockerSidecarImage\": \"ghcr.io/renovatebot/base-image:13.75.
|
|
1
|
+
{"version":3,"file":"global-config-option-defaults.generated.js","names":[],"sources":["../lib/global-config-option-defaults.generated.ts"],"sourcesContent":["\nexport const globalConfigOptionDefaults: Record<string, unknown> = {\n \"allowCustomCrateRegistries\": false,\n \"allowedCommands\": [],\n \"allowedEnv\": [],\n \"allowedHeaders\": [\n \"X-*\"\n ],\n \"allowedUnsafeExecutions\": [],\n \"allowPlugins\": false,\n \"allowScripts\": false,\n \"allowShellExecutorForPostUpgradeCommands\": false,\n \"autodiscover\": false,\n \"bbUseDevelopmentBranch\": false,\n \"binarySource\": \"install\",\n \"cacheHardTtlMinutes\": 10080,\n \"cachePrivatePackages\": false,\n \"cacheTtlOverride\": {},\n \"checkedBranches\": [],\n \"configValidationError\": false,\n \"customEnvVariables\": {},\n \"deleteAdditionalConfigFile\": false,\n \"deleteConfigFile\": false,\n \"detectGlobalManagerConfig\": false,\n \"detectHostRulesFromEnv\": false,\n \"dockerChildPrefix\": \"renovate_\",\n \"dockerMaxPages\": 20,\n \"dockerSidecarImage\": \"ghcr.io/renovatebot/base-image:13.75.1\",\n \"dockerUser\": \"12021\",\n \"executionTimeout\": 15,\n \"exposeAllEnv\": false,\n \"forceCli\": true,\n \"forkCreation\": true,\n \"githubTokenWarn\": true,\n \"gitNoVerify\": [\n \"commit\",\n \"push\"\n ],\n \"gitTimeout\": 0,\n \"gitUrl\": \"default\",\n \"httpCacheTtlDays\": 90,\n \"ignorePrAuthor\": false,\n \"includeMirrors\": false,\n \"inheritConfig\": false,\n \"inheritConfigFileName\": \"org-inherited-config.json\",\n \"inheritConfigRepoName\": \"{{parentOrg}}/renovate-config\",\n \"inheritConfigStrict\": false,\n \"mergeConfidenceDatasources\": [\n \"go\",\n \"maven\",\n \"npm\",\n \"nuget\",\n \"packagist\",\n \"pypi\",\n \"rubygems\"\n ],\n \"mergeConfidenceEndpoint\": \"https://developer.mend.io/\",\n \"migratePresets\": {},\n \"onboardingBranch\": \"renovate/configure\",\n \"onboardingConfig\": {\n \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\"\n },\n \"onboardingConfigFileName\": \"renovate.json\",\n \"onboardingNoDeps\": \"auto\",\n \"onboardingPrTitle\": \"Configure Renovate\",\n \"onboardingRebaseCheckbox\": false,\n \"optimizeForDisabled\": false,\n \"persistRepoData\": false,\n \"platform\": \"github\",\n \"prCacheSyncMaxPages\": 100,\n \"prCommitsPerRunLimit\": 0,\n \"presetCachePersistence\": false,\n \"processEnv\": {},\n \"productLinks\": {\n \"documentation\": \"https://docs.renovatebot.com/\",\n \"help\": \"https://github.com/renovatebot/renovate/discussions\",\n \"homepage\": \"https://github.com/renovatebot/renovate\"\n },\n \"reportFormatting\": false,\n \"repositoryCache\": \"disabled\",\n \"repositoryCacheForceLocal\": false,\n \"repositoryCacheType\": \"local\",\n \"requireConfig\": \"required\",\n \"s3PathStyle\": false,\n \"secrets\": {},\n \"unicodeEmoji\": true,\n \"useCloudMetadataServices\": true,\n \"userAgent\": \"Renovate/{{renovateVersion}} (https://github.com/renovatebot/renovate)\",\n \"variables\": {}\n};\n"],"mappings":";AACA,MAAa,6BAAsD;CACjE,8BAA8B;CAC9B,mBAAmB,CAAC;CACpB,cAAc,CAAC;CACf,kBAAkB,CAChB,KACF;CACA,2BAA2B,CAAC;CAC5B,gBAAgB;CAChB,gBAAgB;CAChB,4CAA4C;CAC5C,gBAAgB;CAChB,0BAA0B;CAC1B,gBAAgB;CAChB,uBAAuB;CACvB,wBAAwB;CACxB,oBAAoB,CAAC;CACrB,mBAAmB,CAAC;CACpB,yBAAyB;CACzB,sBAAsB,CAAC;CACvB,8BAA8B;CAC9B,oBAAoB;CACpB,6BAA6B;CAC7B,0BAA0B;CAC1B,qBAAqB;CACrB,kBAAkB;CAClB,sBAAsB;CACtB,cAAc;CACd,oBAAoB;CACpB,gBAAgB;CAChB,YAAY;CACZ,gBAAgB;CAChB,mBAAmB;CACnB,eAAe,CACb,UACA,MACF;CACA,cAAc;CACd,UAAU;CACV,oBAAoB;CACpB,kBAAkB;CAClB,kBAAkB;CAClB,iBAAiB;CACjB,yBAAyB;CACzB,yBAAyB;CACzB,uBAAuB;CACvB,8BAA8B;EAC5B;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,2BAA2B;CAC3B,kBAAkB,CAAC;CACnB,oBAAoB;CACpB,oBAAoB,EAClB,WAAW,oDACb;CACA,4BAA4B;CAC5B,oBAAoB;CACpB,qBAAqB;CACrB,4BAA4B;CAC5B,uBAAuB;CACvB,mBAAmB;CACnB,YAAY;CACZ,uBAAuB;CACvB,wBAAwB;CACxB,0BAA0B;CAC1B,cAAc,CAAC;CACf,gBAAgB;EACd,iBAAiB;EACjB,QAAQ;EACR,YAAY;CACd;CACA,oBAAoB;CACpB,mBAAmB;CACnB,6BAA6B;CAC7B,uBAAuB;CACvB,iBAAiB;CACjB,eAAe;CACf,WAAW,CAAC;CACZ,gBAAgB;CAChB,4BAA4B;CAC5B,aAAa;CACb,aAAa,CAAC;AAChB"}
|