renovate 44.39.1 → 44.39.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/validation.js +2 -2
- package/dist/config/validation.js.map +1 -1
- package/dist/logger/once.js +1 -1
- package/dist/logger/once.js.map +1 -1
- package/dist/logger/renovate-logger.js +1 -1
- package/dist/logger/renovate-logger.js.map +1 -1
- package/dist/modules/datasource/bitrise/index.js +1 -1
- package/dist/modules/datasource/bitrise/index.js.map +1 -1
- package/dist/modules/datasource/cpan/index.js +1 -1
- package/dist/modules/datasource/cpan/index.js.map +1 -1
- package/dist/modules/datasource/crate/index.js +1 -1
- package/dist/modules/datasource/crate/index.js.map +1 -1
- package/dist/modules/datasource/dart/index.js +1 -1
- package/dist/modules/datasource/dart/index.js.map +1 -1
- package/dist/modules/datasource/dart-version/index.js +1 -1
- package/dist/modules/datasource/dart-version/index.js.map +1 -1
- package/dist/modules/datasource/deb/index.js +1 -1
- package/dist/modules/datasource/deb/index.js.map +1 -1
- package/dist/modules/datasource/deno/index.js +1 -1
- package/dist/modules/datasource/deno/index.js.map +1 -1
- package/dist/modules/datasource/docker/common.js +1 -1
- package/dist/modules/datasource/docker/common.js.map +1 -1
- package/dist/modules/datasource/docker/index.js +5 -5
- package/dist/modules/datasource/docker/index.js.map +1 -1
- package/dist/modules/datasource/flutter-version/index.js +1 -1
- package/dist/modules/datasource/flutter-version/index.js.map +1 -1
- package/dist/modules/datasource/git-refs/index.js +1 -1
- package/dist/modules/datasource/git-refs/index.js.map +1 -1
- package/dist/modules/datasource/gitlab-packages/index.js +1 -1
- package/dist/modules/datasource/gitlab-packages/index.js.map +1 -1
- package/dist/modules/datasource/gitlab-releases/index.js +1 -1
- package/dist/modules/datasource/gitlab-releases/index.js.map +1 -1
- package/dist/modules/datasource/go/index.js +1 -1
- package/dist/modules/datasource/go/index.js.map +1 -1
- package/dist/modules/datasource/go/releases-direct.js +2 -2
- package/dist/modules/datasource/go/releases-direct.js.map +1 -1
- package/dist/modules/datasource/go/releases-goproxy.js +1 -1
- package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
- package/dist/modules/datasource/golang-version/index.js +1 -1
- package/dist/modules/datasource/golang-version/index.js.map +1 -1
- package/dist/modules/datasource/gradle-version/index.js +1 -1
- package/dist/modules/datasource/gradle-version/index.js.map +1 -1
- package/dist/modules/datasource/helm/index.js +1 -1
- package/dist/modules/datasource/helm/index.js.map +1 -1
- package/dist/modules/datasource/jenkins-plugins/index.js +1 -1
- package/dist/modules/datasource/jenkins-plugins/index.js.map +1 -1
- package/dist/modules/datasource/jsr/index.js +1 -1
- package/dist/modules/datasource/jsr/index.js.map +1 -1
- package/dist/modules/datasource/maven/index.js +2 -2
- package/dist/modules/datasource/maven/index.js.map +1 -1
- package/dist/modules/datasource/node-version/index.js +1 -1
- package/dist/modules/datasource/node-version/index.js.map +1 -1
- package/dist/modules/datasource/npm/index.js +1 -1
- package/dist/modules/datasource/npm/index.js.map +1 -1
- package/dist/modules/datasource/npm/npmrc.js +1 -1
- package/dist/modules/datasource/npm/npmrc.js.map +1 -1
- package/dist/modules/datasource/nuget/index.js +1 -1
- package/dist/modules/datasource/nuget/index.js.map +1 -1
- package/dist/modules/datasource/nuget/v3.js +1 -1
- package/dist/modules/datasource/nuget/v3.js.map +1 -1
- package/dist/modules/datasource/orb/index.js +1 -1
- package/dist/modules/datasource/orb/index.js.map +1 -1
- package/dist/modules/datasource/packagist/index.js +1 -1
- package/dist/modules/datasource/packagist/index.js.map +1 -1
- package/dist/modules/datasource/pod/index.js +1 -1
- package/dist/modules/datasource/pod/index.js.map +1 -1
- package/dist/modules/datasource/python-version/index.js +1 -1
- package/dist/modules/datasource/python-version/index.js.map +1 -1
- package/dist/modules/datasource/repology/index.js +1 -1
- package/dist/modules/datasource/repology/index.js.map +1 -1
- package/dist/modules/datasource/rubygems/index.js +1 -1
- package/dist/modules/datasource/rubygems/index.js.map +1 -1
- package/dist/modules/datasource/sbt-package/index.js +1 -1
- package/dist/modules/datasource/sbt-package/index.js.map +1 -1
- package/dist/modules/datasource/sbt-plugin/index.js +1 -1
- package/dist/modules/datasource/sbt-plugin/index.js.map +1 -1
- package/dist/modules/datasource/terraform-module/index.js +1 -1
- package/dist/modules/datasource/terraform-module/index.js.map +1 -1
- package/dist/modules/datasource/terraform-provider/index.js +3 -3
- package/dist/modules/datasource/terraform-provider/index.js.map +1 -1
- package/dist/modules/manager/gomod/update.js +2 -2
- package/dist/modules/manager/gomod/update.js.map +1 -1
- package/dist/modules/manager/kustomize/artifacts.js +1 -1
- package/dist/modules/manager/kustomize/artifacts.js.map +1 -1
- package/dist/modules/manager/npm/extract/common/package-file.js +1 -1
- package/dist/modules/manager/npm/extract/common/package-file.js.map +1 -1
- package/dist/modules/manager/npm/extract/post/locked-versions.js +1 -1
- package/dist/modules/manager/npm/extract/post/locked-versions.js.map +1 -1
- package/dist/modules/manager/npm/post-update/index.js +3 -3
- package/dist/modules/manager/npm/post-update/index.js.map +1 -1
- package/dist/modules/manager/npm/post-update/npm.js +1 -1
- package/dist/modules/manager/npm/post-update/npm.js.map +1 -1
- package/dist/modules/manager/npm/post-update/pnpm.js +1 -1
- package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
- package/dist/modules/manager/npm/post-update/yarn.js +1 -1
- package/dist/modules/manager/npm/post-update/yarn.js.map +1 -1
- package/dist/modules/manager/npm/update/locked-dependency/package-lock/index.js +1 -1
- package/dist/modules/manager/npm/update/locked-dependency/package-lock/index.js.map +1 -1
- package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/get-locked.js +2 -2
- package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/get-locked.js.map +1 -1
- package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/index.js +1 -1
- package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/index.js.map +1 -1
- package/dist/modules/manager/pep621/processors/uv.js +2 -2
- package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
- package/dist/modules/manager/terraform/extractors/others/modules.js +1 -1
- package/dist/modules/manager/terraform/extractors/others/modules.js.map +1 -1
- package/dist/modules/manager/terraform/extractors/others/providers.js +1 -1
- package/dist/modules/manager/terraform/extractors/others/providers.js.map +1 -1
- package/dist/modules/manager/terraform/extractors/resources/generic-docker-image-ref.js +1 -1
- package/dist/modules/manager/terraform/extractors/resources/generic-docker-image-ref.js.map +1 -1
- package/dist/modules/manager/terraform/extractors/resources/helm-release.js +1 -1
- package/dist/modules/manager/terraform/extractors/resources/helm-release.js.map +1 -1
- package/dist/modules/manager/terraform/lockfile/index.js +1 -1
- package/dist/modules/manager/terraform/lockfile/index.js.map +1 -1
- package/dist/util/git/index.js +1 -1
- package/dist/util/git/index.js.map +1 -1
- package/dist/workers/repository/index.js +1 -1
- package/dist/workers/repository/index.js.map +1 -1
- package/dist/workers/repository/process/lookup/filter.js +3 -3
- package/dist/workers/repository/process/lookup/filter.js.map +1 -1
- package/package.json +1 -1
- package/renovate-schema.json +2 -2
|
@@ -149,7 +149,7 @@ async function validateConfig(configType, config, isPreset, parentPath) {
|
|
|
149
149
|
let warnings = [];
|
|
150
150
|
for (const [key, val] of Object.entries(config)) {
|
|
151
151
|
const currentPath = parentPath ? `${parentPath}.${key}` : key;
|
|
152
|
-
/* v8 ignore next
|
|
152
|
+
/* v8 ignore next -- TODO: add test */
|
|
153
153
|
if (key === "__proto__") {
|
|
154
154
|
errors.push({
|
|
155
155
|
topic: ConfigValidationTopic.Security,
|
|
@@ -643,7 +643,7 @@ async function validateConfig(configType, config, isPreset, parentPath) {
|
|
|
643
643
|
* Basic validation for global config options
|
|
644
644
|
*/
|
|
645
645
|
async function validateGlobalConfig(key, val, type, warnings, errors, currentPath, config) {
|
|
646
|
-
/* v8 ignore next
|
|
646
|
+
/* v8 ignore next -- not testable yet */
|
|
647
647
|
if (getDeprecationMessage(key)) warnings.push({
|
|
648
648
|
topic: ConfigValidationTopic.Deprecation,
|
|
649
649
|
message: getDeprecationMessage(key)
|
|
@@ -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 isNonEmptyStringAndNotWhitespace,\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 { clone } from '../util/clone.ts';\nimport { getToolConfig } from '../util/exec/containerbase.ts';\nimport { isConstraintName, isToolName } from '../util/exec/types.ts';\nimport { isValidCommitTrailer } from '../util/git/commit-trailers.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 { isRelativePresetReference, 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 { ConfigValidationTopic } from './validation-helpers/types.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+\\]$/);\nconst repoEntryRe = regEx(/^repositories\\[\\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\n/**\n * Removes every relative preset reference from a deep copy of the given\n * `packageRules` entry, at any nesting depth.\n *\n * Relative references are only resolvable while the preset which contains them\n * is fetched, so they must not be passed to `resolveConfigPresets()` during\n * validation. They are still syntax checked by the `extends` validation.\n */\nfunction stripRelativePresets(packageRule: RenovateConfig): {\n rule: RenovateConfig;\n hasRelativePresets: boolean;\n} {\n const rule = clone(packageRule);\n const hasRelativePresets = stripRelativePresetsFromValue(rule);\n return { rule, hasRelativePresets };\n}\n\nfunction stripRelativePresetsFromValue(value: unknown): boolean {\n if (isArray(value)) {\n let stripped = false;\n for (const element of value) {\n stripped = stripRelativePresetsFromValue(element) || stripped;\n }\n return stripped;\n }\n\n if (!isPlainObject(value)) {\n return false;\n }\n\n let stripped = false;\n for (const [key, val] of Object.entries(value)) {\n if (key === 'extends' && isArray(val)) {\n const remaining = val.filter(\n (preset) => !(isString(preset) && isRelativePresetReference(preset)),\n );\n if (remaining.length !== val.length) {\n value[key] = remaining;\n stripped = true;\n }\n continue;\n }\n\n stripped = stripRelativePresetsFromValue(val) || stripped;\n }\n return stripped;\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: ConfigValidationTopic.Security,\n message: '__proto__',\n });\n continue;\n }\n if (\n parentPath &&\n parentPath !== 'onboardingConfig' &&\n !repoEntryRe.test(parentPath) &&\n topLevelObjects.includes(key)\n ) {\n errors.push({\n topic: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.Deprecation,\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: ConfigValidationTopic.Error,\n message: `Invalid template in config path: ${currentPath}`,\n });\n }\n }\n const parentName =\n parentPath && repoEntryRe.test(parentPath)\n ? '.'\n : 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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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,\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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n }\n if (!subval.includes('{{')) {\n try {\n parsePreset(subval);\n } catch {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: preset \"${subval}\" is not valid`,\n });\n }\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: preset value is not a string`,\n });\n }\n }\n }\n\n if (key === 'commitTrailers') {\n for (const subval of val) {\n if (!isValidCommitTrailer(subval)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid commit trailer: \\`${JSON.stringify(\n subval,\n )}\\`. Must be a single-line string in the form \\`Key: value\\`, where the key contains only letters, digits and \\`-\\`.`,\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 { rule, hasRelativePresets } =\n stripRelativePresets(packageRule);\n const { config: resolved } = await resolveConfigPresets(\n rule,\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 if (hasRelativePresets) {\n // the stripped relative preset may still provide the\n // missing selectors, so this cannot be an error\n const message = `${currentPath}[${subIndex}]: this rule extends a relative preset that cannot be resolved during validation, so its selectors could not be checked. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message,\n });\n } else {\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: ConfigValidationTopic.Error,\n message,\n });\n }\n }\n if (\n // the stripped relative preset legitimately provides\n // the non-selector field\n !hasRelativePresets &&\n selectorLength === Object.keys(resolvedRule).length\n ) {\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: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n message,\n });\n }\n }\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n message: `Each Custom Manager must contain a non-empty customType string`,\n });\n } else {\n errors.push({\n topic: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n message: `${currentPath}: ${key} should be inside a \\`packageRule\\` only`,\n });\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}=${v}\\`: \\`${v}\\` is not a valid versioning scheme`,\n });\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.Deprecation,\n message: getDeprecationMessage(key)!,\n });\n }\n\n if (key === 'binarySource' && val === 'docker') {\n warnings.push({\n topic: ConfigValidationTopic.Deprecation,\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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n message: `reportType '${val}' requires a configured reportPath`,\n });\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.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: ConfigValidationTopic.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) && key !== 'repositories') {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n 'global',\n subval,\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: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n message: `Invalid value \\`${value}\\` for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n } else if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isPlainObject(subval)) {\n if (!isNonEmptyString(subval.repository)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}[${subIndex}]: each repository object entry must have a \\`repository\\` string property`,\n });\n }\n const { repository: _, ...repoEntryConfig } = subval;\n // Each repository object entry is validated as its own global config, so it does not automatically see the top-level `allowedEnv`/`allowedHeaders`.\n // Inherit them (unless the entry sets its own) so that entry-level `env`/`headers` are validated against the allowlists, rather than an empty one.\n const subValidation = await validateConfig(\n 'global',\n {\n ...(config.allowedEnv ? { allowedEnv: config.allowedEnv } : {}),\n ...(config.allowedHeaders\n ? { allowedHeaders: config.allowedHeaders }\n : {}),\n ...repoEntryConfig,\n },\n false,\n `${currentPath}[${subIndex}]`,\n );\n warnings.push(...subValidation.warnings);\n errors.push(...subValidation.errors);\n } else if (isString(subval)) {\n if (!isNonEmptyStringAndNotWhitespace(subval)) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}[${subIndex}]: each repository string entry entry must be a non-empty string`,\n });\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}[${subIndex}]: invalid type, should be either a string or an object`,\n });\n }\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n });\n }\n }\n } else {\n const res = validatePlainObject(val);\n if (res !== true) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${res}\\` configuration: value must be a string.`,\n });\n }\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,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;AACxC,MAAM,cAAc,MAAM,uBAAuB;AAEjD,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;CAG3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L;OACK;GACL,MAAM,MAAM,oBAAoB,GAAG;GACnC,IAAI,QAAQ,MACV,SAAS,KAAK;IACZ,OAAO,sBAAsB;IAC7B,SAAS,aAAa,YAAY,GAAG,IAAI;GAC3C,CAAC;EAEL;OAEA,SAAS,KAAK;GACZ,OAAO,sBAAsB;GAC7B,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"}
|
|
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 isNonEmptyStringAndNotWhitespace,\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 { clone } from '../util/clone.ts';\nimport { getToolConfig } from '../util/exec/containerbase.ts';\nimport { isConstraintName, isToolName } from '../util/exec/types.ts';\nimport { isValidCommitTrailer } from '../util/git/commit-trailers.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 { isRelativePresetReference, 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 { ConfigValidationTopic } from './validation-helpers/types.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+\\]$/);\nconst repoEntryRe = regEx(/^repositories\\[\\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\n/**\n * Removes every relative preset reference from a deep copy of the given\n * `packageRules` entry, at any nesting depth.\n *\n * Relative references are only resolvable while the preset which contains them\n * is fetched, so they must not be passed to `resolveConfigPresets()` during\n * validation. They are still syntax checked by the `extends` validation.\n */\nfunction stripRelativePresets(packageRule: RenovateConfig): {\n rule: RenovateConfig;\n hasRelativePresets: boolean;\n} {\n const rule = clone(packageRule);\n const hasRelativePresets = stripRelativePresetsFromValue(rule);\n return { rule, hasRelativePresets };\n}\n\nfunction stripRelativePresetsFromValue(value: unknown): boolean {\n if (isArray(value)) {\n let stripped = false;\n for (const element of value) {\n stripped = stripRelativePresetsFromValue(element) || stripped;\n }\n return stripped;\n }\n\n if (!isPlainObject(value)) {\n return false;\n }\n\n let stripped = false;\n for (const [key, val] of Object.entries(value)) {\n if (key === 'extends' && isArray(val)) {\n const remaining = val.filter(\n (preset) => !(isString(preset) && isRelativePresetReference(preset)),\n );\n if (remaining.length !== val.length) {\n value[key] = remaining;\n stripped = true;\n }\n continue;\n }\n\n stripped = stripRelativePresetsFromValue(val) || stripped;\n }\n return stripped;\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 -- TODO: add test */\n if (key === '__proto__') {\n errors.push({\n topic: ConfigValidationTopic.Security,\n message: '__proto__',\n });\n continue;\n }\n if (\n parentPath &&\n parentPath !== 'onboardingConfig' &&\n !repoEntryRe.test(parentPath) &&\n topLevelObjects.includes(key)\n ) {\n errors.push({\n topic: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.Deprecation,\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: ConfigValidationTopic.Error,\n message: `Invalid template in config path: ${currentPath}`,\n });\n }\n }\n const parentName =\n parentPath && repoEntryRe.test(parentPath)\n ? '.'\n : 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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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,\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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n }\n if (!subval.includes('{{')) {\n try {\n parsePreset(subval);\n } catch {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: preset \"${subval}\" is not valid`,\n });\n }\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: preset value is not a string`,\n });\n }\n }\n }\n\n if (key === 'commitTrailers') {\n for (const subval of val) {\n if (!isValidCommitTrailer(subval)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid commit trailer: \\`${JSON.stringify(\n subval,\n )}\\`. Must be a single-line string in the form \\`Key: value\\`, where the key contains only letters, digits and \\`-\\`.`,\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 { rule, hasRelativePresets } =\n stripRelativePresets(packageRule);\n const { config: resolved } = await resolveConfigPresets(\n rule,\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 if (hasRelativePresets) {\n // the stripped relative preset may still provide the\n // missing selectors, so this cannot be an error\n const message = `${currentPath}[${subIndex}]: this rule extends a relative preset that cannot be resolved during validation, so its selectors could not be checked. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message,\n });\n } else {\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: ConfigValidationTopic.Error,\n message,\n });\n }\n }\n if (\n // the stripped relative preset legitimately provides\n // the non-selector field\n !hasRelativePresets &&\n selectorLength === Object.keys(resolvedRule).length\n ) {\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: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n message,\n });\n }\n }\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n message: `Each Custom Manager must contain a non-empty customType string`,\n });\n } else {\n errors.push({\n topic: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n message: `${currentPath}: ${key} should be inside a \\`packageRule\\` only`,\n });\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}=${v}\\`: \\`${v}\\` is not a valid versioning scheme`,\n });\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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 -- not testable yet */\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: ConfigValidationTopic.Deprecation,\n message: getDeprecationMessage(key)!,\n });\n }\n\n if (key === 'binarySource' && val === 'docker') {\n warnings.push({\n topic: ConfigValidationTopic.Deprecation,\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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n message: `reportType '${val}' requires a configured reportPath`,\n });\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.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: ConfigValidationTopic.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) && key !== 'repositories') {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n 'global',\n subval,\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: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n message: `Invalid value \\`${value}\\` for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n } else if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isPlainObject(subval)) {\n if (!isNonEmptyString(subval.repository)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}[${subIndex}]: each repository object entry must have a \\`repository\\` string property`,\n });\n }\n const { repository: _, ...repoEntryConfig } = subval;\n // Each repository object entry is validated as its own global config, so it does not automatically see the top-level `allowedEnv`/`allowedHeaders`.\n // Inherit them (unless the entry sets its own) so that entry-level `env`/`headers` are validated against the allowlists, rather than an empty one.\n const subValidation = await validateConfig(\n 'global',\n {\n ...(config.allowedEnv ? { allowedEnv: config.allowedEnv } : {}),\n ...(config.allowedHeaders\n ? { allowedHeaders: config.allowedHeaders }\n : {}),\n ...repoEntryConfig,\n },\n false,\n `${currentPath}[${subIndex}]`,\n );\n warnings.push(...subValidation.warnings);\n errors.push(...subValidation.errors);\n } else if (isString(subval)) {\n if (!isNonEmptyStringAndNotWhitespace(subval)) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}[${subIndex}]: each repository string entry entry must be a non-empty string`,\n });\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}[${subIndex}]: invalid type, should be either a string or an object`,\n });\n }\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.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: ConfigValidationTopic.Error,\n });\n }\n }\n } else {\n const res = validatePlainObject(val);\n if (res !== true) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${res}\\` configuration: value must be a string.`,\n });\n }\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,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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,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,sBAAsB;GAC/B,CAAC;EAEL;OACK;GACL,MAAM,MAAM,oBAAoB,GAAG;GACnC,IAAI,QAAQ,MACV,SAAS,KAAK;IACZ,OAAO,sBAAsB;IAC7B,SAAS,aAAa,YAAY,GAAG,IAAI;GAC3C,CAAC;EAEL;OAEA,SAAS,KAAK;GACZ,OAAO,sBAAsB;GAC7B,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/logger/once.js
CHANGED
|
@@ -30,7 +30,7 @@ function getCallSite(omitFn) {
|
|
|
30
30
|
const keys = /* @__PURE__ */ new Set();
|
|
31
31
|
function once(callback, omitFn = once, p1, p2) {
|
|
32
32
|
const callsite = getCallSite(omitFn);
|
|
33
|
-
/* v8 ignore next
|
|
33
|
+
/* v8 ignore next -- should not happen */
|
|
34
34
|
if (!callsite) return;
|
|
35
35
|
const key = `${callsite}|${hashParams(p1, p2)}`;
|
|
36
36
|
if (!keys.has(key)) {
|
package/dist/logger/once.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"once.js","names":[],"sources":["../../lib/logger/once.ts"],"sourcesContent":["// Do not static import `bunyan` here!\n// Otherwise otel can't instrument it.\nimport { createHash } from 'node:crypto';\nimport { stringify } from 'safe-stable-stringify';\n\ntype OmitFn = (...args: any[]) => any;\n\n// TODO: use `callsite` package instead?\n\n/**\n * Get the single frame of this function's callers stack.\n *\n * @param omitFn Starting from this function, stack frames will be ignored.\n * @returns The string containing file name, line number and column name.\n *\n * @example getCallSite() // => 'Object.<anonymous> (/path/to/file.js:10:15)'\n */\nfunction getCallSite(omitFn: OmitFn): string | null {\n const stackTraceLimitOrig = Error.stackTraceLimit;\n // We don't use `Error.captureStackTrace` directly, we simply restore it later.\n // oxlint-disable-next-line typescript/unbound-method\n const prepareStackTraceOrig = Error.prepareStackTrace;\n\n let result: string | null = null;\n try {\n const res: { stack: string[] } = { stack: [] };\n\n Error.stackTraceLimit = 1;\n Error.prepareStackTrace = (_err, stack) => stack;\n Error.captureStackTrace(res, omitFn);\n\n const [callsite] = res.stack;\n // v8 ignore else -- TODO: add test #40625\n if (callsite) {\n result = callsite.toString();\n }\n /* v8 ignore next
|
|
1
|
+
{"version":3,"file":"once.js","names":[],"sources":["../../lib/logger/once.ts"],"sourcesContent":["// Do not static import `bunyan` here!\n// Otherwise otel can't instrument it.\nimport { createHash } from 'node:crypto';\nimport { stringify } from 'safe-stable-stringify';\n\ntype OmitFn = (...args: any[]) => any;\n\n// TODO: use `callsite` package instead?\n\n/**\n * Get the single frame of this function's callers stack.\n *\n * @param omitFn Starting from this function, stack frames will be ignored.\n * @returns The string containing file name, line number and column name.\n *\n * @example getCallSite() // => 'Object.<anonymous> (/path/to/file.js:10:15)'\n */\nfunction getCallSite(omitFn: OmitFn): string | null {\n const stackTraceLimitOrig = Error.stackTraceLimit;\n // We don't use `Error.captureStackTrace` directly, we simply restore it later.\n // oxlint-disable-next-line typescript/unbound-method\n const prepareStackTraceOrig = Error.prepareStackTrace;\n\n let result: string | null = null;\n try {\n const res: { stack: string[] } = { stack: [] };\n\n Error.stackTraceLimit = 1;\n Error.prepareStackTrace = (_err, stack) => stack;\n Error.captureStackTrace(res, omitFn);\n\n const [callsite] = res.stack;\n // v8 ignore else -- TODO: add test #40625\n if (callsite) {\n result = callsite.toString();\n }\n /* v8 ignore next -- should not happen */\n } catch {\n // no-op\n } finally {\n Error.stackTraceLimit = stackTraceLimitOrig;\n Error.prepareStackTrace = prepareStackTraceOrig;\n }\n\n return result;\n}\n\nconst keys = new Set<string>();\n\nexport function once(\n callback: () => void,\n omitFn: OmitFn = once,\n p1: string | Record<string, any>,\n p2?: string,\n): void {\n const callsite = getCallSite(omitFn);\n\n /* v8 ignore next -- should not happen */\n if (!callsite) {\n return;\n }\n\n const paramsKey = hashParams(p1, p2);\n const key = `${callsite}|${paramsKey}`;\n\n if (!keys.has(key)) {\n keys.add(key);\n callback();\n }\n}\n\n/**\n * Before processing each repository,\n * all keys are supposed to be reset.\n */\nexport function reset(): void {\n keys.clear();\n}\n\nfunction hashParams(p1: string | Record<string, any>, p2?: string): string {\n const data =\n p2 === undefined ? stringify(p1) : `${stringify(p1)}|${stringify(p2)}`;\n return createHash('sha256').update(data).digest('hex');\n}\n"],"mappings":";;;;;;;;;;;AAiBA,SAAS,YAAY,QAA+B;CAClD,MAAM,sBAAsB,MAAM;CAGlC,MAAM,wBAAwB,MAAM;CAEpC,IAAI,SAAwB;CAC5B,IAAI;EACF,MAAM,MAA2B,EAAE,OAAO,CAAC,EAAE;EAE7C,MAAM,kBAAkB;EACxB,MAAM,qBAAqB,MAAM,UAAU;EAC3C,MAAM,kBAAkB,KAAK,MAAM;EAEnC,MAAM,CAAC,YAAY,IAAI;;EAEvB,IAAI,UACF,SAAS,SAAS,SAAS;CAG/B,QAAQ,CAER,UAAU;EACR,MAAM,kBAAkB;EACxB,MAAM,oBAAoB;CAC5B;CAEA,OAAO;AACT;AAEA,MAAM,uBAAO,IAAI,IAAY;AAE7B,SAAgB,KACd,UACA,SAAiB,MACjB,IACA,IACM;CACN,MAAM,WAAW,YAAY,MAAM;;CAGnC,IAAI,CAAC,UACH;CAIF,MAAM,MAAM,GAAG,SAAS,GADN,WAAW,IAAI,EACE;CAEnC,IAAI,CAAC,KAAK,IAAI,GAAG,GAAG;EAClB,KAAK,IAAI,GAAG;EACZ,SAAS;CACX;AACF;;;;;AAMA,SAAgB,QAAc;CAC5B,KAAK,MAAM;AACb;AAEA,SAAS,WAAW,IAAkC,IAAqB;CACzE,MAAM,OACJ,OAAO,KAAA,IAAY,UAAU,EAAE,IAAI,GAAG,UAAU,EAAE,EAAE,GAAG,UAAU,EAAE;CACrE,OAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,KAAK;AACvD"}
|
|
@@ -102,7 +102,7 @@ var RenovateLogger = class RenovateLogger {
|
|
|
102
102
|
let level = _level;
|
|
103
103
|
if (isString(msg)) {
|
|
104
104
|
const remappedLevel = getRemappedLevel(msg);
|
|
105
|
-
/* v8 ignore next
|
|
105
|
+
/* v8 ignore next -- not easily testable */
|
|
106
106
|
if (remappedLevel) {
|
|
107
107
|
meta.oldLevel = level;
|
|
108
108
|
level = remappedLevel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renovate-logger.js","names":["onceReset"],"sources":["../../lib/logger/renovate-logger.ts"],"sourcesContent":["import { isString } from '@sindresorhus/is';\nimport { LOGGER_NOT_INITIALIZED } from '../constants/error-messages.ts';\nimport { once, reset as onceReset } from './once.ts';\nimport { getRemappedLevel } from './remap.ts';\nimport type {\n BunyanLogLevel,\n BunyanLogger,\n BunyanSerializers,\n BunyanStream,\n Logger,\n} from './types.ts';\nimport { getMessage, toMeta } from './utils.ts';\nimport { withSanitizer } from './with-sanitizer.ts';\n\nconst loggerLevels: BunyanLogLevel[] = [\n 'trace',\n 'debug',\n 'info',\n 'warn',\n 'error',\n 'fatal',\n];\n\ntype LoggerFunction = (p1: string | Record<string, any>, p2?: string) => void;\n\nexport class RenovateLogger implements Logger {\n private readonly queue: (() => void)[] = [];\n readonly logger: Logger = { once: { reset: onceReset } } as any;\n readonly once = this.logger.once;\n private bunyanLogger: BunyanLogger | undefined;\n private uninitializedWarningFired: boolean;\n private context: string;\n private meta: Record<string, unknown>;\n\n constructor(\n context: string,\n meta: Record<string, unknown>,\n bunyanLogger?: BunyanLogger,\n ) {\n this.bunyanLogger = bunyanLogger;\n this.context = context;\n this.meta = meta;\n for (const level of loggerLevels) {\n this.logger[level] = this.logFactory(level) as never;\n this.logger.once[level] = this.logOnceFn(level);\n }\n this.uninitializedWarningFired = false;\n }\n\n trace(p1: string): void;\n trace(p1: Record<string, any>, p2?: string): void;\n trace(p1: string | Record<string, any>, p2?: string): void {\n this.log('trace', p1, p2);\n }\n\n debug(p1: string): void;\n debug(p1: Record<string, any>, p2?: string): void;\n debug(p1: string | Record<string, any>, p2?: string): void {\n this.log('debug', p1, p2);\n }\n\n info(p1: string): void;\n info(p1: Record<string, any>, p2?: string): void;\n info(p1: string | Record<string, any>, p2?: string): void {\n this.log('info', p1, p2);\n }\n\n warn(p1: string): void;\n warn(p1: Record<string, any>, p2?: string): void;\n warn(p1: string | Record<string, any>, p2?: string): void {\n this.log('warn', p1, p2);\n }\n\n error(p1: string): void;\n error(p1: Record<string, any>, p2?: string): void;\n error(p1: string | Record<string, any>, p2?: string): void {\n this.log('error', p1, p2);\n }\n\n fatal(p1: string): void;\n fatal(p1: Record<string, any>, p2?: string): void;\n fatal(p1: string | Record<string, any>, p2?: string): void {\n this.log('fatal', p1, p2);\n }\n\n addSerializers(serializers: BunyanSerializers): void {\n this.ensureLogger().addSerializers(serializers);\n }\n\n addStream(stream: BunyanStream): void {\n this.ensureLogger().addStream(withSanitizer(stream));\n }\n\n childLogger(): RenovateLogger {\n return new RenovateLogger(\n this.context,\n this.meta,\n this.ensureLogger().child({}),\n );\n }\n\n levels(name: 'stdout' | 'logfile', level: BunyanLogLevel): void {\n this.ensureLogger().levels(name, level);\n }\n\n get logContext(): string {\n return this.context;\n }\n\n set logContext(context: string) {\n this.context = context;\n }\n\n /**\n * For internal initialization only\n */\n set bunyan(bunyanLogger: BunyanLogger) {\n this.bunyanLogger = bunyanLogger;\n // flush any logs that were queued before bunyan logger was initialized\n for (const logFn of this.queue) {\n logFn();\n }\n this.queue.length = 0;\n }\n\n setMeta(obj: Record<string, unknown>): void {\n this.meta = { ...obj };\n }\n\n addMeta(obj: Record<string, unknown>): void {\n this.meta = { ...this.meta, ...obj };\n }\n\n removeMeta(fields: string[]): void {\n for (const key of Object.keys(this.meta)) {\n if (fields.includes(key)) {\n delete this.meta[key];\n }\n }\n }\n\n private ensureLogger(): BunyanLogger {\n if (!this.bunyanLogger) {\n throw new Error(LOGGER_NOT_INITIALIZED);\n }\n return this.bunyanLogger;\n }\n\n private logFactory(_level: BunyanLogLevel): LoggerFunction {\n return (p1: string | Record<string, any>, p2?: string): void => {\n const meta: Record<string, unknown> = {\n logContext: this.context,\n ...this.meta,\n ...toMeta(p1),\n };\n const msg = getMessage(p1, p2);\n let level = _level;\n\n if (isString(msg)) {\n const remappedLevel = getRemappedLevel(msg);\n /* v8 ignore next
|
|
1
|
+
{"version":3,"file":"renovate-logger.js","names":["onceReset"],"sources":["../../lib/logger/renovate-logger.ts"],"sourcesContent":["import { isString } from '@sindresorhus/is';\nimport { LOGGER_NOT_INITIALIZED } from '../constants/error-messages.ts';\nimport { once, reset as onceReset } from './once.ts';\nimport { getRemappedLevel } from './remap.ts';\nimport type {\n BunyanLogLevel,\n BunyanLogger,\n BunyanSerializers,\n BunyanStream,\n Logger,\n} from './types.ts';\nimport { getMessage, toMeta } from './utils.ts';\nimport { withSanitizer } from './with-sanitizer.ts';\n\nconst loggerLevels: BunyanLogLevel[] = [\n 'trace',\n 'debug',\n 'info',\n 'warn',\n 'error',\n 'fatal',\n];\n\ntype LoggerFunction = (p1: string | Record<string, any>, p2?: string) => void;\n\nexport class RenovateLogger implements Logger {\n private readonly queue: (() => void)[] = [];\n readonly logger: Logger = { once: { reset: onceReset } } as any;\n readonly once = this.logger.once;\n private bunyanLogger: BunyanLogger | undefined;\n private uninitializedWarningFired: boolean;\n private context: string;\n private meta: Record<string, unknown>;\n\n constructor(\n context: string,\n meta: Record<string, unknown>,\n bunyanLogger?: BunyanLogger,\n ) {\n this.bunyanLogger = bunyanLogger;\n this.context = context;\n this.meta = meta;\n for (const level of loggerLevels) {\n this.logger[level] = this.logFactory(level) as never;\n this.logger.once[level] = this.logOnceFn(level);\n }\n this.uninitializedWarningFired = false;\n }\n\n trace(p1: string): void;\n trace(p1: Record<string, any>, p2?: string): void;\n trace(p1: string | Record<string, any>, p2?: string): void {\n this.log('trace', p1, p2);\n }\n\n debug(p1: string): void;\n debug(p1: Record<string, any>, p2?: string): void;\n debug(p1: string | Record<string, any>, p2?: string): void {\n this.log('debug', p1, p2);\n }\n\n info(p1: string): void;\n info(p1: Record<string, any>, p2?: string): void;\n info(p1: string | Record<string, any>, p2?: string): void {\n this.log('info', p1, p2);\n }\n\n warn(p1: string): void;\n warn(p1: Record<string, any>, p2?: string): void;\n warn(p1: string | Record<string, any>, p2?: string): void {\n this.log('warn', p1, p2);\n }\n\n error(p1: string): void;\n error(p1: Record<string, any>, p2?: string): void;\n error(p1: string | Record<string, any>, p2?: string): void {\n this.log('error', p1, p2);\n }\n\n fatal(p1: string): void;\n fatal(p1: Record<string, any>, p2?: string): void;\n fatal(p1: string | Record<string, any>, p2?: string): void {\n this.log('fatal', p1, p2);\n }\n\n addSerializers(serializers: BunyanSerializers): void {\n this.ensureLogger().addSerializers(serializers);\n }\n\n addStream(stream: BunyanStream): void {\n this.ensureLogger().addStream(withSanitizer(stream));\n }\n\n childLogger(): RenovateLogger {\n return new RenovateLogger(\n this.context,\n this.meta,\n this.ensureLogger().child({}),\n );\n }\n\n levels(name: 'stdout' | 'logfile', level: BunyanLogLevel): void {\n this.ensureLogger().levels(name, level);\n }\n\n get logContext(): string {\n return this.context;\n }\n\n set logContext(context: string) {\n this.context = context;\n }\n\n /**\n * For internal initialization only\n */\n set bunyan(bunyanLogger: BunyanLogger) {\n this.bunyanLogger = bunyanLogger;\n // flush any logs that were queued before bunyan logger was initialized\n for (const logFn of this.queue) {\n logFn();\n }\n this.queue.length = 0;\n }\n\n setMeta(obj: Record<string, unknown>): void {\n this.meta = { ...obj };\n }\n\n addMeta(obj: Record<string, unknown>): void {\n this.meta = { ...this.meta, ...obj };\n }\n\n removeMeta(fields: string[]): void {\n for (const key of Object.keys(this.meta)) {\n if (fields.includes(key)) {\n delete this.meta[key];\n }\n }\n }\n\n private ensureLogger(): BunyanLogger {\n if (!this.bunyanLogger) {\n throw new Error(LOGGER_NOT_INITIALIZED);\n }\n return this.bunyanLogger;\n }\n\n private logFactory(_level: BunyanLogLevel): LoggerFunction {\n return (p1: string | Record<string, any>, p2?: string): void => {\n const meta: Record<string, unknown> = {\n logContext: this.context,\n ...this.meta,\n ...toMeta(p1),\n };\n const msg = getMessage(p1, p2);\n let level = _level;\n\n if (isString(msg)) {\n const remappedLevel = getRemappedLevel(msg);\n /* v8 ignore next -- not easily testable */\n if (remappedLevel) {\n meta.oldLevel = level;\n level = remappedLevel;\n }\n this.ensureLogger()[level](meta, msg);\n } else {\n this.ensureLogger()[level](meta);\n }\n };\n }\n\n private logOnceFn(level: BunyanLogLevel): LoggerFunction {\n // Must stay an arrow function: the returned function is stored on\n // `this.logger.once[level]` and invoked from there, so it relies on\n // lexically-bound `this` (this RenovateLogger instance) rather than\n // whatever `this` the call site would otherwise supply to a plain\n // `function` declaration.\n // oxlint-disable-next-line func-style -- see comment above\n const logOnceFn = (p1: string | Record<string, any>, p2?: string): void => {\n once(\n () => {\n const logFn = this[level].bind(this); // bind to the instance.\n if (isString(p1)) {\n logFn(p1);\n } else {\n logFn(p1, p2);\n }\n },\n logOnceFn,\n p1,\n p2,\n );\n };\n return logOnceFn;\n }\n\n private log(\n level: BunyanLogLevel,\n p1: string | Record<string, any>,\n p2?: string,\n ): void {\n if (!this.bunyanLogger) {\n // defer logging until bunyan logger is initialized, to avoid losing logs during initialization\n this.queue.push(() => this.log(level, p1, p2));\n if (!this.uninitializedWarningFired) {\n // oxlint-disable-next-line no-console -- intentional: display warning when bunyan isn't initialized\n console.warn(\n `⚠️ NOTE ⚠️: Renovate's logger has not yet been initialized. If you see no other output, this is a bug`,\n );\n this.uninitializedWarningFired = true;\n }\n return;\n }\n const logFn = this.logger[level];\n if (isString(p1)) {\n logFn(p1);\n } else {\n logFn(p1, p2);\n }\n }\n}\n"],"mappings":";;;;;;;AAcA,MAAM,eAAiC;CACrC;CACA;CACA;CACA;CACA;CACA;AACF;AAIA,IAAa,iBAAb,MAAa,eAAiC;CAC5C,QAAyC,CAAC;CAC1C,SAA0B,EAAE,MAAM,EAASA,MAAU,EAAE;CACvD,OAAgB,KAAK,OAAO;CAC5B;CACA;CACA;CACA;CAEA,YACE,SACA,MACA,cACA;EACA,KAAK,eAAe;EACpB,KAAK,UAAU;EACf,KAAK,OAAO;EACZ,KAAK,MAAM,SAAS,cAAc;GAChC,KAAK,OAAO,SAAS,KAAK,WAAW,KAAK;GAC1C,KAAK,OAAO,KAAK,SAAS,KAAK,UAAU,KAAK;EAChD;EACA,KAAK,4BAA4B;CACnC;CAIA,MAAM,IAAkC,IAAmB;EACzD,KAAK,IAAI,SAAS,IAAI,EAAE;CAC1B;CAIA,MAAM,IAAkC,IAAmB;EACzD,KAAK,IAAI,SAAS,IAAI,EAAE;CAC1B;CAIA,KAAK,IAAkC,IAAmB;EACxD,KAAK,IAAI,QAAQ,IAAI,EAAE;CACzB;CAIA,KAAK,IAAkC,IAAmB;EACxD,KAAK,IAAI,QAAQ,IAAI,EAAE;CACzB;CAIA,MAAM,IAAkC,IAAmB;EACzD,KAAK,IAAI,SAAS,IAAI,EAAE;CAC1B;CAIA,MAAM,IAAkC,IAAmB;EACzD,KAAK,IAAI,SAAS,IAAI,EAAE;CAC1B;CAEA,eAAe,aAAsC;EACnD,KAAK,aAAa,CAAC,CAAC,eAAe,WAAW;CAChD;CAEA,UAAU,QAA4B;EACpC,KAAK,aAAa,CAAC,CAAC,UAAU,cAAc,MAAM,CAAC;CACrD;CAEA,cA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IAAkC,OAAsB;GACzE,WACQ;IACJ,MAAM,QAAQ,KAAK,MAAM,CAAC,KAAK,IAAI;IACnC,IAAI,SAAS,EAAE,GACb,MAAM,EAAE;SAER,MAAM,IAAI,EAAE;GAEhB,GACA,WACA,IACA,EACF;EACF;EACA,OAAO;CACT;CAEA,IACE,OACA,IACA,IACM;EACN,IAAI,CAAC,KAAK,cAAc;GAEtB,KAAK,MAAM,WAAW,KAAK,IAAI,OAAO,IAAI,EAAE,CAAC;GAC7C,IAAI,CAAC,KAAK,2BAA2B;IAEnC,QAAQ,KACN,uGACF;IACA,KAAK,4BAA4B;GACnC;GACA;EACF;EACA,MAAM,QAAQ,KAAK,OAAO;EAC1B,IAAI,SAAS,EAAE,GACb,MAAM,EAAE;OAER,MAAM,IAAI,EAAE;CAEhB;AACF"}
|
|
@@ -25,7 +25,7 @@ var BitriseDatasource = class BitriseDatasource extends Datasource {
|
|
|
25
25
|
sourceUrlSupport = "release";
|
|
26
26
|
sourceUrlNote = "The source URL is determined from the `source_code_url` field of the release object in the results.";
|
|
27
27
|
async _getReleases({ packageName, registryUrl }) {
|
|
28
|
-
/* v8 ignore next
|
|
28
|
+
/* v8 ignore next -- should never happen */
|
|
29
29
|
if (!registryUrl) return null;
|
|
30
30
|
const parsedUrl = parseGitUrl(registryUrl);
|
|
31
31
|
if (detectPlatform(registryUrl) !== "github") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["semver"],"sources":["../../../../lib/modules/datasource/bitrise/index.ts"],"sourcesContent":["import { isArray } from '@sindresorhus/is';\nimport { logger } from '../../../logger/index.ts';\nimport { withCache } from '../../../util/cache/package/with-cache.ts';\nimport { detectPlatform } from '../../../util/common.ts';\nimport { parseGitUrl } from '../../../util/git/url.ts';\nimport { GithubHttp } from '../../../util/http/github.ts';\nimport { fromBase64 } from '../../../util/string.ts';\nimport { joinUrlParts } from '../../../util/url.ts';\nimport { GithubContentResponse } from '../../platform/github/schema.ts';\nimport semver from '../../versioning/semver/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { GetReleasesConfig, ReleaseResult } from '../types.ts';\nimport { BitriseStepFile } from './schema.ts';\n\nexport class BitriseDatasource extends Datasource {\n static readonly id = 'bitrise';\n\n override readonly http: GithubHttp;\n\n constructor() {\n super(BitriseDatasource.id);\n\n this.http = new GithubHttp(this.id);\n }\n\n override readonly customRegistrySupport = true;\n\n override readonly defaultRegistryUrls = [\n 'https://github.com/bitrise-io/bitrise-steplib.git',\n ];\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timestamp is determined from the `published_at` field in the results.';\n override readonly sourceUrlSupport = 'release';\n override readonly sourceUrlNote =\n 'The source URL is determined from the `source_code_url` field of the release object in the results.';\n\n private async _getReleases({\n packageName,\n registryUrl,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n /* v8 ignore next
|
|
1
|
+
{"version":3,"file":"index.js","names":["semver"],"sources":["../../../../lib/modules/datasource/bitrise/index.ts"],"sourcesContent":["import { isArray } from '@sindresorhus/is';\nimport { logger } from '../../../logger/index.ts';\nimport { withCache } from '../../../util/cache/package/with-cache.ts';\nimport { detectPlatform } from '../../../util/common.ts';\nimport { parseGitUrl } from '../../../util/git/url.ts';\nimport { GithubHttp } from '../../../util/http/github.ts';\nimport { fromBase64 } from '../../../util/string.ts';\nimport { joinUrlParts } from '../../../util/url.ts';\nimport { GithubContentResponse } from '../../platform/github/schema.ts';\nimport semver from '../../versioning/semver/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { GetReleasesConfig, ReleaseResult } from '../types.ts';\nimport { BitriseStepFile } from './schema.ts';\n\nexport class BitriseDatasource extends Datasource {\n static readonly id = 'bitrise';\n\n override readonly http: GithubHttp;\n\n constructor() {\n super(BitriseDatasource.id);\n\n this.http = new GithubHttp(this.id);\n }\n\n override readonly customRegistrySupport = true;\n\n override readonly defaultRegistryUrls = [\n 'https://github.com/bitrise-io/bitrise-steplib.git',\n ];\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timestamp is determined from the `published_at` field in the results.';\n override readonly sourceUrlSupport = 'release';\n override readonly sourceUrlNote =\n 'The source URL is determined from the `source_code_url` field of the release object in the results.';\n\n private async _getReleases({\n packageName,\n registryUrl,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n /* v8 ignore next -- should never happen */\n if (!registryUrl) {\n return null;\n }\n\n const parsedUrl = parseGitUrl(registryUrl);\n if (detectPlatform(registryUrl) !== 'github') {\n logger.once.warn(\n { source: parsedUrl.source },\n 'Unsupported Git hoster for this datasource',\n );\n return null;\n }\n\n const result: ReleaseResult = {\n releases: [],\n };\n\n const massagedPackageName = encodeURIComponent(packageName);\n const baseApiURL =\n parsedUrl.resource === 'github.com'\n ? 'https://api.github.com'\n : `https://${parsedUrl.resource}/api/v3`;\n const packageUrl = joinUrlParts(\n baseApiURL,\n 'repos',\n parsedUrl.full_name,\n 'contents/steps',\n massagedPackageName,\n );\n\n const { body: packageRaw } = await this.http.getJson(\n packageUrl,\n GithubContentResponse,\n );\n\n if (!isArray(packageRaw)) {\n logger.warn(\n { data: packageRaw, url: packageUrl },\n 'Got unexpected response for Bitrise package location',\n );\n return null;\n }\n\n for (const versionDir of packageRaw.filter((element) =>\n semver.isValid(element.name),\n )) {\n const stepUrl = joinUrlParts(packageUrl, versionDir.name, 'step.yml');\n // TODO use getRawFile when ready #30155\n const { body } = await this.http.getJson(stepUrl, GithubContentResponse);\n if (!('content' in body)) {\n logger.warn(\n { data: body, url: stepUrl },\n 'Got unexpected response for Bitrise step location',\n );\n return null;\n }\n if (body.encoding !== 'base64') {\n logger.warn(\n { encoding: body.encoding, data: body, url: stepUrl },\n `Got unexpected encoding for Bitrise step location`,\n );\n return null;\n }\n\n const content = fromBase64(body.content);\n const { published_at, source_code_url } = BitriseStepFile.parse(content);\n\n result.releases.push({\n version: versionDir.name,\n releaseTimestamp: published_at,\n sourceUrl: source_code_url,\n });\n }\n\n // if we have no releases return null\n if (!result.releases.length) {\n return null;\n }\n\n return {\n ...result,\n homepage: `https://bitrise.io/integrations/steps/${packageName}`,\n };\n }\n\n getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null> {\n return withCache(\n {\n namespace: `datasource-${BitriseDatasource.id}`,\n key: `${config.registryUrl}/${config.packageName}`,\n fallback: true,\n },\n () => this._getReleases(config),\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAa,oBAAb,MAAa,0BAA0B,WAAW;CAChD,OAAgB,KAAK;CAErB;CAEA,cAAc;EACZ,MAAM,kBAAkB,EAAE;EAE1B,KAAK,OAAO,IAAI,WAAW,KAAK,EAAE;CACpC;CAEA,wBAA0C;CAE1C,sBAAwC,CACtC,mDACF;CAEA,0BAA4C;CAC5C,uBACE;CACF,mBAAqC;CACrC,gBACE;CAEF,MAAc,aAAa,EACzB,aACA,eACmD;;EAEnD,IAAI,CAAC,aACH,OAAO;EAGT,MAAM,YAAY,YAAY,WAAW;EACzC,IAAI,eAAe,WAAW,MAAM,UAAU;GAC5C,OAAO,KAAK,KACV,EAAE,QAAQ,UAAU,OAAO,GAC3B,4CACF;GACA,OAAO;EACT;EAEA,MAAM,SAAwB,EAC5B,UAAU,CAAC,EACb;EAEA,MAAM,sBAAsB,mBAAmB,WAAW;EAC1D,MAAM,aACJ,UAAU,aAAa,eACnB,2BACA,WAAW,UAAU,SAAS;EACpC,MAAM,aAAa,aACjB,YACA,SACA,UAAU,WACV,kBACA,mBACF;EAEA,MAAM,EAAE,MAAM,eAAe,MAAM,KAAK,KAAK,QAC3C,YACA,qBACF;EAEA,IAAI,CAAC,QAAQ,UAAU,GAAG;GACxB,OAAO,KACL;IAAE,MAAM;IAAY,KAAK;GAAW,GACpC,sDACF;GACA,OAAO;EACT;EAEA,KAAK,MAAM,cAAc,WAAW,QAAQ,YAC1CA,IAAO,QAAQ,QAAQ,IAAI,CAC7B,GAAG;GACD,MAAM,UAAU,aAAa,YAAY,WAAW,MAAM,UAAU;GAEpE,MAAM,EAAE,SAAS,MAAM,KAAK,KAAK,QAAQ,SAAS,qBAAqB;GACvE,IAAI,EAAE,aAAa,OAAO;IACxB,OAAO,KACL;KAAE,MAAM;KAAM,KAAK;IAAQ,GAC3B,mDACF;IACA,OAAO;GACT;GACA,IAAI,KAAK,aAAa,UAAU;IAC9B,OAAO,KACL;KAAE,UAAU,KAAK;KAAU,MAAM;KAAM,KAAK;IAAQ,GACpD,mDACF;IACA,OAAO;GACT;GAEA,MAAM,UAAU,WAAW,KAAK,OAAO;GACvC,MAAM,EAAE,cAAc,oBAAoB,gBAAgB,MAAM,OAAO;GAEvE,OAAO,SAAS,KAAK;IACnB,SAAS,WAAW;IACpB,kBAAkB;IAClB,WAAW;GACb,CAAC;EACH;EAGA,IAAI,CAAC,OAAO,SAAS,QACnB,OAAO;EAGT,OAAO;GACL,GAAG;GACH,UAAU,yCAAyC;EACrD;CACF;CAEA,YAAY,QAA0D;EACpE,OAAO,UACL;GACE,WAAW,cAAc,kBAAkB;GAC3C,KAAK,GAAG,OAAO,YAAY,GAAG,OAAO;GACrC,UAAU;EACZ,SACM,KAAK,aAAa,MAAM,CAChC;CACF;AACF"}
|
|
@@ -15,7 +15,7 @@ var CpanDatasource = class CpanDatasource extends Datasource {
|
|
|
15
15
|
releaseTimestampSupport = true;
|
|
16
16
|
releaseTimestampNote = "The release timestamp is determined from the `date` field in the results.";
|
|
17
17
|
async _getReleases({ packageName, registryUrl }) {
|
|
18
|
-
/* v8 ignore next
|
|
18
|
+
/* v8 ignore next -- should never happen */
|
|
19
19
|
if (!registryUrl) return null;
|
|
20
20
|
let result = null;
|
|
21
21
|
const searchUrl = joinUrlParts(registryUrl, "v1/file/_search");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["perlVersioning.id"],"sources":["../../../../lib/modules/datasource/cpan/index.ts"],"sourcesContent":["import { withCache } from '../../../util/cache/package/with-cache.ts';\nimport { joinUrlParts } from '../../../util/url.ts';\nimport * as perlVersioning from '../../versioning/perl/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { GetReleasesConfig, ReleaseResult } from '../types.ts';\nimport { MetaCpanApiFileSearchResponse } from './schema.ts';\nimport type { CpanRelease } from './types.ts';\n\nexport class CpanDatasource extends Datasource {\n static readonly id = 'cpan';\n\n constructor() {\n super(CpanDatasource.id);\n }\n\n override readonly customRegistrySupport = false;\n\n override readonly defaultRegistryUrls = ['https://fastapi.metacpan.org/'];\n\n override readonly defaultVersioning = perlVersioning.id;\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timestamp is determined from the `date` field in the results.';\n\n private async _getReleases({\n packageName,\n registryUrl,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n /* v8 ignore next
|
|
1
|
+
{"version":3,"file":"index.js","names":["perlVersioning.id"],"sources":["../../../../lib/modules/datasource/cpan/index.ts"],"sourcesContent":["import { withCache } from '../../../util/cache/package/with-cache.ts';\nimport { joinUrlParts } from '../../../util/url.ts';\nimport * as perlVersioning from '../../versioning/perl/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { GetReleasesConfig, ReleaseResult } from '../types.ts';\nimport { MetaCpanApiFileSearchResponse } from './schema.ts';\nimport type { CpanRelease } from './types.ts';\n\nexport class CpanDatasource extends Datasource {\n static readonly id = 'cpan';\n\n constructor() {\n super(CpanDatasource.id);\n }\n\n override readonly customRegistrySupport = false;\n\n override readonly defaultRegistryUrls = ['https://fastapi.metacpan.org/'];\n\n override readonly defaultVersioning = perlVersioning.id;\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timestamp is determined from the `date` field in the results.';\n\n private async _getReleases({\n packageName,\n registryUrl,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n /* v8 ignore next -- should never happen */\n if (!registryUrl) {\n return null;\n }\n\n let result: ReleaseResult | null = null;\n const searchUrl = joinUrlParts(registryUrl, 'v1/file/_search');\n\n let releases: CpanRelease[] | null = null;\n try {\n const body = {\n query: {\n bool: {\n filter: [\n { term: { 'module.name': packageName } },\n { term: { 'module.authorized': true } },\n { exists: { field: 'module.associated_pod' } },\n ],\n },\n },\n _source: [\n 'module.name',\n 'module.version',\n 'distribution',\n 'date',\n 'deprecated',\n 'maturity',\n 'status',\n ],\n sort: [{ date: 'desc' }],\n };\n\n releases = (\n await this.http.postJson(\n searchUrl,\n { body },\n MetaCpanApiFileSearchResponse,\n )\n ).body;\n } catch (err) {\n this.handleGenericErrors(err);\n }\n\n let latestDistribution: string | null = null;\n let latestVersion: string | null = null;\n if (releases) {\n for (const release of releases) {\n latestDistribution ??= release.distribution;\n if (!latestVersion && release.isLatest) {\n latestVersion = release.version;\n }\n }\n }\n if (releases.length > 0 && latestDistribution) {\n result = {\n releases,\n changelogUrl: `https://metacpan.org/dist/${latestDistribution}/changes`,\n homepage: `https://metacpan.org/pod/${packageName}`,\n };\n\n if (latestVersion) {\n result.tags ??= {};\n result.tags.latest = latestVersion;\n }\n }\n\n return result;\n }\n\n override getReleases(\n config: GetReleasesConfig,\n ): Promise<ReleaseResult | null> {\n return withCache(\n {\n namespace: `datasource-${CpanDatasource.id}`,\n key: `${config.packageName}`,\n fallback: true,\n },\n () => this._getReleases(config),\n );\n }\n}\n"],"mappings":";;;;;;AAQA,IAAa,iBAAb,MAAa,uBAAuB,WAAW;CAC7C,OAAgB,KAAK;CAErB,cAAc;EACZ,MAAM,eAAe,EAAE;CACzB;CAEA,wBAA0C;CAE1C,sBAAwC,CAAC,+BAA+B;CAExE,oBAAsCA;CAEtC,0BAA4C;CAC5C,uBACE;CAEF,MAAc,aAAa,EACzB,aACA,eACmD;;EAEnD,IAAI,CAAC,aACH,OAAO;EAGT,IAAI,SAA+B;EACnC,MAAM,YAAY,aAAa,aAAa,iBAAiB;EAE7D,IAAI,WAAiC;EACrC,IAAI;GACF,MAAM,OAAO;IACX,OAAO,EACL,MAAM,EACJ,QAAQ;KACN,EAAE,MAAM,EAAE,eAAe,YAAY,EAAE;KACvC,EAAE,MAAM,EAAE,qBAAqB,KAAK,EAAE;KACtC,EAAE,QAAQ,EAAE,OAAO,wBAAwB,EAAE;IAC/C,EACF,EACF;IACA,SAAS;KACP;KACA;KACA;KACA;KACA;KACA;KACA;IACF;IACA,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC;GACzB;GAEA,YACE,MAAM,KAAK,KAAK,SACd,WACA,EAAE,KAAK,GACP,6BACF,EAAA,CACA;EACJ,SAAS,KAAK;GACZ,KAAK,oBAAoB,GAAG;EAC9B;EAEA,IAAI,qBAAoC;EACxC,IAAI,gBAA+B;EACnC,IAAI,UACF,KAAK,MAAM,WAAW,UAAU;GAC9B,uBAAuB,QAAQ;GAC/B,IAAI,CAAC,iBAAiB,QAAQ,UAC5B,gBAAgB,QAAQ;EAE5B;EAEF,IAAI,SAAS,SAAS,KAAK,oBAAoB;GAC7C,SAAS;IACP;IACA,cAAc,6BAA6B,mBAAmB;IAC9D,UAAU,4BAA4B;GACxC;GAEA,IAAI,eAAe;IACjB,OAAO,SAAS,CAAC;IACjB,OAAO,KAAK,SAAS;GACvB;EACF;EAEA,OAAO;CACT;CAEA,YACE,QAC+B;EAC/B,OAAO,UACL;GACE,WAAW,cAAc,eAAe;GACxC,KAAK,GAAG,OAAO;GACf,UAAU;EACZ,SACM,KAAK,aAAa,MAAM,CAChC;CACF;AACF"}
|
|
@@ -179,7 +179,7 @@ var CrateDatasource = class CrateDatasource extends Datasource {
|
|
|
179
179
|
* url and clones it to cache.
|
|
180
180
|
*/
|
|
181
181
|
static async fetchRegistryInfo({ packageName, registryUrl }) {
|
|
182
|
-
/* v8 ignore next
|
|
182
|
+
/* v8 ignore next -- should never happen */
|
|
183
183
|
if (!registryUrl) return null;
|
|
184
184
|
const isSparseRegistry = CrateDatasource.isSparseRegistry(registryUrl);
|
|
185
185
|
const registryFetchUrl = isSparseRegistry ? registryUrl.replace(regEx(/^sparse\+/), "") : registryUrl;
|