-
Notifications
You must be signed in to change notification settings - Fork 0
fix(go-runner): ensure excludes dont filter files #47
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
base: main
Are you sure you want to change the base?
fix(go-runner): ensure excludes dont filter files #47
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug where files containing excluded directory names (like target.go or node_modules.go) were incorrectly being filtered out during directory copying. The root cause was the dircpy library's use of .contains() for matching exclusion patterns, which led to false positives. The fix removes the hardcoded exclusion list, allowing all files to be copied correctly.
Key Changes:
- Removed hardcoded excludes
["node_modules", "target"]from thecopy_dir_recursivelyfunction - Added comprehensive test project
example-with-excluded-nameswith files namedtarget.goandnode_modules.goto validate the fix - Added integration and discovery test cases for the new test project
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
go-runner/src/utils.rs |
Removed the hardcoded exclusion patterns that were causing false positives |
go-runner/testdata/projects/example-with-excluded-names/main_test.go |
Added benchmark test that depends on code in files with problematic names |
go-runner/testdata/projects/example-with-excluded-names/main.go |
Added main source file that imports from internal tools package |
go-runner/testdata/projects/example-with-excluded-names/internal/tools/target_impl.go |
Implementation file containing functions used by target.go and node_modules.go |
go-runner/testdata/projects/example-with-excluded-names/internal/tools/target.go |
Test file with "target" in filename to validate it's no longer excluded |
go-runner/testdata/projects/example-with-excluded-names/internal/tools/node_modules.go |
Test file with "node_modules" in filename to validate it's no longer excluded |
go-runner/testdata/projects/example-with-excluded-names/internal/tools/instrumentation.go |
Integration point that uses functions from both target and node_modules files |
go-runner/testdata/projects/example-with-excluded-names/go.mod |
Go module definition for test project |
go-runner/src/snapshots/codspeed_go_runner__integration_tests__assert_results_snapshots@example-with-excluded-names.snap |
Expected benchmark results snapshot |
go-runner/src/integration_tests.rs |
Added test case for new example project |
go-runner/src/builder/snapshots/codspeed_go_runner__builder__discovery__tests__discover_benchmarks@example-with-excluded-names.snap |
Expected discovery results snapshot |
go-runner/src/builder/discovery.rs |
Added test case for benchmark discovery validation |
The changes are well-structured and provide comprehensive test coverage for the bug fix. No issues were identified during the review.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #47 will degrade performances by 22.65%Comparing Summary
Benchmarks breakdown
|
Unable to generate the performance reportThe benchmarks did not report any results. Please check the documentation to check your benchmarking setup. |
Turns out that the exclude filters are just checking with
.containswhich also deletes any file that includes the exclude (e.g.target.go): https://github.com/woelper/dircpy/blob/645889b819dc78deade6d7ef16aba0420b8e5d08/src/lib.rs#L216-L223Fixes #46
EDIT: There are more issues on the opentelemetry-go project, I'll fix them in this PR as well.