-
Notifications
You must be signed in to change notification settings - Fork 110
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
fix: filesystemStore fails to prepend target file hashes on Windows #274
fix: filesystemStore fails to prepend target file hashes on Windows #274
Conversation
This looks great, thanks! 2 things:
|
@torin-carey - It's important to have consistent support for Windows too, so thank you for helping with that! 💯 Perhaps it needs a bit more polishing though, because CI failed not only for 1.17, but for the whole set of test cases (it cancels the rest when one fails). You can try debugging these issues by running the test suite locally via Also, as @znewman01 suggested, adding the Windows environment to the CI config would be useful to make sure we support it continuously 👍 |
902de0f
to
afe41f8
Compare
I've sorted the failing tests (bug in original commit causing files to not be deleted after removing target) and all of the go tests are passing on Linux and Windows. I've also replaced the use of I've also added |
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.
Thank you very much! This looks fine to me barring the test failures (which might just be lint related?)
Looking at the last test failures: I see Line 47 in ad96eca
It looks like one of those is reading |
Thanks for reviewing!
Thanks for finding this, the line endings do seem to be the only issue affecting the windows tests. I don't think it would suffice to just change the reader, since the mangling of the metadata files by git really does infringe on their integrity and I don't think we should try and accommodate that. Adding The linter errors also seem to be about line endings, since Another problem I've noticed running git on windows locally is that git for windows by default does not create symlinks, causing some of the test cases to fail where test case metadata files are de-duplicated through links. Github workflows seems to enable |
You've convinced me, I think that's correct.
SGTM
Good find. I think we can address this later; I'll file an issue. The symlinks are all consistent snapshot-related so I think they're somewhat deliberate. TBH I'd prefer to keep the symlinks and fix this with documentation. If we must remove them, we'd need some automation around making sure the files stay in sync. |
💯 this is what we did for python-tuf: theupdateframework/python-tuf@69cc684 |
1 more annoying thing, sorry: #319 (You'll need to rebase and do something like: https://github.com/src-d/guide/blob/master/developer-community/fix-DCO.md before you push again) |
@torin-carey anything the maintainers can do on our end to help out with this? (No urgency, just want to make sure you're not blocked) |
The filesystemStore LocalStore implementation conflates paths and filepaths, which cause issues on systems where they take different formats (Windows). Signed-off-by: Torin Carey <[email protected]>
Signed-off-by: Torin Carey <[email protected]>
Signed-off-by: Torin Carey <[email protected]>
Signed-off-by: Torin Carey <[email protected]>
For the satisfaction of golangci-lint, go files should have LF line endings. Since the integrity of the test data is important, the metadata files should be marked as binary to prevent git from mangling them. Signed-off-by: Torin Carey <[email protected]>
0a5be89
to
4dd57eb
Compare
Hi @znewman01, I apologise for the delayed response. The current state of the PR works for me with both |
No need to apologize; we appreciate the contribution! I'm OOO this week so I'll take a look next week; if you'd prefer a quicker review, CC in a few of the other maintainers. |
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.
Thank you so much for your work on this! I'm looking forward to having Windows working and tested :-)
The PR looks great. I just have one small question about the gitattributes file.
Oh, I'm taking @rdimitrov off as reviewer because he's currently on leave. @joshuagl can you review for approval? |
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.
LGTM, thanks so much @torin-carey !
Thanks for reviewing and approving! |
Fixes #273
Release Notes: Fix commit for Windows when using filesystemStore.
Types of changes:
Description of the changes being introduced by the pull request:
The
filesystemStore
LocalStore
implementation conflates paths and filepaths,which cause issues on systems where they take different formats (Windows).
This is most noticeable when running a repository with consistent snapshots, where committed targets will not have a prepended file hash, since the
filesystemStore
implementation mistakes them for metadata files, rather than targets:Because of this, clients will fail to find the target file from the repository.
Please verify and check that the pull request fulfills the following requirements: