Auto-merged master into fix_crons on deployment.
This commit is contained in:
commit
f787a96b96
|
@ -29,11 +29,14 @@ class Travis::Api::App
|
|||
#
|
||||
# I think we need to properly deprecate this by publishing a blog post.
|
||||
Metriks.meter("api.request.restart").mark
|
||||
service = Travis::Enqueue::Services::RestartModel.new(current_user, params)
|
||||
params[:user_id] = service.target.repository.owner.id
|
||||
|
||||
service = Travis::Enqueue::Services::RestartModel.new(current_user, { build_id: params[:build_id] })
|
||||
payload = {id: params[:build_id], user_id: current_user.id}
|
||||
service.push("job:restart", payload)
|
||||
status 202
|
||||
type = params[:build_id] ? 'build' : 'job'
|
||||
params[:id] = params[:build_id] || params[:job_id]
|
||||
|
||||
service.push("#{type}:restart", params)
|
||||
respond_with(result: true, flash: service.messages)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -30,7 +30,14 @@ describe 'Requests', set_app: true do
|
|||
describe 'POST /requests' do
|
||||
it 'triggers a build request using Hub' do
|
||||
response = post "/requests", { build_id: build.id }, headers
|
||||
response.status.should be(202)
|
||||
response.status.should be(200)
|
||||
end
|
||||
end
|
||||
|
||||
it 'triggers a job request' do
|
||||
payload = { job_id: build.matrix.first.id, user_id: repo.owner.id }
|
||||
response = post "/requests", payload, headers
|
||||
response.status.should be(200)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user