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

FSEventsWatcher: Don't track files #1415

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

FSEventsWatcher: Don't track files #1415

wants to merge 4 commits into from

Conversation

robhogan
Copy link
Contributor

@robhogan robhogan commented Dec 21, 2024

Summary:
When using Sapling in an OSS checkout, Flow does not ignore files under `.hg`, leading to false errors especially in Saplings `origbackups`, which may contain old versions of files out of context.

Changelog: Internal

Test Plan:
## Before
```
yarn flow ls | grep '\.hg'
/Users/robhogan/workspace/metro-sl/.hg/runlog/41hxy19HHF6cGBn491508.json
/Users/robhogan/workspace/metro-sl/.hg/runlog/37Z4u1Env4S8RkEa44097.json
<...>
/Users/robhogan/workspace/metro-sl/.hg/origbackups/packages/metro-file-map/src/watchers/common.js
/Users/robhogan/workspace/metro-sl/.hg/origbackups/packages/metro-file-map/src/watchers/FSEventsWatcher.js
```

```
yarn flow ls | wc -l
   25908
```

## After
```
yarn flow ls | grep '\.hg'
<empty response>
```

```
yarn flow ls | wc -l
   25861
```

Reviewers:

Subscribers:

Tasks:

Tags:
Summary:
Ensure `'add'` and `'change'` events fired by watcher backends always have associated `metadata` (and that `'delete'` events never do), by typing change event payloads as objects with the `event: 'change' | 'add' | 'delete'` as a discriminator.

(This is in preparation for refactoring out the distinction between `'change'` and `'add'` from backends, which means they don't need to track files and can do much less IO)

Changelog: Internal

Differential Revision: D67287046
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants