-
Notifications
You must be signed in to change notification settings - Fork 353
Replace get_env with compile_env in module body & minor enhancement with version upgrade. #580
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
Replace get_env with compile_env in module body & minor enhancement with version upgrade. #580
Conversation
Do you mind bumping the version in the Line 5 in 30c3a29
|
You cannot do this while Tesla depends on Elixir ~> 1.7, since the # TODO: remove once we depend on Elixir 1.10+.
if function_exported?(Application, :compile_env, 3) do
@config Application.compile_env(:tesla, __MODULE__, [])
else
@config Application.get_env(:tesla, __MODULE__, [])
end |
4efd283
to
937241b
Compare
I have made changes accordingly. Please review |
Related to #581 (comment) I am OK change the supported Elixir version to be higher and follow a bit https://hexdocs.pm/elixir/compatibility-and-deprecations.html @whatyouhide any objections?! |
@yordis absolutely not! I was just warning against a breaking change, but raising the required Elixir version to 1.10 is great, it's been around for quite a while now! |
@whatyouhide I think I tried to say what you said 😄 @uzairaslam196 bump the version of elixir Line 13 in 30c3a29
~> 1.10 and the version Line 5 in 30c3a29
1.7.0
We wouldn't need to check for the func existence after that. |
I got it. 😄 |
- Elixir version to 1.10. - Tesla version to 1.7.0
@yordis i pushed new changes after upgrading versions, test cases are running fine. |
@disable_legacy_event Application.compile_env(:tesla, Tesla.Middleware.Telemetry, | ||
disable_legacy_event: false)[:disable_legacy_event] |
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.
@disable_legacy_event Application.compile_env(:tesla, Tesla.Middleware.Telemetry, | |
disable_legacy_event: false)[:disable_legacy_event] | |
@disable_legacy_event Application.compile_env(:tesla [Tesla.Middleware.Telemetry, :disable_legacy_event], false) |
I think this is a clearer implementation.
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.
Yes, I agree. Thanks for enhancement.
@whatyouhide share some Code Review love 🙏🏻 @uzairaslam196 thank you so much for the help! |
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 good to me too, but I'd merge #581 first so that this one can bump the version only once 🙃
close #579
Changes:
Tesla.Middleware.Logger.Formatter
&Tesla.Middleware.Telemetry
modules.~> 1.10
.1.7.0
.