feat: env deploy --no-rollback flag#4168
Conversation
|
🍕 Here are the new binary sizes!
|
Codecov Report
@@ Coverage Diff @@
## mainline #4168 +/- ##
============================================
- Coverage 69.24% 69.22% -0.02%
============================================
Files 250 250
Lines 35927 35945 +18
Branches 264 264
============================================
+ Hits 24876 24883 +7
- Misses 9856 9866 +10
- Partials 1195 1196 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
| } | ||
| if o.disableRollback { | ||
| stackName := stack.NameForEnv(o.targetApp.Name, o.targetEnv.Name) | ||
| rollbackCmd := fmt.Sprintf("aws cloudformation rollback-stack --stack-name %s --role-arn %s", stackName, o.targetEnv.ExecutionRoleARN) |
There was a problem hiding this comment.
Really nice to include the role ARN! 💖
There was a problem hiding this comment.
nit: This is nice so you don't have to change it, I'm just thinking out loud here.
I'd have expected this log to be in either the (1) RecommendedActions method, or, (2) we implement a custom error type that implements the RecommendActions method.
I don't think (1) fits since we are not exiting Execute successfully, so I think (2) is the better route 💭
So perhaps something like:
err := fmt.Errorf("deploy environment %s: %w", o.name, err)
if o.disableRollback{
return &errWithDisabledRollback{
parentErr: err,
stackName: stack.NameForEnv(o.targetApp.Name, o.targetEnv.Name),
cmd: fmt.Sprintf("aws cloudformation rollback-stack --stack-name %s --role-arn %s", stackName, o.targetEnv.ExecutionRoleARN)
}
}
return err
iamhopaul123
left a comment
There was a problem hiding this comment.
This is awesome! One quick question: shall we give a different hint to them if their env deploy fails because they did env deploy --no-rollback before and they haven't manually rollback the deployment?
|
This is what the error looks like right now - I think it's probably good enough, what do you think? The second command is the specific case you're talking about: |
should help with some debugging. - https://gitter.im/aws/copilot-cli?at=636cb648473cf96648dbcbb9 - https://gitter.im/aws/copilot-cli?at=636c024ca34b51121122d168 By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
should help with some debugging.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.