Skip to content

Add self-hosted configuration to allow returning an exit code on error states #45475

Description

@jamietanna

When Renovate runs, there are a few means to determine whether the run was successful.

One such means to identify this is i.e.

INFO: Repository finished
{
  "cloned": true,
  "durationMs": 59440,
  "result": "done",
  "status": "activated",
  "enabled": true,
  "onboarded": true
}

or an unsuccessful run:

 INFO: Repository finished (repository=local)
       "cloned": undefined,
       "durationMs": 47,
       "result": "config-validation",
       "status": "onboarded",
       "enabled": true,
       "onboarded": true

A self-hosted administrator could parse these log lines, and the exported lib/constants/error-messages.ts constants that are handily grouped, and determine whether it's a success/failure.

This is independent from being able to work out whether Renovate itself had an error (i.e. Out Of Memory errors, the process crashes for some other reason)

Alternatively, we can use the process exit code to indicate this.

This would:

  • Introduce a new experimental: true self-hosted configuration option, exitCodeForErrors
  • Explicitly document the known error states:
    • 1: application error
    • (...etc)
  • When one of the known repository error states are encountered, the exit code is updated appropriately

Questions:

  • Should this only work when one repository is set?
  • Should this error code be added to Repository finished? Yes

Metadata

Metadata

Labels

mend:customer-interestA Mend customer has shown interest in this workpriority-2-highBugs impacting wide number of users or very important features

Fields

Priority

None yet

Datasource

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions