renovate 39.76.0 → 39.78.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/config/options/index.js +1 -0
- package/dist/config/options/index.js.map +1 -1
- package/dist/config/presets/internal/group.js +2 -1
- package/dist/config/presets/internal/group.js.map +1 -1
- package/dist/config/types.d.ts +2 -0
- package/dist/config/types.js.map +1 -1
- package/dist/modules/datasource/go/releases-goproxy.js +9 -1
- package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
- package/dist/modules/manager/bazel-module/index.js +1 -1
- package/dist/modules/manager/bazel-module/index.js.map +1 -1
- package/dist/modules/manager/fingerprint.generated.js +1 -1
- package/dist/modules/manager/fingerprint.generated.js.map +1 -1
- package/dist/modules/manager/gomod/artifacts.js +3 -2
- package/dist/modules/manager/gomod/artifacts.js.map +1 -1
- package/dist/modules/manager/npm/post-update/index.js +1 -1
- package/dist/modules/manager/npm/post-update/index.js.map +1 -1
- package/dist/modules/versioning/api.js +2 -0
- package/dist/modules/versioning/api.js.map +1 -1
- package/dist/modules/versioning/devbox/index.d.ts +7 -0
- package/dist/modules/versioning/devbox/index.js +65 -0
- package/dist/modules/versioning/devbox/index.js.map +1 -0
- package/dist/workers/global/config/parse/env.js +1 -1
- package/dist/workers/global/config/parse/env.js.map +1 -1
- package/dist/workers/repository/init/vulnerability.js +3 -3
- package/dist/workers/repository/init/vulnerability.js.map +1 -1
- package/dist/workers/repository/onboarding/branch/index.js +1 -1
- package/dist/workers/repository/onboarding/branch/index.js.map +1 -1
- package/dist/workers/repository/process/extract-update.js +1 -1
- package/dist/workers/repository/process/extract-update.js.map +1 -1
- package/package.json +7 -7
- package/renovate-schema.json +3 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/gomod/artifacts.ts"],"names":[],"mappings":";;AAoHA,0CAwUC;;AA5bD,kEAAkC;AAClC,4DAA4B;AAC5B,iCAA8B;AAC9B,0DAA0B;AAC1B,mDAAsD;AACtD,sEAAoE;AACpE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AC;QAC3B,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,qBAAqB;QACrB,IAAI,GAAG,CAAC,OAAO,KAAK,gCAAe,EAAE,CAAC;YACpC,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,yBAAyB,CAAC,CAAC;QACjD,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,WAAW;oBACrB,MAAM,EAAE,GAAG,CAAC,OAAO;iBACpB;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,gBAAgB,CAC7B,aAAqB;IAErB,MAAM,OAAO,GAAG,CAAC,MAAM,IAAA,kBAAa,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC;IACrE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,EAAE,GAAG,IAAA,aAAK,EAAC,4BAA4B,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;AAClC,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport semver from 'semver';\nimport { quote } from 'shlex';\nimport upath from 'upath';\nimport { GlobalConfig } from '../../../config/global';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { coerceArray } from '../../../util/array';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions } from '../../../util/exec/types';\nimport { filterMap } from '../../../util/filter-map';\nimport {\n ensureCacheDir,\n findLocalSiblingOrParent,\n isValidLocalPath,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport { getRepoStatus } from '../../../util/git';\nimport { getGitEnvironmentVariables } from '../../../util/git/auth';\nimport { regEx } from '../../../util/regex';\nimport { isValid } from '../../versioning/semver';\nimport type {\n PackageDependency,\n UpdateArtifact,\n UpdateArtifactsConfig,\n UpdateArtifactsResult,\n} from '../types';\nimport { getExtraDepsNotice } from './artifacts-extra';\n\nconst { major, valid } = semver;\n\nfunction getUpdateImportPathCmds(\n updatedDeps: PackageDependency[],\n { constraints }: UpdateArtifactsConfig,\n): string[] {\n // Check if we fail to parse any major versions and log that they're skipped\n const invalidMajorDeps = updatedDeps.filter(\n ({ newVersion }) => !valid(newVersion),\n );\n if (invalidMajorDeps.length > 0) {\n invalidMajorDeps.forEach(({ depName }) =>\n logger.warn(\n { depName },\n 'Ignoring dependency: Could not get major version',\n ),\n );\n }\n\n const updateImportCommands = updatedDeps\n .filter(\n ({ newVersion }) =>\n valid(newVersion) && !newVersion!.endsWith('+incompatible'),\n )\n .map(({ depName, newVersion }) => ({\n depName: depName!,\n newMajor: major(newVersion!),\n }))\n // Skip path updates going from v0 to v1\n .filter(\n ({ depName, newMajor }) =>\n depName.startsWith('gopkg.in/') || newMajor > 1,\n )\n\n .map(\n ({ depName, newMajor }) =>\n `mod upgrade --mod-name=${depName} -t=${newMajor}`,\n );\n\n if (updateImportCommands.length > 0) {\n let installMarwanModArgs =\n 'install github.com/marwan-at-work/mod/cmd/mod@latest';\n const gomodModCompatibility = constraints?.gomodMod;\n if (gomodModCompatibility) {\n if (\n gomodModCompatibility.startsWith('v') &&\n isValid(gomodModCompatibility.replace(regEx(/^v/), ''))\n ) {\n installMarwanModArgs = installMarwanModArgs.replace(\n regEx(/@latest$/),\n `@${gomodModCompatibility}`,\n );\n } else {\n logger.debug(\n { gomodModCompatibility },\n 'marwan-at-work/mod compatibility range is not valid - skipping',\n );\n }\n } else {\n logger.debug(\n 'No marwan-at-work/mod compatibility range found - installing marwan-at-work/mod latest',\n );\n }\n updateImportCommands.unshift(`go ${installMarwanModArgs}`);\n }\n\n return updateImportCommands;\n}\n\nfunction useModcacherw(goVersion: string | undefined): boolean {\n if (!is.string(goVersion)) {\n return true;\n }\n\n const [, majorPart, minorPart] = coerceArray(\n regEx(/(\\d+)\\.(\\d+)/).exec(goVersion),\n );\n const [major, minor] = [majorPart, minorPart].map((x) => parseInt(x, 10));\n\n return (\n !Number.isNaN(major) &&\n !Number.isNaN(minor) &&\n (major > 1 || (major === 1 && minor >= 14))\n );\n}\n\nexport async function updateArtifacts({\n packageFileName: goModFileName,\n updatedDeps,\n newPackageFileContent: newGoModContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`gomod.updateArtifacts(${goModFileName})`);\n\n const sumFileName = goModFileName.replace(regEx(/\\.mod$/), '.sum');\n const existingGoSumContent = await readLocalFile(sumFileName);\n if (!existingGoSumContent) {\n logger.debug('No go.sum found');\n return null;\n }\n\n const goModDir = upath.dirname(goModFileName);\n\n const vendorDir = upath.join(goModDir, 'vendor/');\n const vendorModulesFileName = upath.join(vendorDir, 'modules.txt');\n const useVendor =\n !config.postUpdateOptions?.includes('gomodSkipVendor') &&\n (await readLocalFile(vendorModulesFileName)) !== null;\n\n let massagedGoMod = newGoModContent;\n\n if (config.postUpdateOptions?.includes('gomodMassage')) {\n // Regex match inline replace directive, example:\n // replace golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5\n // https://go.dev/ref/mod#go-mod-file-replace\n\n // replace bracket after comments, so it doesn't break the regex, doing a complex regex causes problems\n // when there's a comment and \")\" after it, the regex will read replace block until comment.. and stop.\n massagedGoMod = massagedGoMod\n .split('\\n')\n .map((line) => {\n if (line.trim().startsWith('//')) {\n return line.replace(')', 'renovate-replace-bracket');\n }\n return line;\n })\n .join('\\n');\n\n const inlineReplaceRegEx = regEx(\n /(\\r?\\n)(replace\\s+[^\\s]+\\s+=>\\s+\\.\\.\\/.*)/g,\n );\n\n // $1 will be matched with the (\\r?n) group\n // $2 will be matched with the inline replace match, example\n // \"// renovate-replace replace golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5\"\n const inlineCommentOut = '$1// renovate-replace $2';\n\n // Regex match replace directive block, example:\n // replace (\n // golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5\n // )\n const blockReplaceRegEx = regEx(/(\\r?\\n)replace\\s*\\([^)]+\\s*\\)/g);\n\n /**\n * replacerFunction for commenting out replace blocks\n * @param match A string representing a golang replace directive block\n * @returns A commented out block with // renovate-replace\n */\n const blockCommentOut = (match: string): string =>\n match.replace(/(\\r?\\n)/g, '$1// renovate-replace ');\n\n // Comment out golang replace directives\n massagedGoMod = massagedGoMod\n .replace(inlineReplaceRegEx, inlineCommentOut)\n .replace(blockReplaceRegEx, blockCommentOut);\n\n if (massagedGoMod !== newGoModContent) {\n logger.debug(\n 'Removed some relative replace statements and comments from go.mod',\n );\n }\n }\n const goConstraints =\n config.constraints?.go ?? (await getGoConstraints(goModFileName));\n\n try {\n await writeLocalFile(goModFileName, massagedGoMod);\n\n const cmd = 'go';\n const execOptions: ExecOptions = {\n cwdFile: goModFileName,\n userConfiguredEnv: config.env,\n extraEnv: {\n GOPATH: await ensureCacheDir('go'),\n GOPROXY: process.env.GOPROXY,\n GOPRIVATE: process.env.GOPRIVATE,\n GONOPROXY: process.env.GONOPROXY,\n GONOSUMDB: process.env.GONOSUMDB,\n GOSUMDB: process.env.GOSUMDB,\n GOINSECURE: process.env.GOINSECURE,\n GOFLAGS: useModcacherw(goConstraints)\n ? '-modcacherw'\n : /* istanbul ignore next: hard to test */ null,\n CGO_ENABLED: GlobalConfig.get('binarySource') === 'docker' ? '0' : null,\n ...getGitEnvironmentVariables(['go']),\n },\n docker: {},\n toolConstraints: [\n {\n toolName: 'golang',\n constraint: goConstraints,\n },\n ],\n };\n\n const execCommands: string[] = [];\n\n let goGetDirs: string | undefined;\n if (config.goGetDirs) {\n goGetDirs = config.goGetDirs\n .filter((dir) => {\n const isValid = isValidLocalPath(dir);\n if (!isValid) {\n logger.warn({ dir }, 'Invalid path in goGetDirs');\n }\n return isValid;\n })\n .map(quote)\n .join(' ');\n\n if (goGetDirs === '') {\n throw new Error('Invalid goGetDirs');\n }\n }\n\n let args = `get -d -t ${goGetDirs ?? './...'}`;\n logger.trace({ cmd, args }, 'go get command included');\n execCommands.push(`${cmd} ${args}`);\n\n // Update import paths on major updates\n const isImportPathUpdateRequired =\n config.postUpdateOptions?.includes('gomodUpdateImportPaths') &&\n config.updateType === 'major';\n\n if (isImportPathUpdateRequired) {\n const updateImportCmds = getUpdateImportPathCmds(updatedDeps, config);\n if (updateImportCmds.length > 0) {\n logger.debug(updateImportCmds, 'update import path commands included');\n // The updates\n execCommands.push(...updateImportCmds);\n }\n }\n\n const mustSkipGoModTidy =\n !config.postUpdateOptions?.includes('gomodUpdateImportPaths') &&\n config.updateType === 'major';\n if (mustSkipGoModTidy) {\n logger.debug('go mod tidy command skipped');\n }\n\n let tidyOpts = '';\n if (config.postUpdateOptions?.includes('gomodTidy1.17')) {\n tidyOpts += ' -compat=1.17';\n }\n if (config.postUpdateOptions?.includes('gomodTidyE')) {\n tidyOpts += ' -e';\n }\n\n const isGoModTidyRequired =\n !mustSkipGoModTidy &&\n (config.postUpdateOptions?.includes('gomodTidy') === true ||\n config.postUpdateOptions?.includes('gomodTidy1.17') === true ||\n config.postUpdateOptions?.includes('gomodTidyE') === true ||\n (config.updateType === 'major' && isImportPathUpdateRequired));\n if (isGoModTidyRequired) {\n args = 'mod tidy' + tidyOpts;\n logger.debug('go mod tidy command included');\n execCommands.push(`${cmd} ${args}`);\n }\n\n const goWorkSumFileName = upath.join(goModDir, 'go.work.sum');\n if (useVendor) {\n // If we find a go.work, then use go workspace vendoring.\n const goWorkFile = await findLocalSiblingOrParent(\n goModFileName,\n 'go.work',\n );\n\n if (goWorkFile) {\n args = 'work vendor';\n logger.debug('using go work vendor');\n execCommands.push(`${cmd} ${args}`);\n\n args = 'work sync';\n logger.debug('using go work sync');\n execCommands.push(`${cmd} ${args}`);\n } else {\n args = 'mod vendor';\n logger.debug('using go mod vendor');\n execCommands.push(`${cmd} ${args}`);\n }\n\n if (isGoModTidyRequired) {\n args = 'mod tidy' + tidyOpts;\n logger.debug('go mod tidy command included');\n execCommands.push(`${cmd} ${args}`);\n }\n }\n\n // We tidy one more time as a solution for #6795\n if (isGoModTidyRequired) {\n args = 'mod tidy' + tidyOpts;\n logger.debug('go mod tidy command included');\n execCommands.push(`${cmd} ${args}`);\n }\n\n await exec(execCommands, execOptions);\n\n const status = await getRepoStatus();\n if (\n !status.modified.includes(sumFileName) &&\n !status.modified.includes(goModFileName) &&\n !status.modified.includes(goWorkSumFileName)\n ) {\n return null;\n }\n\n const res: UpdateArtifactsResult[] = [];\n if (status.modified.includes(sumFileName)) {\n logger.debug('Returning updated go.sum');\n res.push({\n file: {\n type: 'addition',\n path: sumFileName,\n contents: await readLocalFile(sumFileName),\n },\n });\n }\n\n if (status.modified.includes(goWorkSumFileName)) {\n logger.debug('Returning updated go.work.sum');\n res.push({\n file: {\n type: 'addition',\n path: goWorkSumFileName,\n contents: await readLocalFile(goWorkSumFileName),\n },\n });\n }\n\n // Include all the .go file import changes\n if (isImportPathUpdateRequired) {\n logger.debug('Returning updated go source files for import path changes');\n for (const f of status.modified) {\n if (f.endsWith('.go')) {\n res.push({\n file: {\n type: 'addition',\n path: f,\n contents: await readLocalFile(f),\n },\n });\n }\n }\n }\n\n if (useVendor) {\n for (const f of status.modified.concat(status.not_added)) {\n if (f.startsWith(vendorDir)) {\n res.push({\n file: {\n type: 'addition',\n path: f,\n contents: await readLocalFile(f),\n },\n });\n }\n }\n for (const f of coerceArray(status.deleted)) {\n res.push({\n file: {\n type: 'deletion',\n path: f,\n },\n });\n }\n }\n\n // TODO: throws in tests (#22198)\n const finalGoModContent = (await readLocalFile(goModFileName, 'utf8'))!\n .replace(regEx(/\\/\\/ renovate-replace /g), '')\n .replace(regEx(/renovate-replace-bracket/g), ')');\n if (finalGoModContent !== newGoModContent) {\n const artifactResult: UpdateArtifactsResult = {\n file: {\n type: 'addition',\n path: goModFileName,\n contents: finalGoModContent,\n },\n };\n\n const updatedDepNames = filterMap(updatedDeps, (dep) => dep?.depName);\n const extraDepsNotice = getExtraDepsNotice(\n newGoModContent,\n finalGoModContent,\n updatedDepNames,\n );\n\n if (extraDepsNotice) {\n artifactResult.notice = {\n file: goModFileName,\n message: extraDepsNotice,\n };\n }\n\n logger.debug('Found updated go.mod after go.sum update');\n res.push(artifactResult);\n }\n return res;\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, 'Failed to update go.sum');\n return [\n {\n artifactError: {\n lockFile: sumFileName,\n stderr: err.message,\n },\n },\n ];\n }\n}\n\nasync function getGoConstraints(\n goModFileName: string,\n): Promise<string | undefined> {\n const content = (await readLocalFile(goModFileName, 'utf8')) ?? null;\n if (!content) {\n return undefined;\n }\n const re = regEx(/^go\\s*(?<gover>\\d+\\.\\d+)$/m);\n const match = re.exec(content);\n if (!match?.groups?.gover) {\n return undefined;\n }\n return '^' + match.groups.gover;\n}\n"]}
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/gomod/artifacts.ts"],"names":[],"mappings":";;AAoHA,0CAwUC;;AA5bD,kEAAkC;AAClC,4DAA4B;AAC5B,iCAA8B;AAC9B,0DAA0B;AAC1B,mDAAsD;AACtD,sEAAoE;AACpE,4CAAyC;AACzC,+CAAkD;AAClD,6CAA0C;AAE1C,yDAAqD;AACrD,yCAM0B;AAC1B,2CAAkD;AAClD,iDAAoE;AACpE,+CAA4C;AAC5C,oDAAkD;AAOlD,uDAAuD;AAEvD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,gBAAM,CAAC;AAEhC,SAAS,uBAAuB,CAC9B,WAAgC,EAChC,EAAE,WAAW,EAAyB;IAEtC,4EAA4E;IAC5E,MAAM,gBAAgB,GAAG,WAAW,CAAC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BAAyB,CAAC,CAAC;QACjD,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,WAAW;oBACrB,MAAM,EAAE,GAAG,CAAC,OAAO;iBACpB;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,gBAAgB,CAC7B,aAAqB;IAErB,MAAM,OAAO,GAAG,CAAC,MAAM,IAAA,kBAAa,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC;IACrE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,EAAE,GAAG,IAAA,aAAK,EAAC,4BAA4B,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;AAClC,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport semver from 'semver';\nimport { quote } from 'shlex';\nimport upath from 'upath';\nimport { GlobalConfig } from '../../../config/global';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { coerceArray } from '../../../util/array';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions } from '../../../util/exec/types';\nimport { filterMap } from '../../../util/filter-map';\nimport {\n ensureCacheDir,\n findLocalSiblingOrParent,\n isValidLocalPath,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport { getRepoStatus } from '../../../util/git';\nimport { getGitEnvironmentVariables } from '../../../util/git/auth';\nimport { regEx } from '../../../util/regex';\nimport { isValid } from '../../versioning/semver';\nimport type {\n PackageDependency,\n UpdateArtifact,\n UpdateArtifactsConfig,\n UpdateArtifactsResult,\n} from '../types';\nimport { getExtraDepsNotice } from './artifacts-extra';\n\nconst { major, valid } = semver;\n\nfunction getUpdateImportPathCmds(\n updatedDeps: PackageDependency[],\n { constraints }: UpdateArtifactsConfig,\n): string[] {\n // Check if we fail to parse any major versions and log that they're skipped\n const invalidMajorDeps = updatedDeps.filter(\n ({ newVersion }) => !valid(newVersion),\n );\n if (invalidMajorDeps.length > 0) {\n invalidMajorDeps.forEach(({ depName }) =>\n logger.warn(\n { depName },\n 'Ignoring dependency: Could not get major version',\n ),\n );\n }\n\n const updateImportCommands = updatedDeps\n .filter(\n ({ newVersion }) =>\n valid(newVersion) && !newVersion!.endsWith('+incompatible'),\n )\n .map(({ depName, newVersion }) => ({\n depName: depName!,\n newMajor: major(newVersion!),\n }))\n // Skip path updates going from v0 to v1\n .filter(\n ({ depName, newMajor }) =>\n depName.startsWith('gopkg.in/') || newMajor > 1,\n )\n\n .map(\n ({ depName, newMajor }) =>\n `mod upgrade --mod-name=${depName} -t=${newMajor}`,\n );\n\n if (updateImportCommands.length > 0) {\n let installMarwanModArgs =\n 'install github.com/marwan-at-work/mod/cmd/mod@latest';\n const gomodModCompatibility = constraints?.gomodMod;\n if (gomodModCompatibility) {\n if (\n gomodModCompatibility.startsWith('v') &&\n isValid(gomodModCompatibility.replace(regEx(/^v/), ''))\n ) {\n installMarwanModArgs = installMarwanModArgs.replace(\n regEx(/@latest$/),\n `@${gomodModCompatibility}`,\n );\n } else {\n logger.debug(\n { gomodModCompatibility },\n 'marwan-at-work/mod compatibility range is not valid - skipping',\n );\n }\n } else {\n logger.debug(\n 'No marwan-at-work/mod compatibility range found - installing marwan-at-work/mod latest',\n );\n }\n updateImportCommands.unshift(`go ${installMarwanModArgs}`);\n }\n\n return updateImportCommands;\n}\n\nfunction useModcacherw(goVersion: string | undefined): boolean {\n if (!is.string(goVersion)) {\n return true;\n }\n\n const [, majorPart, minorPart] = coerceArray(\n regEx(/(\\d+)\\.(\\d+)/).exec(goVersion),\n );\n const [major, minor] = [majorPart, minorPart].map((x) => parseInt(x, 10));\n\n return (\n !Number.isNaN(major) &&\n !Number.isNaN(minor) &&\n (major > 1 || (major === 1 && minor >= 14))\n );\n}\n\nexport async function updateArtifacts({\n packageFileName: goModFileName,\n updatedDeps,\n newPackageFileContent: newGoModContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`gomod.updateArtifacts(${goModFileName})`);\n\n const sumFileName = goModFileName.replace(regEx(/\\.mod$/), '.sum');\n const existingGoSumContent = await readLocalFile(sumFileName);\n if (!existingGoSumContent) {\n logger.debug('No go.sum found');\n return null;\n }\n\n const goModDir = upath.dirname(goModFileName);\n\n const vendorDir = upath.join(goModDir, 'vendor/');\n const vendorModulesFileName = upath.join(vendorDir, 'modules.txt');\n const useVendor =\n !!config.postUpdateOptions?.includes('gomodVendor') ||\n (!config.postUpdateOptions?.includes('gomodSkipVendor') &&\n (await readLocalFile(vendorModulesFileName)) !== null);\n let massagedGoMod = newGoModContent;\n\n if (config.postUpdateOptions?.includes('gomodMassage')) {\n // Regex match inline replace directive, example:\n // replace golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5\n // https://go.dev/ref/mod#go-mod-file-replace\n\n // replace bracket after comments, so it doesn't break the regex, doing a complex regex causes problems\n // when there's a comment and \")\" after it, the regex will read replace block until comment.. and stop.\n massagedGoMod = massagedGoMod\n .split('\\n')\n .map((line) => {\n if (line.trim().startsWith('//')) {\n return line.replace(')', 'renovate-replace-bracket');\n }\n return line;\n })\n .join('\\n');\n\n const inlineReplaceRegEx = regEx(\n /(\\r?\\n)(replace\\s+[^\\s]+\\s+=>\\s+\\.\\.\\/.*)/g,\n );\n\n // $1 will be matched with the (\\r?n) group\n // $2 will be matched with the inline replace match, example\n // \"// renovate-replace replace golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5\"\n const inlineCommentOut = '$1// renovate-replace $2';\n\n // Regex match replace directive block, example:\n // replace (\n // golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5\n // )\n const blockReplaceRegEx = regEx(/(\\r?\\n)replace\\s*\\([^)]+\\s*\\)/g);\n\n /**\n * replacerFunction for commenting out replace blocks\n * @param match A string representing a golang replace directive block\n * @returns A commented out block with // renovate-replace\n */\n const blockCommentOut = (match: string): string =>\n match.replace(/(\\r?\\n)/g, '$1// renovate-replace ');\n\n // Comment out golang replace directives\n massagedGoMod = massagedGoMod\n .replace(inlineReplaceRegEx, inlineCommentOut)\n .replace(blockReplaceRegEx, blockCommentOut);\n\n if (massagedGoMod !== newGoModContent) {\n logger.debug(\n 'Removed some relative replace statements and comments from go.mod',\n );\n }\n }\n const goConstraints =\n config.constraints?.go ?? (await getGoConstraints(goModFileName));\n\n try {\n await writeLocalFile(goModFileName, massagedGoMod);\n\n const cmd = 'go';\n const execOptions: ExecOptions = {\n cwdFile: goModFileName,\n userConfiguredEnv: config.env,\n extraEnv: {\n GOPATH: await ensureCacheDir('go'),\n GOPROXY: process.env.GOPROXY,\n GOPRIVATE: process.env.GOPRIVATE,\n GONOPROXY: process.env.GONOPROXY,\n GONOSUMDB: process.env.GONOSUMDB,\n GOSUMDB: process.env.GOSUMDB,\n GOINSECURE: process.env.GOINSECURE,\n GOFLAGS: useModcacherw(goConstraints)\n ? '-modcacherw'\n : /* istanbul ignore next: hard to test */ null,\n CGO_ENABLED: GlobalConfig.get('binarySource') === 'docker' ? '0' : null,\n ...getGitEnvironmentVariables(['go']),\n },\n docker: {},\n toolConstraints: [\n {\n toolName: 'golang',\n constraint: goConstraints,\n },\n ],\n };\n\n const execCommands: string[] = [];\n\n let goGetDirs: string | undefined;\n if (config.goGetDirs) {\n goGetDirs = config.goGetDirs\n .filter((dir) => {\n const isValid = isValidLocalPath(dir);\n if (!isValid) {\n logger.warn({ dir }, 'Invalid path in goGetDirs');\n }\n return isValid;\n })\n .map(quote)\n .join(' ');\n\n if (goGetDirs === '') {\n throw new Error('Invalid goGetDirs');\n }\n }\n\n let args = `get -d -t ${goGetDirs ?? './...'}`;\n logger.trace({ cmd, args }, 'go get command included');\n execCommands.push(`${cmd} ${args}`);\n\n // Update import paths on major updates\n const isImportPathUpdateRequired =\n config.postUpdateOptions?.includes('gomodUpdateImportPaths') &&\n config.updateType === 'major';\n\n if (isImportPathUpdateRequired) {\n const updateImportCmds = getUpdateImportPathCmds(updatedDeps, config);\n if (updateImportCmds.length > 0) {\n logger.debug(updateImportCmds, 'update import path commands included');\n // The updates\n execCommands.push(...updateImportCmds);\n }\n }\n\n const mustSkipGoModTidy =\n !config.postUpdateOptions?.includes('gomodUpdateImportPaths') &&\n config.updateType === 'major';\n if (mustSkipGoModTidy) {\n logger.debug('go mod tidy command skipped');\n }\n\n let tidyOpts = '';\n if (config.postUpdateOptions?.includes('gomodTidy1.17')) {\n tidyOpts += ' -compat=1.17';\n }\n if (config.postUpdateOptions?.includes('gomodTidyE')) {\n tidyOpts += ' -e';\n }\n\n const isGoModTidyRequired =\n !mustSkipGoModTidy &&\n (config.postUpdateOptions?.includes('gomodTidy') === true ||\n config.postUpdateOptions?.includes('gomodTidy1.17') === true ||\n config.postUpdateOptions?.includes('gomodTidyE') === true ||\n (config.updateType === 'major' && isImportPathUpdateRequired));\n if (isGoModTidyRequired) {\n args = 'mod tidy' + tidyOpts;\n logger.debug('go mod tidy command included');\n execCommands.push(`${cmd} ${args}`);\n }\n\n const goWorkSumFileName = upath.join(goModDir, 'go.work.sum');\n if (useVendor) {\n // If we find a go.work, then use go workspace vendoring.\n const goWorkFile = await findLocalSiblingOrParent(\n goModFileName,\n 'go.work',\n );\n\n if (goWorkFile) {\n args = 'work vendor';\n logger.debug('using go work vendor');\n execCommands.push(`${cmd} ${args}`);\n\n args = 'work sync';\n logger.debug('using go work sync');\n execCommands.push(`${cmd} ${args}`);\n } else {\n args = 'mod vendor';\n logger.debug('using go mod vendor');\n execCommands.push(`${cmd} ${args}`);\n }\n\n if (isGoModTidyRequired) {\n args = 'mod tidy' + tidyOpts;\n logger.debug('go mod tidy command included');\n execCommands.push(`${cmd} ${args}`);\n }\n }\n\n // We tidy one more time as a solution for #6795\n if (isGoModTidyRequired) {\n args = 'mod tidy' + tidyOpts;\n logger.debug('go mod tidy command included');\n execCommands.push(`${cmd} ${args}`);\n }\n\n await exec(execCommands, execOptions);\n\n const status = await getRepoStatus();\n if (\n !status.modified.includes(sumFileName) &&\n !status.modified.includes(goModFileName) &&\n !status.modified.includes(goWorkSumFileName)\n ) {\n return null;\n }\n\n const res: UpdateArtifactsResult[] = [];\n if (status.modified.includes(sumFileName)) {\n logger.debug('Returning updated go.sum');\n res.push({\n file: {\n type: 'addition',\n path: sumFileName,\n contents: await readLocalFile(sumFileName),\n },\n });\n }\n\n if (status.modified.includes(goWorkSumFileName)) {\n logger.debug('Returning updated go.work.sum');\n res.push({\n file: {\n type: 'addition',\n path: goWorkSumFileName,\n contents: await readLocalFile(goWorkSumFileName),\n },\n });\n }\n\n // Include all the .go file import changes\n if (isImportPathUpdateRequired) {\n logger.debug('Returning updated go source files for import path changes');\n for (const f of status.modified) {\n if (f.endsWith('.go')) {\n res.push({\n file: {\n type: 'addition',\n path: f,\n contents: await readLocalFile(f),\n },\n });\n }\n }\n }\n\n if (useVendor) {\n for (const f of status.modified.concat(status.not_added)) {\n if (f.startsWith(vendorDir)) {\n res.push({\n file: {\n type: 'addition',\n path: f,\n contents: await readLocalFile(f),\n },\n });\n }\n }\n for (const f of coerceArray(status.deleted)) {\n res.push({\n file: {\n type: 'deletion',\n path: f,\n },\n });\n }\n }\n\n // TODO: throws in tests (#22198)\n const finalGoModContent = (await readLocalFile(goModFileName, 'utf8'))!\n .replace(regEx(/\\/\\/ renovate-replace /g), '')\n .replace(regEx(/renovate-replace-bracket/g), ')');\n if (finalGoModContent !== newGoModContent) {\n const artifactResult: UpdateArtifactsResult = {\n file: {\n type: 'addition',\n path: goModFileName,\n contents: finalGoModContent,\n },\n };\n\n const updatedDepNames = filterMap(updatedDeps, (dep) => dep?.depName);\n const extraDepsNotice = getExtraDepsNotice(\n newGoModContent,\n finalGoModContent,\n updatedDepNames,\n );\n\n if (extraDepsNotice) {\n artifactResult.notice = {\n file: goModFileName,\n message: extraDepsNotice,\n };\n }\n\n logger.debug('Found updated go.mod after go.sum update');\n res.push(artifactResult);\n }\n return res;\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, 'Failed to update go.sum');\n return [\n {\n artifactError: {\n lockFile: sumFileName,\n stderr: err.message,\n },\n },\n ];\n }\n}\n\nasync function getGoConstraints(\n goModFileName: string,\n): Promise<string | undefined> {\n const content = (await readLocalFile(goModFileName, 'utf8')) ?? null;\n if (!content) {\n return undefined;\n }\n const re = regEx(/^go\\s*(?<gover>\\d+\\.\\d+)$/m);\n const match = re.exec(content);\n if (!match?.groups?.gover) {\n return undefined;\n }\n return '^' + match.groups.gover;\n}\n"]}
|
@@ -246,7 +246,7 @@ async function updateYarnBinary(lockFileDir, updatedArtifacts, existingYarnrcYml
|
|
246
246
|
let yarnrcYml = existingYarnrcYmlContent;
|
247
247
|
try {
|
248
248
|
const yarnrcYmlFilename = upath_1.default.join(lockFileDir, '.yarnrc.yml');
|
249
|
-
yarnrcYml
|
249
|
+
yarnrcYml ??= (await (0, git_1.getFile)(yarnrcYmlFilename)) ?? undefined;
|
250
250
|
const newYarnrcYml = await (0, fs_1.readLocalFile)(yarnrcYmlFilename, 'utf8');
|
251
251
|
if (!is_1.default.string(yarnrcYml) || !is_1.default.string(newYarnrcYml)) {
|
252
252
|
return existingYarnrcYmlContent;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/modules/manager/npm/post-update/index.ts"],"names":[],"mappings":";;AA+CA,sDAoEC;AAED,gDAsGC;AAED,4DA6BC;AAwDD,4CAkDC;AAED,gDAqRC;;AA3nBD,uBAAuB;AACvB,kEAAkC;AAClC,kEAAkC;AAClC,0DAA0B;AAC1B,+CAA4C;AAC5C,sFAAiF;AACjF,mDAA+D;AAC/D,4CAK6B;AAC7B,8CAA8D;AAE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E,MAAM,EAAE,EAC7C,8EAA8E,CAC/E,CAAC;wBACF,MAAM,IAAI,uCAAiB,CACzB,KAAK,CACH,8EAA8E,CAC/E,EACD,mBAAa,CAAC,EAAE,CACjB,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;YACD,cAAc,CAAC,IAAI,CAAC;gBAClB,QAAQ,EAAE,cAAc;gBACxB,wEAAwE;gBACxE,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM;aACjC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,MAAM,eAAe,GAAG,MAAM,IAAA,aAAO,EACnC,cAAc,EACd,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CACnE,CAAC;YACF,IAAI,GAAG,CAAC,QAAQ,KAAK,eAAe,EAAE,CAAC;gBACrC,eAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,eAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;gBAC9C,gBAAgB,CAAC,IAAI,CAAC;oBACpB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,cAAc;oBACpB,mCAAmC;oBACnC,QAAQ,EAAE,GAAG,CAAC,QAAS;iBACxB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,MAAM,IAAA,yBAAiB,EAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC;AAC9C,CAAC","sourcesContent":["// TODO: types (#22198)\nimport is from '@sindresorhus/is';\nimport deepmerge from 'deepmerge';\nimport upath from 'upath';\nimport { logger } from '../../../../logger';\nimport { ExternalHostError } from '../../../../types/errors/external-host-error';\nimport { getChildProcessEnv } from '../../../../util/exec/env';\nimport {\n ensureCacheDir,\n getSiblingFileName,\n readLocalFile,\n writeLocalFile,\n} from '../../../../util/fs';\nimport { getFile, getRepoStatus } from '../../../../util/git';\nimport type { FileChange } from '../../../../util/git/types';\nimport * as hostRules from '../../../../util/host-rules';\nimport { newlineRegex, regEx } from '../../../../util/regex';\nimport { ensureTrailingSlash } from '../../../../util/url';\nimport { dump, parseSingleYaml } from '../../../../util/yaml';\nimport { NpmDatasource } from '../../../datasource/npm';\nimport { scm } from '../../../platform/scm';\nimport type { PackageFile, PostUpdateConfig, Upgrade } from '../../types';\nimport { getZeroInstallPaths } from '../extract/yarn';\nimport type { NpmManagerData } from '../types';\nimport {\n composeLockFile,\n getNpmrcContent,\n parseLockFile,\n resetNpmrcContent,\n updateNpmrcContent,\n} from '../utils';\nimport * as npm from './npm';\nimport * as pnpm from './pnpm';\nimport { processHostRules } from './rules';\nimport type {\n AdditionalPackageFiles,\n ArtifactError,\n DetermineLockFileDirsResult,\n WriteExistingFilesResult,\n YarnRcYmlFile,\n} from './types';\nimport * as yarn from './yarn';\n\n// Strips empty values, deduplicates, and returns the directories from filenames\nconst getDirs = (arr: (string | null | undefined)[]): string[] =>\n Array.from(new Set(arr.filter(is.string)));\n\nexport function determineLockFileDirs(\n config: PostUpdateConfig,\n packageFiles: AdditionalPackageFiles,\n): DetermineLockFileDirsResult {\n const npmLockDirs: (string | undefined)[] = [];\n const yarnLockDirs: (string | undefined)[] = [];\n const pnpmShrinkwrapDirs: (string | undefined)[] = [];\n\n for (const upgrade of config.upgrades) {\n if (\n upgrade.updateType === 'lockFileMaintenance' ||\n upgrade.isRemediation === true ||\n upgrade.isLockfileUpdate === true\n ) {\n yarnLockDirs.push(upgrade.managerData?.yarnLock);\n npmLockDirs.push(upgrade.managerData?.npmLock);\n pnpmShrinkwrapDirs.push(upgrade.managerData?.pnpmShrinkwrap);\n }\n }\n\n if (\n config.upgrades.every(\n (upgrade: Upgrade) =>\n upgrade.updateType === 'lockFileMaintenance' ||\n upgrade.isLockfileUpdate,\n )\n ) {\n return {\n yarnLockDirs: getDirs(yarnLockDirs),\n npmLockDirs: getDirs(npmLockDirs),\n pnpmShrinkwrapDirs: getDirs(pnpmShrinkwrapDirs),\n };\n }\n\n function getPackageFile(\n fileName: string,\n ): Partial<PackageFile<NpmManagerData>> {\n logger.trace('Looking for packageFile: ' + fileName);\n\n for (const packageFile of packageFiles.npm!) {\n if (packageFile.packageFile === fileName) {\n logger.trace({ packageFile }, 'Found packageFile');\n return packageFile;\n }\n logger.trace('No match');\n }\n return {};\n }\n\n // TODO #22198\n for (const p of config.updatedPackageFiles!) {\n logger.trace(`Checking ${String(p.path)} for lock files`);\n const packageFile = getPackageFile(p.path);\n // istanbul ignore if\n if (!packageFile.managerData) {\n continue;\n }\n // push full lock file names and convert them later\n yarnLockDirs.push(packageFile.managerData.yarnLock);\n npmLockDirs.push(packageFile.managerData.npmLock);\n pnpmShrinkwrapDirs.push(packageFile.managerData.pnpmShrinkwrap);\n }\n\n return {\n yarnLockDirs: getDirs(yarnLockDirs),\n npmLockDirs: getDirs(npmLockDirs),\n pnpmShrinkwrapDirs: getDirs(pnpmShrinkwrapDirs),\n };\n}\n\nexport async function writeExistingFiles(\n config: PostUpdateConfig,\n packageFiles: AdditionalPackageFiles,\n): Promise<void> {\n if (!packageFiles.npm) {\n return;\n }\n const npmFiles = packageFiles.npm;\n logger.debug(\n { packageFiles: npmFiles.map((n) => n.packageFile) },\n 'Writing package.json files',\n );\n for (const packageFile of npmFiles) {\n // istanbul ignore if\n if (!packageFile.managerData) {\n continue;\n }\n // TODO #22198\n const basedir = upath.dirname(packageFile.packageFile!);\n const npmrc = packageFile.npmrc;\n const npmrcFilename = upath.join(basedir, '.npmrc');\n if (is.string(npmrc)) {\n try {\n await writeLocalFile(npmrcFilename, npmrc.replace(/\\n?$/, '\\n'));\n } catch (err) /* istanbul ignore next */ {\n logger.warn({ npmrcFilename, err }, 'Error writing .npmrc');\n }\n }\n const npmLock = packageFile.managerData.npmLock;\n if (npmLock) {\n const npmLockPath = npmLock;\n logger.debug(`Writing ${npmLock}`);\n let existingNpmLock: string;\n try {\n existingNpmLock = (await getFile(npmLock)) ?? '';\n } catch (err) /* istanbul ignore next */ {\n logger.warn({ err }, 'Error reading npm lock file');\n existingNpmLock = '';\n }\n const { detectedIndent, lockFileParsed: npmLockParsed } =\n parseLockFile(existingNpmLock);\n if (npmLockParsed) {\n const packageNames =\n 'packages' in npmLockParsed\n ? Object.keys(npmLockParsed.packages)\n : [];\n const widens: string[] = [];\n let lockFileChanged = false;\n for (const upgrade of config.upgrades) {\n if (upgrade.lockFiles && !upgrade.lockFiles.includes(npmLock)) {\n continue;\n }\n if (!upgrade.managerData) {\n continue;\n }\n if (\n upgrade.rangeStrategy === 'widen' &&\n upgrade.managerData.npmLock === npmLock\n ) {\n // TODO #22198\n widens.push(upgrade.depName!);\n }\n const { depName } = upgrade;\n for (const packageName of packageNames) {\n if (\n 'packages' in npmLockParsed &&\n (packageName === `node_modules/${depName}` ||\n packageName.startsWith(`node_modules/${depName}/`))\n ) {\n logger.trace({ packageName }, 'Massaging out package name');\n lockFileChanged = true;\n delete npmLockParsed.packages[packageName];\n }\n }\n }\n if (widens.length) {\n logger.debug(\n `Removing ${String(widens)} from ${npmLock} to force an update`,\n );\n lockFileChanged = true;\n try {\n if ('dependencies' in npmLockParsed && npmLockParsed.dependencies) {\n widens.forEach((depName) => {\n // TODO #22198\n delete npmLockParsed.dependencies![depName];\n });\n }\n } catch /* istanbul ignore next */ {\n logger.warn(\n { npmLock },\n 'Error massaging package-lock.json for widen',\n );\n }\n }\n if (lockFileChanged) {\n logger.debug('Massaging npm lock file before writing to disk');\n existingNpmLock = composeLockFile(npmLockParsed, detectedIndent);\n }\n await writeLocalFile(npmLockPath, existingNpmLock);\n }\n }\n }\n}\n\nexport async function writeUpdatedPackageFiles(\n config: PostUpdateConfig,\n): Promise<void> {\n logger.trace({ config }, 'writeUpdatedPackageFiles');\n logger.debug('Writing any updated package files');\n if (!config.updatedPackageFiles) {\n logger.debug('No files found');\n return;\n }\n const supportedLockFiles = ['package-lock.json', 'yarn.lock'];\n for (const packageFile of config.updatedPackageFiles) {\n if (packageFile.type !== 'addition') {\n continue;\n }\n if (\n supportedLockFiles.some((fileName) => packageFile.path.endsWith(fileName))\n ) {\n logger.debug(`Writing lock file: ${packageFile.path}`);\n // TODO #22198\n\n await writeLocalFile(packageFile.path, packageFile.contents!);\n continue;\n }\n if (!packageFile.path.endsWith('package.json')) {\n continue;\n }\n logger.debug(`Writing ${packageFile.path}`);\n await writeLocalFile(packageFile.path, packageFile.contents!);\n }\n}\n\n// istanbul ignore next\nasync function updateYarnOffline(\n lockFileDir: string,\n updatedArtifacts: FileChange[],\n): Promise<void> {\n try {\n const resolvedPaths: string[] = [];\n const yarnrcYml = await getFile(upath.join(lockFileDir, '.yarnrc.yml'));\n const yarnrc = await getFile(upath.join(lockFileDir, '.yarnrc'));\n\n // As .yarnrc.yml overrides .yarnrc in Yarn 1 (https://git.io/JUcco)\n // both files may exist, so check for .yarnrc.yml first\n if (yarnrcYml) {\n // Yarn 2 (offline cache and zero-installs)\n const paths = getZeroInstallPaths(yarnrcYml);\n resolvedPaths.push(...paths.map((p) => upath.join(lockFileDir, p)));\n } else if (yarnrc) {\n // Yarn 1 (offline mirror)\n const mirrorLine = yarnrc\n .split(newlineRegex)\n .find((line) => line.startsWith('yarn-offline-mirror '));\n if (mirrorLine) {\n const mirrorPath = ensureTrailingSlash(\n mirrorLine.split(' ')[1].replace(regEx(/\"/g), ''),\n );\n resolvedPaths.push(upath.join(lockFileDir, mirrorPath));\n }\n }\n logger.debug({ resolvedPaths }, 'updateYarnOffline resolvedPaths');\n\n if (resolvedPaths.length) {\n const status = await getRepoStatus();\n for (const f of status.modified.concat(status.not_added)) {\n if (resolvedPaths.some((p) => f.startsWith(p))) {\n updatedArtifacts.push({\n type: 'addition',\n path: f,\n contents: await readLocalFile(f),\n });\n }\n }\n for (const f of status.deleted || []) {\n if (resolvedPaths.some((p) => f.startsWith(p))) {\n updatedArtifacts.push({ type: 'deletion', path: f });\n }\n }\n }\n } catch (err) {\n logger.error({ err }, 'Error updating yarn offline packages');\n }\n}\n\n// TODO: move to ./yarn.ts\n// exported for testing\nexport async function updateYarnBinary(\n lockFileDir: string,\n updatedArtifacts: FileChange[],\n existingYarnrcYmlContent: string | undefined | null,\n): Promise<string | undefined | null> {\n let yarnrcYml = existingYarnrcYmlContent;\n try {\n const yarnrcYmlFilename = upath.join(lockFileDir, '.yarnrc.yml');\n yarnrcYml ||= (await getFile(yarnrcYmlFilename)) ?? undefined;\n const newYarnrcYml = await readLocalFile(yarnrcYmlFilename, 'utf8');\n if (!is.string(yarnrcYml) || !is.string(newYarnrcYml)) {\n return existingYarnrcYmlContent;\n }\n\n // TODO: use schema (#9610)\n const oldYarnPath = parseSingleYaml<YarnRcYmlFile>(yarnrcYml)?.yarnPath;\n const newYarnPath = parseSingleYaml<YarnRcYmlFile>(newYarnrcYml)?.yarnPath;\n if (\n !is.nonEmptyStringAndNotWhitespace(oldYarnPath) ||\n !is.nonEmptyStringAndNotWhitespace(newYarnPath)\n ) {\n return existingYarnrcYmlContent;\n }\n\n const oldYarnFullPath = upath.join(lockFileDir, oldYarnPath);\n const newYarnFullPath = upath.join(lockFileDir, newYarnPath);\n logger.debug({ oldYarnPath, newYarnPath }, 'Found updated Yarn binary');\n\n yarnrcYml = yarnrcYml.replace(oldYarnPath, newYarnPath);\n updatedArtifacts.push(\n {\n type: 'addition',\n path: yarnrcYmlFilename,\n contents: yarnrcYml,\n },\n {\n type: 'deletion',\n path: oldYarnFullPath,\n },\n {\n type: 'addition',\n path: newYarnFullPath,\n contents: await readLocalFile(newYarnFullPath, 'utf8'),\n isExecutable: true,\n },\n );\n } catch (err) /* istanbul ignore next */ {\n logger.error({ err }, 'Error updating Yarn binary');\n }\n return existingYarnrcYmlContent && yarnrcYml;\n}\n\nexport async function getAdditionalFiles(\n config: PostUpdateConfig<NpmManagerData>,\n packageFiles: AdditionalPackageFiles,\n): Promise<WriteExistingFilesResult> {\n logger.trace({ config }, 'getAdditionalFiles');\n const artifactErrors: ArtifactError[] = [];\n const updatedArtifacts: FileChange[] = [];\n if (!packageFiles.npm?.length) {\n return { artifactErrors, updatedArtifacts };\n }\n if (!config.updateLockFiles) {\n logger.debug('Skipping lock file generation');\n return { artifactErrors, updatedArtifacts };\n }\n if (\n config.reuseExistingBranch &&\n !config.updatedPackageFiles?.length &&\n config.upgrades?.every((upgrade) => upgrade.isLockfileUpdate)\n ) {\n logger.debug('Existing branch contains all necessary lock file updates');\n return { artifactErrors, updatedArtifacts };\n }\n logger.debug('Getting updated lock files');\n if (\n config.updateType === 'lockFileMaintenance' &&\n config.reuseExistingBranch &&\n (await scm.branchExists(config.branchName))\n ) {\n logger.debug('Skipping lockFileMaintenance update');\n return { artifactErrors, updatedArtifacts };\n }\n const dirs = determineLockFileDirs(config, packageFiles);\n logger.trace({ dirs }, 'lock file dirs');\n await writeExistingFiles(config, packageFiles);\n await writeUpdatedPackageFiles(config);\n\n const { additionalNpmrcContent, additionalYarnRcYml } = processHostRules();\n\n const env = {\n ...getChildProcessEnv(),\n NPM_CONFIG_CACHE: await ensureCacheDir('npm'),\n YARN_CACHE_FOLDER: await ensureCacheDir('yarn'),\n YARN_GLOBAL_FOLDER: await ensureCacheDir('berry'),\n npm_config_store: await ensureCacheDir('pnpm'),\n NODE_ENV: 'dev',\n };\n\n let token: string | undefined;\n try {\n ({ token } = hostRules.find({\n hostType: 'github',\n url: 'https://api.github.com/',\n }));\n token = token ? /* istanbul ignore next */ `${token}@` : token;\n } catch (err) /* istanbul ignore next */ {\n logger.warn({ err }, 'Error getting token for packageFile');\n }\n const tokenRe = regEx(`${token ?? ''}`, 'g', false);\n for (const npmLock of dirs.npmLockDirs) {\n const lockFileDir = upath.dirname(npmLock);\n const npmrcContent = await getNpmrcContent(lockFileDir);\n await updateNpmrcContent(lockFileDir, npmrcContent, additionalNpmrcContent);\n const fileName = upath.basename(npmLock);\n logger.debug(`Generating ${fileName} for ${lockFileDir}`);\n const upgrades = config.upgrades.filter(\n (upgrade) => upgrade.managerData?.npmLock === npmLock,\n );\n const res = await npm.generateLockFile(\n lockFileDir,\n env,\n fileName,\n config,\n upgrades,\n );\n if (res.error) {\n // istanbul ignore if\n if (res.stderr?.includes('No matching version found for')) {\n for (const upgrade of config.upgrades) {\n if (\n res.stderr.includes(\n `No matching version found for ${upgrade.depName}`,\n )\n ) {\n logger.debug(\n { dependency: upgrade.depName, type: 'npm' },\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n const err = new Error(\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n throw new ExternalHostError(err, NpmDatasource.id);\n }\n }\n }\n artifactErrors.push({\n lockFile: npmLock,\n stderr: res.stderr,\n });\n } else if (res.lockFile) {\n const existingContent = await getFile(\n npmLock,\n config.reuseExistingBranch ? config.branchName : config.baseBranch,\n );\n if (res.lockFile === existingContent) {\n logger.debug(`${npmLock} hasn't changed`);\n } else {\n logger.debug(`${npmLock} needs updating`);\n updatedArtifacts.push({\n type: 'addition',\n path: npmLock,\n // TODO: can this be undefined? (#22198)\n\n contents: res.lockFile.replace(tokenRe, ''),\n });\n }\n }\n await resetNpmrcContent(lockFileDir, npmrcContent);\n }\n\n for (const yarnLock of dirs.yarnLockDirs) {\n const lockFileDir = upath.dirname(yarnLock);\n const npmrcContent = await getNpmrcContent(lockFileDir);\n await updateNpmrcContent(lockFileDir, npmrcContent, additionalNpmrcContent);\n let yarnRcYmlFilename: string | undefined;\n let existingYarnrcYmlContent: string | undefined | null;\n if (additionalYarnRcYml) {\n yarnRcYmlFilename = getSiblingFileName(yarnLock, '.yarnrc.yml');\n existingYarnrcYmlContent = await readLocalFile(yarnRcYmlFilename, 'utf8');\n if (existingYarnrcYmlContent) {\n try {\n // TODO: use schema (#9610)\n const existingYarnrRcYml = parseSingleYaml<Record<string, unknown>>(\n existingYarnrcYmlContent,\n );\n\n const updatedYarnYrcYml = deepmerge(\n existingYarnrRcYml,\n yarn.fuzzyMatchAdditionalYarnrcYml(\n additionalYarnRcYml,\n existingYarnrRcYml,\n ),\n );\n\n await writeLocalFile(yarnRcYmlFilename, dump(updatedYarnYrcYml));\n logger.debug('Added authentication to .yarnrc.yml');\n } catch (err) {\n logger.warn({ err }, 'Error appending .yarnrc.yml content');\n }\n }\n }\n logger.debug(`Generating yarn.lock for ${lockFileDir}`);\n const lockFileName = upath.join(lockFileDir, 'yarn.lock');\n const upgrades = config.upgrades.filter(\n (upgrade) => upgrade.managerData?.yarnLock === yarnLock,\n );\n const res = await yarn.generateLockFile(lockFileDir, env, config, upgrades);\n if (res.error) {\n // istanbul ignore if\n if (res.stderr?.includes(`Couldn't find any versions for`)) {\n for (const upgrade of config.upgrades) {\n /* eslint-disable no-useless-escape */\n if (\n res.stderr.includes(\n `Couldn't find any versions for \\\\\\\"${upgrade.depName}\\\\\\\"`,\n )\n ) {\n logger.debug(\n { dependency: upgrade.depName, type: 'yarn' },\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n throw new ExternalHostError(\n new Error(\n 'lock file failed for the dependency being updated - skipping branch creation',\n ),\n NpmDatasource.id,\n );\n }\n /* eslint-enable no-useless-escape */\n }\n }\n artifactErrors.push({\n lockFile: yarnLock,\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n stderr: res.stderr || res.stdout,\n });\n } else {\n const existingContent = await getFile(\n lockFileName,\n config.reuseExistingBranch ? config.branchName : config.baseBranch,\n );\n if (res.lockFile === existingContent) {\n logger.debug(\"yarn.lock hasn't changed\");\n } else {\n logger.debug('yarn.lock needs updating');\n updatedArtifacts.push({\n type: 'addition',\n path: lockFileName,\n // TODO #22198\n contents: res.lockFile!,\n });\n await updateYarnOffline(lockFileDir, updatedArtifacts);\n }\n\n // istanbul ignore if: already tested seperately, needs additional test?\n if (upgrades.some(yarn.isYarnUpdate)) {\n existingYarnrcYmlContent = await updateYarnBinary(\n lockFileDir,\n updatedArtifacts,\n existingYarnrcYmlContent,\n );\n }\n }\n await resetNpmrcContent(lockFileDir, npmrcContent);\n // istanbul ignore if: needs test\n if (existingYarnrcYmlContent) {\n // TODO #22198\n await writeLocalFile(yarnRcYmlFilename!, existingYarnrcYmlContent);\n }\n }\n\n for (const pnpmShrinkwrap of dirs.pnpmShrinkwrapDirs) {\n const lockFileDir = upath.dirname(pnpmShrinkwrap);\n const npmrcContent = await getNpmrcContent(lockFileDir);\n await updateNpmrcContent(lockFileDir, npmrcContent, additionalNpmrcContent);\n logger.debug(`Generating pnpm-lock.yaml for ${lockFileDir}`);\n const upgrades = config.upgrades.filter(\n (upgrade) => upgrade.managerData?.pnpmShrinkwrap === pnpmShrinkwrap,\n );\n const res = await pnpm.generateLockFile(lockFileDir, env, config, upgrades);\n if (res.error) {\n // istanbul ignore if\n if (res.stdout?.includes(`No compatible version found:`)) {\n for (const upgrade of config.upgrades) {\n if (\n res.stdout.includes(\n `No compatible version found: ${upgrade.depName}`,\n )\n ) {\n logger.debug(\n { dependency: upgrade.depName, type: 'pnpm' },\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n throw new ExternalHostError(\n Error(\n 'lock file failed for the dependency being updated - skipping branch creation',\n ),\n NpmDatasource.id,\n );\n }\n }\n }\n artifactErrors.push({\n lockFile: pnpmShrinkwrap,\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n stderr: res.stderr || res.stdout,\n });\n } else {\n const existingContent = await getFile(\n pnpmShrinkwrap,\n config.reuseExistingBranch ? config.branchName : config.baseBranch,\n );\n if (res.lockFile === existingContent) {\n logger.debug(\"pnpm-lock.yaml hasn't changed\");\n } else {\n logger.debug('pnpm-lock.yaml needs updating');\n updatedArtifacts.push({\n type: 'addition',\n path: pnpmShrinkwrap,\n // TODO: can be undefined? (#22198)\n contents: res.lockFile!,\n });\n }\n }\n await resetNpmrcContent(lockFileDir, npmrcContent);\n }\n\n return { artifactErrors, updatedArtifacts };\n}\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/modules/manager/npm/post-update/index.ts"],"names":[],"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esContent":["// TODO: types (#22198)\nimport is from '@sindresorhus/is';\nimport deepmerge from 'deepmerge';\nimport upath from 'upath';\nimport { logger } from '../../../../logger';\nimport { ExternalHostError } from '../../../../types/errors/external-host-error';\nimport { getChildProcessEnv } from '../../../../util/exec/env';\nimport {\n ensureCacheDir,\n getSiblingFileName,\n readLocalFile,\n writeLocalFile,\n} from '../../../../util/fs';\nimport { getFile, getRepoStatus } from '../../../../util/git';\nimport type { FileChange } from '../../../../util/git/types';\nimport * as hostRules from '../../../../util/host-rules';\nimport { newlineRegex, regEx } from '../../../../util/regex';\nimport { ensureTrailingSlash } from '../../../../util/url';\nimport { dump, parseSingleYaml } from '../../../../util/yaml';\nimport { NpmDatasource } from '../../../datasource/npm';\nimport { scm } from '../../../platform/scm';\nimport type { PackageFile, PostUpdateConfig, Upgrade } from '../../types';\nimport { getZeroInstallPaths } from '../extract/yarn';\nimport type { NpmManagerData } from '../types';\nimport {\n composeLockFile,\n getNpmrcContent,\n parseLockFile,\n resetNpmrcContent,\n updateNpmrcContent,\n} from '../utils';\nimport * as npm from './npm';\nimport * as pnpm from './pnpm';\nimport { processHostRules } from './rules';\nimport type {\n AdditionalPackageFiles,\n ArtifactError,\n DetermineLockFileDirsResult,\n WriteExistingFilesResult,\n YarnRcYmlFile,\n} from './types';\nimport * as yarn from './yarn';\n\n// Strips empty values, deduplicates, and returns the directories from filenames\nconst getDirs = (arr: (string | null | undefined)[]): string[] =>\n Array.from(new Set(arr.filter(is.string)));\n\nexport function determineLockFileDirs(\n config: PostUpdateConfig,\n packageFiles: AdditionalPackageFiles,\n): DetermineLockFileDirsResult {\n const npmLockDirs: (string | undefined)[] = [];\n const yarnLockDirs: (string | undefined)[] = [];\n const pnpmShrinkwrapDirs: (string | undefined)[] = [];\n\n for (const upgrade of config.upgrades) {\n if (\n upgrade.updateType === 'lockFileMaintenance' ||\n upgrade.isRemediation === true ||\n upgrade.isLockfileUpdate === true\n ) {\n yarnLockDirs.push(upgrade.managerData?.yarnLock);\n npmLockDirs.push(upgrade.managerData?.npmLock);\n pnpmShrinkwrapDirs.push(upgrade.managerData?.pnpmShrinkwrap);\n }\n }\n\n if (\n config.upgrades.every(\n (upgrade: Upgrade) =>\n upgrade.updateType === 'lockFileMaintenance' ||\n upgrade.isLockfileUpdate,\n )\n ) {\n return {\n yarnLockDirs: getDirs(yarnLockDirs),\n npmLockDirs: getDirs(npmLockDirs),\n pnpmShrinkwrapDirs: getDirs(pnpmShrinkwrapDirs),\n };\n }\n\n function getPackageFile(\n fileName: string,\n ): Partial<PackageFile<NpmManagerData>> {\n logger.trace('Looking for packageFile: ' + fileName);\n\n for (const packageFile of packageFiles.npm!) {\n if (packageFile.packageFile === fileName) {\n logger.trace({ packageFile }, 'Found packageFile');\n return packageFile;\n }\n logger.trace('No match');\n }\n return {};\n }\n\n // TODO #22198\n for (const p of config.updatedPackageFiles!) {\n logger.trace(`Checking ${String(p.path)} for lock files`);\n const packageFile = getPackageFile(p.path);\n // istanbul ignore if\n if (!packageFile.managerData) {\n continue;\n }\n // push full lock file names and convert them later\n yarnLockDirs.push(packageFile.managerData.yarnLock);\n npmLockDirs.push(packageFile.managerData.npmLock);\n pnpmShrinkwrapDirs.push(packageFile.managerData.pnpmShrinkwrap);\n }\n\n return {\n yarnLockDirs: getDirs(yarnLockDirs),\n npmLockDirs: getDirs(npmLockDirs),\n pnpmShrinkwrapDirs: getDirs(pnpmShrinkwrapDirs),\n };\n}\n\nexport async function writeExistingFiles(\n config: PostUpdateConfig,\n packageFiles: AdditionalPackageFiles,\n): Promise<void> {\n if (!packageFiles.npm) {\n return;\n }\n const npmFiles = packageFiles.npm;\n logger.debug(\n { packageFiles: npmFiles.map((n) => n.packageFile) },\n 'Writing package.json files',\n );\n for (const packageFile of npmFiles) {\n // istanbul ignore if\n if (!packageFile.managerData) {\n continue;\n }\n // TODO #22198\n const basedir = upath.dirname(packageFile.packageFile!);\n const npmrc = packageFile.npmrc;\n const npmrcFilename = upath.join(basedir, '.npmrc');\n if (is.string(npmrc)) {\n try {\n await writeLocalFile(npmrcFilename, npmrc.replace(/\\n?$/, '\\n'));\n } catch (err) /* istanbul ignore next */ {\n logger.warn({ npmrcFilename, err }, 'Error writing .npmrc');\n }\n }\n const npmLock = packageFile.managerData.npmLock;\n if (npmLock) {\n const npmLockPath = npmLock;\n logger.debug(`Writing ${npmLock}`);\n let existingNpmLock: string;\n try {\n existingNpmLock = (await getFile(npmLock)) ?? '';\n } catch (err) /* istanbul ignore next */ {\n logger.warn({ err }, 'Error reading npm lock file');\n existingNpmLock = '';\n }\n const { detectedIndent, lockFileParsed: npmLockParsed } =\n parseLockFile(existingNpmLock);\n if (npmLockParsed) {\n const packageNames =\n 'packages' in npmLockParsed\n ? Object.keys(npmLockParsed.packages)\n : [];\n const widens: string[] = [];\n let lockFileChanged = false;\n for (const upgrade of config.upgrades) {\n if (upgrade.lockFiles && !upgrade.lockFiles.includes(npmLock)) {\n continue;\n }\n if (!upgrade.managerData) {\n continue;\n }\n if (\n upgrade.rangeStrategy === 'widen' &&\n upgrade.managerData.npmLock === npmLock\n ) {\n // TODO #22198\n widens.push(upgrade.depName!);\n }\n const { depName } = upgrade;\n for (const packageName of packageNames) {\n if (\n 'packages' in npmLockParsed &&\n (packageName === `node_modules/${depName}` ||\n packageName.startsWith(`node_modules/${depName}/`))\n ) {\n logger.trace({ packageName }, 'Massaging out package name');\n lockFileChanged = true;\n delete npmLockParsed.packages[packageName];\n }\n }\n }\n if (widens.length) {\n logger.debug(\n `Removing ${String(widens)} from ${npmLock} to force an update`,\n );\n lockFileChanged = true;\n try {\n if ('dependencies' in npmLockParsed && npmLockParsed.dependencies) {\n widens.forEach((depName) => {\n // TODO #22198\n delete npmLockParsed.dependencies![depName];\n });\n }\n } catch /* istanbul ignore next */ {\n logger.warn(\n { npmLock },\n 'Error massaging package-lock.json for widen',\n );\n }\n }\n if (lockFileChanged) {\n logger.debug('Massaging npm lock file before writing to disk');\n existingNpmLock = composeLockFile(npmLockParsed, detectedIndent);\n }\n await writeLocalFile(npmLockPath, existingNpmLock);\n }\n }\n }\n}\n\nexport async function writeUpdatedPackageFiles(\n config: PostUpdateConfig,\n): Promise<void> {\n logger.trace({ config }, 'writeUpdatedPackageFiles');\n logger.debug('Writing any updated package files');\n if (!config.updatedPackageFiles) {\n logger.debug('No files found');\n return;\n }\n const supportedLockFiles = ['package-lock.json', 'yarn.lock'];\n for (const packageFile of config.updatedPackageFiles) {\n if (packageFile.type !== 'addition') {\n continue;\n }\n if (\n supportedLockFiles.some((fileName) => packageFile.path.endsWith(fileName))\n ) {\n logger.debug(`Writing lock file: ${packageFile.path}`);\n // TODO #22198\n\n await writeLocalFile(packageFile.path, packageFile.contents!);\n continue;\n }\n if (!packageFile.path.endsWith('package.json')) {\n continue;\n }\n logger.debug(`Writing ${packageFile.path}`);\n await writeLocalFile(packageFile.path, packageFile.contents!);\n }\n}\n\n// istanbul ignore next\nasync function updateYarnOffline(\n lockFileDir: string,\n updatedArtifacts: FileChange[],\n): Promise<void> {\n try {\n const resolvedPaths: string[] = [];\n const yarnrcYml = await getFile(upath.join(lockFileDir, '.yarnrc.yml'));\n const yarnrc = await getFile(upath.join(lockFileDir, '.yarnrc'));\n\n // As .yarnrc.yml overrides .yarnrc in Yarn 1 (https://git.io/JUcco)\n // both files may exist, so check for .yarnrc.yml first\n if (yarnrcYml) {\n // Yarn 2 (offline cache and zero-installs)\n const paths = getZeroInstallPaths(yarnrcYml);\n resolvedPaths.push(...paths.map((p) => upath.join(lockFileDir, p)));\n } else if (yarnrc) {\n // Yarn 1 (offline mirror)\n const mirrorLine = yarnrc\n .split(newlineRegex)\n .find((line) => line.startsWith('yarn-offline-mirror '));\n if (mirrorLine) {\n const mirrorPath = ensureTrailingSlash(\n mirrorLine.split(' ')[1].replace(regEx(/\"/g), ''),\n );\n resolvedPaths.push(upath.join(lockFileDir, mirrorPath));\n }\n }\n logger.debug({ resolvedPaths }, 'updateYarnOffline resolvedPaths');\n\n if (resolvedPaths.length) {\n const status = await getRepoStatus();\n for (const f of status.modified.concat(status.not_added)) {\n if (resolvedPaths.some((p) => f.startsWith(p))) {\n updatedArtifacts.push({\n type: 'addition',\n path: f,\n contents: await readLocalFile(f),\n });\n }\n }\n for (const f of status.deleted || []) {\n if (resolvedPaths.some((p) => f.startsWith(p))) {\n updatedArtifacts.push({ type: 'deletion', path: f });\n }\n }\n }\n } catch (err) {\n logger.error({ err }, 'Error updating yarn offline packages');\n }\n}\n\n// TODO: move to ./yarn.ts\n// exported for testing\nexport async function updateYarnBinary(\n lockFileDir: string,\n updatedArtifacts: FileChange[],\n existingYarnrcYmlContent: string | undefined | null,\n): Promise<string | undefined | null> {\n let yarnrcYml = existingYarnrcYmlContent;\n try {\n const yarnrcYmlFilename = upath.join(lockFileDir, '.yarnrc.yml');\n yarnrcYml ??= (await getFile(yarnrcYmlFilename)) ?? undefined;\n const newYarnrcYml = await readLocalFile(yarnrcYmlFilename, 'utf8');\n if (!is.string(yarnrcYml) || !is.string(newYarnrcYml)) {\n return existingYarnrcYmlContent;\n }\n\n // TODO: use schema (#9610)\n const oldYarnPath = parseSingleYaml<YarnRcYmlFile>(yarnrcYml)?.yarnPath;\n const newYarnPath = parseSingleYaml<YarnRcYmlFile>(newYarnrcYml)?.yarnPath;\n if (\n !is.nonEmptyStringAndNotWhitespace(oldYarnPath) ||\n !is.nonEmptyStringAndNotWhitespace(newYarnPath)\n ) {\n return existingYarnrcYmlContent;\n }\n\n const oldYarnFullPath = upath.join(lockFileDir, oldYarnPath);\n const newYarnFullPath = upath.join(lockFileDir, newYarnPath);\n logger.debug({ oldYarnPath, newYarnPath }, 'Found updated Yarn binary');\n\n yarnrcYml = yarnrcYml.replace(oldYarnPath, newYarnPath);\n updatedArtifacts.push(\n {\n type: 'addition',\n path: yarnrcYmlFilename,\n contents: yarnrcYml,\n },\n {\n type: 'deletion',\n path: oldYarnFullPath,\n },\n {\n type: 'addition',\n path: newYarnFullPath,\n contents: await readLocalFile(newYarnFullPath, 'utf8'),\n isExecutable: true,\n },\n );\n } catch (err) /* istanbul ignore next */ {\n logger.error({ err }, 'Error updating Yarn binary');\n }\n return existingYarnrcYmlContent && yarnrcYml;\n}\n\nexport async function getAdditionalFiles(\n config: PostUpdateConfig<NpmManagerData>,\n packageFiles: AdditionalPackageFiles,\n): Promise<WriteExistingFilesResult> {\n logger.trace({ config }, 'getAdditionalFiles');\n const artifactErrors: ArtifactError[] = [];\n const updatedArtifacts: FileChange[] = [];\n if (!packageFiles.npm?.length) {\n return { artifactErrors, updatedArtifacts };\n }\n if (!config.updateLockFiles) {\n logger.debug('Skipping lock file generation');\n return { artifactErrors, updatedArtifacts };\n }\n if (\n config.reuseExistingBranch &&\n !config.updatedPackageFiles?.length &&\n config.upgrades?.every((upgrade) => upgrade.isLockfileUpdate)\n ) {\n logger.debug('Existing branch contains all necessary lock file updates');\n return { artifactErrors, updatedArtifacts };\n }\n logger.debug('Getting updated lock files');\n if (\n config.updateType === 'lockFileMaintenance' &&\n config.reuseExistingBranch &&\n (await scm.branchExists(config.branchName))\n ) {\n logger.debug('Skipping lockFileMaintenance update');\n return { artifactErrors, updatedArtifacts };\n }\n const dirs = determineLockFileDirs(config, packageFiles);\n logger.trace({ dirs }, 'lock file dirs');\n await writeExistingFiles(config, packageFiles);\n await writeUpdatedPackageFiles(config);\n\n const { additionalNpmrcContent, additionalYarnRcYml } = processHostRules();\n\n const env = {\n ...getChildProcessEnv(),\n NPM_CONFIG_CACHE: await ensureCacheDir('npm'),\n YARN_CACHE_FOLDER: await ensureCacheDir('yarn'),\n YARN_GLOBAL_FOLDER: await ensureCacheDir('berry'),\n npm_config_store: await ensureCacheDir('pnpm'),\n NODE_ENV: 'dev',\n };\n\n let token: string | undefined;\n try {\n ({ token } = hostRules.find({\n hostType: 'github',\n url: 'https://api.github.com/',\n }));\n token = token ? /* istanbul ignore next */ `${token}@` : token;\n } catch (err) /* istanbul ignore next */ {\n logger.warn({ err }, 'Error getting token for packageFile');\n }\n const tokenRe = regEx(`${token ?? ''}`, 'g', false);\n for (const npmLock of dirs.npmLockDirs) {\n const lockFileDir = upath.dirname(npmLock);\n const npmrcContent = await getNpmrcContent(lockFileDir);\n await updateNpmrcContent(lockFileDir, npmrcContent, additionalNpmrcContent);\n const fileName = upath.basename(npmLock);\n logger.debug(`Generating ${fileName} for ${lockFileDir}`);\n const upgrades = config.upgrades.filter(\n (upgrade) => upgrade.managerData?.npmLock === npmLock,\n );\n const res = await npm.generateLockFile(\n lockFileDir,\n env,\n fileName,\n config,\n upgrades,\n );\n if (res.error) {\n // istanbul ignore if\n if (res.stderr?.includes('No matching version found for')) {\n for (const upgrade of config.upgrades) {\n if (\n res.stderr.includes(\n `No matching version found for ${upgrade.depName}`,\n )\n ) {\n logger.debug(\n { dependency: upgrade.depName, type: 'npm' },\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n const err = new Error(\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n throw new ExternalHostError(err, NpmDatasource.id);\n }\n }\n }\n artifactErrors.push({\n lockFile: npmLock,\n stderr: res.stderr,\n });\n } else if (res.lockFile) {\n const existingContent = await getFile(\n npmLock,\n config.reuseExistingBranch ? config.branchName : config.baseBranch,\n );\n if (res.lockFile === existingContent) {\n logger.debug(`${npmLock} hasn't changed`);\n } else {\n logger.debug(`${npmLock} needs updating`);\n updatedArtifacts.push({\n type: 'addition',\n path: npmLock,\n // TODO: can this be undefined? (#22198)\n\n contents: res.lockFile.replace(tokenRe, ''),\n });\n }\n }\n await resetNpmrcContent(lockFileDir, npmrcContent);\n }\n\n for (const yarnLock of dirs.yarnLockDirs) {\n const lockFileDir = upath.dirname(yarnLock);\n const npmrcContent = await getNpmrcContent(lockFileDir);\n await updateNpmrcContent(lockFileDir, npmrcContent, additionalNpmrcContent);\n let yarnRcYmlFilename: string | undefined;\n let existingYarnrcYmlContent: string | undefined | null;\n if (additionalYarnRcYml) {\n yarnRcYmlFilename = getSiblingFileName(yarnLock, '.yarnrc.yml');\n existingYarnrcYmlContent = await readLocalFile(yarnRcYmlFilename, 'utf8');\n if (existingYarnrcYmlContent) {\n try {\n // TODO: use schema (#9610)\n const existingYarnrRcYml = parseSingleYaml<Record<string, unknown>>(\n existingYarnrcYmlContent,\n );\n\n const updatedYarnYrcYml = deepmerge(\n existingYarnrRcYml,\n yarn.fuzzyMatchAdditionalYarnrcYml(\n additionalYarnRcYml,\n existingYarnrRcYml,\n ),\n );\n\n await writeLocalFile(yarnRcYmlFilename, dump(updatedYarnYrcYml));\n logger.debug('Added authentication to .yarnrc.yml');\n } catch (err) {\n logger.warn({ err }, 'Error appending .yarnrc.yml content');\n }\n }\n }\n logger.debug(`Generating yarn.lock for ${lockFileDir}`);\n const lockFileName = upath.join(lockFileDir, 'yarn.lock');\n const upgrades = config.upgrades.filter(\n (upgrade) => upgrade.managerData?.yarnLock === yarnLock,\n );\n const res = await yarn.generateLockFile(lockFileDir, env, config, upgrades);\n if (res.error) {\n // istanbul ignore if\n if (res.stderr?.includes(`Couldn't find any versions for`)) {\n for (const upgrade of config.upgrades) {\n /* eslint-disable no-useless-escape */\n if (\n res.stderr.includes(\n `Couldn't find any versions for \\\\\\\"${upgrade.depName}\\\\\\\"`,\n )\n ) {\n logger.debug(\n { dependency: upgrade.depName, type: 'yarn' },\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n throw new ExternalHostError(\n new Error(\n 'lock file failed for the dependency being updated - skipping branch creation',\n ),\n NpmDatasource.id,\n );\n }\n /* eslint-enable no-useless-escape */\n }\n }\n artifactErrors.push({\n lockFile: yarnLock,\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n stderr: res.stderr || res.stdout,\n });\n } else {\n const existingContent = await getFile(\n lockFileName,\n config.reuseExistingBranch ? config.branchName : config.baseBranch,\n );\n if (res.lockFile === existingContent) {\n logger.debug(\"yarn.lock hasn't changed\");\n } else {\n logger.debug('yarn.lock needs updating');\n updatedArtifacts.push({\n type: 'addition',\n path: lockFileName,\n // TODO #22198\n contents: res.lockFile!,\n });\n await updateYarnOffline(lockFileDir, updatedArtifacts);\n }\n\n // istanbul ignore if: already tested seperately, needs additional test?\n if (upgrades.some(yarn.isYarnUpdate)) {\n existingYarnrcYmlContent = await updateYarnBinary(\n lockFileDir,\n updatedArtifacts,\n existingYarnrcYmlContent,\n );\n }\n }\n await resetNpmrcContent(lockFileDir, npmrcContent);\n // istanbul ignore if: needs test\n if (existingYarnrcYmlContent) {\n // TODO #22198\n await writeLocalFile(yarnRcYmlFilename!, existingYarnrcYmlContent);\n }\n }\n\n for (const pnpmShrinkwrap of dirs.pnpmShrinkwrapDirs) {\n const lockFileDir = upath.dirname(pnpmShrinkwrap);\n const npmrcContent = await getNpmrcContent(lockFileDir);\n await updateNpmrcContent(lockFileDir, npmrcContent, additionalNpmrcContent);\n logger.debug(`Generating pnpm-lock.yaml for ${lockFileDir}`);\n const upgrades = config.upgrades.filter(\n (upgrade) => upgrade.managerData?.pnpmShrinkwrap === pnpmShrinkwrap,\n );\n const res = await pnpm.generateLockFile(lockFileDir, env, config, upgrades);\n if (res.error) {\n // istanbul ignore if\n if (res.stdout?.includes(`No compatible version found:`)) {\n for (const upgrade of config.upgrades) {\n if (\n res.stdout.includes(\n `No compatible version found: ${upgrade.depName}`,\n )\n ) {\n logger.debug(\n { dependency: upgrade.depName, type: 'pnpm' },\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n throw new ExternalHostError(\n Error(\n 'lock file failed for the dependency being updated - skipping branch creation',\n ),\n NpmDatasource.id,\n );\n }\n }\n }\n artifactErrors.push({\n lockFile: pnpmShrinkwrap,\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n stderr: res.stderr || res.stdout,\n });\n } else {\n const existingContent = await getFile(\n pnpmShrinkwrap,\n config.reuseExistingBranch ? config.branchName : config.baseBranch,\n );\n if (res.lockFile === existingContent) {\n logger.debug(\"pnpm-lock.yaml hasn't changed\");\n } else {\n logger.debug('pnpm-lock.yaml needs updating');\n updatedArtifacts.push({\n type: 'addition',\n path: pnpmShrinkwrap,\n // TODO: can be undefined? (#22198)\n contents: res.lockFile!,\n });\n }\n }\n await resetNpmrcContent(lockFileDir, npmrcContent);\n }\n\n return { artifactErrors, updatedArtifacts };\n}\n"]}
|
@@ -9,6 +9,7 @@ const composer = tslib_1.__importStar(require("./composer"));
|
|
9
9
|
const conan = tslib_1.__importStar(require("./conan"));
|
10
10
|
const deb = tslib_1.__importStar(require("./deb"));
|
11
11
|
const debian = tslib_1.__importStar(require("./debian"));
|
12
|
+
const devbox = tslib_1.__importStar(require("./devbox"));
|
12
13
|
const docker = tslib_1.__importStar(require("./docker"));
|
13
14
|
const git = tslib_1.__importStar(require("./git"));
|
14
15
|
const glasskube = tslib_1.__importStar(require("./glasskube"));
|
@@ -52,6 +53,7 @@ api.set(composer.id, composer.api);
|
|
52
53
|
api.set(conan.id, conan.api);
|
53
54
|
api.set(deb.id, deb.api);
|
54
55
|
api.set(debian.id, debian.api);
|
56
|
+
api.set(devbox.id, devbox.api);
|
55
57
|
api.set(docker.id, docker.api);
|
56
58
|
api.set(git.id, git.api);
|
57
59
|
api.set(glasskube.id, glasskube.api);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../lib/modules/versioning/api.ts"],"names":[],"mappings":";;;AAAA,gFAA0D;AAC1D,uEAAiD;AACjD,oEAA8C;AAC9C,uDAAiC;AACjC,6DAAuC;AACvC,uDAAiC;AACjC,mDAA6B;AAC7B,yDAAmC;AACnC,yDAAmC;AACnC,mDAA6B;AAC7B,+DAAyC;AACzC,2EAAqD;AACrD,yDAAmC;AACnC,+DAAyC;AACzC,qDAA+B;AAC/B,yDAAmC;AACnC,mDAA6B;AAC7B,mDAA6B;AAC7B,wEAAkD;AAClD,uDAAiC;AACjC,uDAAiC;AACjC,2DAAqC;AACrC,qDAA+B;AAC/B,mDAA6B;AAC7B,uDAAiC;AACjC,yDAAmC;AACnC,qDAA+B;AAC/B,yDAAmC;AACnC,mDAA6B;AAC7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AC,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC","sourcesContent":["import * as amazonMachineImage from './aws-machine-image';\nimport * as azureRestApi from './azure-rest-api';\nimport * as bazelModule from './bazel-module';\nimport * as cargo from './cargo';\nimport * as composer from './composer';\nimport * as conan from './conan';\nimport * as deb from './deb';\nimport * as debian from './debian';\nimport * as docker from './docker';\nimport * as git from './git';\nimport * as glasskube from './glasskube';\nimport * as goModDirective from './go-mod-directive';\nimport * as gradle from './gradle';\nimport * as hashicorp from './hashicorp';\nimport * as helm from './helm';\nimport * as hermit from './hermit';\nimport * as hex from './hex';\nimport * as ivy from './ivy';\nimport * as kubernetesApi from './kubernetes-api';\nimport * as loose from './loose';\nimport * as maven from './maven';\nimport * as nixpkgs from './nixpkgs';\nimport * as node from './node';\nimport * as npm from './npm';\nimport * as nuget from './nuget';\nimport * as pep440 from './pep440';\nimport * as perl from './perl';\nimport * as poetry from './poetry';\nimport * as pvp from './pvp';\nimport * as python from './python';\nimport * as redhat from './redhat';\nimport * as regex from './regex';\nimport * as rez from './rez';\nimport * as rpm from './rpm';\nimport * as ruby from './ruby';\nimport * as sameMajor from './same-major';\nimport * as semver from './semver';\nimport * as semverCoerced from './semver-coerced';\nimport * as swift from './swift';\nimport type { VersioningApi, VersioningApiConstructor } from './types';\nimport * as ubuntu from './ubuntu';\nimport * as unity3d from './unity3d';\n\nconst api = new Map<string, VersioningApi | VersioningApiConstructor>();\nexport default api;\n\napi.set(amazonMachineImage.id, amazonMachineImage.api);\napi.set(azureRestApi.id, azureRestApi.api);\napi.set(bazelModule.id, bazelModule.api);\napi.set(cargo.id, cargo.api);\napi.set(composer.id, composer.api);\napi.set(conan.id, conan.api);\napi.set(deb.id, deb.api);\napi.set(debian.id, debian.api);\napi.set(docker.id, docker.api);\napi.set(git.id, git.api);\napi.set(glasskube.id, glasskube.api);\napi.set(goModDirective.id, goModDirective.api);\napi.set(gradle.id, gradle.api);\napi.set(hashicorp.id, hashicorp.api);\napi.set(helm.id, helm.api);\napi.set(hermit.id, hermit.api);\napi.set(hex.id, hex.api);\napi.set(ivy.id, ivy.api);\napi.set(kubernetesApi.id, kubernetesApi.api);\napi.set(loose.id, loose.api);\napi.set(maven.id, maven.api);\napi.set(nixpkgs.id, nixpkgs.api);\napi.set(node.id, node.api);\napi.set(npm.id, npm.api);\napi.set(nuget.id, nuget.api);\napi.set(pep440.id, pep440.api);\napi.set(perl.id, perl.api);\napi.set(poetry.id, poetry.api);\napi.set(pvp.id, pvp.api);\napi.set(python.id, python.api);\napi.set(redhat.id, redhat.api);\napi.set(regex.id, regex.api);\napi.set(rez.id, rez.api);\napi.set(rpm.id, rpm.api);\napi.set(ruby.id, ruby.api);\napi.set(sameMajor.id, sameMajor.api);\napi.set(semver.id, semver.api);\napi.set(semverCoerced.id, semverCoerced.api);\napi.set(swift.id, swift.api);\napi.set(ubuntu.id, ubuntu.api);\napi.set(unity3d.id, unity3d.api);\n"]}
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../lib/modules/versioning/api.ts"],"names":[],"mappings":";;;AAAA,gFAA0D;AAC1D,uEAAiD;AACjD,oEAA8C;AAC9C,uDAAiC;AACjC,6DAAuC;AACvC,uDAAiC;AACjC,mDAA6B;AAC7B,yDAAmC;AACnC,yDAAmC;AACnC,yDAAmC;AACnC,mDAA6B;AAC7B,+DAAyC;AACzC,2EAAqD;AACrD,yDAAmC;AACnC,+DAAyC;AACzC,qDAA+B;AAC/B,yDAAmC;AACnC,mDAA6B;AAC7B,mDAA6B;AAC7B,wEAAkD;AAClD,uDAAiC;AACjC,uDAAiC;AACjC,2DAAqC;AACrC,qDAA+B;AAC/B,mDAA6B;AAC7B,uDAAiC;AACjC,yDAAmC;AACnC,qDAA+B;AAC/B,yDAAmC;AACnC,mDAA6B;AAC7B,yDAAmC;AACnC,yDAAmC;AACnC,uDAAiC;AACjC,mDAA6B;AAC7B,mDAA6B;AAC7B,qDAA+B;AAC/B,gEAA0C;AAC1C,yDAAmC;A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,CAAC,CAAC","sourcesContent":["import * as amazonMachineImage from './aws-machine-image';\nimport * as azureRestApi from './azure-rest-api';\nimport * as bazelModule from './bazel-module';\nimport * as cargo from './cargo';\nimport * as composer from './composer';\nimport * as conan from './conan';\nimport * as deb from './deb';\nimport * as debian from './debian';\nimport * as devbox from './devbox';\nimport * as docker from './docker';\nimport * as git from './git';\nimport * as glasskube from './glasskube';\nimport * as goModDirective from './go-mod-directive';\nimport * as gradle from './gradle';\nimport * as hashicorp from './hashicorp';\nimport * as helm from './helm';\nimport * as hermit from './hermit';\nimport * as hex from './hex';\nimport * as ivy from './ivy';\nimport * as kubernetesApi from './kubernetes-api';\nimport * as loose from './loose';\nimport * as maven from './maven';\nimport * as nixpkgs from './nixpkgs';\nimport * as node from './node';\nimport * as npm from './npm';\nimport * as nuget from './nuget';\nimport * as pep440 from './pep440';\nimport * as perl from './perl';\nimport * as poetry from './poetry';\nimport * as pvp from './pvp';\nimport * as python from './python';\nimport * as redhat from './redhat';\nimport * as regex from './regex';\nimport * as rez from './rez';\nimport * as rpm from './rpm';\nimport * as ruby from './ruby';\nimport * as sameMajor from './same-major';\nimport * as semver from './semver';\nimport * as semverCoerced from './semver-coerced';\nimport * as swift from './swift';\nimport type { VersioningApi, VersioningApiConstructor } from './types';\nimport * as ubuntu from './ubuntu';\nimport * as unity3d from './unity3d';\n\nconst api = new Map<string, VersioningApi | VersioningApiConstructor>();\nexport default api;\n\napi.set(amazonMachineImage.id, amazonMachineImage.api);\napi.set(azureRestApi.id, azureRestApi.api);\napi.set(bazelModule.id, bazelModule.api);\napi.set(cargo.id, cargo.api);\napi.set(composer.id, composer.api);\napi.set(conan.id, conan.api);\napi.set(deb.id, deb.api);\napi.set(debian.id, debian.api);\napi.set(devbox.id, devbox.api);\napi.set(docker.id, docker.api);\napi.set(git.id, git.api);\napi.set(glasskube.id, glasskube.api);\napi.set(goModDirective.id, goModDirective.api);\napi.set(gradle.id, gradle.api);\napi.set(hashicorp.id, hashicorp.api);\napi.set(helm.id, helm.api);\napi.set(hermit.id, hermit.api);\napi.set(hex.id, hex.api);\napi.set(ivy.id, ivy.api);\napi.set(kubernetesApi.id, kubernetesApi.api);\napi.set(loose.id, loose.api);\napi.set(maven.id, maven.api);\napi.set(nixpkgs.id, nixpkgs.api);\napi.set(node.id, node.api);\napi.set(npm.id, npm.api);\napi.set(nuget.id, nuget.api);\napi.set(pep440.id, pep440.api);\napi.set(perl.id, perl.api);\napi.set(poetry.id, poetry.api);\napi.set(pvp.id, pvp.api);\napi.set(python.id, python.api);\napi.set(redhat.id, redhat.api);\napi.set(regex.id, regex.api);\napi.set(rez.id, rez.api);\napi.set(rpm.id, rpm.api);\napi.set(ruby.id, ruby.api);\napi.set(sameMajor.id, sameMajor.api);\napi.set(semver.id, semver.api);\napi.set(semverCoerced.id, semverCoerced.api);\napi.set(swift.id, swift.api);\napi.set(ubuntu.id, ubuntu.api);\napi.set(unity3d.id, unity3d.api);\n"]}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { VersioningApi } from '../types';
|
2
|
+
export declare const id = "devbox";
|
3
|
+
export declare const displayName = "devbox";
|
4
|
+
export declare const urls: never[];
|
5
|
+
export declare const supportsRanges = false;
|
6
|
+
export declare const api: VersioningApi;
|
7
|
+
export default api;
|
@@ -0,0 +1,65 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.api = exports.supportsRanges = exports.urls = exports.displayName = exports.id = void 0;
|
4
|
+
const regex_1 = require("../../../util/regex");
|
5
|
+
const generic_1 = require("../generic");
|
6
|
+
exports.id = 'devbox';
|
7
|
+
exports.displayName = 'devbox';
|
8
|
+
exports.urls = [];
|
9
|
+
exports.supportsRanges = false;
|
10
|
+
const validPattern = (0, regex_1.regEx)(/^((\d|[1-9]\d*)(\.(\d|[1-9]\d*)){0,2})$/);
|
11
|
+
const versionPattern = (0, regex_1.regEx)(/^((\d|[1-9]\d*)(\.(\d|[1-9]\d*)){2})$/);
|
12
|
+
class DevboxVersioningApi extends generic_1.GenericVersioningApi {
|
13
|
+
_parse(version) {
|
14
|
+
const matches = validPattern.exec(version);
|
15
|
+
if (!matches) {
|
16
|
+
return null;
|
17
|
+
}
|
18
|
+
const release = matches[0].split('.').map(Number);
|
19
|
+
return { release };
|
20
|
+
}
|
21
|
+
isValid(version) {
|
22
|
+
if (version === 'latest') {
|
23
|
+
return true;
|
24
|
+
}
|
25
|
+
return this._parse(version) !== null;
|
26
|
+
}
|
27
|
+
isVersion(version) {
|
28
|
+
if (version === 'latest') {
|
29
|
+
return false;
|
30
|
+
}
|
31
|
+
const matches = versionPattern.exec(version);
|
32
|
+
return !!matches;
|
33
|
+
}
|
34
|
+
matches(version, range) {
|
35
|
+
return this.isVersion(version) && this.equals(version, range);
|
36
|
+
}
|
37
|
+
_compare(version, other) {
|
38
|
+
const parsed1 = this._parse(version);
|
39
|
+
const parsed2 = this._parse(other);
|
40
|
+
// Treat "latest" as * and always return equal
|
41
|
+
if (other === 'latest' && parsed1) {
|
42
|
+
return 0;
|
43
|
+
}
|
44
|
+
// If either version is invalid, return unequal
|
45
|
+
if (!(parsed1 && parsed2)) {
|
46
|
+
return 1;
|
47
|
+
}
|
48
|
+
// support variable length compare
|
49
|
+
const length = Math.max(parsed1.release.length, parsed2.release.length);
|
50
|
+
for (let i = 0; i < length; i += 1) {
|
51
|
+
// 2.1 and 2.1.0 are equivalent
|
52
|
+
const part1 = parsed1.release[i];
|
53
|
+
const part2 = parsed2.release[i];
|
54
|
+
// if part1 or part2 is undefined, we should treat them as equal
|
55
|
+
// e.g. 1.0.0 === 1.0
|
56
|
+
if (part1 !== undefined && part2 !== undefined && part1 !== part2) {
|
57
|
+
return part1 - part2;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
return 0;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
exports.api = new DevboxVersioningApi();
|
64
|
+
exports.default = exports.api;
|
65
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @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AO,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;IAEkB,QAAQ,CAAC,OAAe,EAAE,KAAa;QACxD,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEnC,8CAA8C;QAC9C,IAAI,KAAK,KAAK,QAAQ,IAAI,OAAO,EAAE,CAAC;YAClC,OAAO,CAAC,CAAC;QACX,CAAC;QAED,+CAA+C;QAC/C,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC;YAC1B,OAAO,CAAC,CAAC;QACX,CAAC;QACD,kCAAkC;QAClC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACxE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YACnC,+BAA+B;YAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACjC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACjC,gEAAgE;YAChE,qBAAqB;YACrB,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;gBAClE,OAAO,KAAK,GAAG,KAAK,CAAC;YACvB,CAAC;QACH,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AAEY,QAAA,GAAG,GAAkB,IAAI,mBAAmB,EAAE,CAAC;AAE5D,kBAAe,WAAG,CAAC","sourcesContent":["import { regEx } from '../../../util/regex';\nimport type { GenericVersion } from '../generic';\nimport { GenericVersioningApi } from '../generic';\nimport type { VersioningApi } from '../types';\n\nexport const id = 'devbox';\nexport const displayName = 'devbox';\nexport const urls = [];\nexport const supportsRanges = false;\n\nconst validPattern = regEx(/^((\\d|[1-9]\\d*)(\\.(\\d|[1-9]\\d*)){0,2})$/);\nconst versionPattern = regEx(/^((\\d|[1-9]\\d*)(\\.(\\d|[1-9]\\d*)){2})$/);\n\nclass DevboxVersioningApi extends GenericVersioningApi {\n protected _parse(version: string): GenericVersion | null {\n const matches = validPattern.exec(version);\n if (!matches) {\n return null;\n }\n const release = matches[0].split('.').map(Number);\n return { release };\n }\n\n override isValid(version: string): boolean {\n if (version === 'latest') {\n return true;\n }\n return this._parse(version) !== null;\n }\n\n override isVersion(version: string): boolean {\n if (version === 'latest') {\n return false;\n }\n const matches = versionPattern.exec(version);\n return !!matches;\n }\n\n override matches(version: string, range: string): boolean {\n return this.isVersion(version) && this.equals(version, range);\n }\n\n protected override _compare(version: string, other: string): number {\n const parsed1 = this._parse(version);\n const parsed2 = this._parse(other);\n\n // Treat \"latest\" as * and always return equal\n if (other === 'latest' && parsed1) {\n return 0;\n }\n\n // If either version is invalid, return unequal\n if (!(parsed1 && parsed2)) {\n return 1;\n }\n // support variable length compare\n const length = Math.max(parsed1.release.length, parsed2.release.length);\n for (let i = 0; i < length; i += 1) {\n // 2.1 and 2.1.0 are equivalent\n const part1 = parsed1.release[i];\n const part2 = parsed2.release[i];\n // if part1 or part2 is undefined, we should treat them as equal\n // e.g. 1.0.0 === 1.0\n if (part1 !== undefined && part2 !== undefined && part1 !== part2) {\n return part1 - part2;\n }\n }\n return 0;\n }\n}\n\nexport const api: VersioningApi = new DevboxVersioningApi();\n\nexport default api;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../../../../lib/workers/global/config/parse/env.ts"],"names":[],"mappings":";;AA0BA,gCASC;AAmFD,8BA4HC;;AAlPD,kEAAkC;AAClC,0DAA0B;AAC1B,wDAAwD;AAExD,+CAA4C;AAC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BACH,CAAC;oBACD,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;wBACrC,IAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAY,KAAK,MAAM,EAAE,CAAC;4BAC/C,eAAM,CAAC,IAAI,CACT,gEAAgE,CACjE,CAAC;4BACF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;wBAClC,CAAC;6BAAM,IAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAY,KAAK,OAAO,EAAE,CAAC;4BACvD,eAAM,CAAC,IAAI,CACT,iEAAiE,CAClE,CAAC;4BACF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC;wBACnC,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,GAAG,CAAC,gBAAgB,EAAE,CAAC;QACzB,eAAM,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACpE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;YACpB,QAAQ,EAAE,QAAQ;YAClB,SAAS,EAAE,YAAY;YACvB,KAAK,EAAE,GAAG,CAAC,gBAAgB;SAC5B,CAAC,CAAC;IACL,CAAC;IAED,0EAA0E;IAC1E,MAAM,cAAc,GAAG;QACrB,iBAAiB;QACjB,oBAAoB;QACpB,oBAAoB;QACpB,iBAAiB;QACjB,cAAc;QACd,iBAAiB;QACjB,cAAc;QACd,eAAe;QACf,YAAY;KACb,CAAC;IAEF,cAAc,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAEjD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport JSON5 from 'json5';\nimport { getOptions } from '../../../../config/options';\nimport type { AllConfig } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport { coersions } from './coersions';\nimport type { ParseConfigOptions } from './types';\nimport { migrateAndValidateConfig } from './util';\n\nfunction normalizePrefixes(\n env: NodeJS.ProcessEnv,\n prefix: string | undefined,\n): NodeJS.ProcessEnv {\n const result = { ...env };\n if (prefix) {\n for (const [key, val] of Object.entries(result)) {\n if (key.startsWith(prefix)) {\n const newKey = key.replace(prefix, 'RENOVATE_');\n result[newKey] = val;\n delete result[key];\n }\n }\n }\n return result;\n}\n\nexport function getEnvName(option: ParseConfigOptions): string {\n if (option.env === false) {\n return '';\n }\n if (option.env) {\n return option.env;\n }\n const nameWithUnderscores = option.name.replace(/([A-Z])/g, '_$1');\n return `RENOVATE_${nameWithUnderscores.toUpperCase()}`;\n}\n\nconst renameKeys = {\n aliases: 'registryAliases',\n azureAutoComplete: 'platformAutomerge', // migrate: azureAutoComplete\n gitLabAutomerge: 'platformAutomerge', // migrate: gitLabAutomerge\n mergeConfidenceApiBaseUrl: 'mergeConfidenceEndpoint',\n mergeConfidenceSupportedDatasources: 'mergeConfidenceDatasources',\n};\n\nfunction renameEnvKeys(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {\n const result = { ...env };\n for (const [from, to] of Object.entries(renameKeys)) {\n const fromKey = getEnvName({ name: from });\n const toKey = getEnvName({ name: to });\n if (env[fromKey]) {\n result[toKey] = env[fromKey];\n delete result[fromKey];\n }\n }\n return result;\n}\n\nconst migratedKeysWithValues = [\n {\n oldName: 'recreateClosed',\n newName: 'recreateWhen',\n from: 'true',\n to: 'always',\n },\n {\n oldName: 'recreateClosed',\n newName: 'recreateWhen',\n from: 'false',\n to: 'auto',\n },\n];\n\nfunction massageEnvKeyValues(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {\n const result = { ...env };\n for (const { oldName, newName, from, to } of migratedKeysWithValues) {\n const key = getEnvName({ name: oldName });\n if (env[key] !== undefined) {\n if (result[key] === from) {\n delete result[key];\n result[getEnvName({ name: newName })] = to;\n }\n }\n }\n return result;\n}\n\n// these experimental env vars have been converted into self-hosted config options\nconst convertedExperimentalEnvVars = [\n 'RENOVATE_X_AUTODISCOVER_REPO_SORT',\n 'RENOVATE_X_AUTODISCOVER_REPO_ORDER',\n 'RENOVATE_X_DOCKER_MAX_PAGES',\n 'RENOVATE_X_DELETE_CONFIG_FILE',\n 'RENOVATE_X_S3_ENDPOINT',\n 'RENOVATE_X_S3_PATH_STYLE',\n 'RENOVATE_X_MERGE_CONFIDENCE_API_BASE_URL',\n 'RENOVATE_X_MERGE_CONFIDENCE_SUPPORTED_DATASOURCES',\n];\n\n/**\n * Massages the experimental env vars which have been converted to config options\n *\n * e.g. RENOVATE_X_AUTODISCOVER_REPO_SORT -> RENOVATE_AUTODISCOVER_REPO_SORT\n */\nfunction massageConvertedExperimentalVars(\n env: NodeJS.ProcessEnv,\n): NodeJS.ProcessEnv {\n const result = { ...env };\n for (const key of convertedExperimentalEnvVars) {\n if (env[key] !== undefined) {\n const newKey = key.replace('RENOVATE_X_', 'RENOVATE_');\n result[newKey] = env[key];\n delete result[key];\n }\n }\n return result;\n}\n\nexport async function getConfig(\n inputEnv: NodeJS.ProcessEnv,\n): Promise<AllConfig> {\n let env = inputEnv;\n env = normalizePrefixes(inputEnv, inputEnv.ENV_PREFIX);\n env = massageConvertedExperimentalVars(env);\n env = renameEnvKeys(env);\n // massage the values of migrated configuration keys\n env = massageEnvKeyValues(env);\n\n const options = getOptions();\n\n let config: AllConfig = {};\n\n if (env.RENOVATE_CONFIG) {\n try {\n config = JSON5.parse(env.RENOVATE_CONFIG);\n logger.debug({ config }, 'Detected config in env RENOVATE_CONFIG');\n\n config = await migrateAndValidateConfig(config, 'RENOVATE_CONFIG');\n } catch (err) {\n logger.fatal({ err }, 'Could not parse RENOVATE_CONFIG');\n process.exit(1);\n }\n }\n\n config.hostRules ||= [];\n\n options.forEach((option) => {\n if (option.env !== false) {\n const envName = getEnvName(option);\n const envVal = env[envName];\n if (envVal) {\n if (option.type === 'array' && option.subType === 'object') {\n try {\n const parsed = JSON5.parse(envVal);\n if (is.array(parsed)) {\n config[option.name] = parsed;\n } else {\n logger.debug(\n { val: envVal, envName },\n 'Could not parse object array',\n );\n }\n } catch {\n logger.debug(\n { val: envVal, envName },\n 'Could not parse environment variable',\n );\n }\n } else {\n const coerce = coersions[option.type];\n config[option.name] = coerce(envVal);\n if (option.name === 'dryRun') {\n if ((config[option.name] as string) === 'true') {\n logger.warn(\n 'env config dryRun property has been changed to full',\n );\n config[option.name] = 'full';\n } else if ((config[option.name] as string) === 'false') {\n logger.warn(\n 'env config dryRun property has been changed to null',\n );\n delete config[option.name];\n } else if ((config[option.name] as string) === 'null') {\n delete config[option.name];\n }\n }\n if (option.name === 'requireConfig') {\n if ((config[option.name] as string) === 'true') {\n logger.warn(\n 'env config requireConfig property has been changed to required',\n );\n config[option.name] = 'required';\n } else if ((config[option.name] as string) === 'false') {\n logger.warn(\n 'env config requireConfig property has been changed to optional',\n );\n config[option.name] = 'optional';\n }\n }\n if (option.name === 'platformCommit') {\n if ((config[option.name] as string) === 'true') {\n logger.warn(\n 'env config platformCommit property has been changed to enabled',\n );\n config[option.name] = 'enabled';\n } else if ((config[option.name] as string) === 'false') {\n logger.warn(\n 'env config platformCommit property has been changed to disabled',\n );\n config[option.name] = 'disabled';\n }\n }\n }\n }\n }\n });\n\n if (env.GITHUB_COM_TOKEN) {\n logger.debug(`Converting GITHUB_COM_TOKEN into a global host rule`);\n config.hostRules.push({\n hostType: 'github',\n matchHost: 'github.com',\n token: env.GITHUB_COM_TOKEN,\n });\n }\n\n // These env vars are deprecated and deleted to make sure they're not used\n const unsupportedEnv = [\n 'BITBUCKET_TOKEN',\n 'BITBUCKET_USERNAME',\n 'BITBUCKET_PASSWORD',\n 'GITHUB_ENDPOINT',\n 'GITHUB_TOKEN',\n 'GITLAB_ENDPOINT',\n 'GITLAB_TOKEN',\n 'VSTS_ENDPOINT',\n 'VSTS_TOKEN',\n ];\n\n unsupportedEnv.forEach((val) => delete env[val]);\n\n return config;\n}\n"]}
|
1
|
+
{"version":3,"file":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M,CAAC;AAChB,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport JSON5 from 'json5';\nimport { getOptions } from '../../../../config/options';\nimport type { AllConfig } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport { coersions } from './coersions';\nimport type { ParseConfigOptions } from './types';\nimport { migrateAndValidateConfig } from './util';\n\nfunction normalizePrefixes(\n env: NodeJS.ProcessEnv,\n prefix: string | undefined,\n): NodeJS.ProcessEnv {\n const result = { ...env };\n if (prefix) {\n for (const [key, val] of Object.entries(result)) {\n if (key.startsWith(prefix)) {\n const newKey = key.replace(prefix, 'RENOVATE_');\n result[newKey] = val;\n delete result[key];\n }\n }\n }\n return result;\n}\n\nexport function getEnvName(option: ParseConfigOptions): string {\n if (option.env === false) {\n return '';\n }\n if (option.env) {\n return option.env;\n }\n const nameWithUnderscores = option.name.replace(/([A-Z])/g, '_$1');\n return `RENOVATE_${nameWithUnderscores.toUpperCase()}`;\n}\n\nconst renameKeys = {\n aliases: 'registryAliases',\n azureAutoComplete: 'platformAutomerge', // migrate: azureAutoComplete\n gitLabAutomerge: 'platformAutomerge', // migrate: gitLabAutomerge\n mergeConfidenceApiBaseUrl: 'mergeConfidenceEndpoint',\n mergeConfidenceSupportedDatasources: 'mergeConfidenceDatasources',\n};\n\nfunction renameEnvKeys(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {\n const result = { ...env };\n for (const [from, to] of Object.entries(renameKeys)) {\n const fromKey = getEnvName({ name: from });\n const toKey = getEnvName({ name: to });\n if (env[fromKey]) {\n result[toKey] = env[fromKey];\n delete result[fromKey];\n }\n }\n return result;\n}\n\nconst migratedKeysWithValues = [\n {\n oldName: 'recreateClosed',\n newName: 'recreateWhen',\n from: 'true',\n to: 'always',\n },\n {\n oldName: 'recreateClosed',\n newName: 'recreateWhen',\n from: 'false',\n to: 'auto',\n },\n];\n\nfunction massageEnvKeyValues(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {\n const result = { ...env };\n for (const { oldName, newName, from, to } of migratedKeysWithValues) {\n const key = getEnvName({ name: oldName });\n if (env[key] !== undefined) {\n if (result[key] === from) {\n delete result[key];\n result[getEnvName({ name: newName })] = to;\n }\n }\n }\n return result;\n}\n\n// these experimental env vars have been converted into self-hosted config options\nconst convertedExperimentalEnvVars = [\n 'RENOVATE_X_AUTODISCOVER_REPO_SORT',\n 'RENOVATE_X_AUTODISCOVER_REPO_ORDER',\n 'RENOVATE_X_DOCKER_MAX_PAGES',\n 'RENOVATE_X_DELETE_CONFIG_FILE',\n 'RENOVATE_X_S3_ENDPOINT',\n 'RENOVATE_X_S3_PATH_STYLE',\n 'RENOVATE_X_MERGE_CONFIDENCE_API_BASE_URL',\n 'RENOVATE_X_MERGE_CONFIDENCE_SUPPORTED_DATASOURCES',\n];\n\n/**\n * Massages the experimental env vars which have been converted to config options\n *\n * e.g. RENOVATE_X_AUTODISCOVER_REPO_SORT -> RENOVATE_AUTODISCOVER_REPO_SORT\n */\nfunction massageConvertedExperimentalVars(\n env: NodeJS.ProcessEnv,\n): NodeJS.ProcessEnv {\n const result = { ...env };\n for (const key of convertedExperimentalEnvVars) {\n if (env[key] !== undefined) {\n const newKey = key.replace('RENOVATE_X_', 'RENOVATE_');\n result[newKey] = env[key];\n delete result[key];\n }\n }\n return result;\n}\n\nexport async function getConfig(\n inputEnv: NodeJS.ProcessEnv,\n): Promise<AllConfig> {\n let env = inputEnv;\n env = normalizePrefixes(inputEnv, inputEnv.ENV_PREFIX);\n env = massageConvertedExperimentalVars(env);\n env = renameEnvKeys(env);\n // massage the values of migrated configuration keys\n env = massageEnvKeyValues(env);\n\n const options = getOptions();\n\n let config: AllConfig = {};\n\n if (env.RENOVATE_CONFIG) {\n try {\n config = JSON5.parse(env.RENOVATE_CONFIG);\n logger.debug({ config }, 'Detected config in env RENOVATE_CONFIG');\n\n config = await migrateAndValidateConfig(config, 'RENOVATE_CONFIG');\n } catch (err) {\n logger.fatal({ err }, 'Could not parse RENOVATE_CONFIG');\n process.exit(1);\n }\n }\n\n config.hostRules ??= [];\n\n options.forEach((option) => {\n if (option.env !== false) {\n const envName = getEnvName(option);\n const envVal = env[envName];\n if (envVal) {\n if (option.type === 'array' && option.subType === 'object') {\n try {\n const parsed = JSON5.parse(envVal);\n if (is.array(parsed)) {\n config[option.name] = parsed;\n } else {\n logger.debug(\n { val: envVal, envName },\n 'Could not parse object array',\n );\n }\n } catch {\n logger.debug(\n { val: envVal, envName },\n 'Could not parse environment variable',\n );\n }\n } else {\n const coerce = coersions[option.type];\n config[option.name] = coerce(envVal);\n if (option.name === 'dryRun') {\n if ((config[option.name] as string) === 'true') {\n logger.warn(\n 'env config dryRun property has been changed to full',\n );\n config[option.name] = 'full';\n } else if ((config[option.name] as string) === 'false') {\n logger.warn(\n 'env config dryRun property has been changed to null',\n );\n delete config[option.name];\n } else if ((config[option.name] as string) === 'null') {\n delete config[option.name];\n }\n }\n if (option.name === 'requireConfig') {\n if ((config[option.name] as string) === 'true') {\n logger.warn(\n 'env config requireConfig property has been changed to required',\n );\n config[option.name] = 'required';\n } else if ((config[option.name] as string) === 'false') {\n logger.warn(\n 'env config requireConfig property has been changed to optional',\n );\n config[option.name] = 'optional';\n }\n }\n if (option.name === 'platformCommit') {\n if ((config[option.name] as string) === 'true') {\n logger.warn(\n 'env config platformCommit property has been changed to enabled',\n );\n config[option.name] = 'enabled';\n } else if ((config[option.name] as string) === 'false') {\n logger.warn(\n 'env config platformCommit property has been changed to disabled',\n );\n config[option.name] = 'disabled';\n }\n }\n }\n }\n }\n });\n\n if (env.GITHUB_COM_TOKEN) {\n logger.debug(`Converting GITHUB_COM_TOKEN into a global host rule`);\n config.hostRules.push({\n hostType: 'github',\n matchHost: 'github.com',\n token: env.GITHUB_COM_TOKEN,\n });\n }\n\n // These env vars are deprecated and deleted to make sure they're not used\n const unsupportedEnv = [\n 'BITBUCKET_TOKEN',\n 'BITBUCKET_USERNAME',\n 'BITBUCKET_PASSWORD',\n 'GITHUB_ENDPOINT',\n 'GITHUB_TOKEN',\n 'GITLAB_ENDPOINT',\n 'GITLAB_TOKEN',\n 'VSTS_ENDPOINT',\n 'VSTS_TOKEN',\n ];\n\n unsupportedEnv.forEach((val) => delete env[val]);\n\n return config;\n}\n"]}
|
@@ -83,9 +83,9 @@ async function detectVulnerabilityAlerts(input) {
|
|
83
83
|
const fileType = fileName.split('/').pop();
|
84
84
|
const firstPatchedVersion = alert.security_vulnerability.first_patched_version.identifier;
|
85
85
|
const advisory = alert.security_advisory;
|
86
|
-
combinedAlerts[fileName]
|
87
|
-
combinedAlerts[fileName][datasource]
|
88
|
-
combinedAlerts[fileName][datasource][depName]
|
86
|
+
combinedAlerts[fileName] ??= {};
|
87
|
+
combinedAlerts[fileName][datasource] ??= {};
|
88
|
+
combinedAlerts[fileName][datasource][depName] ??= {
|
89
89
|
advisories: [],
|
90
90
|
};
|
91
91
|
const alertDetails = combinedAlerts[fileName][datasource][depName];
|