renovate 44.75.2 → 44.77.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,26 @@
1
- import { CONFIG_SECRETS_EXPOSED, CONFIG_VALIDATION, MISSING_API_CREDENTIALS, RepositoryErrors } from "../../constants/error-messages.js";
1
+ import { CONFIG_SECRETS_EXPOSED, CONFIG_VALIDATION, ConfigErrors, EXTERNAL_HOST_ERROR, MANAGER_LOCKFILE_ERROR, MISSING_API_CREDENTIALS, PlatformErrors, RepositoryErrors, SystemErrors, TemporaryErrors, UNKNOWN_ERROR } from "../../constants/error-messages.js";
2
2
  import { logger } from "../../logger/index.js";
3
3
  //#region lib/workers/repository/result.ts
4
+ /**
5
+ * Exit code per known error group, used when `exitCodeForErrors` is enabled.
6
+ *
7
+ * `RepositoryErrors` are deliberately absent: they mean the repository is disabled, not that the run failed.
8
+ */
9
+ const exitCodes = [
10
+ [SystemErrors, 3],
11
+ [PlatformErrors, 4],
12
+ [ConfigErrors, 5],
13
+ [TemporaryErrors, 6],
14
+ [[
15
+ EXTERNAL_HOST_ERROR,
16
+ MANAGER_LOCKFILE_ERROR,
17
+ MISSING_API_CREDENTIALS
18
+ ], 7],
19
+ [[UNKNOWN_ERROR], 8]
20
+ ];
21
+ function getExitCode(res) {
22
+ return exitCodes.find(([errors]) => errors.includes(res))?.[1] ?? 0;
23
+ }
4
24
  function processResult(config, res) {
5
25
  const enabledStatuses = [
6
26
  CONFIG_SECRETS_EXPOSED,
@@ -35,7 +55,8 @@ function processResult(config, res) {
35
55
  res,
36
56
  status,
37
57
  enabled,
38
- onboarded
58
+ onboarded,
59
+ exitCode: getExitCode(res)
39
60
  };
40
61
  }
41
62
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"result.js","names":[],"sources":["../../../lib/workers/repository/result.ts"],"sourcesContent":["import type { RenovateConfig } from '../../config/types.ts';\n\nimport type {\n ConfigErrors,\n EXTERNAL_HOST_ERROR,\n MANAGER_LOCKFILE_ERROR,\n PlatformErrors,\n SystemErrors,\n TemporaryErrors,\n UNKNOWN_ERROR,\n} from '../../constants/error-messages.ts';\nimport {\n CONFIG_SECRETS_EXPOSED,\n CONFIG_VALIDATION,\n MISSING_API_CREDENTIALS,\n RepositoryErrors,\n} from '../../constants/error-messages.ts';\n\nimport { logger } from '../../logger/index.ts';\n\nexport type ProcessStatus =\n /**\n * The repository has been disabled, and will not be processed.\n *\n * See {@link RepositoryErrors} for information on which statuses lead to this.\n */\n | 'disabled'\n /**\n * The repository has onboarded to Renovate, so will see PRs and/or branches raised by Renovate.\n *\n * The repository has not yet merged any PRs, or the repository performs branch-based automerge and those have not been detected (TODO #40635).\n */\n | 'onboarded'\n /**\n * The repository has onboarded to Renovate, and has merged at least 1 Renovate PR.\n *\n * The repository may also perform branch-based automerge which has not been detected (TODO #40635).\n */\n | 'activated'\n /**\n * The repository has an onboarding PR from Renovate that has not yet been reviewed and merged.\n */\n | 'onboarding'\n | 'unknown';\n\nexport interface ProcessResult {\n res: RepositoryResult;\n status: ProcessStatus;\n enabled: boolean | undefined;\n onboarded: boolean | undefined;\n}\n\n/** a strong type for any repository result status that Renovate may report */\nexport type RepositoryResult =\n /** repository was processed successfully */\n | 'done'\n /** Renovate performed branch-based automerge on one branch during its run */\n | 'automerged'\n /** the repository is not yet onboarded, and its onboarding PR was processed during this run */\n | 'onboarding'\n // common set of errors\n | (typeof SystemErrors)[number]\n | (typeof RepositoryErrors)[number]\n | (typeof TemporaryErrors)[number]\n | (typeof ConfigErrors)[number]\n | (typeof PlatformErrors)[number]\n // other errors\n | typeof EXTERNAL_HOST_ERROR\n | typeof MISSING_API_CREDENTIALS\n | typeof MANAGER_LOCKFILE_ERROR\n | typeof UNKNOWN_ERROR;\n\nexport function processResult(\n config: RenovateConfig,\n res: RepositoryResult,\n): ProcessResult {\n const enabledStatuses = [\n CONFIG_SECRETS_EXPOSED,\n CONFIG_VALIDATION,\n MISSING_API_CREDENTIALS,\n ];\n let status: ProcessStatus;\n let enabled: boolean | undefined;\n let onboarded: boolean | undefined;\n // istanbul ignore next\n if (RepositoryErrors.includes(res as (typeof RepositoryErrors)[number])) {\n status = 'disabled';\n enabled = false;\n } else if (config.repoIsActivated) {\n status = 'activated';\n enabled = true;\n onboarded = true;\n } else if (enabledStatuses.includes(res) || config.repoIsOnboarded) {\n status = 'onboarded';\n enabled = true;\n onboarded = true;\n } else if (config.repoIsOnboarded === false) {\n status = 'onboarding';\n enabled = true;\n onboarded = false;\n } else {\n logger.debug(`Unknown res: ${res}`);\n status = 'unknown';\n }\n logger.debug(\n // TODO: types (#22198)\n `Repository result: ${res}, status: ${status}, enabled: ${enabled!}, onboarded: ${onboarded!}`,\n );\n return { res, status, enabled, onboarded };\n}\n"],"mappings":";;;AAwEA,SAAgB,cACd,QACA,KACe;CACf,MAAM,kBAAkB;EACtB;EACA;EACA;CACF;CACA,IAAI;CACJ,IAAI;CACJ,IAAI;;CAEJ,IAAI,iBAAiB,SAAS,GAAwC,GAAG;EACvE,SAAS;EACT,UAAU;CACZ,OAAO,IAAI,OAAO,iBAAiB;EACjC,SAAS;EACT,UAAU;EACV,YAAY;CACd,OAAO,IAAI,gBAAgB,SAAS,GAAG,KAAK,OAAO,iBAAiB;EAClE,SAAS;EACT,UAAU;EACV,YAAY;CACd,OAAO,IAAI,OAAO,oBAAoB,OAAO;EAC3C,SAAS;EACT,UAAU;EACV,YAAY;CACd,OAAO;EACL,OAAO,MAAM,gBAAgB,KAAK;EAClC,SAAS;CACX;CACA,OAAO,MAEL,sBAAsB,IAAI,YAAY,OAAO,aAAa,QAAS,eAAe,WACpF;CACA,OAAO;EAAE;EAAK;EAAQ;EAAS;CAAU;AAC3C"}
1
+ {"version":3,"file":"result.js","names":[],"sources":["../../../lib/workers/repository/result.ts"],"sourcesContent":["import type { RenovateConfig } from '../../config/types.ts';\n\nimport {\n CONFIG_SECRETS_EXPOSED,\n CONFIG_VALIDATION,\n ConfigErrors,\n EXTERNAL_HOST_ERROR,\n MANAGER_LOCKFILE_ERROR,\n MISSING_API_CREDENTIALS,\n PlatformErrors,\n RepositoryErrors,\n SystemErrors,\n TemporaryErrors,\n UNKNOWN_ERROR,\n} from '../../constants/error-messages.ts';\n\nimport { logger } from '../../logger/index.ts';\n\nexport type ProcessStatus =\n /**\n * The repository has been disabled, and will not be processed.\n *\n * See {@link RepositoryErrors} for information on which statuses lead to this.\n */\n | 'disabled'\n /**\n * The repository has onboarded to Renovate, so will see PRs and/or branches raised by Renovate.\n *\n * The repository has not yet merged any PRs, or the repository performs branch-based automerge and those have not been detected (TODO #40635).\n */\n | 'onboarded'\n /**\n * The repository has onboarded to Renovate, and has merged at least 1 Renovate PR.\n *\n * The repository may also perform branch-based automerge which has not been detected (TODO #40635).\n */\n | 'activated'\n /**\n * The repository has an onboarding PR from Renovate that has not yet been reviewed and merged.\n */\n | 'onboarding'\n | 'unknown';\n\nexport interface ProcessResult {\n res: RepositoryResult;\n status: ProcessStatus;\n enabled: boolean | undefined;\n onboarded: boolean | undefined;\n /** the process exit code this result maps to, used when `exitCodeForErrors` is enabled */\n exitCode: number;\n}\n\n/** a strong type for any repository result status that Renovate may report */\nexport type RepositoryResult =\n /** repository was processed successfully */\n | 'done'\n /** Renovate performed branch-based automerge on one branch during its run */\n | 'automerged'\n /** the repository is not yet onboarded, and its onboarding PR was processed during this run */\n | 'onboarding'\n // common set of errors\n | (typeof SystemErrors)[number]\n | (typeof RepositoryErrors)[number]\n | (typeof TemporaryErrors)[number]\n | (typeof ConfigErrors)[number]\n | (typeof PlatformErrors)[number]\n // other errors\n | typeof EXTERNAL_HOST_ERROR\n | typeof MISSING_API_CREDENTIALS\n | typeof MANAGER_LOCKFILE_ERROR\n | typeof UNKNOWN_ERROR;\n\n/**\n * Exit code per known error group, used when `exitCodeForErrors` is enabled.\n *\n * `RepositoryErrors` are deliberately absent: they mean the repository is disabled, not that the run failed.\n */\nconst exitCodes: [readonly string[], number][] = [\n [SystemErrors, 3],\n [PlatformErrors, 4],\n [ConfigErrors, 5],\n [TemporaryErrors, 6],\n [[EXTERNAL_HOST_ERROR, MANAGER_LOCKFILE_ERROR, MISSING_API_CREDENTIALS], 7],\n [[UNKNOWN_ERROR], 8],\n];\n\nfunction getExitCode(res: RepositoryResult): number {\n return exitCodes.find(([errors]) => errors.includes(res))?.[1] ?? 0;\n}\n\nexport function processResult(\n config: RenovateConfig,\n res: RepositoryResult,\n): ProcessResult {\n const enabledStatuses = [\n CONFIG_SECRETS_EXPOSED,\n CONFIG_VALIDATION,\n MISSING_API_CREDENTIALS,\n ];\n let status: ProcessStatus;\n let enabled: boolean | undefined;\n let onboarded: boolean | undefined;\n // istanbul ignore next\n if (RepositoryErrors.includes(res as (typeof RepositoryErrors)[number])) {\n status = 'disabled';\n enabled = false;\n } else if (config.repoIsActivated) {\n status = 'activated';\n enabled = true;\n onboarded = true;\n } else if (enabledStatuses.includes(res) || config.repoIsOnboarded) {\n status = 'onboarded';\n enabled = true;\n onboarded = true;\n } else if (config.repoIsOnboarded === false) {\n status = 'onboarding';\n enabled = true;\n onboarded = false;\n } else {\n logger.debug(`Unknown res: ${res}`);\n status = 'unknown';\n }\n logger.debug(\n // TODO: types (#22198)\n `Repository result: ${res}, status: ${status}, enabled: ${enabled!}, onboarded: ${onboarded!}`,\n );\n return { res, status, enabled, onboarded, exitCode: getExitCode(res) };\n}\n"],"mappings":";;;;;;;;AA6EA,MAAM,YAA2C;CAC/C,CAAC,cAAc,CAAC;CAChB,CAAC,gBAAgB,CAAC;CAClB,CAAC,cAAc,CAAC;CAChB,CAAC,iBAAiB,CAAC;CACnB,CAAC;EAAC;EAAqB;EAAwB;CAAuB,GAAG,CAAC;CAC1E,CAAC,CAAC,aAAa,GAAG,CAAC;AACrB;AAEA,SAAS,YAAY,KAA+B;CAClD,OAAO,UAAU,MAAM,CAAC,YAAY,OAAO,SAAS,GAAG,CAAC,CAAC,GAAG,MAAM;AACpE;AAEA,SAAgB,cACd,QACA,KACe;CACf,MAAM,kBAAkB;EACtB;EACA;EACA;CACF;CACA,IAAI;CACJ,IAAI;CACJ,IAAI;;CAEJ,IAAI,iBAAiB,SAAS,GAAwC,GAAG;EACvE,SAAS;EACT,UAAU;CACZ,OAAO,IAAI,OAAO,iBAAiB;EACjC,SAAS;EACT,UAAU;EACV,YAAY;CACd,OAAO,IAAI,gBAAgB,SAAS,GAAG,KAAK,OAAO,iBAAiB;EAClE,SAAS;EACT,UAAU;EACV,YAAY;CACd,OAAO,IAAI,OAAO,oBAAoB,OAAO;EAC3C,SAAS;EACT,UAAU;EACV,YAAY;CACd,OAAO;EACL,OAAO,MAAM,gBAAgB,KAAK;EAClC,SAAS;CACX;CACA,OAAO,MAEL,sBAAsB,IAAI,YAAY,OAAO,aAAa,QAAS,eAAe,WACpF;CACA,OAAO;EAAE;EAAK;EAAQ;EAAS;EAAW,UAAU,YAAY,GAAG;CAAE;AACvE"}
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.75.2",
4
+ "version": "44.77.0",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "renovate": "dist/renovate.js",
@@ -215,7 +215,7 @@
215
215
  "re2": "1.26.1"
216
216
  },
217
217
  "devDependencies": {
218
- "@biomejs/biome": "2.5.11",
218
+ "@biomejs/biome": "2.5.12",
219
219
  "@commander-js/extra-typings": "15.0.0",
220
220
  "@containerbase/istanbul-reports-html": "2.0.17",
221
221
  "@containerbase/semantic-release-pnpm": "1.4.3",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$id": "https://docs.renovatebot.com/renovate-schema.json",
3
- "title": "JSON schema for Renovate 44.75.2 config files (https://renovatebot.com/)",
3
+ "title": "JSON schema for Renovate 44.77.0 config files (https://renovatebot.com/)",
4
4
  "$schema": "http://json-schema.org/draft-07/schema#",
5
- "x-renovate-version": "44.75.2",
5
+ "x-renovate-version": "44.77.0",
6
6
  "allowComments": true,
7
7
  "type": "object",
8
8
  "definitions": {
@@ -11907,6 +11907,11 @@
11907
11907
  "executionTimeout"
11908
11908
  ]
11909
11909
  },
11910
+ {
11911
+ "required": [
11912
+ "exitCodeForErrors"
11913
+ ]
11914
+ },
11910
11915
  {
11911
11916
  "required": [
11912
11917
  "processEnv"