Allow empty updates #1047
Replies: 8 comments
-
Is it just throwing the no changes boto exception? We should probably handle that exception for the create_change_set part and return a zero status. |
Beta Was this translation helpful? Give feedback.
-
In a somewhat related issue, I notice that if there are any other types of errors in updating via The problem is detecting errors from the CLI end, as the command still returns a 0 after encountering an error. Perhaps more broadly, defining a strategy of detecting and handling errors on the command line would be beneficial. |
Beta Was this translation helpful? Give feedback.
-
So I've had a chance to poke around and do some testing with the latest code - it doesn't appear that an exception is thrown from boto, instead the change set is created, fails on the aws end because there are no changes to apply (as expected), then upon checking if By tracing through one of these updates, I found that cloudformation returns:
Which results in From what I can tell, it seems the only way to detect this scenario is to check that the status reason matches the above snippet, and return 0. However I'm unsure if this is a change you would agree with. I'm happy to attempt a PR if you do, however. |
Beta Was this translation helpful? Give feedback.
-
@justinberry would this be specifically for the CLI output. I don't see any reason why we couldn't include a more meaningful CLI output for this so that you could add some logic to the returned message on your side. We probably wouldn't want to start creating our own exit codes for responses from boto but could certainly help with more useful responses for you to parse? |
Beta Was this translation helpful? Give feedback.
-
I was able to work-around this issue by using a dummy resource. See the recommendation in this forum post. Adding a resource of type As a bonus, this also works very well when you are changing outputs and other metadata which does not always show up as an update. |
Beta Was this translation helpful? Give feedback.
-
Do we want exit codes to reflect on just how Sceptre runs or also reflect on CloudFormation? |
Beta Was this translation helpful? Give feedback.
-
In my view this sort of ties into the philosophy of the tool - is it supposed to build a layer of abstraction on top of boto/CF and add some features that people are missing? Or does it lean more towards being an easy tool for a developer/sysadmin to use while sometimes ignoring how the underlying implementations of boto and CF work? Or something else? If it's the latter, I'd argue that if there's a good argument for overruling an error that improves usability it may be worth doing. In this case, it seems to me that amazon are treating a what amounts to a NOOP action as an error, and the state you're sending up (i.e. the template) is actually valid. Also given exit codes are pretty central to error handling on the command line, it is a key part of making the tool usable in automated environments. Perhaps there are reasons that you wouldn't want this, but I can't think of any scenarios where that'd be the case right now. Another possible solution would be to add something like a @ngfgrant - friendly/parseable output would work, however it just means we'd still need to add stuff around the @mithun - this is a pretty cool solution however it does add a little more noise to our templates, but it may come in handy for us, thanks for the link! |
Beta Was this translation helpful? Give feedback.
-
sceptre-date-resolver has been implemented in issue #608 which may help with this issue. |
Beta Was this translation helpful? Give feedback.
-
Hey everyone,
We're using the
update-stack[-cs]
command in our build pipeline to update our stacks based on repository changes, and if there are no changes in our cloud formation templates (e.g. maybe we refactored a yaml file that has no effect on the template) sceptre attempts to issue an update and returns a non-zero status and subsequently fails the build. Right now I'm parsing theStatusReason
to find if the update actually failed or just lacked any new changes, but would like something a bit nicer.Some ideas for handling this:
StatusReason
provides. Right now it's much more human-friendly and not the greatest thing to rely on if they someday decide to change the wording.I'm new to this tool so apologies if I've missed something obvious here.
Beta Was this translation helpful? Give feedback.
All reactions