Skip to content
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

bot: properly deprecate search_url_callbacks() method #2581

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

dgw
Copy link
Member

@dgw dgw commented Dec 6, 2023

Description

That decorator is the only thing wot might actually get people to notice that they're still using a deprecated feature…

Carelessly left out of #2121, somehow. Actually was included in #2121 but reverted in #2156 due to log spam. But it's not so important that it needs to go in 8.0.0, either.

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make lint and make test)
  • I have tested the functionality of the things this change touches

That decorator is the only thing wot *might* actually get people to
notice that they're still using a deprecated feature...
@dgw dgw added the Housekeeping Code cleanup, removal of deprecated stuff, etc. label Dec 6, 2023
@dgw dgw added this to the 8.0.1 milestone Dec 6, 2023
@dgw dgw requested a review from a team December 6, 2023 07:10
Copy link
Contributor

@Exirel Exirel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean... this can go in 8.0.0 if you accept to merge it the same day as another PR.

Edit: but 8.0.1 is fine too!

@dgw
Copy link
Member Author

dgw commented Dec 8, 2023

I might have figured out why #2121 didn't do this: url still needs to call this method.

sopel/sopel/builtins/url.py

Lines 503 to 507 in 120477f

return (
excluded or
any(bot.search_url_callbacks(url)) or
bot.rules.check_url_callback(bot, url)
)

What do y'all think of adding this warning_in 8.1 as planned, and then having url cease checking the deprecated URL callback machinery in 8.1?

The best alternative I could imagine is making the public search_url_callbacks() method a deprecated-decorated wrapper around a private method that isn't decorated, so url could continue checking the old machinery without a warning until it's actually removed in 9.0. That feels messier than I'd like, though.

@SnoopJ
Copy link
Contributor

SnoopJ commented Dec 8, 2023

I think it's okay to formally deprecate it in 8.0.0 and defer the warning. It should obviously be mentioned in the change notes, but deferring the warning to 8.1.0 because we're using it internally makes sense to me. There should be an issue tracking the internal change to url, though. (I didn't check if there already is one)

@dgw dgw modified the milestones: 8.0.1, 8.0.0 Dec 9, 2023
@dgw
Copy link
Member Author

dgw commented Dec 9, 2023

Closed the loop on this being "forgotten" in #2121 (it wasn't) when I noticed #2156 in the changelog draft @SnoopJ put together. I won't merge this until after I have a moment to create a draft PR implementing one of the solutions in #2581 (comment) for 8.1.0, so we don't forget about it and have a repeat occurrence of logspam.

@dgw dgw marked this pull request as ready for review December 11, 2023 23:40
@dgw
Copy link
Member Author

dgw commented Dec 11, 2023

#2585 for follow-up; I chose a method that would let url continue interacting with anything added via the deprecated system without additional warnings.

Will merge this soon, once other maintainers have a chance to voice objection.

Edit: "Soon" = 14 Dec, 3 days later. I'm sure any objections would've come up sooner. 🙃

@dgw dgw merged commit 6fc9eee into master Dec 14, 2023
15 checks passed
@dgw dgw deleted the proper-SUC-deprecation branch December 14, 2023 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Housekeeping Code cleanup, removal of deprecated stuff, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants