Skip to content

Add before_send_transaction hook#1989

Merged
sl0thentr0py merged 1 commit intomasterfrom
neel/before-send-tx
Jan 30, 2023
Merged

Add before_send_transaction hook#1989
sl0thentr0py merged 1 commit intomasterfrom
neel/before-send-tx

Conversation

@sl0thentr0py
Copy link
Copy Markdown
Member

resolves #1937

@codecov
Copy link
Copy Markdown

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
Copy Markdown
Contributor

@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
Copy Markdown
Contributor

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
Copy Markdown
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.

@st0012 st0012 added this to the 5.8.0 milestone Jan 25, 2023
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor

@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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add beforeSendTransaction

3 participants