Closed Bug 1911968 Opened 2 months ago Closed 2 months ago

Running `./mach puppeteer-test` deletes the entire source repository

Categories

(Remote Protocol :: Agent, defect, P2)

defect

Tracking

(firefox131 fixed)

RESOLVED FIXED
131 Branch
Tracking Status
firefox131 --- fixed

People

(Reporter: mossop, Assigned: jdescottes)

References

Details

(Keywords: dataloss, Whiteboard: [webdriver:m12][webdriver:external])

Attachments

(1 obsolete file)

I just ran ./mach puppeteer-test to attempt to reproduce a test failure I was backed out for. It sat there for quite a while with no output running ../../tools/clean.mjs. Eventually I gave up and killed the process and then tried running ./mach help puppeteer-test at which point I discovered the mach file no longer existed. In fact almost my entire source repository, including the .hg directory had been deleted.

I'm not entirely sure how many days of work I've lost here. But a mach command shouldn't be wiping large amounts of data like this without some kind of confirmation step.

Looks like what is happening is the clean command is running git clean. I have a git repository above my source repository, it holds a bunch of scripts and my build configurations. So this command deleted everything not checking into or ignored by that repository. Which was more than just my source repository.

Attachment #9418296 - Attachment is obsolete: true

I was under the impression that we had the full git repo vendored, but it's not the case. So of course here git clean will run on whatever git repo happens to be in scope. Still odd that this didn't cause issues earlier?

Ouch, this is not good.

I've filed https://github.com/puppeteer/puppeteer/issues/12917 to make the Puppeteer team aware of this bug. We should also do something on our side to avoid the issue e.g. maybe we don't need to run clean at all, or maybe we can patch in a list of paths that actually need to be deleted.

(In reply to Julian Descottes [:jdescottes] from comment #3)

I was under the impression that we had the full git repo vendored, but it's not the case. So of course here git clean will run on whatever git repo happens to be in scope. Still odd that this didn't cause issues earlier?

After switching to git for my mozilla-central clone there is no longer an issue. I'm guessing the number of people that use a mercurial clone of mozilla inside a git repository is fairly small, perhaps even only me, and even I'm not now.

I think the question is why it hasn't affected people who are using git. by deleting things in the m-c .gitignore files. Most of those are .pyc and similar, which might go unnoticed, but it might include mozconfig files which people likely would notice going missing.

mossop: which git version are you running? Puppeteer have landed a patch to make this safer, but it should already have been running git clean only in the puppeteer directory (but maybe the command syntax changed in recent versions or something)

Flags: needinfo?(dtownsend)

(In reply to James Graham [:jgraham] from comment #7)

mossop: which git version are you running? Puppeteer have landed a patch to make this safer, but it should already have been running git clean only in the puppeteer directory (but maybe the command syntax changed in recent versions or something)

v2.45.2 from homebrew.

Flags: needinfo?(dtownsend)

The fix will be in Puppeteer v23.1.0 and it will be vendored in via bug 1912239.

Severity: -- → S3
Component: CDP → Agent
Priority: -- → P2

Fixed with the landing of bug 1912239.

Assignee: nobody → jdescottes
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Whiteboard: [webdriver:m12][webdriver:external]
Target Milestone: --- → 131 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: