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

Idea: Hurl for custom uploaders #94

Open
nikeee opened this issue Oct 10, 2021 · 4 comments
Open

Idea: Hurl for custom uploaders #94

nikeee opened this issue Oct 10, 2021 · 4 comments

Comments

@nikeee
Copy link
Owner

nikeee commented Oct 10, 2021

Custom uploader specs might not work for all scenarios.

Maybe we could leverage Hurl to define how to upload something. The path to the image as well as some metadata could be supplied to the script by injecting variables:
https://hurl.dev/docs/templates.html#injecting-variables

This would make it possible to model complex scenarios for APIs that require multiple HTTP requests to do stuff.

Error handling would be pain, I guess. Also, shipping Hurl with HS would be needed (or some heavy lifting like with FFmpeg, which is also error prone).

@nikeee
Copy link
Owner Author

nikeee commented Oct 10, 2021

Hurl files could be prepended with a YAML metadata block that basically resembles the current UploaderMeta.

@nikeee
Copy link
Owner Author

nikeee commented Oct 10, 2021

We'd have some trouble displaying a progress bar.

Also, Hurl is primarily focused on testing HTTP APIs. Maybe there is an alternative that can be used to achieve the same goal.

We should avoid forking Hurl, but without support for FFI, we're going to have a hard time.
If we fork it, we can also add support for progress bars by implementing a callback function that fills a buffer, so we can keep track of what has been sent. That would also avoid saving the image to disk.

@nikeee
Copy link
Owner Author

nikeee commented Oct 14, 2021

We could also evaluate how much work it would be to re-implement the important (for us) parts of Hurl. For example, we don't need assertions.

Would be nice to be a proper subset of Hurl, so people could test their stuff with it.

When usiung Hurl as a library, we'd need to do FFI (p/invokes) with that. We must evaluate how much overhead this comes with, when passing stuff around.

@nikeee
Copy link
Owner Author

nikeee commented Oct 17, 2021

We depend on Orange-OpenSource/hurl#284 and Orange-OpenSource/hurl#306 for this.

Maybe we could implement a small, compatible subset of hurl files for this. This would be a lot of work.

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

No branches or pull requests

1 participant