renovate 43.285.3 → 43.285.5

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.
Files changed (92) hide show
  1. package/dist/config/massage.js.map +1 -1
  2. package/dist/config/migration.js.map +1 -1
  3. package/dist/config/migrations/custom/compatibility-migration.js.map +1 -1
  4. package/dist/config/presets/index.js.map +1 -1
  5. package/dist/config/validation.js.map +1 -1
  6. package/dist/logger/bunyan.js.map +1 -1
  7. package/dist/modules/datasource/go/releases-goproxy.js +10 -4
  8. package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
  9. package/dist/modules/datasource/go/schema.js +5 -1
  10. package/dist/modules/datasource/go/schema.js.map +1 -1
  11. package/dist/modules/datasource/packagist/schema.js +13 -11
  12. package/dist/modules/datasource/packagist/schema.js.map +1 -1
  13. package/dist/modules/datasource/rubygems/metadata-cache.js.map +1 -1
  14. package/dist/modules/manager/bazel-module/index.js +1 -0
  15. package/dist/modules/manager/bazel-module/index.js.map +1 -1
  16. package/dist/modules/manager/bazelisk/index.js +1 -0
  17. package/dist/modules/manager/bazelisk/index.js.map +1 -1
  18. package/dist/modules/manager/bun/index.js +1 -0
  19. package/dist/modules/manager/bun/index.js.map +1 -1
  20. package/dist/modules/manager/bundler/index.js +1 -0
  21. package/dist/modules/manager/bundler/index.js.map +1 -1
  22. package/dist/modules/manager/cargo/index.js +1 -0
  23. package/dist/modules/manager/cargo/index.js.map +1 -1
  24. package/dist/modules/manager/circleci/schema.js.map +1 -1
  25. package/dist/modules/manager/composer/index.js +1 -0
  26. package/dist/modules/manager/composer/index.js.map +1 -1
  27. package/dist/modules/manager/conan/index.js +1 -0
  28. package/dist/modules/manager/conan/index.js.map +1 -1
  29. package/dist/modules/manager/deno/index.js +1 -0
  30. package/dist/modules/manager/deno/index.js.map +1 -1
  31. package/dist/modules/manager/devbox/index.js +1 -0
  32. package/dist/modules/manager/devbox/index.js.map +1 -1
  33. package/dist/modules/manager/fingerprint.generated.js +8 -8
  34. package/dist/modules/manager/fingerprint.generated.js.map +1 -1
  35. package/dist/modules/manager/gleam/index.js +1 -0
  36. package/dist/modules/manager/gleam/index.js.map +1 -1
  37. package/dist/modules/manager/gradle/extract/consistent-versions-plugin.js.map +1 -1
  38. package/dist/modules/manager/gradle/index.js +1 -0
  39. package/dist/modules/manager/gradle/index.js.map +1 -1
  40. package/dist/modules/manager/helmfile/index.js +1 -0
  41. package/dist/modules/manager/helmfile/index.js.map +1 -1
  42. package/dist/modules/manager/helmv3/index.js +1 -0
  43. package/dist/modules/manager/helmv3/index.js.map +1 -1
  44. package/dist/modules/manager/jsonnet-bundler/index.js +1 -0
  45. package/dist/modules/manager/jsonnet-bundler/index.js.map +1 -1
  46. package/dist/modules/manager/mise/index.js +1 -0
  47. package/dist/modules/manager/mise/index.js.map +1 -1
  48. package/dist/modules/manager/mix/index.js +1 -0
  49. package/dist/modules/manager/mix/index.js.map +1 -1
  50. package/dist/modules/manager/nix/index.js +1 -0
  51. package/dist/modules/manager/nix/index.js.map +1 -1
  52. package/dist/modules/manager/npm/artifacts.js.map +1 -1
  53. package/dist/modules/manager/npm/extract/common/package-file.js.map +1 -1
  54. package/dist/modules/manager/npm/index.js +3 -1
  55. package/dist/modules/manager/npm/index.js.map +1 -1
  56. package/dist/modules/manager/nuget/index.js +1 -0
  57. package/dist/modules/manager/nuget/index.js.map +1 -1
  58. package/dist/modules/manager/pep621/index.js +3 -1
  59. package/dist/modules/manager/pep621/index.js.map +1 -1
  60. package/dist/modules/manager/pep621/schema.js.map +1 -1
  61. package/dist/modules/manager/pip-compile/index.js +1 -0
  62. package/dist/modules/manager/pip-compile/index.js.map +1 -1
  63. package/dist/modules/manager/pipenv/index.js +1 -0
  64. package/dist/modules/manager/pipenv/index.js.map +1 -1
  65. package/dist/modules/manager/pixi/index.js +1 -0
  66. package/dist/modules/manager/pixi/index.js.map +1 -1
  67. package/dist/modules/manager/poetry/index.js +1 -0
  68. package/dist/modules/manager/poetry/index.js.map +1 -1
  69. package/dist/modules/manager/pub/index.js +1 -0
  70. package/dist/modules/manager/pub/index.js.map +1 -1
  71. package/dist/modules/manager/terraform/index.js +1 -0
  72. package/dist/modules/manager/terraform/index.js.map +1 -1
  73. package/dist/modules/manager/terragrunt/index.js +3 -1
  74. package/dist/modules/manager/terragrunt/index.js.map +1 -1
  75. package/dist/modules/manager/types.d.ts +12 -0
  76. package/dist/modules/manager/vendir/index.js +1 -0
  77. package/dist/modules/manager/vendir/index.js.map +1 -1
  78. package/dist/modules/platform/codecommit/index.js.map +1 -1
  79. package/dist/modules/versioning/distro.js.map +1 -1
  80. package/dist/util/http/cache/abstract-http-cache-provider.js.map +1 -1
  81. package/dist/util/minimum-release-age.js +33 -0
  82. package/dist/util/minimum-release-age.js.map +1 -0
  83. package/dist/util/package-rules/index.js.map +1 -1
  84. package/dist/util/result.js.map +1 -1
  85. package/dist/workers/repository/init/vulnerability.js.map +1 -1
  86. package/dist/workers/repository/process/lookup/filter-checks.js +2 -28
  87. package/dist/workers/repository/process/lookup/filter-checks.js.map +1 -1
  88. package/dist/workers/repository/update/pr/changelog/common.js.map +1 -1
  89. package/dist/workers/repository/updates/branch-name.js.map +1 -1
  90. package/dist/workers/repository/updates/branchify.js.map +1 -1
  91. package/package.json +4 -4
  92. package/renovate-schema.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"massage.js","names":[],"sources":["../../lib/config/massage.ts"],"sourcesContent":["import { isArray, isNonEmptyArray, isObject, isString } from '@sindresorhus/is';\nimport { clone } from '../util/clone.ts';\nimport { toMs } from '../util/pretty-time.ts';\nimport { getOptions } from './options/index.ts';\nimport type { PackageRule, RenovateConfig, UpdateType } from './types.ts';\n\nconst options = getOptions();\n\nlet allowedStrings: string[];\n\n// Returns a massaged config\nexport function massageConfig(config: RenovateConfig): RenovateConfig {\n if (!allowedStrings) {\n allowedStrings = [];\n options.forEach((option) => {\n if (option.allowString) {\n allowedStrings.push(option.name);\n }\n });\n }\n const massagedConfig = clone(config);\n for (const [key, val] of Object.entries(config)) {\n if (key === 'minimumReleaseAge' && isString(val) && toMs(val) === 0) {\n massagedConfig.minimumReleaseAge = null;\n } else if (allowedStrings.includes(key) && isString(val)) {\n // @ts-expect-error -- TODO: fix me\n massagedConfig[key] = [val];\n } else if (isArray(val)) {\n // @ts-expect-error -- TODO: fix me\n massagedConfig[key] = [];\n val.forEach((item) => {\n if (isObject(item)) {\n // @ts-expect-error -- TODO: fix me\n (massagedConfig[key] as RenovateConfig[]).push(\n massageConfig(item as RenovateConfig),\n );\n } else {\n // @ts-expect-error -- TODO: fix me\n (massagedConfig[key] as unknown[]).push(item);\n }\n });\n } else if (isObject(val) && key !== 'encrypted') {\n // @ts-expect-error -- TODO: fix me\n massagedConfig[key] = massageConfig(val as RenovateConfig);\n }\n }\n if (isNonEmptyArray(massagedConfig.packageRules)) {\n let newRules: PackageRule[] = [];\n const updateTypes: UpdateType[] = [\n 'major',\n 'minor',\n 'patch',\n 'pin',\n 'digest',\n 'rollback',\n ];\n for (const rule of massagedConfig.packageRules) {\n newRules.push(rule);\n for (const [key, val] of Object.entries(rule) as [\n UpdateType,\n PackageRule,\n ][]) {\n if (updateTypes.includes(key)) {\n let newRule = clone(rule);\n Object.keys(newRule).forEach((newKey) => {\n if (!(newKey.startsWith(`match`) || newKey.startsWith('exclude'))) {\n // @ts-expect-error -- TODO: fix me\n delete newRule[newKey];\n }\n });\n newRule.matchUpdateTypes = rule.matchUpdateTypes ?? [];\n newRule.matchUpdateTypes.push(key);\n newRule = { ...newRule, ...val };\n newRules.push(newRule);\n }\n }\n }\n for (const rule of newRules) {\n updateTypes.forEach((updateType) => {\n delete rule[updateType];\n });\n }\n newRules = newRules.filter((rule) => {\n if (\n Object.keys(rule).every(\n (key) => key.startsWith('match') || key.startsWith('exclude'),\n )\n ) {\n // Exclude rules which contain only match or exclude options\n return false;\n }\n return true;\n });\n massagedConfig.packageRules = newRules;\n }\n return massagedConfig;\n}\n"],"mappings":";;;;;AAMA,MAAM,U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B,KAAK,GAAG;IACjC,UAAU;KAAE,GAAG;KAAS,GAAG;IAAI;IAC/B,SAAS,KAAK,OAAO;GACvB;EAEJ;EACA,KAAK,MAAM,QAAQ,UACjB,YAAY,SAAS,eAAe;GAClC,OAAO,KAAK;EACd,CAAC;EAEH,WAAW,SAAS,QAAQ,SAAS;GACnC,IACE,OAAO,KAAK,IAAI,CAAC,CAAC,OACf,QAAQ,IAAI,WAAW,OAAO,KAAK,IAAI,WAAW,SAAS,CAC9D,GAGA,OAAO;GAET,OAAO;EACT,CAAC;EACD,eAAe,eAAe;CAChC;CACA,OAAO;AACT"}
1
+ {"version":3,"file":"massage.js","names":[],"sources":["../../lib/config/massage.ts"],"sourcesContent":["import { isArray, isNonEmptyArray, isObject, isString } from '@sindresorhus/is';\nimport { clone } from '../util/clone.ts';\nimport { toMs } from '../util/pretty-time.ts';\nimport { getOptions } from './options/index.ts';\nimport type { PackageRule, RenovateConfig, UpdateType } from './types.ts';\n\nconst options = getOptions();\n\nlet allowedStrings: string[];\n\n// Returns a massaged config\nexport function massageConfig(config: RenovateConfig): RenovateConfig {\n if (!allowedStrings) {\n allowedStrings = [];\n options.forEach((option) => {\n if (option.allowString) {\n allowedStrings.push(option.name);\n }\n });\n }\n const massagedConfig = clone(config);\n for (const [key, val] of Object.entries(config)) {\n if (key === 'minimumReleaseAge' && isString(val) && toMs(val) === 0) {\n massagedConfig.minimumReleaseAge = null;\n } else if (allowedStrings.includes(key) && isString(val)) {\n // @ts-expect-error -- TODO: fix me\n massagedConfig[key] = [val];\n } else if (isArray(val)) {\n // @ts-expect-error -- TODO: fix me\n massagedConfig[key] = [];\n val.forEach((item) => {\n if (isObject(item)) {\n // @ts-expect-error -- TODO: fix me\n (massagedConfig[key] as RenovateConfig[]).push(massageConfig(item));\n } else {\n // @ts-expect-error -- TODO: fix me\n (massagedConfig[key] as unknown[]).push(item);\n }\n });\n } else if (isObject(val) && key !== 'encrypted') {\n // @ts-expect-error -- TODO: fix me\n massagedConfig[key] = massageConfig(val);\n }\n }\n if (isNonEmptyArray(massagedConfig.packageRules)) {\n let newRules: PackageRule[] = [];\n const updateTypes: UpdateType[] = [\n 'major',\n 'minor',\n 'patch',\n 'pin',\n 'digest',\n 'rollback',\n ];\n for (const rule of massagedConfig.packageRules) {\n newRules.push(rule);\n for (const [key, val] of Object.entries(rule) as [\n UpdateType,\n PackageRule,\n ][]) {\n if (updateTypes.includes(key)) {\n let newRule = clone(rule);\n Object.keys(newRule).forEach((newKey) => {\n if (!(newKey.startsWith(`match`) || newKey.startsWith('exclude'))) {\n // @ts-expect-error -- TODO: fix me\n delete newRule[newKey];\n }\n });\n newRule.matchUpdateTypes = rule.matchUpdateTypes ?? [];\n newRule.matchUpdateTypes.push(key);\n newRule = { ...newRule, ...val };\n newRules.push(newRule);\n }\n }\n }\n for (const rule of newRules) {\n updateTypes.forEach((updateType) => {\n delete rule[updateType];\n });\n }\n newRules = newRules.filter((rule) => {\n if (\n Object.keys(rule).every(\n (key) => key.startsWith('match') || key.startsWith('exclude'),\n )\n ) {\n // Exclude rules which contain only match or exclude options\n return false;\n }\n return true;\n });\n massagedConfig.packageRules = newRules;\n }\n return massagedConfig;\n}\n"],"mappings":";;;;;AAMA,MAAM,UAAU,WAAW;AAE3B,IAAI;AAGJ,SAAgB,cAAc,QAAwC;CACpE,IAAI,CAAC,gBAAgB;EACnB,iBAAiB,CAAC;EAClB,QAAQ,SAAS,WAAW;GAC1B,IAAI,OAAO,aACT,eAAe,KAAK,OAAO,IAAI;EAEnC,CAAC;CACH;CACA,MAAM,iBAAiB,MAAM,MAAM;CACnC,KAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,QAAQ,MAAM,GAC5C,IAAI,QAAQ,uBAAuB,SAAS,GAAG,KAAK,KAAK,GAAG,MAAM,GAChE,eAAe,oBAAoB;MAC9B,IAAI,eAAe,SAAS,GAAG,KAAK,SAAS,GAAG,GAErD,eAAe,OAAO,CAAC,GAAG;MACrB,IAAI,QAAQ,GAAG,GA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ean,\n isNonEmptyArray,\n isNonEmptyObject,\n isObject,\n isString,\n} from '@sindresorhus/is';\nimport { dequal } from 'dequal';\nimport { logger } from '../logger/index.ts';\nimport { clone } from '../util/clone.ts';\nimport { regEx } from '../util/regex.ts';\nimport { MigrationsService } from './migrations/index.ts';\nimport { getOptions } from './options/index.ts';\nimport type {\n MigratedConfig,\n MigratedRenovateConfig,\n PackageRule,\n RenovateConfig,\n RenovateOptions,\n} from './types.ts';\nimport { mergeChildConfig } from './utils.ts';\n\nconst options = getOptions();\nexport function fixShortHours(input: string): string {\n return input.replace(regEx(/( \\d?\\d)((a|p)m)/g), '$1:00$2');\n}\n\nlet optionTypes: Record<string, RenovateOptions['type']>;\n// Returns a migrated config\nexport function migrateConfig(\n config: RenovateConfig,\n parentKey?: string,\n): MigratedConfig {\n try {\n if (!optionTypes) {\n optionTypes = {};\n options.forEach((option) => {\n optionTypes[option.name] = option.type;\n });\n }\n const newConfig = MigrationsService.run(config, parentKey);\n const migratedConfig = clone(newConfig) as MigratedRenovateConfig;\n\n for (const [key, val] of Object.entries(newConfig)) {\n if (isString(val) && val.includes('{{baseDir}}')) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = val.replace(\n regEx(/{{baseDir}}/g),\n '{{packageFileDir}}',\n );\n } else if (isString(val) && val.includes('{{lookupName}}')) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = val.replace(\n regEx(/{{lookupName}}/g),\n '{{packageName}}',\n );\n } else if (isString(val) && val.includes('{{depNameShort}}')) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = val.replace(\n regEx(/{{depNameShort}}/g),\n '{{depName}}',\n );\n } else if (isString(val) && val.startsWith('{{semanticPrefix}}')) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = val.replace(\n '{{semanticPrefix}}',\n '{{#if semanticCommitType}}{{semanticCommitType}}{{#if semanticCommitScope}}({{semanticCommitScope}}){{/if}}: {{/if}}',\n );\n } else if (optionTypes[key] === 'object' && isBoolean(val)) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = { enabled: val };\n } else if (optionTypes[key] === 'boolean') {\n if (val === 'true') {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = true;\n } else if (val === 'false') {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = false;\n }\n } else if (\n optionTypes[key] === 'string' &&\n isArray(val) &&\n val.length === 1\n ) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = String(val[0]);\n } else if (isArray(val)) {\n // @ts-expect-error -- TODO: fix me\n // v8 ignore else -- TODO: add test #40625\n if (isArray(migratedConfig?.[key])) {\n const newArray = [];\n // @ts-expect-error -- TODO: fix me\n for (const item of migratedConfig[key]) {\n if (isObject(item) && !isArray(item)) {\n const arrMigrate = migrateConfig(item as RenovateConfig);\n newArray.push(arrMigrate.migratedConfig);\n } else {\n newArray.push(item);\n }\n }\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = newArray;\n }\n } else if (isObject(val)) {\n const subMigrate = migrateConfig(\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] as RenovateConfig,\n key,\n );\n if (subMigrate.isMigrated) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = subMigrate.migratedConfig;\n }\n }\n\n const migratedTemplates = {\n fromVersion: 'currentVersion',\n newValueMajor: 'newMajor',\n newValueMinor: 'newMinor',\n newVersionMajor: 'newMajor',\n newVersionMinor: 'newMinor',\n toVersion: 'newVersion',\n };\n // @ts-expect-error -- TODO: fix me\n if (isString(migratedConfig[key])) {\n for (const [from, to] of Object.entries(migratedTemplates)) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = (migratedConfig[key] as string).replace(\n regEx(from, 'g'),\n to,\n );\n }\n }\n }\n const languages = [\n 'docker',\n 'dotnet',\n 'golang',\n 'java',\n 'js',\n 'node',\n 'php',\n 'python',\n 'ruby',\n 'rust',\n ];\n for (const language of languages) {\n // @ts-expect-error -- TODO: fix me\n if (isNonEmptyObject(migratedConfig[language])) {\n migratedConfig.packageRules ??= [];\n // @ts-expect-error -- TODO: fix me\n const currentContent = migratedConfig[language] as any;\n const packageRule = {\n matchCategories: [language],\n ...currentContent,\n };\n migratedConfig.packageRules.unshift(packageRule);\n // @ts-expect-error -- TODO: fix me\n delete migratedConfig[language];\n }\n }\n // Migrate nested packageRules\n if (isNonEmptyArray(migratedConfig.packageRules)) {\n const existingRules = migratedConfig.packageRules;\n migratedConfig.packageRules = [];\n for (const packageRule of existingRules) {\n // @ts-expect-error -- TODO: fix me\n if (isArray(packageRule.packageRules)) {\n logger.debug('Flattening nested packageRules');\n // merge each subrule and add to the parent list\n // @ts-expect-error -- TODO: fix me\n for (const subrule of packageRule.packageRules) {\n // TODO: fix types #22198\n const combinedRule = mergeChildConfig(\n packageRule,\n subrule as PackageRule,\n );\n // @ts-expect-error -- TODO: fix me\n delete combinedRule.packageRules;\n migratedConfig.packageRules.push(combinedRule);\n }\n } else {\n migratedConfig.packageRules.push(packageRule);\n }\n }\n }\n if (\n // @ts-expect-error -- TODO: fix me\n isNonEmptyObject(migratedConfig['pip-compile']) &&\n // @ts-expect-error -- TODO: fix me\n isNonEmptyArray(migratedConfig['pip-compile'].managerFilePatterns)\n ) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig['pip-compile'].managerFilePatterns = migratedConfig[\n 'pip-compile'\n ].managerFilePatterns.map((filePattern) => {\n const pattern = filePattern as string;\n if (pattern.endsWith('.in')) {\n return pattern.replace(/\\.in$/, '.txt');\n }\n if (pattern.endsWith('.in/')) {\n return pattern.replace(/\\.in\\/$/, '.txt/');\n }\n return pattern.replace(/\\.in\\$\\/$/, '.txt$/');\n });\n }\n if (\n // @ts-expect-error -- TODO: fix me\n isNonEmptyArray(migratedConfig.matchManagers) &&\n // @ts-expect-error -- TODO: fix me\n migratedConfig.matchManagers.includes('gradle-lite')\n ) {\n // @ts-expect-error -- TODO: fix me\n // v8 ignore else -- TODO: add test #40625\n if (!migratedConfig.matchManagers.includes('gradle')) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig.matchManagers.push('gradle');\n }\n // @ts-expect-error -- TODO: fix me\n migratedConfig.matchManagers = migratedConfig.matchManagers.filter(\n // @ts-expect-error -- TODO: fix me\n (manager) => manager !== 'gradle-lite',\n );\n }\n // @ts-expect-error -- TODO: fix me\n if (isNonEmptyObject(migratedConfig['gradle-lite'])) {\n migratedConfig.gradle = mergeChildConfig(\n migratedConfig.gradle ?? {},\n // @ts-expect-error -- TODO: fix me\n migratedConfig['gradle-lite'],\n );\n }\n // @ts-expect-error -- TODO: fix me\n delete migratedConfig['gradle-lite'];\n const isMigrated = !dequal(config, migratedConfig);\n if (isMigrated) {\n // recursive call in case any migrated configs need further migrating\n return {\n isMigrated,\n migratedConfig: migrateConfig(migratedConfig).migratedConfig,\n };\n }\n return { isMigrated, migratedConfig };\n } catch (err) {\n logger.debug({ config, err }, 'migrateConfig() error');\n throw err;\n }\n}\n"],"mappings":";;;;;;;;;;AAuBA,MAAM,UAAU,WAAW;AAC3B,SAAgB,cAAc,OAAuB;CACnD,OAAO,MAAM,QAAQ,MAAM,mBAAmB,GAAG,SAAS;AAC5D;AAEA,IAAI;AAEJ,SAAgB,cACd,QACA,WACgB;CAChB,IAAI;EACF,IAAI,CAAC,aAAa;GAChB,cAAc,CAAC;GACf,QAAQ,SAAS,WAAW;IAC1B,YAAY,OAAO,QAAQ,OAAO;GACpC,CAAC;EACH;EACA,MAAM,YAAY,kBAAkB,IAAI,QAAQ,SAAS;EACzD,MAAM,iBAAiB,MAAM,SAAS;EAEtC,KAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,QAAQ,SAAS,GAAG;GAClD,IAAI,SAAS,GAAG,KAAK,IAAI,SAAS,aAAa,GAE7C,eAAe,OAAO,IAAI,QACxB,MAAM,cAAc,GACpB,oBACF;QACK,IAAI,SAAS,GAAG,KAAK,IAAI,SAAS,gBAAgB,GAEvD,eAAe,OAAO,IAAI,QACxB,MAAM,iBAAiB,GAC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AAe,cACjB;EAGF,OAAO,eAAe;EACtB,MAAM,aAAa,CAAC,OAAO,QAAQ,cAAc;EACjD,IAAI,YAEF,OAAO;GACL;GACA,gBAAgB,cAAc,cAAc,CAAC,CAAC;EAChD;EAEF,OAAO;GAAE;GAAY;EAAe;CACtC,SAAS,KAAK;EACZ,OAAO,MAAM;GAAE;GAAQ;EAAI,GAAG,uBAAuB;EACrD,MAAM;CACR;AACF"}
1
+ {"version":3,"file":"migration.js","names":[],"sources":["../../lib/config/migration.ts"],"sourcesContent":["import {\n isArray,\n isBoolean,\n isNonEmptyArray,\n isNonEmptyObject,\n isObject,\n isString,\n} from '@sindresorhus/is';\nimport { dequal } from 'dequal';\nimport { logger } from '../logger/index.ts';\nimport { clone } from '../util/clone.ts';\nimport { regEx } from '../util/regex.ts';\nimport { MigrationsService } from './migrations/index.ts';\nimport { getOptions } from './options/index.ts';\nimport type {\n MigratedConfig,\n MigratedRenovateConfig,\n PackageRule,\n RenovateConfig,\n RenovateOptions,\n} from './types.ts';\nimport { mergeChildConfig } from './utils.ts';\n\nconst options = getOptions();\nexport function fixShortHours(input: string): string {\n return input.replace(regEx(/( \\d?\\d)((a|p)m)/g), '$1:00$2');\n}\n\nlet optionTypes: Record<string, RenovateOptions['type']>;\n// Returns a migrated config\nexport function migrateConfig(\n config: RenovateConfig,\n parentKey?: string,\n): MigratedConfig {\n try {\n if (!optionTypes) {\n optionTypes = {};\n options.forEach((option) => {\n optionTypes[option.name] = option.type;\n });\n }\n const newConfig = MigrationsService.run(config, parentKey);\n const migratedConfig = clone(newConfig) as MigratedRenovateConfig;\n\n for (const [key, val] of Object.entries(newConfig)) {\n if (isString(val) && val.includes('{{baseDir}}')) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = val.replace(\n regEx(/{{baseDir}}/g),\n '{{packageFileDir}}',\n );\n } else if (isString(val) && val.includes('{{lookupName}}')) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = val.replace(\n regEx(/{{lookupName}}/g),\n '{{packageName}}',\n );\n } else if (isString(val) && val.includes('{{depNameShort}}')) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = val.replace(\n regEx(/{{depNameShort}}/g),\n '{{depName}}',\n );\n } else if (isString(val) && val.startsWith('{{semanticPrefix}}')) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = val.replace(\n '{{semanticPrefix}}',\n '{{#if semanticCommitType}}{{semanticCommitType}}{{#if semanticCommitScope}}({{semanticCommitScope}}){{/if}}: {{/if}}',\n );\n } else if (optionTypes[key] === 'object' && isBoolean(val)) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = { enabled: val };\n } else if (optionTypes[key] === 'boolean') {\n if (val === 'true') {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = true;\n } else if (val === 'false') {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = false;\n }\n } else if (\n optionTypes[key] === 'string' &&\n isArray(val) &&\n val.length === 1\n ) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = String(val[0]);\n } else if (isArray(val)) {\n // @ts-expect-error -- TODO: fix me\n // v8 ignore else -- TODO: add test #40625\n if (isArray(migratedConfig?.[key])) {\n const newArray = [];\n // @ts-expect-error -- TODO: fix me\n for (const item of migratedConfig[key]) {\n if (isObject(item) && !isArray(item)) {\n const arrMigrate = migrateConfig(item);\n newArray.push(arrMigrate.migratedConfig);\n } else {\n newArray.push(item);\n }\n }\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = newArray;\n }\n } else if (isObject(val)) {\n const subMigrate = migrateConfig(\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] as RenovateConfig,\n key,\n );\n if (subMigrate.isMigrated) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = subMigrate.migratedConfig;\n }\n }\n\n const migratedTemplates = {\n fromVersion: 'currentVersion',\n newValueMajor: 'newMajor',\n newValueMinor: 'newMinor',\n newVersionMajor: 'newMajor',\n newVersionMinor: 'newMinor',\n toVersion: 'newVersion',\n };\n // @ts-expect-error -- TODO: fix me\n if (isString(migratedConfig[key])) {\n for (const [from, to] of Object.entries(migratedTemplates)) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig[key] = (migratedConfig[key] as string).replace(\n regEx(from, 'g'),\n to,\n );\n }\n }\n }\n const languages = [\n 'docker',\n 'dotnet',\n 'golang',\n 'java',\n 'js',\n 'node',\n 'php',\n 'python',\n 'ruby',\n 'rust',\n ];\n for (const language of languages) {\n // @ts-expect-error -- TODO: fix me\n if (isNonEmptyObject(migratedConfig[language])) {\n migratedConfig.packageRules ??= [];\n // @ts-expect-error -- TODO: fix me\n const currentContent = migratedConfig[language] as any;\n const packageRule = {\n matchCategories: [language],\n ...currentContent,\n };\n migratedConfig.packageRules.unshift(packageRule);\n // @ts-expect-error -- TODO: fix me\n delete migratedConfig[language];\n }\n }\n // Migrate nested packageRules\n if (isNonEmptyArray(migratedConfig.packageRules)) {\n const existingRules = migratedConfig.packageRules;\n migratedConfig.packageRules = [];\n for (const packageRule of existingRules) {\n // @ts-expect-error -- TODO: fix me\n if (isArray(packageRule.packageRules)) {\n logger.debug('Flattening nested packageRules');\n // merge each subrule and add to the parent list\n // @ts-expect-error -- TODO: fix me\n for (const subrule of packageRule.packageRules) {\n // TODO: fix types #22198\n const combinedRule = mergeChildConfig(\n packageRule,\n subrule as PackageRule,\n );\n // @ts-expect-error -- TODO: fix me\n delete combinedRule.packageRules;\n migratedConfig.packageRules.push(combinedRule);\n }\n } else {\n migratedConfig.packageRules.push(packageRule);\n }\n }\n }\n if (\n // @ts-expect-error -- TODO: fix me\n isNonEmptyObject(migratedConfig['pip-compile']) &&\n // @ts-expect-error -- TODO: fix me\n isNonEmptyArray(migratedConfig['pip-compile'].managerFilePatterns)\n ) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig['pip-compile'].managerFilePatterns = migratedConfig[\n 'pip-compile'\n ].managerFilePatterns.map((filePattern) => {\n const pattern = filePattern as string;\n if (pattern.endsWith('.in')) {\n return pattern.replace(/\\.in$/, '.txt');\n }\n if (pattern.endsWith('.in/')) {\n return pattern.replace(/\\.in\\/$/, '.txt/');\n }\n return pattern.replace(/\\.in\\$\\/$/, '.txt$/');\n });\n }\n if (\n // @ts-expect-error -- TODO: fix me\n isNonEmptyArray(migratedConfig.matchManagers) &&\n // @ts-expect-error -- TODO: fix me\n migratedConfig.matchManagers.includes('gradle-lite')\n ) {\n // @ts-expect-error -- TODO: fix me\n // v8 ignore else -- TODO: add test #40625\n if (!migratedConfig.matchManagers.includes('gradle')) {\n // @ts-expect-error -- TODO: fix me\n migratedConfig.matchManagers.push('gradle');\n }\n // @ts-expect-error -- TODO: fix me\n migratedConfig.matchManagers = migratedConfig.matchManagers.filter(\n // @ts-expect-error -- TODO: fix me\n (manager) => manager !== 'gradle-lite',\n );\n }\n // @ts-expect-error -- TODO: fix me\n if (isNonEmptyObject(migratedConfig['gradle-lite'])) {\n migratedConfig.gradle = mergeChildConfig(\n migratedConfig.gradle ?? {},\n // @ts-expect-error -- TODO: fix me\n migratedConfig['gradle-lite'],\n );\n }\n // @ts-expect-error -- TODO: fix me\n delete migratedConfig['gradle-lite'];\n const isMigrated = !dequal(config, migratedConfig);\n if (isMigrated) {\n // recursive call in case any migrated configs need further migrating\n return {\n isMigrated,\n migratedConfig: migrateConfig(migratedConfig).migratedConfig,\n };\n }\n return { isMigrated, migratedConfig };\n } catch (err) {\n logger.debug({ config, err }, 'migrateConfig() error');\n throw err;\n }\n}\n"],"mappings":";;;;;;;;;;AAuBA,MAAM,UAAU,WAAW;AAC3B,SAAgB,cAAc,OAAuB;CACnD,OAAO,MAAM,QAAQ,MAAM,mBAAmB,GAAG,SAAS;AAC5D;AAEA,IAAI;AAEJ,SAAgB,cACd,QACA,WACgB;CAChB,IAAI;EACF,IAAI,CAAC,aAAa;GAChB,cAAc,CAAC;GACf,QAAQ,SAAS,WAAW;IAC1B,YAAY,OAAO,QAAQ,OAAO;GACpC,CAAC;EACH;EACA,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AAQ,QAAQ,aAAa,QAAQ;EAC9C,CAAC;EAEH,IAEE,gBAAgB,eAAe,aAAa,KAE5C,eAAe,cAAc,SAAS,aAAa,GACnD;;GAGA,IAAI,CAAC,eAAe,cAAc,SAAS,QAAQ,GAEjD,eAAe,cAAc,KAAK,QAAQ;GAG5C,eAAe,gBAAgB,eAAe,cAAc,QAEzD,YAAY,YAAY,aAC3B;EACF;EAEA,IAAI,iBAAiB,eAAe,cAAc,GAChD,eAAe,SAAS,iBACtB,eAAe,UAAU,CAAC,GAE1B,eAAe,cACjB;EAGF,OAAO,eAAe;EACtB,MAAM,aAAa,CAAC,OAAO,QAAQ,cAAc;EACjD,IAAI,YAEF,OAAO;GACL;GACA,gBAAgB,cAAc,cAAc,CAAC,CAAC;EAChD;EAEF,OAAO;GAAE;GAAY;EAAe;CACtC,SAAS,KAAK;EACZ,OAAO,MAAM;GAAE;GAAQ;EAAI,GAAG,uBAAuB;EACrD,MAAM;CACR;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"compatibility-migration.js","names":[],"sources":["../../../../lib/config/migrations/custom/compatibility-migration.ts"],"sourcesContent":["import { isObject } from '@sindresorhus/is';\nimport { AbstractMigration } from '../base/abstract-migration.ts';\n\nexport class CompatibilityMigration extends AbstractMigration {\n override readonly deprecated = true;\n override readonly propertyName = 'compatibility';\n\n override run(value: unknown): void {\n if (isObject(value)) {\n this.setSafely('constraints', value as Record<string, string>);\n }\n }\n}\n"],"mappings":";;;AAGA,IAAa,yBAAb,cAA4C,kBAAkB;CAC5D,aAA+B;CAC/B,eAAiC;CAEjC,IAAa,OAAsB;EACjC,IAAI,SAAS,KAAK,GAChB,KAAK,UAAU,eAAe,KAA+B;CAEjE;AACF"}
1
+ {"version":3,"file":"compatibility-migration.js","names":[],"sources":["../../../../lib/config/migrations/custom/compatibility-migration.ts"],"sourcesContent":["import { isObject } from '@sindresorhus/is';\nimport { AbstractMigration } from '../base/abstract-migration.ts';\n\nexport class CompatibilityMigration extends AbstractMigration {\n override readonly deprecated = true;\n override readonly propertyName = 'compatibility';\n\n override run(value: unknown): void {\n if (isObject(value)) {\n this.setSafely('constraints', value);\n }\n }\n}\n"],"mappings":";;;AAGA,IAAa,yBAAb,cAA4C,kBAAkB;CAC5D,aAA+B;CAC/B,eAAiC;CAEjC,IAAa,OAAsB;EACjC,IAAI,SAAS,KAAK,GAChB,KAAK,UAAU,eAAe,KAAK;CAEvC;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["internal.getPreset","memCache.get","migration.migrateConfig","massage.massageConfig","template.compile","internal.isInternal"],"sources":["../../../lib/config/presets/index.ts"],"sourcesContent":["import {\n isArray,\n isNullOrUndefined,\n isObject,\n isString,\n} from '@sindresorhus/is';\nimport {\n CONFIG_VALIDATION,\n PLATFORM_RATE_LIMIT_EXCEEDED,\n} from '../../constants/error-messages.ts';\nimport { logger } from '../../logger/index.ts';\nimport { ExternalHostError } from '../../types/errors/external-host-error.ts';\nimport * as memCache from '../../util/cache/memory/index.ts';\nimport { clone } from '../../util/clone.ts';\nimport { regEx } from '../../util/regex.ts';\nimport * as template from '../../util/template/index.ts';\nimport { GlobalConfig } from '../global.ts';\nimport * as massage from '../massage.ts';\nimport * as migration from '../migration.ts';\nimport type { AllConfig, RenovateConfig } from '../types.ts';\nimport { mergeChildConfig } from '../utils.ts';\nimport { removedPresets } from './common.ts';\nimport * as internal from './internal/index.ts';\nimport { parsePreset } from './parse.ts';\nimport type { Preset, PresetApi } from './types.ts';\nimport {\n PRESET_DEP_NOT_FOUND,\n PRESET_INVALID,\n PRESET_INVALID_JSON,\n PRESET_NOT_FOUND,\n PRESET_PROHIBITED_SUBPRESET,\n PRESET_RENOVATE_CONFIG_NOT_FOUND,\n} from './util.ts';\n\nconst presetSourceLoaders: Record<string, () => Promise<PresetApi>> = {\n forgejo: () => import('./forgejo/index.ts'),\n gitea: () => import('./gitea/index.ts'),\n github: () => import('./github/index.ts'),\n gitlab: () => import('./gitlab/index.ts'),\n http: () => import('./http/index.ts'),\n local: () => import('./local/index.ts'),\n npm: () => import('./npm/index.ts'),\n};\n\nconst presetCacheNamespace = 'preset';\n\nexport function replaceArgs(\n obj: string,\n argMapping: Record<string, any>,\n): string;\nexport function replaceArgs(\n obj: string[],\n argMapping: Record<string, any>,\n): string[];\nexport function replaceArgs(\n obj: Record<string, any>,\n argMapping: Record<string, any>,\n): Record<string, any>;\nexport function replaceArgs(\n obj: Record<string, any>[],\n argMapping: Record<string, any>,\n): Record<string, any>[];\n\n/**\n * TODO: fix me #22198\n * @param obj\n * @param argMapping\n */\nexport function replaceArgs(obj: any, argMapping: Record<string, any>): any;\nexport function replaceArgs(\n obj: string | string[] | Record<string, any> | Record<string, any>[],\n argMapping: Record<string, any>,\n): any {\n if (isString(obj)) {\n let returnStr = obj;\n for (const [arg, argVal] of Object.entries(argMapping)) {\n const re = regEx(`{{${arg}}}`, 'g', false);\n returnStr = returnStr.replace(re, argVal);\n }\n return returnStr;\n }\n if (isArray(obj)) {\n const returnArray = [];\n for (const item of obj) {\n returnArray.push(replaceArgs(item, argMapping));\n }\n return returnArray;\n }\n if (isObject(obj)) {\n const returnObj: Record<string, any> = {};\n for (const [key, val] of Object.entries(obj)) {\n returnObj[key] = replaceArgs(val, argMapping);\n }\n return returnObj;\n }\n return obj;\n}\n\nexport async function getPreset(\n preset: string,\n baseConfig?: RenovateConfig,\n): Promise<RenovateConfig> {\n logger.trace(`getPreset(${preset})`);\n // Check if the preset has been removed or replaced\n const newPreset = removedPresets[preset];\n if (newPreset) {\n return getPreset(newPreset, baseConfig);\n }\n if (newPreset === null) {\n return {};\n }\n const { presetSource, repo, presetPath, presetName, tag, params, rawParams } =\n parsePreset(preset);\n\n let presetConfig: Preset | null | undefined;\n\n if (presetSource === 'internal') {\n presetConfig = internal.getPreset({\n repo,\n presetPath,\n presetName,\n tag,\n });\n } else {\n const cacheKey = `preset:${preset}`;\n const presetCachePersistence = GlobalConfig.get('presetCachePersistence');\n\n const packageCache = presetCachePersistence\n ? await import('../../util/cache/package/index.ts')\n : undefined;\n\n if (packageCache) {\n presetConfig = await packageCache.get(presetCacheNamespace, cacheKey);\n } else {\n presetConfig = memCache.get(cacheKey);\n }\n\n if (isNullOrUndefined(presetConfig)) {\n const source = await presetSourceLoaders[presetSource]();\n presetConfig = await source.getPreset({\n repo,\n presetPath,\n presetName,\n tag,\n });\n if (packageCache) {\n await packageCache.set(\n presetCacheNamespace,\n cacheKey,\n presetConfig,\n 15,\n );\n } else {\n memCache.set(cacheKey, presetConfig);\n }\n }\n }\n\n if (!presetConfig) {\n throw new Error(PRESET_DEP_NOT_FOUND);\n }\n logger.trace({ presetConfig }, `Found preset ${preset}`);\n if (params) {\n const argMapping: Record<string, string> = {};\n for (const [index, value] of params.entries()) {\n argMapping[`arg${index}`] = value;\n }\n if (rawParams) {\n argMapping.args = rawParams;\n }\n presetConfig = replaceArgs(presetConfig, argMapping);\n }\n logger.trace({ presetConfig }, `Applied params to preset ${preset}`);\n const presetKeys = Object.keys(presetConfig);\n if (\n presetKeys.length === 2 &&\n presetKeys.includes('description') &&\n presetKeys.includes('extends')\n ) {\n // preset is just a collection of other presets\n delete presetConfig.description;\n }\n const packageListKeys = ['description', 'matchPackageNames'];\n if (presetKeys.every((key) => packageListKeys.includes(key))) {\n delete presetConfig.description;\n }\n const { migratedConfig } = migration.migrateConfig(presetConfig);\n return massage.massageConfig(migratedConfig);\n}\n\nexport interface ResolveConfigPresetsResult {\n config: AllConfig;\n /** when resolving the given configuration, which internal/shared presets were discovered */\n visitedPresets: {\n /** which internal/shared presets were merged into the final config */\n merged: string[];\n /** which internal/shared presets were not merged into the final config */\n unmerged: string[];\n };\n}\n\n/**\n * @param [mergeInternalPresets=true] when resolving the config presets, whether to merge Renovate internal presets into the resulting configuration.\n * When set to `false`, this will resolve these internal presets (recursively), but not merge them.\n * This is primarily intended to be used by \"shallow config\" resolution (for logging purposes).\n */\nexport async function resolveConfigPresets(\n inputConfig: AllConfig,\n baseConfig?: RenovateConfig,\n _ignorePresets?: string[],\n existingPresets: string[] = [],\n mergeInternalPresets = true,\n): Promise<ResolveConfigPresetsResult> {\n const allVisitedPresets = {\n merged: new Set<string>(),\n unmerged: new Set<string>(),\n };\n\n let ignorePresets = clone(_ignorePresets);\n if (!ignorePresets || ignorePresets.length === 0) {\n ignorePresets = inputConfig.ignorePresets ?? [];\n }\n logger.trace(\n { config: inputConfig, existingPresets, mergeInternalPresets },\n 'resolveConfigPresets',\n );\n\n let config: AllConfig = {};\n // First, merge all the preset configs from left to right\n if (inputConfig.extends?.length) {\n // Compile templates\n inputConfig.extends = inputConfig.extends.map((tmpl) =>\n template.compile(tmpl, {}),\n );\n for (const preset of inputConfig.extends) {\n // don't attempt to merge any internal presets if we're not expecting to\n if (!mergeInternalPresets && internal.isInternal(preset)) {\n logger.once.trace(\n { ignoredPreset: preset, mergeInternalPresets },\n 'Not merging preset',\n );\n // ... but make sure we note that we haven't resolved it\n allVisitedPresets.unmerged.add(preset);\n continue;\n }\n\n if (shouldResolvePreset(preset, existingPresets, ignorePresets)) {\n logger.trace(`Resolving preset \"${preset}\"`);\n const fetchedPreset = await fetchPreset(\n preset,\n baseConfig,\n inputConfig,\n existingPresets,\n );\n const { config: presetConfig, visitedPresets } =\n await resolveConfigPresets(\n fetchedPreset,\n baseConfig ?? inputConfig,\n ignorePresets,\n existingPresets.concat([preset]),\n mergeInternalPresets,\n );\n if (inputConfig?.ignoreDeps?.length === 0) {\n delete presetConfig.description;\n }\n\n config = mergeChildConfig(config, presetConfig);\n allVisitedPresets.merged.add(preset);\n\n // then also make sure we've noted any nested presets we've merged\n for (const mergedPreset of visitedPresets.merged) {\n allVisitedPresets.merged.add(mergedPreset);\n }\n // ... or not merged\n for (const unmergedPreset of visitedPresets.unmerged) {\n allVisitedPresets.unmerged.add(unmergedPreset);\n }\n }\n }\n }\n logger.trace({ config }, `Post-preset resolve config`);\n // Now assign \"regular\" config on top\n config = mergeChildConfig(config, inputConfig);\n delete config.extends;\n delete config.ignorePresets;\n logger.trace({ config }, `Post-merge resolve config`);\n for (const [key, val] of Object.entries(config) as [\n keyof AllConfig,\n unknown,\n ][]) {\n const ignoredKeys = ['content', 'onboardingConfig'];\n if (isArray(val)) {\n // Resolve nested objects inside arrays\n config[key] = [] as never; // type can't be narrowed\n for (const element of val) {\n if (isObject(element)) {\n const { config: presetConfig, visitedPresets: visited } =\n await resolveConfigPresets(\n element as RenovateConfig,\n baseConfig,\n ignorePresets,\n existingPresets,\n mergeInternalPresets,\n );\n (config[key] as RenovateConfig[]).push(presetConfig);\n\n // then also make sure we've noted any nested presets we've merged\n for (const mergedPreset of visited.merged) {\n allVisitedPresets.merged.add(mergedPreset);\n }\n // ... or not merged\n for (const unmergedPreset of visited.unmerged) {\n allVisitedPresets.unmerged.add(unmergedPreset);\n }\n } else {\n (config[key] as unknown[]).push(element);\n }\n }\n } else if (isObject(val) && !ignoredKeys.includes(key)) {\n // Resolve nested objects\n logger.trace(`Resolving object \"${key}\"`);\n const { config: presetConfig, visitedPresets: visited } =\n await resolveConfigPresets(\n val as RenovateConfig,\n baseConfig,\n ignorePresets,\n existingPresets,\n mergeInternalPresets,\n );\n config[key] = presetConfig as never; // type can't be narrowed\n\n // then also make sure we've noted any nested presets we've merged\n for (const mergedPreset of visited.merged) {\n allVisitedPresets.merged.add(mergedPreset);\n }\n // ... or not merged\n for (const unmergedPreset of visited.unmerged) {\n allVisitedPresets.unmerged.add(unmergedPreset);\n }\n }\n }\n logger.trace({ config: inputConfig }, 'Input config');\n logger.trace(\n { config, visitedPresets: allVisitedPresets },\n 'Resolved config',\n );\n\n return {\n config,\n visitedPresets: {\n merged: Array.from(allVisitedPresets.merged),\n unmerged: Array.from(allVisitedPresets.unmerged),\n },\n };\n}\n\nasync function fetchPreset(\n preset: string,\n baseConfig: RenovateConfig | undefined,\n inputConfig: AllConfig,\n existingPresets: string[],\n): Promise<AllConfig> {\n try {\n return await getPreset(preset, baseConfig ?? inputConfig);\n } catch (err) {\n logger.debug({ preset, err }, 'Preset fetch error');\n if (err instanceof ExternalHostError) {\n throw err;\n }\n if (err.message === PLATFORM_RATE_LIMIT_EXCEEDED) {\n throw err;\n }\n const error = new Error(CONFIG_VALIDATION);\n if (err.message === PRESET_DEP_NOT_FOUND) {\n error.validationError = `Cannot find preset's package (${preset})`;\n } else if (err.message === PRESET_RENOVATE_CONFIG_NOT_FOUND) {\n error.validationError = `Preset package is missing a renovate-config entry (${preset})`;\n } else if (err.message === PRESET_NOT_FOUND) {\n error.validationError = `Preset name not found within published preset config (${preset})`;\n } else if (err.message === PRESET_INVALID) {\n error.validationError = `Preset is invalid (${preset})`;\n } else if (err.message === PRESET_PROHIBITED_SUBPRESET) {\n error.validationError = `Sub-presets cannot be combined with a custom path (${preset})`;\n } else if (err.message === PRESET_INVALID_JSON) {\n error.validationError = `Preset is invalid JSON (${preset})`;\n } else {\n error.validationError = `Preset caused unexpected error (${preset})`;\n }\n if (existingPresets.length) {\n error.validationError +=\n '. Note: this is a *nested* preset so please contact the preset author if you are unable to fix it yourself.';\n }\n logger.info(\n { validationError: error.validationError },\n 'Throwing preset error',\n );\n throw error;\n }\n}\n\nfunction shouldResolvePreset(\n preset: string,\n existingPresets: string[],\n ignorePresets: string[],\n): boolean {\n if (existingPresets.includes(preset)) {\n logger.debug(\n `Already seen preset ${preset} in [${existingPresets.join(', ')}]`,\n );\n return false;\n }\n if (ignorePresets.includes(preset)) {\n logger.debug(\n `Ignoring preset ${preset} in [${existingPresets.join(', ')}]`,\n );\n return false;\n }\n return true;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,MAAM,sBAAgE;CACpE,eAAe,OAAO;CACtB,aAAa,OAAO;CACpB,cAAc,OAAO;CACrB,cAAc,OAAO;CACrB,YAAY,OAAO;CACnB,aAAa,OAAO;CACpB,WAAW,OAAO;AACpB;AAEA,MAAM,uBAAuB;AAyB7B,SAAgB,YACd,KACA,YACK;CACL,IAAI,SAAS,GAAG,GAAG;EACjB,IAAI,YAAY;EAChB,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E1D,MAAM,kBAAkB,mCAAmC,OAAO;EAEpE,IAAI,gBAAgB,QAClB,MAAM,mBACJ;EAEJ,OAAO,KACL,EAAE,iBAAiB,MAAM,gBAAgB,GACzC,uBACF;EACA,MAAM;CACR;AACF;AAEA,SAAS,oBACP,QACA,iBACA,eACS;CACT,IAAI,gBAAgB,SAAS,MAAM,GAAG;EACpC,OAAO,MACL,uBAAuB,OAAO,OAAO,gBAAgB,KAAK,IAAI,EAAE,EAClE;EACA,OAAO;CACT;CACA,IAAI,cAAc,SAAS,MAAM,GAAG;EAClC,OAAO,MACL,mBAAmB,OAAO,OAAO,gBAAgB,KAAK,IAAI,EAAE,EAC9D;EACA,OAAO;CACT;CACA,OAAO;AACT"}
1
+ {"version":3,"file":"index.js","names":["internal.getPreset","memCache.get","migration.migrateConfig","massage.massageConfig","template.compile","internal.isInternal"],"sources":["../../../lib/config/presets/index.ts"],"sourcesContent":["import {\n isArray,\n isNullOrUndefined,\n isObject,\n isString,\n} from '@sindresorhus/is';\nimport {\n CONFIG_VALIDATION,\n PLATFORM_RATE_LIMIT_EXCEEDED,\n} from '../../constants/error-messages.ts';\nimport { logger } from '../../logger/index.ts';\nimport { ExternalHostError } from '../../types/errors/external-host-error.ts';\nimport * as memCache from '../../util/cache/memory/index.ts';\nimport { clone } from '../../util/clone.ts';\nimport { regEx } from '../../util/regex.ts';\nimport * as template from '../../util/template/index.ts';\nimport { GlobalConfig } from '../global.ts';\nimport * as massage from '../massage.ts';\nimport * as migration from '../migration.ts';\nimport type { AllConfig, RenovateConfig } from '../types.ts';\nimport { mergeChildConfig } from '../utils.ts';\nimport { removedPresets } from './common.ts';\nimport * as internal from './internal/index.ts';\nimport { parsePreset } from './parse.ts';\nimport type { Preset, PresetApi } from './types.ts';\nimport {\n PRESET_DEP_NOT_FOUND,\n PRESET_INVALID,\n PRESET_INVALID_JSON,\n PRESET_NOT_FOUND,\n PRESET_PROHIBITED_SUBPRESET,\n PRESET_RENOVATE_CONFIG_NOT_FOUND,\n} from './util.ts';\n\nconst presetSourceLoaders: Record<string, () => Promise<PresetApi>> = {\n forgejo: () => import('./forgejo/index.ts'),\n gitea: () => import('./gitea/index.ts'),\n github: () => import('./github/index.ts'),\n gitlab: () => import('./gitlab/index.ts'),\n http: () => import('./http/index.ts'),\n local: () => import('./local/index.ts'),\n npm: () => import('./npm/index.ts'),\n};\n\nconst presetCacheNamespace = 'preset';\n\nexport function replaceArgs(\n obj: string,\n argMapping: Record<string, any>,\n): string;\nexport function replaceArgs(\n obj: string[],\n argMapping: Record<string, any>,\n): string[];\nexport function replaceArgs(\n obj: Record<string, any>,\n argMapping: Record<string, any>,\n): Record<string, any>;\nexport function replaceArgs(\n obj: Record<string, any>[],\n argMapping: Record<string, any>,\n): Record<string, any>[];\n\n/**\n * TODO: fix me #22198\n * @param obj\n * @param argMapping\n */\nexport function replaceArgs(obj: any, argMapping: Record<string, any>): any;\nexport function replaceArgs(\n obj: string | string[] | Record<string, any> | Record<string, any>[],\n argMapping: Record<string, any>,\n): any {\n if (isString(obj)) {\n let returnStr = obj;\n for (const [arg, argVal] of Object.entries(argMapping)) {\n const re = regEx(`{{${arg}}}`, 'g', false);\n returnStr = returnStr.replace(re, argVal);\n }\n return returnStr;\n }\n if (isArray(obj)) {\n const returnArray = [];\n for (const item of obj) {\n returnArray.push(replaceArgs(item, argMapping));\n }\n return returnArray;\n }\n if (isObject(obj)) {\n const returnObj: Record<string, any> = {};\n for (const [key, val] of Object.entries(obj)) {\n returnObj[key] = replaceArgs(val, argMapping);\n }\n return returnObj;\n }\n return obj;\n}\n\nexport async function getPreset(\n preset: string,\n baseConfig?: RenovateConfig,\n): Promise<RenovateConfig> {\n logger.trace(`getPreset(${preset})`);\n // Check if the preset has been removed or replaced\n const newPreset = removedPresets[preset];\n if (newPreset) {\n return getPreset(newPreset, baseConfig);\n }\n if (newPreset === null) {\n return {};\n }\n const { presetSource, repo, presetPath, presetName, tag, params, rawParams } =\n parsePreset(preset);\n\n let presetConfig: Preset | null | undefined;\n\n if (presetSource === 'internal') {\n presetConfig = internal.getPreset({\n repo,\n presetPath,\n presetName,\n tag,\n });\n } else {\n const cacheKey = `preset:${preset}`;\n const presetCachePersistence = GlobalConfig.get('presetCachePersistence');\n\n const packageCache = presetCachePersistence\n ? await import('../../util/cache/package/index.ts')\n : undefined;\n\n if (packageCache) {\n presetConfig = await packageCache.get(presetCacheNamespace, cacheKey);\n } else {\n presetConfig = memCache.get(cacheKey);\n }\n\n if (isNullOrUndefined(presetConfig)) {\n const source = await presetSourceLoaders[presetSource]();\n presetConfig = await source.getPreset({\n repo,\n presetPath,\n presetName,\n tag,\n });\n if (packageCache) {\n await packageCache.set(\n presetCacheNamespace,\n cacheKey,\n presetConfig,\n 15,\n );\n } else {\n memCache.set(cacheKey, presetConfig);\n }\n }\n }\n\n if (!presetConfig) {\n throw new Error(PRESET_DEP_NOT_FOUND);\n }\n logger.trace({ presetConfig }, `Found preset ${preset}`);\n if (params) {\n const argMapping: Record<string, string> = {};\n for (const [index, value] of params.entries()) {\n argMapping[`arg${index}`] = value;\n }\n if (rawParams) {\n argMapping.args = rawParams;\n }\n presetConfig = replaceArgs(presetConfig, argMapping);\n }\n logger.trace({ presetConfig }, `Applied params to preset ${preset}`);\n const presetKeys = Object.keys(presetConfig);\n if (\n presetKeys.length === 2 &&\n presetKeys.includes('description') &&\n presetKeys.includes('extends')\n ) {\n // preset is just a collection of other presets\n delete presetConfig.description;\n }\n const packageListKeys = ['description', 'matchPackageNames'];\n if (presetKeys.every((key) => packageListKeys.includes(key))) {\n delete presetConfig.description;\n }\n const { migratedConfig } = migration.migrateConfig(presetConfig);\n return massage.massageConfig(migratedConfig);\n}\n\nexport interface ResolveConfigPresetsResult {\n config: AllConfig;\n /** when resolving the given configuration, which internal/shared presets were discovered */\n visitedPresets: {\n /** which internal/shared presets were merged into the final config */\n merged: string[];\n /** which internal/shared presets were not merged into the final config */\n unmerged: string[];\n };\n}\n\n/**\n * @param [mergeInternalPresets=true] when resolving the config presets, whether to merge Renovate internal presets into the resulting configuration.\n * When set to `false`, this will resolve these internal presets (recursively), but not merge them.\n * This is primarily intended to be used by \"shallow config\" resolution (for logging purposes).\n */\nexport async function resolveConfigPresets(\n inputConfig: AllConfig,\n baseConfig?: RenovateConfig,\n _ignorePresets?: string[],\n existingPresets: string[] = [],\n mergeInternalPresets = true,\n): Promise<ResolveConfigPresetsResult> {\n const allVisitedPresets = {\n merged: new Set<string>(),\n unmerged: new Set<string>(),\n };\n\n let ignorePresets = clone(_ignorePresets);\n if (!ignorePresets || ignorePresets.length === 0) {\n ignorePresets = inputConfig.ignorePresets ?? [];\n }\n logger.trace(\n { config: inputConfig, existingPresets, mergeInternalPresets },\n 'resolveConfigPresets',\n );\n\n let config: AllConfig = {};\n // First, merge all the preset configs from left to right\n if (inputConfig.extends?.length) {\n // Compile templates\n inputConfig.extends = inputConfig.extends.map((tmpl) =>\n template.compile(tmpl, {}),\n );\n for (const preset of inputConfig.extends) {\n // don't attempt to merge any internal presets if we're not expecting to\n if (!mergeInternalPresets && internal.isInternal(preset)) {\n logger.once.trace(\n { ignoredPreset: preset, mergeInternalPresets },\n 'Not merging preset',\n );\n // ... but make sure we note that we haven't resolved it\n allVisitedPresets.unmerged.add(preset);\n continue;\n }\n\n if (shouldResolvePreset(preset, existingPresets, ignorePresets)) {\n logger.trace(`Resolving preset \"${preset}\"`);\n const fetchedPreset = await fetchPreset(\n preset,\n baseConfig,\n inputConfig,\n existingPresets,\n );\n const { config: presetConfig, visitedPresets } =\n await resolveConfigPresets(\n fetchedPreset,\n baseConfig ?? inputConfig,\n ignorePresets,\n existingPresets.concat([preset]),\n mergeInternalPresets,\n );\n if (inputConfig?.ignoreDeps?.length === 0) {\n delete presetConfig.description;\n }\n\n config = mergeChildConfig(config, presetConfig);\n allVisitedPresets.merged.add(preset);\n\n // then also make sure we've noted any nested presets we've merged\n for (const mergedPreset of visitedPresets.merged) {\n allVisitedPresets.merged.add(mergedPreset);\n }\n // ... or not merged\n for (const unmergedPreset of visitedPresets.unmerged) {\n allVisitedPresets.unmerged.add(unmergedPreset);\n }\n }\n }\n }\n logger.trace({ config }, `Post-preset resolve config`);\n // Now assign \"regular\" config on top\n config = mergeChildConfig(config, inputConfig);\n delete config.extends;\n delete config.ignorePresets;\n logger.trace({ config }, `Post-merge resolve config`);\n for (const [key, val] of Object.entries(config) as [\n keyof AllConfig,\n unknown,\n ][]) {\n const ignoredKeys = ['content', 'onboardingConfig'];\n if (isArray(val)) {\n // Resolve nested objects inside arrays\n config[key] = [] as never; // type can't be narrowed\n for (const element of val) {\n if (isObject(element)) {\n const { config: presetConfig, visitedPresets: visited } =\n await resolveConfigPresets(\n element,\n baseConfig,\n ignorePresets,\n existingPresets,\n mergeInternalPresets,\n );\n (config[key] as RenovateConfig[]).push(presetConfig);\n\n // then also make sure we've noted any nested presets we've merged\n for (const mergedPreset of visited.merged) {\n allVisitedPresets.merged.add(mergedPreset);\n }\n // ... or not merged\n for (const unmergedPreset of visited.unmerged) {\n allVisitedPresets.unmerged.add(unmergedPreset);\n }\n } else {\n (config[key] as unknown[]).push(element);\n }\n }\n } else if (isObject(val) && !ignoredKeys.includes(key)) {\n // Resolve nested objects\n logger.trace(`Resolving object \"${key}\"`);\n const { config: presetConfig, visitedPresets: visited } =\n await resolveConfigPresets(\n val,\n baseConfig,\n ignorePresets,\n existingPresets,\n mergeInternalPresets,\n );\n config[key] = presetConfig as never; // type can't be narrowed\n\n // then also make sure we've noted any nested presets we've merged\n for (const mergedPreset of visited.merged) {\n allVisitedPresets.merged.add(mergedPreset);\n }\n // ... or not merged\n for (const unmergedPreset of visited.unmerged) {\n allVisitedPresets.unmerged.add(unmergedPreset);\n }\n }\n }\n logger.trace({ config: inputConfig }, 'Input config');\n logger.trace(\n { config, visitedPresets: allVisitedPresets },\n 'Resolved config',\n );\n\n return {\n config,\n visitedPresets: {\n merged: Array.from(allVisitedPresets.merged),\n unmerged: Array.from(allVisitedPresets.unmerged),\n },\n };\n}\n\nasync function fetchPreset(\n preset: string,\n baseConfig: RenovateConfig | undefined,\n inputConfig: AllConfig,\n existingPresets: string[],\n): Promise<AllConfig> {\n try {\n return await getPreset(preset, baseConfig ?? inputConfig);\n } catch (err) {\n logger.debug({ preset, err }, 'Preset fetch error');\n if (err instanceof ExternalHostError) {\n throw err;\n }\n if (err.message === PLATFORM_RATE_LIMIT_EXCEEDED) {\n throw err;\n }\n const error = new Error(CONFIG_VALIDATION);\n if (err.message === PRESET_DEP_NOT_FOUND) {\n error.validationError = `Cannot find preset's package (${preset})`;\n } else if (err.message === PRESET_RENOVATE_CONFIG_NOT_FOUND) {\n error.validationError = `Preset package is missing a renovate-config entry (${preset})`;\n } else if (err.message === PRESET_NOT_FOUND) {\n error.validationError = `Preset name not found within published preset config (${preset})`;\n } else if (err.message === PRESET_INVALID) {\n error.validationError = `Preset is invalid (${preset})`;\n } else if (err.message === PRESET_PROHIBITED_SUBPRESET) {\n error.validationError = `Sub-presets cannot be combined with a custom path (${preset})`;\n } else if (err.message === PRESET_INVALID_JSON) {\n error.validationError = `Preset is invalid JSON (${preset})`;\n } else {\n error.validationError = `Preset caused unexpected error (${preset})`;\n }\n if (existingPresets.length) {\n error.validationError +=\n '. Note: this is a *nested* preset so please contact the preset author if you are unable to fix it yourself.';\n }\n logger.info(\n { validationError: error.validationError },\n 'Throwing preset error',\n );\n throw error;\n }\n}\n\nfunction shouldResolvePreset(\n preset: string,\n existingPresets: string[],\n ignorePresets: string[],\n): boolean {\n if (existingPresets.includes(preset)) {\n logger.debug(\n `Already seen preset ${preset} in [${existingPresets.join(', ')}]`,\n );\n return false;\n }\n if (ignorePresets.includes(preset)) {\n logger.debug(\n `Ignoring preset ${preset} in [${existingPresets.join(', ')}]`,\n );\n return false;\n }\n return true;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,MAAM,sBAAgE;CACpE,eAAe,OAAO;CACtB,aAAa,OAAO;CACpB,cAAc,OAAO;CACrB,cAAc,OAAO;CACrB,YAAY,OAA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AAM,kBAAkB,sBAAsB,OAAO;OAChD,IAAI,IAAI,YAAA,yBACb,MAAM,kBAAkB,sDAAsD,OAAO;OAChF,IAAI,IAAI,YAAA,uBACb,MAAM,kBAAkB,2BAA2B,OAAO;OAE1D,MAAM,kBAAkB,mCAAmC,OAAO;EAEpE,IAAI,gBAAgB,QAClB,MAAM,mBACJ;EAEJ,OAAO,KACL,EAAE,iBAAiB,MAAM,gBAAgB,GACzC,uBACF;EACA,MAAM;CACR;AACF;AAEA,SAAS,oBACP,QACA,iBACA,eACS;CACT,IAAI,gBAAgB,SAAS,MAAM,GAAG;EACpC,OAAO,MACL,uBAAuB,OAAO,OAAO,gBAAgB,KAAK,IAAI,EAAE,EAClE;EACA,OAAO;CACT;CACA,IAAI,cAAc,SAAS,MAAM,GAAG;EAClC,OAAO,MACL,mBAAmB,OAAO,OAAO,gBAAgB,KAAK,IAAI,EAAE,EAC9D;EACA,OAAO;CACT;CACA,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"validation.js","names":["regexOrGlobValidator.check","matchBaseBranchesValidator.check"],"sources":["../../lib/config/validation.ts"],"sourcesContent":["import is, {\n isArray,\n isEmptyString,\n isNonEmptyArray,\n isNonEmptyString,\n isObject,\n isPlainObject,\n isString,\n isUndefined,\n} from '@sindresorhus/is';\nimport type { PlatformId } from '../constants/index.ts';\nimport { instrument } from '../instrumentation/index.ts';\nimport { logger } from '../logger/index.ts';\nimport {\n AllManagersListLiteral,\n CustomManagersListLiteral,\n} from '../manager-list.generated.ts';\nimport { isCustomManager } from '../modules/manager/custom/index.ts';\nimport type { CustomManager } from '../modules/manager/custom/types.ts';\nimport type { HostRule } from '../types/index.ts';\nimport { packageCacheNamespaces } from '../util/cache/package/namespaces.ts';\nimport { getToolConfig } from '../util/exec/containerbase.ts';\nimport { isConstraintName, isToolName } from '../util/exec/types.ts';\nimport { 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 { parsePreset } from './presets/parse.ts';\nimport type {\n AllConfig,\n AllowedParents,\n RenovateConfig,\n RenovateOptions,\n StatusCheckKey,\n ValidationMessage,\n ValidationResult,\n} from './types.ts';\nimport { allowedStatusCheckStrings } from './types.ts';\nimport * as matchBaseBranchesValidator from './validation-helpers/match-base-branches.ts';\nimport * as regexOrGlobValidator from './validation-helpers/regex-glob-matchers.ts';\nimport {\n getParentName,\n isFalseGlobal,\n validateJSONataManagerFields,\n validateNumber,\n validatePlainObject,\n validateRegexManagerFields,\n} from './validation-helpers/utils.ts';\n\nconst options = getOptions();\n\nlet optionsInitialized = false;\nlet optionTypes: Record<string, RenovateOptions['type']>;\nlet optionParents: Record<string, AllowedParents[]>;\nlet optionGlobals: Set<string>;\nlet optionInherits: Set<string>;\nlet optionRegexOrGlob: Set<string>;\nlet optionAllowsNegativeIntegers: Set<string>;\nlet optionSupportsTemplating: Set<string>;\n\nconst managerList: readonly string[] = AllManagersListLiteral;\n\nconst allManagersList: readonly string[] = [\n ...AllManagersListLiteral,\n ...CustomManagersListLiteral,\n];\n\nconst topLevelObjects = [...managerList, 'env'];\n\nconst ignoredNodes = [\n '$schema',\n 'headers',\n 'depType',\n 'npmToken',\n 'packageFile',\n 'forkToken',\n 'repository',\n 'vulnerabilityAlertsOnly',\n 'vulnerabilityAlert',\n 'isVulnerabilityAlert',\n 'vulnerabilityFixVersion', // not intended to be used by end users but may be by Mend apps\n 'copyLocalLibs', // deprecated - functionality is now enabled by default\n 'prBody', // deprecated\n 'minimumConfidence', // undocumented feature flag\n];\nconst tzRe = regEx(/^:timezone\\((.+)\\)$/);\nconst rulesRe = regEx(/p.*Rules\\[\\d+\\]$/);\n\nfunction isIgnored(key: string): boolean {\n return ignoredNodes.includes(key);\n}\n\nfunction getUnsupportedEnabledManagers(enabledManagers: string[]): string[] {\n return enabledManagers.filter(\n (manager) => !allManagersList.includes(manager.replace('custom.', '')),\n );\n}\n\nfunction getDeprecationMessage(option: string): string | undefined {\n const deprecatedOptions: Record<string, string | undefined> = {\n branchName: `Direct editing of branchName is now deprecated. Please edit branchPrefix, additionalBranchPrefix, or branchTopic instead`,\n commitMessage: `Direct editing of commitMessage is now deprecated. Please edit commitMessage's subcomponents instead.`,\n prTitle: `Direct editing of prTitle is now deprecated. Please edit commitMessage subcomponents instead as they will be passed through to prTitle.`,\n };\n if (deprecatedOptions[option]) {\n return deprecatedOptions[option];\n }\n\n const found = options.find((o) => o.name === option);\n if (!found) {\n return undefined;\n }\n\n if (!found.deprecationMsg) {\n return undefined;\n }\n\n return `The '${option}' option is deprecated: ${found.deprecationMsg}`;\n}\n\nfunction isInhertConfigOption(key: string): boolean {\n return optionInherits.has(key);\n}\n\nfunction isRegexOrGlobOption(key: string): boolean {\n return optionRegexOrGlob.has(key);\n}\n\nfunction isGlobalOption(key: string): boolean {\n return optionGlobals.has(key);\n}\n\nfunction initOptions(): void {\n if (optionsInitialized) {\n return;\n }\n\n optionParents = {};\n optionInherits = new Set();\n optionTypes = {};\n optionRegexOrGlob = new Set();\n optionGlobals = new Set();\n optionAllowsNegativeIntegers = new Set();\n optionSupportsTemplating = new Set();\n\n for (const option of options) {\n optionTypes[option.name] = option.type;\n\n if (option.parents) {\n optionParents[option.name] = option.parents;\n }\n\n if (option.inheritConfigSupport) {\n optionInherits.add(option.name);\n }\n\n if (option.patternMatch) {\n optionRegexOrGlob.add(option.name);\n }\n\n if (option.globalOnly) {\n optionGlobals.add(option.name);\n }\n\n if (option.allowNegative) {\n optionAllowsNegativeIntegers.add(option.name);\n }\n\n if (option.supportsTemplating) {\n optionSupportsTemplating.add(option.name);\n }\n }\n\n optionsInitialized = true;\n}\n\nexport async function validateConfig(\n configType: 'global' | 'inherit' | 'repo',\n config: AllConfig,\n isPreset?: boolean,\n parentPath?: string,\n): Promise<ValidationResult> {\n return instrument(\n `validateConfig(${configType}, ${JSON.stringify(parentPath)})`,\n async () => {\n initOptions();\n\n let errors: ValidationMessage[] = [];\n let warnings: ValidationMessage[] = [];\n\n for (const [key, val] of Object.entries(config)) {\n const currentPath = parentPath ? `${parentPath}.${key}` : key;\n /* v8 ignore next 7 -- TODO: add test */\n if (key === '__proto__') {\n errors.push({\n topic: 'Config security error',\n message: '__proto__',\n });\n continue;\n }\n if (\n parentPath &&\n parentPath !== 'onboardingConfig' &&\n topLevelObjects.includes(key)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `The \"${key}\" object can only be configured at the top level of a config but was found inside \"${parentPath}\"`,\n });\n }\n\n if (isGlobalOption(key)) {\n if (configType === 'global') {\n await validateGlobalConfig(\n key,\n val,\n optionTypes[key],\n warnings,\n errors,\n currentPath,\n config,\n );\n continue;\n } else if (\n !isFalseGlobal(key, parentPath) &&\n !(configType === 'inherit' && isInhertConfigOption(key))\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `The \"${key}\" option is a global option reserved only for Renovate's global configuration and cannot be configured within a repository's config file.`,\n });\n continue;\n }\n }\n if (key === 'enabledManagers' && val) {\n const unsupportedManagers = getUnsupportedEnabledManagers(\n val as string[],\n );\n if (isNonEmptyArray(unsupportedManagers)) {\n errors.push({\n topic: 'Configuration Error',\n message: `The following managers configured in enabledManagers are not supported: \"${unsupportedManagers.join(\n ', ',\n )}\"`,\n });\n }\n }\n if (key === 'registryUrls' && !parentPath && isNonEmptyArray(val)) {\n warnings.push({\n topic: 'Configuration Warning',\n message:\n 'Setting `registryUrls` at the top level of your config will apply it to all managers and datasources, which can cause the wrong registry URL to be used for some packages. Use `registryUrls` inside `packageRules` to target specific managers or packages.',\n });\n }\n if (\n key === 'defaultRegistryUrls' &&\n !parentPath &&\n isNonEmptyArray(val)\n ) {\n warnings.push({\n topic: 'Configuration Warning',\n message:\n 'Setting `defaultRegistryUrls` at the top level of your config will apply it to all managers and datasources, which can cause the wrong registry URL to be used for some packages. Use `defaultRegistryUrls` inside `packageRules` to target specific managers or packages.',\n });\n }\n if (\n !isIgnored(key) && // We need to ignore some reserved keys\n !(is as any).function(val) // Ignore all functions\n ) {\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: 'Deprecation Warning',\n message: getDeprecationMessage(key)!,\n });\n }\n if (optionSupportsTemplating.has(key) && val) {\n try {\n // TODO: types (#22198)\n template.validate((val as string).toString());\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid template in config path: ${currentPath}`,\n });\n }\n }\n const parentName = getParentName(parentPath);\n if (\n !isPreset &&\n optionParents[key] &&\n !optionParents[key].includes(parentName as AllowedParents)\n ) {\n // TODO: types (#22198)\n const options = optionParents[key]?.toSorted().join(', ');\n const message = `\"${key}\" can't be used in \"${parentName}\". Allowed objects: ${options}.`;\n warnings.push({\n topic: `${parentPath ? `${parentPath}.` : ''}${key}`,\n message,\n });\n }\n\n // v8 ignore else -- intentionally unhandled - if we knew what was to be covered here, we'd add validation\n if (!optionTypes[key]) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid configuration option: ${currentPath}`,\n });\n } else if (key === 'schedule') {\n const [validSchedule, errorMessage] = hasValidSchedule(\n val as string[],\n );\n if (!validSchedule) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid ${currentPath}: \\`${errorMessage}\\``,\n });\n }\n } else if (\n [\n 'allowedVersions',\n 'matchCurrentVersion',\n 'matchCurrentValue',\n 'matchNewValue',\n ].includes(key) &&\n isRegexMatch(val)\n ) {\n if (!getRegexPredicate(val)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${val}\\``,\n });\n }\n } else if (key === 'timezone' && val !== null) {\n const [validTimezone, errorMessage] = hasValidTimezone(\n val as string,\n );\n if (!validTimezone) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n } else if (val !== null) {\n const type = optionTypes[key];\n if (type === 'boolean') {\n if (val !== true && val !== false) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val})`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n errors.push(\n ...validateNumber(key, val, allowsNegative, currentPath),\n );\n } else if (type === 'array' && val) {\n if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n configType,\n subval as RenovateConfig,\n isPreset,\n `${currentPath}[${subIndex}]`,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n if (isRegexOrGlobOption(key)) {\n errors.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath,\n }),\n );\n }\n if (key === 'extends') {\n for (const subval of val) {\n if (isString(subval)) {\n if (\n configType !== 'global' &&\n subval.startsWith('global:')\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: you cannot extend from \"global:\" presets in a repository config's \"extends\"`,\n });\n }\n\n if (\n parentName === 'packageRules' &&\n subval.startsWith('group:')\n ) {\n warnings.push({\n topic: 'Configuration Warning',\n message: `${currentPath}: you should not extend \"group:\" presets`,\n });\n }\n if (tzRe.test(subval)) {\n const [, timezone] = tzRe.exec(subval)!;\n const [validTimezone, errorMessage] =\n hasValidTimezone(timezone);\n if (!validTimezone) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n }\n if (!subval.includes('{{')) {\n try {\n parsePreset(subval);\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: preset \"${subval}\" is not valid`,\n });\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: preset value is not a string`,\n });\n }\n }\n }\n\n if (key === 'commitTrailers') {\n for (const subval of val) {\n if (!isValidCommitTrailer(subval)) {\n errors.push({\n topic: 'Configuration 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 { config: resolved } = await resolveConfigPresets(\n packageRule as RenovateConfig,\n config,\n );\n const resolvedRule = migrateConfig({\n packageRules: [resolved],\n }).migratedConfig.packageRules![0];\n warnings.push(\n ...matchBaseBranchesValidator.check({\n resolvedRule,\n currentPath: `${currentPath}[${subIndex}]`,\n baseBranchPatterns: config.baseBranchPatterns!,\n }),\n );\n const selectorLength = Object.keys(resolvedRule).filter(\n (ruleKey) => selectors.includes(ruleKey),\n ).length;\n if (!selectorLength) {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one match* or exclude* selector. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: 'Configuration Error',\n message,\n });\n }\n if (selectorLength === Object.keys(resolvedRule).length) {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one non-match* or non-exclude* field. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n warnings.push({\n topic: 'Configuration Error',\n message,\n });\n }\n // It's too late to apply any of these options once you already have updates determined\n const preLookupOptions = [\n 'allowedVersions',\n 'extractVersion',\n 'followTag',\n 'ignoreDeps',\n 'ignoreUnstable',\n 'rangeStrategy',\n 'registryUrls',\n 'respectLatest',\n 'rollbackPrs',\n 'separateMajorMinor',\n 'separateMinorPatch',\n 'separateMultipleMajor',\n 'separateMultipleMinor',\n 'versioning',\n ] as const;\n if (isNonEmptyArray(resolvedRule.matchUpdateTypes)) {\n for (const option of preLookupOptions) {\n if (resolvedRule[option] !== undefined) {\n const message = `${currentPath}[${subIndex}]: packageRules cannot combine both matchUpdateTypes and ${option}. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: 'Configuration Error',\n message,\n });\n }\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath} must contain JSON objects`,\n });\n }\n }\n }\n if (key === 'customManagers') {\n const allowedKeys = [\n 'customType',\n 'description',\n 'fileFormat',\n 'managerFilePatterns',\n 'matchStrings',\n 'matchStringsStrategy',\n 'depNameTemplate',\n 'packageNameTemplate',\n 'datasourceTemplate',\n 'versioningTemplate',\n 'registryUrlTemplate',\n 'currentValueTemplate',\n 'extractVersionTemplate',\n 'autoReplaceStringTemplate',\n 'depTypeTemplate',\n ];\n for (const customManager of val as CustomManager[]) {\n if (\n Object.keys(customManager).some(\n (k) => !allowedKeys.includes(k),\n )\n ) {\n const disallowedKeys = Object.keys(customManager).filter(\n (k) => !allowedKeys.includes(k),\n );\n errors.push({\n topic: 'Configuration Error',\n message: `Custom Manager contains disallowed fields: ${disallowedKeys.join(\n ', ',\n )}`,\n });\n } else if (\n isNonEmptyString(customManager.customType) &&\n isCustomManager(customManager.customType)\n ) {\n if (isNonEmptyArray(customManager.managerFilePatterns)) {\n switch (customManager.customType) {\n case 'regex':\n validateRegexManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n case 'jsonata':\n validateJSONataManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Each Custom Manager must contain a non-empty managerFilePatterns array`,\n });\n }\n } else {\n if (\n isEmptyString(customManager.customType) ||\n isUndefined(customManager.customType)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Each Custom Manager must contain a non-empty customType string`,\n });\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid customType: ${customManager.customType}. Key is not a custom manager`,\n });\n }\n }\n }\n }\n if (['matchPackageNames', 'matchDepNames'].includes(key)) {\n const startPattern = regEx(/!?\\//);\n const endPattern = regEx(/\\/g?i?$/);\n for (const pattern of val as string[]) {\n if (\n startPattern.test(pattern) &&\n endPattern.test(pattern)\n ) {\n try {\n // regEx isn't aware of our !/ prefix but can handle the suffix\n regEx(pattern.replace(startPattern, '/'));\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${pattern}\\``,\n });\n }\n }\n }\n }\n if (key === 'baseBranchPatterns') {\n for (const baseBranchPattern of val as string[]) {\n if (\n isRegexMatch(baseBranchPattern) &&\n !getRegexPredicate(baseBranchPattern)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${baseBranchPattern}\\``,\n });\n }\n }\n }\n if (\n (selectors.includes(key) ||\n key === 'matchCurrentVersion' ||\n key === 'matchCurrentValue') &&\n // TODO: can be undefined ? #22198\n !rulesRe.test(parentPath!) && // Inside a packageRule\n (isString(parentPath) || !isPreset) // top level in a preset\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${key} should be inside a \\`packageRule\\` only`,\n });\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a list (Array)`,\n });\n }\n } else if (type === 'string') {\n if (!isString(val)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a string`,\n });\n }\n } else if (type === 'object') {\n if (isPlainObject(val)) {\n if (key === 'registryAliases') {\n const res = validatePlainObject(val);\n if (res !== true) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${res}\\` configuration: value is not a string`,\n });\n }\n } else if (key === 'env') {\n const allowedEnvVars =\n configType === 'global'\n ? (config.allowedEnv ?? [])\n : GlobalConfig.get('allowedEnv');\n for (const [envVarName, envVarValue] of Object.entries(val)) {\n if (!isString(envVarValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid env variable value: \\`${currentPath}.${envVarName}\\` must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(envVarName, allowedEnvVars)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Env variable name \\`${envVarName}\\` is not allowed by this bot's \\`allowedEnv\\`.`,\n });\n }\n }\n } else if (key === 'statusCheckNames') {\n for (const [\n statusCheckKey,\n statusCheckValue,\n ] of Object.entries(val)) {\n if (\n !allowedStatusCheckStrings.includes(\n statusCheckKey as StatusCheckKey,\n )\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${statusCheckKey}\\` configuration: key is not allowed.`,\n });\n }\n if (\n !(isString(statusCheckValue) || null === statusCheckValue)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${statusCheckKey}\\` configuration: status check is not a string.`,\n });\n continue;\n }\n }\n } else if (key === 'statusCheckWhen') {\n const allowedWhenValues = ['always', 'never', 'failed'];\n for (const [\n statusCheckKey,\n statusCheckValue,\n ] of Object.entries(val)) {\n if (\n !allowedStatusCheckStrings.includes(\n statusCheckKey as StatusCheckKey,\n )\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${statusCheckKey}\\` configuration: key is not allowed.`,\n });\n }\n if (\n !isString(statusCheckValue) ||\n !allowedWhenValues.includes(statusCheckValue)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${statusCheckKey}\\` configuration: value must be one of \"always\", \"never\", or \"failed\".`,\n });\n continue;\n }\n }\n } else if (key === 'customDatasources') {\n const allowedKeys = [\n 'description',\n 'defaultRegistryUrlTemplate',\n 'format',\n 'transformTemplates',\n ];\n for (const [\n customDatasourceName,\n customDatasourceValue,\n ] of Object.entries(val)) {\n if (!isPlainObject(customDatasourceValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${customDatasourceName}\\` configuration: customDatasource is not an object`,\n });\n continue;\n }\n for (const [subKey, subValue] of Object.entries(\n customDatasourceValue,\n )) {\n if (!allowedKeys.includes(subKey)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: key is not allowed`,\n });\n } else if (subKey === 'transformTemplates') {\n if (!isArray(subValue, isString)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of string`,\n });\n }\n } else if (subKey === 'description') {\n if (\n !(isString(subValue) || isArray(subValue, isString))\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of strings`,\n });\n }\n } else if (!isString(subValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is a string`,\n });\n }\n }\n }\n } else if (key === 'installTools') {\n for (const toolName of Object.keys(val)) {\n if (!isToolName(toolName)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${toolName}\\` configuration: not a valid tool name.`,\n });\n }\n }\n } else if (key === 'constraints') {\n const { get: getVersioning } =\n await import('../modules/versioning/index.ts');\n for (const [k, v] of Object.entries(val)) {\n if (!isString(v)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\` should be an object of key-value pairs of constraints and their value`,\n });\n break;\n }\n\n if (!isConstraintName(k)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\`: \\`${k}\\` is not a supported constraint name`,\n });\n } else if (isToolName(k)) {\n // TODO: #31831\n const versioningId = getToolConfig(k).versioning;\n const versioning = getVersioning(versioningId);\n if (!versioning.isValid(v)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}=${v}\\` is not a valid tool version constraint, according to \\`${versioningId}\\` versioning`,\n });\n }\n }\n }\n } else if (key === 'constraintsVersioning') {\n for (const [k, v] of Object.entries(val)) {\n if (!isString(v)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\` should be an object of key-value pairs of additional constraint names and their versioning`,\n });\n break;\n }\n\n if (isToolName(k)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\` is not a valid additional constraint name, as \\`${k}\\` is a tool name, and \\`constraintsVersioning\\` can only override the versioning for a non-tool constraint`,\n });\n } else if (isConstraintName(k)) {\n const versioningName = v.split(':')[0];\n if (\n !AllVersioningsListLiteral.includes(\n versioningName as VersioningName,\n )\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}=${v}\\`: \\`${v}\\` is not a valid versioning scheme`,\n });\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\`: \\`${k}\\` is not a known additional constraint name`,\n });\n }\n }\n } else {\n const ignoredObjects = options\n .filter((option) => option.freeChoice)\n .map((option) => option.name);\n if (!ignoredObjects.includes(key)) {\n const subValidation = await validateConfig(\n configType,\n val,\n isPreset,\n currentPath,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a json object`,\n });\n }\n } else {\n // v8 ignore next -- intentionally unhandled - if we knew what was to be covered here, we'd add validation\n logger.debug(\n {},\n `Unhandled validation for ${type} at \\`${currentPath}\\``,\n );\n }\n }\n }\n\n if (key === 'hostRules' && isArray(val)) {\n const allowedHeaders =\n configType === 'global'\n ? (config.allowedHeaders ?? [])\n : GlobalConfig.get('allowedHeaders');\n for (const rule of val as HostRule[]) {\n if (isNonEmptyString(rule.matchHost)) {\n if (\n rule.matchHost.includes('://') &&\n parseUrl(rule.matchHost) === null\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules matchHost \\`${rule.matchHost}\\` is not a valid URL.`,\n });\n }\n } else if (isEmptyString(rule.matchHost)) {\n errors.push({\n topic: 'Configuration Error',\n message:\n 'Invalid value for hostRules matchHost. It cannot be an empty string.',\n });\n }\n\n if (!rule.headers) {\n continue;\n }\n for (const [header, value] of Object.entries(rule.headers)) {\n if (!isString(value)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid hostRules headers value configuration: header must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(header, allowedHeaders)) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules header \\`${header}\\` is not allowed by this bot's \\`allowedHeaders\\`.`,\n });\n }\n }\n }\n }\n\n if (key === 'matchJsonata' && isArray(val, isString)) {\n for (const expression of val) {\n const res = getExpression(expression);\n if (res instanceof Error) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid JSONata expression for ${currentPath}: ${res.message}`,\n });\n }\n }\n }\n }\n\n function sortAll(a: ValidationMessage, b: ValidationMessage): number {\n if (a.topic === b.topic) {\n return a.message > b.message ? 1 : -1;\n }\n return a.topic > b.topic ? 1 : -1;\n }\n\n errors.sort(sortAll);\n warnings.sort(sortAll);\n return { errors, warnings };\n },\n );\n}\n\n/**\n * Basic validation for global config options\n */\nasync function validateGlobalConfig(\n key: string,\n val: unknown,\n type: string,\n warnings: ValidationMessage[],\n errors: ValidationMessage[],\n currentPath: string | undefined,\n config: AllConfig,\n): Promise<void> {\n /* v8 ignore next 5 -- not testable yet */\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: 'Deprecation Warning',\n message: getDeprecationMessage(key)!,\n });\n }\n\n if (key === 'binarySource' && val === 'docker') {\n warnings.push({\n topic: 'Deprecation Warning',\n message:\n 'Usage of `binarySource=docker` is deprecated, and will be removed in the future. Please migrate to `binarySource=install`. Feedback on the usage of `binarySource=docker` is welcome at https://github.com/renovatebot/renovate/discussions/40742',\n });\n }\n\n if (val !== null) {\n // v8 ignore else -- TODO: add test #40625\n if (type === 'string') {\n if (isString(val)) {\n if (\n key === 'onboardingConfigFileName' &&\n !getPossibleConfigFileNames({\n configFileNames: config.configFileNames,\n platform: config.platform,\n }).includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${getPossibleConfigFileNames(\n {\n configFileNames: config.configFileNames,\n platform: config.platform,\n },\n ).join(', ')}.`,\n });\n } else if (\n key === 'repositoryCache' &&\n !['enabled', 'disabled', 'reset'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['enabled', 'disabled', 'reset'].join(', ')}.`,\n });\n } else if (\n key === 'dryRun' &&\n !['extract', 'lookup', 'full'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['extract', 'lookup', 'full'].join(', ')}.`,\n });\n } else if (\n key === 'binarySource' &&\n !['docker', 'global', 'install', 'hermit'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['docker', 'global', 'install', 'hermit'].join(', ')}.`,\n });\n } else if (\n key === 'requireConfig' &&\n !['required', 'optional', 'ignored'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['required', 'optional', 'ignored'].join(', ')}.`,\n });\n } else if (\n key === 'gitUrl' &&\n !['default', 'ssh', 'endpoint'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['default', 'ssh', 'endpoint'].join(', ')}.`,\n });\n }\n\n if (\n key === 'reportType' &&\n ['s3', 'file'].includes(val) &&\n !isString(config.reportPath)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `reportType '${val}' requires a configured reportPath`,\n });\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a string.`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(...validateNumber(key, val, allowsNegative, currentPath));\n } else if (type === 'boolean') {\n if (val !== true && val !== false) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val}).`,\n });\n }\n } else if (type === 'array') {\n if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n 'global',\n subval as AllConfig,\n false,\n `${currentPath}[${subIndex}]`,\n );\n warnings.push(...subValidation.warnings);\n errors.push(...subValidation.errors);\n }\n }\n\n if (isRegexOrGlobOption(key)) {\n warnings.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath: currentPath!,\n }),\n );\n }\n if (key === 'gitNoVerify') {\n const allowedValues = ['commit', 'push'];\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n if (key === 'mergeConfidenceDatasources') {\n const allowedValues = supportedDatasources;\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${value}\\` for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a list (Array).`,\n });\n }\n } else if (type === 'object') {\n if (isPlainObject(val)) {\n if (key === 'onboardingConfig') {\n const subValidation = await validateConfig('repo', val);\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'force') {\n const subValidation = await validateConfig('global', val);\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'cacheTtlOverride') {\n for (const [subKey, subValue] of Object.entries(val)) {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(\n ...validateNumber(\n key,\n subValue,\n allowsNegative,\n currentPath,\n subKey,\n ),\n );\n\n if (\n !(packageCacheNamespaces as readonly string[]).includes(subKey) &&\n !anyMatchRegexOrGlobList(\n packageCacheNamespaces as unknown as string[],\n [subKey],\n )\n ) {\n errors.push({\n message: `${currentPath}: namespace \\`${subKey}\\` does not exist`,\n topic: 'Configuration Error',\n });\n }\n }\n } else {\n const res = validatePlainObject(val);\n if (res !== true) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${res}\\` configuration: value must be a string.`,\n });\n }\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a JSON object.`,\n });\n }\n }\n }\n}\n\nfunction getPossibleConfigFileNames({\n configFileNames,\n platform,\n}: {\n configFileNames?: string[];\n platform?: PlatformId;\n}): string[] {\n const filenames = getConfigFileNames(platform);\n if (isNonEmptyArray(configFileNames)) {\n return filenames.concat(configFileNames);\n }\n\n return filenames;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,MAAM,UAAU,WAAW;AAE3B,IAAI,qBAAqB;AACzB,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,I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AS,OAC3C,cAAc,MAChB,GACE,SAAS,KAAK,OAAO;EAEzB,OAAO,IAAI,QAAQ,SAAS;GAC1B,MAAM,gBAAgB,MAAM,eAAe,UAAU,GAAG;GACxD,KAAK,MAAM,WAAW,cAAc,SAAS,OAC3C,cAAc,MAChB,GACE,SAAS,KAAK,OAAO;EAEzB,OAAO,IAAI,QAAQ,oBACjB,KAAK,MAAM,CAAC,QAAQ,aAAa,OAAO,QAAQ,GAAG,GAAG;GACpD,MAAM,iBAAiB,6BAA6B,IAAI,GAAG;GAC3D,SAAS,KACP,GAAG,eACD,KACA,UACA,gBACA,aACA,MACF,CACF;GAEA,IACE,CAAE,uBAA6C,SAAS,MAAM,KAC9D,CAAC,wBACC,wBACA,CAAC,MAAM,CACT,GAEA,OAAO,KAAK;IACV,SAAS,GAAG,YAAY,gBAAgB,OAAO;IAC/C,OAAO;GACT,CAAC;EAEL;OACK;GACL,MAAM,MAAM,oBAAoB,GAAG;GACnC,IAAI,QAAQ,MACV,SAAS,KAAK;IACZ,OAAO;IACP,SAAS,aAAa,YAAY,GAAG,IAAI;GAC3C,CAAC;EAEL;OAEA,SAAS,KAAK;GACZ,OAAO;GACP,SAAS,0BAA0B,YAAY;EACjD,CAAC;CAAA;AAIT;AAEA,SAAS,2BAA2B,EAClC,iBACA,YAIW;CACX,MAAM,YAAY,mBAAmB,QAAQ;CAC7C,IAAI,gBAAgB,eAAe,GACjC,OAAO,UAAU,OAAO,eAAe;CAGzC,OAAO;AACT"}
1
+ {"version":3,"file":"validation.js","names":["regexOrGlobValidator.check","matchBaseBranchesValidator.check"],"sources":["../../lib/config/validation.ts"],"sourcesContent":["import is, {\n isArray,\n isEmptyString,\n isNonEmptyArray,\n isNonEmptyString,\n isObject,\n isPlainObject,\n isString,\n isUndefined,\n} from '@sindresorhus/is';\nimport type { PlatformId } from '../constants/index.ts';\nimport { instrument } from '../instrumentation/index.ts';\nimport { logger } from '../logger/index.ts';\nimport {\n AllManagersListLiteral,\n CustomManagersListLiteral,\n} from '../manager-list.generated.ts';\nimport { isCustomManager } from '../modules/manager/custom/index.ts';\nimport type { CustomManager } from '../modules/manager/custom/types.ts';\nimport type { HostRule } from '../types/index.ts';\nimport { packageCacheNamespaces } from '../util/cache/package/namespaces.ts';\nimport { getToolConfig } from '../util/exec/containerbase.ts';\nimport { isConstraintName, isToolName } from '../util/exec/types.ts';\nimport { 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 { parsePreset } from './presets/parse.ts';\nimport type {\n AllConfig,\n AllowedParents,\n RenovateOptions,\n StatusCheckKey,\n ValidationMessage,\n ValidationResult,\n} from './types.ts';\nimport { allowedStatusCheckStrings } from './types.ts';\nimport * as matchBaseBranchesValidator from './validation-helpers/match-base-branches.ts';\nimport * as regexOrGlobValidator from './validation-helpers/regex-glob-matchers.ts';\nimport {\n getParentName,\n isFalseGlobal,\n validateJSONataManagerFields,\n validateNumber,\n validatePlainObject,\n validateRegexManagerFields,\n} from './validation-helpers/utils.ts';\n\nconst options = getOptions();\n\nlet optionsInitialized = false;\nlet optionTypes: Record<string, RenovateOptions['type']>;\nlet optionParents: Record<string, AllowedParents[]>;\nlet optionGlobals: Set<string>;\nlet optionInherits: Set<string>;\nlet optionRegexOrGlob: Set<string>;\nlet optionAllowsNegativeIntegers: Set<string>;\nlet optionSupportsTemplating: Set<string>;\n\nconst managerList: readonly string[] = AllManagersListLiteral;\n\nconst allManagersList: readonly string[] = [\n ...AllManagersListLiteral,\n ...CustomManagersListLiteral,\n];\n\nconst topLevelObjects = [...managerList, 'env'];\n\nconst ignoredNodes = [\n '$schema',\n 'headers',\n 'depType',\n 'npmToken',\n 'packageFile',\n 'forkToken',\n 'repository',\n 'vulnerabilityAlertsOnly',\n 'vulnerabilityAlert',\n 'isVulnerabilityAlert',\n 'vulnerabilityFixVersion', // not intended to be used by end users but may be by Mend apps\n 'copyLocalLibs', // deprecated - functionality is now enabled by default\n 'prBody', // deprecated\n 'minimumConfidence', // undocumented feature flag\n];\nconst tzRe = regEx(/^:timezone\\((.+)\\)$/);\nconst rulesRe = regEx(/p.*Rules\\[\\d+\\]$/);\n\nfunction isIgnored(key: string): boolean {\n return ignoredNodes.includes(key);\n}\n\nfunction getUnsupportedEnabledManagers(enabledManagers: string[]): string[] {\n return enabledManagers.filter(\n (manager) => !allManagersList.includes(manager.replace('custom.', '')),\n );\n}\n\nfunction getDeprecationMessage(option: string): string | undefined {\n const deprecatedOptions: Record<string, string | undefined> = {\n branchName: `Direct editing of branchName is now deprecated. Please edit branchPrefix, additionalBranchPrefix, or branchTopic instead`,\n commitMessage: `Direct editing of commitMessage is now deprecated. Please edit commitMessage's subcomponents instead.`,\n prTitle: `Direct editing of prTitle is now deprecated. Please edit commitMessage subcomponents instead as they will be passed through to prTitle.`,\n };\n if (deprecatedOptions[option]) {\n return deprecatedOptions[option];\n }\n\n const found = options.find((o) => o.name === option);\n if (!found) {\n return undefined;\n }\n\n if (!found.deprecationMsg) {\n return undefined;\n }\n\n return `The '${option}' option is deprecated: ${found.deprecationMsg}`;\n}\n\nfunction isInhertConfigOption(key: string): boolean {\n return optionInherits.has(key);\n}\n\nfunction isRegexOrGlobOption(key: string): boolean {\n return optionRegexOrGlob.has(key);\n}\n\nfunction isGlobalOption(key: string): boolean {\n return optionGlobals.has(key);\n}\n\nfunction initOptions(): void {\n if (optionsInitialized) {\n return;\n }\n\n optionParents = {};\n optionInherits = new Set();\n optionTypes = {};\n optionRegexOrGlob = new Set();\n optionGlobals = new Set();\n optionAllowsNegativeIntegers = new Set();\n optionSupportsTemplating = new Set();\n\n for (const option of options) {\n optionTypes[option.name] = option.type;\n\n if (option.parents) {\n optionParents[option.name] = option.parents;\n }\n\n if (option.inheritConfigSupport) {\n optionInherits.add(option.name);\n }\n\n if (option.patternMatch) {\n optionRegexOrGlob.add(option.name);\n }\n\n if (option.globalOnly) {\n optionGlobals.add(option.name);\n }\n\n if (option.allowNegative) {\n optionAllowsNegativeIntegers.add(option.name);\n }\n\n if (option.supportsTemplating) {\n optionSupportsTemplating.add(option.name);\n }\n }\n\n optionsInitialized = true;\n}\n\nexport async function validateConfig(\n configType: 'global' | 'inherit' | 'repo',\n config: AllConfig,\n isPreset?: boolean,\n parentPath?: string,\n): Promise<ValidationResult> {\n return instrument(\n `validateConfig(${configType}, ${JSON.stringify(parentPath)})`,\n async () => {\n initOptions();\n\n let errors: ValidationMessage[] = [];\n let warnings: ValidationMessage[] = [];\n\n for (const [key, val] of Object.entries(config)) {\n const currentPath = parentPath ? `${parentPath}.${key}` : key;\n /* v8 ignore next 7 -- TODO: add test */\n if (key === '__proto__') {\n errors.push({\n topic: 'Config security error',\n message: '__proto__',\n });\n continue;\n }\n if (\n parentPath &&\n parentPath !== 'onboardingConfig' &&\n topLevelObjects.includes(key)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `The \"${key}\" object can only be configured at the top level of a config but was found inside \"${parentPath}\"`,\n });\n }\n\n if (isGlobalOption(key)) {\n if (configType === 'global') {\n await validateGlobalConfig(\n key,\n val,\n optionTypes[key],\n warnings,\n errors,\n currentPath,\n config,\n );\n continue;\n } else if (\n !isFalseGlobal(key, parentPath) &&\n !(configType === 'inherit' && isInhertConfigOption(key))\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `The \"${key}\" option is a global option reserved only for Renovate's global configuration and cannot be configured within a repository's config file.`,\n });\n continue;\n }\n }\n if (key === 'enabledManagers' && val) {\n const unsupportedManagers = getUnsupportedEnabledManagers(\n val as string[],\n );\n if (isNonEmptyArray(unsupportedManagers)) {\n errors.push({\n topic: 'Configuration Error',\n message: `The following managers configured in enabledManagers are not supported: \"${unsupportedManagers.join(\n ', ',\n )}\"`,\n });\n }\n }\n if (key === 'registryUrls' && !parentPath && isNonEmptyArray(val)) {\n warnings.push({\n topic: 'Configuration Warning',\n message:\n 'Setting `registryUrls` at the top level of your config will apply it to all managers and datasources, which can cause the wrong registry URL to be used for some packages. Use `registryUrls` inside `packageRules` to target specific managers or packages.',\n });\n }\n if (\n key === 'defaultRegistryUrls' &&\n !parentPath &&\n isNonEmptyArray(val)\n ) {\n warnings.push({\n topic: 'Configuration Warning',\n message:\n 'Setting `defaultRegistryUrls` at the top level of your config will apply it to all managers and datasources, which can cause the wrong registry URL to be used for some packages. Use `defaultRegistryUrls` inside `packageRules` to target specific managers or packages.',\n });\n }\n if (\n !isIgnored(key) && // We need to ignore some reserved keys\n !(is as any).function(val) // Ignore all functions\n ) {\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: 'Deprecation Warning',\n message: getDeprecationMessage(key)!,\n });\n }\n if (optionSupportsTemplating.has(key) && val) {\n try {\n // TODO: types (#22198)\n template.validate((val as string).toString());\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid template in config path: ${currentPath}`,\n });\n }\n }\n const parentName = getParentName(parentPath);\n if (\n !isPreset &&\n optionParents[key] &&\n !optionParents[key].includes(parentName as AllowedParents)\n ) {\n // TODO: types (#22198)\n const options = optionParents[key]?.toSorted().join(', ');\n const message = `\"${key}\" can't be used in \"${parentName}\". Allowed objects: ${options}.`;\n warnings.push({\n topic: `${parentPath ? `${parentPath}.` : ''}${key}`,\n message,\n });\n }\n\n // v8 ignore else -- intentionally unhandled - if we knew what was to be covered here, we'd add validation\n if (!optionTypes[key]) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid configuration option: ${currentPath}`,\n });\n } else if (key === 'schedule') {\n const [validSchedule, errorMessage] = hasValidSchedule(\n val as string[],\n );\n if (!validSchedule) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid ${currentPath}: \\`${errorMessage}\\``,\n });\n }\n } else if (\n [\n 'allowedVersions',\n 'matchCurrentVersion',\n 'matchCurrentValue',\n 'matchNewValue',\n ].includes(key) &&\n isRegexMatch(val)\n ) {\n if (!getRegexPredicate(val)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${val}\\``,\n });\n }\n } else if (key === 'timezone' && val !== null) {\n const [validTimezone, errorMessage] = hasValidTimezone(\n val as string,\n );\n if (!validTimezone) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n } else if (val !== null) {\n const type = optionTypes[key];\n if (type === 'boolean') {\n if (val !== true && val !== false) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val})`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n errors.push(\n ...validateNumber(key, val, allowsNegative, currentPath),\n );\n } else if (type === 'array' && val) {\n if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n configType,\n subval,\n isPreset,\n `${currentPath}[${subIndex}]`,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n if (isRegexOrGlobOption(key)) {\n errors.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath,\n }),\n );\n }\n if (key === 'extends') {\n for (const subval of val) {\n if (isString(subval)) {\n if (\n configType !== 'global' &&\n subval.startsWith('global:')\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: you cannot extend from \"global:\" presets in a repository config's \"extends\"`,\n });\n }\n\n if (\n parentName === 'packageRules' &&\n subval.startsWith('group:')\n ) {\n warnings.push({\n topic: 'Configuration Warning',\n message: `${currentPath}: you should not extend \"group:\" presets`,\n });\n }\n if (tzRe.test(subval)) {\n const [, timezone] = tzRe.exec(subval)!;\n const [validTimezone, errorMessage] =\n hasValidTimezone(timezone);\n if (!validTimezone) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n }\n if (!subval.includes('{{')) {\n try {\n parsePreset(subval);\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: preset \"${subval}\" is not valid`,\n });\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: preset value is not a string`,\n });\n }\n }\n }\n\n if (key === 'commitTrailers') {\n for (const subval of val) {\n if (!isValidCommitTrailer(subval)) {\n errors.push({\n topic: 'Configuration 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 { config: resolved } = await resolveConfigPresets(\n packageRule,\n config,\n );\n const resolvedRule = migrateConfig({\n packageRules: [resolved],\n }).migratedConfig.packageRules![0];\n warnings.push(\n ...matchBaseBranchesValidator.check({\n resolvedRule,\n currentPath: `${currentPath}[${subIndex}]`,\n baseBranchPatterns: config.baseBranchPatterns!,\n }),\n );\n const selectorLength = Object.keys(resolvedRule).filter(\n (ruleKey) => selectors.includes(ruleKey),\n ).length;\n if (!selectorLength) {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one match* or exclude* selector. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: 'Configuration Error',\n message,\n });\n }\n if (selectorLength === Object.keys(resolvedRule).length) {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one non-match* or non-exclude* field. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n warnings.push({\n topic: 'Configuration Error',\n message,\n });\n }\n // It's too late to apply any of these options once you already have updates determined\n const preLookupOptions = [\n 'allowedVersions',\n 'extractVersion',\n 'followTag',\n 'ignoreDeps',\n 'ignoreUnstable',\n 'rangeStrategy',\n 'registryUrls',\n 'respectLatest',\n 'rollbackPrs',\n 'separateMajorMinor',\n 'separateMinorPatch',\n 'separateMultipleMajor',\n 'separateMultipleMinor',\n 'versioning',\n ] as const;\n if (isNonEmptyArray(resolvedRule.matchUpdateTypes)) {\n for (const option of preLookupOptions) {\n if (resolvedRule[option] !== undefined) {\n const message = `${currentPath}[${subIndex}]: packageRules cannot combine both matchUpdateTypes and ${option}. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: 'Configuration Error',\n message,\n });\n }\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath} must contain JSON objects`,\n });\n }\n }\n }\n if (key === 'customManagers') {\n const allowedKeys = [\n 'customType',\n 'description',\n 'fileFormat',\n 'managerFilePatterns',\n 'matchStrings',\n 'matchStringsStrategy',\n 'depNameTemplate',\n 'packageNameTemplate',\n 'datasourceTemplate',\n 'versioningTemplate',\n 'registryUrlTemplate',\n 'currentValueTemplate',\n 'extractVersionTemplate',\n 'autoReplaceStringTemplate',\n 'depTypeTemplate',\n ];\n for (const customManager of val as CustomManager[]) {\n if (\n Object.keys(customManager).some(\n (k) => !allowedKeys.includes(k),\n )\n ) {\n const disallowedKeys = Object.keys(customManager).filter(\n (k) => !allowedKeys.includes(k),\n );\n errors.push({\n topic: 'Configuration Error',\n message: `Custom Manager contains disallowed fields: ${disallowedKeys.join(\n ', ',\n )}`,\n });\n } else if (\n isNonEmptyString(customManager.customType) &&\n isCustomManager(customManager.customType)\n ) {\n if (isNonEmptyArray(customManager.managerFilePatterns)) {\n switch (customManager.customType) {\n case 'regex':\n validateRegexManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n case 'jsonata':\n validateJSONataManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Each Custom Manager must contain a non-empty managerFilePatterns array`,\n });\n }\n } else {\n if (\n isEmptyString(customManager.customType) ||\n isUndefined(customManager.customType)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Each Custom Manager must contain a non-empty customType string`,\n });\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid customType: ${customManager.customType}. Key is not a custom manager`,\n });\n }\n }\n }\n }\n if (['matchPackageNames', 'matchDepNames'].includes(key)) {\n const startPattern = regEx(/!?\\//);\n const endPattern = regEx(/\\/g?i?$/);\n for (const pattern of val as string[]) {\n if (\n startPattern.test(pattern) &&\n endPattern.test(pattern)\n ) {\n try {\n // regEx isn't aware of our !/ prefix but can handle the suffix\n regEx(pattern.replace(startPattern, '/'));\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${pattern}\\``,\n });\n }\n }\n }\n }\n if (key === 'baseBranchPatterns') {\n for (const baseBranchPattern of val as string[]) {\n if (\n isRegexMatch(baseBranchPattern) &&\n !getRegexPredicate(baseBranchPattern)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${baseBranchPattern}\\``,\n });\n }\n }\n }\n if (\n (selectors.includes(key) ||\n key === 'matchCurrentVersion' ||\n key === 'matchCurrentValue') &&\n // TODO: can be undefined ? #22198\n !rulesRe.test(parentPath!) && // Inside a packageRule\n (isString(parentPath) || !isPreset) // top level in a preset\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `${currentPath}: ${key} should be inside a \\`packageRule\\` only`,\n });\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a list (Array)`,\n });\n }\n } else if (type === 'string') {\n if (!isString(val)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a string`,\n });\n }\n } else if (type === 'object') {\n if (isPlainObject(val)) {\n if (key === 'registryAliases') {\n const res = validatePlainObject(val);\n if (res !== true) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${res}\\` configuration: value is not a string`,\n });\n }\n } else if (key === 'env') {\n const allowedEnvVars =\n configType === 'global'\n ? (config.allowedEnv ?? [])\n : GlobalConfig.get('allowedEnv');\n for (const [envVarName, envVarValue] of Object.entries(val)) {\n if (!isString(envVarValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid env variable value: \\`${currentPath}.${envVarName}\\` must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(envVarName, allowedEnvVars)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Env variable name \\`${envVarName}\\` is not allowed by this bot's \\`allowedEnv\\`.`,\n });\n }\n }\n } else if (key === 'statusCheckNames') {\n for (const [\n statusCheckKey,\n statusCheckValue,\n ] of Object.entries(val)) {\n if (\n !allowedStatusCheckStrings.includes(\n statusCheckKey as StatusCheckKey,\n )\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${statusCheckKey}\\` configuration: key is not allowed.`,\n });\n }\n if (\n !(isString(statusCheckValue) || null === statusCheckValue)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${statusCheckKey}\\` configuration: status check is not a string.`,\n });\n continue;\n }\n }\n } else if (key === 'statusCheckWhen') {\n const allowedWhenValues = ['always', 'never', 'failed'];\n for (const [\n statusCheckKey,\n statusCheckValue,\n ] of Object.entries(val)) {\n if (\n !allowedStatusCheckStrings.includes(\n statusCheckKey as StatusCheckKey,\n )\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${key}.${statusCheckKey}\\` configuration: key is not allowed.`,\n });\n }\n if (\n !isString(statusCheckValue) ||\n !allowedWhenValues.includes(statusCheckValue)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${statusCheckKey}\\` configuration: value must be one of \"always\", \"never\", or \"failed\".`,\n });\n continue;\n }\n }\n } else if (key === 'customDatasources') {\n const allowedKeys = [\n 'description',\n 'defaultRegistryUrlTemplate',\n 'format',\n 'transformTemplates',\n ];\n for (const [\n customDatasourceName,\n customDatasourceValue,\n ] of Object.entries(val)) {\n if (!isPlainObject(customDatasourceValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${customDatasourceName}\\` configuration: customDatasource is not an object`,\n });\n continue;\n }\n for (const [subKey, subValue] of Object.entries(\n customDatasourceValue,\n )) {\n if (!allowedKeys.includes(subKey)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: key is not allowed`,\n });\n } else if (subKey === 'transformTemplates') {\n if (!isArray(subValue, isString)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of string`,\n });\n }\n } else if (subKey === 'description') {\n if (\n !(isString(subValue) || isArray(subValue, isString))\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of strings`,\n });\n }\n } else if (!isString(subValue)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is a string`,\n });\n }\n }\n }\n } else if (key === 'installTools') {\n for (const toolName of Object.keys(val)) {\n if (!isToolName(toolName)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${toolName}\\` configuration: not a valid tool name.`,\n });\n }\n }\n } else if (key === 'constraints') {\n const { get: getVersioning } =\n await import('../modules/versioning/index.ts');\n for (const [k, v] of Object.entries(val)) {\n if (!isString(v)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\` should be an object of key-value pairs of constraints and their value`,\n });\n break;\n }\n\n if (!isConstraintName(k)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\`: \\`${k}\\` is not a supported constraint name`,\n });\n } else if (isToolName(k)) {\n // TODO: #31831\n const versioningId = getToolConfig(k).versioning;\n const versioning = getVersioning(versioningId);\n if (!versioning.isValid(v)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}=${v}\\` is not a valid tool version constraint, according to \\`${versioningId}\\` versioning`,\n });\n }\n }\n }\n } else if (key === 'constraintsVersioning') {\n for (const [k, v] of Object.entries(val)) {\n if (!isString(v)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\` should be an object of key-value pairs of additional constraint names and their versioning`,\n });\n break;\n }\n\n if (isToolName(k)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\` is not a valid additional constraint name, as \\`${k}\\` is a tool name, and \\`constraintsVersioning\\` can only override the versioning for a non-tool constraint`,\n });\n } else if (isConstraintName(k)) {\n const versioningName = v.split(':')[0];\n if (\n !AllVersioningsListLiteral.includes(\n versioningName as VersioningName,\n )\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}=${v}\\`: \\`${v}\\` is not a valid versioning scheme`,\n });\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}.${k}\\`: \\`${k}\\` is not a known additional constraint name`,\n });\n }\n }\n } else {\n const ignoredObjects = options\n .filter((option) => option.freeChoice)\n .map((option) => option.name);\n if (!ignoredObjects.includes(key)) {\n const subValidation = await validateConfig(\n configType,\n val,\n isPreset,\n currentPath,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a json object`,\n });\n }\n } else {\n // v8 ignore next -- intentionally unhandled - if we knew what was to be covered here, we'd add validation\n logger.debug(\n {},\n `Unhandled validation for ${type} at \\`${currentPath}\\``,\n );\n }\n }\n }\n\n if (key === 'hostRules' && isArray(val)) {\n const allowedHeaders =\n configType === 'global'\n ? (config.allowedHeaders ?? [])\n : GlobalConfig.get('allowedHeaders');\n for (const rule of val as HostRule[]) {\n if (isNonEmptyString(rule.matchHost)) {\n if (\n rule.matchHost.includes('://') &&\n parseUrl(rule.matchHost) === null\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules matchHost \\`${rule.matchHost}\\` is not a valid URL.`,\n });\n }\n } else if (isEmptyString(rule.matchHost)) {\n errors.push({\n topic: 'Configuration Error',\n message:\n 'Invalid value for hostRules matchHost. It cannot be an empty string.',\n });\n }\n\n if (!rule.headers) {\n continue;\n }\n for (const [header, value] of Object.entries(rule.headers)) {\n if (!isString(value)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid hostRules headers value configuration: header must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(header, allowedHeaders)) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules header \\`${header}\\` is not allowed by this bot's \\`allowedHeaders\\`.`,\n });\n }\n }\n }\n }\n\n if (key === 'matchJsonata' && isArray(val, isString)) {\n for (const expression of val) {\n const res = getExpression(expression);\n if (res instanceof Error) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid JSONata expression for ${currentPath}: ${res.message}`,\n });\n }\n }\n }\n }\n\n function sortAll(a: ValidationMessage, b: ValidationMessage): number {\n if (a.topic === b.topic) {\n return a.message > b.message ? 1 : -1;\n }\n return a.topic > b.topic ? 1 : -1;\n }\n\n errors.sort(sortAll);\n warnings.sort(sortAll);\n return { errors, warnings };\n },\n );\n}\n\n/**\n * Basic validation for global config options\n */\nasync function validateGlobalConfig(\n key: string,\n val: unknown,\n type: string,\n warnings: ValidationMessage[],\n errors: ValidationMessage[],\n currentPath: string | undefined,\n config: AllConfig,\n): Promise<void> {\n /* v8 ignore next 5 -- not testable yet */\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: 'Deprecation Warning',\n message: getDeprecationMessage(key)!,\n });\n }\n\n if (key === 'binarySource' && val === 'docker') {\n warnings.push({\n topic: 'Deprecation Warning',\n message:\n 'Usage of `binarySource=docker` is deprecated, and will be removed in the future. Please migrate to `binarySource=install`. Feedback on the usage of `binarySource=docker` is welcome at https://github.com/renovatebot/renovate/discussions/40742',\n });\n }\n\n if (val !== null) {\n // v8 ignore else -- TODO: add test #40625\n if (type === 'string') {\n if (isString(val)) {\n if (\n key === 'onboardingConfigFileName' &&\n !getPossibleConfigFileNames({\n configFileNames: config.configFileNames,\n platform: config.platform,\n }).includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${getPossibleConfigFileNames(\n {\n configFileNames: config.configFileNames,\n platform: config.platform,\n },\n ).join(', ')}.`,\n });\n } else if (\n key === 'repositoryCache' &&\n !['enabled', 'disabled', 'reset'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['enabled', 'disabled', 'reset'].join(', ')}.`,\n });\n } else if (\n key === 'dryRun' &&\n !['extract', 'lookup', 'full'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['extract', 'lookup', 'full'].join(', ')}.`,\n });\n } else if (\n key === 'binarySource' &&\n !['docker', 'global', 'install', 'hermit'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['docker', 'global', 'install', 'hermit'].join(', ')}.`,\n });\n } else if (\n key === 'requireConfig' &&\n !['required', 'optional', 'ignored'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['required', 'optional', 'ignored'].join(', ')}.`,\n });\n } else if (\n key === 'gitUrl' &&\n !['default', 'ssh', 'endpoint'].includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['default', 'ssh', 'endpoint'].join(', ')}.`,\n });\n }\n\n if (\n key === 'reportType' &&\n ['s3', 'file'].includes(val) &&\n !isString(config.reportPath)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `reportType '${val}' requires a configured reportPath`,\n });\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a string.`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(...validateNumber(key, val, allowsNegative, currentPath));\n } else if (type === 'boolean') {\n if (val !== true && val !== false) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val}).`,\n });\n }\n } else if (type === 'array') {\n if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n 'global',\n subval,\n false,\n `${currentPath}[${subIndex}]`,\n );\n warnings.push(...subValidation.warnings);\n errors.push(...subValidation.errors);\n }\n }\n\n if (isRegexOrGlobOption(key)) {\n warnings.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath: currentPath!,\n }),\n );\n }\n if (key === 'gitNoVerify') {\n const allowedValues = ['commit', 'push'];\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n if (key === 'mergeConfidenceDatasources') {\n const allowedValues = supportedDatasources;\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${value}\\` for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a list (Array).`,\n });\n }\n } else if (type === 'object') {\n if (isPlainObject(val)) {\n if (key === 'onboardingConfig') {\n const subValidation = await validateConfig('repo', val);\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'force') {\n const subValidation = await validateConfig('global', val);\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'cacheTtlOverride') {\n for (const [subKey, subValue] of Object.entries(val)) {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(\n ...validateNumber(\n key,\n subValue,\n allowsNegative,\n currentPath,\n subKey,\n ),\n );\n\n if (\n !(packageCacheNamespaces as readonly string[]).includes(subKey) &&\n !anyMatchRegexOrGlobList(\n packageCacheNamespaces as unknown as string[],\n [subKey],\n )\n ) {\n errors.push({\n message: `${currentPath}: namespace \\`${subKey}\\` does not exist`,\n topic: 'Configuration Error',\n });\n }\n }\n } else {\n const res = validatePlainObject(val);\n if (res !== true) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid \\`${currentPath}.${res}\\` configuration: value must be a string.`,\n });\n }\n }\n } else {\n warnings.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${currentPath}\\` should be a JSON object.`,\n });\n }\n }\n }\n}\n\nfunction getPossibleConfigFileNames({\n configFileNames,\n platform,\n}: {\n configFileNames?: string[];\n platform?: PlatformId;\n}): string[] {\n const filenames = getConfigFileNames(platform);\n if (isNonEmptyArray(configFileNames)) {\n return filenames.concat(configFileNames);\n }\n\n return filenames;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,MAAM,UAAU,WAAW;AAE3B,IAAI,qBAAqB;AACzB,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AAEJ,MAAM,cAAiC;AAEvC,MAAM,kBAAqC,CACzC,GAAG,wBACH,GAAG,yBACL;AAEA,MAAM,kBAAkB,CAAC,GAAG,aAAa,KAAK;AAE9C,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,MAAM,OAAO,MAAM,qBAAqB;AACxC,MAAM,UAAU,MAAM,kBAAkB;AAExC,SAAS,UAAU,KAAsB;CACvC,OAAO,aAAa,SAAS,GAAG;AAClC;AAEA,SAAS,8BAA8B,iBAAqC;CAC1E,OAAO,gBAAgB,QACpB,YAAY,CAAC,gBAAgB,SAAS,QAAQ,QAAQ,WAAW,EAAE,CAAC,CACvE;AACF;AAEA,SAAS,sBAAsB,QAAoC;CACjE,MAAM,oBAAwD;EAC5D,YAAY;EACZ,eAAe;EACf,SAAS;CACX;CACA,IAAI,kBAAkB,SACpB,OAAO,kBAAkB;CAG3B,MAAM,QAAQ,QAAQ,MAAM,MAAM,EAAE,SAAS,MAAM;CACnD,IAAI,CAAC,OACH;CAGF,IAAI,CAAC,MAAM,gBACT;CAGF,OAAO,QAAQ,OAAO,0BAA0B,MAAM;AACxD;AAEA,SAAS,qBAAqB,KAAsB;CAClD,OAAO,eAAe,IAAI,GAAG;AAC/B;AAEA,SAAS,oBAAoB,KAAsB;CACjD,OAAO,kBAAkB,IAAI,GAAG;AAClC;AAEA,SAAS,eAAe,KAAsB;CAC5C,OAAO,c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an.js","names":[],"sources":["../../lib/logger/bunyan.ts"],"sourcesContent":["import { isString, isUndefined } from '@sindresorhus/is';\nimport fs from 'fs-extra';\nimport upath from 'upath';\nimport { bunyan } from '../expose.ts';\nimport cmdSerializer from './cmd-serializer.ts';\nimport configSerializer from './config-serializer.ts';\nimport errSerializer from './err-serializer.ts';\nimport { PrettyStdoutStream, formatRecord } from './pretty-stdout.ts';\nimport type { ProblemStream } from './problem-stream.ts';\nimport type {\n BunyanLogLevel,\n BunyanLogger,\n BunyanRecord,\n BunyanStream,\n} from './types.ts';\nimport { getEnv } from './utils.ts';\nimport { withSanitizer } from './with-sanitizer.ts';\n\nexport function createDefaultStreams(\n stdoutLevel: BunyanLogLevel,\n problems: ProblemStream,\n logFile: string | undefined,\n): BunyanStream[] {\n const stdout: BunyanStream = {\n name: 'stdout',\n level: stdoutLevel,\n stream: process.stdout,\n };\n\n // v8 ignore else -- TODO: add test #40625\n if (getEnv('LOG_FORMAT') !== 'json') {\n const prettyStdOut = new PrettyStdoutStream();\n stdout.stream = prettyStdOut;\n stdout.type = 'raw';\n }\n\n const problemsStream: BunyanStream = {\n name: 'problems',\n level: 'warn' as BunyanLogLevel,\n stream: problems as any,\n type: 'raw',\n };\n\n const logFileStream: BunyanStream | undefined = isString(logFile)\n ? createLogFileStream(logFile)\n : undefined;\n\n return [stdout, problemsStream, logFileStream].filter(\n Boolean,\n ) as BunyanStream[];\n}\n\nfunction createLogFileStream(logFile: string): BunyanStream {\n // Ensure log file directory exists\n const directoryName = upath.dirname(logFile);\n fs.ensureDirSync(directoryName);\n\n const logFileLevel = validateLogLevel(getEnv('LOG_FILE_LEVEL'), 'debug');\n\n // Sync writes avoid data loss when process.exit() is called before async streams drain.\n const fd = fs.openSync(logFile, 'a');\n\n if (getEnv('LOG_FILE_FORMAT') === 'pretty') {\n return {\n name: 'logfile',\n level: logFileLevel,\n type: 'raw',\n stream: {\n writable: true,\n write: (rec: unknown) => {\n fs.writeSync(fd, formatRecord(rec as BunyanRecord, false));\n },\n },\n } as BunyanStream;\n }\n\n return {\n name: 'logfile',\n level: logFileLevel,\n stream: {\n writable: true,\n write: (data: string) => {\n fs.writeSync(fd, data);\n },\n },\n } as BunyanStream;\n}\n\nfunction serializedSanitizedLogger(streams: BunyanStream[]): BunyanLogger {\n return bunyan().createLogger({\n name: 'renovate',\n serializers: {\n body: configSerializer,\n cmd: cmdSerializer,\n config: configSerializer,\n migratedConfig: configSerializer,\n originalConfig: configSerializer,\n presetConfig: configSerializer,\n oldConfig: configSerializer,\n newConfig: configSerializer,\n err: errSerializer,\n },\n streams: streams.map(withSanitizer),\n });\n}\n\nexport function createLogger(\n stdoutLevel: BunyanLogLevel,\n problems: ProblemStream,\n): BunyanLogger {\n const defaultStreams = createDefaultStreams(\n stdoutLevel,\n problems,\n getEnv('LOG_FILE'),\n );\n\n return serializedSanitizedLogger(defaultStreams);\n}\n/**\n * A function that terminates execution if the log level that was entered is\n * not a valid value for the Bunyan logger.\n * @param logLevelToCheck\n * @returns returns the logLevel when the logLevelToCheck is valid or the defaultLevel passed as argument when it is undefined. Else it stops execution.\n */\nexport function validateLogLevel(\n logLevelToCheck: string | undefined,\n defaultLevel: BunyanLogLevel,\n): BunyanLogLevel {\n const allowedValues: BunyanLogLevel[] = [\n 'trace',\n 'debug',\n 'info',\n 'warn',\n 'error',\n 'fatal',\n ];\n\n if (\n isUndefined(logLevelToCheck) ||\n (isString(logLevelToCheck) &&\n allowedValues.includes(logLevelToCheck as BunyanLogLevel))\n ) {\n // log level is in the allowed values or its undefined\n return (logLevelToCheck as BunyanLogLevel) ?? defaultLevel;\n }\n\n const logger = bunyan().createLogger({\n name: 'renovate',\n streams: [\n {\n level: 'fatal',\n stream: process.stdout,\n },\n ],\n });\n logger.fatal({ logLevel: logLevelToCheck }, 'Invalid log level');\n process.exit(1);\n}\n"],"mappings":";;;;;;;;;;;AAkBA,SAAgB,qBACd,aACA,UACA,SACgB;CAChB,MAAM,SAAuB;EAC3B,MAAM;EACN,OA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A;EACA;EACA;EACA;EACA;CAMc,CAAC,CAAC,SAAS,eAAiC,GAG1D,OAAQ,mBAAsC;CAYhD,OATsB,CAAC,CAAC,aAAa;EACnC,MAAM;EACN,SAAS,CACP;GACE,OAAO;GACP,QAAQ,QAAQ;EAClB,CACF;CACF,CACK,CAAC,CAAC,MAAM,EAAE,UAAU,gBAAgB,GAAG,mBAAmB;CAC/D,QAAQ,KAAK,CAAC;AAChB"}
1
+ {"version":3,"file":"bunyan.js","names":[],"sources":["../../lib/logger/bunyan.ts"],"sourcesContent":["import { isString, isUndefined } from '@sindresorhus/is';\nimport fs from 'fs-extra';\nimport upath from 'upath';\nimport { bunyan } from '../expose.ts';\nimport cmdSerializer from './cmd-serializer.ts';\nimport configSerializer from './config-serializer.ts';\nimport errSerializer from './err-serializer.ts';\nimport { PrettyStdoutStream, formatRecord } from './pretty-stdout.ts';\nimport type { ProblemStream } from './problem-stream.ts';\nimport type {\n BunyanLogLevel,\n BunyanLogger,\n BunyanRecord,\n BunyanStream,\n} from './types.ts';\nimport { getEnv } from './utils.ts';\nimport { withSanitizer } from './with-sanitizer.ts';\n\nexport function createDefaultStreams(\n stdoutLevel: BunyanLogLevel,\n problems: ProblemStream,\n logFile: string | undefined,\n): BunyanStream[] {\n const stdout: BunyanStream = {\n name: 'stdout',\n level: stdoutLevel,\n stream: process.stdout,\n };\n\n // v8 ignore else -- TODO: add test #40625\n if (getEnv('LOG_FORMAT') !== 'json') {\n const prettyStdOut = new PrettyStdoutStream();\n stdout.stream = prettyStdOut;\n stdout.type = 'raw';\n }\n\n const problemsStream: BunyanStream = {\n name: 'problems',\n level: 'warn',\n stream: problems as any,\n type: 'raw',\n };\n\n const logFileStream: BunyanStream | undefined = isString(logFile)\n ? createLogFileStream(logFile)\n : undefined;\n\n return [stdout, problemsStream, logFileStream].filter(\n Boolean,\n ) as BunyanStream[];\n}\n\nfunction createLogFileStream(logFile: string): BunyanStream {\n // Ensure log file directory exists\n const directoryName = upath.dirname(logFile);\n fs.ensureDirSync(directoryName);\n\n const logFileLevel = validateLogLevel(getEnv('LOG_FILE_LEVEL'), 'debug');\n\n // Sync writes avoid data loss when process.exit() is called before async streams drain.\n const fd = fs.openSync(logFile, 'a');\n\n if (getEnv('LOG_FILE_FORMAT') === 'pretty') {\n return {\n name: 'logfile',\n level: logFileLevel,\n type: 'raw',\n stream: {\n writable: true,\n write: (rec: unknown) => {\n fs.writeSync(fd, formatRecord(rec as BunyanRecord, false));\n },\n },\n };\n }\n\n return {\n name: 'logfile',\n level: logFileLevel,\n stream: {\n writable: true,\n write: (data: string) => {\n fs.writeSync(fd, data);\n },\n },\n } as BunyanStream;\n}\n\nfunction serializedSanitizedLogger(streams: BunyanStream[]): BunyanLogger {\n return bunyan().createLogger({\n name: 'renovate',\n serializers: {\n body: configSerializer,\n cmd: cmdSerializer,\n config: configSerializer,\n migratedConfig: configSerializer,\n originalConfig: configSerializer,\n presetConfig: configSerializer,\n oldConfig: configSerializer,\n newConfig: configSerializer,\n err: errSerializer,\n },\n streams: streams.map(withSanitizer),\n });\n}\n\nexport function createLogger(\n stdoutLevel: BunyanLogLevel,\n problems: ProblemStream,\n): BunyanLogger {\n const defaultStreams = createDefaultStreams(\n stdoutLevel,\n problems,\n getEnv('LOG_FILE'),\n );\n\n return serializedSanitizedLogger(defaultStreams);\n}\n/**\n * A function that terminates execution if the log level that was entered is\n * not a valid value for the Bunyan logger.\n * @param logLevelToCheck\n * @returns returns the logLevel when the logLevelToCheck is valid or the defaultLevel passed as argument when it is undefined. Else it stops execution.\n */\nexport function validateLogLevel(\n logLevelToCheck: string | undefined,\n defaultLevel: BunyanLogLevel,\n): BunyanLogLevel {\n const allowedValues: BunyanLogLevel[] = [\n 'trace',\n 'debug',\n 'info',\n 'warn',\n 'error',\n 'fatal',\n ];\n\n if (\n isUndefined(logLevelToCheck) ||\n (isString(logLevelToCheck) &&\n allowedValues.includes(logLevelToCheck as BunyanLogLevel))\n ) {\n // log level is in the allowed values or its undefined\n return (logLevelToCheck as BunyanLogLevel) ?? defaultLevel;\n }\n\n const logger = bunyan().createLogger({\n name: 'renovate',\n streams: [\n {\n level: 'fatal',\n stream: process.stdout,\n },\n ],\n });\n logger.fatal({ logLevel: logLevelToCheck }, 'Invalid log level');\n process.exit(1);\n}\n"],"mappings":";;;;;;;;;;;AAkBA,SAAgB,qBACd,aACA,UACA,SACgB;CAChB,MAAM,SAAuB;EAC3B,MAAM;EACN,OAAO;EACP,QAAQ,QAAQ;CAClB;;CAGA,IAAI,OAAO,YAAY,MAAM,QAAQ;EAEnC,OAAO,SAAS,IADS,mBACE;EAC3B,OAAO,OAAO;CAChB;CAaA,OAAO;EAAC;EAAQ;GAVd,MAAM;GACN,OAAO;GACP,QAAQ;GACR,MAAM;EAOqB;EAJmB,SAAS,OAAO,IAC5D,oBAAoB,OAAO,IAC3B,KAAA;CAEyC,CAAC,CAAC,OAC7C,OACF;AACF;AAEA,SAAS,oBAAoB,SAA+B;CAE1D,MAAM,gBAAgB,MAAM,QAAQ,OAAO;CAC3C,GAAG,cAAc,aAAa;CAE9B,MAAM,eAAe,iBAAiB,OAAO,gBAAgB,GAAG,OAAO;CAGvE,MAAM,KAAK,GAAG,SAAS,SAAS,GAAG;CAEnC,IAAI,OAAO,iBAAiB,MAAM,UAChC,OAAO;EACL,MAAM;EACN,OAAO;EACP,MAAM;EACN,QAAQ;GACN,UAAU;GACV,QAAQ,QAAiB;IACvB,GAAG,UAAU,IAAI,aAAa,KAAqB,KAAK,CAAC;GAC3D;EACF;CACF;CAGF,OAAO;EACL,MAAM;EACN,OAAO;EACP,QAAQ;GACN,UAAU;GACV,QAAQ,SAAiB;IACvB,GAAG,UAAU,IAAI,IAAI;GACvB;EACF;CACF;AACF;AAEA,SAAS,0BAA0B,SAAuC;CACxE,OAAO,OAAO,CAAC,CAAC,aAAa;EAC3B,MAAM;EACN,aAAa;GACX,MAAM;GACN,KAAK;GACL,QAAQ;GACR,gBAAgB;GAChB,gBAAgB;GAChB,cAAc;GACd,WAAW;GACX,WAAW;GACX,KAAK;EACP;EACA,SAAS,QAAQ,IAAI,aAAa;CACpC,CAAC;AACH;AAEA,SAAgB,aACd,aACA,UACc;CAOd,OAAO,0BANgB,qBACrB,aACA,UACA,OAAO,UAAU,CAG2B,CAAC;AACjD;;;;;;;AAOA,SAAgB,iBACd,iBACA,cACgB;CAUhB,IACE,YAAY,eAAe,KAC1B,SAAS,eAAe,KACvB;EAXF;EACA;EACA;EACA;EACA;EACA;CAMc,CAAC,CAAC,SAAS,eAAiC,GAG1D,OAAQ,mBAAsC;CAYhD,OATsB,CAAC,CAAC,aAAa;EACnC,MAAM;EACN,SAAS,CACP;GACE,OAAO;GACP,QAAQ,QAAQ;EAClB,CACF;CACF,CACK,CAAC,CAAC,MAAM,EAAE,UAAU,gBAAgB,GAAG,mBAAmB;CAC/D,QAAQ,KAAK,CAAC;AAChB"}
@@ -16,7 +16,7 @@ import { parseGoproxy, parseNoproxy } from "./goproxy-parser.js";
16
16
  import { getSourceUrl } from "./common.js";
17
17
  import { GoDirectDatasource } from "./releases-direct.js";
18
18
  import { VersionInfo } from "./schema.js";
19
- import { isNonEmptyStringAndNotWhitespace, isTruthy } from "@sindresorhus/is";
19
+ import { isNonEmptyString, isNonEmptyStringAndNotWhitespace, isTruthy } from "@sindresorhus/is";
20
20
  //#region lib/modules/datasource/go/releases-goproxy.ts
21
21
  /** TODO #42566 */
22
22
  const goVersionRegex = regEx(/^\s*go\s+(?<version>[^\s]+)\s*$/);
@@ -147,7 +147,11 @@ var GoProxyDatasource = class GoProxyDatasource extends Datasource {
147
147
  async getLatestVersion(baseUrl, packageName) {
148
148
  try {
149
149
  const url = joinUrlParts(baseUrl, this.encodeCase(packageName), "@latest");
150
- return (await this.http.getJson(url, VersionInfo)).body.Version;
150
+ const { Version: version, Origin: origin } = (await this.http.getJson(url, VersionInfo)).body;
151
+ return {
152
+ version,
153
+ sourceUrl: origin?.VCS === "git" && isNonEmptyString(origin.URL) ? origin.URL.replace(regEx(/\.git$/), "") : void 0
154
+ };
151
155
  } catch (err) {
152
156
  logger.trace({ err }, "Failed to get latest version");
153
157
  return null;
@@ -205,11 +209,13 @@ var GoProxyDatasource = class GoProxyDatasource extends Datasource {
205
209
  if (potentialHttpError instanceof RequestError && (status === 404 || status === 403) && major !== packageMajor) break;
206
210
  throw err;
207
211
  }
208
- const latestVersion = await this.getLatestVersion(baseUrl, pkg);
209
- if (latestVersion) {
212
+ const latest = await this.getLatestVersion(baseUrl, pkg);
213
+ if (latest) {
214
+ const { version: latestVersion, sourceUrl } = latest;
210
215
  result.tags ??= {};
211
216
  result.tags.latest ??= latestVersion;
212
217
  if (api.isGreaterThan(latestVersion, result.tags.latest)) result.tags.latest = latestVersion;
218
+ if (sourceUrl) result.sourceUrl ??= sourceUrl;
213
219
  if (!result.releases.length) {
214
220
  const releaseFromLatest = pseudoVersionToRelease(latestVersion);
215
221
  if (releaseFromLatest) result.releases.push(releaseFromLatest);