Skip to content

Commit

Permalink
Added root inclusion/exclusion params to changesSinceV2
Browse files Browse the repository at this point in the history
Summary:
# Context

We are introducing EdenFS notifications to support scalable and ergonomic file system notifications for EdenFS mounts.

# This Diff

* Added optional includeVCSRoots flag to ChangesSinceV2Params
* Added optional includedRoots list to ChangesSinceV2Params
* Added optional excludedRoots list to ChangesSinceV2Params
* Changed VCSDirectories config to be a vector to make it ordered
* Added new buildIncludedAndExcludedRoots to construct the included and excluded roots - including VCS roorts
* Updated isPathIncluded to use new included and excluded roots

# Next Steps

* Add suffix (extension) filters - inclusion and exclusion.
* Investigate best performance data structures for modeling inclusion and exclusion path filters (Watchman uses a radix tree search).
* Change the journal walking code to scan for position then walk forwards - current implemantion walks backward.
* .t tests, Python integration tests, C++ unit tests

# Discussion Points

None

Reviewed By: MichaelCuevas

Differential Revision: D66685181

fbshipit-source-id: ba412e3009e66e88a8c7b117549226f4cb81d427
  • Loading branch information
jdelliot authored and facebook-github-bot committed Dec 3, 2024
1 parent 8923797 commit 562b62e
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions eden/fs/service/eden.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -1908,11 +1908,11 @@ union ChangeNotification {
* Return value of the changesSinceV2 API
*
* toPosition - a new journal poistion that indicates the next change
* that will occur in the future. Should be used in the next call to
* changesSinceV2 go get the next list of changes.
* that will occur in the future. Should be used in the next call to
* changesSinceV2 go get the next list of changes.
*
* changes - a list of all change notifications that have ocurred in
* within the given mount point since the provided journal position.
* within the given mount point since the provided journal position.
*/
struct ChangesSinceV2Result {
1: JournalPosition toPosition;
Expand All @@ -1925,14 +1925,29 @@ struct ChangesSinceV2Result {
* mountPoint - the EdenFS checkout to request changes about.
*
* fromPosition - the journal position used as the starting point to
* request changes since. Typically, fromPosition is the set to the
* toPostiion value returned in ChangesSinceV2Result. However, for
* the initial invocation of changesSinceV2, the caller can obtain
* the current journal position by calling getCurrentJournalPosition.
* request changes since. Typically, fromPosition is the set to the
* toPostiion value returned in ChangesSinceV2Result. However, for
* the initial invocation of changesSinceV2, the caller can obtain
* the current journal position by calling getCurrentJournalPosition.
*
* includeVCSRoots - optional flag indicating the VCS roots should be included
* in the returned results. By default, VCS roots will be excluded from
* results.
*
* includedRoots - optional list of roots to include in results. If not
* provided or an empty list, all roots will be included in results.
* Applied before roots are excluded - see excludedRoots.
*
* excludedRoots - optional ist of roots to exclude from results. If not
* provided or an empty list, no roots will be excluded from results.
* Applied after roots are included - see includedRoots.
*/
struct ChangesSinceV2Params {
1: PathString mountPoint;
2: JournalPosition fromPosition;
3: optional bool includeVCSRoots;
4: optional list<PathString> includedRoots;
5: optional list<PathString> excludedRoots;
}

service EdenService extends fb303_core.BaseService {
Expand Down

0 comments on commit 562b62e

Please sign in to comment.