-
Notifications
You must be signed in to change notification settings - Fork 17
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 metrics ip and port, and http endpoint port configurable #87
Conversation
Codecov Report
@@ Coverage Diff @@
## main #87 +/- ##
==========================================
+ Coverage 83.70% 84.27% +0.56%
==========================================
Files 43 44 +1
Lines 718 744 +26
==========================================
+ Hits 601 627 +26
Misses 117 117
Continue to review full report in Codecov by Sentry.
|
config/runtime.exs
Outdated
# we set ip and port here to allow for | ||
# running multiple Jellyfishes in development | ||
config :jellyfish, JellyfishWeb.Endpoint, | ||
# Binding to loopback ipv4 address prevents access from other machines. | ||
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines. | ||
http: [ip: {127, 0, 0, 1}, port: port] | ||
|
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.
Won't it be confusing to set up JellyfishWeb.Endpoint
in two places for the dev environment, now we set up JellyfishWeb.Endpoint
in two places in this file, maybe we should move it closer and in the case clause?
06b800e
to
3b2008b
Compare
c3550fa
to
2d249b6
Compare
.credo.exs
Outdated
@@ -129,7 +129,7 @@ | |||
{Credo.Check.Refactor.MatchInCondition, []}, | |||
{Credo.Check.Refactor.NegatedConditionsInUnless, []}, | |||
{Credo.Check.Refactor.NegatedConditionsWithElse, []}, | |||
{Credo.Check.Refactor.Nesting, []}, | |||
{Credo.Check.Refactor.Nesting, [max_nesting: 3]}, |
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.
A little bit more power?
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.
Why do we need this?
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.
We need more power to write a good code :D I belive that 3 leveles of nesting is acceptable. Some functions in ConfigReader uses this
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.
The load balancing test doesn't pass.
.credo.exs
Outdated
@@ -129,7 +129,7 @@ | |||
{Credo.Check.Refactor.MatchInCondition, []}, | |||
{Credo.Check.Refactor.NegatedConditionsInUnless, []}, | |||
{Credo.Check.Refactor.NegatedConditionsWithElse, []}, | |||
{Credo.Check.Refactor.Nesting, []}, | |||
{Credo.Check.Refactor.Nesting, [max_nesting: 3]}, |
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.
Why do we need this?
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.
Besides failing load-balancing tests, everything looks fine.
def read_port(env) do | ||
if value = System.get_env(env) do | ||
case Integer.parse(value) do | ||
{port, _sufix} when port in 1..65_535 -> |
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.
Why is it 1 here and 0 in read_port_range
?
8337558
to
7218656
Compare
7218656
to
cd00d5b
Compare
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.
🥇
This PR allows for running multiple JF instances in development. In particular:
lib
directory makingruntime.exs
clearer