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

fix: configuring the start_link opts without global config #88

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

yordis
Copy link
Contributor

@yordis yordis commented Jun 6, 2023

I tried the following:

defmodule Umbrella.Application do
  use Application

  @impl true
  def start(_type, _args) do
    children = [
      {Umbrella.EventStore.Client, connection_string: "esdb://localhost:2113?tls=true&tlsVerifyCert=false"}
    ]

    Supervisor.start_link(children, strategy: :one_for_one, name: Umbrella.Supervisor)
  end
end

WITHOUT configuring anything under config/* configuration files, thus, it failed because:

** (Mix) Could not start application umbrella: Umbrella.Application.start(:normal, []) returned an error: shutdown: failed to start child: Umbrella.EventStore.Client
    ** (EXIT) an exception was raised:
        ** (FunctionClauseError) no function clause matching in Keyword.merge/2
            (elixir 1.14.5) lib/keyword.ex:979: Keyword.merge(nil, [connection_string: "esdb://localhost:2113?tls=true&tlsVerifyCert=false"])
            (umbrella 0.1.0) lib/umbrella/event_store/client.ex:2: Umbrella.EventStore.Client.start_link/1
            (stdlib 5.0) supervisor.erl:420: :supervisor.do_start_child_i/3
            (stdlib 5.0) supervisor.erl:406: :supervisor.do_start_child/2
            (stdlib 5.0) supervisor.erl:390: anonymous fn/3 in :supervisor.start_children/2
            (stdlib 5.0) supervisor.erl:1256: :supervisor.children_map/4
            (stdlib 5.0) supervisor.erl:350: :supervisor.init_children/2
            (stdlib 5.0) gen_server.erl:962: :gen_server.init_it/2

@yordis
Copy link
Contributor Author

yordis commented Jun 6, 2023

Either this or force the config using fetch_env! (which I wouldn't recommend honestly)

@yordis yordis marked this pull request as ready for review June 6, 2023 01:37
@yordis
Copy link
Contributor Author

yordis commented Jun 6, 2023

@the-mikedavis do you mind giving me some love over here?

@coveralls
Copy link

coveralls commented Jun 6, 2023

Pull Request Test Coverage Report for Build a3e2bd96b6156044f5f028f296fd76e069669bf2-PR-88

Warning: This coverage report may be inaccurate.

We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
To ensure accuracy in future PRs, please see these guidelines.
A quick fix for this PR: rebase it; your next report should be accurate.

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 356 unchanged lines in 25 files lost coverage.
  • Overall coverage decreased (-50.2%) to 49.365%

Files with Coverage Reduction New Missed Lines %
lib/spear/acl.ex 1 90.0%
lib/spear/connection/configuration.ex 1 96.77%
lib/spear/filter/checkpoint.ex 1 0.0%
lib/spear/grpc.ex 1 83.33%
lib/spear/position.ex 1 0.0%
lib/spear/scavenge.ex 1 0.0%
lib/spear/supported_rpc.ex 1 0.0%
lib/spear/uuid.ex 1 90.0%
lib/spear/filter.ex 2 93.33%
lib/spear/cluster_member.ex 3 0.0%
Totals Coverage Status
Change from base Build 40d5f2f12eae2090e90d0d5e5cddf50329ff1222: -50.2%
Covered Lines: 350
Relevant Lines: 709

💛 - Coveralls

Copy link
Collaborator

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

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

Good catch, thanks! Looks like the CI is having some trouble, I'll take a look

@the-mikedavis the-mikedavis merged commit da51387 into NFIBrokerage:main Jun 6, 2023
@yordis yordis deleted the fix-config-init branch June 6, 2023 15:10
@yordis yordis mentioned this pull request Jun 6, 2023
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.

3 participants