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

feat: Prompt user for confirmation to remove resource group #383

Merged
merged 2 commits into from
Oct 31, 2019

Conversation

tbarlow12
Copy link
Collaborator

What did you implement:

Requires user to enter resource group name as confirmation for group removal

Closes #380

How did you implement it:

  • Added utility function to wait for user input
  • Check user input against configured resource group name
  • Delete if results match

How can we verify it:

  • Try to remove a non-deployed project
  • Run sls remove and then just type Enter (empty string shouldn't match), removal won't happen
  • Run sls remove and then type exact resource group name and removal will happen

Todos:

Note: Run npm run test:ci to run all validation checks on proposed changes

  • Ensure there are no lint errors.
    Validate via npm run lint
    Note: Some reported issues can be automatically fixed by running npm run lint:fix
  • Write tests and confirm existing functionality is not broken.
    Validate via npm test
  • Write documentation
  • Provide verification config / commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

Copy link
Collaborator

@PIC123 PIC123 left a comment

Choose a reason for hiding this comment

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

Looks good! Definitely a nice feature to have

this.log(`Resource group "${rgName}" does not exist in your Azure subscription`)
return;
}
this.log(`This command will delete your entire resource group (${resourceService.getResourceGroupName()}). ` +
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: can we update the message to indicate something like: "This command will delete your ENTIRE resource group and ALL the Azure resources that it contains."

Just to explicitly call out that all resources will get nuked, not just things created by the sls framework.

@pjlittle
Copy link
Collaborator

Minor comment, otherwise looks great. Thx for adding this!

@tbarlow12 tbarlow12 closed this Oct 30, 2019
@tbarlow12 tbarlow12 reopened this Oct 30, 2019
@tbarlow12 tbarlow12 merged commit f2e96a1 into dev Oct 31, 2019
@tbarlow12 tbarlow12 deleted the tabarlow/confirm-remove branch October 31, 2019 20:55
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.

None yet

4 participants