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

Not reading dsn config at compile time #441

Merged
merged 1 commit into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/sentry/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ defmodule Sentry.Config do

@deprecated "Use root_source_code_paths/0 instead"
def root_source_code_path do
path = get_config(:root_source_code_path)
path = get_config(:root_source_code_path, check_dsn: false)

if path do
path
Expand All @@ -97,8 +97,8 @@ defmodule Sentry.Config do
# We should deprecate this the :root_source_code_path completely in the next major
# release.
def root_source_code_paths do
paths = get_config(:root_source_code_paths)
path = get_config(:root_source_code_path)
paths = get_config(:root_source_code_paths, check_dsn: false)
path = get_config(:root_source_code_path, check_dsn: false)

cond do
not is_nil(path) and not is_nil(paths) ->
Expand Down
6 changes: 6 additions & 0 deletions test/config_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,11 @@ defmodule Sentry.ConfigTest do

assert Config.root_source_code_paths() == ["/test"]
end

test "call to :root_source_code_paths does not read dsn env" do
modify_env(:sentry, dsn: {:system, "DSN", required: true})

Config.root_source_code_paths()
end
end
end