summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-08-31 22:03:41 +0900
committerShinya Maeda <shinya@gitlab.com>2017-09-05 14:30:28 +0900
commit1d7c0390722c96aa66af5b26f5a826b97293dcd6 (patch)
treeff1795a881ac9a4fa455552ef5dd076f2978d8e2 /app
parentb1af1f268b97c8518bf2806bca48f49174a8aead (diff)
downloadgitlab-ce-1d7c0390722c96aa66af5b26f5a826b97293dcd6.tar.gz
Fix enum lists
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/build.rb2
-rw-r--r--app/models/commit_status.rb14
-rw-r--r--app/services/projects/update_pages_service.rb2
-rw-r--r--app/workers/stuck_ci_jobs_worker.rb2
4 files changed, 7 insertions, 13 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 9c50d521880..ba3156154ac 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -103,7 +103,7 @@ module Ci
end
end
- before_transition any => [:failed] do |build, transition|
+ before_transition any => [:failed] do |build|
next if build.retries_max.zero?
if build.retries_count < build.retries_max
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index 424f8e49d4d..1c4088d5af9 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -39,16 +39,10 @@ class CommitStatus < ActiveRecord::Base
scope :after_stage, -> (index) { where('stage_idx > ?', index) }
enum failure_reason: {
- no_error: nil,
- failed_by_script: 1, # TODO: Not used. Should we expand pipeline as well?
- failed_by_missing_dependency: 2, # This will be done in the next MR.
- failed_by_system: 3, # TODO: Not used. What's this state?
- failed_by_job_state: 4,
- failed_by_out_of_quota: 5, # TODO: Only EE. How can we detect?
- failed_by_stuck_and_timeout: 6,
- failed_by_no_runner: 7, # TODO: Not used. How can we detect?
- failed_by_api: 8,
- failed_by_page: 9
+ unknown_failure: nil,
+ job_failure: 1,
+ api_failure: 2,
+ stuck_or_timeout_failure: 3,
}
state_machine :status do
diff --git a/app/services/projects/update_pages_service.rb b/app/services/projects/update_pages_service.rb
index 0de123515c3..a18b9aae1ea 100644
--- a/app/services/projects/update_pages_service.rb
+++ b/app/services/projects/update_pages_service.rb
@@ -53,7 +53,7 @@ module Projects
log_error("Projects::UpdatePagesService: #{message}")
@status.allow_failure = !latest?
@status.description = message
- @status.drop(:failed_by_page)
+ @status.drop(:job_failure)
super
end
diff --git a/app/workers/stuck_ci_jobs_worker.rb b/app/workers/stuck_ci_jobs_worker.rb
index 0af8090866a..269776a1f62 100644
--- a/app/workers/stuck_ci_jobs_worker.rb
+++ b/app/workers/stuck_ci_jobs_worker.rb
@@ -53,7 +53,7 @@ class StuckCiJobsWorker
def drop_build(type, build, status, timeout)
Rails.logger.info "#{self.class}: Dropping #{type} build #{build.id} for runner #{build.runner_id} (status: #{status}, timeout: #{timeout})"
Gitlab::OptimisticLocking.retry_lock(build, 3) do |b|
- b.drop(:failed_by_stuck_and_timeout)
+ b.drop(:stuck_or_timeout_failure)
end
end
end