Repository navigation
Conversation
|
|
|
Welcome @lusoris! |
|
Hi @lusoris. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lusoris The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
LoadRootsWithConfig made a relative filesystem root absolute with filepath.Abs while it still ended in "...". On Windows, filepath.Abs resolves the path with GetFullPathNameW, which drops trailing dots, so `x\...` became `x`, the root was treated as a single directory and only the package in x was loaded. Set the "..." aside before making the directory absolute and join it back afterwards. The test stands in an Abs that drops the trailing element as Windows does, so the regression shows on every platform; the existing loader specs with filesystem roots ending in "..." now also pass on Windows. Signed-off-by: lusoris <lusoris@proton.me>
2c4d09b to
64ee60d
Compare
|
Hi @lusoris Thank you for looking on that. We do not really support Windows. I would be OK with the proposed change if we can ensure that ALL is properly tested to ensure that no regressions or breaking changes are faced for the supported ones Linux/Mac SOs, |
Move the cleaning and absolute-path step for a filesystem root into absRoot, and test it directly: - where filepath.Abs keeps a trailing "..." (Linux, macOS), absRoot returns what the loader computed before this change, for relative, absolute, nested and cfg.Dir-relative roots; - where filepath.Abs drops trailing dots (Windows), a root ending in "..." keeps its nested traversal, with and without cfg.Dir. Add loader specs for an absolute root ending in "..." and for cfg.Dir with "./...". Signed-off-by: lusoris <lusoris@proton.me>
…trailing-ellipsis
|
Thanks @camilamacedo86, that is a fair condition. I ran the whole test suite on Linux, macOS and Windows for this branch and for current Both runs use the same throwaway workflow on my fork (not part of this PR):
So no package that passes on The new tests in |
On Windows, a filesystem root ending in
...(paths=./x/...) loaded only the package in the root directory (#1484).LoadRootsWithConfigmade the root absolute withfilepath.Abswhile it still ended in.... On Windows,filepath.Absresolves the path withGetFullPathNameW, which drops trailing dots, sox\...becamex. The checkfilepath.Base(r) == "..."then failed, andgo/packageswas called with.\.instead of.\....This change sets the trailing
...aside before the directory is made absolute and joins it back afterwards withfilepath.Join, which only cleans the path lexically. Relative roots resolved againstcfg.Dirand absolute roots are unchanged.TestFilesystemRootKeepsTrailingEllipsisWhenAbsDropsTrailingDotsstands in anAbsthat drops the trailing element the way Windows does (through the unexportedabsPathvariable), so the regression shows on non-Windows CI.Before this change (Linux), the test fails:
After this change (Linux),
go test ./pkg/loader/passes, andgolangci-lint run ./pkg/loader/reports 0 issues.On Windows (the official Go 1.27.2
windows/amd64toolchain under Wine), the loader specs went from8 Passed | 3 Failedto11 Passed | 0 Failed; the three specs with filesystem roots ending in...failed before. A Windows-builtcontroller-gennow gives the samerole.yamlforpaths=./x/...as on Linux.Fixes #1484