-
Notifications
You must be signed in to change notification settings - Fork 211
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
make the HTTP Manager configurable #2027
Conversation
52e72e0
to
25db7df
Compare
I don't want to DOS the CI, is there an easy way to mirror a CI run locally (with cabal and without nix (man I should finally set up nix...))? |
2303d75
to
3733f7f
Compare
@amesgen: The most accurate way is using Nix: $ nix build --file ./release.nix … but the closest thing using plain Cabal is: $ cabal configure -f-use-http-client-tls
$ cabal test |
767d701
to
7e62a36
Compare
dhall-nixpkgs and dhall-try(?) seem to be missing from the root cabal.project. Should I add them in this PR or is this out of scope? |
7e62a36
to
cb53de9
Compare
@amesgen: Feel free to add them! 🙂 |
5a9e64e
to
872a28d
Compare
Rebased on master. I removed dhall-try form |
@amesgen: Instead of parametrizing each API function on a new |
If we did this, one could choose between these options:
Right now, 1. and 3. are already possible. In my original comment, I mentioned (first bullet point) that it is probably rare that 2. is actually useful (how often does one need HTTP imports, but not HTTPS imports?). The second and third bullet point are only possible with changed type signatures, and they are much more useful: |
@amesgen: If the goal is to depend on |
That would have the disadvantage that possible future Also, a configurable I understand that these type signature changes are not ideal. If you feel that the added flexibility of this PR is not worth the cost, I can create a new one with your suggestion to create a flag to switch between |
@amesgen: How about preserving the original type signatures for the default functions, but add variations on them that accept a |
Good idea, what suffix should we use? |
@amesgen: |
I reverted the changes to all subprojects except As a result, the diff is way smaller. It might be a good idea to add a test that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I'm just waiting on CI
@amesgen: Thank you for doing this! 🙂 |
Closes #2022.
This description is partly outdated (see discussion below).
A LOT of functions now take
IO Dhall.Import.Manager
, whereManager = ()
on GHCJS or ifwith-http
is disabled. TheManager
is configurable viaEvaluateSettings
, and defaults to the previous default (default TLSManager
from http-client-tls with 30s timeout) when theuse-http-client-tls
flag is enabled, and the default plainManager
otherwise. This default is available inDhall.Import.defaultNewManager
.Some remarks:
-fwith-http -f-use-http-client-tls
due to TLS failures. Do you know any plain HTTP servers without HTTPS redirections for this use case?-f-with-http
, this url fromdhall-lang/tests/import/success/unit/asLocation/RemoteChainEnvA.dhall
does not seem to have been mocked.In addition to bloat and security concerns, this PR enables to selectively disallow remote imports (e.g. in
Dhall.Format
).Feel free to close this PR if the changes are too invasive or you see a different way to make the HTTP Manager configurable.