-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Version horizon deprecations #3414
Conversation
@bronzdoc Loving this! This is WIP, right? I mean, next steps would be to change the calls to use the new implemenation of Also, can we default to set removal date for the next major is no explicit version is passed? Actually, we might want to remove the parameter altogether because I don't think it makes sense to deprecate something two major versions in advance? |
Good point, makes sense.
Yeah, my idea to implement it like this was that we might want to discuss when those methods were going to be deprecated(which version), but if we are going to set the deprecation to the next major always I think I should just get rid of the "date" methods and use the new ones. What you think? |
Yeah, I think removal on the next major is the safest thing to do? |
@deivid-rodriguez so if we set the default to be always the next major(calculated with the current major) without passing a major version explicitly, we might run into the same problem we have today. If we deprecate a method/command and we forget to deprecate it in the next major release we would be stuck with it for the next release. So: B: We calculate it to always be the next major but we will have to build tooling to check for deprecations before a major release C:? |
Indeed! I was actually going to propose B) as a follow up for this PR. Isn't A) subject to the same problem? I we do |
Actually, I built some tooling to check the current date based deprecations: Lines 89 to 100 in 2bbcdcd
But I set it to only be activated when releasing a major version, so it's never actually been run yet 😅. So we need to adapt to custom Thoughts? |
True, I think I was thinking on checking something like
Sounds good, we can adapt that to the new version horizon deprecation. Is there a benefit in making it a rubocop custom cop instead of a rake task? |
It's actually a |
9c2c0a5
to
2218c79
Compare
Errors are not related, seems like the bundler container can't connect to |
Nice @bronzdoc, it looks good to me now! After a second though I'm not sure we even need the We definitely need to add "Remove pending deprecations" to our release playbook, in the case of releasing a major, but maybe this automated check is unnecessary and might get in the middle. In any case, this is a strict improvement over what we have now, so I'm happy to merge this and discuss the removal of the rubocop check separately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed the changes to the rubocp cop, although as I explained, we might want to get rid of it. Something else we need to add if we keep it is to also detect deprecate_command
calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad review, I wanted to request changes to the documentation of the cop 😅
@deivid-rodriguez sounds good, lets keep it and decide if we want to remove it in the future. Meanwhile I added a check for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two super minor comments, but other than that looks great to me!
Co-Authored-By: David Rodríguez <deivid.rodriguez@riseup.net>
Thanks for the Review @deivid-rodriguez I addressed your changes, going to merge this 🚀 |
Thanks @bronzdoc! |
ℹ️ I have seen this deprecation mechanismus used in wild by gems extending Since that method is not |
Hi @simi, thanks for noticing this! I guess we should keep the signature and deprecate the date and month parameters, but... deprecating a deprecation mechanism... makes my head ache 🤣. Not sure, let's think about it a bit more. 🤔 |
🤔 Alternatively we can keep the old |
Yeah, I was thinking of something like that too. But it seems weird to give our new preferred deprecation mechanism an artificial name. Something else I'm noticing is that, we've turned an (apparently public, not sure if that was ever intended) mechanism for deprecating generic methods into something rubygems specific, because the message now mentions rubygems. So that's another compatibility problem on top of that. |
There's an accepted feature request in ruby-core to make this builtin, by the way: https://bugs.ruby-lang.org/issues/16018. Currently I tend to think we should deprecate passing date and month, and explicitly pass a version. I believe that was @bronzdoc's initial implementation, and I told him that an explicit version parameter was not necessary. However, if we want to keep this method generic, it sounds like the easiest way. I'll think of it a bit more. |
Right name is the key here. Maybe
The question in here is if rubygems is going to accept this fact and continue supporting
It is not even developed and would take a long time unless it will be publicly used. 🤔 FYI I have spotted the same wild usage of rubygems tar reader/writer as well. |
Regarding the ruby-core feature request, yeah, I only pointed to it as a reference, but it's not something useful at the moment. Anyways, I definitely appreciate that you spotted this, this early, and I think we should definitely restore support for this at least for the next minor, since I'm sure it is indeed widely used.
Actually, deprecations are too tricky. We probably should do this and instead restore the original implementation for now and add our new private mechanism for deprecating stuff ourselves, as you suggested. |
Yeah, thanks for that. I had no idea about that. |
Description:
Closes #3013
This PR makes
deprecate
anddeprecate_command
accept a date horizon and instead of a date,I will abide by the code of conduct.