-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
chore: Basic UnixFS sanity checks #10701
Conversation
Signed-off-by: Abhinav Prakash <[email protected]>
https://docs.ipfs.tech/install/command-line/#system-requirements states 6 GiB, updating readme to match that
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.
triage note:
- thank you, this is useful, but needs regression test
- @PsychoPunkSage mind adding a test that confirms error occurs when someone tries to copy dag-cbor to MFS? (e.g. empty dag-cbor:
bafyreigbtj4x7ip5legnfznufuopl4sg4knzc2cof6duas4b3q2fy6swua
)
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.
See suggested changes and get CI passing first.
Signed-off-by: Abhinav Prakash <[email protected]>
Signed-off-by: Abhinav Prakash <[email protected]>
Signed-off-by: Abhinav Prakash <[email protected]>
Signed-off-by: Abhinav Prakash <[email protected]>
Signed-off-by: Abhinav Prakash <[email protected]>
Hi @lidel I wrote a test and it is failing ig... currently solving it... Can give some suggestions which might help me
@gammazero Made required changes.... |
Signed-off-by: Abhinav Prakash <[email protected]>
Signed-off-by: Abhinav Prakash <[email protected]>
Signed-off-by: Abhinav Prakash <[email protected]>
The test is failing because the type assertion for To test your code, the test needs to create something that is not a |
Signed-off-by: Abhinav Prakash <[email protected]>
Hi @gammazero The Test is
|
This is necessary because a "force" option is already used elsewhere, and its use in multiple places is causing CI to report the error: `Error: option name "force" used multiple times`
@PsychoPunkSage I made 3 additional minor changes. See my 3 commits above. |
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
Hi @gammazero |
hi @lidel I think is PR is ready to be merged. |
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, mostly ok, but needs end-to-end tests + small nits inline.
Co-authored-by: Marcin Rataj <[email protected]>
Co-authored-by: Marcin Rataj <[email protected]>
Co-authored-by: Marcin Rataj <[email protected]>
Signed-off-by: Abhinav Prakash <[email protected]>
test/cli/files_test.go
Outdated
assert.Contains(t, res.Stderr.String(), "source must be a UnixFS") | ||
}) | ||
|
||
t.Run("files cp with invalid DAG node succeeds with force", func(t *testing.T) { |
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.
Hi @lidel
I noticed an interesting behavior here...
This test reveals something important about your implementation - the --force flag
skips the initial validation, but there's still a later step (flushing) that can't handle non-UnixFS node types.
filesCpCmd
allows copying a non-UnixFS node
with --force, but MFS itself might not be able to properly handle or flush
that type of node, causing this error during the flush operation.
What should I do?? Maybe create another PR to handle the Flush thing....
Adding the Flush
here will make this PR quite big ig.
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.
Discussed this during triage today, and the consensus is to remove --force
flag.
We don't have time to go intoo rabbit hole of fleshing out specs for MFS that supports codecs other than UnixfS( dag-pb and raw).
We don't want this actually, because MFS data model is files and directories (which could be mounted over something like FUSE in the future).
This formally limits ipfs files
API to files and directories (unixfs).
If someone wants to mix UnixFS with other codecs (like dag-cbor) they can use lower level API at ipfs dag
.
@PsychoPunkSage so the ask is to remove --force
from this PR 🙏
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.
Disregard, I'm going to do it :)
Signed-off-by: Abhinav Prakash <[email protected]>
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, we will include this in Kubo 0.34.0-rc1
Raw data
anddag-pb
>no-validate
flag tocmd.options
Closes #10331