Conversation
Add GetFilteredFilesSingleWalk, which traverses the directory tree once instead of twice (GetAllFiles + GetFilteredFiles) and prunes wholly- excluded directories such as node_modules and .git rather than globbing every file beneath them — where almost all the time on real projects was spent. A directory is pruned only when a rule excludes the directory itself (node_modules, /node_modules/, **/dist), never when a rule excludes only its contents (src/*, obj/**) or when the directory contains its own ignore file, since those may be re-included by a ! negation. Per-file emission still uses the full rule set, so output is identical to the original pipeline. Includes equivalence, negation-edge-case, and pruning tests plus a benchmark against the old pipeline.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
3 tasks
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is in relation to this ticket. My testing shows that the changes here reduce bundle creation time from between %50 to %90. Feel free to take whatever you want from this PR and remix it with whatever design might suite engineering better.
Add GetFilteredFilesSingleWalk, which traverses the directory tree once instead of twice (GetAllFiles + GetFilteredFiles) and prunes wholly- excluded directories such as node_modules and .git rather than globbing every file beneath them — where almost all the time on real projects was spent.
A directory is pruned only when a rule excludes the directory itself (node_modules, /node_modules/, /dist), never when a rule excludes only its contents (src/*, obj/) or when the directory contains its own ignore file, since those may be re-included by a ! negation. Per-file emission still uses the full rule set, so output is identical to the original pipeline.
Includes equivalence, negation-edge-case, and pruning tests plus a benchmark against the old pipeline.
Description
Provide description of this PR and changes.
Checklist
make test)make generate)make lint)go get github.com/snyk/go-application-framework@YOUR_LATEST_GAF_COMMITin thecliv2directory.go.modto point to your local GAF code.go mod tidyin thecliv2directory.go.modandgo.sumchanges.