Skip to content

Add retry:exit_codes syntax for CI config

What does this MR do and why?

👋 This MR is the first one of a little series to add retry:exit_codes syntax to the CI Config.

The exit code of a job is already used by allowed_failures:exit_codes. The goal is to use the exit code to retry a job.

Example of usage:

  • Users might want to retry a job when OOM killed by kubernetes exit 137.

See the issue #262674 (closed) for more use cases.

New syntax

job:
  script: echo 'hello job script'
  retry:
    max: 2
    exit_codes:
      - 137
      - 255

OR.

job:
  script: echo 'hello job script'
  retry:
    max: 2
    exit_codes: 137

Same behaviours as allowed_failures:exit_codes

Implementation table

Step Status
1. Add exit_codes to retry class <-- This MR
2. Update retry business logic !137349 (merged)
3. Update CI json schema and documentation !137348 (merged)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #262674 (closed)

Edited by Baptiste Lalanne

Merge request reports

Loading