From d6870c2bb86494472d418735f9244490eef8e5e4 Mon Sep 17 00:00:00 2001 From: Shinya Maeda <shinya@gitlab.com> Date: Wed, 22 Sep 2021 10:42:29 +0700 Subject: [PATCH] Do not auto-retry unrecoverable job failure Currently, the system tries to auto-retry jobs that failed by 'missing_dependency_failure', however, this failure is not recoverable. This commit force-overrides the auto-retry maximum on the specific failure. --- app/assets/javascripts/editor/schema/ci.json | 4 ---- doc/ci/yaml/index.md | 1 - lib/gitlab/ci/build/auto_retry.rb | 3 ++- spec/lib/gitlab/ci/build/auto_retry_spec.rb | 1 + spec/lib/gitlab/ci/config/entry/retry_spec.rb | 1 - 5 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/editor/schema/ci.json b/app/assets/javascripts/editor/schema/ci.json index 04a36953d666437e..205b4c4ab07d38e7 100644 --- a/app/assets/javascripts/editor/schema/ci.json +++ b/app/assets/javascripts/editor/schema/ci.json @@ -841,10 +841,6 @@ "const": "runner_system_failure", "description": "Retry if there is a runner system failure (for example, job setup failed)." }, - { - "const": "missing_dependency_failure", - "description": "Retry if a dependency is missing." - }, { "const": "runner_unsupported", "description": "Retry if the runner is unsupported." diff --git a/doc/ci/yaml/index.md b/doc/ci/yaml/index.md index b9b4e1faafb955ae..b50d2e519059eddc 100644 --- a/doc/ci/yaml/index.md +++ b/doc/ci/yaml/index.md @@ -3405,7 +3405,6 @@ Possible values for `when` are: - `api_failure`: Retry on API failure. - `stuck_or_timeout_failure`: Retry when the job got stuck or timed out. - `runner_system_failure`: Retry if there is a runner system failure (for example, job setup failed). -- `missing_dependency_failure`: Retry if a dependency is missing. - `runner_unsupported`: Retry if the runner is unsupported. - `stale_schedule`: Retry if a delayed job could not be executed. - `job_execution_timeout`: Retry if the script exceeded the maximum execution time set for the job. diff --git a/lib/gitlab/ci/build/auto_retry.rb b/lib/gitlab/ci/build/auto_retry.rb index b98d1d7b330efd5a..6ab567dff7c6772f 100644 --- a/lib/gitlab/ci/build/auto_retry.rb +++ b/lib/gitlab/ci/build/auto_retry.rb @@ -9,7 +9,8 @@ class Gitlab::Ci::Build::AutoRetry RETRY_OVERRIDES = { ci_quota_exceeded: 0, - no_matching_runner: 0 + no_matching_runner: 0, + missing_dependency_failure: 0 }.freeze def initialize(build) diff --git a/spec/lib/gitlab/ci/build/auto_retry_spec.rb b/spec/lib/gitlab/ci/build/auto_retry_spec.rb index e83e13262067c2cb..fc5999d59ac3000b 100644 --- a/spec/lib/gitlab/ci/build/auto_retry_spec.rb +++ b/spec/lib/gitlab/ci/build/auto_retry_spec.rb @@ -24,6 +24,7 @@ "default for scheduler failure" | 1 | {} | :scheduler_failure | true "quota is exceeded" | 0 | { max: 2 } | :ci_quota_exceeded | false "no matching runner" | 0 | { max: 2 } | :no_matching_runner | false + "missing dependencies" | 0 | { max: 2 } | :missing_dependency_failure | false end with_them do diff --git a/spec/lib/gitlab/ci/config/entry/retry_spec.rb b/spec/lib/gitlab/ci/config/entry/retry_spec.rb index b38387a437e49ee0..84ef5344a8b3775d 100644 --- a/spec/lib/gitlab/ci/config/entry/retry_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/retry_spec.rb @@ -101,7 +101,6 @@ api_failure stuck_or_timeout_failure runner_system_failure - missing_dependency_failure runner_unsupported stale_schedule job_execution_timeout -- GitLab