formica
formica copied to clipboard
Add option to create stack if missing on change command
Especially for CI it can be helpful to create the stack if it doesn't already exist.
This should be a separate option for change, e.g. --create-if-missing
so its clear that this isn't the best way to do things, but is possible.
How about a different command called upsert
?
I should have closed this by now. I've changed my mind on this one and imho every command (including deploying if it doesn't exist) should be a separate command you have to call. I want every command in Formica to be explicit, so there are never any surprises. A little more cumbersome, but much safer.
I understand your sentiment for deployment, but submitting a changeset is not as dangerous as deploying - one can always review it and change their mind. I think you might want to consider being a bit more lax about that. You could also, on a command like upsert
, emit a very loud output saying "CREATED" or "UPDATED" so it's unmissable.
Anyone who'd choose to use upsert
is probably familiar with its risks, but it doesn't change the fact that it'd be a very nice feature to have.
Anyone who'd choose to use upsert is probably familiar with its risks, but it doesn't change the fact that it'd be a very nice feature to have.
I agree with it being a nice feature to have, but for me one of the most important parts of Formica (and my general toolset) is forcing best practices (at least what I consider best practices) and that for me includes having change/deploy to be two separate steps so people don't accidentally deploy something. Its less convenient no doubt, but I'm really strongly in favor of making sure that tools push everyone to really inspect the changes that are about to happen and my fear is that people will just use upsert blindly, which I don't want.
Completely get the sentiment, its inconvenient for me regularly as well, but I consider that inconvenience a feature, not a bug.
I think you're confusing something. Isn't upsert
short for change || new
instead of change && deploy
. I definitely understand that change && deploy
shouldn't be introduced, but I don't understand the problems with change || new
(change the stack if it exists, otherwise create it). No deploy
involved.
Yup you're right my bad. Mixed up different issues here. Its probably going to be a flag on change like ---create-missing
or something like that. I'll reopen the issue. I'm not working on it at the moment, but maybe at some point in the future or with a PR.