Skip to content

Update prefetch to match cone patterns#70

Merged
wilbaker merged 2 commits intomicrosoft:masterfrom
wilbaker:prefetch_more_blobs
Aug 21, 2019
Merged

Update prefetch to match cone patterns#70
wilbaker merged 2 commits intomicrosoft:masterfrom
wilbaker:prefetch_more_blobs

Conversation

@wilbaker
Copy link
Member

@wilbaker wilbaker commented Aug 20, 2019

Resolves #62

Updated ShouldIncludeResult to return true for paths that match the included cones.

Previously only descendants of the specified folder(s) would be included. With these changes the immediate children of all levels of the specified folder are also included.

Example

Included folder: A\B\C

Old behavior

  • All descendants of A\B\C are included.

New behavior

  • All descendants of A\B\C are included.
  • All files in the root folder are included.
  • All immediate child files of A are included.
  • All immediate child files of A\B are included.

@wilbaker
Copy link
Member Author

@derrickstolee @jrbriggs FYI - I still need to manually test these changes (and see if there are some unit or functional tests that can be added).

@derrickstolee
Copy link
Contributor

@derrickstolee @jrbriggs FYI - I still need to manually test these changes (and see if there are some unit or functional tests that can be added).

You have some functional tests to update to the new behavior, and that should be enough at the functional level. Perhaps this is an area that could use unit tests? It is definitely an old area, so would be from before we were doing many unit tests.

Copy link
Contributor

@derrickstolee derrickstolee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started with just a nit, but then got a little deeper into perf stuff. I got a bit excited.

You also have functional tests to update and unit tests to write, but I appreciate your work here! This is super important to user productivity.

Copy link
Member

@jeschu1 jeschu1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questions on unit testing and comments.

@wilbaker
Copy link
Member Author

@jeschu1 @derrickstolee I've switched to a faster matching algorithm and updated the tests. The PR is ready for another look, thanks!

  - Switch to a better performing matching algorithm
  - Add unit tests
  - Update functional tests
@wilbaker wilbaker force-pushed the prefetch_more_blobs branch from dfe576a to 747afce Compare August 20, 2019 23:30
Copy link
Contributor

@derrickstolee derrickstolee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just gave this a quick test on my machine, and it works great! The functional test updates make sense, and the unit tests really show that this works as intended.

/// </summary>
public bool UpdatedWholeTree { get; internal set; } = false;

// public for unit tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious was InternalsVisibleToAttribute another option?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We haven't set up internals anywhere in our system of projects (yet). Maybe it's something to think about after @mjcheetham converts the projects to .net 3.0 projects?

Copy link
Member

@jeschu1 jeschu1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, exellent unit tests here for clarity!

@wilbaker wilbaker merged commit 36e85ec into microsoft:master Aug 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prefetch --stdin-folders-list doesn't match cone patterns

3 participants