renovate 42.19.4 → 42.19.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/workers/repository/process/lookup/filter-checks.js +5 -2
- package/dist/workers/repository/process/lookup/filter-checks.js.map +1 -1
- package/dist/workers/repository/update/branch/index.js +5 -2
- package/dist/workers/repository/update/branch/index.js.map +1 -1
- package/package.json +2 -2
- package/renovate-schema.json +2 -2
|
@@ -43,13 +43,16 @@ async function filterInternalChecks(config, versioningApi, bucket, sortedRelease
|
|
|
43
43
|
candidateRelease = updatedCandidateRelease;
|
|
44
44
|
// Now check for a minimumReleaseAge config
|
|
45
45
|
const { minimumConfidence, minimumReleaseAge, updateType } = releaseConfig;
|
|
46
|
-
|
|
46
|
+
const minimumReleaseAgeMs = (0, is_1.isNonEmptyString)(minimumReleaseAge)
|
|
47
|
+
? (0, number_1.coerceNumber)((0, pretty_time_1.toMs)(minimumReleaseAge), 0)
|
|
48
|
+
: 0;
|
|
49
|
+
if (minimumReleaseAgeMs) {
|
|
47
50
|
const minimumReleaseAgeBehaviour = releaseConfig.minimumReleaseAgeBehaviour;
|
|
48
51
|
// if there is a releaseTimestamp, regardless of `minimumReleaseAgeBehaviour`, we should process it
|
|
49
52
|
if (candidateRelease.releaseTimestamp) {
|
|
50
53
|
// we should skip this if we have a timestamp that isn't passing checks:
|
|
51
54
|
if ((0, date_1.getElapsedMs)(candidateRelease.releaseTimestamp) <
|
|
52
|
-
|
|
55
|
+
minimumReleaseAgeMs) {
|
|
53
56
|
// Skip it if it doesn't pass checks
|
|
54
57
|
logger_1.logger.trace({ depName, check: 'minimumReleaseAge' }, `Release ${candidateRelease.version} is pending status checks`);
|
|
55
58
|
pendingReleases.unshift(candidateRelease);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-checks.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/process/lookup/filter-checks.ts"],"names":[],"mappings":";;AAyBA,oDA0KC;AA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AC,CAAC,MAAM,kIAAkI,CAC3M,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,IAAI,eAAe,CAAC,MAAM,EAAE,CAAC;gBAC3B,0DAA0D;gBAC1D,eAAM,CAAC,KAAK,CACV,EAAE,OAAO,EAAE,MAAM,EAAE,EACnB,yCAAyC,CAC1C,CAAC;gBACF,OAAO,GAAG,eAAe,CAAC,GAAG,EAAE,CAAC;gBAChC,0EAA0E;gBAC1E,eAAe,GAAG,EAAE,CAAC;gBACrB,IAAI,oBAAoB,KAAK,QAAQ,EAAE,CAAC;oBACtC,aAAa,GAAG,IAAI,CAAC;gBACvB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AACrD,CAAC","sourcesContent":["import { isNonEmptyString, isNullOrUndefined } from '@sindresorhus/is';\nimport { mergeChildConfig } from '../../../../config';\nimport type { MinimumReleaseAgeBehaviour } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport type { Release } from '../../../../modules/datasource';\nimport { postprocessRelease } from '../../../../modules/datasource/postprocess-release';\nimport type { VersioningApi } from '../../../../modules/versioning';\nimport { getElapsedMs } from '../../../../util/date';\nimport {\n getMergeConfidenceLevel,\n isActiveConfidenceLevel,\n satisfiesConfidenceLevel,\n} from '../../../../util/merge-confidence';\nimport { coerceNumber } from '../../../../util/number';\nimport { applyPackageRules } from '../../../../util/package-rules';\nimport { toMs } from '../../../../util/pretty-time';\nimport type { LookupUpdateConfig, UpdateResult } from './types';\nimport { getUpdateType } from './update-type';\n\nexport interface InternalChecksResult {\n release?: Release;\n pendingChecks: boolean;\n pendingReleases: Release[];\n}\n\nexport async function filterInternalChecks(\n config: Partial<LookupUpdateConfig & UpdateResult>,\n versioningApi: VersioningApi,\n bucket: string,\n sortedReleases: Release[],\n): Promise<InternalChecksResult> {\n const {\n currentVersion,\n datasource,\n depName,\n packageName,\n internalChecksFilter,\n } = config;\n let release: Release | undefined = undefined;\n let pendingChecks = false;\n let pendingReleases: Release[] = [];\n if (internalChecksFilter === 'none') {\n // Don't care if minimumReleaseAge or minimumConfidence are unmet\n release = sortedReleases.pop();\n } else {\n const candidateVersionsWithoutReleaseTimestamp: Record<\n MinimumReleaseAgeBehaviour,\n string[]\n > = {\n 'timestamp-required': [],\n 'timestamp-optional': [],\n };\n\n // iterate through releases from highest to lowest, looking for the first which will pass checks if present\n for (let candidateRelease of sortedReleases.reverse()) {\n // merge the release data into dependency config\n let releaseConfig = mergeChildConfig(config, candidateRelease);\n // calculate updateType and then apply it\n releaseConfig.updateType = getUpdateType(\n releaseConfig,\n versioningApi,\n // TODO #22198\n currentVersion!,\n candidateRelease.version,\n );\n releaseConfig = mergeChildConfig(\n releaseConfig,\n releaseConfig[releaseConfig.updateType]!,\n );\n // Apply packageRules in case any apply to updateType\n releaseConfig = await applyPackageRules(releaseConfig, 'update-type');\n\n const updatedCandidateRelease = await postprocessRelease(\n releaseConfig,\n candidateRelease,\n );\n if (!updatedCandidateRelease) {\n continue;\n }\n candidateRelease = updatedCandidateRelease;\n\n // Now check for a minimumReleaseAge config\n const { minimumConfidence, minimumReleaseAge, updateType } =\n releaseConfig;\n if (isNonEmptyString(minimumReleaseAge)) {\n const minimumReleaseAgeBehaviour =\n releaseConfig.minimumReleaseAgeBehaviour;\n\n // if there is a releaseTimestamp, regardless of `minimumReleaseAgeBehaviour`, we should process it\n if (candidateRelease.releaseTimestamp) {\n // we should skip this if we have a timestamp that isn't passing checks:\n if (\n getElapsedMs(candidateRelease.releaseTimestamp) <\n coerceNumber(toMs(minimumReleaseAge), 0)\n ) {\n // Skip it if it doesn't pass checks\n logger.trace(\n { depName, check: 'minimumReleaseAge' },\n `Release ${candidateRelease.version} is pending status checks`,\n );\n pendingReleases.unshift(candidateRelease);\n continue;\n }\n } // or if there is no timestamp, and we're running in `minimumReleaseAgeBehaviour=timestamp-required`\n else if (\n isNullOrUndefined(candidateRelease.releaseTimestamp) &&\n minimumReleaseAgeBehaviour === 'timestamp-required'\n ) {\n // Skip it, as we require a timestamp\n candidateVersionsWithoutReleaseTimestamp[\n minimumReleaseAgeBehaviour\n ].push(candidateRelease.version);\n pendingReleases.unshift(candidateRelease);\n continue;\n } // if there is no timestamp, and we're running in `optional` mode, we can allow it\n else if (\n isNullOrUndefined(candidateRelease.releaseTimestamp) &&\n minimumReleaseAgeBehaviour === 'timestamp-optional'\n ) {\n candidateVersionsWithoutReleaseTimestamp[\n minimumReleaseAgeBehaviour\n ].push(candidateRelease.version);\n }\n }\n\n // TODO #22198\n if (isActiveConfidenceLevel(minimumConfidence!)) {\n const confidenceLevel =\n (await getMergeConfidenceLevel(\n datasource!,\n packageName!,\n currentVersion!,\n candidateRelease.version,\n updateType!,\n )) ?? 'neutral';\n // TODO #22198\n if (!satisfiesConfidenceLevel(confidenceLevel, minimumConfidence!)) {\n logger.trace(\n { depName, check: 'minimumConfidence' },\n `Release ${candidateRelease.version} is pending status checks`,\n );\n pendingReleases.unshift(candidateRelease);\n continue;\n }\n }\n // If we get to here, then the release is OK and we can stop iterating\n release = candidateRelease;\n break;\n }\n\n if (candidateVersionsWithoutReleaseTimestamp['timestamp-required'].length) {\n logger.debug(\n {\n depName,\n versions:\n candidateVersionsWithoutReleaseTimestamp['timestamp-required'],\n check: 'minimumReleaseAge',\n },\n `Marking ${candidateVersionsWithoutReleaseTimestamp['timestamp-required'].length} release(s) as pending, as they do not have a releaseTimestamp and we're running with minimumReleaseAgeBehaviour=timestamp-required`,\n );\n }\n\n if (candidateVersionsWithoutReleaseTimestamp['timestamp-optional'].length) {\n logger.once.warn(\n \"Some release(s) did not have a releaseTimestamp, but as we're running with minimumReleaseAgeBehaviour=timestamp-optional, proceeding. See debug logs for more information\",\n );\n logger.debug(\n {\n depName,\n versions:\n candidateVersionsWithoutReleaseTimestamp['timestamp-optional'],\n check: 'minimumReleaseAge',\n },\n `${candidateVersionsWithoutReleaseTimestamp['timestamp-optional'].length} release(s) did not have a releaseTimestamp, but as we're running with minimumReleaseAgeBehaviour=timestamp-optional, proceeding`,\n );\n }\n\n if (!release) {\n if (pendingReleases.length) {\n // If all releases were pending then just take the highest\n logger.trace(\n { depName, bucket },\n 'All releases are pending - using latest',\n );\n release = pendingReleases.pop();\n // None are pending anymore because we took the latest, so empty the array\n pendingReleases = [];\n if (internalChecksFilter === 'strict') {\n pendingChecks = true;\n }\n }\n }\n }\n\n return { release, pendingChecks, pendingReleases };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"filter-checks.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/process/lookup/filter-checks.ts"],"names":[],"mappings":";;AAyBA,oDA+KC;AAxMD,yCAAuE;AACvE,+CAAsD;AAEtD,+CAA4C;AAE5C,4FAAwF;AAExF,gDAAqD;AACrD,wEAI2C;AAC3C,oDAAuD;AACvD,kEAAmE;AACnE,8DAAoD;AAEpD,+CAA8C;AAQvC,KAAK,UAAU,oBAAoB,CACxC,MAAkD,EAClD,aAA4B,EAC5B,MAAc,EACd,cAAyB;IAEzB,MAAM,EACJ,cAAc,EACd,UAAU,EACV,OAAO,EACP,WAAW,EACX,oBAAoB,GACrB,GAAG,MAAM,CAAC;IACX,IAAI,OAAO,GAAwB,SAAS,CAAC;IAC7C,IAAI,aAAa,GAAG,KAAK,CAAC;IAC1B,IAAI,eAAe,GAAc,EAAE,CAAC;IACpC,IAAI,oBAAoB,KAAK,MAAM,EAAE,CAAC;QACpC,iEAAiE;QACjE,OAAO,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC;IACjC,CAAC;SAAM,CAAC;QACN,MAAM,wCAAwC,GAG1C;YACF,oBAAoB,EAAE,EAAE;YACxB,oBAAoB,EAAE,EAAE;SACzB,CAAC;QAEF,2GAA2G;QAC3G,KAAK,IAAI,gBAAgB,IAAI,cAAc,CAAC,OAAO,EAAE,EAAE,CAAC;YACtD,gDAAgD;YAChD,IAAI,aAAa,GAAG,IAAA,yBAAgB,EAAC,MAAM,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B,CAAC,CAAC,MAAM,EAAE,CAAC;YAC1E,eAAM,CAAC,KAAK,CACV;gBACE,OAAO;gBACP,QAAQ,EACN,wCAAwC,CAAC,oBAAoB,CAAC;gBAChE,KAAK,EAAE,mBAAmB;aAC3B,EACD,WAAW,wCAAwC,CAAC,oBAAoB,CAAC,CAAC,MAAM,qIAAqI,CACtN,CAAC;QACJ,CAAC;QAED,IAAI,wCAAwC,CAAC,oBAAoB,CAAC,CAAC,MAAM,EAAE,CAAC;YAC1E,eAAM,CAAC,IAAI,CAAC,IAAI,CACd,2KAA2K,CAC5K,CAAC;YACF,eAAM,CAAC,KAAK,CACV;gBACE,OAAO;gBACP,QAAQ,EACN,wCAAwC,CAAC,oBAAoB,CAAC;gBAChE,KAAK,EAAE,mBAAmB;aAC3B,EACD,GAAG,wCAAwC,CAAC,oBAAoB,CAAC,CAAC,MAAM,kIAAkI,CAC3M,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,IAAI,eAAe,CAAC,MAAM,EAAE,CAAC;gBAC3B,0DAA0D;gBAC1D,eAAM,CAAC,KAAK,CACV,EAAE,OAAO,EAAE,MAAM,EAAE,EACnB,yCAAyC,CAC1C,CAAC;gBACF,OAAO,GAAG,eAAe,CAAC,GAAG,EAAE,CAAC;gBAChC,0EAA0E;gBAC1E,eAAe,GAAG,EAAE,CAAC;gBACrB,IAAI,oBAAoB,KAAK,QAAQ,EAAE,CAAC;oBACtC,aAAa,GAAG,IAAI,CAAC;gBACvB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AACrD,CAAC","sourcesContent":["import { isNonEmptyString, isNullOrUndefined } from '@sindresorhus/is';\nimport { mergeChildConfig } from '../../../../config';\nimport type { MinimumReleaseAgeBehaviour } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport type { Release } from '../../../../modules/datasource';\nimport { postprocessRelease } from '../../../../modules/datasource/postprocess-release';\nimport type { VersioningApi } from '../../../../modules/versioning';\nimport { getElapsedMs } from '../../../../util/date';\nimport {\n getMergeConfidenceLevel,\n isActiveConfidenceLevel,\n satisfiesConfidenceLevel,\n} from '../../../../util/merge-confidence';\nimport { coerceNumber } from '../../../../util/number';\nimport { applyPackageRules } from '../../../../util/package-rules';\nimport { toMs } from '../../../../util/pretty-time';\nimport type { LookupUpdateConfig, UpdateResult } from './types';\nimport { getUpdateType } from './update-type';\n\nexport interface InternalChecksResult {\n release?: Release;\n pendingChecks: boolean;\n pendingReleases: Release[];\n}\n\nexport async function filterInternalChecks(\n config: Partial<LookupUpdateConfig & UpdateResult>,\n versioningApi: VersioningApi,\n bucket: string,\n sortedReleases: Release[],\n): Promise<InternalChecksResult> {\n const {\n currentVersion,\n datasource,\n depName,\n packageName,\n internalChecksFilter,\n } = config;\n let release: Release | undefined = undefined;\n let pendingChecks = false;\n let pendingReleases: Release[] = [];\n if (internalChecksFilter === 'none') {\n // Don't care if minimumReleaseAge or minimumConfidence are unmet\n release = sortedReleases.pop();\n } else {\n const candidateVersionsWithoutReleaseTimestamp: Record<\n MinimumReleaseAgeBehaviour,\n string[]\n > = {\n 'timestamp-required': [],\n 'timestamp-optional': [],\n };\n\n // iterate through releases from highest to lowest, looking for the first which will pass checks if present\n for (let candidateRelease of sortedReleases.reverse()) {\n // merge the release data into dependency config\n let releaseConfig = mergeChildConfig(config, candidateRelease);\n // calculate updateType and then apply it\n releaseConfig.updateType = getUpdateType(\n releaseConfig,\n versioningApi,\n // TODO #22198\n currentVersion!,\n candidateRelease.version,\n );\n releaseConfig = mergeChildConfig(\n releaseConfig,\n releaseConfig[releaseConfig.updateType]!,\n );\n // Apply packageRules in case any apply to updateType\n releaseConfig = await applyPackageRules(releaseConfig, 'update-type');\n\n const updatedCandidateRelease = await postprocessRelease(\n releaseConfig,\n candidateRelease,\n );\n if (!updatedCandidateRelease) {\n continue;\n }\n candidateRelease = updatedCandidateRelease;\n\n // Now check for a minimumReleaseAge config\n const { minimumConfidence, minimumReleaseAge, updateType } =\n releaseConfig;\n\n const minimumReleaseAgeMs = isNonEmptyString(minimumReleaseAge)\n ? coerceNumber(toMs(minimumReleaseAge), 0)\n : 0;\n\n if (minimumReleaseAgeMs) {\n const minimumReleaseAgeBehaviour =\n releaseConfig.minimumReleaseAgeBehaviour;\n\n // if there is a releaseTimestamp, regardless of `minimumReleaseAgeBehaviour`, we should process it\n if (candidateRelease.releaseTimestamp) {\n // we should skip this if we have a timestamp that isn't passing checks:\n if (\n getElapsedMs(candidateRelease.releaseTimestamp) <\n minimumReleaseAgeMs\n ) {\n // Skip it if it doesn't pass checks\n logger.trace(\n { depName, check: 'minimumReleaseAge' },\n `Release ${candidateRelease.version} is pending status checks`,\n );\n pendingReleases.unshift(candidateRelease);\n continue;\n }\n } // or if there is no timestamp, and we're running in `minimumReleaseAgeBehaviour=timestamp-required`\n else if (\n isNullOrUndefined(candidateRelease.releaseTimestamp) &&\n minimumReleaseAgeBehaviour === 'timestamp-required'\n ) {\n // Skip it, as we require a timestamp\n candidateVersionsWithoutReleaseTimestamp[\n minimumReleaseAgeBehaviour\n ].push(candidateRelease.version);\n pendingReleases.unshift(candidateRelease);\n continue;\n } // if there is no timestamp, and we're running in `optional` mode, we can allow it\n else if (\n isNullOrUndefined(candidateRelease.releaseTimestamp) &&\n minimumReleaseAgeBehaviour === 'timestamp-optional'\n ) {\n candidateVersionsWithoutReleaseTimestamp[\n minimumReleaseAgeBehaviour\n ].push(candidateRelease.version);\n }\n }\n\n // TODO #22198\n if (isActiveConfidenceLevel(minimumConfidence!)) {\n const confidenceLevel =\n (await getMergeConfidenceLevel(\n datasource!,\n packageName!,\n currentVersion!,\n candidateRelease.version,\n updateType!,\n )) ?? 'neutral';\n // TODO #22198\n if (!satisfiesConfidenceLevel(confidenceLevel, minimumConfidence!)) {\n logger.trace(\n { depName, check: 'minimumConfidence' },\n `Release ${candidateRelease.version} is pending status checks`,\n );\n pendingReleases.unshift(candidateRelease);\n continue;\n }\n }\n // If we get to here, then the release is OK and we can stop iterating\n release = candidateRelease;\n break;\n }\n\n if (candidateVersionsWithoutReleaseTimestamp['timestamp-required'].length) {\n logger.debug(\n {\n depName,\n versions:\n candidateVersionsWithoutReleaseTimestamp['timestamp-required'],\n check: 'minimumReleaseAge',\n },\n `Marking ${candidateVersionsWithoutReleaseTimestamp['timestamp-required'].length} release(s) as pending, as they do not have a releaseTimestamp and we're running with minimumReleaseAgeBehaviour=timestamp-required`,\n );\n }\n\n if (candidateVersionsWithoutReleaseTimestamp['timestamp-optional'].length) {\n logger.once.warn(\n \"Some release(s) did not have a releaseTimestamp, but as we're running with minimumReleaseAgeBehaviour=timestamp-optional, proceeding. See debug logs for more information\",\n );\n logger.debug(\n {\n depName,\n versions:\n candidateVersionsWithoutReleaseTimestamp['timestamp-optional'],\n check: 'minimumReleaseAge',\n },\n `${candidateVersionsWithoutReleaseTimestamp['timestamp-optional'].length} release(s) did not have a releaseTimestamp, but as we're running with minimumReleaseAgeBehaviour=timestamp-optional, proceeding`,\n );\n }\n\n if (!release) {\n if (pendingReleases.length) {\n // If all releases were pending then just take the highest\n logger.trace(\n { depName, bucket },\n 'All releases are pending - using latest',\n );\n release = pendingReleases.pop();\n // None are pending anymore because we took the latest, so empty the array\n pendingReleases = [];\n if (internalChecksFilter === 'strict') {\n pendingChecks = true;\n }\n }\n }\n }\n\n return { release, pendingChecks, pendingReleases };\n}\n"]}
|
|
@@ -288,12 +288,15 @@ async function processBranch(branchConfig, forceRebase = false) {
|
|
|
288
288
|
config.stabilityStatus = 'green';
|
|
289
289
|
// Default to 'success' but set 'pending' if any update is pending
|
|
290
290
|
for (const upgrade of config.upgrades) {
|
|
291
|
-
|
|
291
|
+
const minimumReleaseAgeMs = (0, is_1.isNonEmptyString)(upgrade.minimumReleaseAge)
|
|
292
|
+
? (0, number_1.coerceNumber)((0, pretty_time_1.toMs)(upgrade.minimumReleaseAge), 0)
|
|
293
|
+
: 0;
|
|
294
|
+
if (minimumReleaseAgeMs) {
|
|
292
295
|
const minimumReleaseAgeBehaviour = upgrade.minimumReleaseAgeBehaviour ?? 'timestamp-required';
|
|
293
296
|
// regardless of the value of `minimumReleaseAgeBehaviour`, if there is a timestamp, we will process it according to `minimumReleaseAge`
|
|
294
297
|
if (upgrade.releaseTimestamp) {
|
|
295
298
|
const timeElapsed = (0, date_1.getElapsedMs)(upgrade.releaseTimestamp);
|
|
296
|
-
if (timeElapsed <
|
|
299
|
+
if (timeElapsed < minimumReleaseAgeMs) {
|
|
297
300
|
logger_1.logger.debug({
|
|
298
301
|
depName: upgrade.depName,
|
|
299
302
|
timeElapsed,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/update/branch/index.ts"],"names":[],"mappings":";;AA2HA,sCAu7BC;;AAljCD,yCAAoD;AACpD,iCAAiC;AACjC,sDAAyD;AAMzD,yEAW8C;AAC9C,+CAAwD;AACxD,6EAAiF;AAEjF,2DAAwD;AACxD,kEAG8C;AAC9C,0DAAuD;AACvD,sFAAiF;AACjF,gDAAqD;AACrD,kDAAiD;AACjD,wEAI2C;AAC3C,oDAAuD;AACvD,8DAAoD;AACpD,4EAAsD;AACtD,mDAAkE;AAElE,+CAAkD;AAClD,8BAAuD;AACvD,+CAAiD;AACjD,2CAAqD;AACrD,2CAAiD;AACjD,mDAA+C;AAC/C,qDAAoD;AACpD,qCAA+C;AAC/C,4GAAyE;AACzE,+CAAuD;AACvD,uDAAqE;AACrE,mCAAoD;AACpD,yCAA4C;AAC5C,mDAA8D;AAE9D,KAAK,UAAU,WAAW,CACxB,MAAsB,EACtB,QAAY;IAEZ,MAAM,WAAW,GAAG,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC1D,IAAI,WAAW,EAAE,CAAC;QAChB,eAAM,CAAC,KAAK,CACV,6CAA6C,QAAQ,CAAC,MAAM,EAAE,CAC/D,CAAC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eAAe;YACf,IAAI,EAAE,QAAQ,EAAE,MAAM;YACtB,MAAM,EAAE,YAAY;YACpB,SAAS;SACV,CAAC;IACJ,CAAC;IACD,OAAO;QACL,YAAY;QACZ,eAAe;QACf,IAAI,EAAE,QAAQ,EAAE,MAAM;QACtB,MAAM,EAAE,MAAM;QACd,SAAS;KACV,CAAC;AACJ,CAAC","sourcesContent":["import { isNonEmptyString } from '@sindresorhus/is';\nimport { DateTime } from 'luxon';\nimport { GlobalConfig } from '../../../../config/global';\nimport {\n type MinimumReleaseAgeBehaviour,\n type RenovateConfig,\n type UpdateType,\n} from '../../../../config/types';\nimport {\n CONFIG_VALIDATION,\n MANAGER_LOCKFILE_ERROR,\n PLATFORM_AUTHENTICATION_ERROR,\n PLATFORM_BAD_CREDENTIALS,\n PLATFORM_INTEGRATION_UNAUTHORIZED,\n PLATFORM_RATE_LIMIT_EXCEEDED,\n REPOSITORY_CHANGED,\n SYSTEM_INSUFFICIENT_DISK_SPACE,\n TEMPORARY_ERROR,\n WORKER_FILE_UPDATE_FAILED,\n} from '../../../../constants/error-messages';\nimport { logger, removeMeta } from '../../../../logger';\nimport { getAdditionalFiles } from '../../../../modules/manager/npm/post-update';\nimport type { Pr } from '../../../../modules/platform';\nimport { platform } from '../../../../modules/platform';\nimport {\n ensureComment,\n ensureCommentRemoval,\n} from '../../../../modules/platform/comment';\nimport { scm } from '../../../../modules/platform/scm';\nimport { ExternalHostError } from '../../../../types/errors/external-host-error';\nimport { getElapsedMs } from '../../../../util/date';\nimport { emojify } from '../../../../util/emoji';\nimport {\n getMergeConfidenceLevel,\n isActiveConfidenceLevel,\n satisfiesConfidenceLevel,\n} from '../../../../util/merge-confidence';\nimport { coerceNumber } from '../../../../util/number';\nimport { toMs } from '../../../../util/pretty-time';\nimport * as template from '../../../../util/template';\nimport { getCount, isLimitReached } from '../../../global/limits';\nimport type { BranchConfig, BranchResult, PrBlockedBy } from '../../../types';\nimport { embedChangelogs } from '../../changelog';\nimport { ensurePr, getPlatformPrOptions } from '../pr';\nimport { checkAutoMerge } from '../pr/automerge';\nimport { setArtifactErrorStatus } from './artifacts';\nimport { tryBranchAutomerge } from './automerge';\nimport { bumpVersions } from './bump-versions';\nimport { prAlreadyExisted } from './check-existing';\nimport { commitFilesToBranch } from './commit';\nimport executePostUpgradeCommands from './execute-post-upgrade-commands';\nimport { getUpdatedPackageFiles } from './get-updated';\nimport { handleClosedPr, handleModifiedPr } from './handle-existing';\nimport { shouldReuseExistingBranch } from './reuse';\nimport { isScheduledNow } from './schedule';\nimport { setConfidence, setStability } from './status-checks';\n\nasync function rebaseCheck(\n config: RenovateConfig,\n branchPr: Pr,\n): Promise<boolean> {\n const titleRebase = branchPr.title?.startsWith('rebase!');\n if (titleRebase) {\n logger.debug(\n `Manual rebase requested via PR title for #${branchPr.number}`,\n );\n return true;\n }\n const labelRebase = !!branchPr.labels?.includes(config.rebaseLabel!);\n if (labelRebase) {\n logger.debug(\n `Manual rebase requested via PR labels for #${branchPr.number}`,\n );\n /* v8 ignore start -- needs test */\n if (GlobalConfig.get('dryRun')) {\n logger.info(\n `DRY-RUN: Would delete label ${config.rebaseLabel!} from #${\n branchPr.number\n }`,\n );\n /* v8 ignore stop -- needs test */\n } else {\n await platform.deleteLabel(branchPr.number, config.rebaseLabel!);\n }\n return true;\n }\n const prRebaseChecked = !!branchPr.bodyStruct?.rebaseRequested;\n if (prRebaseChecked) {\n logger.debug(\n `Manual rebase requested via PR checkbox for #${branchPr.number}`,\n );\n return true;\n }\n\n return false;\n}\n\nasync function deleteBranchSilently(branchName: string): Promise<void> {\n try {\n await scm.deleteBranch(branchName);\n /* v8 ignore start -- needs test */\n } catch (err) {\n logger.debug({ branchName, err }, 'Branch auto-remove failed');\n } /* v8 ignore stop -- needs test */\n}\n\nfunction userChangedTargetBranch(pr: Pr): boolean {\n const oldTargetBranch = pr.bodyStruct?.debugData?.targetBranch;\n if (oldTargetBranch && pr.targetBranch) {\n return pr.targetBranch !== oldTargetBranch;\n }\n return false;\n}\n\nexport interface ProcessBranchResult {\n branchExists: boolean;\n updatesVerified?: boolean;\n prBlockedBy?: PrBlockedBy;\n prNo?: number;\n result: BranchResult;\n commitSha?: string | null;\n}\n\nexport async function processBranch(\n branchConfig: BranchConfig,\n forceRebase = false,\n): Promise<ProcessBranchResult> {\n let commitSha: string | null = null;\n let config: BranchConfig = { ...branchConfig };\n logger.trace({ config }, 'processBranch()');\n let branchExists = await scm.branchExists(config.branchName);\n const dependencyDashboardCheck =\n config.dependencyDashboardChecks?.[config.branchName];\n let updatesVerified = false;\n if (!branchExists && config.branchPrefix !== config.branchPrefixOld) {\n const branchName = config.branchName.replace(\n config.branchPrefix!,\n config.branchPrefixOld!,\n );\n branchExists = await scm.branchExists(branchName);\n if (branchExists) {\n config.branchName = branchName;\n logger.debug('Found existing branch with branchPrefixOld');\n }\n }\n\n if (\n !branchExists &&\n branchConfig.minimumGroupSize &&\n branchConfig.minimumGroupSize > branchConfig.upgrades.length &&\n !dependencyDashboardCheck\n ) {\n logger.debug(\n `Skipping branch creation as minimumGroupSize: ${branchConfig.minimumGroupSize} is not met`,\n );\n return {\n branchExists: false,\n result: 'minimum-group-size-not-met',\n };\n }\n\n let branchPr = await platform.getBranchPr(\n config.branchName,\n config.baseBranch,\n );\n logger.debug(`branchExists=${branchExists}`);\n logger.debug(`dependencyDashboardCheck=${dependencyDashboardCheck!}`);\n if (branchPr) {\n config.rebaseRequested = await rebaseCheck(config, branchPr);\n logger.debug(`PR rebase requested=${config.rebaseRequested}`);\n }\n const keepUpdatedLabel = config.keepUpdatedLabel;\n const artifactErrorTopic = emojify(':warning: Artifact update problem');\n const artifactNoticeTopic = emojify(\n ':information_source: Artifact update notice',\n );\n try {\n // Check if branch already existed\n const existingPr =\n !branchPr || config.automerge\n ? await prAlreadyExisted(config)\n : undefined;\n if (existingPr?.state === 'merged') {\n logger.debug(`Matching PR #${existingPr.number} was merged previously`);\n if (config.automerge) {\n logger.debug('Disabling automerge because PR was merged previously');\n config.automerge = false;\n config.automergedPreviously = true;\n }\n } else if (!branchPr && existingPr && !dependencyDashboardCheck) {\n logger.debug(\n { prTitle: config.prTitle },\n 'Closed PR already exists. Skipping branch.',\n );\n await handleClosedPr(config, existingPr);\n return {\n branchExists: false,\n prNo: existingPr.number,\n result: 'already-existed',\n };\n }\n if (\n !branchExists &&\n branchConfig.pendingChecks &&\n !dependencyDashboardCheck\n ) {\n logger.debug(\n `Branch ${config.branchName} creation is disabled because internalChecksFilter was not met`,\n );\n return {\n branchExists: false,\n result: 'pending',\n };\n }\n if (!branchExists) {\n if (config.mode === 'silent' && !dependencyDashboardCheck) {\n logger.debug(\n `Branch ${config.branchName} creation is disabled because mode=silent`,\n );\n return {\n branchExists,\n result: 'needs-approval',\n };\n }\n if (config.dependencyDashboardApproval && !dependencyDashboardCheck) {\n logger.debug(\n `Branch ${config.branchName} creation is disabled because dependencyDashboardApproval=true`,\n );\n return {\n branchExists,\n result: 'needs-approval',\n };\n }\n }\n\n logger.debug(\n `Open PR Count: ${getCount('ConcurrentPRs')}, Existing Branch Count: ${getCount('Branches')}, Hourly PR Count: ${getCount('HourlyPRs')}`,\n );\n\n if (\n !branchExists &&\n isLimitReached('Branches', branchConfig) &&\n !dependencyDashboardCheck &&\n !config.isVulnerabilityAlert\n ) {\n logger.debug('Reached branch limit - skipping branch creation');\n return {\n branchExists,\n result: 'branch-limit-reached',\n };\n }\n if (\n isLimitReached('Commits') &&\n !dependencyDashboardCheck &&\n !config.isVulnerabilityAlert\n ) {\n logger.debug('Reached commits limit - skipping branch');\n return {\n branchExists,\n prNo: branchPr?.number,\n result: 'commit-limit-reached',\n };\n }\n if (branchExists) {\n // check if branch is labelled to stop\n config.stopUpdating = branchPr?.labels?.includes(\n config.stopUpdatingLabel!,\n );\n\n const prRebaseChecked = !!branchPr?.bodyStruct?.rebaseRequested;\n\n if (branchExists && !dependencyDashboardCheck && !prRebaseChecked) {\n if (config.stopUpdating) {\n logger.info(\n 'Branch updating is skipped because stopUpdatingLabel is present in config',\n );\n return {\n branchExists: true,\n prNo: branchPr?.number,\n result: 'no-work',\n };\n }\n\n if (config.pendingChecks) {\n logger.info(\n 'Branch updating is skipped because internalChecksFilter was not met',\n );\n return {\n branchExists: true,\n prNo: branchPr?.number,\n result: 'pending',\n };\n }\n }\n\n logger.debug('Checking if PR has been edited');\n const branchIsModified = await scm.isBranchModified(\n config.branchName,\n config.baseBranch,\n );\n if (branchPr) {\n logger.debug('Found existing branch PR');\n if (branchPr.state !== 'open') {\n logger.debug(\n 'PR has been closed or merged since this run started - aborting',\n );\n throw new Error(REPOSITORY_CHANGED);\n }\n if (branchIsModified || userChangedTargetBranch(branchPr)) {\n logger.debug(`PR has been edited, PrNo:${branchPr.number}`);\n await handleModifiedPr(config, branchPr);\n if (!(!!dependencyDashboardCheck || config.rebaseRequested)) {\n return {\n branchExists,\n prNo: branchPr.number,\n result: 'pr-edited',\n };\n }\n }\n } else if (branchIsModified) {\n const oldPr = await platform.findPr({\n branchName: config.branchName,\n state: '!open',\n targetBranch: config.baseBranch,\n });\n if (!oldPr) {\n logger.debug('Branch has been edited but found no PR - skipping');\n return {\n branchExists,\n result: 'pr-edited',\n };\n }\n const branchSha = await scm.getBranchCommit(config.branchName);\n const oldPrSha = oldPr?.sha;\n if (!oldPrSha || oldPrSha === branchSha) {\n logger.debug(\n { oldPrNumber: oldPr.number, oldPrSha, branchSha },\n 'Found old PR matching this branch - will override it',\n );\n } else {\n logger.debug(\n { oldPrNumber: oldPr.number, oldPrSha, branchSha },\n 'Found old PR but the SHA is different',\n );\n return {\n branchExists,\n result: 'pr-edited',\n };\n }\n }\n }\n\n // Check schedule\n config.isScheduledNow = isScheduledNow(config, 'schedule');\n if (!config.isScheduledNow && !dependencyDashboardCheck) {\n if (!branchExists) {\n logger.debug('Skipping branch creation as not within schedule');\n return {\n branchExists,\n result: 'not-scheduled',\n };\n }\n if (config.updateNotScheduled === false && !config.rebaseRequested) {\n logger.debug('Skipping branch update as not within schedule');\n return {\n branchExists,\n prNo: branchPr?.number,\n result: 'update-not-scheduled',\n };\n }\n if (\n !branchPr &&\n !(config.automerge && config.automergeType === 'branch') // if branch is configured for automerge there's no need for a PR\n ) {\n logger.debug('Skipping PR creation out of schedule');\n return {\n branchExists,\n result: 'not-scheduled',\n };\n }\n logger.debug(\n 'Branch + PR exists but is not scheduled -- will update if necessary',\n );\n }\n //stability checks\n if (\n config.upgrades.some(\n (upgrade) =>\n isNonEmptyString(upgrade.minimumReleaseAge) ||\n isActiveConfidenceLevel(upgrade.minimumConfidence!),\n )\n ) {\n const depNamesWithoutReleaseTimestamp: Record<\n MinimumReleaseAgeBehaviour,\n {\n depName: string;\n updateType: UpdateType;\n }[]\n > = {\n 'timestamp-required': [],\n 'timestamp-optional': [],\n };\n\n // Only set a stability status check if one or more of the updates contain\n // both a minimumReleaseAge setting and a releaseTimestamp\n config.stabilityStatus = 'green';\n // Default to 'success' but set 'pending' if any update is pending\n for (const upgrade of config.upgrades) {\n if (isNonEmptyString(upgrade.minimumReleaseAge)) {\n const minimumReleaseAgeBehaviour: MinimumReleaseAgeBehaviour =\n upgrade.minimumReleaseAgeBehaviour ?? 'timestamp-required';\n\n // regardless of the value of `minimumReleaseAgeBehaviour`, if there is a timestamp, we will process it according to `minimumReleaseAge`\n if (upgrade.releaseTimestamp) {\n const timeElapsed = getElapsedMs(upgrade.releaseTimestamp);\n if (timeElapsed < coerceNumber(toMs(upgrade.minimumReleaseAge))) {\n logger.debug(\n {\n depName: upgrade.depName,\n timeElapsed,\n minimumReleaseAge: upgrade.minimumReleaseAge,\n },\n 'Update has not passed minimum release age',\n );\n config.stabilityStatus = 'yellow';\n continue;\n }\n } else {\n // if we're set to `minimumReleaseAgeBehaviour=timestamp-required`, and there isn't a timestamp, always mark the update as pending\n if (minimumReleaseAgeBehaviour === 'timestamp-required') {\n depNamesWithoutReleaseTimestamp['timestamp-required'].push({\n depName: upgrade.depName!,\n updateType: upgrade.updateType!,\n });\n config.stabilityStatus = 'yellow';\n continue;\n } else {\n // if there is no timestamp, and we're running in `optional` mode, we can allow it, but make sure to warn the user\n depNamesWithoutReleaseTimestamp['timestamp-optional'].push({\n depName: upgrade.depName!,\n updateType: upgrade.updateType!,\n });\n }\n }\n }\n const datasource = upgrade.datasource!;\n const depName = upgrade.depName!;\n const packageName = upgrade.packageName!;\n const minimumConfidence = upgrade.minimumConfidence!;\n const updateType = upgrade.updateType!;\n const currentVersion = upgrade.currentVersion!;\n const newVersion = upgrade.newVersion!;\n if (isActiveConfidenceLevel(minimumConfidence)) {\n const confidence =\n (await getMergeConfidenceLevel(\n datasource,\n packageName,\n currentVersion,\n newVersion,\n updateType,\n )) ?? 'neutral';\n if (satisfiesConfidenceLevel(confidence, minimumConfidence)) {\n config.confidenceStatus = 'green';\n } else {\n logger.debug(\n { depName, confidence, minimumConfidence },\n 'Update does not meet minimum confidence scores',\n );\n config.confidenceStatus = 'yellow';\n continue;\n }\n }\n }\n\n if (depNamesWithoutReleaseTimestamp['timestamp-required'].length) {\n logger.debug(\n { updates: depNamesWithoutReleaseTimestamp['timestamp-required'] },\n `Marking ${depNamesWithoutReleaseTimestamp['timestamp-required'].length} release(s) as pending, as they do not have a releaseTimestamp and we're running with minimumReleaseAgeBehaviour=timestamp-required`,\n );\n }\n if (depNamesWithoutReleaseTimestamp['timestamp-optional'].length) {\n logger.once.warn(\n \"Some upgrade(s) did not have a releaseTimestamp, but as we're running with minimumReleaseAgeBehaviour=timestamp-optional, proceeding. See debug logs for more information\",\n );\n logger.debug(\n { updates: depNamesWithoutReleaseTimestamp['timestamp-optional'] },\n `${depNamesWithoutReleaseTimestamp['timestamp-optional'].length} upgrade(s) did not have a releaseTimestamp, but as we're running with minimumReleaseAgeBehaviour=timestamp-optional, proceeding`,\n );\n }\n\n // Don't create a branch if we know it will be status 'pending'\n if (\n !dependencyDashboardCheck &&\n !branchExists &&\n config.stabilityStatus === 'yellow' &&\n ['not-pending', 'status-success'].includes(config.prCreation!)\n ) {\n logger.debug(\n 'Skipping branch creation due to internal status checks not met',\n );\n return {\n branchExists,\n result: 'pending',\n };\n }\n }\n\n let userRebaseRequested =\n dependencyDashboardCheck === 'rebase' ||\n !!config.dependencyDashboardRebaseAllOpen ||\n !!config.rebaseRequested;\n const userApproveAllPendingPR = !!config.dependencyDashboardAllPending;\n const userOpenAllRateLimtedPR = !!config.dependencyDashboardAllRateLimited;\n if (forceRebase) {\n logger.debug('Force rebase because branch needs updating');\n config.reuseExistingBranch = false;\n } else if (userRebaseRequested) {\n logger.debug('User has requested rebase');\n config.reuseExistingBranch = false;\n } else if (dependencyDashboardCheck === 'global-config') {\n logger.debug(`Manual create/rebase requested via checkedBranches`);\n config.reuseExistingBranch = false;\n userRebaseRequested = true;\n } else if (userApproveAllPendingPR) {\n logger.debug(\n 'A user manually approved all pending PRs via the Dependency Dashboard.',\n );\n } else if (userOpenAllRateLimtedPR) {\n logger.debug(\n 'A user manually approved all rate-limited PRs via the Dependency Dashboard.',\n );\n } else if (\n branchExists &&\n config.rebaseWhen === 'never' &&\n !(keepUpdatedLabel && branchPr?.labels?.includes(keepUpdatedLabel)) &&\n !dependencyDashboardCheck\n ) {\n logger.debug('rebaseWhen=never so skipping branch update check');\n return {\n branchExists,\n prNo: branchPr?.number,\n result: 'no-work',\n };\n }\n // if the base branch has been changed by user in renovate config, rebase onto the new baseBranch\n // we have already confirmed earlier that branch isn't modified, so its safe to use targetBranch here\n else if (\n branchPr?.targetBranch &&\n branchPr.targetBranch !== config.baseBranch\n ) {\n logger.debug(\n 'Base branch changed by user, rebasing the branch onto new base',\n );\n config.reuseExistingBranch = false;\n } else if (config.cacheFingerprintMatch === 'no-match') {\n logger.debug(\n 'Cache fingerprint does not match, cannot reuse existing branch',\n );\n config.reuseExistingBranch = false;\n } else {\n config = await shouldReuseExistingBranch(config);\n }\n // TODO: types (#22198)\n logger.debug(`Using reuseExistingBranch: ${config.reuseExistingBranch!}`);\n if (\n !(\n config.reuseExistingBranch && config.cacheFingerprintMatch === 'matched'\n )\n ) {\n await scm.checkoutBranch(config.baseBranch);\n const res = await getUpdatedPackageFiles(config);\n if (res.artifactErrors && config.artifactErrors) {\n res.artifactErrors = config.artifactErrors.concat(res.artifactErrors);\n }\n config = { ...config, ...res };\n if (config.updatedPackageFiles?.length) {\n logger.debug(\n `Updated ${config.updatedPackageFiles.length} package files`,\n );\n if (config.reuseExistingBranch && !forceRebase) {\n logger.debug(\n 'Existing branch needs updating. Restarting processBranch() with a clean branch',\n );\n return processBranch(branchConfig, true);\n }\n } else {\n logger.debug('No package files need updating');\n }\n const additionalFiles = await getAdditionalFiles(\n config,\n branchConfig.packageFiles!,\n );\n config.artifactErrors = (config.artifactErrors ?? []).concat(\n additionalFiles.artifactErrors,\n );\n config.updatedArtifacts = (config.updatedArtifacts ?? []).concat(\n additionalFiles.updatedArtifacts,\n );\n if (config.updatedArtifacts?.length) {\n logger.debug(\n {\n updatedArtifacts: config.updatedArtifacts.map((f) =>\n f.type === 'deletion' ? `${f.path} (delete)` : f.path,\n ),\n },\n `Updated ${config.updatedArtifacts.length} lock files`,\n );\n if (config.reuseExistingBranch && !forceRebase) {\n logger.debug(\n 'Existing branch needs updating. Restarting processBranch() with a clean branch',\n );\n return processBranch(branchConfig, true);\n }\n } else {\n logger.debug('No updated lock files in branch');\n }\n if (config.fetchChangeLogs === 'branch') {\n await embedChangelogs(config.upgrades);\n }\n\n const postUpgradeCommandResults =\n await executePostUpgradeCommands(config);\n\n if (postUpgradeCommandResults !== null) {\n const { updatedArtifacts, artifactErrors } = postUpgradeCommandResults;\n config.updatedArtifacts = updatedArtifacts;\n config.artifactErrors = artifactErrors;\n }\n\n // modifies the file changes in place to allow having a version bump in a packageFile or artifact\n await bumpVersions(config);\n\n removeMeta(['dep']);\n\n if (config.artifactErrors?.length) {\n if (config.releaseTimestamp) {\n logger.debug(`Branch timestamp: ` + config.releaseTimestamp);\n const releaseTimestamp = DateTime.fromISO(config.releaseTimestamp);\n if (releaseTimestamp.plus({ hours: 2 }) < DateTime.local()) {\n logger.debug(\n 'PR is older than 2 hours, raise PR with lock file errors',\n );\n } else if (branchExists) {\n logger.debug(\n 'PR is less than 2 hours old but branchExists so updating anyway',\n );\n } else {\n logger.debug(\n 'PR is less than 2 hours old - raise error instead of PR',\n );\n throw new Error(MANAGER_LOCKFILE_ERROR);\n }\n } else {\n logger.debug('PR has no releaseTimestamp');\n }\n } else if (config.updatedArtifacts?.length && branchPr) {\n // If there are artifacts, no errors, and an existing PR then ensure any artifacts error comment is removed\n if (GlobalConfig.get('dryRun')) {\n logger.info(\n `DRY-RUN: Would ensure comment removal in PR #${branchPr.number}`,\n );\n } else {\n // Remove artifacts error comment only if this run has successfully updated artifacts\n await ensureCommentRemoval({\n type: 'by-topic',\n number: branchPr.number,\n topic: artifactErrorTopic,\n });\n\n if (!config.artifactNotices?.length) {\n await ensureCommentRemoval({\n type: 'by-topic',\n number: branchPr.number,\n topic: artifactNoticeTopic,\n });\n }\n }\n }\n const forcedManually = userRebaseRequested || !branchExists;\n\n config.isConflicted ??=\n branchExists &&\n (await scm.isBranchConflicted(config.baseBranch, config.branchName));\n config.forceCommit = forcedManually || config.isConflicted;\n\n // compile commit message with body, which maybe needs changelogs\n if (config.commitBody) {\n // changelog is on first upgrade\n config.commitMessage = `${config.commitMessage!}\\n\\n${template.compile(\n config.commitBody,\n {\n ...config,\n logJSON: config.upgrades[0].logJSON,\n releases: config.upgrades[0].releases,\n },\n )}`;\n\n logger.trace(`commitMessage: ` + JSON.stringify(config.commitMessage));\n }\n\n commitSha = await commitFilesToBranch(config);\n // Checkout to base branch to ensure that the next branch processing always starts with git being on the baseBranch\n // baseBranch is not checked out at the start of processBranch() due to pull/16246\n await scm.checkoutBranch(config.baseBranch);\n updatesVerified = true;\n }\n\n if (branchPr) {\n const platformPrOptions = getPlatformPrOptions(config);\n if (\n platformPrOptions.usePlatformAutomerge &&\n platform.reattemptPlatformAutomerge\n ) {\n if (GlobalConfig.get('dryRun')) {\n logger.info(\n `DRY-RUN: Would reattempt platform automerge for PR #${branchPr.number}`,\n );\n } else {\n await platform.reattemptPlatformAutomerge({\n number: branchPr.number,\n platformPrOptions,\n });\n }\n }\n if (platform.refreshPr) {\n await platform.refreshPr(branchPr.number);\n }\n }\n if (!commitSha && !branchExists) {\n return {\n branchExists,\n result: 'no-work',\n };\n }\n if (commitSha) {\n const action = branchExists ? 'updated' : 'created';\n logger.info({ commitSha }, `Branch ${action}`);\n }\n // Set branch statuses\n await setArtifactErrorStatus(config);\n await setStability(config);\n await setConfidence(config);\n\n // new commit means status check are pretty sure pending but maybe not reported yet\n // if PR has not been created + new commit + prCreation !== immediate skip\n // but do not break when there are artifact errors\n if (\n !branchPr &&\n !config.artifactErrors?.length &&\n !userRebaseRequested &&\n commitSha &&\n config.prCreation !== 'immediate'\n ) {\n logger.debug(`Branch status pending, current sha: ${commitSha}`);\n return {\n branchExists: true,\n updatesVerified,\n result: 'pending',\n commitSha,\n };\n }\n\n // Try to automerge branch and finish if successful, but only if branch already existed before this run\n // skip if we have a non-immediate pr and there is an existing PR,\n // we want to update the PR and skip the Auto merge since status checks aren't done yet\n if (!config.artifactErrors?.length && (!commitSha || config.ignoreTests)) {\n const mergeStatus = await tryBranchAutomerge(config);\n logger.debug(`mergeStatus=${mergeStatus}`);\n if (mergeStatus === 'automerged') {\n if (GlobalConfig.get('dryRun')) {\n logger.info('DRY-RUN: Would delete branch' + config.branchName);\n } else {\n await deleteBranchSilently(config.branchName);\n }\n logger.debug('Branch is automerged - returning');\n return { branchExists: false, result: 'automerged' };\n }\n if (mergeStatus === 'off schedule') {\n if (userRebaseRequested) {\n config.forcePr = true;\n } else {\n logger.debug(\n 'Branch cannot automerge now because automergeSchedule is off schedule - skipping',\n );\n return {\n branchExists,\n result: 'not-scheduled',\n commitSha,\n };\n }\n }\n if (\n mergeStatus === 'stale' &&\n ['conflicted', 'never'].includes(config.rebaseWhen!) &&\n /* v8 ignore next -- needs test */\n !(keepUpdatedLabel && branchPr?.labels?.includes(keepUpdatedLabel))\n ) {\n logger.warn(\n 'Branch cannot automerge because it is behind base branch and rebaseWhen setting disallows rebasing - raising a PR instead',\n );\n config.forcePr = true;\n config.branchAutomergeFailureMessage = mergeStatus;\n }\n if (\n mergeStatus === 'automerge aborted - PR exists' ||\n mergeStatus === 'branch status error' ||\n mergeStatus === 'failed'\n ) {\n logger.debug(\n `Branch automerge not possible, mergeStatus:${mergeStatus}`,\n );\n config.forcePr = true;\n config.branchAutomergeFailureMessage = mergeStatus;\n }\n }\n /* v8 ignore start -- needs test */\n } catch (err) {\n if (err.statusCode === 404) {\n logger.debug({ err }, 'Received a 404 error - aborting run');\n throw new Error(REPOSITORY_CHANGED);\n }\n if (err.message === PLATFORM_RATE_LIMIT_EXCEEDED) {\n logger.debug('Passing rate-limit-exceeded error up');\n throw err;\n }\n if (err.message === REPOSITORY_CHANGED) {\n logger.debug('Passing repository-changed error up');\n throw err;\n }\n if (err.message?.startsWith('remote: Invalid username or password')) {\n logger.debug('Throwing bad credentials');\n throw new Error(PLATFORM_BAD_CREDENTIALS);\n }\n if (\n err.message?.startsWith(\n 'ssh_exchange_identification: Connection closed by remote host',\n )\n ) {\n logger.debug('Throwing bad credentials');\n throw new Error(PLATFORM_BAD_CREDENTIALS);\n }\n if (err.message === PLATFORM_BAD_CREDENTIALS) {\n logger.debug('Passing bad-credentials error up');\n throw err;\n }\n if (err.message === PLATFORM_INTEGRATION_UNAUTHORIZED) {\n logger.debug('Passing integration-unauthorized error up');\n throw err;\n }\n if (err.message === MANAGER_LOCKFILE_ERROR) {\n logger.debug('Passing lockfile-error up');\n throw err;\n }\n if (err.message?.includes('space left on device')) {\n throw new Error(SYSTEM_INSUFFICIENT_DISK_SPACE);\n }\n if (err.message === SYSTEM_INSUFFICIENT_DISK_SPACE) {\n logger.debug('Passing disk-space error up');\n throw err;\n }\n if (err.message.startsWith('Resource not accessible by integration')) {\n logger.debug('Passing 403 error up');\n throw err;\n }\n if (err.message === WORKER_FILE_UPDATE_FAILED) {\n logger.warn('Error updating branch: update failure');\n } else if (err.message.startsWith('bundler-')) {\n // we have already warned inside the bundler artifacts error handling, so just return\n return {\n branchExists: true,\n updatesVerified,\n prNo: branchPr?.number,\n result: 'error',\n commitSha,\n };\n } else if (\n err.messagee &&\n err.message.includes('fatal: Authentication failed')\n ) {\n throw new Error(PLATFORM_AUTHENTICATION_ERROR);\n } else if (err.message?.includes('fatal: bad revision')) {\n logger.debug({ err }, 'Aborting job due to bad revision error');\n throw new Error(REPOSITORY_CHANGED);\n } else if (err.message === CONFIG_VALIDATION) {\n logger.debug('Passing config validation error up');\n throw err;\n } else if (err.message === TEMPORARY_ERROR) {\n logger.debug('Passing TEMPORARY_ERROR error up');\n throw err;\n } else if (!(err instanceof ExternalHostError)) {\n logger.warn({ err }, `Error updating branch`);\n }\n // Don't throw here - we don't want to stop the other renovations\n return {\n branchExists,\n prNo: branchPr?.number,\n result: 'error',\n commitSha,\n };\n } /* v8 ignore stop -- needs test */\n try {\n logger.debug('Ensuring PR');\n logger.debug(\n `There are ${config.errors!.length} errors and ${\n config.warnings!.length\n } warnings`,\n );\n const ensurePrResult = await ensurePr(config);\n if (ensurePrResult.type === 'without-pr') {\n const { prBlockedBy } = ensurePrResult;\n branchPr = null;\n if (prBlockedBy === 'RateLimited' && !config.isVulnerabilityAlert) {\n logger.debug('Reached PR limit - skipping PR creation');\n return {\n branchExists,\n prBlockedBy,\n result: 'pr-limit-reached',\n commitSha,\n };\n }\n // TODO: ensurePr should check for automerge itself (#9719)\n if (prBlockedBy === 'NeedsApproval') {\n return {\n branchExists,\n prBlockedBy,\n result: 'needs-pr-approval',\n commitSha,\n };\n }\n if (prBlockedBy === 'AwaitingTests') {\n return {\n branchExists,\n prBlockedBy,\n result: 'pending',\n commitSha,\n };\n }\n if (prBlockedBy === 'BranchAutomerge') {\n return {\n branchExists,\n prBlockedBy,\n result: 'done',\n commitSha,\n };\n }\n if (prBlockedBy === 'Error') {\n return {\n branchExists,\n prBlockedBy,\n result: 'error',\n commitSha,\n };\n }\n logger.warn({ prBlockedBy }, 'Unknown PrBlockedBy result');\n return {\n branchExists,\n prBlockedBy,\n result: 'error',\n commitSha,\n };\n }\n if (ensurePrResult.type === 'with-pr') {\n const { pr } = ensurePrResult;\n branchPr = pr;\n if (config.artifactErrors?.length) {\n logger.warn(\n { artifactErrors: config.artifactErrors },\n 'artifactErrors',\n );\n let content = `Renovate failed to update `;\n content +=\n config.artifactErrors.length > 1 ? 'artifacts' : 'an artifact';\n content += ' related to this branch. ';\n content += template.compile(\n config.userStrings!.artifactErrorWarning,\n config,\n );\n content += emojify(\n `\\n\\n:recycle: Renovate will retry this branch, including artifacts, only when one of the following happens:\\n\\n`,\n );\n content +=\n ' - any of the package files in this branch needs updating, or \\n';\n content += ' - the branch becomes conflicted, or\\n';\n content +=\n ' - you click the rebase/retry checkbox if found above, or\\n';\n content +=\n ' - you rename this PR\\'s title to start with \"rebase!\" to trigger it manually';\n content += '\\n\\nThe artifact failure details are included below:\\n\\n';\n // TODO: types (#22198)\n config.artifactErrors.forEach((error) => {\n content += `##### File name: ${error.lockFile!}\\n\\n`;\n content += `\\`\\`\\`\\n${error.stderr!}\\n\\`\\`\\`\\n\\n`;\n });\n content = platform.massageMarkdown(content, config.rebaseLabel);\n if (\n !(\n config.suppressNotifications!.includes('artifactErrors') ||\n config.suppressNotifications!.includes('lockFileErrors')\n )\n ) {\n if (GlobalConfig.get('dryRun')) {\n logger.info(\n `DRY-RUN: Would ensure lock file error comment in PR #${pr.number}`,\n );\n } else {\n await ensureComment({\n number: pr.number,\n topic: artifactErrorTopic,\n content,\n });\n }\n }\n } else {\n if (config.artifactNotices?.length) {\n const contentLines: string[] = [];\n for (const notice of config.artifactNotices) {\n contentLines.push(`##### File name: ${notice.file}`);\n contentLines.push(notice.message);\n }\n const content = contentLines.join('\\n\\n');\n await ensureComment({\n number: pr.number,\n topic: artifactNoticeTopic,\n content,\n });\n }\n\n if (config.automerge) {\n logger.debug('PR is configured for automerge');\n // skip automerge if there is a new commit since status checks aren't done yet\n if (config.ignoreTests === true || !commitSha) {\n logger.debug('checking auto-merge');\n const prAutomergeResult = await checkAutoMerge(pr, config);\n if (prAutomergeResult?.automerged) {\n return {\n branchExists,\n result: 'automerged',\n commitSha,\n };\n }\n }\n } else {\n logger.debug('PR is not configured for automerge');\n }\n }\n }\n /* v8 ignore start -- needs test */\n } catch (err) {\n if (\n err instanceof ExternalHostError ||\n [PLATFORM_RATE_LIMIT_EXCEEDED, REPOSITORY_CHANGED].includes(err.message)\n ) {\n logger.debug('Passing PR error up');\n throw err;\n }\n // Otherwise don't throw here - we don't want to stop the other renovations\n logger.error({ err }, `Error ensuring PR`);\n } /* v8 ignore stop -- needs test */\n if (!branchExists) {\n return {\n branchExists: true,\n updatesVerified,\n prNo: branchPr?.number,\n result: 'pr-created',\n commitSha,\n };\n }\n return {\n branchExists,\n updatesVerified,\n prNo: branchPr?.number,\n result: 'done',\n commitSha,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/update/branch/index.ts"],"names":[],"mappings":";;AA2HA,sCA27BC;;AAtjCD,yCAAoD;AACpD,iCAAiC;AACjC,sDAAyD;AAMzD,yEAW8C;AAC9C,+CAAwD;AACxD,6EAAiF;AAEjF,2DAAwD;AACxD,kEAG8C;AAC9C,0DAAuD;AACvD,sFAAiF;AACjF,gDAAqD;AACrD,kDAAiD;AACjD,wEAI2C;AAC3C,oDAAuD;AACvD,8DAAoD;AACpD,4EAAsD;AACtD,mDAAkE;AAElE,+CAAkD;AAClD,8BAAuD;AACvD,+CAAiD;AACjD,2CAAqD;AACrD,2CAAiD;AACjD,mDAA+C;AAC/C,qDAAoD;AACpD,qCAA+C;AAC/C,4GAAyE;AACzE,+CAAuD;AACvD,uDAAqE;AACrE,mCAAoD;AACpD,yCAA4C;AAC5C,mDAA8D;AAE9D,KAAK,UAAU,WAAW,CACxB,MAAsB,EACtB,QAAY;IAEZ,MAAM,WAAW,GAAG,QAAQ,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AAK,CAAC,qBAAqB,CAAC,CAAC;YACpC,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,2EAA2E;QAC3E,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,mBAAmB,CAAC,CAAC;IAC7C,CAAC,CAAC,kCAAkC;IACpC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO;YACL,YAAY,EAAE,IAAI;YAClB,eAAe;YACf,IAAI,EAAE,QAAQ,EAAE,MAAM;YACtB,MAAM,EAAE,YAAY;YACpB,SAAS;SACV,CAAC;IACJ,CAAC;IACD,OAAO;QACL,YAAY;QACZ,eAAe;QACf,IAAI,EAAE,QAAQ,EAAE,MAAM;QACtB,MAAM,EAAE,MAAM;QACd,SAAS;KACV,CAAC;AACJ,CAAC","sourcesContent":["import { isNonEmptyString } from '@sindresorhus/is';\nimport { DateTime } from 'luxon';\nimport { GlobalConfig } from '../../../../config/global';\nimport {\n type MinimumReleaseAgeBehaviour,\n type RenovateConfig,\n type UpdateType,\n} from '../../../../config/types';\nimport {\n CONFIG_VALIDATION,\n MANAGER_LOCKFILE_ERROR,\n PLATFORM_AUTHENTICATION_ERROR,\n PLATFORM_BAD_CREDENTIALS,\n PLATFORM_INTEGRATION_UNAUTHORIZED,\n PLATFORM_RATE_LIMIT_EXCEEDED,\n REPOSITORY_CHANGED,\n SYSTEM_INSUFFICIENT_DISK_SPACE,\n TEMPORARY_ERROR,\n WORKER_FILE_UPDATE_FAILED,\n} from '../../../../constants/error-messages';\nimport { logger, removeMeta } from '../../../../logger';\nimport { getAdditionalFiles } from '../../../../modules/manager/npm/post-update';\nimport type { Pr } from '../../../../modules/platform';\nimport { platform } from '../../../../modules/platform';\nimport {\n ensureComment,\n ensureCommentRemoval,\n} from '../../../../modules/platform/comment';\nimport { scm } from '../../../../modules/platform/scm';\nimport { ExternalHostError } from '../../../../types/errors/external-host-error';\nimport { getElapsedMs } from '../../../../util/date';\nimport { emojify } from '../../../../util/emoji';\nimport {\n getMergeConfidenceLevel,\n isActiveConfidenceLevel,\n satisfiesConfidenceLevel,\n} from '../../../../util/merge-confidence';\nimport { coerceNumber } from '../../../../util/number';\nimport { toMs } from '../../../../util/pretty-time';\nimport * as template from '../../../../util/template';\nimport { getCount, isLimitReached } from '../../../global/limits';\nimport type { BranchConfig, BranchResult, PrBlockedBy } from '../../../types';\nimport { embedChangelogs } from '../../changelog';\nimport { ensurePr, getPlatformPrOptions } from '../pr';\nimport { checkAutoMerge } from '../pr/automerge';\nimport { setArtifactErrorStatus } from './artifacts';\nimport { tryBranchAutomerge } from './automerge';\nimport { bumpVersions } from './bump-versions';\nimport { prAlreadyExisted } from './check-existing';\nimport { commitFilesToBranch } from './commit';\nimport executePostUpgradeCommands from './execute-post-upgrade-commands';\nimport { getUpdatedPackageFiles } from './get-updated';\nimport { handleClosedPr, handleModifiedPr } from './handle-existing';\nimport { shouldReuseExistingBranch } from './reuse';\nimport { isScheduledNow } from './schedule';\nimport { setConfidence, setStability } from './status-checks';\n\nasync function rebaseCheck(\n config: RenovateConfig,\n branchPr: Pr,\n): Promise<boolean> {\n const titleRebase = branchPr.title?.startsWith('rebase!');\n if (titleRebase) {\n logger.debug(\n `Manual rebase requested via PR title for #${branchPr.number}`,\n );\n return true;\n }\n const labelRebase = !!branchPr.labels?.includes(config.rebaseLabel!);\n if (labelRebase) {\n logger.debug(\n `Manual rebase requested via PR labels for #${branchPr.number}`,\n );\n /* v8 ignore start -- needs test */\n if (GlobalConfig.get('dryRun')) {\n logger.info(\n `DRY-RUN: Would delete label ${config.rebaseLabel!} from #${\n branchPr.number\n }`,\n );\n /* v8 ignore stop -- needs test */\n } else {\n await platform.deleteLabel(branchPr.number, config.rebaseLabel!);\n }\n return true;\n }\n const prRebaseChecked = !!branchPr.bodyStruct?.rebaseRequested;\n if (prRebaseChecked) {\n logger.debug(\n `Manual rebase requested via PR checkbox for #${branchPr.number}`,\n );\n return true;\n }\n\n return false;\n}\n\nasync function deleteBranchSilently(branchName: string): Promise<void> {\n try {\n await scm.deleteBranch(branchName);\n /* v8 ignore start -- needs test */\n } catch (err) {\n logger.debug({ branchName, err }, 'Branch auto-remove failed');\n } /* v8 ignore stop -- needs test */\n}\n\nfunction userChangedTargetBranch(pr: Pr): boolean {\n const oldTargetBranch = pr.bodyStruct?.debugData?.targetBranch;\n if (oldTargetBranch && pr.targetBranch) {\n return pr.targetBranch !== oldTargetBranch;\n }\n return false;\n}\n\nexport interface ProcessBranchResult {\n branchExists: boolean;\n updatesVerified?: boolean;\n prBlockedBy?: PrBlockedBy;\n prNo?: number;\n result: BranchResult;\n commitSha?: string | null;\n}\n\nexport async function processBranch(\n branchConfig: BranchConfig,\n forceRebase = false,\n): Promise<ProcessBranchResult> {\n let commitSha: string | null = null;\n let config: BranchConfig = { ...branchConfig };\n logger.trace({ config }, 'processBranch()');\n let branchExists = await scm.branchExists(config.branchName);\n const dependencyDashboardCheck =\n config.dependencyDashboardChecks?.[config.branchName];\n let updatesVerified = false;\n if (!branchExists && config.branchPrefix !== config.branchPrefixOld) {\n const branchName = config.branchName.replace(\n config.branchPrefix!,\n config.branchPrefixOld!,\n );\n branchExists = await scm.branchExists(branchName);\n if (branchExists) {\n config.branchName = branchName;\n logger.debug('Found existing branch with branchPrefixOld');\n }\n }\n\n if (\n !branchExists &&\n branchConfig.minimumGroupSize &&\n branchConfig.minimumGroupSize > branchConfig.upgrades.length &&\n !dependencyDashboardCheck\n ) {\n logger.debug(\n `Skipping branch creation as minimumGroupSize: ${branchConfig.minimumGroupSize} is not met`,\n );\n return {\n branchExists: false,\n result: 'minimum-group-size-not-met',\n };\n }\n\n let branchPr = await platform.getBranchPr(\n config.branchName,\n config.baseBranch,\n );\n logger.debug(`branchExists=${branchExists}`);\n logger.debug(`dependencyDashboardCheck=${dependencyDashboardCheck!}`);\n if (branchPr) {\n config.rebaseRequested = await rebaseCheck(config, branchPr);\n logger.debug(`PR rebase requested=${config.rebaseRequested}`);\n }\n const keepUpdatedLabel = config.keepUpdatedLabel;\n const artifactErrorTopic = emojify(':warning: Artifact update problem');\n const artifactNoticeTopic = emojify(\n ':information_source: Artifact update notice',\n );\n try {\n // Check if branch already existed\n const existingPr =\n !branchPr || config.automerge\n ? await prAlreadyExisted(config)\n : undefined;\n if (existingPr?.state === 'merged') {\n logger.debug(`Matching PR #${existingPr.number} was merged previously`);\n if (config.automerge) {\n logger.debug('Disabling automerge because PR was merged previously');\n config.automerge = false;\n config.automergedPreviously = true;\n }\n } else if (!branchPr && existingPr && !dependencyDashboardCheck) {\n logger.debug(\n { prTitle: config.prTitle },\n 'Closed PR already exists. Skipping branch.',\n );\n await handleClosedPr(config, existingPr);\n return {\n branchExists: false,\n prNo: existingPr.number,\n result: 'already-existed',\n };\n }\n if (\n !branchExists &&\n branchConfig.pendingChecks &&\n !dependencyDashboardCheck\n ) {\n logger.debug(\n `Branch ${config.branchName} creation is disabled because internalChecksFilter was not met`,\n );\n return {\n branchExists: false,\n result: 'pending',\n };\n }\n if (!branchExists) {\n if (config.mode === 'silent' && !dependencyDashboardCheck) {\n logger.debug(\n `Branch ${config.branchName} creation is disabled because mode=silent`,\n );\n return {\n branchExists,\n result: 'needs-approval',\n };\n }\n if (config.dependencyDashboardApproval && !dependencyDashboardCheck) {\n logger.debug(\n `Branch ${config.branchName} creation is disabled because dependencyDashboardApproval=true`,\n );\n return {\n branchExists,\n result: 'needs-approval',\n };\n }\n }\n\n logger.debug(\n `Open PR Count: ${getCount('ConcurrentPRs')}, Existing Branch Count: ${getCount('Branches')}, Hourly PR Count: ${getCount('HourlyPRs')}`,\n );\n\n if (\n !branchExists &&\n isLimitReached('Branches', branchConfig) &&\n !dependencyDashboardCheck &&\n !config.isVulnerabilityAlert\n ) {\n logger.debug('Reached branch limit - skipping branch creation');\n return {\n branchExists,\n result: 'branch-limit-reached',\n };\n }\n if (\n isLimitReached('Commits') &&\n !dependencyDashboardCheck &&\n !config.isVulnerabilityAlert\n ) {\n logger.debug('Reached commits limit - skipping branch');\n return {\n branchExists,\n prNo: branchPr?.number,\n result: 'commit-limit-reached',\n };\n }\n if (branchExists) {\n // check if branch is labelled to stop\n config.stopUpdating = branchPr?.labels?.includes(\n config.stopUpdatingLabel!,\n );\n\n const prRebaseChecked = !!branchPr?.bodyStruct?.rebaseRequested;\n\n if (branchExists && !dependencyDashboardCheck && !prRebaseChecked) {\n if (config.stopUpdating) {\n logger.info(\n 'Branch updating is skipped because stopUpdatingLabel is present in config',\n );\n return {\n branchExists: true,\n prNo: branchPr?.number,\n result: 'no-work',\n };\n }\n\n if (config.pendingChecks) {\n logger.info(\n 'Branch updating is skipped because internalChecksFilter was not met',\n );\n return {\n branchExists: true,\n prNo: branchPr?.number,\n result: 'pending',\n };\n }\n }\n\n logger.debug('Checking if PR has been edited');\n const branchIsModified = await scm.isBranchModified(\n config.branchName,\n config.baseBranch,\n );\n if (branchPr) {\n logger.debug('Found existing branch PR');\n if (branchPr.state !== 'open') {\n logger.debug(\n 'PR has been closed or merged since this run started - aborting',\n );\n throw new Error(REPOSITORY_CHANGED);\n }\n if (branchIsModified || userChangedTargetBranch(branchPr)) {\n logger.debug(`PR has been edited, PrNo:${branchPr.number}`);\n await handleModifiedPr(config, branchPr);\n if (!(!!dependencyDashboardCheck || config.rebaseRequested)) {\n return {\n branchExists,\n prNo: branchPr.number,\n result: 'pr-edited',\n };\n }\n }\n } else if (branchIsModified) {\n const oldPr = await platform.findPr({\n branchName: config.branchName,\n state: '!open',\n targetBranch: config.baseBranch,\n });\n if (!oldPr) {\n logger.debug('Branch has been edited but found no PR - skipping');\n return {\n branchExists,\n result: 'pr-edited',\n };\n }\n const branchSha = await scm.getBranchCommit(config.branchName);\n const oldPrSha = oldPr?.sha;\n if (!oldPrSha || oldPrSha === branchSha) {\n logger.debug(\n { oldPrNumber: oldPr.number, oldPrSha, branchSha },\n 'Found old PR matching this branch - will override it',\n );\n } else {\n logger.debug(\n { oldPrNumber: oldPr.number, oldPrSha, branchSha },\n 'Found old PR but the SHA is different',\n );\n return {\n branchExists,\n result: 'pr-edited',\n };\n }\n }\n }\n\n // Check schedule\n config.isScheduledNow = isScheduledNow(config, 'schedule');\n if (!config.isScheduledNow && !dependencyDashboardCheck) {\n if (!branchExists) {\n logger.debug('Skipping branch creation as not within schedule');\n return {\n branchExists,\n result: 'not-scheduled',\n };\n }\n if (config.updateNotScheduled === false && !config.rebaseRequested) {\n logger.debug('Skipping branch update as not within schedule');\n return {\n branchExists,\n prNo: branchPr?.number,\n result: 'update-not-scheduled',\n };\n }\n if (\n !branchPr &&\n !(config.automerge && config.automergeType === 'branch') // if branch is configured for automerge there's no need for a PR\n ) {\n logger.debug('Skipping PR creation out of schedule');\n return {\n branchExists,\n result: 'not-scheduled',\n };\n }\n logger.debug(\n 'Branch + PR exists but is not scheduled -- will update if necessary',\n );\n }\n //stability checks\n if (\n config.upgrades.some(\n (upgrade) =>\n isNonEmptyString(upgrade.minimumReleaseAge) ||\n isActiveConfidenceLevel(upgrade.minimumConfidence!),\n )\n ) {\n const depNamesWithoutReleaseTimestamp: Record<\n MinimumReleaseAgeBehaviour,\n {\n depName: string;\n updateType: UpdateType;\n }[]\n > = {\n 'timestamp-required': [],\n 'timestamp-optional': [],\n };\n\n // Only set a stability status check if one or more of the updates contain\n // both a minimumReleaseAge setting and a releaseTimestamp\n config.stabilityStatus = 'green';\n // Default to 'success' but set 'pending' if any update is pending\n for (const upgrade of config.upgrades) {\n const minimumReleaseAgeMs = isNonEmptyString(upgrade.minimumReleaseAge)\n ? coerceNumber(toMs(upgrade.minimumReleaseAge), 0)\n : 0;\n\n if (minimumReleaseAgeMs) {\n const minimumReleaseAgeBehaviour: MinimumReleaseAgeBehaviour =\n upgrade.minimumReleaseAgeBehaviour ?? 'timestamp-required';\n\n // regardless of the value of `minimumReleaseAgeBehaviour`, if there is a timestamp, we will process it according to `minimumReleaseAge`\n if (upgrade.releaseTimestamp) {\n const timeElapsed = getElapsedMs(upgrade.releaseTimestamp);\n if (timeElapsed < minimumReleaseAgeMs) {\n logger.debug(\n {\n depName: upgrade.depName,\n timeElapsed,\n minimumReleaseAge: upgrade.minimumReleaseAge,\n },\n 'Update has not passed minimum release age',\n );\n config.stabilityStatus = 'yellow';\n continue;\n }\n } else {\n // if we're set to `minimumReleaseAgeBehaviour=timestamp-required`, and there isn't a timestamp, always mark the update as pending\n if (minimumReleaseAgeBehaviour === 'timestamp-required') {\n depNamesWithoutReleaseTimestamp['timestamp-required'].push({\n depName: upgrade.depName!,\n updateType: upgrade.updateType!,\n });\n config.stabilityStatus = 'yellow';\n continue;\n } else {\n // if there is no timestamp, and we're running in `optional` mode, we can allow it, but make sure to warn the user\n depNamesWithoutReleaseTimestamp['timestamp-optional'].push({\n depName: upgrade.depName!,\n updateType: upgrade.updateType!,\n });\n }\n }\n }\n const datasource = upgrade.datasource!;\n const depName = upgrade.depName!;\n const packageName = upgrade.packageName!;\n const minimumConfidence = upgrade.minimumConfidence!;\n const updateType = upgrade.updateType!;\n const currentVersion = upgrade.currentVersion!;\n const newVersion = upgrade.newVersion!;\n if (isActiveConfidenceLevel(minimumConfidence)) {\n const confidence =\n (await getMergeConfidenceLevel(\n datasource,\n packageName,\n currentVersion,\n newVersion,\n updateType,\n )) ?? 'neutral';\n if (satisfiesConfidenceLevel(confidence, minimumConfidence)) {\n config.confidenceStatus = 'green';\n } else {\n logger.debug(\n { depName, confidence, minimumConfidence },\n 'Update does not meet minimum confidence scores',\n );\n config.confidenceStatus = 'yellow';\n continue;\n }\n }\n }\n\n if (depNamesWithoutReleaseTimestamp['timestamp-required'].length) {\n logger.debug(\n { updates: depNamesWithoutReleaseTimestamp['timestamp-required'] },\n `Marking ${depNamesWithoutReleaseTimestamp['timestamp-required'].length} release(s) as pending, as they do not have a releaseTimestamp and we're running with minimumReleaseAgeBehaviour=timestamp-required`,\n );\n }\n if (depNamesWithoutReleaseTimestamp['timestamp-optional'].length) {\n logger.once.warn(\n \"Some upgrade(s) did not have a releaseTimestamp, but as we're running with minimumReleaseAgeBehaviour=timestamp-optional, proceeding. See debug logs for more information\",\n );\n logger.debug(\n { updates: depNamesWithoutReleaseTimestamp['timestamp-optional'] },\n `${depNamesWithoutReleaseTimestamp['timestamp-optional'].length} upgrade(s) did not have a releaseTimestamp, but as we're running with minimumReleaseAgeBehaviour=timestamp-optional, proceeding`,\n );\n }\n\n // Don't create a branch if we know it will be status 'pending'\n if (\n !dependencyDashboardCheck &&\n !branchExists &&\n config.stabilityStatus === 'yellow' &&\n ['not-pending', 'status-success'].includes(config.prCreation!)\n ) {\n logger.debug(\n 'Skipping branch creation due to internal status checks not met',\n );\n return {\n branchExists,\n result: 'pending',\n };\n }\n }\n\n let userRebaseRequested =\n dependencyDashboardCheck === 'rebase' ||\n !!config.dependencyDashboardRebaseAllOpen ||\n !!config.rebaseRequested;\n const userApproveAllPendingPR = !!config.dependencyDashboardAllPending;\n const userOpenAllRateLimtedPR = !!config.dependencyDashboardAllRateLimited;\n if (forceRebase) {\n logger.debug('Force rebase because branch needs updating');\n config.reuseExistingBranch = false;\n } else if (userRebaseRequested) {\n logger.debug('User has requested rebase');\n config.reuseExistingBranch = false;\n } else if (dependencyDashboardCheck === 'global-config') {\n logger.debug(`Manual create/rebase requested via checkedBranches`);\n config.reuseExistingBranch = false;\n userRebaseRequested = true;\n } else if (userApproveAllPendingPR) {\n logger.debug(\n 'A user manually approved all pending PRs via the Dependency Dashboard.',\n );\n } else if (userOpenAllRateLimtedPR) {\n logger.debug(\n 'A user manually approved all rate-limited PRs via the Dependency Dashboard.',\n );\n } else if (\n branchExists &&\n config.rebaseWhen === 'never' &&\n !(keepUpdatedLabel && branchPr?.labels?.includes(keepUpdatedLabel)) &&\n !dependencyDashboardCheck\n ) {\n logger.debug('rebaseWhen=never so skipping branch update check');\n return {\n branchExists,\n prNo: branchPr?.number,\n result: 'no-work',\n };\n }\n // if the base branch has been changed by user in renovate config, rebase onto the new baseBranch\n // we have already confirmed earlier that branch isn't modified, so its safe to use targetBranch here\n else if (\n branchPr?.targetBranch &&\n branchPr.targetBranch !== config.baseBranch\n ) {\n logger.debug(\n 'Base branch changed by user, rebasing the branch onto new base',\n );\n config.reuseExistingBranch = false;\n } else if (config.cacheFingerprintMatch === 'no-match') {\n logger.debug(\n 'Cache fingerprint does not match, cannot reuse existing branch',\n );\n config.reuseExistingBranch = false;\n } else {\n config = await shouldReuseExistingBranch(config);\n }\n // TODO: types (#22198)\n logger.debug(`Using reuseExistingBranch: ${config.reuseExistingBranch!}`);\n if (\n !(\n config.reuseExistingBranch && config.cacheFingerprintMatch === 'matched'\n )\n ) {\n await scm.checkoutBranch(config.baseBranch);\n const res = await getUpdatedPackageFiles(config);\n if (res.artifactErrors && config.artifactErrors) {\n res.artifactErrors = config.artifactErrors.concat(res.artifactErrors);\n }\n config = { ...config, ...res };\n if (config.updatedPackageFiles?.length) {\n logger.debug(\n `Updated ${config.updatedPackageFiles.length} package files`,\n );\n if (config.reuseExistingBranch && !forceRebase) {\n logger.debug(\n 'Existing branch needs updating. Restarting processBranch() with a clean branch',\n );\n return processBranch(branchConfig, true);\n }\n } else {\n logger.debug('No package files need updating');\n }\n const additionalFiles = await getAdditionalFiles(\n config,\n branchConfig.packageFiles!,\n );\n config.artifactErrors = (config.artifactErrors ?? []).concat(\n additionalFiles.artifactErrors,\n );\n config.updatedArtifacts = (config.updatedArtifacts ?? []).concat(\n additionalFiles.updatedArtifacts,\n );\n if (config.updatedArtifacts?.length) {\n logger.debug(\n {\n updatedArtifacts: config.updatedArtifacts.map((f) =>\n f.type === 'deletion' ? `${f.path} (delete)` : f.path,\n ),\n },\n `Updated ${config.updatedArtifacts.length} lock files`,\n );\n if (config.reuseExistingBranch && !forceRebase) {\n logger.debug(\n 'Existing branch needs updating. Restarting processBranch() with a clean branch',\n );\n return processBranch(branchConfig, true);\n }\n } else {\n logger.debug('No updated lock files in branch');\n }\n if (config.fetchChangeLogs === 'branch') {\n await embedChangelogs(config.upgrades);\n }\n\n const postUpgradeCommandResults =\n await executePostUpgradeCommands(config);\n\n if (postUpgradeCommandResults !== null) {\n const { updatedArtifacts, artifactErrors } = postUpgradeCommandResults;\n config.updatedArtifacts = updatedArtifacts;\n config.artifactErrors = artifactErrors;\n }\n\n // modifies the file changes in place to allow having a version bump in a packageFile or artifact\n await bumpVersions(config);\n\n removeMeta(['dep']);\n\n if (config.artifactErrors?.length) {\n if (config.releaseTimestamp) {\n logger.debug(`Branch timestamp: ` + config.releaseTimestamp);\n const releaseTimestamp = DateTime.fromISO(config.releaseTimestamp);\n if (releaseTimestamp.plus({ hours: 2 }) < DateTime.local()) {\n logger.debug(\n 'PR is older than 2 hours, raise PR with lock file errors',\n );\n } else if (branchExists) {\n logger.debug(\n 'PR is less than 2 hours old but branchExists so updating anyway',\n );\n } else {\n logger.debug(\n 'PR is less than 2 hours old - raise error instead of PR',\n );\n throw new Error(MANAGER_LOCKFILE_ERROR);\n }\n } else {\n logger.debug('PR has no releaseTimestamp');\n }\n } else if (config.updatedArtifacts?.length && branchPr) {\n // If there are artifacts, no errors, and an existing PR then ensure any artifacts error comment is removed\n if (GlobalConfig.get('dryRun')) {\n logger.info(\n `DRY-RUN: Would ensure comment removal in PR #${branchPr.number}`,\n );\n } else {\n // Remove artifacts error comment only if this run has successfully updated artifacts\n await ensureCommentRemoval({\n type: 'by-topic',\n number: branchPr.number,\n topic: artifactErrorTopic,\n });\n\n if (!config.artifactNotices?.length) {\n await ensureCommentRemoval({\n type: 'by-topic',\n number: branchPr.number,\n topic: artifactNoticeTopic,\n });\n }\n }\n }\n const forcedManually = userRebaseRequested || !branchExists;\n\n config.isConflicted ??=\n branchExists &&\n (await scm.isBranchConflicted(config.baseBranch, config.branchName));\n config.forceCommit = forcedManually || config.isConflicted;\n\n // compile commit message with body, which maybe needs changelogs\n if (config.commitBody) {\n // changelog is on first upgrade\n config.commitMessage = `${config.commitMessage!}\\n\\n${template.compile(\n config.commitBody,\n {\n ...config,\n logJSON: config.upgrades[0].logJSON,\n releases: config.upgrades[0].releases,\n },\n )}`;\n\n logger.trace(`commitMessage: ` + JSON.stringify(config.commitMessage));\n }\n\n commitSha = await commitFilesToBranch(config);\n // Checkout to base branch to ensure that the next branch processing always starts with git being on the baseBranch\n // baseBranch is not checked out at the start of processBranch() due to pull/16246\n await scm.checkoutBranch(config.baseBranch);\n updatesVerified = true;\n }\n\n if (branchPr) {\n const platformPrOptions = getPlatformPrOptions(config);\n if (\n platformPrOptions.usePlatformAutomerge &&\n platform.reattemptPlatformAutomerge\n ) {\n if (GlobalConfig.get('dryRun')) {\n logger.info(\n `DRY-RUN: Would reattempt platform automerge for PR #${branchPr.number}`,\n );\n } else {\n await platform.reattemptPlatformAutomerge({\n number: branchPr.number,\n platformPrOptions,\n });\n }\n }\n if (platform.refreshPr) {\n await platform.refreshPr(branchPr.number);\n }\n }\n if (!commitSha && !branchExists) {\n return {\n branchExists,\n result: 'no-work',\n };\n }\n if (commitSha) {\n const action = branchExists ? 'updated' : 'created';\n logger.info({ commitSha }, `Branch ${action}`);\n }\n // Set branch statuses\n await setArtifactErrorStatus(config);\n await setStability(config);\n await setConfidence(config);\n\n // new commit means status check are pretty sure pending but maybe not reported yet\n // if PR has not been created + new commit + prCreation !== immediate skip\n // but do not break when there are artifact errors\n if (\n !branchPr &&\n !config.artifactErrors?.length &&\n !userRebaseRequested &&\n commitSha &&\n config.prCreation !== 'immediate'\n ) {\n logger.debug(`Branch status pending, current sha: ${commitSha}`);\n return {\n branchExists: true,\n updatesVerified,\n result: 'pending',\n commitSha,\n };\n }\n\n // Try to automerge branch and finish if successful, but only if branch already existed before this run\n // skip if we have a non-immediate pr and there is an existing PR,\n // we want to update the PR and skip the Auto merge since status checks aren't done yet\n if (!config.artifactErrors?.length && (!commitSha || config.ignoreTests)) {\n const mergeStatus = await tryBranchAutomerge(config);\n logger.debug(`mergeStatus=${mergeStatus}`);\n if (mergeStatus === 'automerged') {\n if (GlobalConfig.get('dryRun')) {\n logger.info('DRY-RUN: Would delete branch' + config.branchName);\n } else {\n await deleteBranchSilently(config.branchName);\n }\n logger.debug('Branch is automerged - returning');\n return { branchExists: false, result: 'automerged' };\n }\n if (mergeStatus === 'off schedule') {\n if (userRebaseRequested) {\n config.forcePr = true;\n } else {\n logger.debug(\n 'Branch cannot automerge now because automergeSchedule is off schedule - skipping',\n );\n return {\n branchExists,\n result: 'not-scheduled',\n commitSha,\n };\n }\n }\n if (\n mergeStatus === 'stale' &&\n ['conflicted', 'never'].includes(config.rebaseWhen!) &&\n /* v8 ignore next -- needs test */\n !(keepUpdatedLabel && branchPr?.labels?.includes(keepUpdatedLabel))\n ) {\n logger.warn(\n 'Branch cannot automerge because it is behind base branch and rebaseWhen setting disallows rebasing - raising a PR instead',\n );\n config.forcePr = true;\n config.branchAutomergeFailureMessage = mergeStatus;\n }\n if (\n mergeStatus === 'automerge aborted - PR exists' ||\n mergeStatus === 'branch status error' ||\n mergeStatus === 'failed'\n ) {\n logger.debug(\n `Branch automerge not possible, mergeStatus:${mergeStatus}`,\n );\n config.forcePr = true;\n config.branchAutomergeFailureMessage = mergeStatus;\n }\n }\n /* v8 ignore start -- needs test */\n } catch (err) {\n if (err.statusCode === 404) {\n logger.debug({ err }, 'Received a 404 error - aborting run');\n throw new Error(REPOSITORY_CHANGED);\n }\n if (err.message === PLATFORM_RATE_LIMIT_EXCEEDED) {\n logger.debug('Passing rate-limit-exceeded error up');\n throw err;\n }\n if (err.message === REPOSITORY_CHANGED) {\n logger.debug('Passing repository-changed error up');\n throw err;\n }\n if (err.message?.startsWith('remote: Invalid username or password')) {\n logger.debug('Throwing bad credentials');\n throw new Error(PLATFORM_BAD_CREDENTIALS);\n }\n if (\n err.message?.startsWith(\n 'ssh_exchange_identification: Connection closed by remote host',\n )\n ) {\n logger.debug('Throwing bad credentials');\n throw new Error(PLATFORM_BAD_CREDENTIALS);\n }\n if (err.message === PLATFORM_BAD_CREDENTIALS) {\n logger.debug('Passing bad-credentials error up');\n throw err;\n }\n if (err.message === PLATFORM_INTEGRATION_UNAUTHORIZED) {\n logger.debug('Passing integration-unauthorized error up');\n throw err;\n }\n if (err.message === MANAGER_LOCKFILE_ERROR) {\n logger.debug('Passing lockfile-error up');\n throw err;\n }\n if (err.message?.includes('space left on device')) {\n throw new Error(SYSTEM_INSUFFICIENT_DISK_SPACE);\n }\n if (err.message === SYSTEM_INSUFFICIENT_DISK_SPACE) {\n logger.debug('Passing disk-space error up');\n throw err;\n }\n if (err.message.startsWith('Resource not accessible by integration')) {\n logger.debug('Passing 403 error up');\n throw err;\n }\n if (err.message === WORKER_FILE_UPDATE_FAILED) {\n logger.warn('Error updating branch: update failure');\n } else if (err.message.startsWith('bundler-')) {\n // we have already warned inside the bundler artifacts error handling, so just return\n return {\n branchExists: true,\n updatesVerified,\n prNo: branchPr?.number,\n result: 'error',\n commitSha,\n };\n } else if (\n err.messagee &&\n err.message.includes('fatal: Authentication failed')\n ) {\n throw new Error(PLATFORM_AUTHENTICATION_ERROR);\n } else if (err.message?.includes('fatal: bad revision')) {\n logger.debug({ err }, 'Aborting job due to bad revision error');\n throw new Error(REPOSITORY_CHANGED);\n } else if (err.message === CONFIG_VALIDATION) {\n logger.debug('Passing config validation error up');\n throw err;\n } else if (err.message === TEMPORARY_ERROR) {\n logger.debug('Passing TEMPORARY_ERROR error up');\n throw err;\n } else if (!(err instanceof ExternalHostError)) {\n logger.warn({ err }, `Error updating branch`);\n }\n // Don't throw here - we don't want to stop the other renovations\n return {\n branchExists,\n prNo: branchPr?.number,\n result: 'error',\n commitSha,\n };\n } /* v8 ignore stop -- needs test */\n try {\n logger.debug('Ensuring PR');\n logger.debug(\n `There are ${config.errors!.length} errors and ${\n config.warnings!.length\n } warnings`,\n );\n const ensurePrResult = await ensurePr(config);\n if (ensurePrResult.type === 'without-pr') {\n const { prBlockedBy } = ensurePrResult;\n branchPr = null;\n if (prBlockedBy === 'RateLimited' && !config.isVulnerabilityAlert) {\n logger.debug('Reached PR limit - skipping PR creation');\n return {\n branchExists,\n prBlockedBy,\n result: 'pr-limit-reached',\n commitSha,\n };\n }\n // TODO: ensurePr should check for automerge itself (#9719)\n if (prBlockedBy === 'NeedsApproval') {\n return {\n branchExists,\n prBlockedBy,\n result: 'needs-pr-approval',\n commitSha,\n };\n }\n if (prBlockedBy === 'AwaitingTests') {\n return {\n branchExists,\n prBlockedBy,\n result: 'pending',\n commitSha,\n };\n }\n if (prBlockedBy === 'BranchAutomerge') {\n return {\n branchExists,\n prBlockedBy,\n result: 'done',\n commitSha,\n };\n }\n if (prBlockedBy === 'Error') {\n return {\n branchExists,\n prBlockedBy,\n result: 'error',\n commitSha,\n };\n }\n logger.warn({ prBlockedBy }, 'Unknown PrBlockedBy result');\n return {\n branchExists,\n prBlockedBy,\n result: 'error',\n commitSha,\n };\n }\n if (ensurePrResult.type === 'with-pr') {\n const { pr } = ensurePrResult;\n branchPr = pr;\n if (config.artifactErrors?.length) {\n logger.warn(\n { artifactErrors: config.artifactErrors },\n 'artifactErrors',\n );\n let content = `Renovate failed to update `;\n content +=\n config.artifactErrors.length > 1 ? 'artifacts' : 'an artifact';\n content += ' related to this branch. ';\n content += template.compile(\n config.userStrings!.artifactErrorWarning,\n config,\n );\n content += emojify(\n `\\n\\n:recycle: Renovate will retry this branch, including artifacts, only when one of the following happens:\\n\\n`,\n );\n content +=\n ' - any of the package files in this branch needs updating, or \\n';\n content += ' - the branch becomes conflicted, or\\n';\n content +=\n ' - you click the rebase/retry checkbox if found above, or\\n';\n content +=\n ' - you rename this PR\\'s title to start with \"rebase!\" to trigger it manually';\n content += '\\n\\nThe artifact failure details are included below:\\n\\n';\n // TODO: types (#22198)\n config.artifactErrors.forEach((error) => {\n content += `##### File name: ${error.lockFile!}\\n\\n`;\n content += `\\`\\`\\`\\n${error.stderr!}\\n\\`\\`\\`\\n\\n`;\n });\n content = platform.massageMarkdown(content, config.rebaseLabel);\n if (\n !(\n config.suppressNotifications!.includes('artifactErrors') ||\n config.suppressNotifications!.includes('lockFileErrors')\n )\n ) {\n if (GlobalConfig.get('dryRun')) {\n logger.info(\n `DRY-RUN: Would ensure lock file error comment in PR #${pr.number}`,\n );\n } else {\n await ensureComment({\n number: pr.number,\n topic: artifactErrorTopic,\n content,\n });\n }\n }\n } else {\n if (config.artifactNotices?.length) {\n const contentLines: string[] = [];\n for (const notice of config.artifactNotices) {\n contentLines.push(`##### File name: ${notice.file}`);\n contentLines.push(notice.message);\n }\n const content = contentLines.join('\\n\\n');\n await ensureComment({\n number: pr.number,\n topic: artifactNoticeTopic,\n content,\n });\n }\n\n if (config.automerge) {\n logger.debug('PR is configured for automerge');\n // skip automerge if there is a new commit since status checks aren't done yet\n if (config.ignoreTests === true || !commitSha) {\n logger.debug('checking auto-merge');\n const prAutomergeResult = await checkAutoMerge(pr, config);\n if (prAutomergeResult?.automerged) {\n return {\n branchExists,\n result: 'automerged',\n commitSha,\n };\n }\n }\n } else {\n logger.debug('PR is not configured for automerge');\n }\n }\n }\n /* v8 ignore start -- needs test */\n } catch (err) {\n if (\n err instanceof ExternalHostError ||\n [PLATFORM_RATE_LIMIT_EXCEEDED, REPOSITORY_CHANGED].includes(err.message)\n ) {\n logger.debug('Passing PR error up');\n throw err;\n }\n // Otherwise don't throw here - we don't want to stop the other renovations\n logger.error({ err }, `Error ensuring PR`);\n } /* v8 ignore stop -- needs test */\n if (!branchExists) {\n return {\n branchExists: true,\n updatesVerified,\n prNo: branchPr?.number,\n result: 'pr-created',\n commitSha,\n };\n }\n return {\n branchExists,\n updatesVerified,\n prNo: branchPr?.number,\n result: 'done',\n commitSha,\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.19.
|
|
4
|
+
"version": "42.19.5",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|
|
7
7
|
"renovate": "dist/renovate.js",
|
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
"globals": "16.5.0",
|
|
282
282
|
"graphql": "16.12.0",
|
|
283
283
|
"husky": "9.1.7",
|
|
284
|
-
"jest-extended": "
|
|
284
|
+
"jest-extended": "7.0.0",
|
|
285
285
|
"lint-staged": "16.2.6",
|
|
286
286
|
"markdownlint-cli2": "0.18.1",
|
|
287
287
|
"memfs": "4.51.0",
|
package/renovate-schema.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"title": "JSON schema for Renovate 42.19.
|
|
2
|
+
"title": "JSON schema for Renovate 42.19.5 config files (https://renovatebot.com/)",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"x-renovate-version": "42.19.
|
|
4
|
+
"x-renovate-version": "42.19.5",
|
|
5
5
|
"allowComments": true,
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|