renovate 44.176.2 → 44.176.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.js","names":["hostRules.find"],"sources":["../../../../lib/modules/manager/github-actions/artifacts.ts"],"sourcesContent":["import { quote } from 'shlex';\nimport { GlobalConfig } from '../../../config/global.ts';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages.ts';\nimport { logger } from '../../../logger/index.ts';\nimport { coerceArray } from '../../../util/array.ts';\nimport { findGithubToken } from '../../../util/check-token.ts';\nimport { detectPlatform } from '../../../util/common.ts';\nimport { exec } from '../../../util/exec/index.ts';\nimport type { ExecOptions, ExtraEnv } from '../../../util/exec/types.ts';\nimport { readLocalFile, writeLocalFile } from '../../../util/fs/index.ts';\nimport { getRepoStatus } from '../../../util/git/index.ts';\nimport type { FileChange } from '../../../util/git/types.ts';\nimport * as hostRules from '../../../util/host-rules.ts';\nimport { parseUrl } from '../../../util/url.ts';\nimport type { PackageFile, PostUpdateConfig } from '../types.ts';\nimport {\n artifactErrorMessageFromExecError,\n resolveToolConstraint,\n} from '../util.ts';\nimport { actionsLockFile, isLockfileManaged } from './common.ts';\nimport { ActionsLockfile } from './schema.ts';\nimport type { ActionsLockfileResult, OnboardedWorkflows } from './types.ts';\n\n/** The `gh` CLI extension that generates and verifies the lockfile. */\nconst extensionName = 'github/gh-actions-lock';\n\n/** The `uses:` dep types the lockfile graph is built from. */\nconst lockedDepTypes = ['action', 'workflow', 'docker'];\n\nfunction findToken(url: string): string | undefined {\n return findGithubToken(hostRules.find({ hostType: 'github', url }));\n}\n\n/**\n * `gh` takes the token from a different variable for GitHub Enterprise Server, and has to be told which host to talk to.\n *\n * Public actions are still resolved against github.com from there, so pass a token for both hosts.\n */\nfunction getTokenEnv(): ExtraEnv {\n const githubComEndpoint = 'https://api.github.com/';\n const configuredEndpoint = GlobalConfig.get('endpoint');\n // The configured endpoint only says where GitHub lives when Renovate is talking to GitHub: workflows mirrored onto another platform still resolve their actions against github.com.\n const endpoint =\n configuredEndpoint && detectPlatform(configuredEndpoint) === 'github'\n ? configuredEndpoint\n : githubComEndpoint;\n\n const hostname = parseUrl(endpoint)?.hostname;\n const isEnterprise =\n !!hostname && hostname !== 'api.github.com' && hostname !== 'github.com';\n\n const env: ExtraEnv = {};\n\n if (isEnterprise) {\n const enterpriseToken = findToken(endpoint);\n if (enterpriseToken) {\n env.GH_HOST = hostname;\n env.GH_ENTERPRISE_TOKEN = enterpriseToken;\n }\n }\n\n const token = findToken(githubComEndpoint);\n if (token) {\n env.GH_TOKEN = token;\n }\n\n if (!Object.keys(env).length) {\n logger.debug('No GitHub token found for `gh actions-lock`');\n }\n\n return env;\n}\n\n/**\n * Whether any updated dependency is one the lockfile records an edge for, and sits in a file `gh actions-lock` will look at.\n */\nfunction hasLockedUpdate(\n config: PostUpdateConfig,\n onboardedWorkflows: OnboardedWorkflows,\n): boolean {\n return config.upgrades.some((upgrade) => {\n if (upgrade.manager !== 'github-actions') {\n return false;\n }\n\n if (!upgrade.depType || !lockedDepTypes.includes(upgrade.depType)) {\n return false;\n }\n\n const packageFile = upgrade.packageFile;\n if (!packageFile) {\n return false;\n }\n\n return isLockfileManaged(packageFile, onboardedWorkflows);\n });\n}\n\n/**\n * Regenerate `.github/workflows/actions.lock` once per branch.\n *\n * The lockfile records a transitive graph - resolved commits, numeric owner and repository IDs, and each composite action's own `uses:` edges - so it is regenerated by its own tool rather than patched here.\n * `gh actions-lock` re-reads every workflow from disk and rewrites the whole file, so this runs after all of the branch's package file updates have been flushed, in the same shape as npm's `getAdditionalFiles`.\n */\nexport async function updateActionsLockfile(\n config: PostUpdateConfig,\n packageFiles: Record<string, PackageFile[]> | undefined,\n): Promise<ActionsLockfileResult> {\n const empty: ActionsLockfileResult = {\n updatedArtifacts: [],\n artifactErrors: [],\n };\n\n const ghaPackageFiles = packageFiles?.['github-actions'];\n if (!ghaPackageFiles?.length) {\n return empty;\n }\n\n if (config.skipArtifactsUpdate) {\n logger.debug(`Skipping ${actionsLockFile} generation`);\n return empty;\n }\n\n const existingLockFileContent = await readLocalFile(actionsLockFile, 'utf8');\n if (!existingLockFileContent) {\n logger.debug(`No ${actionsLockFile} found`);\n return empty;\n }\n\n const parsedLockfile = ActionsLockfile.safeParse(existingLockFileContent);\n if (!parsedLockfile.success) {\n logger.warn(\n { err: parsedLockfile.error, lockFile: actionsLockFile },\n 'Failed to parse the GitHub Actions lockfile, so not regenerating it',\n );\n return empty;\n }\n\n if (!hasLockedUpdate(config, parsedLockfile.data.workflows)) {\n logger.debug(`No locked dependencies updated for ${actionsLockFile}`);\n return empty;\n }\n\n logger.debug(`Regenerating ${actionsLockFile}`);\n\n const ghaPackageFilePaths = new Set(\n ghaPackageFiles.map((file) => file.packageFile),\n );\n\n // Ensure that in-memory file contents are flushed to disk, so `actions-lock` can run against it.\n // A branch can group updates from other managers, whose contents may be binary - a Gradle wrapper JAR, say - so only write the workflows which the tool actually reads.\n const writtenContent = new Map<string, string>();\n for (const file of coerceArray(config.updatedPackageFiles)) {\n if (file.type === 'addition' && ghaPackageFilePaths.has(file.path)) {\n const contents = file.contents!.toString();\n await writeLocalFile(file.path, contents);\n writtenContent.set(file.path, contents);\n }\n }\n\n const tokenEnv = getTokenEnv();\n\n const ghConstraint = await resolveToolConstraint(config, 'gh');\n const ghActionsLockConstraint = await resolveToolConstraint(\n config,\n 'ghActionsLock',\n );\n\n const execOptions: ExecOptions = {\n // The tool rescans every workflow, so it runs from the repository root\n cwd: GlobalConfig.get('localDir'),\n // `extraEnv` is what forwards a variable into the Docker sidecar, but on its own it is only a default: `getChildEnv` lets a same-named variable in Renovate's own environment win.\n // The token we resolved from the host rules must not be shadowed by an ambient `GH_TOKEN`, so force it as well.\n extraEnv: tokenEnv,\n env: tokenEnv,\n toolConstraints: [{ toolName: 'gh', constraint: ghConstraint }],\n docker: {},\n };\n\n // `--no-interactive`: we have no terminal to answer prompts with\n // `--no-narrow`: keep the ref that we wrote, to avoid a `@v4` being rewritten as `@v4.2.1`\n // `--no-migrate-local-actions`: on-by-default, but unrelated to our lockfile updates\n const commands = [\n 'gh actions-lock --no-interactive --no-narrow --no-migrate-local-actions',\n ];\n\n // `binarySource=global` means the administrator provisions tooling, so we must not reach into their `gh` install to add or re-pin an extension.\n // They own the extension version, and `constraints.ghActionsLock` does not apply.\n // TODO replace once containerbase/base#7279 is available\n if (GlobalConfig.get('binarySource') === 'global') {\n // Debug rather than warn: `constraints.ghActionsLock` ships with a default, so we cannot tell an explicit override from the default here, and warning would fire for every repository on this `binarySource`.\n logger.once.debug(\n { constraint: ghActionsLockConstraint },\n 'Not installing the `gh-actions-lock` extension, and ignoring `constraints.ghActionsLock`, because `binarySource=global` leaves tooling to the administrator',\n );\n } else {\n // `--force` makes an install a no-op when the specified version is already installed\n if (ghActionsLockConstraint) {\n commands.unshift(\n `gh extension install ${extensionName} --force --pin ${quote(ghActionsLockConstraint)}`,\n );\n } else {\n commands.unshift(`gh extension install ${extensionName} --force`);\n }\n }\n\n try {\n await exec(commands, execOptions);\n } catch (err) {\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, `Error updating ${actionsLockFile}`);\n return {\n updatedArtifacts: [],\n artifactErrors: [\n {\n fileName: actionsLockFile,\n // an `ExecError` always carries a `stderr`, so fall back to the message rather than rendering an artifact error with nothing in it\n stderr: artifactErrorMessageFromExecError(err, err.message),\n },\n ],\n };\n }\n\n const updatedArtifacts: FileChange[] = [];\n\n const newLockFileContent = await readLocalFile(actionsLockFile, 'utf8');\n if (newLockFileContent && newLockFileContent !== existingLockFileContent) {\n updatedArtifacts.push({\n type: 'addition',\n path: actionsLockFile,\n contents: newLockFileContent,\n });\n }\n\n // `actions-lock` may annotate workflows being managed with i.e. `# This workflow is managed by gh actions-lock.`, even if there were no updates to that workflow in this branch.\n // We should diff against Git, rather than against the branch's own updated package files, otherwise those annotations are left behind as uncommitted changes\n const status = await getRepoStatus();\n for (const path of status.modified) {\n // ignore the lockfile, as we've already committed it above, and any file which another manager owns\n if (path === actionsLockFile || !ghaPackageFilePaths.has(path)) {\n continue;\n }\n\n const newContent = await readLocalFile(path, 'utf8');\n // Whatever this branch wrote is committed as a package file update already, so only content which the tool changed on top of it is an artifact\n if (!newContent || newContent === writtenContent.get(path)) {\n continue;\n }\n logger.debug(`\\`gh actions-lock\\` annotated ${path}`);\n updatedArtifacts.push({\n type: 'addition',\n path,\n contents: newContent,\n });\n }\n\n if (!updatedArtifacts.length) {\n logger.debug(`${actionsLockFile} is unchanged`);\n }\n\n return { updatedArtifacts, artifactErrors: [] };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,MAAM,gBAAgB;;AAGtB,MAAM,iBAAiB;CAAC;CAAU;CAAY;AAAQ;AAEtD,SAAS,UAAU,KAAiC;CAClD,OAAO,gBAAgBA,KAAe;EAAE,UAAU;EAAU;CAAI,CAAC,CAAC;AACpE;;;;;;AAOA,SAAS,cAAwB;CAC/B,MAAM,oBAAoB;CAC1B,MAAM,qBAAqB,aAAa,IAAI,UAAU;CAEtD,MAAM,WACJ,sBAAsB,eAAe,kBAAkB,MAAM,WACzD,qBACA;CAEN,MAAM,WAAW,SAAS,QAAQ,CAAC,EAAE;CACrC,MAAM,eACJ,CAAC,CAAC,YAAY,aAAa,oBAAoB,aAAa;CAE9D,MAAM,MAAgB,CAAC;CAEvB,IAAI,cAAc;EAChB,MAAM,kBAAkB,UAAU,QAAQ;EAC1C,IAAI,iBAAiB;GACnB,IAAI,UAAU;GACd,IAAI,sBAAsB;EAC5B;CACF;CAEA,MAAM,QAAQ,UAAU,iBAAiB;CACzC,IAAI,OACF,IAAI,WAAW;CAGjB,IAAI,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC,QACpB,OAAO,MAAM,6CAA6C;CAG5D,OAAO;AACT;;;;AAKA,SAAS,gBACP,QACA,oBACS;CACT,OAAO,OAAO,SAAS,MAAM,YAAY;EACvC,IAAI,QAAQ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N;GACA,UAAU;EACZ,CAAC;CACH;CAEA,IAAI,CAAC,iBAAiB,QACpB,OAAO,MAAM,GAAG,gBAAgB,cAAc;CAGhD,OAAO;EAAE;EAAkB,gBAAgB,CAAC;CAAE;AAChD"}
1
+ {"version":3,"file":"artifacts.js","names":["hostRules.find"],"sources":["../../../../lib/modules/manager/github-actions/artifacts.ts"],"sourcesContent":["import { quote } from 'shlex';\nimport { GlobalConfig } from '../../../config/global.ts';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages.ts';\nimport { logger } from '../../../logger/index.ts';\nimport { coerceArray } from '../../../util/array.ts';\nimport { findGithubToken } from '../../../util/check-token.ts';\nimport { detectPlatform } from '../../../util/common.ts';\nimport { exec } from '../../../util/exec/index.ts';\nimport type { ExecOptions, ExtraEnv } from '../../../util/exec/types.ts';\nimport { readLocalFile, writeLocalFile } from '../../../util/fs/index.ts';\nimport { getRepoStatus } from '../../../util/git/index.ts';\nimport type { FileChange } from '../../../util/git/types.ts';\nimport * as hostRules from '../../../util/host-rules.ts';\nimport { parseUrl } from '../../../util/url.ts';\nimport type { PackageFile, PostUpdateConfig } from '../types.ts';\nimport {\n artifactErrorMessageFromExecError,\n resolveToolConstraint,\n} from '../util.ts';\nimport { actionsLockFile, isLockfileManaged } from './common.ts';\nimport { ActionsLockfile } from './schema.ts';\nimport type { ActionsLockfileResult, OnboardedWorkflows } from './types.ts';\n\n/** The `gh` CLI extension that generates and verifies the lockfile. */\nconst extensionName = 'github/gh-actions-lock';\n\n/** The `uses:` dep types the lockfile graph is built from. */\nconst lockedDepTypes = ['action', 'workflow', 'docker'];\n\nfunction findToken(url: string): string | undefined {\n return findGithubToken(hostRules.find({ hostType: 'github', url }));\n}\n\n/**\n * `gh` takes the token from a different variable for GitHub Enterprise Server, and has to be told which host to talk to.\n *\n * Public actions are still resolved against github.com from there, so pass a token for both hosts.\n */\nfunction getTokenEnv(): ExtraEnv {\n const githubComEndpoint = 'https://api.github.com/';\n const configuredEndpoint = GlobalConfig.get('endpoint');\n // The configured endpoint only says where GitHub lives when Renovate is talking to GitHub: workflows mirrored onto another platform still resolve their actions against github.com.\n const endpoint =\n configuredEndpoint && detectPlatform(configuredEndpoint) === 'github'\n ? configuredEndpoint\n : githubComEndpoint;\n\n const hostname = parseUrl(endpoint)?.hostname;\n const isEnterprise =\n !!hostname && hostname !== 'api.github.com' && hostname !== 'github.com';\n\n const env: ExtraEnv = {};\n\n if (isEnterprise) {\n const enterpriseToken = findToken(endpoint);\n if (enterpriseToken) {\n env.GH_HOST = hostname;\n env.GH_ENTERPRISE_TOKEN = enterpriseToken;\n }\n }\n\n const token = findToken(githubComEndpoint);\n if (token) {\n env.GH_TOKEN = token;\n }\n\n if (!Object.keys(env).length) {\n logger.debug('No GitHub token found for `gh actions-lock`');\n }\n\n return env;\n}\n\n/**\n * Whether any updated dependency is one the lockfile records an edge for, and sits in a file `gh actions-lock` will look at.\n */\nfunction hasLockedUpdate(\n config: PostUpdateConfig,\n onboardedWorkflows: OnboardedWorkflows,\n): boolean {\n return config.upgrades.some((upgrade) => {\n if (upgrade.manager !== 'github-actions') {\n return false;\n }\n\n if (!upgrade.depType || !lockedDepTypes.includes(upgrade.depType)) {\n return false;\n }\n\n const packageFile = upgrade.packageFile;\n if (!packageFile) {\n return false;\n }\n\n return isLockfileManaged(packageFile, onboardedWorkflows);\n });\n}\n\n/**\n * Regenerate `.github/workflows/actions.lock` once per branch.\n *\n * The lockfile records a transitive graph - resolved commits, numeric owner and repository IDs, and each composite action's own `uses:` edges - so it is regenerated by its own tool rather than patched here.\n * `gh actions-lock` re-reads every workflow from disk and rewrites the whole file, so this runs after all of the branch's package file updates have been flushed, in the same shape as npm's `getAdditionalFiles`.\n */\nexport async function updateActionsLockfile(\n config: PostUpdateConfig,\n packageFiles: Record<string, PackageFile[]> | undefined,\n): Promise<ActionsLockfileResult> {\n const empty: ActionsLockfileResult = {\n updatedArtifacts: [],\n artifactErrors: [],\n };\n\n const ghaPackageFiles = packageFiles?.['github-actions'];\n if (!ghaPackageFiles?.length) {\n return empty;\n }\n\n if (config.skipArtifactsUpdate) {\n logger.debug(`Skipping ${actionsLockFile} generation`);\n return empty;\n }\n\n const existingLockFileContent = await readLocalFile(actionsLockFile, 'utf8');\n if (!existingLockFileContent) {\n logger.debug(`No ${actionsLockFile} found`);\n return empty;\n }\n\n const parsedLockfile = ActionsLockfile.safeParse(existingLockFileContent);\n if (!parsedLockfile.success) {\n logger.warn(\n { err: parsedLockfile.error, lockFile: actionsLockFile },\n 'Failed to parse the GitHub Actions lockfile, so not regenerating it',\n );\n return empty;\n }\n\n if (!hasLockedUpdate(config, parsedLockfile.data.workflows)) {\n logger.debug(`No locked dependencies updated for ${actionsLockFile}`);\n return empty;\n }\n\n logger.debug(`Regenerating ${actionsLockFile}`);\n\n const ghaPackageFilePaths = new Set(\n ghaPackageFiles.map((file) => file.packageFile),\n );\n\n // Ensure that in-memory file contents are flushed to disk, so `actions-lock` can run against it.\n // A branch can group updates from other managers, whose contents may be binary - a Gradle wrapper JAR, say - so only write the workflows which the tool actually reads.\n const writtenContent = new Map<string, string>();\n for (const file of coerceArray(config.updatedPackageFiles)) {\n if (file.type === 'addition' && ghaPackageFilePaths.has(file.path)) {\n const contents = file.contents!.toString();\n await writeLocalFile(file.path, contents);\n writtenContent.set(file.path, contents);\n }\n }\n\n const tokenEnv = getTokenEnv();\n\n const ghConstraint = await resolveToolConstraint(config, 'gh');\n const ghActionsLockConstraint = await resolveToolConstraint(\n config,\n 'ghActionsLock',\n );\n\n const execOptions: ExecOptions = {\n // The tool rescans every workflow, so it runs from the repository root\n cwd: GlobalConfig.get('localDir'),\n // `extraEnv` is what forwards a variable into the Docker sidecar, but on its own it is only a default: `getChildEnv` lets a same-named variable in Renovate's own environment win.\n // The token we resolved from the host rules must not be shadowed by an ambient `GH_TOKEN`, so force it as well.\n extraEnv: tokenEnv,\n env: tokenEnv,\n toolConstraints: [{ toolName: 'gh', constraint: ghConstraint }],\n docker: {},\n };\n\n // `--no-interactive`: we have no terminal to answer prompts with\n // `--relock`: locked pins are sticky, so without it a changed ref fails with `Ref changed`\n // `--no-narrow`: keep the ref that we wrote, to avoid a `@v4` being rewritten as `@v4.2.1`\n // `--no-migrate-local-actions`: on-by-default, but unrelated to our lockfile updates\n const commands = [\n 'gh actions-lock --no-interactive --relock --no-narrow --no-migrate-local-actions',\n ];\n\n // `binarySource=global` means the administrator provisions tooling, so we must not reach into their `gh` install to add or re-pin an extension.\n // They own the extension version, and `constraints.ghActionsLock` does not apply.\n // TODO replace once containerbase/base#7279 is available\n if (GlobalConfig.get('binarySource') === 'global') {\n // Debug rather than warn: `constraints.ghActionsLock` ships with a default, so we cannot tell an explicit override from the default here, and warning would fire for every repository on this `binarySource`.\n logger.once.debug(\n { constraint: ghActionsLockConstraint },\n 'Not installing the `gh-actions-lock` extension, and ignoring `constraints.ghActionsLock`, because `binarySource=global` leaves tooling to the administrator',\n );\n } else {\n // `--force` makes an install a no-op when the specified version is already installed\n if (ghActionsLockConstraint) {\n commands.unshift(\n `gh extension install ${extensionName} --force --pin ${quote(ghActionsLockConstraint)}`,\n );\n } else {\n commands.unshift(`gh extension install ${extensionName} --force`);\n }\n }\n\n try {\n await exec(commands, execOptions);\n } catch (err) {\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, `Error updating ${actionsLockFile}`);\n return {\n updatedArtifacts: [],\n artifactErrors: [\n {\n fileName: actionsLockFile,\n // an `ExecError` always carries a `stderr`, so fall back to the message rather than rendering an artifact error with nothing in it\n stderr: artifactErrorMessageFromExecError(err, err.message),\n },\n ],\n };\n }\n\n const updatedArtifacts: FileChange[] = [];\n\n const newLockFileContent = await readLocalFile(actionsLockFile, 'utf8');\n if (newLockFileContent && newLockFileContent !== existingLockFileContent) {\n updatedArtifacts.push({\n type: 'addition',\n path: actionsLockFile,\n contents: newLockFileContent,\n });\n }\n\n // `actions-lock` may annotate workflows being managed with i.e. `# This workflow is managed by gh actions-lock.`, even if there were no updates to that workflow in this branch.\n // We should diff against Git, rather than against the branch's own updated package files, otherwise those annotations are left behind as uncommitted changes\n const status = await getRepoStatus();\n for (const path of status.modified) {\n // ignore the lockfile, as we've already committed it above, and any file which another manager owns\n if (path === actionsLockFile || !ghaPackageFilePaths.has(path)) {\n continue;\n }\n\n const newContent = await readLocalFile(path, 'utf8');\n // Whatever this branch wrote is committed as a package file update already, so only content which the tool changed on top of it is an artifact\n if (!newContent || newContent === writtenContent.get(path)) {\n continue;\n }\n logger.debug(`\\`gh actions-lock\\` annotated ${path}`);\n updatedArtifacts.push({\n type: 'addition',\n path,\n contents: newContent,\n });\n }\n\n if (!updatedArtifacts.length) {\n logger.debug(`${actionsLockFile} is unchanged`);\n }\n\n return { updatedArtifacts, artifactErrors: [] };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,MAAM,gBAAgB;;AAGtB,MAAM,iBAAiB;CAAC;CAAU;CAAY;AAAQ;AAEtD,SAAS,UAAU,KAAiC;CAClD,OAAO,gBAAgBA,KAAe;EAAE,UAAU;EAAU;CAAI,CAAC,CAAC;AACpE;;;;;;AAOA,SAAS,cAAwB;CAC/B,MAAM,oBAAoB;CAC1B,MAAM,qBAAqB,aAAa,IAAI,UAAU;CAEtD,MAAM,WACJ,sBAAsB,eAAe,kBAAkB,MAAM,WACzD,qBACA;CAEN,MAAM,WAAW,SAAS,QAAQ,CAAC,EAAE;CACrC,MAAM,eACJ,CAAC,CAAC,YAAY,aAAa,oBAAoB,aAAa;CAE9D,MAAM,MAAgB,CAAC;CAEvB,IAAI,cAAc;EAChB,MAAM,kBAAkB,UAAU,QAAQ;EAC1C,IAAI,iBAAiB;GACnB,IAAI,UAAU;GACd,IAAI,sBAAsB;EAC5B;CACF;CAEA,MAAM,QAAQ,UAAU,iBAAiB;CACzC,IAAI,OACF,IAAI,WAAW;CAGjB,IAAI,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC,QACpB,OAAO,MAAM,6CAA6C;CAG5D,OAAO;AACT;;;;A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IAAI,GACvD;EAEF,OAAO,MAAM,iCAAiC,MAAM;EACpD,iBAAiB,KAAK;GACpB,MAAM;GACN;GACA,UAAU;EACZ,CAAC;CACH;CAEA,IAAI,CAAC,iBAAiB,QACpB,OAAO,MAAM,GAAG,gBAAgB,cAAc;CAGhD,OAAO;EAAE;EAAkB,gBAAgB,CAAC;CAAE;AAChD"}
@@ -27,7 +27,7 @@ async function fetch(url, options, queueStats) {
27
27
  try {
28
28
  const resp = await got(url, { ...options });
29
29
  statusCode = resp.statusCode;
30
- duration = coerceNumber(resp.timings.phases.total, 0);
30
+ duration = coerceNumber(resp.timings?.phases.total, 0);
31
31
  return resp;
32
32
  } catch (error) {
33
33
  // v8 ignore else -- TODO: add test #40625
@@ -1 +1 @@
1
- {"version":3,"file":"got.js","names":[],"sources":["../../../lib/util/http/got.ts"],"sourcesContent":["// TODO: refactor code to remove this (#9651)\nimport './legacy.ts';\n\nimport { isNumber } from '@sindresorhus/is';\nimport type { OptionsInit } from 'got';\nimport got, { RequestError } from 'got';\nimport type { SetRequired } from 'type-fest';\nimport { logger } from '../../logger/index.ts';\nimport { coerceNumber } from '../number.ts';\nimport { type HttpRequestStatsDataPoint, HttpStats } from '../stats.ts';\nimport { coerceString } from '../string.ts';\nimport {\n type GotBufferOptions,\n GotExtraOptionKeys,\n type GotOptions,\n type HttpResponse,\n} from './types.ts';\n\nexport { RequestError } from 'got';\n\ntype QueueStatsData = Pick<HttpRequestStatsDataPoint, 'queueMs'>;\n\nexport function configureRejectUnauth(options: OptionsInit): void {\n if (process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0') {\n logger.once.warn(\n 'NODE_TLS_REJECT_UNAUTHORIZED=0 found, this is strongly discouraged.',\n );\n options.https = { ...options.https, rejectUnauthorized: false };\n }\n}\n\nexport async function fetch(\n url: string,\n options: SetRequired<GotOptions, 'method'>,\n queueStats: QueueStatsData,\n): Promise<HttpResponse<unknown>> {\n logger.trace({ url, options }, 'got request');\n configureRejectUnauth(options);\n\n let duration = 0;\n let statusCode = 0;\n try {\n // Cheat the TS compiler using `as` to pick a specific overload.\n // Otherwise it doesn't typecheck.\n const resp = await got(url, { ...options } as GotBufferOptions);\n statusCode = resp.statusCode;\n duration = coerceNumber(resp.timings.phases.total, 0);\n return resp;\n } catch (error) {\n // v8 ignore else -- TODO: add test #40625\n if (error instanceof RequestError) {\n statusCode = coerceNumber(error.response?.statusCode, -1);\n duration = coerceNumber(error.timings?.phases.total, -1);\n const method = options.method.toUpperCase();\n const code = coerceString(error.code, 'UNKNOWN');\n const retryCount = coerceNumber(error.request?.retryCount, -1);\n logger.debug(\n `${method} ${url} = (code=${code}, statusCode=${statusCode} retryCount=${retryCount}, duration=${duration})`,\n );\n }\n\n throw error;\n /* v8 ignore next: 🐛 https://github.com/bcoe/c8/issues/229 */\n } finally {\n HttpStats.write({\n method: options.method,\n url,\n reqMs: duration,\n queueMs: queueStats.queueMs,\n status: statusCode,\n });\n }\n}\n\nexport function stream(\n url: string,\n options: Omit<OptionsInit, 'isStream'>,\n): NodeJS.ReadableStream {\n configureRejectUnauth(options);\n return got.stream(url, options);\n}\n\n/**\n * Removes non-got options and normalizes some options to match got's expected format.\n * @param options options to normalize\n * @returns normalized got options\n */\nexport function normalize<T extends OptionsInit = OptionsInit>(\n options: T,\n keysToRemove: readonly string[],\n): T {\n // flat copy to void mutating the original options object\n const opts = { ...options };\n\n for (const key of [...GotExtraOptionKeys, ...keysToRemove]) {\n // @ts-expect-error -- delete extra options before passing to got\n delete opts[key];\n }\n\n // optimize options for got v12+\n if (isNumber(opts.timeout)) {\n opts.timeout = { request: opts.timeout };\n }\n\n return opts;\n}\n"],"mappings":";;;;;;;;;AAsBA,SAAgB,sBAAsB,SAA4B;CAChE,IAAI,QAAQ,IAAI,iCAAiC,KAAK;EACpD,OAAO,KAAK,KACV,qEACF;EACA,QAAQ,QAAQ;GAAE,GAAG,QAAQ;GAAO,oBAAoB;EAAM;CAChE;AACF;AAEA,eAAsB,MACpB,KACA,SACA,YACgC;CAChC,OAAO,MAAM;EAAE;EAAK;CAAQ,GAAG,aAAa;CAC5C,sBAAsB,OAAO;CAE7B,IAAI,WAAW;CACf,IAAI,aAAa;CACjB,IAAI;EAGF,MAAM,OAAO,MAAM,IAAI,KAAK,EAAE,GAAG,QAAQ,CAAqB;EAC9D,aAAa,KAAK;EAClB,WAAW,aAAa,KAAK,QAAQ,OAAO,OAAO,CAAC;EACpD,OAAO;CACT,SAAS,OAAO;;EAEd,IAAI,iBAAiB,cAAc;GACjC,aAAa,aAAa,MAAM,UAAU,YAAY,EAAE;GACxD,WAAW,aAAa,MAAM,SAAS,OAAO,OAAO,EAAE;GACvD,MAAM,SAAS,QAAQ,OAAO,YAAY;GAC1C,MAAM,OAAO,aAAa,MAAM,MAAM,SAAS;GAC/C,MAAM,aAAa,aAAa,MAAM,SAAS,YAAY,EAAE;GAC7D,OAAO,MACL,GAAG,OAAO,GAAG,IAAI,WAAW,KAAK,eAAe,WAAW,cAAc,WAAW,aAAa,SAAS,EAC5G;EACF;EAEA,MAAM;CAER,UAAU;EACR,UAAU,MAAM;GACd,QAAQ,QAAQ;GAChB;GACA,OAAO;GACP,SAAS,WAAW;GACpB,QAAQ;EACV,CAAC;CACH;AACF;AAEA,SAAgB,OACd,KACA,SACuB;CACvB,sBAAsB,OAAO;CAC7B,OAAO,IAAI,OAAO,KAAK,OAAO;AAChC;;;;;;AAOA,SAAgB,UACd,SACA,cACG;CAEH,MAAM,OAAO,EAAE,GAAG,QAAQ;CAE1B,KAAK,MAAM,OAAO,CAAC,GAAG,oBAAoB,GAAG,YAAY,GAEvD,OAAO,KAAK;CAId,IAAI,SAAS,KAAK,OAAO,GACvB,KAAK,UAAU,EAAE,SAAS,KAAK,QAAQ;CAGzC,OAAO;AACT"}
1
+ {"version":3,"file":"got.js","names":[],"sources":["../../../lib/util/http/got.ts"],"sourcesContent":["// TODO: refactor code to remove this (#9651)\nimport './legacy.ts';\n\nimport { isNumber } from '@sindresorhus/is';\nimport type { OptionsInit } from 'got';\nimport got, { RequestError } from 'got';\nimport type { SetRequired } from 'type-fest';\nimport { logger } from '../../logger/index.ts';\nimport { coerceNumber } from '../number.ts';\nimport { type HttpRequestStatsDataPoint, HttpStats } from '../stats.ts';\nimport { coerceString } from '../string.ts';\nimport {\n type GotBufferOptions,\n GotExtraOptionKeys,\n type GotOptions,\n type HttpResponse,\n} from './types.ts';\n\nexport { RequestError } from 'got';\n\ntype QueueStatsData = Pick<HttpRequestStatsDataPoint, 'queueMs'>;\n\nexport function configureRejectUnauth(options: OptionsInit): void {\n if (process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0') {\n logger.once.warn(\n 'NODE_TLS_REJECT_UNAUTHORIZED=0 found, this is strongly discouraged.',\n );\n options.https = { ...options.https, rejectUnauthorized: false };\n }\n}\n\nexport async function fetch(\n url: string,\n options: SetRequired<GotOptions, 'method'>,\n queueStats: QueueStatsData,\n): Promise<HttpResponse<unknown>> {\n logger.trace({ url, options }, 'got request');\n configureRejectUnauth(options);\n\n let duration = 0;\n let statusCode = 0;\n try {\n // Cheat the TS compiler using `as` to pick a specific overload.\n // Otherwise it doesn't typecheck.\n const resp = await got(url, { ...options } as GotBufferOptions);\n statusCode = resp.statusCode;\n duration = coerceNumber(resp.timings?.phases.total, 0);\n return resp;\n } catch (error) {\n // v8 ignore else -- TODO: add test #40625\n if (error instanceof RequestError) {\n statusCode = coerceNumber(error.response?.statusCode, -1);\n duration = coerceNumber(error.timings?.phases.total, -1);\n const method = options.method.toUpperCase();\n const code = coerceString(error.code, 'UNKNOWN');\n const retryCount = coerceNumber(error.request?.retryCount, -1);\n logger.debug(\n `${method} ${url} = (code=${code}, statusCode=${statusCode} retryCount=${retryCount}, duration=${duration})`,\n );\n }\n\n throw error;\n /* v8 ignore next: 🐛 https://github.com/bcoe/c8/issues/229 */\n } finally {\n HttpStats.write({\n method: options.method,\n url,\n reqMs: duration,\n queueMs: queueStats.queueMs,\n status: statusCode,\n });\n }\n}\n\nexport function stream(\n url: string,\n options: Omit<OptionsInit, 'isStream'>,\n): NodeJS.ReadableStream {\n configureRejectUnauth(options);\n return got.stream(url, options);\n}\n\n/**\n * Removes non-got options and normalizes some options to match got's expected format.\n * @param options options to normalize\n * @returns normalized got options\n */\nexport function normalize<T extends OptionsInit = OptionsInit>(\n options: T,\n keysToRemove: readonly string[],\n): T {\n // flat copy to void mutating the original options object\n const opts = { ...options };\n\n for (const key of [...GotExtraOptionKeys, ...keysToRemove]) {\n // @ts-expect-error -- delete extra options before passing to got\n delete opts[key];\n }\n\n // optimize options for got v12+\n if (isNumber(opts.timeout)) {\n opts.timeout = { request: opts.timeout };\n }\n\n return opts;\n}\n"],"mappings":";;;;;;;;;AAsBA,SAAgB,sBAAsB,SAA4B;CAChE,IAAI,QAAQ,IAAI,iCAAiC,KAAK;EACpD,OAAO,KAAK,KACV,qEACF;EACA,QAAQ,QAAQ;GAAE,GAAG,QAAQ;GAAO,oBAAoB;EAAM;CAChE;AACF;AAEA,eAAsB,MACpB,KACA,SACA,YACgC;CAChC,OAAO,MAAM;EAAE;EAAK;CAAQ,GAAG,aAAa;CAC5C,sBAAsB,OAAO;CAE7B,IAAI,WAAW;CACf,IAAI,aAAa;CACjB,IAAI;EAGF,MAAM,OAAO,MAAM,IAAI,KAAK,EAAE,GAAG,QAAQ,CAAqB;EAC9D,aAAa,KAAK;EAClB,WAAW,aAAa,KAAK,SAAS,OAAO,OAAO,CAAC;EACrD,OAAO;CACT,SAAS,OAAO;;EAEd,IAAI,iBAAiB,cAAc;GACjC,aAAa,aAAa,MAAM,UAAU,YAAY,EAAE;GACxD,WAAW,aAAa,MAAM,SAAS,OAAO,OAAO,EAAE;GACvD,MAAM,SAAS,QAAQ,OAAO,YAAY;GAC1C,MAAM,OAAO,aAAa,MAAM,MAAM,SAAS;GAC/C,MAAM,aAAa,aAAa,MAAM,SAAS,YAAY,EAAE;GAC7D,OAAO,MACL,GAAG,OAAO,GAAG,IAAI,WAAW,KAAK,eAAe,WAAW,cAAc,WAAW,aAAa,SAAS,EAC5G;EACF;EAEA,MAAM;CAER,UAAU;EACR,UAAU,MAAM;GACd,QAAQ,QAAQ;GAChB;GACA,OAAO;GACP,SAAS,WAAW;GACpB,QAAQ;EACV,CAAC;CACH;AACF;AAEA,SAAgB,OACd,KACA,SACuB;CACvB,sBAAsB,OAAO;CAC7B,OAAO,IAAI,OAAO,KAAK,OAAO;AAChC;;;;;;AAOA,SAAgB,UACd,SACA,cACG;CAEH,MAAM,OAAO,EAAE,GAAG,QAAQ;CAE1B,KAAK,MAAM,OAAO,CAAC,GAAG,oBAAoB,GAAG,YAAY,GAEvD,OAAO,KAAK;CAId,IAAI,SAAS,KAAK,OAAO,GACvB,KAAK,UAAU,EAAE,SAAS,KAAK,QAAQ;CAGzC,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"host-rules.js","names":["hostRules.find","hostRules.usesGithubUrlFallback"],"sources":["../../../lib/util/http/host-rules.ts"],"sourcesContent":["import { isNonEmptyString } from '@sindresorhus/is';\nimport { GlobalConfig } from '../../config/global.ts';\nimport { PLATFORM_FAMILIES } from '../../constants/index.ts';\nimport { logger } from '../../logger/index.ts';\nimport { hasProxy } from '../../proxy.ts';\nimport type { CombinedHostRuleWithTrustedHeaders } from '../host-rules.ts';\nimport * as hostRules from '../host-rules.ts';\nimport { matchRegexOrGlobList } from '../string-match.ts';\nimport { parseUrl } from '../url.ts';\nimport type { InternalHttpOptions } from './http.ts';\nimport { keepAliveAgents } from './keep-alive.ts';\nimport type { GotOptions } from './types.ts';\n\nexport type HostRulesGotOptions = Pick<\n GotOptions & InternalHttpOptions,\n | 'hostType'\n | 'noAuth'\n | 'headers'\n | 'token'\n | 'username'\n | 'password'\n | 'context'\n | 'enabled'\n | 'abortOnError'\n | 'abortIgnoreStatusCodes'\n | 'timeout'\n | 'agent'\n | 'http2'\n | 'https'\n | 'readOnly'\n>;\n\nexport function findMatchingRule<GotOptions extends HostRulesGotOptions>(\n url: string,\n options: GotOptions,\n): CombinedHostRuleWithTrustedHeaders {\n const { hostType, readOnly } = options;\n let res = hostRules.find({ hostType, url, readOnly });\n\n if (\n isNonEmptyString(res.token) ||\n isNonEmptyString(res.username) ||\n isNonEmptyString(res.password)\n ) {\n // do not fallback if we already have auth infos\n return res;\n }\n\n // Fallback to `github` hostType\n if (\n hostType &&\n PLATFORM_FAMILIES.github.apiUsingHostTypes.includes(hostType) &&\n hostType !== 'github'\n ) {\n res = {\n ...hostRules.find({\n hostType: 'github',\n url,\n }),\n ...res,\n };\n }\n\n // Fallback to `github` hostType for the GitHub.com API and the host of the GitHub platform endpoint, such as GitHub Enterprise Server or GitHub Enterprise Cloud\n if (hostRules.usesGithubUrlFallback(url)) {\n res = {\n ...hostRules.find({ hostType: 'github', url }),\n ...res,\n };\n }\n\n // Fallback to `gitlab` hostType\n if (\n hostType &&\n PLATFORM_FAMILIES.gitlab.apiUsingHostTypes.includes(hostType) &&\n hostType !== 'gitlab'\n ) {\n res = {\n ...hostRules.find({\n hostType: 'gitlab',\n url,\n }),\n ...res,\n };\n }\n\n // Fallback to `bitbucket` hostType\n if (\n hostType &&\n PLATFORM_FAMILIES.bitbucket.apiUsingHostTypes.includes(hostType) &&\n hostType !== 'bitbucket'\n ) {\n res = {\n ...hostRules.find({\n hostType: 'bitbucket',\n url,\n }),\n ...res,\n };\n }\n\n // Fallback to `bitbucket-server` hostType\n if (\n hostType &&\n PLATFORM_FAMILIES['bitbucket-server'].apiUsingHostTypes.includes(\n hostType,\n ) &&\n hostType !== 'bitbucket-server'\n ) {\n res = {\n ...hostRules.find({\n hostType: 'bitbucket-server',\n url,\n }),\n ...res,\n };\n }\n\n // Fallback to `forgejo` hostType\n if (\n hostType &&\n PLATFORM_FAMILIES.forgejo.apiUsingHostTypes.includes(hostType) &&\n hostType !== 'forgejo'\n ) {\n res = {\n ...hostRules.find({\n hostType: 'forgejo',\n url,\n }),\n ...res,\n };\n }\n\n // Fallback to `gitea` hostType\n if (\n hostType &&\n PLATFORM_FAMILIES.gitea.apiUsingHostTypes.includes(hostType) &&\n hostType !== 'gitea'\n ) {\n res = {\n ...hostRules.find({\n hostType: 'gitea',\n url,\n }),\n ...res,\n };\n }\n\n // Fallback to `go` hostType, which requests to a Go module proxy used until they were split into the `go-proxy` datasource\n if (hostType === 'go-proxy') {\n // only inherit the authentication-related fields\n const {\n token,\n authType,\n username,\n password,\n httpsCertificate,\n httpsPrivateKey,\n httpsCertificateAuthority,\n } = hostRules.find({ hostType: 'go', url });\n res = {\n token,\n authType,\n username,\n password,\n httpsCertificate,\n httpsPrivateKey,\n httpsCertificateAuthority,\n ...res,\n };\n }\n\n return res;\n}\n\n// Apply host rules to requests\nexport function applyHostRule<GotOptions extends HostRulesGotOptions>(\n url: string,\n options: GotOptions,\n hostRule: CombinedHostRuleWithTrustedHeaders,\n): GotOptions {\n if (hostRule.enabled === false) {\n options.enabled = false;\n return options;\n }\n\n const { username, password, token, authType } = hostRule;\n const host = parseUrl(url)?.host;\n if (options.noAuth) {\n logger.trace({ url }, `Authorization disabled`);\n } else if (\n isNonEmptyString(options.headers?.authorization) ||\n isNonEmptyString(options.password) ||\n isNonEmptyString(options.token)\n ) {\n logger.once.debug(`hostRules: authentication already set for ${host}`);\n logger.trace({ url }, `Authorization already set`);\n } else if (password !== undefined) {\n logger.once.debug(`hostRules: applying Basic authentication for ${host}`);\n logger.trace({ url }, `Applying Basic authentication`);\n options.username = username;\n options.password = password;\n } else if (token) {\n logger.once.debug(`hostRules: applying Bearer authentication for ${host}`);\n logger.trace({ url }, `Applying Bearer authentication`);\n options.token = token;\n options.context = { ...options.context, authType };\n } else {\n logger.once.debug(`hostRules: no authentication for ${host}`);\n }\n // Apply optional params\n if (hostRule.abortOnError) {\n options.abortOnError = hostRule.abortOnError;\n }\n\n if (hostRule.abortIgnoreStatusCodes) {\n options.abortIgnoreStatusCodes = hostRule.abortIgnoreStatusCodes;\n }\n\n if (hostRule.timeout) {\n options.timeout = hostRule.timeout;\n }\n\n if (hostRule.headers) {\n const allowedHeaders = GlobalConfig.get('allowedHeaders');\n // headers already known to have come from the self-hosted administrator's own (`trusted`) config bypassed `allowedHeaders` at registration - see `hostRules.add()` - so must not be re-checked, and dropped, here\n const trustedHeaderNames = new Set(hostRule.trustedHeaderNames);\n const filteredHeaders: Record<string, string> = {};\n\n for (const [header, value] of Object.entries(hostRule.headers)) {\n if (\n trustedHeaderNames.has(header) ||\n matchRegexOrGlobList(header, allowedHeaders)\n ) {\n filteredHeaders[header] = value;\n } else {\n logger.once.error(\n { allowedHeaders, header },\n 'Disallowed hostRules headers',\n );\n }\n }\n\n options.headers = {\n ...options.headers,\n ...filteredHeaders,\n };\n }\n\n if (hostRule.keepAlive) {\n options.agent = keepAliveAgents;\n }\n\n if (!hasProxy() && hostRule.enableHttp2 === true) {\n options.http2 = true;\n }\n\n if (isNonEmptyString(hostRule.httpsCertificateAuthority)) {\n options.https = {\n ...options.https,\n certificateAuthority: hostRule.httpsCertificateAuthority,\n };\n }\n\n if (isNonEmptyString(hostRule.httpsPrivateKey)) {\n options.https = {\n ...options.https,\n key: hostRule.httpsPrivateKey,\n };\n }\n\n if (isNonEmptyString(hostRule.httpsCertificate)) {\n options.https = {\n ...options.https,\n certificate: hostRule.httpsCertificate,\n };\n }\n\n return options;\n}\n"],"mappings":";;;;;;;;;;AAgCA,SAAgB,iBACd,KACA,SACoC;CACpC,MAAM,EAAE,UAAU,aAAa;CAC/B,IAAI,MAAMA,KAAe;EAAE;EAAU;EAAK;CAAS,CAAC;CAEpD,IACE,iBAAiB,IAAI,KAAK,KAC1B,iBAAiB,IAAI,QAAQ,KAC7B,iBAAiB,IAAI,QAAQ,GAG7B,OAAO;CAIT,IACE,YACA,kBAAkB,OAAO,kBAAkB,SAAS,QAAQ,KAC5D,aAAa,UAEb,MAAM;EACJ,GAAGA,KAAe;GAChB,UAAU;GACV;EACF,CAAC;EACD,GAAG;CACL;CAIF,IAAIC,sBAAgC,GAAG,GACrC,MAAM;EACJ,GAAGD,KAAe;GA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ACd,GAAG,QAAQ;EACX,sBAAsB,SAAS;CACjC;CAGF,IAAI,iBAAiB,SAAS,eAAe,GAC3C,QAAQ,QAAQ;EACd,GAAG,QAAQ;EACX,KAAK,SAAS;CAChB;CAGF,IAAI,iBAAiB,SAAS,gBAAgB,GAC5C,QAAQ,QAAQ;EACd,GAAG,QAAQ;EACX,aAAa,SAAS;CACxB;CAGF,OAAO;AACT"}
1
+ {"version":3,"file":"host-rules.js","names":["hostRules.find","hostRules.usesGithubUrlFallback"],"sources":["../../../lib/util/http/host-rules.ts"],"sourcesContent":["import { isNonEmptyString } from '@sindresorhus/is';\nimport { GlobalConfig } from '../../config/global.ts';\nimport { PLATFORM_FAMILIES } from '../../constants/index.ts';\nimport { logger } from '../../logger/index.ts';\nimport { hasProxy } from '../../proxy.ts';\nimport type { CombinedHostRuleWithTrustedHeaders } from '../host-rules.ts';\nimport * as hostRules from '../host-rules.ts';\nimport { matchRegexOrGlobList } from '../string-match.ts';\nimport { parseUrl } from '../url.ts';\nimport type { InternalHttpOptions } from './http.ts';\nimport { keepAliveAgents } from './keep-alive.ts';\nimport type { GotOptions } from './types.ts';\n\nexport type HostRulesGotOptions = Pick<\n GotOptions & Omit<InternalHttpOptions, 'headers'>,\n | 'hostType'\n | 'noAuth'\n | 'headers'\n | 'token'\n | 'username'\n | 'password'\n | 'context'\n | 'enabled'\n | 'abortOnError'\n | 'abortIgnoreStatusCodes'\n | 'timeout'\n | 'agent'\n | 'http2'\n | 'https'\n | 'readOnly'\n>;\n\nexport function findMatchingRule<GotOptions extends HostRulesGotOptions>(\n url: string,\n options: GotOptions,\n): CombinedHostRuleWithTrustedHeaders {\n const { hostType, readOnly } = options;\n let res = hostRules.find({ hostType, url, readOnly });\n\n if (\n isNonEmptyString(res.token) ||\n isNonEmptyString(res.username) ||\n isNonEmptyString(res.password)\n ) {\n // do not fallback if we already have auth infos\n return res;\n }\n\n // Fallback to `github` hostType\n if (\n hostType &&\n PLATFORM_FAMILIES.github.apiUsingHostTypes.includes(hostType) &&\n hostType !== 'github'\n ) {\n res = {\n ...hostRules.find({\n hostType: 'github',\n url,\n }),\n ...res,\n };\n }\n\n // Fallback to `github` hostType for the GitHub.com API and the host of the GitHub platform endpoint, such as GitHub Enterprise Server or GitHub Enterprise Cloud\n if (hostRules.usesGithubUrlFallback(url)) {\n res = {\n ...hostRules.find({ hostType: 'github', url }),\n ...res,\n };\n }\n\n // Fallback to `gitlab` hostType\n if (\n hostType &&\n PLATFORM_FAMILIES.gitlab.apiUsingHostTypes.includes(hostType) &&\n hostType !== 'gitlab'\n ) {\n res = {\n ...hostRules.find({\n hostType: 'gitlab',\n url,\n }),\n ...res,\n };\n }\n\n // Fallback to `bitbucket` hostType\n if (\n hostType &&\n PLATFORM_FAMILIES.bitbucket.apiUsingHostTypes.includes(hostType) &&\n hostType !== 'bitbucket'\n ) {\n res = {\n ...hostRules.find({\n hostType: 'bitbucket',\n url,\n }),\n ...res,\n };\n }\n\n // Fallback to `bitbucket-server` hostType\n if (\n hostType &&\n PLATFORM_FAMILIES['bitbucket-server'].apiUsingHostTypes.includes(\n hostType,\n ) &&\n hostType !== 'bitbucket-server'\n ) {\n res = {\n ...hostRules.find({\n hostType: 'bitbucket-server',\n url,\n }),\n ...res,\n };\n }\n\n // Fallback to `forgejo` hostType\n if (\n hostType &&\n PLATFORM_FAMILIES.forgejo.apiUsingHostTypes.includes(hostType) &&\n hostType !== 'forgejo'\n ) {\n res = {\n ...hostRules.find({\n hostType: 'forgejo',\n url,\n }),\n ...res,\n };\n }\n\n // Fallback to `gitea` hostType\n if (\n hostType &&\n PLATFORM_FAMILIES.gitea.apiUsingHostTypes.includes(hostType) &&\n hostType !== 'gitea'\n ) {\n res = {\n ...hostRules.find({\n hostType: 'gitea',\n url,\n }),\n ...res,\n };\n }\n\n // Fallback to `go` hostType, which requests to a Go module proxy used until they were split into the `go-proxy` datasource\n if (hostType === 'go-proxy') {\n // only inherit the authentication-related fields\n const {\n token,\n authType,\n username,\n password,\n httpsCertificate,\n httpsPrivateKey,\n httpsCertificateAuthority,\n } = hostRules.find({ hostType: 'go', url });\n res = {\n token,\n authType,\n username,\n password,\n httpsCertificate,\n httpsPrivateKey,\n httpsCertificateAuthority,\n ...res,\n };\n }\n\n return res;\n}\n\n// Apply host rules to requests\nexport function applyHostRule<GotOptions extends HostRulesGotOptions>(\n url: string,\n options: GotOptions,\n hostRule: CombinedHostRuleWithTrustedHeaders,\n): GotOptions {\n if (hostRule.enabled === false) {\n options.enabled = false;\n return options;\n }\n\n const { username, password, token, authType } = hostRule;\n const host = parseUrl(url)?.host;\n if (options.noAuth) {\n logger.trace({ url }, `Authorization disabled`);\n } else if (\n isNonEmptyString(options.headers?.authorization) ||\n isNonEmptyString(options.password) ||\n isNonEmptyString(options.token)\n ) {\n logger.once.debug(`hostRules: authentication already set for ${host}`);\n logger.trace({ url }, `Authorization already set`);\n } else if (password !== undefined) {\n logger.once.debug(`hostRules: applying Basic authentication for ${host}`);\n logger.trace({ url }, `Applying Basic authentication`);\n options.username = username;\n options.password = password;\n } else if (token) {\n logger.once.debug(`hostRules: applying Bearer authentication for ${host}`);\n logger.trace({ url }, `Applying Bearer authentication`);\n options.token = token;\n options.context = { ...options.context, authType };\n } else {\n logger.once.debug(`hostRules: no authentication for ${host}`);\n }\n // Apply optional params\n if (hostRule.abortOnError) {\n options.abortOnError = hostRule.abortOnError;\n }\n\n if (hostRule.abortIgnoreStatusCodes) {\n options.abortIgnoreStatusCodes = hostRule.abortIgnoreStatusCodes;\n }\n\n if (hostRule.timeout) {\n options.timeout = hostRule.timeout;\n }\n\n if (hostRule.headers) {\n const allowedHeaders = GlobalConfig.get('allowedHeaders');\n // headers already known to have come from the self-hosted administrator's own (`trusted`) config bypassed `allowedHeaders` at registration - see `hostRules.add()` - so must not be re-checked, and dropped, here\n const trustedHeaderNames = new Set(hostRule.trustedHeaderNames);\n const filteredHeaders: Record<string, string> = {};\n\n for (const [header, value] of Object.entries(hostRule.headers)) {\n if (\n trustedHeaderNames.has(header) ||\n matchRegexOrGlobList(header, allowedHeaders)\n ) {\n filteredHeaders[header] = value;\n } else {\n logger.once.error(\n { allowedHeaders, header },\n 'Disallowed hostRules headers',\n );\n }\n }\n\n options.headers = {\n ...options.headers,\n ...filteredHeaders,\n };\n }\n\n if (hostRule.keepAlive) {\n options.agent = keepAliveAgents;\n }\n\n if (!hasProxy() && hostRule.enableHttp2 === true) {\n options.http2 = true;\n }\n\n if (isNonEmptyString(hostRule.httpsCertificateAuthority)) {\n options.https = {\n ...options.https,\n certificateAuthority: hostRule.httpsCertificateAuthority,\n };\n }\n\n if (isNonEmptyString(hostRule.httpsPrivateKey)) {\n options.https = {\n ...options.https,\n key: hostRule.httpsPrivateKey,\n };\n }\n\n if (isNonEmptyString(hostRule.httpsCertificate)) {\n options.https = {\n ...options.https,\n certificate: hostRule.httpsCertificate,\n };\n }\n\n return options;\n}\n"],"mappings":";;;;;;;;;;AAgCA,SAAgB,iBACd,KACA,SACoC;CACpC,MAAM,EAAE,UAAU,aAAa;CAC/B,IAAI,MAAMA,KAAe;EAAE;EAAU;EAAK;CAAS,CAAC;CAEpD,IACE,iBAAiB,IAAI,KAAK,KAC1B,iBAAiB,IAAI,QAAQ,KAC7B,iBAAiB,IAAI,QAAQ,GAG7B,OAAO;CAIT,IACE,YACA,kBAAkB,OAAO,kBAAkB,SAAS,QAAQ,KAC5D,aAAa,UAEb,MAAM;EACJ,GAAGA,KAAe;GAChB,UAAU;GACV;EACF,CAAC;EACD,GAAG;CACL;CAIF,IAAIC,sBAAgC,GAAG,GACrC,MAAM;EACJ,GAAGD,KAAe;GAAE,UAAU;GAAU;EAAI,CAAC;EAC7C,GAAG;CACL;CAIF,IACE,YACA,kBAAkB,OAAO,kBAAkB,SAAS,QAAQ,KAC5D,aAAa,UAEb,MAAM;EACJ,GAAGA,KAAe;GAChB,UAAU;GACV;EACF,CAAC;EACD,GAAG;CACL;CAIF,IACE,YACA,kBAAkB,UAAU,kBAAkB,SAAS,QAAQ,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GF,OAAO;AACT"}
@@ -99,7 +99,8 @@ async function readDashboardBody(config) {
99
99
  dependencyDashboardAllRateLimited: false
100
100
  };
101
101
  const stringifiedConfig = JSON.stringify(config);
102
- if (config.dependencyDashboard === true || stringifiedConfig.includes("\"dependencyDashboardApproval\":true") || stringifiedConfig.includes("\"prCreation\":\"approval\"")) {
102
+ if (config.mode === "silent") logger.debug("Ignoring Dependency Dashboard checkboxes when mode=silent");
103
+ else if (config.dependencyDashboard === true || stringifiedConfig.includes("\"dependencyDashboardApproval\":true") || stringifiedConfig.includes("\"prCreation\":\"approval\"")) {
103
104
  config.dependencyDashboardTitle = config.dependencyDashboardTitle ?? `Dependency Dashboard`;
104
105
  const issue = await platform.findIssue(config.dependencyDashboardTitle);
105
106
  if (issue) {
@@ -1 +1 @@
1
- {"version":3,"file":"dependency-dashboard.js","names":["template.compile"],"sources":["../../../lib/workers/repository/dependency-dashboard.ts"],"sourcesContent":["import {\n isNonEmptyArray,\n isNonEmptyObject,\n isNonEmptyString,\n isNullOrUndefined,\n isTruthy,\n} from '@sindresorhus/is';\nimport { DateTime } from 'luxon';\nimport { GlobalConfig } from '../../config/global.ts';\nimport type { RenovateConfig } from '../../config/types.ts';\nimport { logger } from '../../logger/index.ts';\nimport type { PackageFile } from '../../modules/manager/types.ts';\nimport { platform } from '../../modules/platform/index.ts';\nimport { coerceArray } from '../../util/array.ts';\nimport { emojify } from '../../util/emoji.ts';\nimport { regEx } from '../../util/regex.ts';\nimport { coerceString } from '../../util/string.ts';\nimport * as template from '../../util/template/index.ts';\nimport type { BranchConfig, SelectAllConfig } from '../types.ts';\nimport { extractRepoProblems, replacementAlreadyExists } from './common.ts';\nimport type { ConfigMigrationResult } from './config-migration/index.ts';\nimport { getDepWarningsDashboard } from './errors-warnings.ts';\nimport { PackageFiles } from './package-files.ts';\nimport type { Vulnerability } from './process/types.ts';\nimport { Vulnerabilities } from './process/vulnerabilities.ts';\nimport type {\n DependencyDashboardCheck,\n DependencyDashboardListItemType,\n} from './types.ts';\n\ninterface DependencyDashboard {\n dependencyDashboardChecks: Record<string, string>;\n dependencyDashboardRebaseAllOpen: boolean;\n dependencyDashboardAllPending: boolean;\n dependencyDashboardAllRateLimited: boolean;\n dependencyDashboardAllAwaitingSchedule: boolean;\n}\n\nconst rateLimitedRe = regEx(\n ` - \\\\[ \\\\] ${getMarkdownComment('unlimit-branch=([^\\\\s]+)')}`,\n 'g',\n);\nconst pendingApprovalRe = regEx(\n ` - \\\\[ \\\\] ${getMarkdownComment('approve-branch=([^\\\\s]+)')}`,\n 'g',\n);\nconst awaitingScheduleRe = regEx(\n ` - \\\\[ \\\\] ${getMarkdownComment('unschedule-branch=([^\\\\s]+)')}`,\n 'g',\n);\nconst generalBranchRe = regEx(\n ` ${getMarkdownComment('([a-zA-Z]+)-branch=([^\\\\s]+)')}`,\n);\nconst markedBranchesRe = regEx(\n ` - \\\\[x\\\\] ${getMarkdownComment('([a-zA-Z]+)-branch=([^\\\\s]+)')}`,\n 'g',\n);\n\nconst approveAllPendingPrs = 'approve-all-pending-prs';\nconst createAllRateLimitedPrs = 'create-all-rate-limited-prs';\nconst createAllAwaitingSchedulePrs = 'create-all-awaiting-schedule-prs';\nconst createConfigMigrationPr = 'create-config-migration-pr';\nconst configMigrationPrInfo = 'config-migration-pr-info';\nconst rebaseAllOpenPrs = 'rebase-all-open-prs';\n\nfunction getMarkdownComment(comment: string): string {\n return `<!-- ${comment} -->`;\n}\n\nfunction isBoxChecked(issueBody: string, type: string): boolean {\n return issueBody.includes(getCheckbox(type, true));\n}\n\nfunction isBoxUnchecked(issueBody: string, type: string): boolean {\n return issueBody.includes(getCheckbox(type));\n}\n\nfunction getCheckbox(type: string, checked = false): string {\n return ` - [${checked ? 'x' : ' '}] ${getMarkdownComment(type)}`;\n}\n\nfunction checkOpenAllRateLimitedPR(issueBody: string): boolean {\n return isBoxChecked(issueBody, createAllRateLimitedPrs);\n}\n\nfunction checkOpenAllAwaitingSchedulePR(issueBody: string): boolean {\n return isBoxChecked(issueBody, createAllAwaitingSchedulePrs);\n}\n\nfunction checkApproveAllPendingPR(issueBody: string): boolean {\n return isBoxChecked(issueBody, approveAllPendingPrs);\n}\n\nfunction checkRebaseAll(issueBody: string): boolean {\n return isBoxChecked(issueBody, rebaseAllOpenPrs);\n}\n\nfunction getConfigMigrationCheckboxState(\n issueBody: string,\n): 'no-checkbox' | 'checked' | 'unchecked' | 'migration-pr-exists' {\n if (issueBody.includes(getMarkdownComment(configMigrationPrInfo))) {\n return 'migration-pr-exists';\n }\n\n if (isBoxChecked(issueBody, createConfigMigrationPr)) {\n return 'checked';\n }\n\n if (isBoxUnchecked(issueBody, createConfigMigrationPr)) {\n return 'unchecked';\n }\n\n return 'no-checkbox';\n}\n\nfunction selectAllRelevantBranches(issueBody: string): string[] {\n const checkedBranches = [];\n if (checkOpenAllRateLimitedPR(issueBody)) {\n for (const match of issueBody.matchAll(rateLimitedRe)) {\n checkedBranches.push(match[0]);\n }\n }\n if (checkOpenAllAwaitingSchedulePR(issueBody)) {\n for (const match of issueBody.matchAll(awaitingScheduleRe)) {\n checkedBranches.push(match[0]);\n }\n }\n if (checkApproveAllPendingPR(issueBody)) {\n for (const match of issueBody.matchAll(pendingApprovalRe)) {\n checkedBranches.push(match[0]);\n }\n }\n return checkedBranches;\n}\n\nfunction getAllSelectedBranches(\n issueBody: string,\n dependencyDashboardChecks: Record<string, string>,\n): Record<string, string> {\n const allRelevantBranches = selectAllRelevantBranches(issueBody);\n for (const branch of allRelevantBranches) {\n const [, type, branchName] = generalBranchRe.exec(branch)!;\n dependencyDashboardChecks[branchName] = type;\n }\n return dependencyDashboardChecks;\n}\n\nfunction getCheckedBranches(issueBody: string): Record<string, string> {\n let dependencyDashboardChecks: Record<string, string> = {};\n for (const [, type, branchName] of issueBody.matchAll(markedBranchesRe)) {\n dependencyDashboardChecks[branchName] = type;\n }\n dependencyDashboardChecks = getAllSelectedBranches(\n issueBody,\n dependencyDashboardChecks,\n );\n return dependencyDashboardChecks;\n}\n\nfunction parseDashboardIssue(issueBody: string): DependencyDashboard {\n const dependencyDashboardChecks = getCheckedBranches(issueBody);\n const dependencyDashboardRebaseAllOpen = checkRebaseAll(issueBody);\n const dependencyDashboardAllAwaitingSchedule =\n checkOpenAllAwaitingSchedulePR(issueBody);\n const dependencyDashboardAllPending = checkApproveAllPendingPR(issueBody);\n const dependencyDashboardAllRateLimited =\n checkOpenAllRateLimitedPR(issueBody);\n dependencyDashboardChecks.configMigrationCheckboxState =\n getConfigMigrationCheckboxState(issueBody);\n return {\n dependencyDashboardChecks,\n dependencyDashboardRebaseAllOpen,\n dependencyDashboardAllAwaitingSchedule,\n dependencyDashboardAllPending,\n dependencyDashboardAllRateLimited,\n };\n}\n\nexport async function readDashboardBody(\n config: SelectAllConfig,\n): Promise<void> {\n let dashboardChecks: DependencyDashboard = {\n dependencyDashboardChecks: {},\n dependencyDashboardRebaseAllOpen: false,\n dependencyDashboardAllAwaitingSchedule: false,\n dependencyDashboardAllPending: false,\n dependencyDashboardAllRateLimited: false,\n };\n const stringifiedConfig = JSON.stringify(config);\n if (\n config.dependencyDashboard === true ||\n stringifiedConfig.includes('\"dependencyDashboardApproval\":true') ||\n stringifiedConfig.includes('\"prCreation\":\"approval\"')\n ) {\n config.dependencyDashboardTitle =\n config.dependencyDashboardTitle ?? `Dependency Dashboard`;\n const issue = await platform.findIssue(config.dependencyDashboardTitle);\n if (issue) {\n config.dependencyDashboardIssue = issue.number;\n dashboardChecks = parseDashboardIssue(issue.body ?? '');\n }\n }\n\n const checkedBranches = GlobalConfig.get('checkedBranches');\n if (isNonEmptyArray(checkedBranches)) {\n const checkedBranchesRec: Record<string, DependencyDashboardCheck> =\n Object.fromEntries(\n checkedBranches.map((branchName) => [branchName, 'global-config']),\n );\n dashboardChecks.dependencyDashboardChecks = {\n ...dashboardChecks.dependencyDashboardChecks,\n ...checkedBranchesRec,\n };\n }\n\n if (GlobalConfig.get('rebaseAllOpenBranches')) {\n dashboardChecks.dependencyDashboardRebaseAllOpen = true;\n }\n\n Object.assign(config, dashboardChecks);\n}\n\nfunction formatAsMarkdownLink(name: string, url?: string | null): string {\n return url ? `[${name}](${url})` : `\\`${name}\\``;\n}\n\nfunction getListItem(\n branch: BranchConfig,\n type: DependencyDashboardListItemType,\n): string {\n let item = getCheckbox(`${type}-branch=${branch.branchName}`);\n if (branch.prNo) {\n // TODO: types (#22198)\n item += `[${branch.prTitle!}](../pull/${branch.prNo})`;\n } else {\n item += branch.prTitle;\n }\n const uniquePackages = [\n // TODO: types (#22198)\n ...new Set(branch.upgrades.map((upgrade) => `\\`${upgrade.depName!}\\``)),\n ];\n if (uniquePackages.length < 2) {\n return `${item}\\n`;\n }\n return `${item} (${uniquePackages.join(', ')})\\n`;\n}\n\nfunction splitBranchesByCategory(filteredBranches: BranchConfig[]): {\n categories: Record<string, BranchConfig[]>;\n uncategorized: BranchConfig[];\n hasCategorized: boolean;\n hasUncategorized: boolean;\n} {\n const categories: Record<string, BranchConfig[]> = {};\n const uncategorized: BranchConfig[] = [];\n let hasCategorized = false;\n let hasUncategorized = false;\n for (const branch of filteredBranches) {\n if (branch.dependencyDashboardCategory) {\n categories[branch.dependencyDashboardCategory] ??= [];\n categories[branch.dependencyDashboardCategory].push(branch);\n hasCategorized = true;\n continue;\n }\n uncategorized.push(branch);\n hasUncategorized = true;\n }\n return { categories, uncategorized, hasCategorized, hasUncategorized };\n}\n\nfunction getBranchList(\n branches: BranchConfig[],\n listItemType: DependencyDashboardListItemType,\n): string {\n return branches\n .map((branch: BranchConfig): string => getListItem(branch, listItemType))\n .join('');\n}\n\nfunction getBranchesListMd(\n branches: BranchConfig[],\n predicate: (\n value: BranchConfig,\n index: number,\n array: BranchConfig[],\n ) => unknown,\n title: string,\n description: string,\n listItemType: DependencyDashboardListItemType = 'approvePr',\n bulkComment?: string,\n bulkMessage?: string,\n bulkIcon?: '🔐',\n): string {\n const filteredBranches = branches.filter(predicate);\n if (filteredBranches.length === 0) {\n return '';\n }\n let result = `## ${title}\\n\\n${description}\\n\\n`;\n const { categories, uncategorized, hasCategorized, hasUncategorized } =\n splitBranchesByCategory(filteredBranches);\n if (hasCategorized) {\n for (const [category, branches] of Object.entries(categories).sort(\n ([keyA], [keyB]) =>\n keyA.localeCompare(keyB, undefined, { numeric: true }),\n )) {\n result = `${result.trimEnd()}\\n\\n`;\n result += `### ${category}\\n\\n`;\n result += getBranchList(branches, listItemType);\n }\n if (hasUncategorized) {\n result = `${result.trimEnd()}\\n\\n`;\n result += `### Others`;\n }\n }\n result = `${result.trimEnd()}\\n\\n`;\n result += getBranchList(uncategorized, listItemType);\n\n if (bulkComment && bulkMessage && filteredBranches.length > 1) {\n if (hasCategorized) {\n result = `${result.trimEnd()}\\n\\n`;\n result += '### All\\n\\n';\n }\n result += getCheckbox(bulkComment);\n result += `${bulkIcon ? `${bulkIcon} ` : ''}**${bulkMessage}**${bulkIcon ? ` ${bulkIcon}` : ''}`;\n }\n return `${result.trimEnd()}\\n\\n`;\n}\n\nfunction appendRepoProblems(config: RenovateConfig, issueBody: string): string {\n let newIssueBody = issueBody;\n const repoProblems = extractRepoProblems(config.repository);\n if (repoProblems.size) {\n newIssueBody += '## Repository Problems\\n\\n';\n const repoProblemsHeader =\n config.customizeDashboard?.repoProblemsHeader ??\n 'Renovate tried to run on this repository, but found these problems.';\n newIssueBody += `${template.compile(repoProblemsHeader, config)}\\n\\n`;\n\n for (const repoProblem of repoProblems) {\n newIssueBody += ` - ${repoProblem}\\n`;\n }\n newIssueBody += '\\n';\n }\n return newIssueBody;\n}\n\nexport async function ensureDependencyDashboard(\n config: SelectAllConfig,\n allBranches: BranchConfig[],\n packageFiles: Record<string, PackageFile[]> = {},\n configMigrationRes: ConfigMigrationResult,\n): Promise<void> {\n logger.debug('ensureDependencyDashboard()');\n if (config.mode === 'silent') {\n logger.debug(\n 'Dependency Dashboard issue is not created, updated or closed when mode=silent',\n );\n return;\n }\n // legacy/migrated issue\n const reuseTitle = 'Update Dependencies (Renovate Bot)';\n const branches = allBranches.filter(\n (branch) =>\n branch.result !== 'automerged' &&\n !branch.upgrades?.every((upgrade) => upgrade.remediationNotPossible),\n );\n if (!(\n config.dependencyDashboard === true ||\n config.dependencyDashboardApproval === true ||\n config.packageRules?.some((rule) => rule.dependencyDashboardApproval) ===\n true ||\n branches.some(\n (branch) =>\n !!branch.dependencyDashboardApproval ||\n !!branch.dependencyDashboardPrApproval,\n )\n )) {\n if (GlobalConfig.get('dryRun')) {\n logger.info(\n { title: config.dependencyDashboardTitle },\n 'DRY-RUN: Would close Dependency Dashboard',\n );\n } else {\n logger.debug('Closing Dependency Dashboard');\n await platform.ensureIssueClosing(config.dependencyDashboardTitle!);\n }\n return;\n }\n // istanbul ignore if\n if (config.repoIsOnboarded === false) {\n logger.debug('Repo is onboarding - skipping dependency dashboard');\n return;\n }\n logger.debug('Ensuring Dependency Dashboard');\n\n // Check packageFiles for any deprecations or replacements\n let hasDeprecationsOrReplacements = false;\n const deprecatedPackages: Record<\n string,\n Record<\n string,\n { hasActionableReplacement: boolean; sourceUrl?: string | null }\n >\n > = {};\n logger.debug('Checking packageFiles for deprecated or replacement packages');\n if (isNonEmptyObject(packageFiles)) {\n for (const [manager, fileNames] of Object.entries(packageFiles)) {\n for (const fileName of fileNames) {\n for (const dep of fileName.deps) {\n const name = dep.packageName;\n const replacementUpdate = dep.updates?.find(\n (update) => update.updateType === 'replacement',\n );\n const hasAnyReplacement = !!replacementUpdate;\n const hasActionableReplacement =\n hasAnyReplacement &&\n !(\n replacementUpdate.newName &&\n replacementAlreadyExists(\n fileName.deps,\n dep,\n replacementUpdate.newName,\n )\n );\n if (name && (dep.deprecationMessage ?? hasAnyReplacement)) {\n hasDeprecationsOrReplacements = true;\n deprecatedPackages[manager] ??= {};\n deprecatedPackages[manager][name] ??= {\n hasActionableReplacement,\n sourceUrl: dep.sourceUrl,\n };\n }\n }\n }\n }\n }\n\n const hasBranches = isNonEmptyArray(branches);\n if (\n config.dependencyDashboardAutoclose &&\n !hasBranches &&\n !hasDeprecationsOrReplacements\n ) {\n if (GlobalConfig.get('dryRun')) {\n logger.info(\n { title: config.dependencyDashboardTitle },\n 'DRY-RUN: Would close Dependency Dashboard',\n );\n } else {\n logger.debug('Closing Dependency Dashboard');\n await platform.ensureIssueClosing(config.dependencyDashboardTitle!);\n }\n return;\n }\n let issueBody = '';\n\n if (config.dependencyDashboardHeader?.length) {\n issueBody += `${template.compile(config.dependencyDashboardHeader, config)}\\n\\n`;\n }\n\n if (configMigrationRes.result === 'pr-exists') {\n issueBody += `## Config Migration Needed\\n\\n${getMarkdownComment(configMigrationPrInfo)} See Config Migration PR: #${configMigrationRes.prNumber}.\\n\\n`;\n } else if (configMigrationRes?.result === 'pr-modified') {\n issueBody += `## Config Migration Needed (Blocked)\\n\\n${getMarkdownComment(configMigrationPrInfo)} The Config Migration branch exists but has been modified by another user. Renovate will not push to this branch unless it is first deleted. \\n\\n See Config Migration PR: #${configMigrationRes.prNumber}.\\n\\n`;\n } else if (configMigrationRes?.result === 'add-checkbox') {\n issueBody += `## Config Migration Needed\\n\\n${getCheckbox(createConfigMigrationPr)} Select this checkbox to let Renovate create an automated Config Migration PR.\\n\\n`;\n }\n\n issueBody = appendRepoProblems(config, issueBody);\n\n if (hasDeprecationsOrReplacements) {\n issueBody += '## Deprecations / Replacements\\n';\n issueBody += emojify('> :warning: **Warning**\\n> \\n');\n issueBody +=\n '> The following dependencies are either deprecated or have replacements available.\\n\\n';\n issueBody += '| Datasource | Package | Replacement PR? |\\n';\n issueBody += '|------------|------|--------------|\\n';\n for (const manager of Object.keys(deprecatedPackages).sort()) {\n const deps = deprecatedPackages[manager];\n for (const depName of Object.keys(deps).sort()) {\n const { hasActionableReplacement, sourceUrl } = deps[depName];\n const packageName = formatAsMarkdownLink(depName, sourceUrl);\n\n issueBody += `| ${manager} | ${packageName} | ${\n hasActionableReplacement\n ? '![Available](https://img.shields.io/badge/available-green?style=flat-square)'\n : '![Unavailable](https://img.shields.io/badge/unavailable-orange?style=flat-square)'\n } |\\n`;\n }\n }\n issueBody += '\\n';\n }\n\n if (config.dependencyDashboardReportAbandonment) {\n issueBody += getAbandonedPackagesMd(config, packageFiles);\n }\n\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'needs-approval',\n 'Pending Approval',\n 'The following branches are pending approval. To create them, click on a checkbox below.',\n 'approve',\n approveAllPendingPrs,\n 'Create all pending approval PRs at once',\n '🔐',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'minimum-group-size-not-met',\n 'Group Size Not Met',\n 'The following branches have not met their minimum group size. To create them, click on a checkbox below.',\n 'approveGroup',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'not-scheduled',\n 'Awaiting Schedule',\n 'The following updates are awaiting their schedule. To get an update now, click on a checkbox below.',\n 'unschedule',\n createAllAwaitingSchedulePrs,\n 'Create all awaiting schedule PRs at once',\n '🔐',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) =>\n branch.result === 'branch-limit-reached' ||\n branch.result === 'pr-limit-reached' ||\n branch.result === 'commit-per-run-limit-reached' ||\n branch.result === 'commit-hourly-limit-reached',\n 'Rate-Limited',\n 'The following updates are currently rate-limited. To force their creation now, click on a checkbox below.',\n 'unlimit',\n createAllRateLimitedPrs,\n 'Create all rate-limited PRs at once',\n '🔐',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'error',\n 'Errored',\n 'The following updates encountered an error and will be retried. To force a retry now, click on a checkbox below.',\n 'retry',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'needs-pr-approval',\n 'PR Creation Approval Required',\n 'The following branches exist but PR creation requires approval. To approve PR creation, click on a checkbox below.',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'pr-edited',\n 'PR Edited (Blocked)',\n 'The following updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox below.',\n 'rebase',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'pending',\n 'Pending Status Checks',\n 'The following updates await pending status checks. To force their creation now, click on a checkbox below.',\n 'unpend',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.prBlockedBy === 'BranchAutomerge',\n 'Pending Branch Automerge',\n 'The following updates await pending status checks before automerging. To abort the branch automerge and create a PR instead, click on a checkbox below.',\n );\n\n const warn = getDepWarningsDashboard(packageFiles, config);\n if (warn) {\n issueBody += warn;\n issueBody += '\\n';\n }\n\n const otherRes = [\n 'pending',\n 'needs-approval',\n 'needs-pr-approval',\n 'not-scheduled',\n 'pr-limit-reached',\n 'commit-per-run-limit-reached',\n 'commit-hourly-limit-reached',\n 'branch-limit-reached',\n 'already-existed',\n 'error',\n 'automerged',\n 'pr-edited',\n 'minimum-group-size-not-met',\n ];\n const inProgress = branches.filter(\n (branch) =>\n !otherRes.includes(branch.result!) &&\n branch.prBlockedBy !== 'BranchAutomerge',\n );\n issueBody += getBranchesListMd(\n inProgress,\n (branch) => !!branch.prBlockedBy || !branch.prNo,\n 'Other Branches',\n 'The following updates are pending. To force the creation of a PR, click on a checkbox below.',\n 'other',\n );\n issueBody += getBranchesListMd(\n inProgress,\n (branch) => branch.prNo && !branch.prBlockedBy,\n 'Open',\n 'The following updates have all been created. To force a retry/rebase of any, click on a checkbox below.',\n 'rebase',\n rebaseAllOpenPrs,\n 'Click on this checkbox to rebase all open PRs at once',\n );\n\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'already-existed',\n 'PR Closed (Blocked)',\n 'The following updates are blocked by an existing closed PR. To recreate the PR, click on a checkbox below.',\n 'recreate',\n );\n\n if (!hasBranches) {\n issueBody +=\n 'This repository currently has no open or pending branches.\\n\\n';\n }\n\n // add CVE section\n issueBody += await getDashboardMarkdownVulnerabilities(config, packageFiles);\n\n // fit the detected dependencies section\n const footer = getFooter(config);\n issueBody += PackageFiles.getDashboardMarkdown(\n platform.maxBodyLength() - issueBody.length - footer.length,\n );\n\n issueBody += footer;\n\n if (config.dependencyDashboardIssue) {\n // If we're not changing the dashboard issue, then we can skip checking if the user changed it.\n // The cached issue we get back here will reflect its state at the _start_ of our run\n const cachedIssue = await platform.getIssue?.(\n config.dependencyDashboardIssue,\n );\n if (cachedIssue?.body === issueBody) {\n logger.debug('No changes to dependency dashboard issue needed');\n return;\n }\n\n // Skip cache when getting the issue to ensure we get the latest body,\n // including any updates the user made after we started the run\n const updatedIssue = await platform.getIssue?.(\n config.dependencyDashboardIssue,\n false,\n );\n if (updatedIssue) {\n const { dependencyDashboardChecks } = parseDashboardIssue(\n coerceString(updatedIssue.body),\n );\n for (const branchName of Object.keys(config.dependencyDashboardChecks!)) {\n delete dependencyDashboardChecks[branchName];\n }\n for (const branchName of Object.keys(dependencyDashboardChecks)) {\n const checkText = getCheckbox(\n `${dependencyDashboardChecks[branchName]}-branch=${branchName}`,\n );\n issueBody = issueBody.replace(\n checkText,\n checkText.replace('[ ]', '[x]'),\n );\n }\n }\n }\n\n if (GlobalConfig.get('dryRun')) {\n logger.info(\n { title: config.dependencyDashboardTitle },\n 'DRY-RUN: Would ensure Dependency Dashboard',\n );\n } else {\n await platform.ensureIssue({\n title: config.dependencyDashboardTitle!,\n reuseTitle,\n body: platform.massageMarkdown(issueBody, config.rebaseLabel),\n labels: config.dependencyDashboardLabels,\n confidential: config.confidential,\n });\n }\n}\n\nexport function getAbandonedPackagesMd(\n config: RenovateConfig,\n packageFiles: Record<string, PackageFile[]>,\n): string {\n const abandonedPackages: Record<\n string,\n Record<\n string,\n { mostRecentTimestamp?: string | null; sourceUrl?: string | null }\n >\n > = {};\n let abandonedCount = 0;\n\n for (const [manager, managerPackageFiles] of Object.entries(packageFiles)) {\n for (const packageFile of managerPackageFiles) {\n for (const dep of coerceArray(packageFile.deps)) {\n if (dep.depName && dep.isAbandoned) {\n abandonedCount++;\n abandonedPackages[manager] = abandonedPackages[manager] || {};\n abandonedPackages[manager][dep.depName] = {\n mostRecentTimestamp: dep.mostRecentTimestamp,\n sourceUrl: dep.sourceUrl,\n };\n }\n }\n }\n }\n\n if (abandonedCount === 0) {\n return '';\n }\n\n let abandonedMd = '## Abandoned Dependencies\\n\\n';\n abandonedMd +=\n 'The following dependencies have not received updates for an extended period and may be unmaintained.\\n\\n';\n\n // Keep the note outside the `<details>` block: GitHub only renders alert\n // callouts at the top level of a body, not inside collapsible sections.\n abandonedMd += emojify('> :information_source: **Note**\\n> \\n');\n abandonedMd += `> Packages are marked as abandoned when they exceed the [\\`abandonmentThreshold\\`](${GlobalConfig.get('productLinks').documentation}configuration-options/#abandonmentthreshold) since their last release. `;\n abandonedMd +=\n 'Unlike deprecated packages with official notices, abandonment is detected by release inactivity.\\n> \\n';\n\n abandonedMd += '<details>\\n';\n abandonedMd += `<summary>View abandoned dependencies (${abandonedCount})</summary>\\n\\n`;\n\n abandonedMd += '| Datasource | Package | Last Updated |\\n';\n abandonedMd += '|------------|------|-------------|\\n';\n\n for (const manager of Object.keys(abandonedPackages).sort()) {\n const deps = abandonedPackages[manager];\n for (const depName of Object.keys(deps).sort()) {\n const { mostRecentTimestamp, sourceUrl } = deps[depName];\n const formattedDate = mostRecentTimestamp\n ? DateTime.fromISO(mostRecentTimestamp).toFormat('yyyy-MM-dd')\n : 'unknown';\n const packageName = formatAsMarkdownLink(depName, sourceUrl);\n abandonedMd += `| ${manager} | ${packageName} | \\`${formattedDate}\\` |\\n`;\n }\n }\n\n abandonedMd += '\\n</details>\\n\\n\\n';\n\n return abandonedMd;\n}\n\nfunction getFooter(config: RenovateConfig): string {\n let footer = '';\n if (config.dependencyDashboardFooter?.length) {\n footer += `---\\n${template.compile(config.dependencyDashboardFooter, config)}\\n`;\n }\n\n return footer;\n}\n\nexport async function getDashboardMarkdownVulnerabilities(\n config: RenovateConfig,\n packageFiles: Record<string, PackageFile[]>,\n): Promise<string> {\n let result = '';\n\n if (\n isNullOrUndefined(config.dependencyDashboardOSVVulnerabilitySummary) ||\n config.dependencyDashboardOSVVulnerabilitySummary === 'none'\n ) {\n return result;\n }\n\n result += '## Vulnerabilities\\n\\n';\n\n let vulnerabilities: Vulnerability[];\n try {\n const vulnerabilityFetcher = await Vulnerabilities.create();\n vulnerabilities = await vulnerabilityFetcher.fetchVulnerabilities(\n config,\n packageFiles,\n );\n } catch (err) {\n logger.warn({ err }, 'Unable to read vulnerability information');\n result +=\n 'Renovate was unable to fetch CVE information from [osv.dev](https://osv.dev) this run.\\n\\n';\n return result;\n }\n\n if (vulnerabilities.length === 0) {\n result +=\n 'Renovate has not found any CVEs on [osv.dev](https://osv.dev).\\n\\n';\n return result;\n }\n\n const unresolvedVulnerabilities = vulnerabilities.filter((value) =>\n isNullOrUndefined(value.fixedVersion),\n );\n const resolvedVulnerabilitiesLength =\n vulnerabilities.length - unresolvedVulnerabilities.length;\n\n result += emojify('> :exclamation: **Important**\\n> \\n');\n result += `> \\`${resolvedVulnerabilitiesLength}\\`/\\`${vulnerabilities.length}\\``;\n if (isTruthy(config.osvVulnerabilityAlerts)) {\n result += ' CVEs have Renovate fixes.\\n\\n';\n } else {\n result += ` CVEs have possible Renovate fixes.\\n> See [\\`osvVulnerabilityAlerts\\`](${GlobalConfig.get('productLinks').documentation}configuration-options/#osvvulnerabilityalerts) to allow Renovate to supply fixes.\\n\\n`;\n }\n\n let renderedVulnerabilities: Vulnerability[];\n switch (config.dependencyDashboardOSVVulnerabilitySummary) {\n // filter vulnerabilities to display based on configuration\n case 'unresolved':\n renderedVulnerabilities = unresolvedVulnerabilities;\n break;\n default:\n renderedVulnerabilities = vulnerabilities;\n }\n\n const managerRecords: Record<\n string,\n Record<string, Record<string, Vulnerability[]>>\n > = {};\n for (const vulnerability of renderedVulnerabilities) {\n const { manager, packageFile } = vulnerability.packageFileConfig;\n if (isNullOrUndefined(managerRecords[manager!])) {\n managerRecords[manager!] = {};\n }\n if (isNullOrUndefined(managerRecords[manager!][packageFile])) {\n managerRecords[manager!][packageFile] = {};\n }\n if (\n isNullOrUndefined(\n managerRecords[manager!][packageFile][vulnerability.packageName],\n )\n ) {\n managerRecords[manager!][packageFile][vulnerability.packageName] = [];\n }\n managerRecords[manager!][packageFile][vulnerability.packageName].push(\n vulnerability,\n );\n }\n\n for (const [manager, packageFileRecords] of Object.entries(managerRecords)) {\n result += `<details><summary>${manager}</summary>\\n<blockquote>\\n\\n`;\n for (const [packageFile, packageNameRecords] of Object.entries(\n packageFileRecords,\n )) {\n result += `<details><summary>${packageFile}</summary>\\n<blockquote>\\n\\n`;\n for (const [packageName, cves] of Object.entries(packageNameRecords)) {\n result += `<details><summary>${packageName}</summary>\\n<blockquote>\\n\\n`;\n for (const vul of cves) {\n const id = vul.vulnerability.id;\n const suffix = isNonEmptyString(vul.fixedVersion)\n ? ` (fixed in ${vul.fixedVersion})`\n : '';\n result += `- [${id}](https://osv.dev/vulnerability/${id})${suffix}\\n`;\n }\n result += `</blockquote>\\n</details>\\n\\n`;\n }\n result += `</blockquote>\\n</details>\\n\\n`;\n }\n result += `</blockquote>\\n</details>\\n\\n`;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAsCA,MAAM,gBAAgB,MACpB,cAAc,mBAAmB,0BAA0B,KAC3D,GACF;AACA,MAAM,oBAAoB,MACxB,cAAc,mBAAmB,0BAA0B,KAC3D,GACF;AACA,MAAM,qBAAqB,MACzB,cAAc,mBAAmB,6BAA6B,KAC9D,GACF;AACA,MAAM,kBAAkB,MACtB,IAAI,mBAAmB,8BAA8B,GACvD;AACA,MAAM,mBAAmB,MACvB,cAAc,mBAAmB,8BAA8B,KAC/D,GACF;AAEA,MAAM,uBAAuB;AAC7B,MAAM,0BAA0B;AAChC,MAAM,+BAA+B;AACrC,MAAM,0BAA0B;AAChC,MAAM,wBAAwB;AAC9B,MAAM,mBAAmB;AAEzB,SAAS,mBAAmB,SAAyB;CACnD,OAAO,QAAQ,QAAQ;AACzB;AAEA,SAAS,aAAa,WAAmB,MAAuB;CAC9D,OAAO,UAAU,SAAS,YAAY,MAAM,IAAI,CAAC;AACnD;AAEA,SAAS,eAAe,WAAmB,M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AGF,CAAC;CACL,KAAK,MAAM,iBAAiB,yBAAyB;EACnD,MAAM,EAAE,SAAS,gBAAgB,cAAc;EAC/C,IAAI,kBAAkB,eAAe,QAAS,GAC5C,eAAe,WAAY,CAAC;EAE9B,IAAI,kBAAkB,eAAe,QAAS,CAAC,YAAY,GACzD,eAAe,QAAS,CAAC,eAAe,CAAC;EAE3C,IACE,kBACE,eAAe,QAAS,CAAC,YAAY,CAAC,cAAc,YACtD,GAEA,eAAe,QAAS,CAAC,YAAY,CAAC,cAAc,eAAe,CAAC;EAEtE,eAAe,QAAS,CAAC,YAAY,CAAC,cAAc,YAAY,CAAC,KAC/D,aACF;CACF;CAEA,KAAK,MAAM,CAAC,SAAS,uBAAuB,OAAO,QAAQ,cAAc,GAAG;EAC1E,UAAU,qBAAqB,QAAQ;EACvC,KAAK,MAAM,CAAC,aAAa,uBAAuB,OAAO,QACrD,kBACF,GAAG;GACD,UAAU,qBAAqB,YAAY;GAC3C,KAAK,MAAM,CAAC,aAAa,SAAS,OAAO,QAAQ,kBAAkB,GAAG;IACpE,UAAU,qBAAqB,YAAY;IAC3C,KAAK,MAAM,OAAO,MAAM;KACtB,MAAM,KAAK,IAAI,cAAc;KAC7B,MAAM,SAAS,iBAAiB,IAAI,YAAY,IAC5C,cAAc,IAAI,aAAa,KAC/B;KACJ,UAAU,MAAM,GAAG,kCAAkC,GAAG,GAAG,OAAO;IACpE;IACA,UAAU;GACZ;GACA,UAAU;EACZ;EACA,UAAU;CACZ;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"dependency-dashboard.js","names":["template.compile"],"sources":["../../../lib/workers/repository/dependency-dashboard.ts"],"sourcesContent":["import {\n isNonEmptyArray,\n isNonEmptyObject,\n isNonEmptyString,\n isNullOrUndefined,\n isTruthy,\n} from '@sindresorhus/is';\nimport { DateTime } from 'luxon';\nimport { GlobalConfig } from '../../config/global.ts';\nimport type { RenovateConfig } from '../../config/types.ts';\nimport { logger } from '../../logger/index.ts';\nimport type { PackageFile } from '../../modules/manager/types.ts';\nimport { platform } from '../../modules/platform/index.ts';\nimport { coerceArray } from '../../util/array.ts';\nimport { emojify } from '../../util/emoji.ts';\nimport { regEx } from '../../util/regex.ts';\nimport { coerceString } from '../../util/string.ts';\nimport * as template from '../../util/template/index.ts';\nimport type { BranchConfig, SelectAllConfig } from '../types.ts';\nimport { extractRepoProblems, replacementAlreadyExists } from './common.ts';\nimport type { ConfigMigrationResult } from './config-migration/index.ts';\nimport { getDepWarningsDashboard } from './errors-warnings.ts';\nimport { PackageFiles } from './package-files.ts';\nimport type { Vulnerability } from './process/types.ts';\nimport { Vulnerabilities } from './process/vulnerabilities.ts';\nimport type {\n DependencyDashboardCheck,\n DependencyDashboardListItemType,\n} from './types.ts';\n\ninterface DependencyDashboard {\n dependencyDashboardChecks: Record<string, string>;\n dependencyDashboardRebaseAllOpen: boolean;\n dependencyDashboardAllPending: boolean;\n dependencyDashboardAllRateLimited: boolean;\n dependencyDashboardAllAwaitingSchedule: boolean;\n}\n\nconst rateLimitedRe = regEx(\n ` - \\\\[ \\\\] ${getMarkdownComment('unlimit-branch=([^\\\\s]+)')}`,\n 'g',\n);\nconst pendingApprovalRe = regEx(\n ` - \\\\[ \\\\] ${getMarkdownComment('approve-branch=([^\\\\s]+)')}`,\n 'g',\n);\nconst awaitingScheduleRe = regEx(\n ` - \\\\[ \\\\] ${getMarkdownComment('unschedule-branch=([^\\\\s]+)')}`,\n 'g',\n);\nconst generalBranchRe = regEx(\n ` ${getMarkdownComment('([a-zA-Z]+)-branch=([^\\\\s]+)')}`,\n);\nconst markedBranchesRe = regEx(\n ` - \\\\[x\\\\] ${getMarkdownComment('([a-zA-Z]+)-branch=([^\\\\s]+)')}`,\n 'g',\n);\n\nconst approveAllPendingPrs = 'approve-all-pending-prs';\nconst createAllRateLimitedPrs = 'create-all-rate-limited-prs';\nconst createAllAwaitingSchedulePrs = 'create-all-awaiting-schedule-prs';\nconst createConfigMigrationPr = 'create-config-migration-pr';\nconst configMigrationPrInfo = 'config-migration-pr-info';\nconst rebaseAllOpenPrs = 'rebase-all-open-prs';\n\nfunction getMarkdownComment(comment: string): string {\n return `<!-- ${comment} -->`;\n}\n\nfunction isBoxChecked(issueBody: string, type: string): boolean {\n return issueBody.includes(getCheckbox(type, true));\n}\n\nfunction isBoxUnchecked(issueBody: string, type: string): boolean {\n return issueBody.includes(getCheckbox(type));\n}\n\nfunction getCheckbox(type: string, checked = false): string {\n return ` - [${checked ? 'x' : ' '}] ${getMarkdownComment(type)}`;\n}\n\nfunction checkOpenAllRateLimitedPR(issueBody: string): boolean {\n return isBoxChecked(issueBody, createAllRateLimitedPrs);\n}\n\nfunction checkOpenAllAwaitingSchedulePR(issueBody: string): boolean {\n return isBoxChecked(issueBody, createAllAwaitingSchedulePrs);\n}\n\nfunction checkApproveAllPendingPR(issueBody: string): boolean {\n return isBoxChecked(issueBody, approveAllPendingPrs);\n}\n\nfunction checkRebaseAll(issueBody: string): boolean {\n return isBoxChecked(issueBody, rebaseAllOpenPrs);\n}\n\nfunction getConfigMigrationCheckboxState(\n issueBody: string,\n): 'no-checkbox' | 'checked' | 'unchecked' | 'migration-pr-exists' {\n if (issueBody.includes(getMarkdownComment(configMigrationPrInfo))) {\n return 'migration-pr-exists';\n }\n\n if (isBoxChecked(issueBody, createConfigMigrationPr)) {\n return 'checked';\n }\n\n if (isBoxUnchecked(issueBody, createConfigMigrationPr)) {\n return 'unchecked';\n }\n\n return 'no-checkbox';\n}\n\nfunction selectAllRelevantBranches(issueBody: string): string[] {\n const checkedBranches = [];\n if (checkOpenAllRateLimitedPR(issueBody)) {\n for (const match of issueBody.matchAll(rateLimitedRe)) {\n checkedBranches.push(match[0]);\n }\n }\n if (checkOpenAllAwaitingSchedulePR(issueBody)) {\n for (const match of issueBody.matchAll(awaitingScheduleRe)) {\n checkedBranches.push(match[0]);\n }\n }\n if (checkApproveAllPendingPR(issueBody)) {\n for (const match of issueBody.matchAll(pendingApprovalRe)) {\n checkedBranches.push(match[0]);\n }\n }\n return checkedBranches;\n}\n\nfunction getAllSelectedBranches(\n issueBody: string,\n dependencyDashboardChecks: Record<string, string>,\n): Record<string, string> {\n const allRelevantBranches = selectAllRelevantBranches(issueBody);\n for (const branch of allRelevantBranches) {\n const [, type, branchName] = generalBranchRe.exec(branch)!;\n dependencyDashboardChecks[branchName] = type;\n }\n return dependencyDashboardChecks;\n}\n\nfunction getCheckedBranches(issueBody: string): Record<string, string> {\n let dependencyDashboardChecks: Record<string, string> = {};\n for (const [, type, branchName] of issueBody.matchAll(markedBranchesRe)) {\n dependencyDashboardChecks[branchName] = type;\n }\n dependencyDashboardChecks = getAllSelectedBranches(\n issueBody,\n dependencyDashboardChecks,\n );\n return dependencyDashboardChecks;\n}\n\nfunction parseDashboardIssue(issueBody: string): DependencyDashboard {\n const dependencyDashboardChecks = getCheckedBranches(issueBody);\n const dependencyDashboardRebaseAllOpen = checkRebaseAll(issueBody);\n const dependencyDashboardAllAwaitingSchedule =\n checkOpenAllAwaitingSchedulePR(issueBody);\n const dependencyDashboardAllPending = checkApproveAllPendingPR(issueBody);\n const dependencyDashboardAllRateLimited =\n checkOpenAllRateLimitedPR(issueBody);\n dependencyDashboardChecks.configMigrationCheckboxState =\n getConfigMigrationCheckboxState(issueBody);\n return {\n dependencyDashboardChecks,\n dependencyDashboardRebaseAllOpen,\n dependencyDashboardAllAwaitingSchedule,\n dependencyDashboardAllPending,\n dependencyDashboardAllRateLimited,\n };\n}\n\nexport async function readDashboardBody(\n config: SelectAllConfig,\n): Promise<void> {\n let dashboardChecks: DependencyDashboard = {\n dependencyDashboardChecks: {},\n dependencyDashboardRebaseAllOpen: false,\n dependencyDashboardAllAwaitingSchedule: false,\n dependencyDashboardAllPending: false,\n dependencyDashboardAllRateLimited: false,\n };\n const stringifiedConfig = JSON.stringify(config);\n // mode=silent never updates the dashboard, so checkboxes left on an existing one would never be cleared\n if (config.mode === 'silent') {\n logger.debug('Ignoring Dependency Dashboard checkboxes when mode=silent');\n } else if (\n config.dependencyDashboard === true ||\n stringifiedConfig.includes('\"dependencyDashboardApproval\":true') ||\n stringifiedConfig.includes('\"prCreation\":\"approval\"')\n ) {\n config.dependencyDashboardTitle =\n config.dependencyDashboardTitle ?? `Dependency Dashboard`;\n const issue = await platform.findIssue(config.dependencyDashboardTitle);\n if (issue) {\n config.dependencyDashboardIssue = issue.number;\n dashboardChecks = parseDashboardIssue(issue.body ?? '');\n }\n }\n\n const checkedBranches = GlobalConfig.get('checkedBranches');\n if (isNonEmptyArray(checkedBranches)) {\n const checkedBranchesRec: Record<string, DependencyDashboardCheck> =\n Object.fromEntries(\n checkedBranches.map((branchName) => [branchName, 'global-config']),\n );\n dashboardChecks.dependencyDashboardChecks = {\n ...dashboardChecks.dependencyDashboardChecks,\n ...checkedBranchesRec,\n };\n }\n\n if (GlobalConfig.get('rebaseAllOpenBranches')) {\n dashboardChecks.dependencyDashboardRebaseAllOpen = true;\n }\n\n Object.assign(config, dashboardChecks);\n}\n\nfunction formatAsMarkdownLink(name: string, url?: string | null): string {\n return url ? `[${name}](${url})` : `\\`${name}\\``;\n}\n\nfunction getListItem(\n branch: BranchConfig,\n type: DependencyDashboardListItemType,\n): string {\n let item = getCheckbox(`${type}-branch=${branch.branchName}`);\n if (branch.prNo) {\n // TODO: types (#22198)\n item += `[${branch.prTitle!}](../pull/${branch.prNo})`;\n } else {\n item += branch.prTitle;\n }\n const uniquePackages = [\n // TODO: types (#22198)\n ...new Set(branch.upgrades.map((upgrade) => `\\`${upgrade.depName!}\\``)),\n ];\n if (uniquePackages.length < 2) {\n return `${item}\\n`;\n }\n return `${item} (${uniquePackages.join(', ')})\\n`;\n}\n\nfunction splitBranchesByCategory(filteredBranches: BranchConfig[]): {\n categories: Record<string, BranchConfig[]>;\n uncategorized: BranchConfig[];\n hasCategorized: boolean;\n hasUncategorized: boolean;\n} {\n const categories: Record<string, BranchConfig[]> = {};\n const uncategorized: BranchConfig[] = [];\n let hasCategorized = false;\n let hasUncategorized = false;\n for (const branch of filteredBranches) {\n if (branch.dependencyDashboardCategory) {\n categories[branch.dependencyDashboardCategory] ??= [];\n categories[branch.dependencyDashboardCategory].push(branch);\n hasCategorized = true;\n continue;\n }\n uncategorized.push(branch);\n hasUncategorized = true;\n }\n return { categories, uncategorized, hasCategorized, hasUncategorized };\n}\n\nfunction getBranchList(\n branches: BranchConfig[],\n listItemType: DependencyDashboardListItemType,\n): string {\n return branches\n .map((branch: BranchConfig): string => getListItem(branch, listItemType))\n .join('');\n}\n\nfunction getBranchesListMd(\n branches: BranchConfig[],\n predicate: (\n value: BranchConfig,\n index: number,\n array: BranchConfig[],\n ) => unknown,\n title: string,\n description: string,\n listItemType: DependencyDashboardListItemType = 'approvePr',\n bulkComment?: string,\n bulkMessage?: string,\n bulkIcon?: '🔐',\n): string {\n const filteredBranches = branches.filter(predicate);\n if (filteredBranches.length === 0) {\n return '';\n }\n let result = `## ${title}\\n\\n${description}\\n\\n`;\n const { categories, uncategorized, hasCategorized, hasUncategorized } =\n splitBranchesByCategory(filteredBranches);\n if (hasCategorized) {\n for (const [category, branches] of Object.entries(categories).sort(\n ([keyA], [keyB]) =>\n keyA.localeCompare(keyB, undefined, { numeric: true }),\n )) {\n result = `${result.trimEnd()}\\n\\n`;\n result += `### ${category}\\n\\n`;\n result += getBranchList(branches, listItemType);\n }\n if (hasUncategorized) {\n result = `${result.trimEnd()}\\n\\n`;\n result += `### Others`;\n }\n }\n result = `${result.trimEnd()}\\n\\n`;\n result += getBranchList(uncategorized, listItemType);\n\n if (bulkComment && bulkMessage && filteredBranches.length > 1) {\n if (hasCategorized) {\n result = `${result.trimEnd()}\\n\\n`;\n result += '### All\\n\\n';\n }\n result += getCheckbox(bulkComment);\n result += `${bulkIcon ? `${bulkIcon} ` : ''}**${bulkMessage}**${bulkIcon ? ` ${bulkIcon}` : ''}`;\n }\n return `${result.trimEnd()}\\n\\n`;\n}\n\nfunction appendRepoProblems(config: RenovateConfig, issueBody: string): string {\n let newIssueBody = issueBody;\n const repoProblems = extractRepoProblems(config.repository);\n if (repoProblems.size) {\n newIssueBody += '## Repository Problems\\n\\n';\n const repoProblemsHeader =\n config.customizeDashboard?.repoProblemsHeader ??\n 'Renovate tried to run on this repository, but found these problems.';\n newIssueBody += `${template.compile(repoProblemsHeader, config)}\\n\\n`;\n\n for (const repoProblem of repoProblems) {\n newIssueBody += ` - ${repoProblem}\\n`;\n }\n newIssueBody += '\\n';\n }\n return newIssueBody;\n}\n\nexport async function ensureDependencyDashboard(\n config: SelectAllConfig,\n allBranches: BranchConfig[],\n packageFiles: Record<string, PackageFile[]> = {},\n configMigrationRes: ConfigMigrationResult,\n): Promise<void> {\n logger.debug('ensureDependencyDashboard()');\n if (config.mode === 'silent') {\n logger.debug(\n 'Dependency Dashboard issue is not created, updated or closed when mode=silent',\n );\n return;\n }\n // legacy/migrated issue\n const reuseTitle = 'Update Dependencies (Renovate Bot)';\n const branches = allBranches.filter(\n (branch) =>\n branch.result !== 'automerged' &&\n !branch.upgrades?.every((upgrade) => upgrade.remediationNotPossible),\n );\n if (!(\n config.dependencyDashboard === true ||\n config.dependencyDashboardApproval === true ||\n config.packageRules?.some((rule) => rule.dependencyDashboardApproval) ===\n true ||\n branches.some(\n (branch) =>\n !!branch.dependencyDashboardApproval ||\n !!branch.dependencyDashboardPrApproval,\n )\n )) {\n if (GlobalConfig.get('dryRun')) {\n logger.info(\n { title: config.dependencyDashboardTitle },\n 'DRY-RUN: Would close Dependency Dashboard',\n );\n } else {\n logger.debug('Closing Dependency Dashboard');\n await platform.ensureIssueClosing(config.dependencyDashboardTitle!);\n }\n return;\n }\n // istanbul ignore if\n if (config.repoIsOnboarded === false) {\n logger.debug('Repo is onboarding - skipping dependency dashboard');\n return;\n }\n logger.debug('Ensuring Dependency Dashboard');\n\n // Check packageFiles for any deprecations or replacements\n let hasDeprecationsOrReplacements = false;\n const deprecatedPackages: Record<\n string,\n Record<\n string,\n { hasActionableReplacement: boolean; sourceUrl?: string | null }\n >\n > = {};\n logger.debug('Checking packageFiles for deprecated or replacement packages');\n if (isNonEmptyObject(packageFiles)) {\n for (const [manager, fileNames] of Object.entries(packageFiles)) {\n for (const fileName of fileNames) {\n for (const dep of fileName.deps) {\n const name = dep.packageName;\n const replacementUpdate = dep.updates?.find(\n (update) => update.updateType === 'replacement',\n );\n const hasAnyReplacement = !!replacementUpdate;\n const hasActionableReplacement =\n hasAnyReplacement &&\n !(\n replacementUpdate.newName &&\n replacementAlreadyExists(\n fileName.deps,\n dep,\n replacementUpdate.newName,\n )\n );\n if (name && (dep.deprecationMessage ?? hasAnyReplacement)) {\n hasDeprecationsOrReplacements = true;\n deprecatedPackages[manager] ??= {};\n deprecatedPackages[manager][name] ??= {\n hasActionableReplacement,\n sourceUrl: dep.sourceUrl,\n };\n }\n }\n }\n }\n }\n\n const hasBranches = isNonEmptyArray(branches);\n if (\n config.dependencyDashboardAutoclose &&\n !hasBranches &&\n !hasDeprecationsOrReplacements\n ) {\n if (GlobalConfig.get('dryRun')) {\n logger.info(\n { title: config.dependencyDashboardTitle },\n 'DRY-RUN: Would close Dependency Dashboard',\n );\n } else {\n logger.debug('Closing Dependency Dashboard');\n await platform.ensureIssueClosing(config.dependencyDashboardTitle!);\n }\n return;\n }\n let issueBody = '';\n\n if (config.dependencyDashboardHeader?.length) {\n issueBody += `${template.compile(config.dependencyDashboardHeader, config)}\\n\\n`;\n }\n\n if (configMigrationRes.result === 'pr-exists') {\n issueBody += `## Config Migration Needed\\n\\n${getMarkdownComment(configMigrationPrInfo)} See Config Migration PR: #${configMigrationRes.prNumber}.\\n\\n`;\n } else if (configMigrationRes?.result === 'pr-modified') {\n issueBody += `## Config Migration Needed (Blocked)\\n\\n${getMarkdownComment(configMigrationPrInfo)} The Config Migration branch exists but has been modified by another user. Renovate will not push to this branch unless it is first deleted. \\n\\n See Config Migration PR: #${configMigrationRes.prNumber}.\\n\\n`;\n } else if (configMigrationRes?.result === 'add-checkbox') {\n issueBody += `## Config Migration Needed\\n\\n${getCheckbox(createConfigMigrationPr)} Select this checkbox to let Renovate create an automated Config Migration PR.\\n\\n`;\n }\n\n issueBody = appendRepoProblems(config, issueBody);\n\n if (hasDeprecationsOrReplacements) {\n issueBody += '## Deprecations / Replacements\\n';\n issueBody += emojify('> :warning: **Warning**\\n> \\n');\n issueBody +=\n '> The following dependencies are either deprecated or have replacements available.\\n\\n';\n issueBody += '| Datasource | Package | Replacement PR? |\\n';\n issueBody += '|------------|------|--------------|\\n';\n for (const manager of Object.keys(deprecatedPackages).sort()) {\n const deps = deprecatedPackages[manager];\n for (const depName of Object.keys(deps).sort()) {\n const { hasActionableReplacement, sourceUrl } = deps[depName];\n const packageName = formatAsMarkdownLink(depName, sourceUrl);\n\n issueBody += `| ${manager} | ${packageName} | ${\n hasActionableReplacement\n ? '![Available](https://img.shields.io/badge/available-green?style=flat-square)'\n : '![Unavailable](https://img.shields.io/badge/unavailable-orange?style=flat-square)'\n } |\\n`;\n }\n }\n issueBody += '\\n';\n }\n\n if (config.dependencyDashboardReportAbandonment) {\n issueBody += getAbandonedPackagesMd(config, packageFiles);\n }\n\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'needs-approval',\n 'Pending Approval',\n 'The following branches are pending approval. To create them, click on a checkbox below.',\n 'approve',\n approveAllPendingPrs,\n 'Create all pending approval PRs at once',\n '🔐',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'minimum-group-size-not-met',\n 'Group Size Not Met',\n 'The following branches have not met their minimum group size. To create them, click on a checkbox below.',\n 'approveGroup',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'not-scheduled',\n 'Awaiting Schedule',\n 'The following updates are awaiting their schedule. To get an update now, click on a checkbox below.',\n 'unschedule',\n createAllAwaitingSchedulePrs,\n 'Create all awaiting schedule PRs at once',\n '🔐',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) =>\n branch.result === 'branch-limit-reached' ||\n branch.result === 'pr-limit-reached' ||\n branch.result === 'commit-per-run-limit-reached' ||\n branch.result === 'commit-hourly-limit-reached',\n 'Rate-Limited',\n 'The following updates are currently rate-limited. To force their creation now, click on a checkbox below.',\n 'unlimit',\n createAllRateLimitedPrs,\n 'Create all rate-limited PRs at once',\n '🔐',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'error',\n 'Errored',\n 'The following updates encountered an error and will be retried. To force a retry now, click on a checkbox below.',\n 'retry',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'needs-pr-approval',\n 'PR Creation Approval Required',\n 'The following branches exist but PR creation requires approval. To approve PR creation, click on a checkbox below.',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'pr-edited',\n 'PR Edited (Blocked)',\n 'The following updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox below.',\n 'rebase',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'pending',\n 'Pending Status Checks',\n 'The following updates await pending status checks. To force their creation now, click on a checkbox below.',\n 'unpend',\n );\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.prBlockedBy === 'BranchAutomerge',\n 'Pending Branch Automerge',\n 'The following updates await pending status checks before automerging. To abort the branch automerge and create a PR instead, click on a checkbox below.',\n );\n\n const warn = getDepWarningsDashboard(packageFiles, config);\n if (warn) {\n issueBody += warn;\n issueBody += '\\n';\n }\n\n const otherRes = [\n 'pending',\n 'needs-approval',\n 'needs-pr-approval',\n 'not-scheduled',\n 'pr-limit-reached',\n 'commit-per-run-limit-reached',\n 'commit-hourly-limit-reached',\n 'branch-limit-reached',\n 'already-existed',\n 'error',\n 'automerged',\n 'pr-edited',\n 'minimum-group-size-not-met',\n ];\n const inProgress = branches.filter(\n (branch) =>\n !otherRes.includes(branch.result!) &&\n branch.prBlockedBy !== 'BranchAutomerge',\n );\n issueBody += getBranchesListMd(\n inProgress,\n (branch) => !!branch.prBlockedBy || !branch.prNo,\n 'Other Branches',\n 'The following updates are pending. To force the creation of a PR, click on a checkbox below.',\n 'other',\n );\n issueBody += getBranchesListMd(\n inProgress,\n (branch) => branch.prNo && !branch.prBlockedBy,\n 'Open',\n 'The following updates have all been created. To force a retry/rebase of any, click on a checkbox below.',\n 'rebase',\n rebaseAllOpenPrs,\n 'Click on this checkbox to rebase all open PRs at once',\n );\n\n issueBody += getBranchesListMd(\n branches,\n (branch) => branch.result === 'already-existed',\n 'PR Closed (Blocked)',\n 'The following updates are blocked by an existing closed PR. To recreate the PR, click on a checkbox below.',\n 'recreate',\n );\n\n if (!hasBranches) {\n issueBody +=\n 'This repository currently has no open or pending branches.\\n\\n';\n }\n\n // add CVE section\n issueBody += await getDashboardMarkdownVulnerabilities(config, packageFiles);\n\n // fit the detected dependencies section\n const footer = getFooter(config);\n issueBody += PackageFiles.getDashboardMarkdown(\n platform.maxBodyLength() - issueBody.length - footer.length,\n );\n\n issueBody += footer;\n\n if (config.dependencyDashboardIssue) {\n // If we're not changing the dashboard issue, then we can skip checking if the user changed it.\n // The cached issue we get back here will reflect its state at the _start_ of our run\n const cachedIssue = await platform.getIssue?.(\n config.dependencyDashboardIssue,\n );\n if (cachedIssue?.body === issueBody) {\n logger.debug('No changes to dependency dashboard issue needed');\n return;\n }\n\n // Skip cache when getting the issue to ensure we get the latest body,\n // including any updates the user made after we started the run\n const updatedIssue = await platform.getIssue?.(\n config.dependencyDashboardIssue,\n false,\n );\n if (updatedIssue) {\n const { dependencyDashboardChecks } = parseDashboardIssue(\n coerceString(updatedIssue.body),\n );\n for (const branchName of Object.keys(config.dependencyDashboardChecks!)) {\n delete dependencyDashboardChecks[branchName];\n }\n for (const branchName of Object.keys(dependencyDashboardChecks)) {\n const checkText = getCheckbox(\n `${dependencyDashboardChecks[branchName]}-branch=${branchName}`,\n );\n issueBody = issueBody.replace(\n checkText,\n checkText.replace('[ ]', '[x]'),\n );\n }\n }\n }\n\n if (GlobalConfig.get('dryRun')) {\n logger.info(\n { title: config.dependencyDashboardTitle },\n 'DRY-RUN: Would ensure Dependency Dashboard',\n );\n } else {\n await platform.ensureIssue({\n title: config.dependencyDashboardTitle!,\n reuseTitle,\n body: platform.massageMarkdown(issueBody, config.rebaseLabel),\n labels: config.dependencyDashboardLabels,\n confidential: config.confidential,\n });\n }\n}\n\nexport function getAbandonedPackagesMd(\n config: RenovateConfig,\n packageFiles: Record<string, PackageFile[]>,\n): string {\n const abandonedPackages: Record<\n string,\n Record<\n string,\n { mostRecentTimestamp?: string | null; sourceUrl?: string | null }\n >\n > = {};\n let abandonedCount = 0;\n\n for (const [manager, managerPackageFiles] of Object.entries(packageFiles)) {\n for (const packageFile of managerPackageFiles) {\n for (const dep of coerceArray(packageFile.deps)) {\n if (dep.depName && dep.isAbandoned) {\n abandonedCount++;\n abandonedPackages[manager] = abandonedPackages[manager] || {};\n abandonedPackages[manager][dep.depName] = {\n mostRecentTimestamp: dep.mostRecentTimestamp,\n sourceUrl: dep.sourceUrl,\n };\n }\n }\n }\n }\n\n if (abandonedCount === 0) {\n return '';\n }\n\n let abandonedMd = '## Abandoned Dependencies\\n\\n';\n abandonedMd +=\n 'The following dependencies have not received updates for an extended period and may be unmaintained.\\n\\n';\n\n // Keep the note outside the `<details>` block: GitHub only renders alert\n // callouts at the top level of a body, not inside collapsible sections.\n abandonedMd += emojify('> :information_source: **Note**\\n> \\n');\n abandonedMd += `> Packages are marked as abandoned when they exceed the [\\`abandonmentThreshold\\`](${GlobalConfig.get('productLinks').documentation}configuration-options/#abandonmentthreshold) since their last release. `;\n abandonedMd +=\n 'Unlike deprecated packages with official notices, abandonment is detected by release inactivity.\\n> \\n';\n\n abandonedMd += '<details>\\n';\n abandonedMd += `<summary>View abandoned dependencies (${abandonedCount})</summary>\\n\\n`;\n\n abandonedMd += '| Datasource | Package | Last Updated |\\n';\n abandonedMd += '|------------|------|-------------|\\n';\n\n for (const manager of Object.keys(abandonedPackages).sort()) {\n const deps = abandonedPackages[manager];\n for (const depName of Object.keys(deps).sort()) {\n const { mostRecentTimestamp, sourceUrl } = deps[depName];\n const formattedDate = mostRecentTimestamp\n ? DateTime.fromISO(mostRecentTimestamp).toFormat('yyyy-MM-dd')\n : 'unknown';\n const packageName = formatAsMarkdownLink(depName, sourceUrl);\n abandonedMd += `| ${manager} | ${packageName} | \\`${formattedDate}\\` |\\n`;\n }\n }\n\n abandonedMd += '\\n</details>\\n\\n\\n';\n\n return abandonedMd;\n}\n\nfunction getFooter(config: RenovateConfig): string {\n let footer = '';\n if (config.dependencyDashboardFooter?.length) {\n footer += `---\\n${template.compile(config.dependencyDashboardFooter, config)}\\n`;\n }\n\n return footer;\n}\n\nexport async function getDashboardMarkdownVulnerabilities(\n config: RenovateConfig,\n packageFiles: Record<string, PackageFile[]>,\n): Promise<string> {\n let result = '';\n\n if (\n isNullOrUndefined(config.dependencyDashboardOSVVulnerabilitySummary) ||\n config.dependencyDashboardOSVVulnerabilitySummary === 'none'\n ) {\n return result;\n }\n\n result += '## Vulnerabilities\\n\\n';\n\n let vulnerabilities: Vulnerability[];\n try {\n const vulnerabilityFetcher = await Vulnerabilities.create();\n vulnerabilities = await vulnerabilityFetcher.fetchVulnerabilities(\n config,\n packageFiles,\n );\n } catch (err) {\n logger.warn({ err }, 'Unable to read vulnerability information');\n result +=\n 'Renovate was unable to fetch CVE information from [osv.dev](https://osv.dev) this run.\\n\\n';\n return result;\n }\n\n if (vulnerabilities.length === 0) {\n result +=\n 'Renovate has not found any CVEs on [osv.dev](https://osv.dev).\\n\\n';\n return result;\n }\n\n const unresolvedVulnerabilities = vulnerabilities.filter((value) =>\n isNullOrUndefined(value.fixedVersion),\n );\n const resolvedVulnerabilitiesLength =\n vulnerabilities.length - unresolvedVulnerabilities.length;\n\n result += emojify('> :exclamation: **Important**\\n> \\n');\n result += `> \\`${resolvedVulnerabilitiesLength}\\`/\\`${vulnerabilities.length}\\``;\n if (isTruthy(config.osvVulnerabilityAlerts)) {\n result += ' CVEs have Renovate fixes.\\n\\n';\n } else {\n result += ` CVEs have possible Renovate fixes.\\n> See [\\`osvVulnerabilityAlerts\\`](${GlobalConfig.get('productLinks').documentation}configuration-options/#osvvulnerabilityalerts) to allow Renovate to supply fixes.\\n\\n`;\n }\n\n let renderedVulnerabilities: Vulnerability[];\n switch (config.dependencyDashboardOSVVulnerabilitySummary) {\n // filter vulnerabilities to display based on configuration\n case 'unresolved':\n renderedVulnerabilities = unresolvedVulnerabilities;\n break;\n default:\n renderedVulnerabilities = vulnerabilities;\n }\n\n const managerRecords: Record<\n string,\n Record<string, Record<string, Vulnerability[]>>\n > = {};\n for (const vulnerability of renderedVulnerabilities) {\n const { manager, packageFile } = vulnerability.packageFileConfig;\n if (isNullOrUndefined(managerRecords[manager!])) {\n managerRecords[manager!] = {};\n }\n if (isNullOrUndefined(managerRecords[manager!][packageFile])) {\n managerRecords[manager!][packageFile] = {};\n }\n if (\n isNullOrUndefined(\n managerRecords[manager!][packageFile][vulnerability.packageName],\n )\n ) {\n managerRecords[manager!][packageFile][vulnerability.packageName] = [];\n }\n managerRecords[manager!][packageFile][vulnerability.packageName].push(\n vulnerability,\n );\n }\n\n for (const [manager, packageFileRecords] of Object.entries(managerRecords)) {\n result += `<details><summary>${manager}</summary>\\n<blockquote>\\n\\n`;\n for (const [packageFile, packageNameRecords] of Object.entries(\n packageFileRecords,\n )) {\n result += `<details><summary>${packageFile}</summary>\\n<blockquote>\\n\\n`;\n for (const [packageName, cves] of Object.entries(packageNameRecords)) {\n result += `<details><summary>${packageName}</summary>\\n<blockquote>\\n\\n`;\n for (const vul of cves) {\n const id = vul.vulnerability.id;\n const suffix = isNonEmptyString(vul.fixedVersion)\n ? ` (fixed in ${vul.fixedVersion})`\n : '';\n result += `- [${id}](https://osv.dev/vulnerability/${id})${suffix}\\n`;\n }\n result += `</blockquote>\\n</details>\\n\\n`;\n }\n result += `</blockquote>\\n</details>\\n\\n`;\n }\n result += `</blockquote>\\n</details>\\n\\n`;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAsCA,MAAM,gBAAgB,MACpB,cAAc,mBAAmB,0BA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AAO,QAAQ,kBAAkB,GAAG;IACpE,UAAU,qBAAqB,YAAY;IAC3C,KAAK,MAAM,OAAO,MAAM;KACtB,MAAM,KAAK,IAAI,cAAc;KAC7B,MAAM,SAAS,iBAAiB,IAAI,YAAY,IAC5C,cAAc,IAAI,aAAa,KAC/B;KACJ,UAAU,MAAM,GAAG,kCAAkC,GAAG,GAAG,OAAO;IACpE;IACA,UAAU;GACZ;GACA,UAAU;EACZ;EACA,UAAU;CACZ;CAEA,OAAO;AACT"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "renovate",
3
3
  "description": "Automated dependency updates. Flexible so you don't need to be.",
4
- "version": "44.176.2",
4
+ "version": "44.176.4",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "renovate": "dist/renovate.js",
@@ -118,7 +118,7 @@
118
118
  "@pnpm/parse-overrides": "1001.0.4",
119
119
  "@qnighy/marshal": "0.1.3",
120
120
  "@redis/client": "6.3.0",
121
- "@renovatebot/base-image": "13.139.1",
121
+ "@renovatebot/base-image": "13.139.3",
122
122
  "@renovatebot/detect-tools": "4.0.23",
123
123
  "@renovatebot/good-enough-parser": "2.0.1",
124
124
  "@renovatebot/osv-offline": "3.0.12",
@@ -160,7 +160,7 @@
160
160
  "glob": "13.0.6",
161
161
  "global-agent": "3.0.0",
162
162
  "google-auth-library": "11.3.0",
163
- "got": "16.0.0",
163
+ "got": "16.1.0",
164
164
  "graph-data-structure": "4.5.0",
165
165
  "handlebars": "4.7.10",
166
166
  "ignore": "7.0.12",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$id": "https://docs.renovatebot.com/renovate-schema.json",
3
- "title": "JSON schema for Renovate 44.176.2 config files (https://renovatebot.com/)",
3
+ "title": "JSON schema for Renovate 44.176.4 config files (https://renovatebot.com/)",
4
4
  "$schema": "http://json-schema.org/draft-07/schema#",
5
- "x-renovate-version": "44.176.2",
5
+ "x-renovate-version": "44.176.4",
6
6
  "allowComments": true,
7
7
  "type": "object",
8
8
  "definitions": {