-
Notifications
You must be signed in to change notification settings - Fork 146
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
Update build_deploy
with allow_concurrency
keyword argument
#1334
Conversation
100c8c7
to
e73b267
Compare
e73b267
to
4ce20f5
Compare
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.
In addition to the comment about the controllers, we need to add tests for this!
4ce20f5
to
5e3767d
Compare
accepts :require_ci, Boolean, default: false | ||
accepts :env, Hash, default: {} | ||
end | ||
def create | ||
commit = stack.commits.by_sha(params.sha) || param_error!(:sha, 'Unknown revision') | ||
param_error!(:force, "Can't deploy a locked stack") if !params.force && stack.locked? | ||
param_error!(:require_ci, "Commit is not deployable") if params.require_ci && !commit.deployable? | ||
deploy = stack.trigger_deploy(commit, current_user, env: params.env, force: params.force) | ||
deploy = stack.trigger_deploy(commit, current_user, env: params.env, force: params.force, |
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 need to add some testing around this - as it stands, I think that if params.allow_concurrency
equals false
but params.force
equals true
, allow_concurrency
is going to end up evaluated to true
due to the ||
condition
Add unit tests
5e3767d
to
c2c77ea
Compare
1 of 2 PRs (2nd PR will be in an Internal Shopify service)
There is an internal Shopify ticket that hopes to separate concurrent deploys from
force=true
for the deploy API. To avoid overriding the wholebuild_deploy
method in our internal service, I have updated the method signature to acceptallow_concurrency
field but default it toforce
to keep the existing implementation.Changelog and README.md have been updated in case other users would also like to more control of the concurrency of deployments; note, that this differs from rollback whose concurrency is still limited to
force
.