Vonage / vonage-ruby-sdk

Vonage REST API client for Ruby. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
https://developer.vonage.com
Apache License 2.0
216 stars 108 forks source link

DEVX-7780: Update Logger Type Signatures #290

Closed superchilled closed 10 months ago

superchilled commented 10 months ago

This PR updates some Sorbet type signatures for Logger creation and assignment. The motivation for this change is that in Rails 7.1.0 a change has been made to Rails.logger so that it no longer inherits from Ruby's std lib Logger class. This means that Rails.logger in 7.1.0 is invalid according to the type signatures in the Vonage Ruby SDK. See this issue for more detail.

The specific fix is to update the type signatures for logger creation and assignment to conditionally allow Rails 7.1's ActiveSupport::BroadcastLogger as a type if it is defined. The signatures updated are:

Thanks to @ohbarye for the detailed bug report and proposed fix.

codecov-commenter commented 10 months ago

Codecov Report

Merging #290 (6a70b8e) into main (b3122cb) will increase coverage by 0.00%. The diff coverage is 100.00%.

:exclamation: Current head 6a70b8e differs from pull request most recent head d4c1a06. Consider uploading reports for the commit d4c1a06 to get more accurate results

@@           Coverage Diff           @@
##             main     #290   +/-   ##
=======================================
  Coverage   97.93%   97.94%           
=======================================
  Files         108      108           
  Lines        1988     1991    +3     
=======================================
+ Hits         1947     1950    +3     
  Misses         41       41           
Files Coverage Δ
lib/vonage/config.rb 97.93% <100.00%> (+0.04%) :arrow_up:
lib/vonage/logger.rb 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more