renovate 39.75.0 → 39.75.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.
- package/dist/config/validation-helpers/utils.d.ts +12 -0
- package/dist/config/validation-helpers/utils.js +106 -0
- package/dist/config/validation-helpers/utils.js.map +1 -0
- package/dist/config/validation.d.ts +0 -1
- package/dist/config/validation.js +12 -104
- package/dist/config/validation.js.map +1 -1
- package/package.json +1 -1
@@ -0,0 +1,12 @@
|
|
1
|
+
import type { RegexManagerConfig } from '../../modules/manager/custom/regex/types';
|
2
|
+
import type { ValidationMessage } from '../types';
|
3
|
+
export declare function getParentName(parentPath: string | undefined): string;
|
4
|
+
export declare function validatePlainObject(val: Record<string, unknown>): true | string;
|
5
|
+
export declare function validateNumber(key: string, val: unknown, allowsNegative: boolean, currentPath?: string, subKey?: string): ValidationMessage[];
|
6
|
+
/** An option is a false global if it has the same name as a global only option
|
7
|
+
* but is actually just the field of a non global option or field an children of the non global option
|
8
|
+
* eg. token: it's global option used as the bot's token as well and
|
9
|
+
* also it can be the token used for a platform inside the hostRules configuration
|
10
|
+
*/
|
11
|
+
export declare function isFalseGlobal(optionName: string, parentPath?: string): boolean;
|
12
|
+
export declare function validateRegexManagerFields(customManager: Partial<RegexManagerConfig>, currentPath: string, errors: ValidationMessage[]): void;
|
@@ -0,0 +1,106 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getParentName = getParentName;
|
4
|
+
exports.validatePlainObject = validatePlainObject;
|
5
|
+
exports.validateNumber = validateNumber;
|
6
|
+
exports.isFalseGlobal = isFalseGlobal;
|
7
|
+
exports.validateRegexManagerFields = validateRegexManagerFields;
|
8
|
+
const tslib_1 = require("tslib");
|
9
|
+
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
|
10
|
+
const logger_1 = require("../../logger");
|
11
|
+
const regex_1 = require("../../util/regex");
|
12
|
+
function getParentName(parentPath) {
|
13
|
+
return parentPath
|
14
|
+
? parentPath
|
15
|
+
.replace((0, regex_1.regEx)(/\.?encrypted$/), '')
|
16
|
+
.replace((0, regex_1.regEx)(/\[\d+\]$/), '')
|
17
|
+
.split('.')
|
18
|
+
.pop()
|
19
|
+
: '.';
|
20
|
+
}
|
21
|
+
function validatePlainObject(val) {
|
22
|
+
for (const [key, value] of Object.entries(val)) {
|
23
|
+
if (!is_1.default.string(value)) {
|
24
|
+
return key;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
return true;
|
28
|
+
}
|
29
|
+
function validateNumber(key, val, allowsNegative, currentPath, subKey) {
|
30
|
+
const errors = [];
|
31
|
+
const path = `${currentPath}${subKey ? '.' + subKey : ''}`;
|
32
|
+
if (is_1.default.number(val)) {
|
33
|
+
if (val < 0 && !allowsNegative) {
|
34
|
+
errors.push({
|
35
|
+
topic: 'Configuration Error',
|
36
|
+
message: `Configuration option \`${path}\` should be a positive integer. Found negative value instead.`,
|
37
|
+
});
|
38
|
+
}
|
39
|
+
}
|
40
|
+
else {
|
41
|
+
errors.push({
|
42
|
+
topic: 'Configuration Error',
|
43
|
+
message: `Configuration option \`${path}\` should be an integer. Found: ${JSON.stringify(val)} (${typeof val}).`,
|
44
|
+
});
|
45
|
+
}
|
46
|
+
return errors;
|
47
|
+
}
|
48
|
+
/** An option is a false global if it has the same name as a global only option
|
49
|
+
* but is actually just the field of a non global option or field an children of the non global option
|
50
|
+
* eg. token: it's global option used as the bot's token as well and
|
51
|
+
* also it can be the token used for a platform inside the hostRules configuration
|
52
|
+
*/
|
53
|
+
function isFalseGlobal(optionName, parentPath) {
|
54
|
+
if (parentPath?.includes('hostRules')) {
|
55
|
+
if (optionName === 'token' ||
|
56
|
+
optionName === 'username' ||
|
57
|
+
optionName === 'password') {
|
58
|
+
return true;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
return false;
|
62
|
+
}
|
63
|
+
function hasField(customManager, field) {
|
64
|
+
const templateField = `${field}Template`;
|
65
|
+
return !!(customManager[templateField] ??
|
66
|
+
customManager.matchStrings?.some((matchString) => matchString.includes(`(?<${field}>`)));
|
67
|
+
}
|
68
|
+
function validateRegexManagerFields(customManager, currentPath, errors) {
|
69
|
+
if (is_1.default.nonEmptyArray(customManager.matchStrings)) {
|
70
|
+
for (const matchString of customManager.matchStrings) {
|
71
|
+
try {
|
72
|
+
(0, regex_1.regEx)(matchString);
|
73
|
+
}
|
74
|
+
catch (err) {
|
75
|
+
logger_1.logger.debug({ err }, 'customManager.matchStrings regEx validation error');
|
76
|
+
errors.push({
|
77
|
+
topic: 'Configuration Error',
|
78
|
+
message: `Invalid regExp for ${currentPath}: \`${matchString}\``,
|
79
|
+
});
|
80
|
+
}
|
81
|
+
}
|
82
|
+
}
|
83
|
+
else {
|
84
|
+
errors.push({
|
85
|
+
topic: 'Configuration Error',
|
86
|
+
message: `Each Custom Manager must contain a non-empty matchStrings array`,
|
87
|
+
});
|
88
|
+
}
|
89
|
+
const mandatoryFields = ['currentValue', 'datasource'];
|
90
|
+
for (const field of mandatoryFields) {
|
91
|
+
if (!hasField(customManager, field)) {
|
92
|
+
errors.push({
|
93
|
+
topic: 'Configuration Error',
|
94
|
+
message: `Regex Managers must contain ${field}Template configuration or regex group named ${field}`,
|
95
|
+
});
|
96
|
+
}
|
97
|
+
}
|
98
|
+
const nameFields = ['depName', 'packageName'];
|
99
|
+
if (!nameFields.some((field) => hasField(customManager, field))) {
|
100
|
+
errors.push({
|
101
|
+
topic: 'Configuration Error',
|
102
|
+
message: `Regex Managers must contain depName or packageName regex groups or templates`,
|
103
|
+
});
|
104
|
+
}
|
105
|
+
}
|
106
|
+
//# sourceMappingURL=utils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/config/validation-helpers/utils.ts"],"names":[],"mappings":";;AASA,sCAQC;AAED,kDASC;AAED,wCA0BC;AAOD,sCAeC;AAeD,gEA4CC;;AAzID,kEAAkC;AAClC,yCAAsC;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AAM,CAAC,IAAI,CAAC;YACV,KAAK,EAAE,qBAAqB;YAC5B,OAAO,EAAE,iEAAiE;SAC3E,CAAC,CAAC;IACL,CAAC;IAED,MAAM,eAAe,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IACvD,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,CAAC;QACpC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC;YACpC,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,qBAAqB;gBAC5B,OAAO,EAAE,+BAA+B,KAAK,+CAA+C,KAAK,EAAE;aACpG,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAC9C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC;QAChE,MAAM,CAAC,IAAI,CAAC;YACV,KAAK,EAAE,qBAAqB;YAC5B,OAAO,EAAE,8EAA8E;SACxF,CAAC,CAAC;IACL,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { logger } from '../../logger';\nimport type {\n RegexManagerConfig,\n RegexManagerTemplates,\n} from '../../modules/manager/custom/regex/types';\nimport { regEx } from '../../util/regex';\nimport type { ValidationMessage } from '../types';\n\nexport function getParentName(parentPath: string | undefined): string {\n return parentPath\n ? parentPath\n .replace(regEx(/\\.?encrypted$/), '')\n .replace(regEx(/\\[\\d+\\]$/), '')\n .split('.')\n .pop()!\n : '.';\n}\n\nexport function validatePlainObject(\n val: Record<string, unknown>,\n): true | string {\n for (const [key, value] of Object.entries(val)) {\n if (!is.string(value)) {\n return key;\n }\n }\n return true;\n}\n\nexport function validateNumber(\n key: string,\n val: unknown,\n allowsNegative: boolean,\n currentPath?: string,\n subKey?: string,\n): ValidationMessage[] {\n const errors: ValidationMessage[] = [];\n const path = `${currentPath}${subKey ? '.' + subKey : ''}`;\n if (is.number(val)) {\n if (val < 0 && !allowsNegative) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${path}\\` should be a positive integer. Found negative value instead.`,\n });\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${path}\\` should be an integer. Found: ${JSON.stringify(\n val,\n )} (${typeof val}).`,\n });\n }\n\n return errors;\n}\n\n/** An option is a false global if it has the same name as a global only option\n * but is actually just the field of a non global option or field an children of the non global option\n * eg. token: it's global option used as the bot's token as well and\n * also it can be the token used for a platform inside the hostRules configuration\n */\nexport function isFalseGlobal(\n optionName: string,\n parentPath?: string,\n): boolean {\n if (parentPath?.includes('hostRules')) {\n if (\n optionName === 'token' ||\n optionName === 'username' ||\n optionName === 'password'\n ) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction hasField(\n customManager: Partial<RegexManagerConfig>,\n field: string,\n): boolean {\n const templateField = `${field}Template` as keyof RegexManagerTemplates;\n return !!(\n customManager[templateField] ??\n customManager.matchStrings?.some((matchString) =>\n matchString.includes(`(?<${field}>`),\n )\n );\n}\n\nexport function validateRegexManagerFields(\n customManager: Partial<RegexManagerConfig>,\n currentPath: string,\n errors: ValidationMessage[],\n): void {\n if (is.nonEmptyArray(customManager.matchStrings)) {\n for (const matchString of customManager.matchStrings) {\n try {\n regEx(matchString);\n } catch (err) {\n logger.debug(\n { err },\n 'customManager.matchStrings regEx validation error',\n );\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${matchString}\\``,\n });\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Each Custom Manager must contain a non-empty matchStrings array`,\n });\n }\n\n const mandatoryFields = ['currentValue', 'datasource'];\n for (const field of mandatoryFields) {\n if (!hasField(customManager, field)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Regex Managers must contain ${field}Template configuration or regex group named ${field}`,\n });\n }\n }\n\n const nameFields = ['depName', 'packageName'];\n if (!nameFields.some((field) => hasField(customManager, field))) {\n errors.push({\n topic: 'Configuration Error',\n message: `Regex Managers must contain depName or packageName regex groups or templates`,\n });\n }\n}\n"]}
|
@@ -1,3 +1,2 @@
|
|
1
1
|
import type { RenovateConfig, ValidationResult } from './types';
|
2
|
-
export declare function getParentName(parentPath: string | undefined): string;
|
3
2
|
export declare function validateConfig(configType: 'global' | 'inherit' | 'repo', config: RenovateConfig, isPreset?: boolean, parentPath?: string): Promise<ValidationResult>;
|
@@ -1,10 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getParentName = getParentName;
|
4
3
|
exports.validateConfig = validateConfig;
|
5
4
|
const tslib_1 = require("tslib");
|
6
5
|
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
|
7
|
-
const logger_1 = require("../logger");
|
8
6
|
const manager_1 = require("../modules/manager");
|
9
7
|
const custom_1 = require("../modules/manager/custom");
|
10
8
|
const jsonata_1 = require("../util/jsonata");
|
@@ -23,6 +21,7 @@ const types_1 = require("./types");
|
|
23
21
|
const managerValidator = tslib_1.__importStar(require("./validation-helpers/managers"));
|
24
22
|
const matchBaseBranchesValidator = tslib_1.__importStar(require("./validation-helpers/match-base-branches"));
|
25
23
|
const regexOrGlobValidator = tslib_1.__importStar(require("./validation-helpers/regex-glob-matchers"));
|
24
|
+
const utils_1 = require("./validation-helpers/utils");
|
26
25
|
const options = (0, options_1.getOptions)();
|
27
26
|
let optionsInitialized = false;
|
28
27
|
let optionTypes;
|
@@ -58,33 +57,6 @@ function isManagerPath(parentPath) {
|
|
58
57
|
function isIgnored(key) {
|
59
58
|
return ignoredNodes.includes(key);
|
60
59
|
}
|
61
|
-
function validatePlainObject(val) {
|
62
|
-
for (const [key, value] of Object.entries(val)) {
|
63
|
-
if (!is_1.default.string(value)) {
|
64
|
-
return key;
|
65
|
-
}
|
66
|
-
}
|
67
|
-
return true;
|
68
|
-
}
|
69
|
-
function validateNumber(key, val, currentPath, subKey) {
|
70
|
-
const errors = [];
|
71
|
-
const path = `${currentPath}${subKey ? '.' + subKey : ''}`;
|
72
|
-
if (is_1.default.number(val)) {
|
73
|
-
if (val < 0 && !optionAllowsNegativeIntegers.has(key)) {
|
74
|
-
errors.push({
|
75
|
-
topic: 'Configuration Error',
|
76
|
-
message: `Configuration option \`${path}\` should be a positive integer. Found negative value instead.`,
|
77
|
-
});
|
78
|
-
}
|
79
|
-
}
|
80
|
-
else {
|
81
|
-
errors.push({
|
82
|
-
topic: 'Configuration Error',
|
83
|
-
message: `Configuration option \`${path}\` should be an integer. Found: ${JSON.stringify(val)} (${typeof val}).`,
|
84
|
-
});
|
85
|
-
}
|
86
|
-
return errors;
|
87
|
-
}
|
88
60
|
function getUnsupportedEnabledManagers(enabledManagers) {
|
89
61
|
return enabledManagers.filter((manager) => !manager_1.allManagersList.includes(manager.replace('custom.', '')));
|
90
62
|
}
|
@@ -135,15 +107,6 @@ function initOptions() {
|
|
135
107
|
}
|
136
108
|
optionsInitialized = true;
|
137
109
|
}
|
138
|
-
function getParentName(parentPath) {
|
139
|
-
return parentPath
|
140
|
-
? parentPath
|
141
|
-
.replace((0, regex_1.regEx)(/\.?encrypted$/), '')
|
142
|
-
.replace((0, regex_1.regEx)(/\[\d+\]$/), '')
|
143
|
-
.split('.')
|
144
|
-
.pop()
|
145
|
-
: '.';
|
146
|
-
}
|
147
110
|
async function validateConfig(configType, config, isPreset, parentPath) {
|
148
111
|
initOptions();
|
149
112
|
let errors = [];
|
@@ -171,7 +134,7 @@ async function validateConfig(configType, config, isPreset, parentPath) {
|
|
171
134
|
await validateGlobalConfig(key, val, optionTypes[key], warnings, errors, currentPath, config);
|
172
135
|
continue;
|
173
136
|
}
|
174
|
-
else if (!isFalseGlobal(key, parentPath) &&
|
137
|
+
else if (!(0, utils_1.isFalseGlobal)(key, parentPath) &&
|
175
138
|
!(configType === 'inherit' && isInhertConfigOption(key))) {
|
176
139
|
warnings.push({
|
177
140
|
topic: 'Configuration Error',
|
@@ -233,7 +196,7 @@ async function validateConfig(configType, config, isPreset, parentPath) {
|
|
233
196
|
});
|
234
197
|
}
|
235
198
|
}
|
236
|
-
const parentName = getParentName(parentPath);
|
199
|
+
const parentName = (0, utils_1.getParentName)(parentPath);
|
237
200
|
if (!isPreset &&
|
238
201
|
optionParents[key] &&
|
239
202
|
!optionParents[key].includes(parentName)) {
|
@@ -293,7 +256,8 @@ async function validateConfig(configType, config, isPreset, parentPath) {
|
|
293
256
|
}
|
294
257
|
}
|
295
258
|
else if (type === 'integer') {
|
296
|
-
|
259
|
+
const allowsNegative = optionAllowsNegativeIntegers.has(key);
|
260
|
+
errors.push(...(0, utils_1.validateNumber)(key, val, allowsNegative, currentPath));
|
297
261
|
}
|
298
262
|
else if (type === 'array' && val) {
|
299
263
|
if (is_1.default.array(val)) {
|
@@ -455,7 +419,7 @@ async function validateConfig(configType, config, isPreset, parentPath) {
|
|
455
419
|
if (is_1.default.nonEmptyArray(customManager.fileMatch)) {
|
456
420
|
switch (customManager.customType) {
|
457
421
|
case 'regex':
|
458
|
-
validateRegexManagerFields(customManager, currentPath, errors);
|
422
|
+
(0, utils_1.validateRegexManagerFields)(customManager, currentPath, errors);
|
459
423
|
break;
|
460
424
|
}
|
461
425
|
}
|
@@ -558,7 +522,7 @@ async function validateConfig(configType, config, isPreset, parentPath) {
|
|
558
522
|
key !== 'constraints') {
|
559
523
|
if (is_1.default.plainObject(val)) {
|
560
524
|
if (key === 'registryAliases') {
|
561
|
-
const res = validatePlainObject(val);
|
525
|
+
const res = (0, utils_1.validatePlainObject)(val);
|
562
526
|
if (res !== true) {
|
563
527
|
errors.push({
|
564
528
|
topic: 'Configuration Error',
|
@@ -733,49 +697,6 @@ async function validateConfig(configType, config, isPreset, parentPath) {
|
|
733
697
|
warnings.sort(sortAll);
|
734
698
|
return { errors, warnings };
|
735
699
|
}
|
736
|
-
function hasField(customManager, field) {
|
737
|
-
const templateField = `${field}Template`;
|
738
|
-
return !!(customManager[templateField] ??
|
739
|
-
customManager.matchStrings?.some((matchString) => matchString.includes(`(?<${field}>`)));
|
740
|
-
}
|
741
|
-
function validateRegexManagerFields(customManager, currentPath, errors) {
|
742
|
-
if (is_1.default.nonEmptyArray(customManager.matchStrings)) {
|
743
|
-
for (const matchString of customManager.matchStrings) {
|
744
|
-
try {
|
745
|
-
(0, regex_1.regEx)(matchString);
|
746
|
-
}
|
747
|
-
catch (err) {
|
748
|
-
logger_1.logger.debug({ err }, 'customManager.matchStrings regEx validation error');
|
749
|
-
errors.push({
|
750
|
-
topic: 'Configuration Error',
|
751
|
-
message: `Invalid regExp for ${currentPath}: \`${matchString}\``,
|
752
|
-
});
|
753
|
-
}
|
754
|
-
}
|
755
|
-
}
|
756
|
-
else {
|
757
|
-
errors.push({
|
758
|
-
topic: 'Configuration Error',
|
759
|
-
message: `Each Custom Manager must contain a non-empty matchStrings array`,
|
760
|
-
});
|
761
|
-
}
|
762
|
-
const mandatoryFields = ['currentValue', 'datasource'];
|
763
|
-
for (const field of mandatoryFields) {
|
764
|
-
if (!hasField(customManager, field)) {
|
765
|
-
errors.push({
|
766
|
-
topic: 'Configuration Error',
|
767
|
-
message: `Regex Managers must contain ${field}Template configuration or regex group named ${field}`,
|
768
|
-
});
|
769
|
-
}
|
770
|
-
}
|
771
|
-
const nameFields = ['depName', 'packageName'];
|
772
|
-
if (!nameFields.some((field) => hasField(customManager, field))) {
|
773
|
-
errors.push({
|
774
|
-
topic: 'Configuration Error',
|
775
|
-
message: `Regex Managers must contain depName or packageName regex groups or templates`,
|
776
|
-
});
|
777
|
-
}
|
778
|
-
}
|
779
700
|
/**
|
780
701
|
* Basic validation for global config options
|
781
702
|
*/
|
@@ -849,7 +770,8 @@ async function validateGlobalConfig(key, val, type, warnings, errors, currentPat
|
|
849
770
|
}
|
850
771
|
}
|
851
772
|
else if (type === 'integer') {
|
852
|
-
|
773
|
+
const allowsNegative = optionAllowsNegativeIntegers.has(key);
|
774
|
+
warnings.push(...(0, utils_1.validateNumber)(key, val, allowsNegative, currentPath));
|
853
775
|
}
|
854
776
|
else if (type === 'boolean') {
|
855
777
|
if (val !== true && val !== false) {
|
@@ -913,11 +835,12 @@ async function validateGlobalConfig(key, val, type, warnings, errors, currentPat
|
|
913
835
|
}
|
914
836
|
else if (key === 'cacheTtlOverride') {
|
915
837
|
for (const [subKey, subValue] of Object.entries(val)) {
|
916
|
-
|
838
|
+
const allowsNegative = optionAllowsNegativeIntegers.has(key);
|
839
|
+
warnings.push(...(0, utils_1.validateNumber)(key, subValue, allowsNegative, currentPath, subKey));
|
917
840
|
}
|
918
841
|
}
|
919
842
|
else {
|
920
|
-
const res = validatePlainObject(val);
|
843
|
+
const res = (0, utils_1.validatePlainObject)(val);
|
921
844
|
if (res !== true) {
|
922
845
|
warnings.push({
|
923
846
|
topic: 'Configuration Error',
|
@@ -935,19 +858,4 @@ async function validateGlobalConfig(key, val, type, warnings, errors, currentPat
|
|
935
858
|
}
|
936
859
|
}
|
937
860
|
}
|
938
|
-
/** An option is a false global if it has the same name as a global only option
|
939
|
-
* but is actually just the field of a non global option or field an children of the non global option
|
940
|
-
* eg. token: it's global option used as the bot's token as well and
|
941
|
-
* also it can be the token used for a platform inside the hostRules configuration
|
942
|
-
*/
|
943
|
-
function isFalseGlobal(optionName, parentPath) {
|
944
|
-
if (parentPath?.includes('hostRules')) {
|
945
|
-
if (optionName === 'token' ||
|
946
|
-
optionName === 'username' ||
|
947
|
-
optionName === 'password') {
|
948
|
-
return true;
|
949
|
-
}
|
950
|
-
}
|
951
|
-
return false;
|
952
|
-
}
|
953
861
|
//# sourceMappingURL=validation.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../lib/config/validation.ts"],"names":[],"mappings":";;AA4LA,sCAQC;AAED,wCA2pBC;;AAj2BD,kEAAkC;AAClC,sCAAmC;AACnC,gDAAqE;AACrE,sDAA4D;AAO5D,6CAAgD;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AAC,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,QAAQ,CAAC,IAAI,CACX,GAAG,cAAc,CAAC,GAAG,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,CAAC,CACtD,CAAC;oBACJ,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,MAAM,GAAG,GAAG,mBAAmB,CAAC,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;AAED;;;;GAIG;AACH,SAAS,aAAa,CAAC,UAAkB,EAAE,UAAmB;IAC5D,IAAI,UAAU,EAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QACtC,IACE,UAAU,KAAK,OAAO;YACtB,UAAU,KAAK,UAAU;YACzB,UAAU,KAAK,UAAU,EACzB,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { logger } from '../logger';\nimport { allManagersList, getManagerList } from '../modules/manager';\nimport { isCustomManager } from '../modules/manager/custom';\nimport type {\n RegexManagerConfig,\n RegexManagerTemplates,\n} from '../modules/manager/custom/regex/types';\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 { configFileNames } 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 managerValidator from './validation-helpers/managers';\nimport * as matchBaseBranchesValidator from './validation-helpers/match-base-branches';\nimport * as regexOrGlobValidator from './validation-helpers/regex-glob-matchers';\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 isManagerPath(parentPath: string): boolean {\n return (\n regEx(/^customManagers\\[[0-9]+]$/).test(parentPath) ||\n managerList.includes(parentPath)\n );\n}\n\nfunction isIgnored(key: string): boolean {\n return ignoredNodes.includes(key);\n}\n\nfunction validatePlainObject(val: Record<string, unknown>): true | string {\n for (const [key, value] of Object.entries(val)) {\n if (!is.string(value)) {\n return key;\n }\n }\n return true;\n}\n\nfunction validateNumber(\n key: string,\n val: unknown,\n currentPath?: string,\n subKey?: string,\n): ValidationMessage[] {\n const errors: ValidationMessage[] = [];\n const path = `${currentPath}${subKey ? '.' + subKey : ''}`;\n if (is.number(val)) {\n if (val < 0 && !optionAllowsNegativeIntegers.has(key)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${path}\\` should be a positive integer. Found negative value instead.`,\n });\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Configuration option \\`${path}\\` should be an integer. Found: ${JSON.stringify(\n val,\n )} (${typeof val}).`,\n });\n }\n\n return errors;\n}\n\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 function getParentName(parentPath: string | undefined): string {\n return parentPath\n ? parentPath\n .replace(regEx(/\\.?encrypted$/), '')\n .replace(regEx(/\\[\\d+\\]$/), '')\n .split('.')\n .pop()!\n : '.';\n}\n\nexport 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 // istanbul ignore if\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 (is.nonEmptyArray(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 === 'fileMatch') {\n if (parentPath === undefined) {\n errors.push({\n topic: 'Config error',\n message: `\"fileMatch\" may not be defined at the top level of a config and must instead be within a manager block`,\n });\n } else if (!isManagerPath(parentPath)) {\n warnings.push({\n topic: 'Config warning',\n message: `\"fileMatch\" must be configured in a manager block and not here: ${parentPath}`,\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 message = `${key} should only be configured within one of \"${optionParents[\n key\n ]?.join(' or ')}\" objects. Was found in ${parentName}`;\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 errors.push(...validateNumber(key, val, currentPath));\n } else if (type === 'array' && val) {\n if (is.array(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (is.object(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 (is.string(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 (is.object(packageRule)) {\n const resolvedRule = migrateConfig({\n packageRules: [\n await resolveConfigPresets(\n packageRule as RenovateConfig,\n config,\n ),\n ],\n }).migratedConfig.packageRules![0];\n errors.push(\n ...managerValidator.check({ resolvedRule, currentPath }),\n );\n warnings.push(\n ...matchBaseBranchesValidator.check({\n resolvedRule,\n currentPath: `${currentPath}[${subIndex}]`,\n baseBranches: config.baseBranches!,\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 (is.nonEmptyArray(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 'fileMatch',\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 is.nonEmptyString(customManager.customType) &&\n isCustomManager(customManager.customType)\n ) {\n if (is.nonEmptyArray(customManager.fileMatch)) {\n switch (customManager.customType) {\n case 'regex':\n validateRegexManagerFields(\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 fileMatch array`,\n });\n }\n } else {\n if (\n is.emptyString(customManager.customType) ||\n is.undefined(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 === 'fileMatch') {\n for (const fileMatch of val as string[]) {\n try {\n regEx(fileMatch);\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${fileMatch}\\``,\n });\n }\n }\n }\n if (key === 'baseBranches') {\n for (const baseBranch of val as string[]) {\n if (\n isRegexMatch(baseBranch) &&\n !getRegexPredicate(baseBranch)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${baseBranch}\\``,\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 (is.string(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 (!is.string(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 (is.plainObject(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 (!is.string(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 !(is.string(statusCheckValue) || is.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 (!is.plainObject(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 (!is.array(subValue, is.string)) {\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 !(is.string(subValue) || is.array(subValue, is.string))\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 (!is.string(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' && is.array(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 (is.nonEmptyString(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 (is.emptyString(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 (!is.string(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' && is.array(val, is.string)) {\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 // istanbul ignore else: currently never happen\n if (a.topic === b.topic) {\n return a.message > b.message ? 1 : -1;\n }\n // istanbul ignore next: currently never happen\n return a.topic > b.topic ? 1 : -1;\n }\n\n errors.sort(sortAll);\n warnings.sort(sortAll);\n return { errors, warnings };\n}\n\nfunction hasField(\n customManager: Partial<RegexManagerConfig>,\n field: string,\n): boolean {\n const templateField = `${field}Template` as keyof RegexManagerTemplates;\n return !!(\n customManager[templateField] ??\n customManager.matchStrings?.some((matchString) =>\n matchString.includes(`(?<${field}>`),\n )\n );\n}\n\nfunction validateRegexManagerFields(\n customManager: Partial<RegexManagerConfig>,\n currentPath: string,\n errors: ValidationMessage[],\n): void {\n if (is.nonEmptyArray(customManager.matchStrings)) {\n for (const matchString of customManager.matchStrings) {\n try {\n regEx(matchString);\n } catch (err) {\n logger.debug(\n { err },\n 'customManager.matchStrings regEx validation error',\n );\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${matchString}\\``,\n });\n }\n }\n } else {\n errors.push({\n topic: 'Configuration Error',\n message: `Each Custom Manager must contain a non-empty matchStrings array`,\n });\n }\n\n const mandatoryFields = ['currentValue', 'datasource'];\n for (const field of mandatoryFields) {\n if (!hasField(customManager, field)) {\n errors.push({\n topic: 'Configuration Error',\n message: `Regex Managers must contain ${field}Template configuration or regex group named ${field}`,\n });\n }\n }\n\n const nameFields = ['depName', 'packageName'];\n if (!nameFields.some((field) => hasField(customManager, field))) {\n errors.push({\n topic: 'Configuration Error',\n message: `Regex Managers must contain depName or packageName regex groups or templates`,\n });\n }\n}\n\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 // istanbul ignore if\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 (is.string(val)) {\n if (\n key === 'onboardingConfigFileName' &&\n !configFileNames.includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${configFileNames.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 !is.string(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 warnings.push(...validateNumber(key, val, 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 (is.array(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 (is.plainObject(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 warnings.push(\n ...validateNumber(key, subValue, currentPath, subKey),\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\n/** An option is a false global if it has the same name as a global only option\n * but is actually just the field of a non global option or field an children of the non global option\n * eg. token: it's global option used as the bot's token as well and\n * also it can be the token used for a platform inside the hostRules configuration\n */\nfunction isFalseGlobal(optionName: string, parentPath?: string): boolean {\n if (parentPath?.includes('hostRules')) {\n if (\n optionName === 'token' ||\n optionName === 'username' ||\n optionName === 'password'\n ) {\n return true;\n }\n }\n\n return false;\n}\n"]}
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../lib/config/validation.ts"],"names":[],"mappings":";;AA0JA,wCA4pBC;;AAtzBD,kEAAkC;AAClC,gDAAqE;AACrE,sDAA4D;AAG5D,6CAAgD;AAChD,yCAAsC;AACtC,uDAI8B;AAC9B,mEAA6C;AAC7C,qCAAuC;AACvC,2EAGsD;AACtD,+CAAgD;AAChD,qCAAwC;AACxC,2CAA4C;AAC5C,uCAAuC;AACvC,uCAAiD;AACjD,0EAA2E;AAS3E,mCAAoD;AACpD,wFAAkE;AAClE,6GAAuF;AACvF,uGAAiF;AACjF,sDAMoC;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,oBAA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C;oBACzB,CAAC;gBACH,CAAC;qBAAM,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;oBAC3B,MAAM,aAAa,GAAG,MAAM,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;oBAC1D,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 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 { configFileNames } 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 managerValidator from './validation-helpers/managers';\nimport * as matchBaseBranchesValidator from './validation-helpers/match-base-branches';\nimport * as regexOrGlobValidator from './validation-helpers/regex-glob-matchers';\nimport {\n getParentName,\n isFalseGlobal,\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 isManagerPath(parentPath: string): boolean {\n return (\n regEx(/^customManagers\\[[0-9]+]$/).test(parentPath) ||\n managerList.includes(parentPath)\n );\n}\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 // istanbul ignore if\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 (is.nonEmptyArray(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 === 'fileMatch') {\n if (parentPath === undefined) {\n errors.push({\n topic: 'Config error',\n message: `\"fileMatch\" may not be defined at the top level of a config and must instead be within a manager block`,\n });\n } else if (!isManagerPath(parentPath)) {\n warnings.push({\n topic: 'Config warning',\n message: `\"fileMatch\" must be configured in a manager block and not here: ${parentPath}`,\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 message = `${key} should only be configured within one of \"${optionParents[\n key\n ]?.join(' or ')}\" objects. Was found in ${parentName}`;\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 (is.array(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (is.object(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 (is.string(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 (is.object(packageRule)) {\n const resolvedRule = migrateConfig({\n packageRules: [\n await resolveConfigPresets(\n packageRule as RenovateConfig,\n config,\n ),\n ],\n }).migratedConfig.packageRules![0];\n errors.push(\n ...managerValidator.check({ resolvedRule, currentPath }),\n );\n warnings.push(\n ...matchBaseBranchesValidator.check({\n resolvedRule,\n currentPath: `${currentPath}[${subIndex}]`,\n baseBranches: config.baseBranches!,\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 (is.nonEmptyArray(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 'fileMatch',\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 is.nonEmptyString(customManager.customType) &&\n isCustomManager(customManager.customType)\n ) {\n if (is.nonEmptyArray(customManager.fileMatch)) {\n switch (customManager.customType) {\n case 'regex':\n validateRegexManagerFields(\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 fileMatch array`,\n });\n }\n } else {\n if (\n is.emptyString(customManager.customType) ||\n is.undefined(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 === 'fileMatch') {\n for (const fileMatch of val as string[]) {\n try {\n regEx(fileMatch);\n } catch {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${fileMatch}\\``,\n });\n }\n }\n }\n if (key === 'baseBranches') {\n for (const baseBranch of val as string[]) {\n if (\n isRegexMatch(baseBranch) &&\n !getRegexPredicate(baseBranch)\n ) {\n errors.push({\n topic: 'Configuration Error',\n message: `Invalid regExp for ${currentPath}: \\`${baseBranch}\\``,\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 (is.string(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 (!is.string(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 (is.plainObject(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 (!is.string(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 !(is.string(statusCheckValue) || is.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 (!is.plainObject(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 (!is.array(subValue, is.string)) {\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 !(is.string(subValue) || is.array(subValue, is.string))\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 (!is.string(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' && is.array(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 (is.nonEmptyString(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 (is.emptyString(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 (!is.string(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' && is.array(val, is.string)) {\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 // istanbul ignore else: currently never happen\n if (a.topic === b.topic) {\n return a.message > b.message ? 1 : -1;\n }\n // istanbul ignore next: currently never happen\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 // istanbul ignore if\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 (is.string(val)) {\n if (\n key === 'onboardingConfigFileName' &&\n !configFileNames.includes(val)\n ) {\n warnings.push({\n topic: 'Configuration Error',\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${configFileNames.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 !is.string(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 (is.array(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 (is.plainObject(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"]}
|