legacy-cli icon indicating copy to clipboard operation
legacy-cli copied to clipboard

`platform environment:resume` returns an error if the project is not paused

Open rfay opened this issue 1 year ago • 1 comments

platform environment:resume returns an error if the project is not paused.

It doesn't seem like this should be an error. How about a success return value?

$ platform environment:resume --project="${PLATFORM_PROJECT}" --environment="${PLATFORM_ENVIRONMENT}" --yes
The environment platform-pull (type: staging) is not paused. Only paused environments can be resumed.
l$ echo $?
1
Platform.sh CLI 4.10.2

rfay avatar Sep 30 '23 15:09 rfay

I guess the status not being "paused" doesn't necessarily mean that it is active or has been successfully resumed - because there is an in-between status of "dirty" while an environment might be either on the way to being paused, or on the way to being resumed. And there are also the statuses of "inactive" and "deleting" which would also not be desired results of resuming. So I feel returning an error feels more conservative: it's up to the caller then to check the exact environment state. I suppose we could return 0 if the environment is active, and 1 otherwise? but that seems convoluted.

pjcdawkins avatar Nov 30 '23 23:11 pjcdawkins