Skip to content

Conversation

@not-matthias
Copy link
Member

@not-matthias not-matthias commented Dec 17, 2025

Turns out that the exclude filters are just checking with .contains which also deletes any file that includes the exclude (e.g. target.go): https://github.com/woelper/dircpy/blob/645889b819dc78deade6d7ef16aba0420b8e5d08/src/lib.rs#L216-L223

Fixes #46


EDIT: There are more issues on the opentelemetry-go project, I'll fix them in this PR as well.

Copy link

Copilot AI left a 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 the copy_dir_recursively function
  • Added comprehensive test project example-with-excluded-names with files named target.go and node_modules.go to 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-hq
Copy link

codspeed-hq bot commented Dec 17, 2025

CodSpeed Performance Report

Merging #47 will degrade performances by 22.65%

Comparing cod-1829-cannot-compile-certain-internal-packages (4c768d5) with main (4df4d46)

Summary

⚡ 1 improvement
❌ 1 regression
✅ 47 untouched

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
bench_go_runner 37 s 47.9 s -22.65%
bench_collect_results[10000000, 25] 6.1 s 5.3 s +15.22%

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 17, 2025

Unable to generate the performance report

The benchmarks did not report any results. Please check the documentation to check your benchmarking setup.

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.

Cannot compile certain internal packages

2 participants