renovate 42.8.1 → 42.9.1

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.
@@ -13,7 +13,6 @@ const groupPreset = tslib_1.__importStar(require("./group"));
13
13
  const helpersPreset = tslib_1.__importStar(require("./helpers"));
14
14
  const mergeConfidence = tslib_1.__importStar(require("./merge-confidence"));
15
15
  const monorepoPreset = tslib_1.__importStar(require("./monorepos"));
16
- const npm = tslib_1.__importStar(require("./npm"));
17
16
  const packagesPreset = tslib_1.__importStar(require("./packages"));
18
17
  const previewPreset = tslib_1.__importStar(require("./preview"));
19
18
  const replacements = tslib_1.__importStar(require("./replacements"));
@@ -32,7 +31,6 @@ exports.groups = {
32
31
  helpers: helpersPreset.presets,
33
32
  mergeConfidence: mergeConfidence.presets,
34
33
  monorepo: monorepoPreset.presets,
35
- npm: npm.presets,
36
34
  packages: packagesPreset.presets,
37
35
  preview: previewPreset.presets,
38
36
  replacements: replacements.presets,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/config/presets/internal/index.ts"],"names":[],"mappings":";;;AAyCA,8BAKC;;AA7CD,2EAAqD;AACrD,+DAAyC;AACzC,gFAA0D;AAC1D,iEAA2C;AAC3C,+DAAyC;AACzC,+DAAyC;AACzC,6DAAuC;AACvC,iEAA2C;AAC3C,4EAAsD;AACtD,oEAA8C;AAC9C,mDAA6B;AAC7B,mEAA6C;AAC7C,iEAA2C;AAC3C,qEAA+C;AAC/C,mEAA6C;AAC7C,mEAA6C;AAC7C,yEAAmD;AAEnD,+EAA+E;AAElE,QAAA,MAAM,GAA2C;IAC5D,YAAY,EAAE,kBAAkB,CAAC,OAAO;IACxC,MAAM,EAAE,YAAY,CAAC,OAAO;IAC5B,cAAc,EAAE,oBAAoB,CAAC,OAAO;IAC5C,OAAO,EAAE,aAAa,CAAC,OAAO;IAC9B,MAAM,EAAE,YAAY,CAAC,OAAO;IAC5B,MAAM,EAAE,YAAY,CAAC,OAAO;IAC5B,KAAK,EAAE,WAAW,CAAC,OAAO;IAC1B,OAAO,EAAE,aAAa,CAAC,OAAO;IAC9B,eAAe,EAAE,eAAe,CAAC,OAAO;IACxC,QAAQ,EAAE,cAAc,CAAC,OAAO;IAChC,GAAG,EAAE,GAAG,CAAC,OAAO;IAChB,QAAQ,EAAE,cAAc,CAAC,OAAO;IAChC,OAAO,EAAE,aAAa,CAAC,OAAO;IAC9B,YAAY,EAAE,YAAY,CAAC,OAAO;IAClC,QAAQ,EAAE,cAAc,CAAC,OAAO;IAChC,QAAQ,EAAE,cAAc,CAAC,OAAO;IAChC,WAAW,EAAE,iBAAiB,CAAC,OAAO;CACvC,CAAC;AAEF,SAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,UAAU,GACG;IACb,OAAO,cAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,cAAM,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC","sourcesContent":["import type { Preset, PresetConfig } from '../types';\nimport * as configAbandonments from './abandonments';\nimport * as configPreset from './config';\nimport * as customManagersPreset from './custom-managers';\nimport * as defaultPreset from './default';\nimport * as dockerPreset from './docker';\nimport * as globalPreset from './global';\nimport * as groupPreset from './group';\nimport * as helpersPreset from './helpers';\nimport * as mergeConfidence from './merge-confidence';\nimport * as monorepoPreset from './monorepos';\nimport * as npm from './npm';\nimport * as packagesPreset from './packages';\nimport * as previewPreset from './preview';\nimport * as replacements from './replacements';\nimport * as schedulePreset from './schedule';\nimport * as securityPreset from './security';\nimport * as workaroundsPreset from './workarounds';\n\n/* eslint sort-keys: [\"error\", \"asc\", {caseSensitive: false, natural: true}] */\n\nexport const groups: Record<string, Record<string, Preset>> = {\n abandonments: configAbandonments.presets,\n config: configPreset.presets,\n customManagers: customManagersPreset.presets,\n default: defaultPreset.presets,\n docker: dockerPreset.presets,\n global: globalPreset.presets,\n group: groupPreset.presets,\n helpers: helpersPreset.presets,\n mergeConfidence: mergeConfidence.presets,\n monorepo: monorepoPreset.presets,\n npm: npm.presets,\n packages: packagesPreset.presets,\n preview: previewPreset.presets,\n replacements: replacements.presets,\n schedule: schedulePreset.presets,\n security: securityPreset.presets,\n workarounds: workaroundsPreset.presets,\n};\n\nexport function getPreset({\n repo,\n presetName,\n}: PresetConfig): Preset | undefined {\n return groups[repo] && presetName ? groups[repo][presetName] : undefined;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/config/presets/internal/index.ts"],"names":[],"mappings":";;;AAuCA,8BAKC;;AA3CD,2EAAqD;AACrD,+DAAyC;AACzC,gFAA0D;AAC1D,iEAA2C;AAC3C,+DAAyC;AACzC,+DAAyC;AACzC,6DAAuC;AACvC,iEAA2C;AAC3C,4EAAsD;AACtD,oEAA8C;AAC9C,mEAA6C;AAC7C,iEAA2C;AAC3C,qEAA+C;AAC/C,mEAA6C;AAC7C,mEAA6C;AAC7C,yEAAmD;AAEnD,+EAA+E;AAElE,QAAA,MAAM,GAA2C;IAC5D,YAAY,EAAE,kBAAkB,CAAC,OAAO;IACxC,MAAM,EAAE,YAAY,CAAC,OAAO;IAC5B,cAAc,EAAE,oBAAoB,CAAC,OAAO;IAC5C,OAAO,EAAE,aAAa,CAAC,OAAO;IAC9B,MAAM,EAAE,YAAY,CAAC,OAAO;IAC5B,MAAM,EAAE,YAAY,CAAC,OAAO;IAC5B,KAAK,EAAE,WAAW,CAAC,OAAO;IAC1B,OAAO,EAAE,aAAa,CAAC,OAAO;IAC9B,eAAe,EAAE,eAAe,CAAC,OAAO;IACxC,QAAQ,EAAE,cAAc,CAAC,OAAO;IAChC,QAAQ,EAAE,cAAc,CAAC,OAAO;IAChC,OAAO,EAAE,aAAa,CAAC,OAAO;IAC9B,YAAY,EAAE,YAAY,CAAC,OAAO;IAClC,QAAQ,EAAE,cAAc,CAAC,OAAO;IAChC,QAAQ,EAAE,cAAc,CAAC,OAAO;IAChC,WAAW,EAAE,iBAAiB,CAAC,OAAO;CACvC,CAAC;AAEF,SAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,UAAU,GACG;IACb,OAAO,cAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,cAAM,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC","sourcesContent":["import type { Preset, PresetConfig } from '../types';\nimport * as configAbandonments from './abandonments';\nimport * as configPreset from './config';\nimport * as customManagersPreset from './custom-managers';\nimport * as defaultPreset from './default';\nimport * as dockerPreset from './docker';\nimport * as globalPreset from './global';\nimport * as groupPreset from './group';\nimport * as helpersPreset from './helpers';\nimport * as mergeConfidence from './merge-confidence';\nimport * as monorepoPreset from './monorepos';\nimport * as packagesPreset from './packages';\nimport * as previewPreset from './preview';\nimport * as replacements from './replacements';\nimport * as schedulePreset from './schedule';\nimport * as securityPreset from './security';\nimport * as workaroundsPreset from './workarounds';\n\n/* eslint sort-keys: [\"error\", \"asc\", {caseSensitive: false, natural: true}] */\n\nexport const groups: Record<string, Record<string, Preset>> = {\n abandonments: configAbandonments.presets,\n config: configPreset.presets,\n customManagers: customManagersPreset.presets,\n default: defaultPreset.presets,\n docker: dockerPreset.presets,\n global: globalPreset.presets,\n group: groupPreset.presets,\n helpers: helpersPreset.presets,\n mergeConfidence: mergeConfidence.presets,\n monorepo: monorepoPreset.presets,\n packages: packagesPreset.presets,\n preview: previewPreset.presets,\n replacements: replacements.presets,\n schedule: schedulePreset.presets,\n security: securityPreset.presets,\n workarounds: workaroundsPreset.presets,\n};\n\nexport function getPreset({\n repo,\n presetName,\n}: PresetConfig): Preset | undefined {\n return groups[repo] && presetName ? groups[repo][presetName] : undefined;\n}\n"]}
@@ -259,6 +259,12 @@ async function validateConfig(configType, config, isPreset, parentPath) {
259
259
  if (key === 'extends') {
260
260
  for (const subval of val) {
261
261
  if ((0, is_1.isString)(subval)) {
262
+ if (configType !== 'global' && subval.startsWith('global:')) {
263
+ errors.push({
264
+ topic: 'Configuration Error',
265
+ message: `${currentPath}: you cannot extend from "global:" presets in a repository config's "extends"`,
266
+ });
267
+ }
262
268
  if (parentName === 'packageRules' &&
263
269
  subval.startsWith('group:')) {
264
270
  warnings.push({
@@ -1 +1 @@
1
- {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../lib/config/validation.ts"],"names":[],"mappings":";;AA4JA,wCAmoBC;;AA/xBD,+DAS0B;AAC1B,gDAAqE;AACrE,sDAA4D;AAG5D,6CAAgD;AAChD,yCAAsC;AACtC,uDAI8B;AAC9B,mEAA6C;AAC7C,qCAAuC;AACvC,2EAGsD;AACtD,+CAAmD;AACnD,qCAAwC;AACxC,2CAA4C;AAC5C,uCAAuC;AACvC,uCAAiD;AACjD,0EAA2E;AAS3E,mCAAoD;AACpD,6GAAuF;AACvF,uGAAiF;AACjF,sDAOoC;AAEpC,MAAM,OAAO,GAAG,IAAA,oBAAU,GAAE,CAAC;AAE7B,IAAI,kBAAkB,GAAG,KAAK,CAAC;AAC/B,IAAI,WAAoD,CAAC;AACzD,IAAI,aAA+C,CAAC;AACpD,IAAI,aAA0B,CAAC;AAC/B,IAAI,cAA2B,CAAC;AAChC,IAAI,iBAA8B,CAAC;AACnC,IAAI,4BAAyC,CAAC;AAE9C,MAAM,WAAW,GAAG,IAAA,wBAAc,GAAE,CAAC;AAErC,MAAM,eAAe,GAAG,CAAC,GAAG,WAAW,EAAE,KAAK,CAAC,CAAC;AAEhD,MAAM,YAAY,GAAG;IACnB,SAAS;IACT,SAAS;IACT,SAAS;IACT,UAAU;IACV,aAAa;IACb,WAAW;IACX,YAAY;IACZ,yBAAyB;IACzB,oBAAoB;IACpB,sBAAsB;IACtB,yBAAyB,EAAE,+DAA+D;IAC1F,eAAe,EAAE,uDAAuD;IACxE,QAAQ,EAAE,aAAa;IACvB,mBAAmB,EAAE,4BAA4B;CAClD,CAAC;AACF,MAAM,IAAI,GAAG,IAAA,aAAK,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yString,\n isObject,\n isPlainObject,\n isString,\n isUndefined,\n} from '@sindresorhus/is';\nimport { allManagersList, getManagerList } from '../modules/manager';\nimport { isCustomManager } from '../modules/manager/custom';\nimport type { CustomManager } from '../modules/manager/custom/types';\nimport type { HostRule } from '../types';\nimport { getExpression } from '../util/jsonata';\nimport { regEx } from '../util/regex';\nimport {\n getRegexPredicate,\n isRegexMatch,\n matchRegexOrGlobList,\n} from '../util/string-match';\nimport * as template from '../util/template';\nimport { parseUrl } from '../util/url';\nimport {\n hasValidSchedule,\n hasValidTimezone,\n} from '../workers/repository/update/branch/schedule';\nimport { getConfigFileNames } from './app-strings';\nimport { GlobalConfig } from './global';\nimport { migrateConfig } from './migration';\nimport { getOptions } from './options';\nimport { resolveConfigPresets } from './presets';\nimport { supportedDatasources } from './presets/internal/merge-confidence';\nimport type {\n AllowedParents,\n RenovateConfig,\n RenovateOptions,\n StatusCheckKey,\n ValidationMessage,\n ValidationResult,\n} from './types';\nimport { allowedStatusCheckStrings } from './types';\nimport * as matchBaseBranchesValidator from './validation-helpers/match-base-branches';\nimport * as regexOrGlobValidator from './validation-helpers/regex-glob-matchers';\nimport {\n getParentName,\n isFalseGlobal,\n validateJSONataManagerFields,\n validateNumber,\n validatePlainObject,\n validateRegexManagerFields,\n} from './validation-helpers/utils';\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>;\n\nconst managerList = getManagerList();\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 return deprecatedOptions[option];\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\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\n optionsInitialized = true;\n}\n\nexport async function validateConfig(\n configType: 'global' | 'inherit' | 'repo',\n config: RenovateConfig,\n isPreset?: boolean,\n parentPath?: string,\n): Promise<ValidationResult> {\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 (\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 const templateKeys = [\n 'branchName',\n 'commitBody',\n 'commitMessage',\n 'prTitle',\n 'semanticCommitScope',\n ];\n if ((key.endsWith('Template') || templateKeys.includes(key)) && val) {\n try {\n // TODO: validate string #22198\n let res = template.compile((val as string).toString(), config, false);\n res = template.compile(res, config, false);\n template.compile(res, config, false);\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]?.sort().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 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(val as string[]);\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(val as string);\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(...validateNumber(key, val, allowsNegative, currentPath));\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 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 } else {\n errors.push({\n topic: 'Configuration Warning',\n message: `${currentPath}: preset value is not a string`,\n });\n }\n }\n }\n\n const selectors = [\n 'matchFileNames',\n 'matchLanguages',\n 'matchCategories',\n 'matchBaseBranches',\n 'matchManagers',\n 'matchDatasources',\n 'matchDepTypes',\n 'matchDepNames',\n 'matchPackageNames',\n 'matchCurrentValue',\n 'matchCurrentVersion',\n 'matchSourceUrls',\n '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 resolvedRule = migrateConfig({\n packageRules: [\n await resolveConfigPresets(\n packageRule as RenovateConfig,\n config,\n ),\n ],\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 ];\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 (startPattern.test(pattern) && endPattern.test(pattern)) {\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 (\n type === 'object' &&\n currentPath !== 'compatibility' &&\n key !== 'constraints'\n ) {\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 as string[]) ?? [])\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 [statusCheckKey, statusCheckValue] of Object.entries(\n val,\n )) {\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 === '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 (!(isString(subValue) || isArray(subValue, isString))) {\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 {\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 }\n }\n }\n\n if (key === 'hostRules' && isArray(val)) {\n const allowedHeaders =\n configType === 'global'\n ? ((config.allowedHeaders as string[]) ?? [])\n : GlobalConfig.get('allowedHeaders', []);\n for (const rule of val as HostRule[]) {\n if (isNonEmptyString(rule.matchHost)) {\n if (rule.matchHost.includes('://')) {\n if (parseUrl(rule.matchHost) === null) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules matchHost \\`${rule.matchHost}\\` is not a valid URL.`,\n });\n }\n }\n } else if (isEmptyString(rule.matchHost)) {\n errors.push({\n topic: 'Configuration Error',\n message:\n 'Invalid value for hostRules matchHost. It cannot be an empty string.',\n });\n }\n\n if (!rule.headers) {\n continue;\n }\n for (const [header, value] of Object.entries(rule.headers)) {\n if (!isString(value)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid hostRules headers value configuration: header must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(header, allowedHeaders)) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules header \\`${header}\\` is not allowed by this bot's \\`allowedHeaders\\`.`,\n });\n }\n }\n }\n }\n\n if (key === 'matchJsonata' && isArray(val, isString)) {\n for (const expression of val) {\n const res = getExpression(expression);\n if (res instanceof Error) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid JSONata expression for ${currentPath}: ${res.message}`,\n });\n }\n }\n }\n }\n\n function sortAll(a: ValidationMessage, b: ValidationMessage): number {\n if (a.topic === b.topic) {\n return a.message > b.message ? 1 : -1;\n }\n return a.topic > b.topic ? 1 : -1;\n }\n\n errors.sort(sortAll);\n warnings.sort(sortAll);\n return { errors, warnings };\n}\n\n/**\n * 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: RenovateConfig,\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 if (val !== null) {\n if (type === 'string') {\n if (isString(val)) {\n if (\n key === 'onboardingConfigFileName' &&\n !getConfigFileNames().includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${getConfigFileNames().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 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 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 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 } 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"]}
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../lib/config/validation.ts"],"names":[],"mappings":";;AA4JA,wCA0oBC;;AAtyBD,+DAS0B;AAC1B,gDAAqE;AACrE,sDAA4D;AAG5D,6CAAgD;AAChD,yCAAsC;AACtC,uDAI8B;AAC9B,mEAA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,KAAK,MAAM,OAAO,IAAI,aAAa,CAAC,QAAQ,CAAC,MAAM,CACjD,aAAa,CAAC,MAAM,CACrB,EAAE,CAAC;wBACF,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBACzB,CAAC;gBACH,CAAC;qBAAM,IAAI,GAAG,KAAK,kBAAkB,EAAE,CAAC;oBACtC,KAAK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;wBACrD,MAAM,cAAc,GAAG,4BAA4B,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;wBAC7D,QAAQ,CAAC,IAAI,CACX,GAAG,IAAA,sBAAc,EACf,GAAG,EACH,QAAQ,EACR,cAAc,EACd,WAAW,EACX,MAAM,CACP,CACF,CAAC;oBACJ,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,MAAM,GAAG,GAAG,IAAA,2BAAmB,EAAC,GAAG,CAAC,CAAC;oBACrC,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;wBACjB,QAAQ,CAAC,IAAI,CAAC;4BACZ,KAAK,EAAE,qBAAqB;4BAC5B,OAAO,EAAE,aAAa,WAAW,IAAI,GAAG,2CAA2C;yBACpF,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,QAAQ,CAAC,IAAI,CAAC;oBACZ,KAAK,EAAE,qBAAqB;oBAC5B,OAAO,EAAE,0BAA0B,WAAW,6BAA6B;iBAC5E,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import is, {\n isArray,\n isEmptyString,\n isNonEmptyArray,\n isNonEmptyString,\n isObject,\n isPlainObject,\n isString,\n isUndefined,\n} from '@sindresorhus/is';\nimport { allManagersList, getManagerList } from '../modules/manager';\nimport { isCustomManager } from '../modules/manager/custom';\nimport type { CustomManager } from '../modules/manager/custom/types';\nimport type { HostRule } from '../types';\nimport { getExpression } from '../util/jsonata';\nimport { regEx } from '../util/regex';\nimport {\n getRegexPredicate,\n isRegexMatch,\n matchRegexOrGlobList,\n} from '../util/string-match';\nimport * as template from '../util/template';\nimport { parseUrl } from '../util/url';\nimport {\n hasValidSchedule,\n hasValidTimezone,\n} from '../workers/repository/update/branch/schedule';\nimport { getConfigFileNames } from './app-strings';\nimport { GlobalConfig } from './global';\nimport { migrateConfig } from './migration';\nimport { getOptions } from './options';\nimport { resolveConfigPresets } from './presets';\nimport { supportedDatasources } from './presets/internal/merge-confidence';\nimport type {\n AllowedParents,\n RenovateConfig,\n RenovateOptions,\n StatusCheckKey,\n ValidationMessage,\n ValidationResult,\n} from './types';\nimport { allowedStatusCheckStrings } from './types';\nimport * as matchBaseBranchesValidator from './validation-helpers/match-base-branches';\nimport * as regexOrGlobValidator from './validation-helpers/regex-glob-matchers';\nimport {\n getParentName,\n isFalseGlobal,\n validateJSONataManagerFields,\n validateNumber,\n validatePlainObject,\n validateRegexManagerFields,\n} from './validation-helpers/utils';\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>;\n\nconst managerList = getManagerList();\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 return deprecatedOptions[option];\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\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\n optionsInitialized = true;\n}\n\nexport async function validateConfig(\n configType: 'global' | 'inherit' | 'repo',\n config: RenovateConfig,\n isPreset?: boolean,\n parentPath?: string,\n): Promise<ValidationResult> {\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 (\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 const templateKeys = [\n 'branchName',\n 'commitBody',\n 'commitMessage',\n 'prTitle',\n 'semanticCommitScope',\n ];\n if ((key.endsWith('Template') || templateKeys.includes(key)) && val) {\n try {\n // TODO: validate string #22198\n let res = template.compile((val as string).toString(), config, false);\n res = template.compile(res, config, false);\n template.compile(res, config, false);\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]?.sort().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 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(val as string[]);\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(val as string);\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(...validateNumber(key, val, allowsNegative, currentPath));\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 (configType !== 'global' && subval.startsWith('global:')) {\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 } else {\n errors.push({\n topic: 'Configuration Warning',\n message: `${currentPath}: preset value is not a string`,\n });\n }\n }\n }\n\n const selectors = [\n 'matchFileNames',\n 'matchLanguages',\n 'matchCategories',\n 'matchBaseBranches',\n 'matchManagers',\n 'matchDatasources',\n 'matchDepTypes',\n 'matchDepNames',\n 'matchPackageNames',\n 'matchCurrentValue',\n 'matchCurrentVersion',\n 'matchSourceUrls',\n '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 resolvedRule = migrateConfig({\n packageRules: [\n await resolveConfigPresets(\n packageRule as RenovateConfig,\n config,\n ),\n ],\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 ];\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 (startPattern.test(pattern) && endPattern.test(pattern)) {\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 (\n type === 'object' &&\n currentPath !== 'compatibility' &&\n key !== 'constraints'\n ) {\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 as string[]) ?? [])\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 [statusCheckKey, statusCheckValue] of Object.entries(\n val,\n )) {\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 === '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 (!(isString(subValue) || isArray(subValue, isString))) {\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 {\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 }\n }\n }\n\n if (key === 'hostRules' && isArray(val)) {\n const allowedHeaders =\n configType === 'global'\n ? ((config.allowedHeaders as string[]) ?? [])\n : GlobalConfig.get('allowedHeaders', []);\n for (const rule of val as HostRule[]) {\n if (isNonEmptyString(rule.matchHost)) {\n if (rule.matchHost.includes('://')) {\n if (parseUrl(rule.matchHost) === null) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules matchHost \\`${rule.matchHost}\\` is not a valid URL.`,\n });\n }\n }\n } else if (isEmptyString(rule.matchHost)) {\n errors.push({\n topic: 'Configuration Error',\n message:\n 'Invalid value for hostRules matchHost. It cannot be an empty string.',\n });\n }\n\n if (!rule.headers) {\n continue;\n }\n for (const [header, value] of Object.entries(rule.headers)) {\n if (!isString(value)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid hostRules headers value configuration: header must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(header, allowedHeaders)) {\n errors.push({\n topic: 'Configuration Error',\n message: `hostRules header \\`${header}\\` is not allowed by this bot's \\`allowedHeaders\\`.`,\n });\n }\n }\n }\n }\n\n if (key === 'matchJsonata' && isArray(val, isString)) {\n for (const expression of val) {\n const res = getExpression(expression);\n if (res instanceof Error) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid JSONata expression for ${currentPath}: ${res.message}`,\n });\n }\n }\n }\n }\n\n function sortAll(a: ValidationMessage, b: ValidationMessage): number {\n if (a.topic === b.topic) {\n return a.message > b.message ? 1 : -1;\n }\n return a.topic > b.topic ? 1 : -1;\n }\n\n errors.sort(sortAll);\n warnings.sort(sortAll);\n return { errors, warnings };\n}\n\n/**\n * 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: RenovateConfig,\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 if (val !== null) {\n if (type === 'string') {\n if (isString(val)) {\n if (\n key === 'onboardingConfigFileName' &&\n !getConfigFileNames().includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${getConfigFileNames().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 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 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 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 } 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"]}
@@ -85,7 +85,22 @@ async function bumpVersion(config, branchConfig, fileList, packageFiles, artifac
85
85
  let newVersion = null;
86
86
  try {
87
87
  const bumpType = (0, template_1.compile)(rawBumpType, branchConfig);
88
- newVersion = (0, semver_1.inc)(version, bumpType);
88
+ const parts = (0, regex_1.regEx)('^(?<major>\\d+)(?:\\.(?<minor>\\d+))?$').exec(version);
89
+ if (parts?.groups) {
90
+ const { major, minor } = parts.groups;
91
+ if (bumpType === 'major') {
92
+ newVersion = `${parseInt(major) + 1}${minor ? `.0` : ''}`;
93
+ }
94
+ else if (bumpType === 'minor') {
95
+ newVersion = `${major}.${parseInt(minor) + 1}`;
96
+ }
97
+ else {
98
+ throw new Error(`Unsupported bump type for {major}.{minor} version: ${bumpType}`);
99
+ }
100
+ }
101
+ else {
102
+ newVersion = (0, semver_1.inc)(version, bumpType);
103
+ }
89
104
  }
90
105
  catch (e) {
91
106
  addArtifactError(branchConfig, `Failed to calculate new version for ${bumpVersionsDescr}: ${e.message}`, filePath);
@@ -1 +1 @@
1
- {"version":3,"file":"bump-versions.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/update/branch/bump-versions.ts"],"names":[],"mappings":";;AAkBA,oCA8BC;AAhDD,mCAA+C;AAE/C,+CAA4C;AAC5C,0DAAuD;AACvD,kDAAqD;AACrD,4CAAoD;AAEpD,kDAA+C;AAC/C,gEAAqE;AACrE,wDAAoD;AAEpD,yDAA+D;AAOxD,KAAK,UAAU,YAAY,CAAC,MAAoB;IACrD,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;IACzC,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;QAC1B,OAAO;IACT,CAAC;IAED,yDAAyD;IACzD,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAC;QAC5E,OAAO;IACT,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,SAAG,CAAC,WAAW,EAAE,CAAC;IACzC,MAAM,QAAQ,GAAG,IAAA,gCAAmB,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEvD,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAC3E,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAEzE,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QAAQ,EAAE,EAClB,GAAG,iBAAiB,0BAA0B,CAAC,CAAC,OAAO,EAAE,CAC1D,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CACvB,QAAgB,EAChB,YAA0C;IAE1C,MAAM,OAAO,GAAG,IAAA,mBAAW,EAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEpD,mCAAmC;IACnC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/C,IAAI,UAAU,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACnC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAC9B,CAAC;IACD,OAAO;QACL,KAAK,EAAE,UAAU;QACjB,OAAO,EAAE,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,IAAI;KACjD,CAAC;AACJ,CAAC","sourcesContent":["import { type ReleaseType, inc } from 'semver';\nimport type { BumpVersionConfig } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport { scm } from '../../../../modules/platform/scm';\nimport { coerceArray } from '../../../../util/array';\nimport { readLocalFile } from '../../../../util/fs';\nimport type { FileChange } from '../../../../util/git/types';\nimport { regEx } from '../../../../util/regex';\nimport { matchRegexOrGlobList } from '../../../../util/string-match';\nimport { compile } from '../../../../util/template';\nimport type { BranchConfig } from '../../../types';\nimport { getFilteredFileList } from '../../extract/file-match';\n\ntype ParseFileChangesResult =\n | { state: 'modified'; content: string | null }\n | { state: 'deleted' }\n | { state: 'unmodified' };\n\nexport async function bumpVersions(config: BranchConfig): Promise<void> {\n const bumpVersions = config.bumpVersions;\n if (!bumpVersions?.length) {\n return;\n }\n\n // skip if no packageFiles or artifacts have been updated\n if (!config.updatedPackageFiles?.length && !config.updatedArtifacts?.length) {\n return;\n }\n\n const allFiles = await scm.getFileList();\n const fileList = getFilteredFileList(config, allFiles);\n\n const packageFileChanges = fileChangeListToMap(config.updatedPackageFiles);\n const artifactFileChanges = fileChangeListToMap(config.updatedArtifacts);\n\n for (const bumpVersionConfig of bumpVersions) {\n await bumpVersion(\n bumpVersionConfig,\n config,\n fileList,\n packageFileChanges,\n artifactFileChanges,\n );\n }\n\n // update the config with the new files\n config.updatedPackageFiles = Object.values(packageFileChanges).flat();\n config.updatedArtifacts = Object.values(artifactFileChanges).flat();\n}\n\nasync function bumpVersion(\n config: BumpVersionConfig,\n branchConfig: BranchConfig,\n fileList: string[],\n packageFiles: Record<string, FileChange[]>,\n artifactFiles: Record<string, FileChange[]>,\n): Promise<void> {\n const rawBumpType = config.bumpType ?? 'patch';\n\n // all log messages should be prefixed with this string to facilitate easier logLevelRemapping\n const bumpVersionsDescr = config.name\n ? `bumpVersions(${config.name})`\n : 'bumpVersions';\n\n const files: string[] = [];\n try {\n files.push(\n ...getMatchedFiles(\n bumpVersionsDescr,\n config.filePatterns,\n branchConfig,\n fileList,\n ),\n );\n } catch (e) {\n addArtifactError(\n branchConfig,\n `Failed to calculate matched files for bumpVersions: ${e.message}`,\n );\n return;\n }\n\n if (!files.length) {\n logger.debug(`${bumpVersionsDescr}: filePatterns did not match any files`);\n return;\n }\n\n logger.trace(\n { files },\n `${bumpVersionsDescr}: Found ${files.length} files to bump versions`,\n );\n\n // keeping this only for logging purposes\n const matchStrings: string[] = [];\n\n // prepare the matchStrings\n const matchStringsRegexes: RegExp[] = [];\n for (const matchString of config.matchStrings) {\n try {\n const templated = compile(matchString, branchConfig);\n matchStrings.push(templated);\n matchStringsRegexes.push(regEx(templated));\n } catch (e) {\n addArtifactError(\n branchConfig,\n `Failed to compile matchString for ${bumpVersionsDescr}: ${e.message}`,\n matchString,\n );\n }\n }\n\n logger.trace({ matchStrings }, `${bumpVersionsDescr}: Compiled matchStrings`);\n\n for (const filePath of files) {\n let fileBumped = false;\n\n const fileContents = await getFileContent(\n bumpVersionsDescr,\n filePath,\n packageFiles,\n artifactFiles,\n );\n if (!fileContents) {\n continue;\n }\n\n for (const matchStringRegex of matchStringsRegexes) {\n // extracting the version from the file\n const regexResult = matchStringRegex.exec(fileContents);\n if (!regexResult) {\n continue;\n }\n const version = regexResult.groups?.version;\n if (!version) {\n logger.debug(\n { file: filePath },\n `${bumpVersionsDescr}: No version found`,\n );\n continue;\n }\n\n // getting new version\n let newVersion: string | null = null;\n try {\n const bumpType = compile(rawBumpType, branchConfig);\n newVersion = inc(version, bumpType as ReleaseType);\n } catch (e) {\n addArtifactError(\n branchConfig,\n `Failed to calculate new version for ${bumpVersionsDescr}: ${e.message}`,\n filePath,\n );\n }\n if (!newVersion) {\n logger.debug(\n { file: filePath },\n `${bumpVersionsDescr}: Could not bump version`,\n );\n continue;\n }\n\n // replace the content of the `version` group with newVersion\n const newFileContents: string = fileContents\n .toString()\n .replace(matchStringRegex, (match, ...groups) => {\n const { version } = groups.pop();\n return match.replace(version, newVersion);\n });\n\n // update the file. Add it to the buckets if exists or create a new artifact update\n if (packageFiles[filePath]) {\n packageFiles[filePath].push({\n type: 'addition',\n path: filePath,\n contents: newFileContents,\n });\n } else {\n artifactFiles[filePath] ??= [];\n artifactFiles[filePath].push({\n type: 'addition',\n path: filePath,\n contents: newFileContents,\n });\n }\n\n fileBumped = true;\n }\n\n if (!fileBumped) {\n logger.debug(\n { file: filePath },\n `${bumpVersionsDescr}: No match found for bumping version`,\n );\n }\n }\n}\n\n/**\n * Get files that match ANY of the fileMatches pattern. fileMatches are compiled with the branchConfig.\n * @param bumpVersionsDescr log description for the bump version config\n * @param filePatternTemplates list of regex patterns\n * @param branchConfig compile metadata\n * @param fileList list of files to match against\n */\nfunction getMatchedFiles(\n bumpVersionsDescr: string,\n filePatternTemplates: string[],\n branchConfig: BranchConfig,\n fileList: string[],\n): string[] {\n // prepare file regex\n const filePatterns: string[] = [];\n for (const filePatternTemplateElement of filePatternTemplates) {\n const filePattern = compile(filePatternTemplateElement, branchConfig);\n filePatterns.push(filePattern);\n }\n\n logger.trace({ filePatterns }, `${bumpVersionsDescr}: Compiled filePatterns`);\n\n // get files that match the fileMatch\n const files: string[] = [];\n for (const file of fileList) {\n if (matchRegexOrGlobList(file, filePatterns)) {\n files.push(file);\n }\n }\n return files;\n}\n\nfunction fileChangeListToMap(\n list: FileChange[] | undefined,\n): Record<string, FileChange[]> {\n const record: Record<string, FileChange[]> = {};\n for (const fileChange of coerceArray(list)) {\n record[fileChange.path] ??= [];\n record[fileChange.path].push(fileChange);\n }\n return record;\n}\n\nfunction addArtifactError(\n branchConfig: BranchConfig,\n message: string,\n fileName?: string,\n): void {\n branchConfig.artifactErrors ??= [];\n branchConfig.artifactErrors.push({\n stderr: message,\n fileName,\n });\n}\n\nasync function getFileContent(\n bumpVersionsDescr: string,\n filePath: string,\n packageFiles: Record<string, FileChange[]>,\n artifactFiles: Record<string, FileChange[]>,\n): Promise<string | null> {\n const packageFileChanges = parseFileChanges(filePath, packageFiles);\n const artifactFileChanges = parseFileChanges(filePath, artifactFiles);\n\n // skip if the file is deleted as it virtually doesn't exist\n if (\n packageFileChanges.state === 'deleted' ||\n artifactFileChanges.state === 'deleted'\n ) {\n return null;\n }\n\n if (packageFileChanges.state === 'modified') {\n const lastChange = packageFileChanges.content;\n if (lastChange) {\n return lastChange;\n }\n }\n if (artifactFileChanges.state === 'modified') {\n const lastChange = artifactFileChanges.content;\n if (lastChange) {\n return lastChange;\n }\n }\n\n try {\n return await readLocalFile(filePath, 'utf8');\n } catch (e) {\n logger.warn(\n { file: filePath },\n `${bumpVersionsDescr}: Could not read file: ${e.message}`,\n );\n return null;\n }\n}\n\nfunction parseFileChanges(\n filePath: string,\n changeRecord: Record<string, FileChange[]>,\n): ParseFileChangesResult {\n const changes = coerceArray(changeRecord[filePath]);\n\n // skip if we can fetch from record\n if (!changes.length) {\n return { state: 'unmodified' };\n }\n\n const lastChange = changes[changes.length - 1];\n if (lastChange.type === 'deletion') {\n return { state: 'deleted' };\n }\n return {\n state: 'modified',\n content: lastChange.contents?.toString() ?? null,\n };\n}\n"]}
1
+ {"version":3,"file":"bump-versions.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/update/branch/bump-versions.ts"],"names":[],"mappings":";;AAkBA,oCA8BC;AAhDD,mCAA+C;AAE/C,+CAA4C;AAC5C,0DAAuD;AACvD,kDAAqD;AACrD,4CAAoD;AAEpD,kDAA+C;AAC/C,gEAAqE;AACrE,wDAAoD;AAEpD,yDAA+D;AAOxD,KAAK,UAAU,YAAY,CAAC,MAAoB;IACrD,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;IACzC,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;QAC1B,OAAO;IACT,CAAC;IAED,yDAAyD;IACzD,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAC;QAC5E,OAAO;IACT,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,SAAG,CAAC,WAAW,EAAE,CAAC;IACzC,MAAM,QAAQ,GAAG,IAAA,gCAAmB,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEvD,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAC3E,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAEzE,KAAK,MAAM,iBAAiB,IAAI,YAAY,EAAE,CAAC;QAC7C,MAAM,WAAW,CACf,iBAAiB,EACjB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,CACpB,CAAC;IACJ,CAAC;IAED,uCAAuC;IACvC,MAAM,CAAC,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAAI,EAAE,CAAC;IACtE,MAAM,CAAC,gBAAgB,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AC;QACpB,CAAC;IACH,CAAC;IACD,IAAI,mBAAmB,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;QAC7C,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,CAAC;QAC/C,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,UAAU,CAAC;QACpB,CAAC;IACH,CAAC;IAED,IAAI,CAAC;QACH,OAAO,MAAM,IAAA,kBAAa,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,eAAM,CAAC,IAAI,CACT,EAAE,IAAI,EAAE,QAAQ,EAAE,EAClB,GAAG,iBAAiB,0BAA0B,CAAC,CAAC,OAAO,EAAE,CAC1D,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CACvB,QAAgB,EAChB,YAA0C;IAE1C,MAAM,OAAO,GAAG,IAAA,mBAAW,EAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEpD,mCAAmC;IACnC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/C,IAAI,UAAU,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACnC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAC9B,CAAC;IACD,OAAO;QACL,KAAK,EAAE,UAAU;QACjB,OAAO,EAAE,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,IAAI;KACjD,CAAC;AACJ,CAAC","sourcesContent":["import { type ReleaseType, inc } from 'semver';\nimport type { BumpVersionConfig } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport { scm } from '../../../../modules/platform/scm';\nimport { coerceArray } from '../../../../util/array';\nimport { readLocalFile } from '../../../../util/fs';\nimport type { FileChange } from '../../../../util/git/types';\nimport { regEx } from '../../../../util/regex';\nimport { matchRegexOrGlobList } from '../../../../util/string-match';\nimport { compile } from '../../../../util/template';\nimport type { BranchConfig } from '../../../types';\nimport { getFilteredFileList } from '../../extract/file-match';\n\ntype ParseFileChangesResult =\n | { state: 'modified'; content: string | null }\n | { state: 'deleted' }\n | { state: 'unmodified' };\n\nexport async function bumpVersions(config: BranchConfig): Promise<void> {\n const bumpVersions = config.bumpVersions;\n if (!bumpVersions?.length) {\n return;\n }\n\n // skip if no packageFiles or artifacts have been updated\n if (!config.updatedPackageFiles?.length && !config.updatedArtifacts?.length) {\n return;\n }\n\n const allFiles = await scm.getFileList();\n const fileList = getFilteredFileList(config, allFiles);\n\n const packageFileChanges = fileChangeListToMap(config.updatedPackageFiles);\n const artifactFileChanges = fileChangeListToMap(config.updatedArtifacts);\n\n for (const bumpVersionConfig of bumpVersions) {\n await bumpVersion(\n bumpVersionConfig,\n config,\n fileList,\n packageFileChanges,\n artifactFileChanges,\n );\n }\n\n // update the config with the new files\n config.updatedPackageFiles = Object.values(packageFileChanges).flat();\n config.updatedArtifacts = Object.values(artifactFileChanges).flat();\n}\n\nasync function bumpVersion(\n config: BumpVersionConfig,\n branchConfig: BranchConfig,\n fileList: string[],\n packageFiles: Record<string, FileChange[]>,\n artifactFiles: Record<string, FileChange[]>,\n): Promise<void> {\n const rawBumpType = config.bumpType ?? 'patch';\n\n // all log messages should be prefixed with this string to facilitate easier logLevelRemapping\n const bumpVersionsDescr = config.name\n ? `bumpVersions(${config.name})`\n : 'bumpVersions';\n\n const files: string[] = [];\n try {\n files.push(\n ...getMatchedFiles(\n bumpVersionsDescr,\n config.filePatterns,\n branchConfig,\n fileList,\n ),\n );\n } catch (e) {\n addArtifactError(\n branchConfig,\n `Failed to calculate matched files for bumpVersions: ${e.message}`,\n );\n return;\n }\n\n if (!files.length) {\n logger.debug(`${bumpVersionsDescr}: filePatterns did not match any files`);\n return;\n }\n\n logger.trace(\n { files },\n `${bumpVersionsDescr}: Found ${files.length} files to bump versions`,\n );\n\n // keeping this only for logging purposes\n const matchStrings: string[] = [];\n\n // prepare the matchStrings\n const matchStringsRegexes: RegExp[] = [];\n for (const matchString of config.matchStrings) {\n try {\n const templated = compile(matchString, branchConfig);\n matchStrings.push(templated);\n matchStringsRegexes.push(regEx(templated));\n } catch (e) {\n addArtifactError(\n branchConfig,\n `Failed to compile matchString for ${bumpVersionsDescr}: ${e.message}`,\n matchString,\n );\n }\n }\n\n logger.trace({ matchStrings }, `${bumpVersionsDescr}: Compiled matchStrings`);\n\n for (const filePath of files) {\n let fileBumped = false;\n\n const fileContents = await getFileContent(\n bumpVersionsDescr,\n filePath,\n packageFiles,\n artifactFiles,\n );\n if (!fileContents) {\n continue;\n }\n\n for (const matchStringRegex of matchStringsRegexes) {\n // extracting the version from the file\n const regexResult = matchStringRegex.exec(fileContents);\n if (!regexResult) {\n continue;\n }\n const version = regexResult.groups?.version;\n if (!version) {\n logger.debug(\n { file: filePath },\n `${bumpVersionsDescr}: No version found`,\n );\n continue;\n }\n\n // getting new version\n let newVersion: string | null = null;\n try {\n const bumpType = compile(rawBumpType, branchConfig);\n const parts = regEx('^(?<major>\\\\d+)(?:\\\\.(?<minor>\\\\d+))?$').exec(\n version,\n );\n if (parts?.groups) {\n const { major, minor } = parts.groups;\n if (bumpType === 'major') {\n newVersion = `${parseInt(major) + 1}${minor ? `.0` : ''}`;\n } else if (bumpType === 'minor') {\n newVersion = `${major}.${parseInt(minor) + 1}`;\n } else {\n throw new Error(\n `Unsupported bump type for {major}.{minor} version: ${bumpType}`,\n );\n }\n } else {\n newVersion = inc(version, bumpType as ReleaseType);\n }\n } catch (e) {\n addArtifactError(\n branchConfig,\n `Failed to calculate new version for ${bumpVersionsDescr}: ${e.message}`,\n filePath,\n );\n }\n if (!newVersion) {\n logger.debug(\n { file: filePath },\n `${bumpVersionsDescr}: Could not bump version`,\n );\n continue;\n }\n\n // replace the content of the `version` group with newVersion\n const newFileContents: string = fileContents\n .toString()\n .replace(matchStringRegex, (match, ...groups) => {\n const { version } = groups.pop();\n return match.replace(version, newVersion);\n });\n\n // update the file. Add it to the buckets if exists or create a new artifact update\n if (packageFiles[filePath]) {\n packageFiles[filePath].push({\n type: 'addition',\n path: filePath,\n contents: newFileContents,\n });\n } else {\n artifactFiles[filePath] ??= [];\n artifactFiles[filePath].push({\n type: 'addition',\n path: filePath,\n contents: newFileContents,\n });\n }\n\n fileBumped = true;\n }\n\n if (!fileBumped) {\n logger.debug(\n { file: filePath },\n `${bumpVersionsDescr}: No match found for bumping version`,\n );\n }\n }\n}\n\n/**\n * Get files that match ANY of the fileMatches pattern. fileMatches are compiled with the branchConfig.\n * @param bumpVersionsDescr log description for the bump version config\n * @param filePatternTemplates list of regex patterns\n * @param branchConfig compile metadata\n * @param fileList list of files to match against\n */\nfunction getMatchedFiles(\n bumpVersionsDescr: string,\n filePatternTemplates: string[],\n branchConfig: BranchConfig,\n fileList: string[],\n): string[] {\n // prepare file regex\n const filePatterns: string[] = [];\n for (const filePatternTemplateElement of filePatternTemplates) {\n const filePattern = compile(filePatternTemplateElement, branchConfig);\n filePatterns.push(filePattern);\n }\n\n logger.trace({ filePatterns }, `${bumpVersionsDescr}: Compiled filePatterns`);\n\n // get files that match the fileMatch\n const files: string[] = [];\n for (const file of fileList) {\n if (matchRegexOrGlobList(file, filePatterns)) {\n files.push(file);\n }\n }\n return files;\n}\n\nfunction fileChangeListToMap(\n list: FileChange[] | undefined,\n): Record<string, FileChange[]> {\n const record: Record<string, FileChange[]> = {};\n for (const fileChange of coerceArray(list)) {\n record[fileChange.path] ??= [];\n record[fileChange.path].push(fileChange);\n }\n return record;\n}\n\nfunction addArtifactError(\n branchConfig: BranchConfig,\n message: string,\n fileName?: string,\n): void {\n branchConfig.artifactErrors ??= [];\n branchConfig.artifactErrors.push({\n stderr: message,\n fileName,\n });\n}\n\nasync function getFileContent(\n bumpVersionsDescr: string,\n filePath: string,\n packageFiles: Record<string, FileChange[]>,\n artifactFiles: Record<string, FileChange[]>,\n): Promise<string | null> {\n const packageFileChanges = parseFileChanges(filePath, packageFiles);\n const artifactFileChanges = parseFileChanges(filePath, artifactFiles);\n\n // skip if the file is deleted as it virtually doesn't exist\n if (\n packageFileChanges.state === 'deleted' ||\n artifactFileChanges.state === 'deleted'\n ) {\n return null;\n }\n\n if (packageFileChanges.state === 'modified') {\n const lastChange = packageFileChanges.content;\n if (lastChange) {\n return lastChange;\n }\n }\n if (artifactFileChanges.state === 'modified') {\n const lastChange = artifactFileChanges.content;\n if (lastChange) {\n return lastChange;\n }\n }\n\n try {\n return await readLocalFile(filePath, 'utf8');\n } catch (e) {\n logger.warn(\n { file: filePath },\n `${bumpVersionsDescr}: Could not read file: ${e.message}`,\n );\n return null;\n }\n}\n\nfunction parseFileChanges(\n filePath: string,\n changeRecord: Record<string, FileChange[]>,\n): ParseFileChangesResult {\n const changes = coerceArray(changeRecord[filePath]);\n\n // skip if we can fetch from record\n if (!changes.length) {\n return { state: 'unmodified' };\n }\n\n const lastChange = changes[changes.length - 1];\n if (lastChange.type === 'deletion') {\n return { state: 'deleted' };\n }\n return {\n state: 'modified',\n content: lastChange.contents?.toString() ?? null,\n };\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "renovate",
3
3
  "description": "Automated dependency updates. Flexible so you don't need to be.",
4
- "version": "42.8.1",
4
+ "version": "42.9.1",
5
5
  "type": "commonjs",
6
6
  "bin": {
7
7
  "renovate": "dist/renovate.js",
@@ -1,7 +1,7 @@
1
1
  {
2
- "title": "JSON schema for Renovate 42.8.1 config files (https://renovatebot.com/)",
2
+ "title": "JSON schema for Renovate 42.9.1 config files (https://renovatebot.com/)",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
- "x-renovate-version": "42.8.1",
4
+ "x-renovate-version": "42.9.1",
5
5
  "allowComments": true,
6
6
  "type": "object",
7
7
  "properties": {
@@ -1,2 +0,0 @@
1
- import type { Preset } from '../types';
2
- export declare const presets: Record<string, Preset>;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.presets = void 0;
4
- /* eslint sort-keys: ["error", "asc", {caseSensitive: false, natural: true}] */
5
- exports.presets = {};
6
- //# sourceMappingURL=npm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"npm.js","sourceRoot":"","sources":["../../../../lib/config/presets/internal/npm.ts"],"names":[],"mappings":";;;AAEA,+EAA+E;AAElE,QAAA,OAAO,GAA2B,EAAE,CAAC","sourcesContent":["import type { Preset } from '../types';\n\n/* eslint sort-keys: [\"error\", \"asc\", {caseSensitive: false, natural: true}] */\n\nexport const presets: Record<string, Preset> = {};\n"]}