boostercloud / booster

Booster Framework
https://www.boosterframework.com
Apache License 2.0
419 stars 87 forks source link

cli should have a --pretend flag to simulate execution #543

Open davidverdu opened 3 years ago

davidverdu commented 3 years ago

Feature Request

Description

It would be nice to have the --pretend flag in our boost commands to just display the command actions without executing. boost deploy -e production --pretend, for example, would check that you are in a Booster project and the environment exists, but it wouldn't perform the deployment in the cloud provider. The same could work for nuke or new commands

Possible Solution

Additional information

NickSeagull commented 3 years ago

Cannot see of a use case of this, can you explain more please?

davidverdu commented 3 years ago

I copied the idea from Ruby on Rails, which has this flag. For example, by running boost new:command CreatePost --fields title:string content:string --pretend the cli could display things like the files about to be created or if any of the files are about to be overwritten, all of it without writing any file. That way you can see the impact of your actions without changing your project. Maybe in rails is more advantageous to have this flag because more files are generated with single commands and you can even destroy things. Alternatively, It comes to my mind on second thought the following ideas:

boost build to compile the project without updating the cloud deployment (you can see if your code is consistent) boost clean to clean the code compiled files boost status to see the status of your project, wether it is deployed or not and in which url

NickSeagull commented 3 years ago

Yep those last three are very useful. We should have issues for them, can you create them please?

Regarding --pretend, maybe all commands should have confirmation unless you specify --yes or -y which then will omit the confirmation? Thoughts @boostercloud/booster-core ?

davidverdu commented 3 years ago

I would display a confirmation message on actions that overwrite or delete files, unless you pass the -y, --yes, -f or --force flag

davidverdu commented 3 years ago

I have created the boost clean, boost build and boost status issues in GitHub