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

Move envelope item processing/trimming logic to the Item class #1824

Merged
merged 5 commits into from
May 20, 2022

Conversation

st0012
Copy link
Collaborator

@st0012 st0012 commented May 20, 2022

I think size-control logic should live inside the Item class and Transport#serialize_envelope only needs to decide whether the result should be included in the envelope.

Item should take care of this check/trimming process and return the best
result it can provide, instead of going back-and-forth with the
Transport class.
The size limitation is Item's concern instead of Event's, so it makes
more sense to define it in the Item class.
We use info level for other event related actions (dropping/sending). So
we should also use the same level when an event is being dropped due to
oversize.
@st0012 st0012 added this to the 5.4.0 milestone May 20, 2022
@st0012 st0012 added this to In progress in 5.x via automation May 20, 2022
@st0012 st0012 self-assigned this May 20, 2022
@st0012 st0012 requested a review from sl0thentr0py May 20, 2022 12:01
@codecov-commenter
Copy link

codecov-commenter commented May 20, 2022

Codecov Report

Merging #1824 (b6ab2dc) into master (cb8c015) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1824      +/-   ##
==========================================
+ Coverage   98.39%   98.46%   +0.06%     
==========================================
  Files         145      145              
  Lines        8657     8659       +2     
==========================================
+ Hits         8518     8526       +8     
+ Misses        139      133       -6     
Impacted Files Coverage Δ
sentry-ruby/lib/sentry/event.rb 98.76% <ø> (-0.02%) ⬇️
sentry-ruby/lib/sentry/envelope.rb 97.95% <100.00%> (+2.72%) ⬆️
sentry-ruby/lib/sentry/transport.rb 99.00% <100.00%> (+4.56%) ⬆️
sentry-ruby/spec/sentry/transport_spec.rb 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb8c015...b6ab2dc. Read the comment docs.

Copy link
Member

@sl0thentr0py sl0thentr0py left a comment

Choose a reason for hiding this comment

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

nice, I agree!

@st0012 st0012 merged commit 4ba0ca2 into master May 20, 2022
5.x automation moved this from In progress to Done May 20, 2022
@st0012 st0012 deleted the refactor-item-processing branch May 20, 2022 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
5.x
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants