-
Notifications
You must be signed in to change notification settings - Fork 146
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
Correctly support Ruby 2.7+ keyword arguments. #426
Comments
@joshuap I've started to take a look at this and obviously this is not a super trivial change. The signature that would most likely work is What I am more worried about is people using explicit hashes ala What's your thoughts on this? EDIT: I think I can make it work with a signature like this (which unfortunately makes it a bit more complicated than before): |
* FIX: Make notify work with proper ruby keyword arguments Fixes #426 * Add tests for the various permutations of hashes and kwargs * Fix docs Removed the hash braces in the second example to clarify that kwargs are fine * Merge kwargs earlier --------- Co-authored-by: Joshua Wood <josh@joshuawood.net>
I think this is OK for now, although I may think about it a bit before releasing. My gut says your approach is best (albeit more complicated) until the next major/breaking release, when we should plan to remove the second |
@joshuap To clarify:
I think that's a good approach, though I admit I can't size "complexity" here since my ruby skills are limited. And if I'm not adding a lot to the complexity of the temporary signature, I would suggest logging a warning when the method is called with "legacy" params, something like: Passing params as an object is deprecated and will not work in future releases. Please click here to read more. |
The other option is to merge #499 and do a major release (6.0). Or, if we're not quite ready for 6.0, we could also revert e4a006c and plan to fix it for real in the next major release (without the interim step). I think I prefer the latter. |
I'm also fine with a deprecation warning if we decide to keep the temporary signature and do a minor release. |
This looks great, nice work team. |
I have no strong opinion about either approach. Actually, the more I think about it, I'm leaning towards the major release: no real winner, so I'd go for the simpler solution. |
One thing to consider is that we'll need to do a release once we finish the logging/insights work—will that also need to be a major release, or can it be a minor one? I'd prefer not to release two major versions back-to-back. |
If it won't introduce breaking changes, it can be a minor release. If it has breaking changes, then I guess we can skip the major release for this one. |
honeybadger-ruby/lib/honeybadger/agent.rb
Line 121 in 1052fd6
Should probably be
def notify(exception_or_opts, **opts)
.The text was updated successfully, but these errors were encountered: