-
Notifications
You must be signed in to change notification settings - Fork 6
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
Bring Wendy upto date with the new Bob #16
Conversation
Add flatten to not loose nested maps
- Refers #15
This looks great, one observation: using |
Or just assume that the data comes from stdin and for a thing needing to do a POST. If stdin is empty simply fail. This should be simpler? The same way HTTPie assumes input is on stdin when doing a POST instead of |
That is what I investigated of course but then you would need to hack around with cli-matic. I did not come up with a beautiful solution that offers multiplatform support. The presets are here: https://github.com/l3nz/cli-matic#current-pre-sets So the way to go would be to go around cli-matic and just read from in when there is a body? I could try that 🤔 |
I thought about this some more. Httpie is not a perfect example for this because httpie doesn't tell you how to do a POST request. We on the other hand are guiding the user on how to do a pipeline-create command. That means there should be the help saying that the user needs to provide additional data as either That means the optimal solution from UX perspective would be to have It would be fine though to only use a pre-set |
Totally agree, for simplicty reasons and opting to use the OS features more than us writing some code and being a bit future proof, I am of the opinion that lets drop files all together and just use stdin. Of course, we need a proper help text and some examples to show how to pipe the contents on various platforms. My thought process is if we introduce files and its accompanying parsing logic, we are introducing another layer and not using the OS/UNIX native and simpler piping/composing infra. I would say lets not use the files at all and if at all the need comes we can think of it then. What say? |
I am also thinking in terms of wendy being in an automated env wherein having only files may be a complexity like downloading them, having a right path and/or permissions. simply using stdin address all of those and decomplects wendy from knowing how to read and its associated incedental complexity. |
Totally agree, as I said using only stdin is totally cool. But the question is how. We would need to investigate contributing to cli-matic here. |
That can be an option, for now can we manually check if the method is post and it needs a body, we fail internally, after cli-matic's parsing? Not all POSTs need a body like pipeline-start. We do need to write a helper fn that does this and if this is generic enough can be contributed upstream too? Lets not add the post body as a cli matic option for now and handle it internally when we are about to make the request. |
This is the stdin issue open for cli-matic l3nz/cli-matic#28 |
Yeah so lets not worry about cli-matic's magical handling of the cli for now. Here is what I think can be done:
Hows that for starters? |
I think this is good to merge for now. |
Does this work with clojure 1.10.1 on Graal? I think cli-matic needed the 1.10.2 versions with the spec fix? |
It worked when I tried it. Need to check my versions though. There was an error message I think, but it worked. |
Check if it says |
You can use the CLI so far. I did not yet work on the receiving of a tar file. And the api-spec request fails as well because of the header. You can read in data for a post request from file or via stdin on linux so far only.
Next Todos are:
--help