summaryrefslogtreecommitdiff
path: root/lib/api/runner.rb
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-09-01 16:52:11 +0900
committerShinya Maeda <shinya@gitlab.com>2017-09-05 14:30:28 +0900
commit68f6c61cf621db82ac98d561782590b1866fcf6f (patch)
tree8d87711be50a9966939fe81aef158b8dfdb67fee /lib/api/runner.rb
parent1d7c0390722c96aa66af5b26f5a826b97293dcd6 (diff)
downloadgitlab-ce-68f6c61cf621db82ac98d561782590b1866fcf6f.tar.gz
- Allow runner API to pass failure_reason
- Fix spec
Diffstat (limited to 'lib/api/runner.rb')
-rw-r--r--lib/api/runner.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/api/runner.rb b/lib/api/runner.rb
index 701c1bff1e0..44ca42fef68 100644
--- a/lib/api/runner.rb
+++ b/lib/api/runner.rb
@@ -114,6 +114,8 @@ module API
requires :id, type: Integer, desc: %q(Job's ID)
optional :trace, type: String, desc: %q(Job's full trace)
optional :state, type: String, desc: %q(Job's status: success, failed)
+ optional :failure_reason, type: String, values: CommitStatus.failure_reasons.keys,
+ desc: %q(Job's failure_reason)
end
put '/:id' do
job = authenticate_job!
@@ -127,7 +129,11 @@ module API
when 'success'
job.success
when 'failed'
- job.drop(:job_failure)
+ if params[:failure_reason]
+ job.drop(params[:failure_reason].to_sym)
+ else
+ job.drop(:job_failure)
+ end
end
end