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

Add support for headers and dynamic base URL (#65) #77

Merged
merged 3 commits into from
Aug 28, 2024

Conversation

sliiser
Copy link
Contributor

@sliiser sliiser commented Jun 25, 2024

The :base_url attribute now accepts static headers or a custom function that returns a URL and headers. This allows us to fetch NIFs from more complicated sources, rather than just public GitHub releases.

#65

lib/rustler_precompiled.ex Outdated Show resolved Hide resolved
Copy link
Owner

@philss philss left a comment

Choose a reason for hiding this comment

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

Good job! Thank you!

I added some minor suggestions. And sorry for the delay :/

lib/rustler_precompiled.ex Outdated Show resolved Hide resolved
lib/rustler_precompiled.ex Outdated Show resolved Hide resolved
lib/rustler_precompiled/config.ex Outdated Show resolved Hide resolved
lib/rustler_precompiled/config.ex Outdated Show resolved Hide resolved
test/rustler_precompiled_test.exs Outdated Show resolved Hide resolved
test/rustler_precompiled_test.exs Outdated Show resolved Hide resolved
@sliiser sliiser force-pushed the dynamic-base-url-and-headers branch from dc6fa8b to 88c8feb Compare July 2, 2024 13:35
@sliiser sliiser requested a review from philss July 3, 2024 06:01
@philss
Copy link
Owner

philss commented Jul 4, 2024

@sliiser almost there! There is one problem in the tests, but other than that it looks great! Please take a look.

The :base_url attribute now accepts static headers or a custom function
that returns a URL and headers. This allows us to fetch NIFs from more
complicated sources, rather than just public GitHub releases.

Co-authored-by: Philip Sampaio <philip.sampaio@gmail.com>
@sliiser sliiser force-pushed the dynamic-base-url-and-headers branch from 88c8feb to 3bcb29a Compare July 8, 2024 09:16
@sliiser
Copy link
Contributor Author

sliiser commented Jul 8, 2024

Whoops. That test was linux only so it didn't fail on my dev machine. Fixed now (hopefully).

I also squashed the commits to be ready for merge.

@sliiser
Copy link
Contributor Author

sliiser commented Aug 27, 2024

Hey, it's been a while... Anything else you need me to change here?

Copy link
Owner

@philss philss left a comment

Choose a reason for hiding this comment

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

Hey @sliiser ! So sorry for the delay here :/

I added some minor points, but the overall looks great!

lib/rustler_precompiled.ex Outdated Show resolved Hide resolved
lib/rustler_precompiled.ex Outdated Show resolved Hide resolved
lib/rustler_precompiled/config.ex Outdated Show resolved Hide resolved
lib/rustler_precompiled/config.ex Outdated Show resolved Hide resolved
sliiser and others added 2 commits August 28, 2024 10:09
Co-authored-by: Philip Sampaio <philip.sampaio@gmail.com>
Previously the `RustlerPrecompiled.Config` struct was initialized
directly in the tests, which bypassed the validation in `new/1`.
This change updates the tests to use `new/1` wherever possible.
Some tests still use direct struct access to test invalid values.
@sliiser sliiser requested a review from philss August 28, 2024 07:16
@philss philss merged commit ae78223 into philss:main Aug 28, 2024
3 checks passed
@philss
Copy link
Owner

philss commented Aug 28, 2024

@sliiser this is great! Thank you! I should release a new version today. I will ping you here.

philss added a commit that referenced this pull request Aug 28, 2024
This reverts commit ae78223.

This change is temporary, since we need to release a patch first.
philss added a commit that referenced this pull request Aug 28, 2024
@philss
Copy link
Owner

philss commented Aug 29, 2024

@sliiser it's released under v0.8.0. Please give it a try.

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.

2 participants