Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Finder] Exclude relative to content root if prefixed / #54754

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

Open
wants to merge 6 commits into
base: 7.4
Choose a base branch
from

Conversation

phil-davis
Copy link
Contributor

@phil-davis phil-davis commented Apr 27, 2024

Q A
Branch? 7.2
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #28158 #47431
License MIT

I had some test enhancements ready to be used against code for this. So this PR to the 7.2 branch has:

  • add multi-level unit test items for Finder tests - that commit adds a top/foo/file.tmp multi-level directory tree to the set of directories and files used by the Finder unit tests. That demonstrates the current behaviour, so we can ensure that the new feature does not introduce regressions. These tests pass with the existing 7.1 branch code.
  • add more comments about Finder exclude, to say that starting the excluded string with / will then only exclude that folder name at the root (top) level of the tree.
  • add test for root-level finder exclude, showing the expected behavior of the new feature
  • fix(Finder): ExcludeDirectoryFilterIterator relative to "root" if / - cherry-pick of the code provided in PR [Finder] Exclude relative to content root if prefixed / #54752

@phil-davis phil-davis marked this pull request as ready for review April 27, 2024 16:43
@carsonbot carsonbot added this to the 7.1 milestone Apr 27, 2024
@symfony symfony deleted a comment from carsonbot Apr 27, 2024
]), $finder->in(self::$tmpDir)->getIterator());
}

public function testExcludeTopLevelOnly()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the new test case. The top-level foo has been excluded, but top/foo and top/foo/file.tmp are still included, which is what we want the new feature to do.

@phil-davis

This comment was marked as resolved.

@phil-davis

This comment was marked as resolved.

@phil-davis

This comment was marked as resolved.

@phil-davis

This comment was marked as resolved.

@joshtrichards
Copy link

Thanks for digging into the tests! I'll try to take a closer look at your PR in the week ahead.

@xabbuh xabbuh modified the milestones: 7.1, 7.2 May 15, 2024
@phil-davis phil-davis force-pushed the issue-28158 branch 2 times, most recently from f144128 to 5349a03 Compare August 9, 2024 15:23
@phil-davis

This comment was marked as resolved.

@phil-davis
Copy link
Contributor Author

I have got this up-to-date with 7.2 branch, and cherry-picked all the code that I can see from #54752

CI passes.

This is an example of the code plus tests that would work with 7.2

@fabpot fabpot removed this from the 7.2 milestone Nov 20, 2024
@fabpot fabpot added this to the 7.3 milestone Nov 20, 2024
@fabpot fabpot modified the milestones: 7.3, 7.4 May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

There is no way to exclude path only from root directory
5 participants