Add ability to have many post initialization callbacks#1261
Conversation
014ca79 to
5fe8e53
Compare
5fe8e53 to
8c2ec4e
Compare
Codecov Report
@@ Coverage Diff @@
## 4-2 #1261 +/- ##
==========================================
- Coverage 98.91% 98.59% -0.32%
==========================================
Files 32 105 +73
Lines 921 4780 +3859
==========================================
+ Hits 911 4713 +3802
- Misses 10 67 +57
Continue to review full report at Codecov.
|
st0012
left a comment
There was a problem hiding this comment.
thanks for the idea and PR, but I think we still need some polishing here 🙂
|
I guess, the problem with CI is a problem with jruby. Don't know why, but it cannot find out a |
|
no worries, that’s happening on master and the 4-2 branch as well, I’ll take care of that 🙂 |
|
@mrexox in case you're curious about it, the issue is a bug on jruby jruby/jruby#6547, which was surfaced because of ruby-i18n/i18n#554. |
|
@mrexox I think if you rebase the branch against |
59ad89c to
80979ec
Compare
st0012
left a comment
There was a problem hiding this comment.
great job 👍
one last thing before merge - can you add a changelog entry for this change 😄
* Add ThreadsInterface (#1178) * Add ThreadsInterface * Update changelog * Inspect exception cause by default & don't exclude ActiveJob::DeserializationError (#1180) * Turn on inspect_exception_causes_for_exclusion by default With this config turned on, we can avoid matching the surface exceptions in integrations, which could cause issues like #1071. Solves #642. * Remove ActiveJob::DeserializationError from ignored list Since the previous commit solves #642, this commit can remove ActiveJob::DeserializationError from the ignored exceptions list. Solves #1071. * Update async document * Update changelog * Make sentry-rails a Rails engine and provide default job class for async (#1181) * Make sentry-rails a Rails engine too * Add Sentry::SendEventJob Instead of letting users defining their SentryJob class, we should provide a default job class for them. * Update document and example for the new job class * Update changelog * Add configuration option for trusted proxies (#1126) * Add configuration option for trusted proxies * Add `trusted_proxies` configuration option to sentry-ruby * Add existing ActionDispatch `trusted_proxies` values * Address some PR feedback * Isolate trusted proxy test configuration * Add comments to explain why we reverse the forwarded_for ip list * Call `uniq` on the trusted proxy list * Rename `filter_local_addresses(ips) to filter_trusted_proxy_addresses(ips) * Remove duplicated hash entry * Update some tests after PR feedback * retrigger checks Co-authored-by: Stan Lo <stan001212@gmail.com> * Only define SendEventJob when ActiveJob is defined * Allow users to configure ActiveJob adapters to ignore (#1256) * Allow users to configure ActiveJob adapters to ignore * Update changelog * Add sidekiq adapter to sentry-rails' ignored adapters list (#1257) * Add sidekiq adapter to sentry-rails' ignored adapters list * Update changelog * Tag queue name and jid on sidekiq events (#1258) * Add queue name and jid to event tags * Update changelog * Tag job_id and provider_job_id on ActiveJob events (#1259) * Refactor/test ActiveJob's context data * Tag job_id and provider_job_id on ActiveJob events * Update changelog * Add ability to have many post initialization callbacks (#1261) * Add ability to have many post initialization callbacks * Revert version bumping, fix codestyle and rewrite rspec test * Remove dependenciy bumping from sentry-sidekiq * Add entries to CHANGELOG * Support config.before_breadcrumb (#1253) * Support config.before_breadcrumb Example: ``` config.before_breadcrumb = lambda do |breadcrumb, hint| breadcrumb.message = "foo" breadcrumb end ``` * Update changelog * Update sentry-ruby's changelog * Update sentry-rails' changelog * Update sentry-sidekiq's changelog * Rename ignored_active_job_adapters to skippable_job_adapters (#1264) * Update sentry-ruby's changelog Co-authored-by: Jon-Erik Schneiderhan <45184220+jeschneiderhan@users.noreply.github.com> Co-authored-by: Valentine Kiselev <mrexox@outlook.com>
* Add ability to have many post initialization callbacks * Revert version bumping, fix codestyle and rewrite rspec test * Remove dependenciy bumping from sentry-sidekiq * Add entries to CHANGELOG
Description
I don't know if there is an issue about it. I faced this problem when I was trying to write my own extension of
Sentry::Configuration. I suppose, it's not going to work with sentry-rails, because sentry-rails already redefinedpost_initialization_callback, and there was no mechanism for adding another callback to initialization process except for patchinginitializemethod. I think this change will make it a bit easier in future.