[Feature Request] Combo for deploy-request subcommand to create, deploy, and auto-close if successful
Context shared by user:
Right now in order to do a deploy request via CLI you need to do it in 3 calls : create + deploy + close. It would be a nice addition to do so in a single CLI call that would do those 3 steps. And just report errors if the deploy couldn't be done for some reason.
In the meantime I'm having to script these steps + having to parse the create output to get the DR_number to use in the next 2 calls...that's a lot of unwarranted complexity.
The current list of commands the user needs to complete looks something like this:
pscale deploy-request create <DATABASE_NAME> <BRANCH_NAME> --deploy-to <BRANCH_NAME>
pscale deploy-request deploy <DATABASE_NAME> <DR_NUMBER>
pscale deploy-request show <DATABASE_NAME> <DR_NUMBER>
pscale deploy-request close <DATABASE_NAME> <DR_NUMBER>
The show in there is for the user to be able to check whether the deploy is complete.
Looking at the current structure of the subcommands in our docs: https://docs.planetscale.com/reference/deploy-request#available-sub-commands
It seemed like one of the simpler ways to possibly make this functionality available to users might be to add a flag as part of the create step of the process:
pscale deploy-request create <DATABASE_NAME> <BRANCH_NAME> --deploy-to <BRANCH_NAME> --auto-deploy
Although I wasn't sure if something like --auto-deploy should include the close step or not. If not, then a secondary flag that also includes that step might be handy to have as well such as:
pscale deploy-request create <DATABASE_NAME> <BRANCH_NAME> --deploy-to <BRANCH_NAME> --auto-deploy-and-close
Lastly, the user also shared the following:
The call would be synchronous (ie. wait for the deploy to be complete). If all went well the call would simply exit. Of course if an issue prevents the deploy from completing then it would have to warn the user that deploy-request XX is in progress along with the appropriate error message and it's then the user's responsibility to finish off the job manually, potentially close the request and try again, etc.
Hopefully these are enough details to help guide the potential addition of this particular request.
Hi @orware
Thanks for writing up.
Right now in order to do a deploy request via CLI you need to do it in 3 calls : create + deploy + close. It would be a nice addition to do so in a single CLI call that would do those 3 steps. And just report errors if the deploy couldn't be done for some reason.
I believe that's not what we should aim for. The CLI is a building block meant to manage a DB's workflow process in each state. It's the same with the UI. There is no create + deploy + close workflow in the UI. Adding such a feature would populate the CLI with options and make it more complicated than we want.