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

Allow converting singleton file tree to directory trees #8387

Merged
merged 2 commits into from Feb 5, 2019

Conversation

wolfs
Copy link
Member

@wolfs wolfs commented Jan 31, 2019

No description provided.

@wolfs wolfs added this to the 5.3 RC1 milestone Jan 31, 2019
@wolfs wolfs self-assigned this Jan 31, 2019
@wolfs wolfs requested a review from lptr February 1, 2019 07:23
@wolfs
Copy link
Member Author

wolfs commented Feb 1, 2019

Fixes #8394.

Copy link
Member

@lptr lptr left a comment

Choose a reason for hiding this comment

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

I think this looks good as a fix for the particular problem. What I don't see is how we could prove there are no other holes like this. Can we do something to that end?

A bit of simplification among FileTree implementations (similar maybe to what @adammurdoch did in #8403) could be nice, too.

@@ -45,4 +50,31 @@ class DefaultSingletonFileTreeTest extends Specification {
}
0 * visitor._
}

def "can be converted to a directory tree"() {
Copy link
Member

Choose a reason for hiding this comment

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

Should we mention the @Issue that triggered this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Added.

@@ -45,4 +50,31 @@ class DefaultSingletonFileTreeTest extends Specification {
}
0 * visitor._
}

def "can be converted to a directory tree"() {
File f = temporaryFolder.file('test-file')
Copy link
Member

Choose a reason for hiding this comment

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

Nit: let's not use single-letter variable names.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed.

@wolfs
Copy link
Member Author

wolfs commented Feb 4, 2019

@lptr I added an extra test for the remaining method on FileTree. I think everything else is now covered.

We may add a separate test which would take a file tree and then exercises all methods. Then we would create a subclass for every file tree implementation to test it.

I opened https://github.com/gradle/build-cache/issues/1476 for consolidating the file tree implementations.

@lptr
Copy link
Member

lptr commented Feb 5, 2019

LGTM. Let's consolidate the creation of FileTrees as part of that other story, and add unified coverage for every implementation that way.

@wolfs wolfs merged commit 5bb7145 into master Feb 5, 2019
@wolfs wolfs deleted the wolfs/incremental-build/singleton-file-tree branch February 5, 2019 08:27
@wolfs wolfs modified the milestones: 5.3 RC1, 5.2.1 Feb 6, 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.

None yet

2 participants