Log Ruby 3 related deprecation warnings in production
Problem to solve
We want to check if we know of all deprecations related to Ruby 3. It is unknown if CI is sufficient
Proposal
We have many options:
1 - Use ActiveSupport to subscribe to deprecation.rails events
- Convert Kernel#warn to also call ActiveSupport::Deprecation.warn.
- We can use deprecation_toolkit gem, or write our own based on https://github.com/Shopify/deprecation_toolkit/blob/master/lib/deprecation_toolkit/warning.rb.
- Use ActiveSupport to subscribe to deprecation.rails events
From @tkuah's comment at &5149 (comment 594862033)
I think we need to capture deprecations from:
- QA runs
- Production
I think we can use ActiveSupport subscribe to subscribe to
deprecation.rails
events
2 - Patch Kernel#warn to log such warnings
3 - Use 3rd party gem
We can definitely use https://github.com/jeremyevans/ruby-warning for this
4 - Grep through existing logs to discover deprecations warnings
Since deprecation warnings are emitted through rb_warn
/Kernel#warn
, we should already see them in production.log
. While this isn't indexed in Kibana, we store it in cold storage: https://gitlab.com/gitlab-com/runbooks/-/tree/master/docs/logging#what-are-we-logging
We could just pull a few days worth of logs and grep out all deprecations warnings.
Edited by Matthias Käppler