renovate 44.87.1 → 44.89.0
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/data/java-version-lts.js +12 -0
- package/dist/data/java-version-lts.js.map +1 -0
- package/dist/modules/datasource/java-version/schema.js +1 -0
- package/dist/modules/datasource/java-version/schema.js.map +1 -1
- package/dist/modules/manager/fingerprint.generated.js +2 -2
- package/dist/modules/manager/fingerprint.generated.js.map +1 -1
- package/dist/modules/manager/github-actions/known-actions.js +20 -0
- package/dist/modules/manager/github-actions/known-actions.js.map +1 -1
- package/dist/modules/manager/maven-wrapper/extract.js +1 -1
- package/dist/modules/manager/maven-wrapper/extract.js.map +1 -1
- package/dist/modules/manager/mise/artifacts.js +9 -7
- package/dist/modules/manager/mise/artifacts.js.map +1 -1
- package/dist/modules/manager/mise/extract.js +84 -16
- package/dist/modules/manager/mise/extract.js.map +1 -1
- package/dist/modules/manager/mise/lockfile.js +9 -2
- package/dist/modules/manager/mise/lockfile.js.map +1 -1
- package/dist/modules/manager/mise/schema.js.map +1 -1
- package/dist/modules/manager/mise/update-locked.js +55 -3
- package/dist/modules/manager/mise/update-locked.js.map +1 -1
- package/dist/modules/manager/types.d.ts +13 -0
- package/dist/util/toml.js +5 -3
- package/dist/util/toml.js.map +1 -1
- package/dist/workers/repository/process/lookup/generate.js +3 -2
- package/dist/workers/repository/process/lookup/generate.js.map +1 -1
- package/dist/workers/repository/process/lookup/index.js +7 -4
- package/dist/workers/repository/process/lookup/index.js.map +1 -1
- package/dist/workers/repository/update/branch/get-updated.js +41 -0
- package/dist/workers/repository/update/branch/get-updated.js.map +1 -1
- package/package.json +2 -1
- package/renovate-schema.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["allVersioning.get"],"sources":["../../../../../lib/workers/repository/process/lookup/index.ts"],"sourcesContent":["import { isNonEmptyString, isString, isUndefined } from '@sindresorhus/is';\nimport { mergeChildConfig } from '../../../../config/index.ts';\nimport type { ValidationMessage } from '../../../../config/types.ts';\nimport { CONFIG_VALIDATION } from '../../../../constants/error-messages.ts';\nimport { logger } from '../../../../logger/index.ts';\nimport {\n getDatasourceFor,\n getDefaultVersioning,\n} from '../../../../modules/datasource/common.ts';\nimport type {\n GetDigestInputConfig,\n Release,\n ReleaseResult,\n} from '../../../../modules/datasource/index.ts';\nimport {\n applyDatasourceFilters,\n getDigest,\n getRawPkgReleases,\n isGetPkgReleasesConfig,\n supportsDigests,\n} from '../../../../modules/datasource/index.ts';\nimport { postprocessRelease } from '../../../../modules/datasource/postprocess-release.ts';\nimport { getRangeStrategy } from '../../../../modules/manager/index.ts';\nimport type { LookupUpdate } from '../../../../modules/manager/types.ts';\nimport { id as dockerVersioningId } from '../../../../modules/versioning/docker/index.ts';\nimport * as allVersioning from '../../../../modules/versioning/index.ts';\nimport { ExternalHostError } from '../../../../types/errors/external-host-error.ts';\nimport { assignKeys } from '../../../../util/assign-keys.ts';\nimport { getElapsedDays } from '../../../../util/date.ts';\nimport { checkMinimumReleaseAge } from '../../../../util/minimum-release-age.ts';\nimport { applyPackageRules } from '../../../../util/package-rules/index.ts';\nimport { regEx } from '../../../../util/regex.ts';\nimport { Result } from '../../../../util/result.ts';\nimport { safeStringify } from '../../../../util/stringify.ts';\nimport type { Timestamp } from '../../../../util/timestamp.ts';\nimport { calculateAbandonment } from './abandonment.ts';\nimport { getBucket } from './bucket.ts';\nimport { getCurrentVersion } from './current.ts';\nimport { filterVersions } from './filter.ts';\nimport { filterInternalChecks } from './filter-checks.ts';\nimport { generateUpdate } from './generate.ts';\nimport { getRollbackUpdate } from './rollback.ts';\nimport { calculateMostRecentTimestamp } from './timestamps.ts';\nimport type { LookupUpdateConfig, UpdateResult } from './types.ts';\nimport {\n addReplacementUpdateIfValid,\n isReplacementRulesConfigured,\n} from './utils.ts';\n\nasync function getTimestamp(\n config: LookupUpdateConfig,\n versions: Release[],\n version: string,\n versioningApi: allVersioning.VersioningApi,\n): Promise<Timestamp | null | undefined> {\n const currentRelease = versions.find(\n (v) =>\n versioningApi.isValid(v.version) &&\n versioningApi.equals(v.version, version),\n );\n\n if (!currentRelease) {\n return null;\n }\n\n if (currentRelease.releaseTimestamp) {\n return currentRelease.releaseTimestamp;\n }\n\n const remoteRelease = await postprocessRelease(config, currentRelease);\n return remoteRelease?.releaseTimestamp;\n}\n\n/** The only two `updateType`s that `applyMinimumReleaseAgeToDigestUpdate()` can be called with */\ntype DigestLikeUpdate = LookupUpdate & { updateType: 'digest' | 'pinDigest' };\n\n/**\n * A helper function to allow a short-circuit for `minimumReleaseAge` functionality if a package may have config that applies it.\n *\n * Allows avoiding unnecessary calls to more expensive checks like merge + `applyPackageRules()` and `getTimestamp()`.\n */\nfunction couldApplyMinimumReleaseAgeToDigest(\n config: LookupUpdateConfig,\n updateType: DigestLikeUpdate['updateType'],\n): boolean {\n // Match filterInternalChecks(): under `none` the user opted out of internal\n // checks entirely, so do no merging, no package rules, no age check and no\n // logging claiming an age check ran.\n if (config.internalChecksFilter === 'none') {\n return false;\n }\n\n return (\n isNonEmptyString(config.minimumReleaseAge) ||\n isNonEmptyString(config[updateType]?.minimumReleaseAge) ||\n !!config.packageRules?.some((rule) =>\n isNonEmptyString(rule.minimumReleaseAge),\n )\n );\n}\n\n/**\n * Ensure `minimumReleaseAge`/`internalChecksFilter` applies to digest/pinDigest updates, as they don't currently get run through `filterInternalChecks()`.\n *\n * NOTE that this should be kept in sync with `filterInternalChecks`()\n */\nasync function applyMinimumReleaseAgeToDigestUpdate(\n update: DigestLikeUpdate,\n config: LookupUpdateConfig,\n res: UpdateResult,\n currentVersionWasResolved: boolean,\n newestMatchingVersionTimestamp: Timestamp | null | undefined,\n): Promise<void> {\n if (!couldApplyMinimumReleaseAgeToDigest(config, update.updateType)) {\n return;\n }\n\n if (update.updateType === 'pinDigest' && !currentVersionWasResolved) {\n // Not `!res.currentVersion` - that's force-set to lockedVersion further down regardless of timestamp resolution.\n // `pinDigest` doesn't repoint anywhere, unlike `digest` - it just freezes whatever the ref already resolves to.\n // An unversioned tag (e.g. `latest`) has no versioned release to age against, and holding the pin would only\n // prolong the less-pinned (less safe) state, so skip the check entirely rather than treating the missing\n // timestamp as pending.\n logger.once.debug(\n { depName: config.depName, updateType: update.updateType },\n `Skipping minimumReleaseAge check for ${update.updateType} update of ${config.depName}, as its current value does not resolve to a versioned release`,\n );\n return;\n }\n\n let releaseConfig: LookupUpdateConfig = {\n ...mergeChildConfig(config, res),\n updateType: update.updateType,\n };\n releaseConfig = mergeChildConfig(\n releaseConfig,\n releaseConfig[update.updateType]!,\n );\n releaseConfig = await applyPackageRules(releaseConfig, 'update-type');\n\n // Not update.releaseTimestamp - that field means \"age of the new release\" elsewhere (generate.ts, libyear.ts).\n // Not res.currentVersionTimestamp either - that tracks whatever rangeStrategy resolves currentVersion to (e.g.\n // the oldest matching release under `bump`), whereas both `digest` and `pinDigest` reflect whatever the current\n // value's ref actually resolves to *right now*, which is always the newest matching version.\n const ageCheck = checkMinimumReleaseAge(\n releaseConfig,\n newestMatchingVersionTimestamp,\n );\n\n // Mirror filterInternalChecks()'s logging so a held/passed digest update is diagnosable.\n if (ageCheck.minimumReleaseAgeMs && !ageCheck.hasTimestamp) {\n if (releaseConfig.minimumReleaseAgeBehaviour === 'timestamp-optional') {\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 }\n\n logger.once.debug(\n {\n depName: config.depName,\n updateType: update.updateType,\n minimumReleaseAgeBehaviour: releaseConfig.minimumReleaseAgeBehaviour,\n check: 'minimumReleaseAge',\n },\n `${update.updateType} update of ${config.depName} has no releaseTimestamp to age against`,\n );\n }\n if (ageCheck.isPending) {\n logger.trace(\n {\n depName: config.depName,\n updateType: update.updateType,\n releaseTimestamp: newestMatchingVersionTimestamp,\n check: 'minimumReleaseAge',\n },\n `${update.updateType} update is pending minimumReleaseAge status checks`,\n );\n\n // internalChecksFilter is read from the unmerged top-level config, like filterInternalChecks().\n if (config.internalChecksFilter === 'strict') {\n update.pendingChecks = true;\n }\n }\n}\n\nexport async function lookupUpdates(\n inconfig: LookupUpdateConfig,\n): Promise<Result<UpdateResult>> {\n let config: LookupUpdateConfig = { ...inconfig };\n config.versioning ??= getDefaultVersioning(config.datasource);\n\n const versioningApi = allVersioning.get(config.versioning);\n\n let dependency: ReleaseResult | null = null;\n const res: UpdateResult = {\n versioning: config.versioning,\n updates: [],\n warnings: [],\n };\n // Timestamp of the release a `digest`/`pinDigest` update's current value currently resolves to (the newest version matching it, regardless of `rangeStrategy`), as opposed to `res.currentVersionTimestamp` which tracks whatever the configured rangeStrategy resolves `currentVersion` to (e.g. the oldest for `bump`)\n let newestMatchingVersionTimestamp: Timestamp | null | undefined;\n // The `digest` update for `config.currentDigest` (if one is added), so its age check can run after `newDigest` is fetched and no-op updates are stripped.\n let digestUpdate: DigestLikeUpdate | undefined;\n\n try {\n logger.trace(\n {\n dependency: config.packageName,\n currentValue: config.currentValue,\n },\n 'lookupUpdates',\n );\n if (config.currentValue && !isString(config.currentValue)) {\n // If currentValue is not a string, then it's invalid\n logger.debug(\n `Invalid currentValue for ${config.packageName}: ${safeStringify(config.currentValue)} (${typeof config.currentValue})`,\n );\n res.skipReason = 'invalid-value';\n return Result.ok(res);\n }\n if (\n !isGetPkgReleasesConfig(config) ||\n !getDatasourceFor(config.datasource)\n ) {\n res.skipReason = 'invalid-config';\n return Result.ok(res);\n }\n let compareValue = config.currentValue;\n if (\n isString(config.currentValue) &&\n isString(config.versionCompatibility)\n ) {\n const versionCompatbilityRegEx = regEx(config.versionCompatibility);\n const regexMatch = versionCompatbilityRegEx.exec(config.currentValue);\n if (regexMatch?.groups) {\n logger.debug(\n {\n versionCompatibility: config.versionCompatibility,\n currentValue: config.currentValue,\n packageName: config.packageName,\n groups: regexMatch.groups,\n },\n 'version compatibility regex match',\n );\n config.currentCompatibility = regexMatch.groups.compatibility;\n res.currentCompatibility = regexMatch.groups.compatibility;\n compareValue = regexMatch.groups.version;\n } else {\n logger.debug(\n {\n versionCompatibility: config.versionCompatibility,\n currentValue: config.currentValue,\n packageName: config.packageName,\n },\n 'version compatibility regex mismatch',\n );\n }\n }\n\n const isValid =\n isString(compareValue) && versioningApi.isValid(compareValue);\n\n const unconstrainedValue =\n !!config.lockedVersion && isUndefined(config.currentValue);\n\n if (isValid || unconstrainedValue) {\n if (\n !config.updatePinnedDependencies &&\n // TODO #22198\n versioningApi.isSingleVersion(compareValue!)\n ) {\n res.skipReason = 'is-pinned';\n return Result.ok(res);\n }\n\n const { val: releaseResult, err: lookupError } = await getRawPkgReleases(\n config,\n )\n .transform((res) => calculateMostRecentTimestamp(versioningApi, res))\n .transform((res) => calculateAbandonment(res, config))\n .transform((res) => applyDatasourceFilters(res, config))\n .unwrap();\n\n if (lookupError instanceof Error) {\n throw lookupError;\n }\n\n if (lookupError) {\n // If dependency lookup fails then warn and return\n const warning: ValidationMessage = {\n topic: config.packageName,\n message: `Failed to look up ${config.datasource} package ${config.packageName}: ${lookupError}`,\n };\n logger.debug(\n {\n dependency: config.packageName,\n packageFile: config.packageFile,\n },\n warning.message,\n );\n // TODO: return warnings in own field\n res.warnings.push(warning);\n return Result.ok(res);\n }\n\n dependency = releaseResult;\n\n if (dependency.deprecationMessage) {\n logger.debug(\n `Found deprecationMessage for ${config.datasource} package ${config.packageName}`,\n );\n }\n\n assignKeys(res, dependency, [\n 'deprecationMessage',\n 'sourceUrl',\n 'registryUrl',\n 'sourceDirectory',\n 'homepage',\n 'changelogUrl',\n 'dependencyUrl',\n 'lookupName',\n 'packageScope',\n 'mostRecentTimestamp',\n 'isAbandoned',\n 'respectLatest',\n ]);\n\n const latestVersion = dependency.tags?.latest;\n // Filter out any results from datasource that don't comply with our versioning\n let allVersions = dependency.releases.filter((release) =>\n versioningApi.isVersion(release.version),\n );\n const allReleaseVersions = new Set(allVersions.map((r) => r.version));\n // The datasources used in these tests always return at least one\n // version-like release, so neither this block nor the currentDigest\n // check inside it is reached. A lookup whose releases are all\n // unversioned tags does not get here either - with a digest configured\n // it takes the digest-only path above instead - see #40625\n // istanbul ignore if\n if (allVersions.length === 0) {\n const message = `Found no results from datasource that look like a version`;\n logger.info(\n {\n dependency: config.packageName,\n result: dependency,\n },\n message,\n );\n if (!config.currentDigest) {\n return Result.ok(res);\n }\n }\n // Reapply package rules in case we missed something from sourceUrl\n config = await applyPackageRules(\n { ...config, sourceUrl: res.sourceUrl },\n 'source-url',\n );\n if (config.followTag) {\n const taggedVersion = dependency.tags?.[config.followTag];\n if (!taggedVersion) {\n res.warnings.push({\n topic: config.packageName,\n message: `Can't find version with tag ${config.followTag} for ${config.datasource} package ${config.packageName}`,\n });\n return Result.ok(res);\n }\n allVersions = allVersions.filter(\n (v) =>\n v.version === taggedVersion ||\n (v.version === compareValue &&\n versioningApi.isGreaterThan(taggedVersion, compareValue)),\n );\n }\n\n const inRangeOnlyStrategy = config.rangeStrategy === 'in-range-only';\n // Check that existing constraint can be satisfied\n const allSatisfyingVersions =\n (inRangeOnlyStrategy || config.rollbackPrs) && !unconstrainedValue\n ? allVersions.filter((v) =>\n // TODO #22198\n versioningApi.matches(v.version, compareValue!),\n )\n : allVersions;\n if (!allSatisfyingVersions.length) {\n logger.debug(\n `Found no satisfying versions with '${config.versioning}' versioning`,\n );\n }\n\n if (config.rollbackPrs && !allSatisfyingVersions.length) {\n const rollback = getRollbackUpdate(config, allVersions, versioningApi);\n // istanbul ignore if\n if (!rollback) {\n res.warnings.push({\n topic: config.packageName,\n // TODO: types (#22198)\n message: `Can't find version matching ${compareValue!} for ${\n config.datasource\n } package ${config.packageName}`,\n });\n return Result.ok(res);\n }\n res.updates.push(rollback);\n }\n let rangeStrategy = getRangeStrategy(config);\n\n // istanbul ignore next\n if (\n config.isVulnerabilityAlert &&\n rangeStrategy === 'update-lockfile' &&\n !config.lockedVersion\n ) {\n rangeStrategy = 'bump';\n }\n // unconstrained deps with lockedVersion\n if (\n config.isVulnerabilityAlert &&\n !config.currentValue &&\n config.lockedVersion\n ) {\n rangeStrategy = 'update-lockfile';\n }\n const nonDeprecatedVersions = dependency.releases\n .filter((release) => !release.isDeprecated)\n .map((release) => release.version);\n let currentVersion: string;\n if (rangeStrategy === 'update-lockfile') {\n currentVersion = config.lockedVersion!;\n } else if (\n compareValue &&\n versioningApi.isSingleVersion(compareValue) &&\n allVersions.find((v) => v.version === compareValue)\n ) {\n currentVersion = compareValue;\n }\n // TODO #22198\n currentVersion ??=\n getCurrentVersion(\n compareValue!,\n config.lockedVersion!,\n versioningApi,\n rangeStrategy!,\n latestVersion!,\n nonDeprecatedVersions,\n ) ??\n getCurrentVersion(\n compareValue!,\n config.lockedVersion!,\n versioningApi,\n rangeStrategy!,\n latestVersion!,\n allVersions.map((v) => v.version),\n )!;\n\n if (!currentVersion) {\n // v8 ignore else -- TODO: add test #40625\n if (!config.lockedVersion) {\n logger.debug(\n `No currentVersion or lockedVersion found for ${config.packageName}`,\n );\n res.skipReason = 'invalid-value';\n }\n return Result.ok(res);\n }\n\n res.currentVersion = currentVersion;\n\n // Use lockedVersion for the timestamp lookup when available, because\n // res.currentVersion is later overwritten to lockedVersion (see below).\n // Without this, strategies like \"replace\" would compute the timestamp\n // for the highest satisfying version (e.g. 1.4.1) while the reported\n // currentVersion ends up being the locked one (e.g. 1.0.0).\n const versionForTimestamp = config.lockedVersion ?? currentVersion;\n const currentVersionTimestamp = await getTimestamp(\n config,\n allVersions,\n versionForTimestamp,\n versioningApi,\n );\n\n if (isNonEmptyString(currentVersionTimestamp)) {\n res.currentVersionTimestamp = currentVersionTimestamp;\n res.currentVersionAgeInDays = getElapsedDays(currentVersionTimestamp);\n\n if (\n config.packageRules?.some((rule) =>\n isNonEmptyString(rule.matchCurrentAge),\n )\n ) {\n // Reapply package rules to check matches for matchCurrentAge\n config = await applyPackageRules(\n { ...config, currentVersionTimestamp },\n 'current-timestamp',\n );\n }\n }\n\n if (\n config.currentDigest\n ? couldApplyMinimumReleaseAgeToDigest(config, 'digest')\n : config.pinDigests &&\n couldApplyMinimumReleaseAgeToDigest(config, 'pinDigest')\n ) {\n // Resolve from `allVersions` (not `dependency.releases`) so that filters like followTag apply, preferring non-deprecated versions with a fallback - both like the `currentVersion` resolution above.\n const newestMatchingVersion =\n getCurrentVersion(\n compareValue!,\n '',\n versioningApi,\n 'replace',\n latestVersion!,\n allVersions.filter((v) => !v.isDeprecated).map((v) => v.version),\n ) ??\n getCurrentVersion(\n compareValue!,\n '',\n versioningApi,\n 'replace',\n latestVersion!,\n allVersions.map((v) => v.version),\n );\n if (newestMatchingVersion) {\n newestMatchingVersionTimestamp = await getTimestamp(\n config,\n allVersions,\n newestMatchingVersion,\n versioningApi,\n );\n }\n }\n\n if (\n compareValue &&\n currentVersion &&\n rangeStrategy === 'pin' &&\n !versioningApi.isSingleVersion(compareValue)\n ) {\n const newValue =\n versioningApi.getPinnedValue?.(currentVersion) ?? currentVersion;\n res.updates.push({\n updateType: 'pin',\n isPin: true,\n newValue,\n newVersion: currentVersion,\n newMajor: versioningApi.getMajor(currentVersion)!,\n });\n }\n if (rangeStrategy === 'pin') {\n // Fall back to replace once pinning logic is done\n rangeStrategy = 'replace';\n }\n // A non-version can only get this far via a locked version under\n // rangeStrategy=pin, but the timestamp lookup above calls `equals()` on\n // it first and throws - see #40625\n // istanbul ignore if\n if (!versioningApi.isVersion(currentVersion!)) {\n res.skipReason = 'invalid-version';\n return Result.ok(res);\n }\n // Filter latest, unstable, etc\n // TODO #22198\n let filteredReleases = filterVersions(\n config,\n currentVersion!,\n latestVersion!,\n inRangeOnlyStrategy ? allSatisfyingVersions : allVersions,\n versioningApi,\n ).filter(\n (v) =>\n // Leave only compatible versions\n unconstrainedValue ||\n versioningApi.isCompatible(v.version, compareValue),\n );\n let shrinkedViaVulnerability = false;\n if (config.isVulnerabilityAlert) {\n if (config.vulnerabilityFixVersion) {\n res.vulnerabilityFixVersion = config.vulnerabilityFixVersion;\n res.vulnerabilityFixStrategy = config.vulnerabilityFixStrategy;\n if (versioningApi.isValid(config.vulnerabilityFixVersion)) {\n let fixedFilteredReleases;\n if (versioningApi.isVersion(config.vulnerabilityFixVersion)) {\n // Retain only releases greater than or equal to the fix version\n fixedFilteredReleases = filteredReleases.filter(\n (release) =>\n !versioningApi.isGreaterThan(\n config.vulnerabilityFixVersion!,\n release.version,\n ),\n );\n } else {\n // Retain only releases which max the fix constraint\n fixedFilteredReleases = filteredReleases.filter((release) =>\n versioningApi.matches(\n release.version,\n config.vulnerabilityFixVersion!,\n ),\n );\n }\n // Warn if this filtering results caused zero releases\n if (fixedFilteredReleases.length === 0 && filteredReleases.length) {\n logger.warn(\n {\n releases: filteredReleases,\n vulnerabilityFixVersion: config.vulnerabilityFixVersion,\n packageName: config.packageName,\n },\n 'No releases satisfy vulnerabilityFixVersion',\n );\n }\n // Use the additionally filtered releases\n filteredReleases = fixedFilteredReleases;\n } else {\n logger.warn(\n {\n vulnerabilityFixVersion: config.vulnerabilityFixVersion,\n packageName: config.packageName,\n },\n 'vulnerabilityFixVersion is not valid',\n );\n }\n }\n if (config.vulnerabilityFixStrategy === 'highest') {\n // Don't shrink the list of releases - let Renovate use its normal logic\n logger.once.debug(\n `Using vulnerabilityFixStrategy=highest for ${config.packageName}`,\n );\n } else {\n // Shrink the list of releases to the lowest fixed version\n logger.once.debug(\n `Using vulnerabilityFixStrategy=lowest for ${config.packageName}`,\n );\n filteredReleases = filteredReleases.slice(0, 1);\n shrinkedViaVulnerability = true;\n }\n }\n const buckets: Record<string, [Release]> = {};\n for (const release of filteredReleases) {\n const bucket = getBucket(\n config,\n // TODO #22198\n currentVersion!,\n release.version,\n versioningApi,\n );\n // `getBucket()` only returns null when the versioning api cannot\n // determine a major, but every release reaching it has already passed\n // `isVersion()`, so a null major contradicts that and the else looks\n // unreachable rather than merely untested\n // v8 ignore else -- see #40625\n if (isString(bucket)) {\n if (buckets[bucket]) {\n buckets[bucket].push(release);\n } else {\n buckets[bucket] = [release];\n }\n }\n }\n const depResultConfig = mergeChildConfig(config, res);\n for (const [bucket, releases] of Object.entries(buckets)) {\n const sortedReleases = releases.sort((r1, r2) =>\n versioningApi.sortVersions(r1.version, r2.version),\n );\n const { release, pendingChecks, pendingReleases } =\n await filterInternalChecks(\n depResultConfig,\n versioningApi,\n bucket,\n sortedReleases,\n );\n // `filterInternalChecks()` normally yields a release, falling back to\n // the newest pending one; only a datasource rejecting every candidate\n // during postprocessing leaves none - see #40625\n // istanbul ignore next\n if (!release) {\n return Result.ok(res);\n }\n const newVersion = release.version;\n const update = await generateUpdate(\n config,\n compareValue,\n versioningApi,\n // TODO #22198\n\n rangeStrategy!,\n config.lockedVersion ?? currentVersion!,\n bucket,\n release,\n allReleaseVersions,\n );\n\n // #29034\n if (\n config.manager === 'gomod' &&\n compareValue?.startsWith('v0.0.0-') &&\n update.newValue?.startsWith('v0.0.0-') &&\n config.currentDigest !== update.newDigest\n ) {\n update.updateType = 'digest';\n\n // As this has already been processed by `filterInternalChecks()`, but we're changing the `updateType`, we need to apply the digest-scoped minimumReleaseAge rules.\n // `currentVersionWasResolved` only matters for `pinDigest`, which `update.updateType` never is here - true is a safe constant.\n await applyMinimumReleaseAgeToDigestUpdate(\n update as DigestLikeUpdate,\n config,\n res,\n true,\n release.releaseTimestamp,\n );\n }\n\n if (pendingChecks) {\n update.pendingChecks = pendingChecks;\n }\n\n if (pendingReleases.length) {\n update.pendingVersions = pendingReleases.map((r) => r.version);\n }\n if (!update.newValue || update.newValue === compareValue) {\n if (!config.lockedVersion) {\n continue;\n }\n // istanbul ignore if\n if (rangeStrategy === 'bump') {\n logger.trace(\n {\n packageName: config.packageName,\n currentValue: config.currentValue,\n lockedVersion: config.lockedVersion,\n newVersion,\n },\n 'Skipping bump because newValue is the same',\n );\n continue;\n }\n res.isSingleVersion = true;\n }\n res.isSingleVersion ??=\n isString(update.newValue) &&\n versioningApi.isSingleVersion(update.newValue);\n // Guards against a docker downgrade, which the datasources used in\n // these tests never produce - see #40625\n // istanbul ignore if\n if (\n config.versioning === dockerVersioningId &&\n update.updateType !== 'rollback' &&\n update.newValue &&\n versioningApi.isVersion(update.newValue) &&\n compareValue &&\n versioningApi.isVersion(compareValue) &&\n versioningApi.isGreaterThan(compareValue, update.newValue)\n ) {\n logger.warn(\n {\n packageName: config.packageName,\n currentValue: config.currentValue,\n compareValue,\n currentVersion: config.currentVersion,\n update,\n allVersionsLength: allVersions.length,\n filteredReleaseVersions: filteredReleases.map((r) => r.version),\n shrinkedViaVulnerability,\n },\n 'Unexpected downgrade detected: skipping',\n );\n } else {\n res.updates.push(update);\n }\n }\n } else if (compareValue) {\n logger.debug(\n `Dependency ${config.packageName} has unsupported/unversioned value ${compareValue} (versioning=${config.versioning})`,\n );\n\n if (!config.pinDigests && !config.currentDigest) {\n logger.debug(\n `Skipping ${config.packageName} because no currentDigest or pinDigests`,\n );\n res.skipReason = 'invalid-value';\n } else {\n delete res.skipReason;\n }\n } else {\n res.skipReason = 'invalid-value';\n }\n\n if (isReplacementRulesConfigured(config)) {\n addReplacementUpdateIfValid(res.updates, config);\n } else if (dependency?.replacementName && dependency.replacementVersion) {\n res.updates.push({\n updateType: 'replacement',\n newName: dependency.replacementName,\n newValue: dependency.replacementVersion,\n });\n }\n\n // Record if the dep is fixed to a version\n if (config.lockedVersion) {\n res.currentVersion = config.lockedVersion;\n res.fixedVersion = config.lockedVersion;\n } else if (compareValue && versioningApi.isSingleVersion(compareValue)) {\n res.fixedVersion = compareValue.replace(regEx(/^=+/), '');\n }\n\n // massage versionCompatibility\n if (\n isString(config.currentValue) &&\n isString(compareValue) &&\n isString(config.versionCompatibility)\n ) {\n for (const update of res.updates) {\n logger.debug({ update });\n // The enclosing condition already requires a string `currentValue`,\n // so only a null `newValue` takes the else\n // v8 ignore else -- see #40625\n if (isString(config.currentValue) && isString(update.newValue)) {\n update.newValue = config.currentValue.replace(\n compareValue,\n update.newValue,\n );\n }\n }\n }\n\n // Add digests if necessary\n if (supportsDigests(config.datasource)) {\n if (config.currentDigest) {\n if (!config.digestOneAndOnly || !res.updates.length) {\n // digest update - age-checked after the strip below, once newDigest is known\n digestUpdate = {\n updateType: 'digest',\n newValue: config.currentValue,\n };\n res.updates.push(digestUpdate);\n }\n } else if (\n config.pinDigests &&\n // only update the digest in the package file if it's managed by us\n !config.digestManagedExternally &&\n // Create a pin only if one doesn't already exists\n // v8 ignore else -- TODO: add test #40625\n !res.updates.some((update) => update.updateType === 'pin')\n ) {\n // pin digest\n const pinDigestUpdate: DigestLikeUpdate = {\n isPinDigest: true,\n updateType: 'pinDigest',\n newValue: config.currentValue,\n };\n await applyMinimumReleaseAgeToDigestUpdate(\n pinDigestUpdate,\n config,\n res,\n isValid || unconstrainedValue,\n newestMatchingVersionTimestamp,\n );\n res.updates.push(pinDigestUpdate);\n }\n if (versioningApi.valueToVersion) {\n // TODO #22198\n res.currentVersion = versioningApi.valueToVersion(res.currentVersion!);\n for (const update of res.updates) {\n // TODO #22198\n update.newVersion = versioningApi.valueToVersion(update.newVersion!);\n }\n }\n if (res.registryUrl) {\n config.registryUrls = [res.registryUrl];\n }\n\n // update digest for all\n for (const update of res.updates) {\n // only update the digest in the package file if it's managed by us\n if (\n (config.pinDigests === true && !config.digestManagedExternally) ||\n config.currentDigest\n ) {\n const getDigestConfig: GetDigestInputConfig = {\n ...config,\n registryUrl: update.registryUrl ?? res.registryUrl,\n lookupName: res.lookupName,\n };\n\n // #20304 only pass it for replacement updates, otherwise we get wrong or invalid digest\n if (update.updateType !== 'replacement') {\n delete getDigestConfig.replacementName;\n }\n\n // #20304 don't use lookupName and currentDigest when we replace image name\n if (\n update.updateType === 'replacement' &&\n update.newName !== config.packageName\n ) {\n delete getDigestConfig.lookupName;\n delete getDigestConfig.currentDigest;\n getDigestConfig.replacementName = update.newName;\n }\n\n // Don't use current releases if replacement changes name, otherwise we use the wrong new digest.\n // This happens on datasources which return the digest in release info like `github-tags`.\n // We can still use it when only version is changing.\n if (\n update.updateType !== 'replacement' ||\n update.newName === config.packageName\n ) {\n update.newDigest ??= dependency?.releases.find(\n (r) => r.version === update.newValue,\n )?.newDigest;\n }\n\n update.newDigest ??= await getDigest(\n getDigestConfig,\n update.newValue,\n );\n\n // If the digest could not be determined, report this as otherwise the\n // update will be omitted later on without notice.\n if (update.newDigest === null) {\n logger.debug(\n {\n packageName: config.packageName,\n currentValue: config.currentValue,\n datasource: config.datasource,\n newValue: update.newValue,\n bucket: update.bucket,\n },\n 'Could not determine new digest for update.',\n );\n\n // Only report a warning if there is a current digest.\n // Context: https://github.com/renovatebot/renovate/pull/20175#discussion_r1102615059.\n if (config.currentDigest) {\n res.warnings.push({\n message: `Could not determine new digest for update (${config.datasource} package ${config.packageName})`,\n topic: config.packageName,\n });\n }\n }\n } else {\n delete update.newDigest;\n }\n if (update.newVersion) {\n const registryUrl = dependency?.releases?.find(\n (release) => release.version === update.newVersion,\n )?.registryUrl;\n if (registryUrl && registryUrl !== res.registryUrl) {\n update.registryUrl = registryUrl;\n }\n }\n }\n }\n\n if (res.updates.length) {\n delete res.skipReason;\n }\n // Strip out any non-changed ones\n res.updates = res.updates\n .filter(\n (update) => update.newValue !== null || config.currentValue === null,\n )\n .filter((update) => update.newDigest !== null)\n .filter(\n (update) =>\n (isString(update.newName) && update.newName !== config.packageName) ||\n update.isReplacement === true ||\n update.newValue !== config.currentValue ||\n update.isLockfileUpdate === true ||\n // TODO #22198\n (update.newDigest &&\n !update.newDigest.startsWith(config.currentDigest!)),\n );\n // If range strategy specified in config is 'in-range-only', also strip out updates where currentValue !== newValue\n if (config.rangeStrategy === 'in-range-only') {\n res.updates = res.updates.filter(\n (update) => update.newValue === config.currentValue,\n );\n }\n // Handle a weird edge case involving followTag and fallbacks\n if (config.rollbackPrs && config.followTag) {\n res.updates = res.updates.filter(\n (update) =>\n update.updateType !== 'rollback' || res.updates.length === 1,\n );\n }\n\n // If there is a digest update proposed which is in the pending updates for this dependency, ensure that `minimumReleaseAge` is applied.\n // `currentVersionWasResolved` only matters for `pinDigest`, which `digestUpdate` never is - true is a safe constant.\n if (digestUpdate && res.updates.includes(digestUpdate)) {\n await applyMinimumReleaseAgeToDigestUpdate(\n digestUpdate,\n config,\n res,\n true,\n newestMatchingVersionTimestamp,\n );\n }\n\n const release =\n res.updates.length > 0\n ? (dependency?.releases.find(\n (r) => r.version === res.updates[0].newValue,\n ) ??\n dependency?.releases.find(\n (r) => r.version === res.updates[0].newVersion,\n ))\n : null;\n\n if (release?.changelogContent) {\n res.changelogContent = release.changelogContent;\n res.changelogUrl = release.changelogUrl;\n }\n } catch (err) /* istanbul ignore next */ {\n if (err instanceof ExternalHostError) {\n return Result.err(err);\n }\n\n if (err instanceof Error && err.message === CONFIG_VALIDATION) {\n return Result.err(err);\n }\n\n logger.error(\n {\n currentDigest: config.currentDigest,\n currentValue: config.currentValue,\n datasource: config.datasource,\n packageName: config.packageName,\n digestOneAndOnly: config.digestOneAndOnly,\n followTag: config.followTag,\n lockedVersion: config.lockedVersion,\n packageFile: config.packageFile,\n pinDigests: config.pinDigests,\n rollbackPrs: config.rollbackPrs,\n isVulnerabilityAlert: config.isVulnerabilityAlert,\n updatePinnedDependencies: config.updatePinnedDependencies,\n err,\n },\n 'lookupUpdates error',\n );\n res.skipReason = 'internal-error';\n }\n return Result.ok(res);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,eAAe,aACb,QACA,UACA,SACA,eACuC;CACvC,MAAM,iBAAiB,SAAS,MAC7B,MACC,cAAc,QAAQ,EAAE,OAAO,KAC/B,cAAc,OAAO,EAAE,SAAS,OAAO,CAC3C;CAEA,IAAI,CAAC,gBACH,OAAO;CAGT,IAAI,eAAe,kBACjB,OAAO,eAAe;CAIxB,QAAO,MADqB,mBAAmB,QAAQ,cAAc,EAAA,EAC/C;AACxB;;;;;;AAUA,SAAS,oCACP,QACA,YACS;CAIT,IAAI,OAAO,yBAAyB,QAClC,OAAO;CAGT,OACE,iBAAiB,OAAO,iBAAiB,KACzC,iBAAiB,OAAO,WAAW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,OAAO,MACL;GACE,eAAe,OAAO;GACtB,cAAc,OAAO;GACrB,YAAY,OAAO;GACnB,aAAa,OAAO;GACpB,kBAAkB,OAAO;GACzB,WAAW,OAAO;GAClB,eAAe,OAAO;GACtB,aAAa,OAAO;GACpB,YAAY,OAAO;GACnB,aAAa,OAAO;GACpB,sBAAsB,OAAO;GAC7B,0BAA0B,OAAO;GACjC;EACF,GACA,qBACF;EACA,IAAI,aAAa;CACnB;CACA,OAAO,OAAO,GAAG,GAAG;AACtB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["allVersioning.get"],"sources":["../../../../../lib/workers/repository/process/lookup/index.ts"],"sourcesContent":["import { isNonEmptyString, isString, isUndefined } from '@sindresorhus/is';\nimport { mergeChildConfig } from '../../../../config/index.ts';\nimport type { ValidationMessage } from '../../../../config/types.ts';\nimport { CONFIG_VALIDATION } from '../../../../constants/error-messages.ts';\nimport { logger } from '../../../../logger/index.ts';\nimport {\n getDatasourceFor,\n getDefaultVersioning,\n} from '../../../../modules/datasource/common.ts';\nimport type {\n GetDigestInputConfig,\n Release,\n ReleaseResult,\n} from '../../../../modules/datasource/index.ts';\nimport {\n applyDatasourceFilters,\n getDigest,\n getRawPkgReleases,\n isGetPkgReleasesConfig,\n supportsDigests,\n} from '../../../../modules/datasource/index.ts';\nimport { postprocessRelease } from '../../../../modules/datasource/postprocess-release.ts';\nimport { getRangeStrategy } from '../../../../modules/manager/index.ts';\nimport type { LookupUpdate } from '../../../../modules/manager/types.ts';\nimport { id as dockerVersioningId } from '../../../../modules/versioning/docker/index.ts';\nimport * as allVersioning from '../../../../modules/versioning/index.ts';\nimport { ExternalHostError } from '../../../../types/errors/external-host-error.ts';\nimport { assignKeys } from '../../../../util/assign-keys.ts';\nimport { getElapsedDays } from '../../../../util/date.ts';\nimport { checkMinimumReleaseAge } from '../../../../util/minimum-release-age.ts';\nimport { applyPackageRules } from '../../../../util/package-rules/index.ts';\nimport { regEx } from '../../../../util/regex.ts';\nimport { Result } from '../../../../util/result.ts';\nimport { safeStringify } from '../../../../util/stringify.ts';\nimport type { Timestamp } from '../../../../util/timestamp.ts';\nimport { calculateAbandonment } from './abandonment.ts';\nimport { getBucket } from './bucket.ts';\nimport { getCurrentVersion } from './current.ts';\nimport { filterVersions } from './filter.ts';\nimport { filterInternalChecks } from './filter-checks.ts';\nimport { generateUpdate } from './generate.ts';\nimport { getRollbackUpdate } from './rollback.ts';\nimport { calculateMostRecentTimestamp } from './timestamps.ts';\nimport type { LookupUpdateConfig, UpdateResult } from './types.ts';\nimport {\n addReplacementUpdateIfValid,\n isReplacementRulesConfigured,\n} from './utils.ts';\n\nasync function getTimestamp(\n config: LookupUpdateConfig,\n versions: Release[],\n version: string,\n versioningApi: allVersioning.VersioningApi,\n): Promise<Timestamp | null | undefined> {\n const currentRelease = versions.find(\n (v) =>\n versioningApi.isValid(v.version) &&\n versioningApi.equals(v.version, version),\n );\n\n if (!currentRelease) {\n return null;\n }\n\n if (currentRelease.releaseTimestamp) {\n return currentRelease.releaseTimestamp;\n }\n\n const remoteRelease = await postprocessRelease(config, currentRelease);\n return remoteRelease?.releaseTimestamp;\n}\n\n/** The only two `updateType`s that `applyMinimumReleaseAgeToDigestUpdate()` can be called with */\ntype DigestLikeUpdate = LookupUpdate & { updateType: 'digest' | 'pinDigest' };\n\n/**\n * A helper function to allow a short-circuit for `minimumReleaseAge` functionality if a package may have config that applies it.\n *\n * Allows avoiding unnecessary calls to more expensive checks like merge + `applyPackageRules()` and `getTimestamp()`.\n */\nfunction couldApplyMinimumReleaseAgeToDigest(\n config: LookupUpdateConfig,\n updateType: DigestLikeUpdate['updateType'],\n): boolean {\n // Match filterInternalChecks(): under `none` the user opted out of internal\n // checks entirely, so do no merging, no package rules, no age check and no\n // logging claiming an age check ran.\n if (config.internalChecksFilter === 'none') {\n return false;\n }\n\n return (\n isNonEmptyString(config.minimumReleaseAge) ||\n isNonEmptyString(config[updateType]?.minimumReleaseAge) ||\n !!config.packageRules?.some((rule) =>\n isNonEmptyString(rule.minimumReleaseAge),\n )\n );\n}\n\n/**\n * Ensure `minimumReleaseAge`/`internalChecksFilter` applies to digest/pinDigest updates, as they don't currently get run through `filterInternalChecks()`.\n *\n * NOTE that this should be kept in sync with `filterInternalChecks`()\n */\nasync function applyMinimumReleaseAgeToDigestUpdate(\n update: DigestLikeUpdate,\n config: LookupUpdateConfig,\n res: UpdateResult,\n currentVersionWasResolved: boolean,\n newestMatchingVersionTimestamp: Timestamp | null | undefined,\n): Promise<void> {\n if (!couldApplyMinimumReleaseAgeToDigest(config, update.updateType)) {\n return;\n }\n\n if (update.updateType === 'pinDigest' && !currentVersionWasResolved) {\n // Not `!res.currentVersion` - that's force-set to lockedVersion further down regardless of timestamp resolution.\n // `pinDigest` doesn't repoint anywhere, unlike `digest` - it just freezes whatever the ref already resolves to.\n // An unversioned tag (e.g. `latest`) has no versioned release to age against, and holding the pin would only\n // prolong the less-pinned (less safe) state, so skip the check entirely rather than treating the missing\n // timestamp as pending.\n logger.once.debug(\n { depName: config.depName, updateType: update.updateType },\n `Skipping minimumReleaseAge check for ${update.updateType} update of ${config.depName}, as its current value does not resolve to a versioned release`,\n );\n return;\n }\n\n let releaseConfig: LookupUpdateConfig = {\n ...mergeChildConfig(config, res),\n updateType: update.updateType,\n };\n releaseConfig = mergeChildConfig(\n releaseConfig,\n releaseConfig[update.updateType]!,\n );\n releaseConfig = await applyPackageRules(releaseConfig, 'update-type');\n\n // Not update.releaseTimestamp - that field means \"age of the new release\" elsewhere (generate.ts, libyear.ts).\n // Not res.currentVersionTimestamp either - that tracks whatever rangeStrategy resolves currentVersion to (e.g.\n // the oldest matching release under `bump`), whereas both `digest` and `pinDigest` reflect whatever the current\n // value's ref actually resolves to *right now*, which is always the newest matching version.\n const ageCheck = checkMinimumReleaseAge(\n releaseConfig,\n newestMatchingVersionTimestamp,\n );\n\n // Mirror filterInternalChecks()'s logging so a held/passed digest update is diagnosable.\n if (ageCheck.minimumReleaseAgeMs && !ageCheck.hasTimestamp) {\n if (releaseConfig.minimumReleaseAgeBehaviour === 'timestamp-optional') {\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 }\n\n logger.once.debug(\n {\n depName: config.depName,\n updateType: update.updateType,\n minimumReleaseAgeBehaviour: releaseConfig.minimumReleaseAgeBehaviour,\n check: 'minimumReleaseAge',\n },\n `${update.updateType} update of ${config.depName} has no releaseTimestamp to age against`,\n );\n }\n if (ageCheck.isPending) {\n logger.trace(\n {\n depName: config.depName,\n updateType: update.updateType,\n releaseTimestamp: newestMatchingVersionTimestamp,\n check: 'minimumReleaseAge',\n },\n `${update.updateType} update is pending minimumReleaseAge status checks`,\n );\n\n // internalChecksFilter is read from the unmerged top-level config, like filterInternalChecks().\n if (config.internalChecksFilter === 'strict') {\n update.pendingChecks = true;\n }\n }\n}\n\nexport async function lookupUpdates(\n inconfig: LookupUpdateConfig,\n): Promise<Result<UpdateResult>> {\n let config: LookupUpdateConfig = { ...inconfig };\n config.versioning ??= getDefaultVersioning(config.datasource);\n\n const versioningApi = allVersioning.get(config.versioning);\n\n let dependency: ReleaseResult | null = null;\n const res: UpdateResult = {\n versioning: config.versioning,\n updates: [],\n warnings: [],\n };\n // Timestamp of the release a `digest`/`pinDigest` update's current value currently resolves to (the newest version matching it, regardless of `rangeStrategy`), as opposed to `res.currentVersionTimestamp` which tracks whatever the configured rangeStrategy resolves `currentVersion` to (e.g. the oldest for `bump`)\n let newestMatchingVersionTimestamp: Timestamp | null | undefined;\n // The `digest` update for `config.currentDigest` (if one is added), so its age check can run after `newDigest` is fetched and no-op updates are stripped.\n let digestUpdate: DigestLikeUpdate | undefined;\n\n try {\n logger.trace(\n {\n dependency: config.packageName,\n currentValue: config.currentValue,\n },\n 'lookupUpdates',\n );\n if (config.currentValue && !isString(config.currentValue)) {\n // If currentValue is not a string, then it's invalid\n logger.debug(\n `Invalid currentValue for ${config.packageName}: ${safeStringify(config.currentValue)} (${typeof config.currentValue})`,\n );\n res.skipReason = 'invalid-value';\n return Result.ok(res);\n }\n if (\n !isGetPkgReleasesConfig(config) ||\n !getDatasourceFor(config.datasource)\n ) {\n res.skipReason = 'invalid-config';\n return Result.ok(res);\n }\n let compareValue =\n config.isLockfileOnly && config.lockedVersion\n ? config.lockedVersion\n : config.currentValue;\n if (\n isString(config.currentValue) &&\n isString(config.versionCompatibility)\n ) {\n const versionCompatbilityRegEx = regEx(config.versionCompatibility);\n const regexMatch = versionCompatbilityRegEx.exec(config.currentValue);\n if (regexMatch?.groups) {\n logger.debug(\n {\n versionCompatibility: config.versionCompatibility,\n currentValue: config.currentValue,\n packageName: config.packageName,\n groups: regexMatch.groups,\n },\n 'version compatibility regex match',\n );\n config.currentCompatibility = regexMatch.groups.compatibility;\n res.currentCompatibility = regexMatch.groups.compatibility;\n compareValue = regexMatch.groups.version;\n } else {\n logger.debug(\n {\n versionCompatibility: config.versionCompatibility,\n currentValue: config.currentValue,\n packageName: config.packageName,\n },\n 'version compatibility regex mismatch',\n );\n }\n }\n\n const isValid =\n isString(compareValue) && versioningApi.isValid(compareValue);\n\n const unconstrainedValue =\n !!config.lockedVersion && isUndefined(config.currentValue);\n\n if (isValid || unconstrainedValue) {\n if (\n !config.updatePinnedDependencies &&\n !config.isLockfileOnly &&\n // TODO #22198\n versioningApi.isSingleVersion(compareValue!)\n ) {\n res.skipReason = 'is-pinned';\n return Result.ok(res);\n }\n\n const { val: releaseResult, err: lookupError } = await getRawPkgReleases(\n config,\n )\n .transform((res) => calculateMostRecentTimestamp(versioningApi, res))\n .transform((res) => calculateAbandonment(res, config))\n .transform((res) => applyDatasourceFilters(res, config))\n .unwrap();\n\n if (lookupError instanceof Error) {\n throw lookupError;\n }\n\n if (lookupError) {\n // If dependency lookup fails then warn and return\n const warning: ValidationMessage = {\n topic: config.packageName,\n message: `Failed to look up ${config.datasource} package ${config.packageName}: ${lookupError}`,\n };\n logger.debug(\n {\n dependency: config.packageName,\n packageFile: config.packageFile,\n },\n warning.message,\n );\n // TODO: return warnings in own field\n res.warnings.push(warning);\n return Result.ok(res);\n }\n\n dependency = releaseResult;\n\n if (dependency.deprecationMessage) {\n logger.debug(\n `Found deprecationMessage for ${config.datasource} package ${config.packageName}`,\n );\n }\n\n assignKeys(res, dependency, [\n 'deprecationMessage',\n 'sourceUrl',\n 'registryUrl',\n 'sourceDirectory',\n 'homepage',\n 'changelogUrl',\n 'dependencyUrl',\n 'lookupName',\n 'packageScope',\n 'mostRecentTimestamp',\n 'isAbandoned',\n 'respectLatest',\n ]);\n\n const latestVersion = dependency.tags?.latest;\n // Filter out any results from datasource that don't comply with our versioning\n let allVersions = dependency.releases.filter((release) =>\n versioningApi.isVersion(release.version),\n );\n const allReleaseVersions = new Set(allVersions.map((r) => r.version));\n // The datasources used in these tests always return at least one\n // version-like release, so neither this block nor the currentDigest\n // check inside it is reached. A lookup whose releases are all\n // unversioned tags does not get here either - with a digest configured\n // it takes the digest-only path above instead - see #40625\n // istanbul ignore if\n if (allVersions.length === 0) {\n const message = `Found no results from datasource that look like a version`;\n logger.info(\n {\n dependency: config.packageName,\n result: dependency,\n },\n message,\n );\n if (!config.currentDigest) {\n return Result.ok(res);\n }\n }\n // Reapply package rules in case we missed something from sourceUrl\n config = await applyPackageRules(\n { ...config, sourceUrl: res.sourceUrl },\n 'source-url',\n );\n if (config.followTag) {\n const taggedVersion = dependency.tags?.[config.followTag];\n if (!taggedVersion) {\n res.warnings.push({\n topic: config.packageName,\n message: `Can't find version with tag ${config.followTag} for ${config.datasource} package ${config.packageName}`,\n });\n return Result.ok(res);\n }\n allVersions = allVersions.filter(\n (v) =>\n v.version === taggedVersion ||\n (v.version === compareValue &&\n versioningApi.isGreaterThan(taggedVersion, compareValue)),\n );\n }\n\n const inRangeOnlyStrategy = config.rangeStrategy === 'in-range-only';\n // Check that existing constraint can be satisfied\n const allSatisfyingVersions =\n (inRangeOnlyStrategy || config.rollbackPrs) && !unconstrainedValue\n ? allVersions.filter((v) =>\n // TODO #22198\n versioningApi.matches(v.version, compareValue!),\n )\n : allVersions;\n if (!allSatisfyingVersions.length) {\n logger.debug(\n `Found no satisfying versions with '${config.versioning}' versioning`,\n );\n }\n\n if (config.rollbackPrs && !allSatisfyingVersions.length) {\n const rollback = getRollbackUpdate(config, allVersions, versioningApi);\n // istanbul ignore if\n if (!rollback) {\n res.warnings.push({\n topic: config.packageName,\n // TODO: types (#22198)\n message: `Can't find version matching ${compareValue!} for ${\n config.datasource\n } package ${config.packageName}`,\n });\n return Result.ok(res);\n }\n res.updates.push(rollback);\n }\n let rangeStrategy = getRangeStrategy(config);\n\n // istanbul ignore next\n if (\n config.isVulnerabilityAlert &&\n rangeStrategy === 'update-lockfile' &&\n !config.lockedVersion\n ) {\n rangeStrategy = 'bump';\n }\n // unconstrained deps with lockedVersion\n if (\n config.isVulnerabilityAlert &&\n !config.currentValue &&\n config.lockedVersion\n ) {\n rangeStrategy = 'update-lockfile';\n }\n const nonDeprecatedVersions = dependency.releases\n .filter((release) => !release.isDeprecated)\n .map((release) => release.version);\n let currentVersion: string;\n if (rangeStrategy === 'update-lockfile') {\n currentVersion = config.lockedVersion!;\n } else if (\n compareValue &&\n versioningApi.isSingleVersion(compareValue) &&\n allVersions.find((v) => v.version === compareValue)\n ) {\n currentVersion = compareValue;\n }\n // TODO #22198\n currentVersion ??=\n getCurrentVersion(\n compareValue!,\n config.lockedVersion!,\n versioningApi,\n rangeStrategy!,\n latestVersion!,\n nonDeprecatedVersions,\n ) ??\n getCurrentVersion(\n compareValue!,\n config.lockedVersion!,\n versioningApi,\n rangeStrategy!,\n latestVersion!,\n allVersions.map((v) => v.version),\n )!;\n\n if (!currentVersion) {\n // v8 ignore else -- TODO: add test #40625\n if (!config.lockedVersion) {\n logger.debug(\n `No currentVersion or lockedVersion found for ${config.packageName}`,\n );\n res.skipReason = 'invalid-value';\n }\n return Result.ok(res);\n }\n\n res.currentVersion = currentVersion;\n\n // Use lockedVersion for the timestamp lookup when available, because\n // res.currentVersion is later overwritten to lockedVersion (see below).\n // Without this, strategies like \"replace\" would compute the timestamp\n // for the highest satisfying version (e.g. 1.4.1) while the reported\n // currentVersion ends up being the locked one (e.g. 1.0.0).\n const versionForTimestamp = config.lockedVersion ?? currentVersion;\n const currentVersionTimestamp = await getTimestamp(\n config,\n allVersions,\n versionForTimestamp,\n versioningApi,\n );\n\n if (isNonEmptyString(currentVersionTimestamp)) {\n res.currentVersionTimestamp = currentVersionTimestamp;\n res.currentVersionAgeInDays = getElapsedDays(currentVersionTimestamp);\n\n if (\n config.packageRules?.some((rule) =>\n isNonEmptyString(rule.matchCurrentAge),\n )\n ) {\n // Reapply package rules to check matches for matchCurrentAge\n config = await applyPackageRules(\n { ...config, currentVersionTimestamp },\n 'current-timestamp',\n );\n }\n }\n\n if (\n config.currentDigest\n ? couldApplyMinimumReleaseAgeToDigest(config, 'digest')\n : config.pinDigests &&\n couldApplyMinimumReleaseAgeToDigest(config, 'pinDigest')\n ) {\n // Resolve from `allVersions` (not `dependency.releases`) so that filters like followTag apply, preferring non-deprecated versions with a fallback - both like the `currentVersion` resolution above.\n const newestMatchingVersion =\n getCurrentVersion(\n compareValue!,\n '',\n versioningApi,\n 'replace',\n latestVersion!,\n allVersions.filter((v) => !v.isDeprecated).map((v) => v.version),\n ) ??\n getCurrentVersion(\n compareValue!,\n '',\n versioningApi,\n 'replace',\n latestVersion!,\n allVersions.map((v) => v.version),\n );\n if (newestMatchingVersion) {\n newestMatchingVersionTimestamp = await getTimestamp(\n config,\n allVersions,\n newestMatchingVersion,\n versioningApi,\n );\n }\n }\n\n if (\n compareValue &&\n currentVersion &&\n rangeStrategy === 'pin' &&\n !versioningApi.isSingleVersion(compareValue)\n ) {\n const newValue =\n versioningApi.getPinnedValue?.(currentVersion) ?? currentVersion;\n res.updates.push({\n updateType: 'pin',\n isPin: true,\n newValue,\n newVersion: currentVersion,\n newMajor: versioningApi.getMajor(currentVersion)!,\n });\n }\n if (rangeStrategy === 'pin') {\n // Fall back to replace once pinning logic is done\n rangeStrategy = 'replace';\n }\n // A non-version can only get this far via a locked version under\n // rangeStrategy=pin, but the timestamp lookup above calls `equals()` on\n // it first and throws - see #40625\n // istanbul ignore if\n if (!versioningApi.isVersion(currentVersion!)) {\n res.skipReason = 'invalid-version';\n return Result.ok(res);\n }\n // Filter latest, unstable, etc\n // TODO #22198\n let filteredReleases = filterVersions(\n config,\n currentVersion!,\n latestVersion!,\n inRangeOnlyStrategy ? allSatisfyingVersions : allVersions,\n versioningApi,\n ).filter((v) => {\n if (config.isLockfileOnly) {\n return true;\n }\n\n // Leave only compatible versions\n return (\n unconstrainedValue ||\n versioningApi.isCompatible(v.version, compareValue)\n );\n });\n let shrinkedViaVulnerability = false;\n if (config.isVulnerabilityAlert) {\n if (config.vulnerabilityFixVersion) {\n res.vulnerabilityFixVersion = config.vulnerabilityFixVersion;\n res.vulnerabilityFixStrategy = config.vulnerabilityFixStrategy;\n if (versioningApi.isValid(config.vulnerabilityFixVersion)) {\n let fixedFilteredReleases;\n if (versioningApi.isVersion(config.vulnerabilityFixVersion)) {\n // Retain only releases greater than or equal to the fix version\n fixedFilteredReleases = filteredReleases.filter(\n (release) =>\n !versioningApi.isGreaterThan(\n config.vulnerabilityFixVersion!,\n release.version,\n ),\n );\n } else {\n // Retain only releases which max the fix constraint\n fixedFilteredReleases = filteredReleases.filter((release) =>\n versioningApi.matches(\n release.version,\n config.vulnerabilityFixVersion!,\n ),\n );\n }\n // Warn if this filtering results caused zero releases\n if (fixedFilteredReleases.length === 0 && filteredReleases.length) {\n logger.warn(\n {\n releases: filteredReleases,\n vulnerabilityFixVersion: config.vulnerabilityFixVersion,\n packageName: config.packageName,\n },\n 'No releases satisfy vulnerabilityFixVersion',\n );\n }\n // Use the additionally filtered releases\n filteredReleases = fixedFilteredReleases;\n } else {\n logger.warn(\n {\n vulnerabilityFixVersion: config.vulnerabilityFixVersion,\n packageName: config.packageName,\n },\n 'vulnerabilityFixVersion is not valid',\n );\n }\n }\n if (config.vulnerabilityFixStrategy === 'highest') {\n // Don't shrink the list of releases - let Renovate use its normal logic\n logger.once.debug(\n `Using vulnerabilityFixStrategy=highest for ${config.packageName}`,\n );\n } else {\n // Shrink the list of releases to the lowest fixed version\n logger.once.debug(\n `Using vulnerabilityFixStrategy=lowest for ${config.packageName}`,\n );\n filteredReleases = filteredReleases.slice(0, 1);\n shrinkedViaVulnerability = true;\n }\n }\n const buckets: Record<string, [Release]> = {};\n for (const release of filteredReleases) {\n const bucket = getBucket(\n config,\n // TODO #22198\n currentVersion!,\n release.version,\n versioningApi,\n );\n // `getBucket()` only returns null when the versioning api cannot\n // determine a major, but every release reaching it has already passed\n // `isVersion()`, so a null major contradicts that and the else looks\n // unreachable rather than merely untested\n // v8 ignore else -- see #40625\n if (isString(bucket)) {\n if (buckets[bucket]) {\n buckets[bucket].push(release);\n } else {\n buckets[bucket] = [release];\n }\n }\n }\n const depResultConfig = mergeChildConfig(config, res);\n for (const [bucket, releases] of Object.entries(buckets)) {\n const sortedReleases = releases.sort((r1, r2) =>\n versioningApi.sortVersions(r1.version, r2.version),\n );\n const { release, pendingChecks, pendingReleases } =\n await filterInternalChecks(\n depResultConfig,\n versioningApi,\n bucket,\n sortedReleases,\n );\n // `filterInternalChecks()` normally yields a release, falling back to\n // the newest pending one; only a datasource rejecting every candidate\n // during postprocessing leaves none - see #40625\n // istanbul ignore next\n if (!release) {\n return Result.ok(res);\n }\n const newVersion = release.version;\n const update = await generateUpdate(\n config,\n config.isLockfileOnly ? config.currentValue : compareValue,\n versioningApi,\n // TODO #22198\n\n rangeStrategy!,\n config.lockedVersion ?? currentVersion!,\n bucket,\n release,\n allReleaseVersions,\n );\n\n // #29034\n if (\n config.manager === 'gomod' &&\n compareValue?.startsWith('v0.0.0-') &&\n update.newValue?.startsWith('v0.0.0-') &&\n config.currentDigest !== update.newDigest\n ) {\n update.updateType = 'digest';\n\n // As this has already been processed by `filterInternalChecks()`, but we're changing the `updateType`, we need to apply the digest-scoped minimumReleaseAge rules.\n // `currentVersionWasResolved` only matters for `pinDigest`, which `update.updateType` never is here - true is a safe constant.\n await applyMinimumReleaseAgeToDigestUpdate(\n update as DigestLikeUpdate,\n config,\n res,\n true,\n release.releaseTimestamp,\n );\n }\n\n if (pendingChecks) {\n update.pendingChecks = pendingChecks;\n }\n\n if (pendingReleases.length) {\n update.pendingVersions = pendingReleases.map((r) => r.version);\n }\n if (!update.newValue || update.newValue === compareValue) {\n if (!config.lockedVersion) {\n continue;\n }\n // istanbul ignore if\n if (rangeStrategy === 'bump') {\n logger.trace(\n {\n packageName: config.packageName,\n currentValue: config.currentValue,\n lockedVersion: config.lockedVersion,\n newVersion,\n },\n 'Skipping bump because newValue is the same',\n );\n continue;\n }\n res.isSingleVersion = true;\n }\n res.isSingleVersion ??=\n isString(update.newValue) &&\n versioningApi.isSingleVersion(update.newValue);\n // Guards against a docker downgrade, which the datasources used in\n // these tests never produce - see #40625\n // istanbul ignore if\n if (\n config.versioning === dockerVersioningId &&\n update.updateType !== 'rollback' &&\n update.newValue &&\n versioningApi.isVersion(update.newValue) &&\n compareValue &&\n versioningApi.isVersion(compareValue) &&\n versioningApi.isGreaterThan(compareValue, update.newValue)\n ) {\n logger.warn(\n {\n packageName: config.packageName,\n currentValue: config.currentValue,\n compareValue,\n currentVersion: config.currentVersion,\n update,\n allVersionsLength: allVersions.length,\n filteredReleaseVersions: filteredReleases.map((r) => r.version),\n shrinkedViaVulnerability,\n },\n 'Unexpected downgrade detected: skipping',\n );\n } else {\n res.updates.push(update);\n }\n }\n } else if (compareValue) {\n logger.debug(\n `Dependency ${config.packageName} has unsupported/unversioned value ${compareValue} (versioning=${config.versioning})`,\n );\n\n if (!config.pinDigests && !config.currentDigest) {\n logger.debug(\n `Skipping ${config.packageName} because no currentDigest or pinDigests`,\n );\n res.skipReason = 'invalid-value';\n } else {\n delete res.skipReason;\n }\n } else {\n res.skipReason = 'invalid-value';\n }\n\n if (isReplacementRulesConfigured(config)) {\n addReplacementUpdateIfValid(res.updates, config);\n } else if (dependency?.replacementName && dependency.replacementVersion) {\n res.updates.push({\n updateType: 'replacement',\n newName: dependency.replacementName,\n newValue: dependency.replacementVersion,\n });\n }\n\n // Record if the dep is fixed to a version\n if (config.lockedVersion) {\n res.currentVersion = config.lockedVersion;\n res.fixedVersion = config.lockedVersion;\n } else if (compareValue && versioningApi.isSingleVersion(compareValue)) {\n res.fixedVersion = compareValue.replace(regEx(/^=+/), '');\n }\n\n // massage versionCompatibility\n if (\n isString(config.currentValue) &&\n isString(compareValue) &&\n isString(config.versionCompatibility)\n ) {\n for (const update of res.updates) {\n logger.debug({ update });\n // The enclosing condition already requires a string `currentValue`,\n // so only a null `newValue` takes the else\n // v8 ignore else -- see #40625\n if (isString(config.currentValue) && isString(update.newValue)) {\n update.newValue = config.currentValue.replace(\n compareValue,\n update.newValue,\n );\n }\n }\n }\n\n // Add digests if necessary\n if (supportsDigests(config.datasource)) {\n if (config.currentDigest) {\n if (!config.digestOneAndOnly || !res.updates.length) {\n // digest update - age-checked after the strip below, once newDigest is known\n digestUpdate = {\n updateType: 'digest',\n newValue: config.currentValue,\n };\n res.updates.push(digestUpdate);\n }\n } else if (\n config.pinDigests &&\n // only update the digest in the package file if it's managed by us\n !config.digestManagedExternally &&\n // Create a pin only if one doesn't already exists\n // v8 ignore else -- TODO: add test #40625\n !res.updates.some((update) => update.updateType === 'pin')\n ) {\n // pin digest\n const pinDigestUpdate: DigestLikeUpdate = {\n isPinDigest: true,\n updateType: 'pinDigest',\n newValue: config.currentValue,\n };\n await applyMinimumReleaseAgeToDigestUpdate(\n pinDigestUpdate,\n config,\n res,\n isValid || unconstrainedValue,\n newestMatchingVersionTimestamp,\n );\n res.updates.push(pinDigestUpdate);\n }\n if (versioningApi.valueToVersion) {\n // TODO #22198\n res.currentVersion = versioningApi.valueToVersion(res.currentVersion!);\n for (const update of res.updates) {\n // TODO #22198\n update.newVersion = versioningApi.valueToVersion(update.newVersion!);\n }\n }\n if (res.registryUrl) {\n config.registryUrls = [res.registryUrl];\n }\n\n // update digest for all\n for (const update of res.updates) {\n // only update the digest in the package file if it's managed by us\n if (\n (config.pinDigests === true && !config.digestManagedExternally) ||\n config.currentDigest\n ) {\n const getDigestConfig: GetDigestInputConfig = {\n ...config,\n registryUrl: update.registryUrl ?? res.registryUrl,\n lookupName: res.lookupName,\n };\n\n // #20304 only pass it for replacement updates, otherwise we get wrong or invalid digest\n if (update.updateType !== 'replacement') {\n delete getDigestConfig.replacementName;\n }\n\n // #20304 don't use lookupName and currentDigest when we replace image name\n if (\n update.updateType === 'replacement' &&\n update.newName !== config.packageName\n ) {\n delete getDigestConfig.lookupName;\n delete getDigestConfig.currentDigest;\n getDigestConfig.replacementName = update.newName;\n }\n\n // Don't use current releases if replacement changes name, otherwise we use the wrong new digest.\n // This happens on datasources which return the digest in release info like `github-tags`.\n // We can still use it when only version is changing.\n if (\n update.updateType !== 'replacement' ||\n update.newName === config.packageName\n ) {\n update.newDigest ??= dependency?.releases.find(\n (r) => r.version === update.newValue,\n )?.newDigest;\n }\n\n update.newDigest ??= await getDigest(\n getDigestConfig,\n update.newValue,\n );\n\n // If the digest could not be determined, report this as otherwise the\n // update will be omitted later on without notice.\n if (update.newDigest === null) {\n logger.debug(\n {\n packageName: config.packageName,\n currentValue: config.currentValue,\n datasource: config.datasource,\n newValue: update.newValue,\n bucket: update.bucket,\n },\n 'Could not determine new digest for update.',\n );\n\n // Only report a warning if there is a current digest.\n // Context: https://github.com/renovatebot/renovate/pull/20175#discussion_r1102615059.\n if (config.currentDigest) {\n res.warnings.push({\n message: `Could not determine new digest for update (${config.datasource} package ${config.packageName})`,\n topic: config.packageName,\n });\n }\n }\n } else {\n delete update.newDigest;\n }\n if (update.newVersion) {\n const registryUrl = dependency?.releases?.find(\n (release) => release.version === update.newVersion,\n )?.registryUrl;\n if (registryUrl && registryUrl !== res.registryUrl) {\n update.registryUrl = registryUrl;\n }\n }\n }\n }\n\n if (res.updates.length) {\n delete res.skipReason;\n }\n // Strip out any non-changed ones\n res.updates = res.updates\n .filter(\n (update) => update.newValue !== null || config.currentValue === null,\n )\n .filter((update) => update.newDigest !== null)\n .filter(\n (update) =>\n (isString(update.newName) && update.newName !== config.packageName) ||\n update.isReplacement === true ||\n update.newValue !== config.currentValue ||\n update.isLockfileUpdate === true ||\n // TODO #22198\n (update.newDigest &&\n !update.newDigest.startsWith(config.currentDigest!)),\n );\n // If range strategy specified in config is 'in-range-only', also strip out updates where currentValue !== newValue\n if (config.rangeStrategy === 'in-range-only') {\n res.updates = res.updates.filter(\n (update) => update.newValue === config.currentValue,\n );\n }\n // Handle a weird edge case involving followTag and fallbacks\n if (config.rollbackPrs && config.followTag) {\n res.updates = res.updates.filter(\n (update) =>\n update.updateType !== 'rollback' || res.updates.length === 1,\n );\n }\n\n // If there is a digest update proposed which is in the pending updates for this dependency, ensure that `minimumReleaseAge` is applied.\n // `currentVersionWasResolved` only matters for `pinDigest`, which `digestUpdate` never is - true is a safe constant.\n if (digestUpdate && res.updates.includes(digestUpdate)) {\n await applyMinimumReleaseAgeToDigestUpdate(\n digestUpdate,\n config,\n res,\n true,\n newestMatchingVersionTimestamp,\n );\n }\n\n const release =\n res.updates.length > 0\n ? (dependency?.releases.find(\n (r) => r.version === res.updates[0].newValue,\n ) ??\n dependency?.releases.find(\n (r) => r.version === res.updates[0].newVersion,\n ))\n : null;\n\n if (release?.changelogContent) {\n res.changelogContent = release.changelogContent;\n res.changelogUrl = release.changelogUrl;\n }\n } catch (err) /* istanbul ignore next */ {\n if (err instanceof ExternalHostError) {\n return Result.err(err);\n }\n\n if (err instanceof Error && err.message === CONFIG_VALIDATION) {\n return Result.err(err);\n }\n\n logger.error(\n {\n currentDigest: config.currentDigest,\n currentValue: config.currentValue,\n datasource: config.datasource,\n packageName: config.packageName,\n digestOneAndOnly: config.digestOneAndOnly,\n followTag: config.followTag,\n lockedVersion: config.lockedVersion,\n packageFile: config.packageFile,\n pinDigests: config.pinDigests,\n rollbackPrs: config.rollbackPrs,\n isVulnerabilityAlert: config.isVulnerabilityAlert,\n updatePinnedDependencies: config.updatePinnedDependencies,\n err,\n },\n 'lookupUpdates error',\n );\n res.skipReason = 'internal-error';\n }\n return Result.ok(res);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,eAAe,aACb,QACA,UACA,SACA,eACuC;CACvC,MAAM,iBAAiB,SAAS,MAC7B,MACC,cAAc,QAAQ,EAAE,OAAO,KAC/B,cAAc,OAAO,EAAE,SAAS,OAAO,CAC3C;CAEA,IAAI,CAAC,gBACH,OAAO;CAGT,IAAI,eAAe,kBACjB,OAAO,eAAe;CAIxB,QAAO,MADqB,mBAAmB,QAAQ,cAAc,EAAA,EAC/C;AACxB;;;;;;AAUA,SAAS,oCACP,QACA,YACS;CAIT,IAAI,OAAO,yBAAyB,QAClC,OAAO;CAGT,OACE,iBAAiB,OAAO,iBAAiB,KACzC,iBAAiB,OAAO,WAAW,EAAE,iBAAiB,KACtD,CAAC,CAAC,OAAO,cAAc,MAAM,SAC3B,iBAAiB,KAAK,iBAAiB,CACzC;AAEJ;;;;;;AAOA,eAAe,qCACb,QACA,QACA,KACA,2BACA,gCACe;CACf,IAAI,CAAC,oCAAoC,QAAQ,OAAO,UAAU,GAChE;CAGF,IAAI,OAAO,eAAe,eAAe,CAAC,2BAA2B;EAMnE,OAAO,KAAK,MACV;GAAE,SAAS,OAAO;GAAS,YAAY,OAAO;EAAW,GACzD,wCAAwC,OAAO,WAAW,aAAa,OAAO,QAAQ,+DACxF;EACA;CACF;CAEA,IAAI,gBAAoC;EACtC,GAAG,iBAAiB,QAAQ,GAAG;EAC/B,YAAY,OAAO;CACrB;CACA,gBAAgB,iBACd,eACA,cAAc,OAAO,WACvB;CACA,gBAAgB,MAAM,kBAAkB,eAAe,aAAa;CAMpE,MAAM,WAAW,uBACf,eACA,8BACF;CAGA,IAAI,SAAS,uBAAuB,CAAC,SAAS,cAAc;EAC1D,IAAI,cAAc,+BAA+B,sB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AEF,IAAI,OAAO,kBAAkB,iBAC3B,IAAI,UAAU,IAAI,QAAQ,QACvB,WAAW,OAAO,aAAa,OAAO,YACzC;EAGF,IAAI,OAAO,eAAe,OAAO,WAC/B,IAAI,UAAU,IAAI,QAAQ,QACvB,WACC,OAAO,eAAe,cAAc,IAAI,QAAQ,WAAW,CAC/D;EAKF,IAAI,gBAAgB,IAAI,QAAQ,SAAS,YAAY,GACnD,MAAM,qCACJ,cACA,QACA,KACA,MACA,8BACF;EAGF,MAAM,UACJ,IAAI,QAAQ,SAAS,IAChB,YAAY,SAAS,MACnB,MAAM,EAAE,YAAY,IAAI,QAAQ,EAAE,CAAC,QACtC,KACA,YAAY,SAAS,MAClB,MAAM,EAAE,YAAY,IAAI,QAAQ,EAAE,CAAC,UACtC,IACA;EAEN,IAAI,SAAS,kBAAkB;GAC7B,IAAI,mBAAmB,QAAQ;GAC/B,IAAI,eAAe,QAAQ;EAC7B;CACF,SAAS,gCAAgC;EACvC,IAAI,eAAe,mBACjB,OAAO,OAAO,IAAI,GAAG;EAGvB,IAAI,eAAe,SAAS,IAAI,YAAA,qBAC9B,OAAO,OAAO,IAAI,GAAG;EAGvB,OAAO,MACL;GACE,eAAe,OAAO;GACtB,cAAc,OAAO;GACrB,YAAY,OAAO;GACnB,aAAa,OAAO;GACpB,kBAAkB,OAAO;GACzB,WAAW,OAAO;GAClB,eAAe,OAAO;GACtB,aAAa,OAAO;GACpB,YAAY,OAAO;GACnB,aAAa,OAAO;GACpB,sBAAsB,OAAO;GAC7B,0BAA0B,OAAO;GACjC;EACF,GACA,qBACF;EACA,IAAI,aAAa;CACnB;CACA,OAAO,OAAO,GAAG,GAAG;AACtB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { WORKER_FILE_UPDATE_FAILED } from "../../../../constants/error-messages.js";
|
|
2
2
|
import { GlobalConfig } from "../../../../config/global.js";
|
|
3
|
+
import { coerceArray } from "../../../../util/array.js";
|
|
3
4
|
import { coerceString } from "../../../../util/string.js";
|
|
4
5
|
import { logger } from "../../../../logger/index.js";
|
|
5
6
|
import { getFile } from "../../../../util/git/index.js";
|
|
@@ -23,6 +24,40 @@ function hasAny(set, targets) {
|
|
|
23
24
|
for (const target of targets) if (set.has(target)) return true;
|
|
24
25
|
return false;
|
|
25
26
|
}
|
|
27
|
+
function getUpdatedLockFileContent(updatedDeps, updatedFileContents) {
|
|
28
|
+
for (const upgrade of updatedDeps) {
|
|
29
|
+
const lockFiles = [upgrade.lockFile, ...coerceArray(upgrade.lockFiles)];
|
|
30
|
+
for (const lockFile of lockFiles) if (lockFile && updatedFileContents[lockFile] !== void 0) return updatedFileContents[lockFile];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function removeUnrefreshedLockfileOnlyChanges(packageFiles, updatedDeps, results) {
|
|
34
|
+
const removedLockFiles = [];
|
|
35
|
+
const refreshedFiles = new Set(coerceArray(results).flatMap((result) => result.file ? [result.file.path] : []));
|
|
36
|
+
const lockFiles = new Set(updatedDeps.filter((upgrade) => upgrade.isLockfileOnly).flatMap((upgrade) => [upgrade.lockFile, ...coerceArray(upgrade.lockFiles)]));
|
|
37
|
+
for (let index = packageFiles.length - 1; index >= 0; index -= 1) {
|
|
38
|
+
const path = packageFiles[index].path;
|
|
39
|
+
if (lockFiles.has(path) && !refreshedFiles.has(path)) {
|
|
40
|
+
packageFiles.splice(index, 1);
|
|
41
|
+
removedLockFiles.push(path);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return removedLockFiles;
|
|
45
|
+
}
|
|
46
|
+
function reportUnrefreshedLockfileOnlyChanges(removedLockFiles, results, artifactErrors) {
|
|
47
|
+
const artifactErrorFiles = new Set(coerceArray(results).flatMap((result) => result.artifactError ? [result.artifactError.fileName] : []));
|
|
48
|
+
for (const lockFile of removedLockFiles) if (!artifactErrorFiles.has(lockFile)) artifactErrors.push({
|
|
49
|
+
fileName: lockFile,
|
|
50
|
+
stderr: "Lockfile-only update could not be refreshed"
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function removeSupersededLockFileChanges(packageFiles, updatedDeps, results) {
|
|
54
|
+
const artifactFiles = new Set(coerceArray(results).flatMap((result) => result.file ? [result.file.path] : []));
|
|
55
|
+
const lockFiles = new Set(updatedDeps.filter((upgrade) => upgrade.isLockfileOnly).flatMap((upgrade) => [upgrade.lockFile, ...coerceArray(upgrade.lockFiles)]));
|
|
56
|
+
for (let index = packageFiles.length - 1; index >= 0; index -= 1) {
|
|
57
|
+
const path = packageFiles[index].path;
|
|
58
|
+
if (lockFiles.has(path) && artifactFiles.has(path)) packageFiles.splice(index, 1);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
26
61
|
function getManagersForPackageFiles(packageFiles, managerPackageFiles) {
|
|
27
62
|
const packageFileNames = packageFiles.map((packageFile) => packageFile.path);
|
|
28
63
|
return new Set(Object.keys(managerPackageFiles).filter((manager) => hasAny(managerPackageFiles[manager], packageFileNames)));
|
|
@@ -233,8 +268,13 @@ async function getUpdatedPackageFiles(config) {
|
|
|
233
268
|
packageFileName: packageFile.path,
|
|
234
269
|
updatedDeps,
|
|
235
270
|
newPackageFileContent: packageFile.contents.toString(),
|
|
271
|
+
newLockFileContent: getUpdatedLockFileContent(updatedDeps, updatedFileContents),
|
|
236
272
|
config: patchConfigForArtifactsUpdate(config, manager, packageFile.path)
|
|
237
273
|
});
|
|
274
|
+
if (manager === "mise") {
|
|
275
|
+
reportUnrefreshedLockfileOnlyChanges(removeUnrefreshedLockfileOnlyChanges(updatedPackageFiles, updatedDeps, results), results, artifactErrors);
|
|
276
|
+
removeSupersededLockFileChanges(updatedPackageFiles, updatedDeps, results);
|
|
277
|
+
}
|
|
238
278
|
processUpdateArtifactResults(results, updatedArtifacts, artifactErrors, artifactNotices);
|
|
239
279
|
if (isNonEmptyArray(results)) await checkForPendingVersions(manager, packageFile.path, packageFile.contents.toString(), updatedDeps, artifactErrors, config);
|
|
240
280
|
}
|
|
@@ -257,6 +297,7 @@ async function getUpdatedPackageFiles(config) {
|
|
|
257
297
|
packageFileName: packageFile.path,
|
|
258
298
|
updatedDeps,
|
|
259
299
|
newPackageFileContent: packageFile.contents.toString(),
|
|
300
|
+
newLockFileContent: getUpdatedLockFileContent(updatedDeps, updatedFileContents),
|
|
260
301
|
config: patchConfigForArtifactsUpdate(config, manager, packageFile.path)
|
|
261
302
|
});
|
|
262
303
|
processUpdateArtifactResults(results, updatedArtifacts, artifactErrors, artifactNotices);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-updated.js","names":[],"sources":["../../../../../lib/workers/repository/update/branch/get-updated.ts"],"sourcesContent":["import { isNonEmptyArray } from '@sindresorhus/is';\nimport { GlobalConfig } from '../../../../config/global.ts';\nimport { WORKER_FILE_UPDATE_FAILED } from '../../../../constants/error-messages.ts';\nimport { logger } from '../../../../logger/index.ts';\nimport { extractPackageFile, get } from '../../../../modules/manager/index.ts';\nimport type {\n ArtifactError,\n ArtifactNotice,\n PackageFile,\n UpdateArtifact,\n UpdateArtifactsConfig,\n UpdateArtifactsResult,\n} from '../../../../modules/manager/types.ts';\nimport { getFile } from '../../../../util/git/index.ts';\nimport type { FileAddition, FileChange } from '../../../../util/git/types.ts';\nimport { coerceString } from '../../../../util/string.ts';\nimport type { BranchConfig, BranchUpgradeConfig } from '../../../types.ts';\nimport { doAutoReplace } from './auto-replace.ts';\n\nexport interface PackageFilesResult {\n artifactErrors: ArtifactError[];\n reuseExistingBranch?: boolean;\n updatedPackageFiles: FileChange[];\n updatedArtifacts: FileChange[];\n artifactNotices: ArtifactNotice[];\n}\n\nasync function getFileContent(\n updatedFileContents: Record<string, string>,\n filePath: string,\n config: BranchConfig,\n): Promise<string | null> {\n let fileContent: string | null = updatedFileContents[filePath];\n if (!fileContent) {\n fileContent = await getFile(\n filePath,\n config.reuseExistingBranch ? config.branchName : config.baseBranch,\n );\n }\n return fileContent;\n}\n\nfunction sortPackageFiles(\n config: BranchConfig,\n manager: string,\n packageFiles: FilePath[],\n): void {\n const managerPackageFiles = config.packageFiles?.[manager];\n if (!managerPackageFiles) {\n return;\n }\n packageFiles.sort((lhs, rhs) => {\n const lhsIndex = managerPackageFiles.findIndex(\n (entry) => entry.packageFile === lhs.path,\n );\n const rhsIndex = managerPackageFiles.findIndex(\n (entry) => entry.packageFile === rhs.path,\n );\n return lhsIndex - rhsIndex;\n });\n}\n\nfunction hasAny(set: Set<string>, targets: Iterable<string>): boolean {\n for (const target of targets) {\n if (set.has(target)) {\n return true;\n }\n }\n return false;\n}\n\ntype FilePath = Pick<FileChange, 'path'>;\n\nfunction getManagersForPackageFiles<T extends FilePath>(\n packageFiles: T[],\n managerPackageFiles: Record<string, Set<string>>,\n): Set<string> {\n const packageFileNames = packageFiles.map((packageFile) => packageFile.path);\n return new Set(\n Object.keys(managerPackageFiles).filter((manager) =>\n hasAny(managerPackageFiles[manager], packageFileNames),\n ),\n );\n}\n\nfunction getPackageFilesForManager<T extends FilePath>(\n packageFiles: T[],\n managerPackageFiles: Set<string>,\n): T[] {\n return packageFiles.filter((packageFile) =>\n managerPackageFiles.has(packageFile.path),\n );\n}\n\nexport async function getUpdatedPackageFiles(\n config: BranchConfig,\n): Promise<PackageFilesResult> {\n logger.trace({ config });\n const reuseExistingBranch = config.reuseExistingBranch!;\n logger.debug(\n `manager.getUpdatedPackageFiles() reuseExistingBranch=${reuseExistingBranch}`,\n );\n let updatedFileContents: Record<string, string> = {};\n const nonUpdatedFileContents: Record<string, string> = {};\n const managerPackageFiles: Record<string, Set<string>> = {};\n const packageFileUpdatedDeps: Record<string, BranchUpgradeConfig[]> = {};\n const lockFileMaintenanceFiles: string[] = [];\n let firstUpdate = true;\n for (const upgrade of config.upgrades) {\n const manager = upgrade.manager;\n const packageFile = upgrade.packageFile!;\n const depName = upgrade.depName!;\n // TODO: fix types, can be undefined (#22198)\n const newVersion = upgrade.newVersion!;\n const currentVersion = upgrade.currentVersion!;\n const updateLockedDependency = get(manager, 'updateLockedDependency')!;\n managerPackageFiles[manager] ??= new Set<string>();\n managerPackageFiles[manager].add(packageFile);\n packageFileUpdatedDeps[packageFile] ??= [];\n packageFileUpdatedDeps[packageFile].push({ ...upgrade });\n const packageFileContent = await getFileContent(\n updatedFileContents,\n packageFile,\n config,\n );\n let lockFileContent: string | null = null;\n const lockFile = upgrade.lockFile ?? upgrade.lockFiles?.[0] ?? '';\n if (lockFile) {\n lockFileContent = await getFileContent(\n updatedFileContents,\n lockFile,\n config,\n );\n }\n // istanbul ignore if\n if (\n reuseExistingBranch &&\n (!packageFileContent || (lockFile && !lockFileContent))\n ) {\n logger.debug(\n { packageFile, depName },\n 'Rebasing branch after file not found',\n );\n return getUpdatedPackageFiles({\n ...config,\n reuseExistingBranch: false,\n });\n }\n if (upgrade.updateType === 'lockFileMaintenance') {\n lockFileMaintenanceFiles.push(packageFile);\n } else if (upgrade.isRemediation) {\n const { status, files } = await updateLockedDependency({\n ...upgrade,\n depName,\n newVersion,\n currentVersion,\n packageFile,\n packageFileContent: packageFileContent!,\n lockFile,\n lockFileContent: lockFileContent!,\n allowParentUpdates: true,\n allowHigherOrRemoved: true,\n });\n if (reuseExistingBranch && status !== 'already-updated') {\n logger.debug(\n { lockFile, depName, status },\n 'Need to retry branch as it is not already up-to-date',\n );\n return getUpdatedPackageFiles({\n ...config,\n reuseExistingBranch: false,\n });\n }\n if (files) {\n updatedFileContents = { ...updatedFileContents, ...files };\n Object.keys(files).forEach(\n (file) => delete nonUpdatedFileContents[file],\n );\n }\n if (status === 'update-failed' || status === 'unsupported') {\n upgrade.remediationNotPossible = true;\n }\n } else if (upgrade.isLockfileUpdate) {\n if (updateLockedDependency) {\n const { status, files } = await updateLockedDependency({\n ...upgrade,\n depName,\n newVersion,\n currentVersion,\n packageFile,\n packageFileContent: packageFileContent!,\n lockFile,\n lockFileContent: lockFileContent!,\n allowParentUpdates: false,\n });\n if (status === 'unsupported') {\n // incompatible lock file\n if (!updatedFileContents[packageFile]) {\n nonUpdatedFileContents[packageFile] = packageFileContent!;\n }\n } else if (status === 'already-updated') {\n logger.debug(\n `Upgrade of ${depName} to ${newVersion} is already done in existing branch`,\n );\n } else {\n // something changed\n if (reuseExistingBranch) {\n logger.debug(\n { lockFile, depName, status },\n 'Need to retry branch as upgrade requirements are not mets',\n );\n return getUpdatedPackageFiles({\n ...config,\n reuseExistingBranch: false,\n });\n }\n if (files) {\n updatedFileContents = { ...updatedFileContents, ...files };\n Object.keys(files).forEach(\n (file) => delete nonUpdatedFileContents[file],\n );\n }\n }\n } else {\n logger.debug(\n { manager },\n 'isLockFileUpdate without updateLockedDependency',\n );\n if (!updatedFileContents[packageFile]) {\n nonUpdatedFileContents[packageFile] = packageFileContent!;\n }\n }\n } else {\n const updateDependency = get(manager, 'updateDependency');\n if (!updateDependency) {\n let res = await doAutoReplace(\n upgrade,\n packageFileContent!,\n reuseExistingBranch,\n firstUpdate,\n );\n firstUpdate = false;\n if (res) {\n res = await applyManagerBumpPackageVersion(res, upgrade);\n if (res === packageFileContent) {\n logger.debug({ packageFile, depName }, 'No content changed');\n } else {\n logger.debug({ packageFile, depName }, 'Contents updated');\n updatedFileContents[packageFile] = res!;\n delete nonUpdatedFileContents[packageFile];\n }\n continue;\n } else if (reuseExistingBranch) {\n return getUpdatedPackageFiles({\n ...config,\n reuseExistingBranch: false,\n });\n }\n logger.error({ packageFile, depName }, 'Could not autoReplace');\n throw new Error(WORKER_FILE_UPDATE_FAILED);\n }\n let newContent = await updateDependency({\n packageFile,\n fileContent: packageFileContent!,\n upgrade,\n });\n newContent = await applyManagerBumpPackageVersion(newContent, upgrade);\n if (!newContent) {\n if (reuseExistingBranch) {\n logger.debug(\n { packageFile, depName },\n 'Rebasing branch after error updating content',\n );\n return getUpdatedPackageFiles({\n ...config,\n reuseExistingBranch: false,\n });\n }\n logger.debug(\n { existingContent: packageFileContent, config: upgrade },\n 'Error updating file',\n );\n throw new Error(WORKER_FILE_UPDATE_FAILED);\n }\n if (newContent !== packageFileContent) {\n if (reuseExistingBranch) {\n // This ensure it's always 1 commit from Renovate\n logger.debug(\n { packageFile, depName },\n 'Need to update package file so will rebase first',\n );\n return getUpdatedPackageFiles({\n ...config,\n reuseExistingBranch: false,\n });\n }\n logger.debug(\n `Updating ${depName} in ${coerceString(packageFile, lockFile)}`,\n );\n updatedFileContents[packageFile] = newContent;\n delete nonUpdatedFileContents[packageFile];\n }\n if (\n newContent === packageFileContent &&\n upgrade.manager === 'git-submodules'\n ) {\n updatedFileContents[packageFile] = newContent;\n delete nonUpdatedFileContents[packageFile];\n }\n }\n }\n const updatedPackageFiles: FileAddition[] = Object.keys(\n updatedFileContents,\n ).map((name) => ({\n type: 'addition',\n path: name,\n contents: updatedFileContents[name],\n }));\n const updatedArtifacts: FileChange[] = [];\n const artifactErrors: ArtifactError[] = [];\n const artifactNotices: ArtifactNotice[] = [];\n if (isNonEmptyArray(updatedPackageFiles)) {\n logger.debug('updateArtifacts for updatedPackageFiles');\n const updatedPackageFileManagers = getManagersForPackageFiles(\n updatedPackageFiles,\n managerPackageFiles,\n );\n for (const manager of updatedPackageFileManagers) {\n const packageFilesForManager = getPackageFilesForManager(\n updatedPackageFiles,\n managerPackageFiles[manager],\n );\n sortPackageFiles(config, manager, packageFilesForManager);\n for (const packageFile of packageFilesForManager) {\n const updatedDeps = packageFileUpdatedDeps[packageFile.path];\n const results = await managerUpdateArtifacts(manager, {\n packageFileName: packageFile.path,\n updatedDeps,\n // TODO #22198\n newPackageFileContent: packageFile.contents!.toString(),\n config: patchConfigForArtifactsUpdate(\n config,\n manager,\n packageFile.path,\n ),\n });\n processUpdateArtifactResults(\n results,\n updatedArtifacts,\n artifactErrors,\n artifactNotices,\n );\n if (isNonEmptyArray(results)) {\n await checkForPendingVersions(\n manager,\n packageFile.path,\n packageFile.contents!.toString(),\n updatedDeps,\n artifactErrors,\n config,\n );\n }\n }\n }\n }\n const nonUpdatedPackageFiles: FileAddition[] = Object.keys(\n nonUpdatedFileContents,\n ).map((name) => ({\n type: 'addition',\n path: name,\n contents: nonUpdatedFileContents[name],\n }));\n if (isNonEmptyArray(nonUpdatedPackageFiles)) {\n logger.debug('updateArtifacts for nonUpdatedPackageFiles');\n const nonUpdatedPackageFileManagers = getManagersForPackageFiles(\n nonUpdatedPackageFiles,\n managerPackageFiles,\n );\n for (const manager of nonUpdatedPackageFileManagers) {\n const packageFilesForManager = getPackageFilesForManager(\n nonUpdatedPackageFiles,\n managerPackageFiles[manager],\n );\n sortPackageFiles(config, manager, packageFilesForManager);\n for (const packageFile of packageFilesForManager) {\n const updatedDeps = packageFileUpdatedDeps[packageFile.path];\n const results = await managerUpdateArtifacts(manager, {\n packageFileName: packageFile.path,\n updatedDeps,\n // TODO #22198\n newPackageFileContent: packageFile.contents!.toString(),\n config: patchConfigForArtifactsUpdate(\n config,\n manager,\n packageFile.path,\n ),\n });\n processUpdateArtifactResults(\n results,\n updatedArtifacts,\n artifactErrors,\n artifactNotices,\n );\n if (isNonEmptyArray(results)) {\n updatedPackageFiles.push(packageFile);\n await checkForPendingVersions(\n manager,\n packageFile.path,\n packageFile.contents!.toString(),\n updatedDeps,\n artifactErrors,\n config,\n );\n }\n }\n }\n }\n if (!reuseExistingBranch) {\n const lockFileMaintenancePackageFiles: FilePath[] =\n lockFileMaintenanceFiles.map((name) => ({\n path: name,\n }));\n // Only perform lock file maintenance if it's a fresh commit\n if (isNonEmptyArray(lockFileMaintenanceFiles)) {\n logger.debug('updateArtifacts for lockFileMaintenanceFiles');\n const lockFileMaintenanceManagers = getManagersForPackageFiles(\n lockFileMaintenancePackageFiles,\n managerPackageFiles,\n );\n for (const manager of lockFileMaintenanceManagers) {\n const packageFilesForManager = getPackageFilesForManager(\n lockFileMaintenancePackageFiles,\n managerPackageFiles[manager],\n );\n sortPackageFiles(config, manager, packageFilesForManager);\n for (const packageFile of packageFilesForManager) {\n const contents =\n updatedFileContents[packageFile.path] ||\n (await getFile(packageFile.path, config.baseBranch));\n const results = await managerUpdateArtifacts(manager, {\n packageFileName: packageFile.path,\n updatedDeps: [],\n newPackageFileContent: contents!,\n config: patchConfigForArtifactsUpdate(\n config,\n manager,\n packageFile.path,\n ),\n });\n processUpdateArtifactResults(\n results,\n updatedArtifacts,\n artifactErrors,\n artifactNotices,\n );\n }\n }\n }\n }\n return {\n reuseExistingBranch, // Need to overwrite original config\n updatedPackageFiles,\n updatedArtifacts,\n artifactErrors,\n artifactNotices,\n };\n}\n\n// workaround, see #27319\nfunction patchConfigForArtifactsUpdate(\n config: BranchConfig,\n manager: string,\n packageFileName: string,\n): UpdateArtifactsConfig {\n // drop any lockFiles that happen to be defined on the branch config\n const updatedConfig = { ...config };\n delete updatedConfig.lockFiles;\n if (isNonEmptyArray(updatedConfig.packageFiles?.[manager])) {\n const managerPackageFiles: PackageFile[] =\n updatedConfig.packageFiles?.[manager];\n const packageFile = managerPackageFiles.find(\n (p) => p.packageFile === packageFileName,\n );\n if (packageFile && isNonEmptyArray(packageFile.lockFiles)) {\n updatedConfig.lockFiles = packageFile.lockFiles;\n }\n }\n return updatedConfig;\n}\n\nasync function managerUpdateArtifacts(\n manager: string,\n updateArtifact: UpdateArtifact,\n): Promise<UpdateArtifactsResult[] | null> {\n const updateArtifacts = get(manager, 'updateArtifacts');\n if (!updateArtifacts) {\n return null;\n }\n\n if (updateArtifact.config.skipArtifactsUpdate) {\n logger.debug(\n { manager, packageFileName: updateArtifact.packageFileName },\n 'Skipping artifact update',\n );\n return null;\n }\n\n return await updateArtifacts(updateArtifact);\n}\n\nfunction processUpdateArtifactResults(\n results: UpdateArtifactsResult[] | null,\n updatedArtifacts: FileChange[],\n artifactErrors: ArtifactError[],\n artifactNotices: ArtifactNotice[],\n): void {\n if (isNonEmptyArray(results)) {\n for (const res of results) {\n const { file, notice, artifactError } = res;\n if (file) {\n updatedArtifacts.push(file);\n }\n\n if (artifactError) {\n artifactErrors.push(artifactError);\n }\n\n if (notice) {\n artifactNotices.push(notice);\n }\n }\n }\n}\n\n/**\n * When using Minimum Release Age, and a package manager that doesn't support being told an explicit version to update to (#41624) it is possible that an artifact update leads to a different version of a dependency being used compared to what Renovate is expecting.\n *\n * We should report these cases more explicitly with an Artifact Error, to allow the reviewers to decide what to do with the changes.\n */\nasync function checkForPendingVersions(\n manager: string,\n packageFileName: string,\n packageFileContent: string,\n updatedDeps: BranchUpgradeConfig[],\n artifactErrors: ArtifactError[],\n config: BranchConfig,\n): Promise<void> {\n const depNameToUpgradeInfo = new Map<\n string,\n {\n pendingVersions: Set<string>;\n newVersion: string | undefined;\n }\n >();\n for (const dep of updatedDeps) {\n if (dep.depName && isNonEmptyArray(dep.pendingVersions)) {\n depNameToUpgradeInfo.set(dep.depName, {\n pendingVersions: new Set(dep.pendingVersions),\n newVersion: dep.newVersion,\n });\n }\n }\n if (!depNameToUpgradeInfo.size) {\n return;\n }\n\n const extracted = await extractPackageFile(\n manager,\n packageFileContent,\n packageFileName,\n config,\n );\n if (!extracted) {\n logger.warn(\n { packageFile: packageFileName, manager },\n 'Could not re-extract the packageFile after updating it',\n );\n return;\n }\n\n for (const dep of extracted.deps) {\n const depName = dep.depName ?? dep.packageName;\n // shouldn't ever happen\n if (!depName) {\n logger.error(\n {\n packageFile: packageFileName,\n manager,\n branchName: config.branchName,\n depName: dep.depName,\n },\n 'No depName found after updating package file',\n );\n throw new Error(WORKER_FILE_UPDATE_FAILED);\n }\n\n const upgradeInfo = depNameToUpgradeInfo.get(depName);\n if (!upgradeInfo) {\n continue;\n }\n const resolvedVersion =\n dep.lockedVersion ??\n dep.newVersion ??\n dep.currentVersion ??\n dep.currentValue;\n if (!resolvedVersion) {\n logger.warn(\n {\n packageFile: packageFileName,\n manager,\n branchName: config.branchName,\n depName,\n },\n 'Could not determine resolved version after updating package file; skipping pending-version check',\n );\n continue;\n }\n\n if (resolvedVersion && upgradeInfo.pendingVersions.has(resolvedVersion)) {\n const expectedVersion = upgradeInfo.newVersion;\n /* v8 ignore next if -- should not happen */\n if (!expectedVersion) {\n logger.error(\n {\n packageFile: packageFileName,\n manager,\n branchName: config.branchName,\n depName,\n newVersion: resolvedVersion,\n expectedVersion,\n },\n 'No expectedVersion found after updating package file',\n );\n continue;\n }\n\n if (config.minimumReleaseAgeBehaviour === 'timestamp-optional') {\n logger.once.warn(\n {\n packageFileName,\n depName,\n expectedVersion,\n resolvedVersion,\n },\n \"Artifact error would be reported due to a pending version in use which hasn't passed Minimum Release Age, but as we're running with minimumReleaseAgeBehaviour=timestamp-optional, proceeding. See debug logs for more information\",\n );\n continue;\n }\n\n logger.debug(\n {\n packageFileName,\n depName,\n expectedVersion,\n resolvedVersion,\n },\n 'Artifact update introduced a pending version',\n );\n let stderr = `Artifact update for ${depName} resolved to version ${resolvedVersion}, which is a pending version that has not yet passed the Minimum Release Age threshold.`;\n stderr += `\\nRenovate was attempting to update to ${expectedVersion}`;\n stderr += `\\nThis is (likely) not a bug in Renovate, but due to the way your project pins dependencies, _and_ how Renovate calls your package manager to update them.\\nUntil Renovate supports specifying an exact update to your package manager (https://github.com/renovatebot/renovate/issues/41624), it is recommended to directly pin your dependencies (with \\`rangeStrategy=pin\\` for apps, or \\`rangeStrategy=widen\\` for libraries)\\nSee also: ${GlobalConfig.get('productLinks').documentation}dependency-pinning/`;\n\n artifactErrors.push({\n fileName: packageFileName,\n stderr,\n });\n }\n }\n}\n\nasync function applyManagerBumpPackageVersion(\n packageFileContent: string | null,\n upgrade: BranchUpgradeConfig,\n): Promise<string | null> {\n const bumpPackageVersion = get(upgrade.manager, 'bumpPackageVersion');\n if (\n !bumpPackageVersion ||\n !packageFileContent ||\n !upgrade.bumpVersion ||\n !upgrade.packageFileVersion\n ) {\n return packageFileContent;\n }\n\n const result = await bumpPackageVersion(\n packageFileContent,\n upgrade.packageFileVersion,\n upgrade.bumpVersion,\n upgrade.packageFile!,\n );\n\n return result.bumpedContent;\n}\n"],"mappings":";;;;;;;;;AA2BA,eAAe,eACb,qBACA,UACA,QACwB;CACxB,IAAI,cAA6B,oBAAoB;CACrD,IAAI,CAAC,aACH,cAAc,MAAM,QAClB,UACA,OAAO,sBA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ACwB;CACxB,MAAM,qBAAqB,IAAI,QAAQ,SAAS,oBAAoB;CACpE,IACE,CAAC,sBACD,CAAC,sBACD,CAAC,QAAQ,eACT,CAAC,QAAQ,oBAET,OAAO;CAUT,QAAO,MAPc,mBACnB,oBACA,QAAQ,oBACR,QAAQ,aACR,QAAQ,WACV,EAAA,CAEc;AAChB"}
|
|
1
|
+
{"version":3,"file":"get-updated.js","names":[],"sources":["../../../../../lib/workers/repository/update/branch/get-updated.ts"],"sourcesContent":["import { isNonEmptyArray } from '@sindresorhus/is';\nimport { GlobalConfig } from '../../../../config/global.ts';\nimport { WORKER_FILE_UPDATE_FAILED } from '../../../../constants/error-messages.ts';\nimport { logger } from '../../../../logger/index.ts';\nimport { extractPackageFile, get } from '../../../../modules/manager/index.ts';\nimport type {\n ArtifactError,\n ArtifactNotice,\n PackageFile,\n UpdateArtifact,\n UpdateArtifactsConfig,\n UpdateArtifactsResult,\n} from '../../../../modules/manager/types.ts';\nimport { coerceArray } from '../../../../util/array.ts';\nimport { getFile } from '../../../../util/git/index.ts';\nimport type { FileAddition, FileChange } from '../../../../util/git/types.ts';\nimport { coerceString } from '../../../../util/string.ts';\nimport type { BranchConfig, BranchUpgradeConfig } from '../../../types.ts';\nimport { doAutoReplace } from './auto-replace.ts';\n\nexport interface PackageFilesResult {\n artifactErrors: ArtifactError[];\n reuseExistingBranch?: boolean;\n updatedPackageFiles: FileChange[];\n updatedArtifacts: FileChange[];\n artifactNotices: ArtifactNotice[];\n}\n\nasync function getFileContent(\n updatedFileContents: Record<string, string>,\n filePath: string,\n config: BranchConfig,\n): Promise<string | null> {\n let fileContent: string | null = updatedFileContents[filePath];\n if (!fileContent) {\n fileContent = await getFile(\n filePath,\n config.reuseExistingBranch ? config.branchName : config.baseBranch,\n );\n }\n return fileContent;\n}\n\nfunction sortPackageFiles(\n config: BranchConfig,\n manager: string,\n packageFiles: FilePath[],\n): void {\n const managerPackageFiles = config.packageFiles?.[manager];\n if (!managerPackageFiles) {\n return;\n }\n packageFiles.sort((lhs, rhs) => {\n const lhsIndex = managerPackageFiles.findIndex(\n (entry) => entry.packageFile === lhs.path,\n );\n const rhsIndex = managerPackageFiles.findIndex(\n (entry) => entry.packageFile === rhs.path,\n );\n return lhsIndex - rhsIndex;\n });\n}\n\nfunction hasAny(set: Set<string>, targets: Iterable<string>): boolean {\n for (const target of targets) {\n if (set.has(target)) {\n return true;\n }\n }\n return false;\n}\n\nfunction getUpdatedLockFileContent(\n updatedDeps: BranchUpgradeConfig[],\n updatedFileContents: Record<string, string>,\n): string | undefined {\n for (const upgrade of updatedDeps) {\n const lockFiles = [upgrade.lockFile, ...coerceArray(upgrade.lockFiles)];\n for (const lockFile of lockFiles) {\n if (lockFile && updatedFileContents[lockFile] !== undefined) {\n return updatedFileContents[lockFile];\n }\n }\n }\n\n return undefined;\n}\n\nfunction removeUnrefreshedLockfileOnlyChanges(\n packageFiles: FileChange[],\n updatedDeps: BranchUpgradeConfig[],\n results: UpdateArtifactsResult[] | null,\n): string[] {\n const removedLockFiles: string[] = [];\n const refreshedFiles = new Set(\n coerceArray(results).flatMap((result) =>\n result.file ? [result.file.path] : [],\n ),\n );\n const lockFiles = new Set(\n updatedDeps\n .filter((upgrade) => upgrade.isLockfileOnly)\n .flatMap((upgrade) => [\n upgrade.lockFile,\n ...coerceArray(upgrade.lockFiles),\n ]),\n );\n for (let index = packageFiles.length - 1; index >= 0; index -= 1) {\n const path = packageFiles[index].path;\n if (lockFiles.has(path) && !refreshedFiles.has(path)) {\n packageFiles.splice(index, 1);\n removedLockFiles.push(path);\n }\n }\n return removedLockFiles;\n}\n\nfunction reportUnrefreshedLockfileOnlyChanges(\n removedLockFiles: string[],\n results: UpdateArtifactsResult[] | null,\n artifactErrors: ArtifactError[],\n): void {\n const artifactErrorFiles = new Set(\n coerceArray(results).flatMap((result) =>\n result.artifactError ? [result.artifactError.fileName] : [],\n ),\n );\n for (const lockFile of removedLockFiles) {\n if (!artifactErrorFiles.has(lockFile)) {\n artifactErrors.push({\n fileName: lockFile,\n stderr: 'Lockfile-only update could not be refreshed',\n });\n }\n }\n}\n\nfunction removeSupersededLockFileChanges(\n packageFiles: FileChange[],\n updatedDeps: BranchUpgradeConfig[],\n results: UpdateArtifactsResult[] | null,\n): void {\n const artifactFiles = new Set(\n coerceArray(results).flatMap((result) =>\n result.file ? [result.file.path] : [],\n ),\n );\n const lockFiles = new Set(\n updatedDeps\n .filter((upgrade) => upgrade.isLockfileOnly)\n .flatMap((upgrade) => [\n upgrade.lockFile,\n ...coerceArray(upgrade.lockFiles),\n ]),\n );\n for (let index = packageFiles.length - 1; index >= 0; index -= 1) {\n const path = packageFiles[index].path;\n if (lockFiles.has(path) && artifactFiles.has(path)) {\n packageFiles.splice(index, 1);\n }\n }\n}\n\ntype FilePath = Pick<FileChange, 'path'>;\n\nfunction getManagersForPackageFiles<T extends FilePath>(\n packageFiles: T[],\n managerPackageFiles: Record<string, Set<string>>,\n): Set<string> {\n const packageFileNames = packageFiles.map((packageFile) => packageFile.path);\n return new Set(\n Object.keys(managerPackageFiles).filter((manager) =>\n hasAny(managerPackageFiles[manager], packageFileNames),\n ),\n );\n}\n\nfunction getPackageFilesForManager<T extends FilePath>(\n packageFiles: T[],\n managerPackageFiles: Set<string>,\n): T[] {\n return packageFiles.filter((packageFile) =>\n managerPackageFiles.has(packageFile.path),\n );\n}\n\nexport async function getUpdatedPackageFiles(\n config: BranchConfig,\n): Promise<PackageFilesResult> {\n logger.trace({ config });\n const reuseExistingBranch = config.reuseExistingBranch!;\n logger.debug(\n `manager.getUpdatedPackageFiles() reuseExistingBranch=${reuseExistingBranch}`,\n );\n let updatedFileContents: Record<string, string> = {};\n const nonUpdatedFileContents: Record<string, string> = {};\n const managerPackageFiles: Record<string, Set<string>> = {};\n const packageFileUpdatedDeps: Record<string, BranchUpgradeConfig[]> = {};\n const lockFileMaintenanceFiles: string[] = [];\n let firstUpdate = true;\n for (const upgrade of config.upgrades) {\n const manager = upgrade.manager;\n const packageFile = upgrade.packageFile!;\n const depName = upgrade.depName!;\n // TODO: fix types, can be undefined (#22198)\n const newVersion = upgrade.newVersion!;\n const currentVersion = upgrade.currentVersion!;\n const updateLockedDependency = get(manager, 'updateLockedDependency')!;\n managerPackageFiles[manager] ??= new Set<string>();\n managerPackageFiles[manager].add(packageFile);\n packageFileUpdatedDeps[packageFile] ??= [];\n packageFileUpdatedDeps[packageFile].push({ ...upgrade });\n const packageFileContent = await getFileContent(\n updatedFileContents,\n packageFile,\n config,\n );\n let lockFileContent: string | null = null;\n const lockFile = upgrade.lockFile ?? upgrade.lockFiles?.[0] ?? '';\n if (lockFile) {\n lockFileContent = await getFileContent(\n updatedFileContents,\n lockFile,\n config,\n );\n }\n // istanbul ignore if\n if (\n reuseExistingBranch &&\n (!packageFileContent || (lockFile && !lockFileContent))\n ) {\n logger.debug(\n { packageFile, depName },\n 'Rebasing branch after file not found',\n );\n return getUpdatedPackageFiles({\n ...config,\n reuseExistingBranch: false,\n });\n }\n if (upgrade.updateType === 'lockFileMaintenance') {\n lockFileMaintenanceFiles.push(packageFile);\n } else if (upgrade.isRemediation) {\n const { status, files } = await updateLockedDependency({\n ...upgrade,\n depName,\n newVersion,\n currentVersion,\n packageFile,\n packageFileContent: packageFileContent!,\n lockFile,\n lockFileContent: lockFileContent!,\n allowParentUpdates: true,\n allowHigherOrRemoved: true,\n });\n if (reuseExistingBranch && status !== 'already-updated') {\n logger.debug(\n { lockFile, depName, status },\n 'Need to retry branch as it is not already up-to-date',\n );\n return getUpdatedPackageFiles({\n ...config,\n reuseExistingBranch: false,\n });\n }\n if (files) {\n updatedFileContents = { ...updatedFileContents, ...files };\n Object.keys(files).forEach(\n (file) => delete nonUpdatedFileContents[file],\n );\n }\n if (status === 'update-failed' || status === 'unsupported') {\n upgrade.remediationNotPossible = true;\n }\n } else if (upgrade.isLockfileUpdate) {\n if (updateLockedDependency) {\n const { status, files } = await updateLockedDependency({\n ...upgrade,\n depName,\n newVersion,\n currentVersion,\n packageFile,\n packageFileContent: packageFileContent!,\n lockFile,\n lockFileContent: lockFileContent!,\n allowParentUpdates: false,\n });\n if (status === 'unsupported') {\n // incompatible lock file\n if (!updatedFileContents[packageFile]) {\n nonUpdatedFileContents[packageFile] = packageFileContent!;\n }\n } else if (status === 'already-updated') {\n logger.debug(\n `Upgrade of ${depName} to ${newVersion} is already done in existing branch`,\n );\n } else {\n // something changed\n if (reuseExistingBranch) {\n logger.debug(\n { lockFile, depName, status },\n 'Need to retry branch as upgrade requirements are not mets',\n );\n return getUpdatedPackageFiles({\n ...config,\n reuseExistingBranch: false,\n });\n }\n if (files) {\n updatedFileContents = { ...updatedFileContents, ...files };\n Object.keys(files).forEach(\n (file) => delete nonUpdatedFileContents[file],\n );\n }\n }\n } else {\n logger.debug(\n { manager },\n 'isLockFileUpdate without updateLockedDependency',\n );\n if (!updatedFileContents[packageFile]) {\n nonUpdatedFileContents[packageFile] = packageFileContent!;\n }\n }\n } else {\n const updateDependency = get(manager, 'updateDependency');\n if (!updateDependency) {\n let res = await doAutoReplace(\n upgrade,\n packageFileContent!,\n reuseExistingBranch,\n firstUpdate,\n );\n firstUpdate = false;\n if (res) {\n res = await applyManagerBumpPackageVersion(res, upgrade);\n if (res === packageFileContent) {\n logger.debug({ packageFile, depName }, 'No content changed');\n } else {\n logger.debug({ packageFile, depName }, 'Contents updated');\n updatedFileContents[packageFile] = res!;\n delete nonUpdatedFileContents[packageFile];\n }\n continue;\n } else if (reuseExistingBranch) {\n return getUpdatedPackageFiles({\n ...config,\n reuseExistingBranch: false,\n });\n }\n logger.error({ packageFile, depName }, 'Could not autoReplace');\n throw new Error(WORKER_FILE_UPDATE_FAILED);\n }\n let newContent = await updateDependency({\n packageFile,\n fileContent: packageFileContent!,\n upgrade,\n });\n newContent = await applyManagerBumpPackageVersion(newContent, upgrade);\n if (!newContent) {\n if (reuseExistingBranch) {\n logger.debug(\n { packageFile, depName },\n 'Rebasing branch after error updating content',\n );\n return getUpdatedPackageFiles({\n ...config,\n reuseExistingBranch: false,\n });\n }\n logger.debug(\n { existingContent: packageFileContent, config: upgrade },\n 'Error updating file',\n );\n throw new Error(WORKER_FILE_UPDATE_FAILED);\n }\n if (newContent !== packageFileContent) {\n if (reuseExistingBranch) {\n // This ensure it's always 1 commit from Renovate\n logger.debug(\n { packageFile, depName },\n 'Need to update package file so will rebase first',\n );\n return getUpdatedPackageFiles({\n ...config,\n reuseExistingBranch: false,\n });\n }\n logger.debug(\n `Updating ${depName} in ${coerceString(packageFile, lockFile)}`,\n );\n updatedFileContents[packageFile] = newContent;\n delete nonUpdatedFileContents[packageFile];\n }\n if (\n newContent === packageFileContent &&\n upgrade.manager === 'git-submodules'\n ) {\n updatedFileContents[packageFile] = newContent;\n delete nonUpdatedFileContents[packageFile];\n }\n }\n }\n const updatedPackageFiles: FileAddition[] = Object.keys(\n updatedFileContents,\n ).map((name) => ({\n type: 'addition',\n path: name,\n contents: updatedFileContents[name],\n }));\n const updatedArtifacts: FileChange[] = [];\n const artifactErrors: ArtifactError[] = [];\n const artifactNotices: ArtifactNotice[] = [];\n if (isNonEmptyArray(updatedPackageFiles)) {\n logger.debug('updateArtifacts for updatedPackageFiles');\n const updatedPackageFileManagers = getManagersForPackageFiles(\n updatedPackageFiles,\n managerPackageFiles,\n );\n for (const manager of updatedPackageFileManagers) {\n const packageFilesForManager = getPackageFilesForManager(\n updatedPackageFiles,\n managerPackageFiles[manager],\n );\n sortPackageFiles(config, manager, packageFilesForManager);\n for (const packageFile of packageFilesForManager) {\n const updatedDeps = packageFileUpdatedDeps[packageFile.path];\n const results = await managerUpdateArtifacts(manager, {\n packageFileName: packageFile.path,\n updatedDeps,\n // TODO #22198\n newPackageFileContent: packageFile.contents!.toString(),\n newLockFileContent: getUpdatedLockFileContent(\n updatedDeps,\n updatedFileContents,\n ),\n config: patchConfigForArtifactsUpdate(\n config,\n manager,\n packageFile.path,\n ),\n });\n if (manager === 'mise') {\n const removedLockFiles = removeUnrefreshedLockfileOnlyChanges(\n updatedPackageFiles,\n updatedDeps,\n results,\n );\n reportUnrefreshedLockfileOnlyChanges(\n removedLockFiles,\n results,\n artifactErrors,\n );\n removeSupersededLockFileChanges(\n updatedPackageFiles,\n updatedDeps,\n results,\n );\n }\n processUpdateArtifactResults(\n results,\n updatedArtifacts,\n artifactErrors,\n artifactNotices,\n );\n if (isNonEmptyArray(results)) {\n await checkForPendingVersions(\n manager,\n packageFile.path,\n packageFile.contents!.toString(),\n updatedDeps,\n artifactErrors,\n config,\n );\n }\n }\n }\n }\n const nonUpdatedPackageFiles: FileAddition[] = Object.keys(\n nonUpdatedFileContents,\n ).map((name) => ({\n type: 'addition',\n path: name,\n contents: nonUpdatedFileContents[name],\n }));\n if (isNonEmptyArray(nonUpdatedPackageFiles)) {\n logger.debug('updateArtifacts for nonUpdatedPackageFiles');\n const nonUpdatedPackageFileManagers = getManagersForPackageFiles(\n nonUpdatedPackageFiles,\n managerPackageFiles,\n );\n for (const manager of nonUpdatedPackageFileManagers) {\n const packageFilesForManager = getPackageFilesForManager(\n nonUpdatedPackageFiles,\n managerPackageFiles[manager],\n );\n sortPackageFiles(config, manager, packageFilesForManager);\n for (const packageFile of packageFilesForManager) {\n const updatedDeps = packageFileUpdatedDeps[packageFile.path];\n const results = await managerUpdateArtifacts(manager, {\n packageFileName: packageFile.path,\n updatedDeps,\n // TODO #22198\n newPackageFileContent: packageFile.contents!.toString(),\n newLockFileContent: getUpdatedLockFileContent(\n updatedDeps,\n updatedFileContents,\n ),\n config: patchConfigForArtifactsUpdate(\n config,\n manager,\n packageFile.path,\n ),\n });\n processUpdateArtifactResults(\n results,\n updatedArtifacts,\n artifactErrors,\n artifactNotices,\n );\n if (isNonEmptyArray(results)) {\n updatedPackageFiles.push(packageFile);\n await checkForPendingVersions(\n manager,\n packageFile.path,\n packageFile.contents!.toString(),\n updatedDeps,\n artifactErrors,\n config,\n );\n }\n }\n }\n }\n if (!reuseExistingBranch) {\n const lockFileMaintenancePackageFiles: FilePath[] =\n lockFileMaintenanceFiles.map((name) => ({\n path: name,\n }));\n // Only perform lock file maintenance if it's a fresh commit\n if (isNonEmptyArray(lockFileMaintenanceFiles)) {\n logger.debug('updateArtifacts for lockFileMaintenanceFiles');\n const lockFileMaintenanceManagers = getManagersForPackageFiles(\n lockFileMaintenancePackageFiles,\n managerPackageFiles,\n );\n for (const manager of lockFileMaintenanceManagers) {\n const packageFilesForManager = getPackageFilesForManager(\n lockFileMaintenancePackageFiles,\n managerPackageFiles[manager],\n );\n sortPackageFiles(config, manager, packageFilesForManager);\n for (const packageFile of packageFilesForManager) {\n const contents =\n updatedFileContents[packageFile.path] ||\n (await getFile(packageFile.path, config.baseBranch));\n const results = await managerUpdateArtifacts(manager, {\n packageFileName: packageFile.path,\n updatedDeps: [],\n newPackageFileContent: contents!,\n config: patchConfigForArtifactsUpdate(\n config,\n manager,\n packageFile.path,\n ),\n });\n processUpdateArtifactResults(\n results,\n updatedArtifacts,\n artifactErrors,\n artifactNotices,\n );\n }\n }\n }\n }\n return {\n reuseExistingBranch, // Need to overwrite original config\n updatedPackageFiles,\n updatedArtifacts,\n artifactErrors,\n artifactNotices,\n };\n}\n\n// workaround, see #27319\nfunction patchConfigForArtifactsUpdate(\n config: BranchConfig,\n manager: string,\n packageFileName: string,\n): UpdateArtifactsConfig {\n // drop any lockFiles that happen to be defined on the branch config\n const updatedConfig = { ...config };\n delete updatedConfig.lockFiles;\n if (isNonEmptyArray(updatedConfig.packageFiles?.[manager])) {\n const managerPackageFiles: PackageFile[] =\n updatedConfig.packageFiles?.[manager];\n const packageFile = managerPackageFiles.find(\n (p) => p.packageFile === packageFileName,\n );\n if (packageFile && isNonEmptyArray(packageFile.lockFiles)) {\n updatedConfig.lockFiles = packageFile.lockFiles;\n }\n }\n return updatedConfig;\n}\n\nasync function managerUpdateArtifacts(\n manager: string,\n updateArtifact: UpdateArtifact,\n): Promise<UpdateArtifactsResult[] | null> {\n const updateArtifacts = get(manager, 'updateArtifacts');\n if (!updateArtifacts) {\n return null;\n }\n\n if (updateArtifact.config.skipArtifactsUpdate) {\n logger.debug(\n { manager, packageFileName: updateArtifact.packageFileName },\n 'Skipping artifact update',\n );\n return null;\n }\n\n return await updateArtifacts(updateArtifact);\n}\n\nfunction processUpdateArtifactResults(\n results: UpdateArtifactsResult[] | null,\n updatedArtifacts: FileChange[],\n artifactErrors: ArtifactError[],\n artifactNotices: ArtifactNotice[],\n): void {\n if (isNonEmptyArray(results)) {\n for (const res of results) {\n const { file, notice, artifactError } = res;\n if (file) {\n updatedArtifacts.push(file);\n }\n\n if (artifactError) {\n artifactErrors.push(artifactError);\n }\n\n if (notice) {\n artifactNotices.push(notice);\n }\n }\n }\n}\n\n/**\n * When using Minimum Release Age, and a package manager that doesn't support being told an explicit version to update to (#41624) it is possible that an artifact update leads to a different version of a dependency being used compared to what Renovate is expecting.\n *\n * We should report these cases more explicitly with an Artifact Error, to allow the reviewers to decide what to do with the changes.\n */\nasync function checkForPendingVersions(\n manager: string,\n packageFileName: string,\n packageFileContent: string,\n updatedDeps: BranchUpgradeConfig[],\n artifactErrors: ArtifactError[],\n config: BranchConfig,\n): Promise<void> {\n const depNameToUpgradeInfo = new Map<\n string,\n {\n pendingVersions: Set<string>;\n newVersion: string | undefined;\n }\n >();\n for (const dep of updatedDeps) {\n if (dep.depName && isNonEmptyArray(dep.pendingVersions)) {\n depNameToUpgradeInfo.set(dep.depName, {\n pendingVersions: new Set(dep.pendingVersions),\n newVersion: dep.newVersion,\n });\n }\n }\n if (!depNameToUpgradeInfo.size) {\n return;\n }\n\n const extracted = await extractPackageFile(\n manager,\n packageFileContent,\n packageFileName,\n config,\n );\n if (!extracted) {\n logger.warn(\n { packageFile: packageFileName, manager },\n 'Could not re-extract the packageFile after updating it',\n );\n return;\n }\n\n for (const dep of extracted.deps) {\n const depName = dep.depName ?? dep.packageName;\n // shouldn't ever happen\n if (!depName) {\n logger.error(\n {\n packageFile: packageFileName,\n manager,\n branchName: config.branchName,\n depName: dep.depName,\n },\n 'No depName found after updating package file',\n );\n throw new Error(WORKER_FILE_UPDATE_FAILED);\n }\n\n const upgradeInfo = depNameToUpgradeInfo.get(depName);\n if (!upgradeInfo) {\n continue;\n }\n const resolvedVersion =\n dep.lockedVersion ??\n dep.newVersion ??\n dep.currentVersion ??\n dep.currentValue;\n if (!resolvedVersion) {\n logger.warn(\n {\n packageFile: packageFileName,\n manager,\n branchName: config.branchName,\n depName,\n },\n 'Could not determine resolved version after updating package file; skipping pending-version check',\n );\n continue;\n }\n\n if (resolvedVersion && upgradeInfo.pendingVersions.has(resolvedVersion)) {\n const expectedVersion = upgradeInfo.newVersion;\n /* v8 ignore next if -- should not happen */\n if (!expectedVersion) {\n logger.error(\n {\n packageFile: packageFileName,\n manager,\n branchName: config.branchName,\n depName,\n newVersion: resolvedVersion,\n expectedVersion,\n },\n 'No expectedVersion found after updating package file',\n );\n continue;\n }\n\n if (config.minimumReleaseAgeBehaviour === 'timestamp-optional') {\n logger.once.warn(\n {\n packageFileName,\n depName,\n expectedVersion,\n resolvedVersion,\n },\n \"Artifact error would be reported due to a pending version in use which hasn't passed Minimum Release Age, but as we're running with minimumReleaseAgeBehaviour=timestamp-optional, proceeding. See debug logs for more information\",\n );\n continue;\n }\n\n logger.debug(\n {\n packageFileName,\n depName,\n expectedVersion,\n resolvedVersion,\n },\n 'Artifact update introduced a pending version',\n );\n let stderr = `Artifact update for ${depName} resolved to version ${resolvedVersion}, which is a pending version that has not yet passed the Minimum Release Age threshold.`;\n stderr += `\\nRenovate was attempting to update to ${expectedVersion}`;\n stderr += `\\nThis is (likely) not a bug in Renovate, but due to the way your project pins dependencies, _and_ how Renovate calls your package manager to update them.\\nUntil Renovate supports specifying an exact update to your package manager (https://github.com/renovatebot/renovate/issues/41624), it is recommended to directly pin your dependencies (with \\`rangeStrategy=pin\\` for apps, or \\`rangeStrategy=widen\\` for libraries)\\nSee also: ${GlobalConfig.get('productLinks').documentation}dependency-pinning/`;\n\n artifactErrors.push({\n fileName: packageFileName,\n stderr,\n });\n }\n }\n}\n\nasync function applyManagerBumpPackageVersion(\n packageFileContent: string | null,\n upgrade: BranchUpgradeConfig,\n): Promise<string | null> {\n const bumpPackageVersion = get(upgrade.manager, 'bumpPackageVersion');\n if (\n !bumpPackageVersion ||\n !packageFileContent ||\n !upgrade.bumpVersion ||\n !upgrade.packageFileVersion\n ) {\n return packageFileContent;\n }\n\n const result = await bumpPackageVersion(\n packageFileContent,\n upgrade.packageFileVersion,\n upgrade.bumpVersion,\n upgrade.packageFile!,\n );\n\n return result.bumpedContent;\n}\n"],"mappings":";;;;;;;;;;AA4BA,eAAe,eACb,qBACA,UACA,QACwB;CACxB,IAAI,cAA6B,oBAAoB;CACrD,IAAI,CAAC,aACH,cAAc,MAAM,QAClB,UACA,OAAO,sBAAsB,OAAO,aAAa,OAAO,UAC1D;CAEF,OAAO;AACT;AAEA,SAAS,iBACP,QACA,SACA,cACM;CACN,MAAM,sBAAsB,OAAO,eAAe;CAClD,IAAI,CAAC,qBACH;CAEF,aAAa,MAAM,KAAK,QAAQ;EAO9B,OANiB,oBAAoB,WAClC,UAAU,MAAM,gBAAgB,IAAI,IAKzB,IAHG,oBAAoB,WAClC,UAAU,MAAM,gBAAgB,IAAI,IAEd;CAC3B,CAAC;AACH;AAEA,SAAS,OAAO,KAAkB,SAAoC;CACpE,KAAK,MAAM,UAAU,SACnB,IAAI,IAAI,IAAI,MAAM,GAChB,OAAO;CAGX,OAAO;AACT;AAEA,SAAS,0BACP,aACA,qBACoB;CACpB,KAAK,MAAM,WAAW,aAAa;EACjC,MAAM,YAAY,CAAC,QAAQ,UAAU,GAAG,YAAY,QAAQ,SAAS,CAAC;EACtE,KAAK,MAAM,YAAY,WACrB,IAAI,YAAY,oBAAoB,cAAc,KAAA,GAChD,OAAO,oBAAoB;CAGjC;AAGF;AAEA,SAAS,qCACP,cACA,aACA,SACU;CACV,MAAM,mBAA6B,CAAC;CACpC,MAAM,iBAAiB,IAAI,IACzB,YAAY,OAAO,CAAC,CAAC,SAAS,WAC5B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
|
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": "44.
|
|
4
|
+
"version": "44.89.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"renovate": "dist/renovate.js",
|
|
@@ -354,6 +354,7 @@
|
|
|
354
354
|
"type-check": "run-s 'generate:*' 'tsc --noEmit {@}' --",
|
|
355
355
|
"update-static-data": "run-s 'update-static-data:*'",
|
|
356
356
|
"update-static-data:distro-info": "node tools/static-data/generate-distro-info.mjs",
|
|
357
|
+
"update-static-data:java-lts-versions": "node tools/static-data/generate-java-lts-versions.ts",
|
|
357
358
|
"update-static-data:lambda-node-schedule": "node tools/static-data/generate-lambda-node-schedule.mjs",
|
|
358
359
|
"update-static-data:mise-registry": "node tools/static-data/generate-mise-registry.ts",
|
|
359
360
|
"update-static-data:node-schedule": "node tools/static-data/generate-node-schedule.mjs"
|
package/renovate-schema.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$id": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
-
"title": "JSON schema for Renovate 44.
|
|
3
|
+
"title": "JSON schema for Renovate 44.89.0 config files (https://renovatebot.com/)",
|
|
4
4
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
-
"x-renovate-version": "44.
|
|
5
|
+
"x-renovate-version": "44.89.0",
|
|
6
6
|
"allowComments": true,
|
|
7
7
|
"type": "object",
|
|
8
8
|
"definitions": {
|