-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
handle sym links in when calculating repo size #4305
Conversation
repo/fsrepo: follow symbolic links when calculating RepoSize Now if the IPFS path is a symbolic it will be followed before calculating the repo size. License: MIT Signed-off-by: John Reed <john@re2d.xyz>
Fixes #4056 |
I'm confused by the GitCop failures since the commit already has the license and signed-off-by trailers. |
@leerspace sometimes it gets upset because it doesnt perfectly match its regex. If you have the right content, then just ignore it. |
If it isn't too much to ask for, a sharness test for it would be great. |
I started working on the sharness test, but now I'm trying to figure out why every time I run edit: this might be getting outside the scope of this PR a bit, but based on the output of With leveldb/flatfs, it creates a new datastore/*.ldb file and updates a datastore/*.log file. I'm not sure if this is desired behavior (I'm guessing not), but either way I'll have to think of a good way to write the tests when the output of |
@leerspace this is the behaviour of those DBs, every time they are opened they create new logfile and if there are X of them (or other condition) they compact. I would suggest adding few hundreds of KiB to ipfs in sharness and checking if size is larger than X. |
Also according to |
@leerspace starting from a fresh repo (as in a test) should yield the same size every run (we have tests that test this). I would just pick a number, run the test, see what it actually was in the test failure output and then adjust the value in your test assertion. |
Though I definitely agree that running |
gofmt fixes to fsrepo.go The sharness test checks that IPFS_PATHS that are symbolically linked to another directory are returning an appropriate size License: MIT Signed-off-by: John Reed <john@re2d.xyz>
I just committed the gofmt fix and a sharness test for this. |
@leerspace looks like you might not have set the executable bit on that test file. the test runners arent very happy trying to run it |
setting the executable bit on sharness test License: MIT Signed-off-by: John Reed <john@re2d.xyz>
@whyrusleeping sorry about that. I think it should be fixed now. I did this on Windows, but fortunately there's a way to set this on Windows. |
repo/fsrepo: follow symbolic links when calculating RepoSize
Now if the IPFS path is a symbolic it will be followed before
calculating the repo size.
License: MIT
Signed-off-by: John Reed john@re2d.xyz