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

Add before_send_transaction hook #1989

Merged
merged 1 commit into from
Jan 30, 2023
Merged

Add before_send_transaction hook #1989

merged 1 commit into from
Jan 30, 2023

Conversation

sl0thentr0py
Copy link
Member

resolves #1937

@codecov
Copy link

codecov bot commented Jan 23, 2023

Codecov Report

Base: 98.62% // Head: 98.63% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (64bf1f7) compared to base (bf0b9b4).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1989   +/-   ##
=======================================
  Coverage   98.62%   98.63%           
=======================================
  Files         157      157           
  Lines        9970    10009   +39     
=======================================
+ Hits         9833     9872   +39     
  Misses        137      137           
Impacted Files Coverage Δ
sentry-ruby/lib/sentry/client.rb 100.00% <100.00%> (ø)
sentry-ruby/lib/sentry/configuration.rb 98.50% <100.00%> (+0.03%) ⬆️
...ntry-ruby/spec/sentry/client/event_sending_spec.rb 99.64% <100.00%> (+0.03%) ⬆️
sentry-ruby/spec/sentry/configuration_spec.rb 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@st0012 st0012 left a comment

Choose a reason for hiding this comment

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

Just small comments on test.

configuration.before_send_transaction = dbl

expect(dbl).not_to receive(:call)
subject.send_event(event)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we avoid using double/mocking when it's not too hard to test it end-to-end? In my experience taking over the old SDK it makes things hard to maintain in the long-term.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did this because of the new codecov enforcing (which was turned on org-wide on github), it was complaining about a test line not being run. I will generally not use doubles, but in this case it makes sense.

sentry-ruby/spec/sentry/client/event_sending_spec.rb Outdated Show resolved Hide resolved
@st0012 st0012 added this to the 5.8.0 milestone Jan 25, 2023
Copy link
Member

@antonpirker antonpirker left a comment

Choose a reason for hiding this comment

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

Now I know what virtual attributes and doubles are in Ruby

Copy link
Collaborator

@st0012 st0012 left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. I was on a trip recently.
I still wonder why that line can't be tested and detected without double, but it's not a blocker for this feature so I'll check it later.

@sl0thentr0py sl0thentr0py merged commit 287cd5b into master Jan 30, 2023
@sl0thentr0py sl0thentr0py deleted the neel/before-send-tx branch January 30, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add beforeSendTransaction
3 participants