New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement an API to trigger custom tasks #447
Conversation
assert_json 'status', 'pending' | ||
end | ||
|
||
test "#trigger when the task doesn't exist" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#trigger returns a 404 when the task doesn't exist
|
||
def trigger | ||
render_resource stack.trigger_task(params[:task_name], current_user), status: :accepted | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to update the require_permission
call for TasksController
as trigger
is more then a :read
on :stack
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:s very good point /o\
Aside from the permissions issue LGTM |
I've restricted it to |
👍 |
Implement an API to trigger custom tasks
👍 |
Part of: #363
Requested by @dwradcliffe
Endpoint
POST /api/stacks/:organization/:repository/:environment/task/:task_name
e.g:
POST /api/shopify/shipit/production/task/restart
.@gmalette @davidcornu @dwradcliffe for review please.