Skip to content
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

Move parts of ipfs add into core/coreunix #1778

Merged
merged 1 commit into from
Nov 2, 2015

Conversation

rht
Copy link
Contributor

@rht rht commented Oct 3, 2015

No description provided.

@jbenet jbenet added the status/in-progress In progress label Oct 3, 2015
@rht rht force-pushed the 0.4.0/cleanup/add branch from 8f0d420 to 4588243 Compare October 3, 2015 07:08
@rht
Copy link
Contributor Author

rht commented Oct 3, 2015

href: #1136

@rht
Copy link
Contributor Author

rht commented Oct 3, 2015

Since the pin callback has been removed, the current AddFile doesn't do pinning yet.
This doesn't affect ipfs add since it does explicit PinRoot() afterward.

One approach is to define AddFileMaybePin.

@whyrusleeping
Copy link
Member

This looks pretty good to me. My only concern is making sure that things that are commands lib specific stay in the commands lib, for example the Object struct and the progress reader stuff feels a bit out of place outside of the commands lib.

@rht
Copy link
Contributor Author

rht commented Oct 4, 2015

In the beginning I'd have opted the progress reader to be in commands lib, but the reader has to wrap the file before the params.Add in L286.

One option is to add generic callback func option.
Similarly for outputDagnode (the reason why the Object struct is pulled into coreunix in the first place), if this is to be turned into a callback func.

@rht
Copy link
Contributor Author

rht commented Oct 4, 2015

In this case, progressReader can be kept out of coreunix if an interface ProgressReaderFile is defined in commands/file.

@@ -27,14 +162,13 @@ func Add(n *core.IpfsNode, r io.Reader) (string, error) {

// TODO more attractive function signature importer.BuildDagFromReader
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this todo get removed now?

@whyrusleeping
Copy link
Member

In this case, progressReader can be kept out of coreunix if an interface ProgressReaderFile is defined in commands/file.

Hrm... youre right. that seems a bit more complicated.. in that case its probably fine to leave things where they are now.

@rht rht force-pushed the 0.4.0/cleanup/add branch from 4588243 to 832c8f1 Compare October 11, 2015 01:25
@rht
Copy link
Contributor Author

rht commented Oct 11, 2015

@whyrusleeping fixed. Also progressReader depends on AddedObject for the output object so if it is moved to commands/files, then it needs to import coreunix and use coreunix.AddedObject. Messier.

@whyrusleeping
Copy link
Member

yeah... i'm all for being less messy.

@jbenet
Copy link
Member

jbenet commented Oct 11, 2015

Assign to me when i should CR -> merge

@rht
Copy link
Contributor Author

rht commented Oct 11, 2015

@jbenet the PR works. It needs CR for the design aspect.

@rht rht mentioned this pull request Oct 15, 2015
5 tasks
@jbenet
Copy link
Member

jbenet commented Oct 19, 2015

sorry for the delay will try to get to this this week, else early next.

@whyrusleeping whyrusleeping added RFCR and removed status/in-progress In progress labels Oct 20, 2015
trickle: trickle,
wrap: wrap,
}
fileAdder := coreunix.NewAdder(req.Context(), n, outChan)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the Adder work just fine without specifying all the below parameters? (i.e. does it have sane defaults?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it does

@rht rht force-pushed the 0.4.0/cleanup/add branch from 832c8f1 to f28f3ad Compare October 25, 2015 00:37

Verified

This commit was signed with the committer’s verified signature.
4yman-0 4yman
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
@rht rht force-pushed the 0.4.0/cleanup/add branch from f28f3ad to 7b6d8a1 Compare October 25, 2015 00:42
@jbenet
Copy link
Member

jbenet commented Oct 27, 2015

this roughly LGTM. thoughts @whyrusleeping ?

@whyrusleeping
Copy link
Member

Yeah, i think this looks good.

@jbenet
Copy link
Member

jbenet commented Nov 2, 2015

ok. rerunning tests as they failed.

jbenet added a commit that referenced this pull request Nov 2, 2015
Move parts of `ipfs add` into core/coreunix
@jbenet jbenet merged commit fd153f2 into ipfs:dev0.4.0 Nov 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants