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

forward the remaining of the stdin args to the server #83

Merged
merged 4 commits into from
Mar 18, 2018

Conversation

Stebalien
Copy link
Member

No description provided.

@ghost ghost assigned Stebalien Mar 18, 2018
@ghost ghost added the status/in-progress In progress label Mar 18, 2018
@Stebalien
Copy link
Member Author

This should probably have some tests... any other feedback?

@codecov
Copy link

codecov bot commented Mar 18, 2018

Codecov Report

Merging #83 into master will increase coverage by 0.57%.
The diff coverage is 62.22%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #83      +/-   ##
=========================================
+ Coverage   43.02%   43.6%   +0.57%     
=========================================
  Files          23      24       +1     
  Lines        1922    1961      +39     
=========================================
+ Hits          827     855      +28     
- Misses        960     970      +10     
- Partials      135     136       +1
Impacted Files Coverage Δ
http/client.go 39.44% <0%> (-1.9%) ⬇️
request.go 39.78% <0%> (-0.88%) ⬇️
command.go 33.33% <0%> (ø) ⬆️
arguments.go 87.5% <87.5%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ed4174...9160bdc. Read the comment docs.

@@ -0,0 +1,66 @@
package cmds
Copy link
Member Author

Choose a reason for hiding this comment

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

Need to be able to continue treating the argument reader as an io.ReadCloser so we can't use bufio.Scanner.

} else if err != nil {
t.Fatal(err)
}
bodyArgs = append(bodyArgs, next)
Copy link
Member Author

Choose a reason for hiding this comment

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

This interface is a bit awkward but I'm not a fan of the scanner interface either.

// However, such is life.
fileReader = files.NewMultiFileReader(files.NewSliceFile("", "", []files.File{
files.NewReaderFile("stdin", "", bodyArgs, nil),
}), true)
Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah....

@Stebalien
Copy link
Member Author

(for the record, I hate this PR)

Copy link
Member

@whyrusleeping whyrusleeping left a comment

Choose a reason for hiding this comment

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

I personally prefer the scanner interface, but other than that, this LGTM.

@whyrusleeping
Copy link
Member

A couple tests would be nice just so we don't have to wait until it gets bubbled up into ipfs to see any regressions

Copy link
Member

@Kubuxu Kubuxu left a comment

Choose a reason for hiding this comment

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

SGWM, only thing I don't like (but it is old) is that we send body args with \n as separator.

@Stebalien
Copy link
Member Author

A couple tests would be nice just so we don't have to wait until it gets bubbled up into ipfs to see any regressions

Note: I've already bubbled it to test and it seems to be working (the one issue is a slight change in an error message).

@Stebalien
Copy link
Member Author

I personally prefer the scanner interface, but other than that, this LGTM.

I have little preference so I'll switch back to it.

Apparently, it's not thread-safe.
@Stebalien Stebalien merged commit b6ffc22 into master Mar 18, 2018
@ghost ghost removed the status/in-progress In progress label Mar 18, 2018
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.

3 participants