Skip to content
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

Support slashes in file sync glob patterns on windows #1280

Merged
merged 2 commits into from
Nov 16, 2018

Conversation

priyawadhwa
Copy link
Contributor

@priyawadhwa priyawadhwa commented Nov 15, 2018

#1266 failed on appveyor because the new library couldn't process windows paths.

filepath.Match also doesn't handle paths for windows itself, so I applied filepath.FromSlash() to each pattern before matching.

@codecov-io
Copy link

codecov-io commented Nov 15, 2018

Codecov Report

Merging #1280 into master will decrease coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1280      +/-   ##
==========================================
- Coverage    44.3%   44.24%   -0.06%     
==========================================
  Files         104      104              
  Lines        4623     4629       +6     
==========================================
  Hits         2048     2048              
- Misses       2366     2372       +6     
  Partials      209      209
Impacted Files Coverage Δ
pkg/skaffold/sync/sync.go 90.9% <100%> (ø) ⬆️
cmd/skaffold/app/cmd/init.go 15.42% <0%> (-0.48%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 412ec74...b0a8843. Read the comment docs.

Copy link
Contributor

@nkubala nkubala left a comment

Choose a reason for hiding this comment

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

thanks for the test. did you find an issue in Go for filepath.Match not working on windows? maybe you should file one :)

Copy link
Contributor

@balopat balopat left a comment

Choose a reason for hiding this comment

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

Actually this became a legit PR as it failed without the FromSlashes: https://ci.appveyor.com/project/r2d4/skaffold/builds/20334943
Please rename it to "support slashes in sync glob patterns on windows" + the little nits and we're good to go! Thank you!

@@ -210,6 +210,32 @@ func TestNewSyncItem(t *testing.T) {
},
},
},
{
description: "test filepaths",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description: "test filepaths",
description: "slashes in glob pattern",

},
},
evt: watch.Events{
Added: []string{filepath.Join("node", "node/node.js")},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Added: []string{filepath.Join("node", "node/node.js")},
Added: []string{filepath.Join("folder1", "folder2/node.js")},

just to make it a bit more understandable. too many nodes :)

@balopat balopat changed the title Check if filepath.Match for sync works on windows paths Ssupport slashes in file sync glob patterns on windows Nov 16, 2018
@balopat balopat changed the title Ssupport slashes in file sync glob patterns on windows Support slashes in file sync glob patterns on windows Nov 16, 2018
@balopat balopat merged commit 7ca9f94 into GoogleContainerTools:master Nov 16, 2018
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.

4 participants