Description
Describing
The CLI has a useful flag --autoclone
. However, I’m seeing confusing behavior when using it.
Assuming my service is currently on version 1 (active), if I use --autoclone
and I type an invalid command, even something like this:
fastly backend create --autoclone --version=active
I get an error message:
ERROR: the Fastly API returned 400 Bad Request: Name can't be blank, 'address', 'ipv4', 'ipv6', or 'hostname' is required.
Unfortunately by this time it seems the cloning by --autoclone has already happened, so if I follow up with another command:
fastly backend create --autoclone --version=active --name=origin --address=www.example.com
I will end up on version 3.
I get it because I understand the cloning happens separate from the backend create, however the CLI doesn’t say this so I found it confusing. It results in a mismatch between the user's mental model of the state of the service and the actual state.
Proposed fix
More communication can help here. I’m thinking that a stdout message when the new version has been created would help clarify. That way, if an error occurs you can still see that the version has been created even though your desired operation never went through to completion.