Feature: add warnings for deprecated methods - #397
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a deprecation warning mechanism for deprecated API methods, updating the Mustache templates to automatically generate deprecation warnings and updating several API clients accordingly. The review feedback suggests avoiding Gem::Version for Ruby version checks to eliminate unnecessary RubyGems dependencies, and recommends using Kernel.warn instead of calling Warning.warn directly to ensure custom warning handlers are respected.
34a7a71 to
8b5e205
Compare
gcatanese
left a comment
There was a problem hiding this comment.
Great work, both solution and documentation. I found one potential problem, pls have a look. Thanks
52a7d9f to
e042df2
Compare
|



Currently, deprecation appears in ruby only via a comment in the associated method. However, since this isn't explicit on the client-side, deprecation might silently be missed, and dropping of endpoints/methods may come without warning.
Description
This creates a deprecation helper-module to emit warnings for deprecated methods + updates generation templates to use it. Library has been regenerated, tests added, updated README. Additionally, added YARD metadata tags -> helps IDEs identify the methods as deprecated.
Though
rubygemshasGem::Deprecatefor this functionality, it's designed for warning and then delegating to an alternative, which doesn't fit this libraries' use-case. I also wanted the warning to exhibit the same information as the existing comment (deprecation version, point to alternative API) which the former doesn't support.Additional notes:
Adyen::Deprecation.silenced = truein the Ruby appADYEN_SILENCE_DEPRECATIONSto1,true, oryesposTerminalManagement.rbandhmac_validator.rbhad some deprecated code that wasn't updated after generation because the former is out of the generation list (deprecated API) and the latter is manual code. Updated both manually.CATEGORY_SUPPORTis for). If we decide to move along with 3.3+, then this can be dropped.Example of what the warnings will look like to the user:
Tested scenarios