bicep icon indicating copy to clipboard operation
bicep copied to clipboard

Bicep Deploy: Command is not cancelable

Open onionhammer opened this issue 1 year ago • 10 comments

Bit of feedback:

  1. When you click 'deploy bicep file' and it prompts you for parameters, it says "escape to cancel", this cancels the dialog but there is no way to cancel the deployment.
  2. When it prompts you for a parameter, especially if it's a @secure parameter, the value should be ****'d out, if possible
  3. When it prompts you for a parameter, allow the user to focus a different window in order to copy/paste things into the parameter. Currently the prompt just dismisses when VSCode loses focus.
  4. Allow the user to name the deployment, rather than generating a 'bicep3124123441' name

onionhammer avatar Jul 21 '22 14:07 onionhammer

Great feedback -- thanks @onionhammer. @ucheNkadiCode can we take a look at this one and turn it into individual issues?

alex-frankel avatar Jul 28 '22 17:07 alex-frankel

Thanks for your feedback @onionhammer! Some questions and comments:

  1. Are you saying that your deployment continues to run even when you didn't complete the deploy dialog? Like you hit escape while entering the params and the deployment still kicks off? Or are you saying you wish there was a way to stop a deployment after you started it?
  2. I appreciate the feedback, we have the option of doing this, as far as I know, VS Code doesn't offer a "Eye" icon to flash the raw password, would this frustrate you if you were to type an incorrect password? This is why we opted out of this route
  3. I think this is a limitation of VS Code actually, the dialog dismisses if something else is pressed
  4. I'll put this on our backlog, do you find yourself needing to name deployments often? Our assumption was that the link to get to your deployment would suffice

ucheNkadiCode avatar Jul 28 '22 18:07 ucheNkadiCode

Hi @ucheNkadiCode

Re: 1: Yes, I'm saying once I click "Deploy" on a bicep file, no matter how many times I hit escape it's going to run a deployment without any way to stop it - short of perhaps ctrl alt delete before it finishes prompting? Re: 2: This is more of a nice-to-have, I havent dealt with the VS code SDK in ages, so I'm not sure what's possible Re: 3: AFAIK other plugins are able to do this, such as the 'live share join' prompt, I can copy from another window while the prompt is up Re; 4: This is a personal thing, so you would have to gauge usage/whether its worth it, but I often times stick certain things in the output of a deployment called 'environment' so I can go to one place to get them, for example if I'm creating dev, test, an QA environment, my environment's output properties contain information like the URL of the site, or perhaps the URL of the keyvault. Without that I would have to probe the resource group itself to enumerate all the resources. It's just a convention I use.

onionhammer avatar Jul 28 '22 19:07 onionhammer

Woah 1 is a nasty bug but I can't reproduce it. If you have a gif that would be helpful! @bhsubra when you click deploy are you seeing the deployment kick off immediately?

image

What I see is, as soon as you right click Bicep deploy, it says "starting deployment, but in reality, it's more like "starting deployment flow" because the deployment is not going to get kicked off if you cancel. @onionhammer are you saying new resources are even showing up in Azure?

ucheNkadiCode avatar Jul 28 '22 20:07 ucheNkadiCode

@ucheNkadiCode should we close this in favor of the other issues you created, or do you want to leave this open?

alex-frankel avatar Aug 03 '22 19:08 alex-frankel

@ucheNkadiCode no, it does not kick off immediately, it looks like now I can't fully reproduce it (we are on a different version of the plugin now), here's what happens now

  1. I click right click on bicep file and click 'deploy'
  2. It prompts for subscription
  3. It prompts for resource group
  4. It prompts for parameters file
  5. It prompts me for first parameter, I hit escape
  6. It prompts me for second parameter, I hit escape
  7. It prompts me for every other parameter, I hit escape on all of them
  8. It cancels the deployment (where previously it would continue with the deployment here)

Relating to 3 above (copy/pasting from a different window), I am not able to reproduce that one anymore.

The only thing I would change now is to stop prompting for remaining parameters if you hit 'cancel' on a prior parameter.

onionhammer avatar Aug 03 '22 20:08 onionhammer

@bhsubra, could you take at look at what @onionhammer is mentioning?

@onionhammer, I'm assuming that when you are prompted for a parameters file, you select "None" correct? From then on, it is my understanding that if you press the escape key for any command prompt command in VS Code, it should cancel the dialog completely right? Or do you mean you hit "Enter"?

You said "stop prompting if you hit "cancel" on a prior parameters? Or do you mean "Esc"? or Enter? -> Is this is windows PC just to make sure I'm understanding

ucheNkadiCode avatar Aug 09 '22 22:08 ucheNkadiCode

@ucheNkadiCode I mean escape key, not cancel. I'm hitting escape key not enter.. this is on windows

onionhammer avatar Aug 09 '22 23:08 onionhammer

Here's a repro file that will show the esc issue:

param foo string
param bar string
param baz string

output foo string = foo
output bar string = bar
output baz string = baz

This will demonstrate that the deployment will still proceed even w/o parameters and that esc won't bail out of the parameter entry process if there are multiple.

alex-frankel avatar Aug 10 '22 19:08 alex-frankel

Okay thanks so much! I understand the scenario now.

@bhsubra, this error should be the first bug you work on at the completion of your Visual Studio work.

  1. We should change the design to STILL ask about unused parameters. I now understand that ARM CLI is expecting all params to be answered for
  2. Also, it's a pretty bad bug that if a user hits ESC to cancel, they still get led through each of the params and THEN it still tries to deploy their solution. Instead, ESC should cancel the entire command which is standard in VS Code

ucheNkadiCode avatar Aug 10 '22 19:08 ucheNkadiCode

When it prompts you for a parameter, allow the user to focus a different window in order to copy/paste things into the parameter. Currently the prompt just dismisses when VSCode loses focus.

This is easy to do, I'll handle it.

StephenWeatherford avatar Aug 19 '22 18:08 StephenWeatherford