chore: Basic UnixFS sanity checks#10701
chore: Basic UnixFS sanity checks#10701lidel merged 25 commits intoipfs:masterfrom PsychoPunkSage:issue-10331
Conversation
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
https://docs.ipfs.tech/install/command-line/#system-requirements states 6 GiB, updating readme to match that
There was a problem hiding this comment.
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)
gammazero
left a comment
There was a problem hiding this comment.
See suggested changes and get CI passing first.
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
|
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 <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
|
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 <abhinav.prakash319@gmail.com>
|
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. |
|
Hi @gammazero |
|
hi @lidel I think is PR is ready to be merged. |
lidel
left a comment
There was a problem hiding this comment.
Thank you, mostly ok, but needs end-to-end tests + small nits inline.
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
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.
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.
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 🙏
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
lidel
left a comment
There was a problem hiding this comment.
Thank you, we will include this in Kubo 0.34.0-rc1
Raw dataanddag-pb>no-validateflag tocmd.optionsCloses #10331