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

Aruba deleted my entire repository #713

Open
nex3 opened this issue Jun 4, 2020 · 1 comment
Open

Aruba deleted my entire repository #713

nex3 opened this issue Jun 4, 2020 · 1 comment
Assignees
Milestone

Comments

@nex3
Copy link

nex3 commented Jun 4, 2020

Summary

I configured Aruba in an incorrect-but-reasonable way and it deleted my entire repository.

Current Behavior

I was trying to get Aruba to run processes in the same working directory as the test runner, so I set:

Aruba.configure do |config|
  config.working_directory = '.'
end

It was not at all obvious to me that this would treat the current working directory as a temp directory and so completely delete it once testing was finished. The term "working directory" is not generally associated with temporary directories, so it seems extremely dangerous to delete it prompting.

I was lucky not to lose too much work to this, but this seems like an extremely dangerous footgun in general.

Possible Solution

I could see a couple mitigations:

  • Warn users wherever possible in the documentation that any directory passed to this option will be deleted.

  • Rename the configuration variable to something clearer, like temp_directory.

  • Before deleting everything, check to make sure if it looks like it shouldn't be deleted (e.g. contains a .git/.hg directory, is the same as the test process's CWD, etc) and prompt or refuse to delete.

  • Provide a more obvious way of configuring the behavior I was trying to set, that is, the working directory in which the process runs.

@mvz
Copy link
Contributor

mvz commented Jun 4, 2020

Whoa, that's bad.

@mvz mvz self-assigned this Jun 4, 2020
@mvz mvz added this to the 1.1.0 milestone Aug 22, 2020
@mvz mvz modified the milestones: 1.1.0, 2.0.0 Jun 20, 2021
@mvz mvz modified the milestones: 2.0.0, 2.1.0 Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants