Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bicep Deploy: add support to name deployments #8717

Merged
merged 4 commits into from
Oct 27, 2022

Conversation

bhsubra
Copy link
Contributor

@bhsubra bhsubra commented Oct 18, 2022

Adds support to name deployments

Microsoft Reviewers: Open in CodeFlow

@bhsubra bhsubra marked this pull request as draft October 18, 2022 17:47
@bhsubra bhsubra marked this pull request as ready for review October 18, 2022 19:07
@@ -124,6 +124,12 @@ export class DeployCommand implements Command {
context
);

const options = {
title: `Please enter name for deployment`,
value: "bicep_deployment_".concat(Date.now().toString()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not using "bicep_deployment_" + DateTime.UtcNow.ToString("yyyyMMddHHmmss") ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, can we add the bicep filename to start of this (trimmed and escaped if needed)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated to specify 'YYYYMMDDHHmmss' format. I checked az cli experience and looks like it just uses the file name for deployment. The changes in this PR match the existing behavior, except an option to accept name from the user.
I would like to keep this as is and wait for customer feedback. @StephenWeatherford, do you have any concerns?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PC, Stephen and I discussed this offline and came up with <bicep_filename>_timestamp.

@bmoore-msft, could you please provide some input? I am trying to add support to accept deployment name from the user. By default, we want to prefil the input box with <bicep_filename>_timestamp. User can either use it or update the name. Does <bicep_filename>_timestamp sound like a good idea? Should we append timestamp to user provided input for uniqueness?

cc: @StephenWeatherford, @puicchan

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for deploying directly from VSCode?

I think the main thing when deploying from the dev env is "debugging" so I would worry less about uninqueness (e.g. a really long timestamp) and more about ease of getting the results if needed. So might go with something like <filename>-MMDD-HHMM

but in general I think looks good.

Copy link
Contributor Author

@bhsubra bhsubra Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the input @bmoore-msft. Yes, this is for deploying directly from VSCode.

I'll go ahead with <filename>-MMDD-HHMM then. @StephenWeatherford, @puicchan, could you please +1?

Copy link
Contributor

@StephenWeatherford StephenWeatherford Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, or else <filename>-YYMMDD-HHMM (added year)

You'll need to remove or substitute invalid characters from filename and trim if too long. Don't know max deployment name length.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

64 chars is the limit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added logic to replace special characters with _ and trim here:
e3e1110

@StephenWeatherford
Copy link
Contributor

Please test that pressing escape correctly cancels the deployment.

@bhsubra
Copy link
Contributor Author

bhsubra commented Oct 25, 2022

Please test that pressing escape correctly cancels the deployment.

Tested this. Thanks!

@bhsubra bhsubra force-pushed the dev/bhsubra/AddSupportToAcceptDeploymentName branch from 6cd354e to 3daa366 Compare October 26, 2022 05:34
@bhsubra bhsubra merged commit 16626f4 into main Oct 27, 2022
@bhsubra bhsubra deleted the dev/bhsubra/AddSupportToAcceptDeploymentName branch October 27, 2022 23:47
@bhsubra bhsubra linked an issue Oct 27, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bicep Deploy: Ability to name deployments
3 participants