Skip to content

fix: normalize root to always include trailing slash before path replacement - #1381

Merged
mrexox merged 8 commits into
masterfrom
copilot/fix-issue-1380-validation
Apr 16, 2026
Merged

fix: normalize root to always include trailing slash before path replacement#1381
mrexox merged 8 commits into
masterfrom
copilot/fix-issue-1380-validation

Conversation

Copilot AI commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Closes #1380

Context

root: "client" and root: "client/" refer to the same directory but produced different results — the former yielded .//src/index.js because byRoot did a naive string replacement without ensuring the matcher ended with /.

Changes

  • filter.go — normalize matcher to always have a trailing / before the prefix check and replacement in byRoot
  • filter_test.go — fix test expectations that encoded the broken double-slash behavior; path: "folder" and path: "folder/" now both produce ./subfolder/0.rb
// before
strings.Replace("client/src/index.js", "client", "./", 1) // → ".//src/index.js"

// after (matcher normalized to "client/")
strings.Replace("client/src/index.js", "client/", "./", 1) // → "./src/index.js"

Comment thread internal/run/controller/filter/filter.go Outdated
@mrexox
mrexox marked this pull request as ready for review April 7, 2026 07:41
Copilot AI requested a review from mrexox April 7, 2026 07:42
Comment thread internal/run/controller/filter/filter.go Outdated
@mrexox
mrexox force-pushed the copilot/fix-issue-1380-validation branch from a7cb9f9 to c5a9511 Compare April 7, 2026 09:33
@mrexox
mrexox merged commit eb3e70d into master Apr 16, 2026
14 checks passed
@mrexox
mrexox deleted the copilot/fix-issue-1380-validation branch May 24, 2026 14:39
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.

root: without trailing slash causes double slashes in resolved file paths

2 participants