-
-
Notifications
You must be signed in to change notification settings - Fork 208
Read dsn from system #109
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
Read dsn from system #109
Conversation
| The event is dropped if it all retries fail. | ||
| """ | ||
| @spec send_event(%Event{}) :: {:ok, String.t} | :error | ||
| def send_event(%Event{} = event) do |
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.
Basically we should be injecting dependences in function signature so we can easily test and move private functions to its own module which we can also test independently so it could be like:
def send_event(%Event{} = event, dsn_parser \\ DsnParser) do
{endpoint, public_key, secret_key} = dsn_parser.parse!
# ....
endUnfortunately I don't have time to implement it yet, but we can refactor it soon
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.
I'm not sure that that would be necessary. This kind of pattern would usually come along with specifying a Behaviour, which might be overkill at this point 🙂
lib/sentry/client.ex
Outdated
| end) | ||
| end | ||
|
|
||
| def dsn_env do |
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.
Unfortunately it is public for testing, this should be moved to another module DsnParser and be injected on send_event public function
|
I can start reviewing this at some point today, but if you need it ASAP, you can reference your fork in mix with: |
|
@mitchellhenke Thanks! |
lib/sentry/client.ex
Outdated
| end | ||
|
|
||
| def dsn_env do | ||
| case Application.get_env(:sentry, :dsn) do |
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.
I think this should stay as Application.fetch_env!?
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 you are right!
|
@mitchellhenke I also just realized that I need to do the same on |
|
@rafaeljesus It might be easier to have something like |
|
@mitchellhenke mate I did the changes you requested may you take a 👀 again? |
|
Also execute the send_test_event manually with my sentry account and works like a charm |
|
Thanks for the contribution! |
Allow read dsn system values for deployment
Closes #107
I kindly ask you to merge it asap as I have a application running in production waiting this feature,
Thanks