Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.07k stars 1.19k forks source link

[eng] `rush reset-workspace` sounds innocent but is way too dangerous #15774

Closed witemple-msft closed 6 months ago

witemple-msft commented 3 years ago

This script sounds like it's just going to clean up some friendly state, but it actually blows everything in your working tree away without prompting to make sure that's what you want to do. I just ran this to try to fix a problem I was having with a build. I assumed it was a rush builtin and wouldn't do anything too destructive, but I discovered (unfortunately after running it), that we define it in command-line.json:

rush unlink && git clean -dfx && rush purge

git clean -dfx is one of the most aggressively destructive commands that can be run on a git tree and if we want to keep this command around, we should make it crystal clear that this is going to destroy everything that isn't checked in to git without asking you any further questions. In my experience, when something is this destructive, there are big warning lights, like a prompt that will keep it from going further:

$ rush reset-workspace
WARNING: This script will run `git clean -dfx` and delete all untracked files, including files ignored by git.
Are you sure you want to continue? [y/N]

Well, the problem I had is indeed fixed and my working tree is as fresh as the day I cloned it. Unfortunately my huge collection of .env files and my client certificate both sleep with the fishes.

ramya-rao-a commented 3 years ago

@praveenkuttappan From what you know about the rush commands and our customizations for them, can you share some pointers as to how we can add the prompt that Will is suggesting above?

github-actions[bot] commented 6 months ago

Hi @witemple-msft, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.