Wikipedia:Bots/Requests for approval/StradBot
- The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at Wikipedia:Bots/Noticeboard. The result of the discussion was Approved.
New to bots on Wikipedia? Read these primers!
- Approval process – How this discussion works
- Overview/Policy – What bots are/What they can (or can't) do
- Dictionary – Explains bot-related jargon
Operator: Mr. Stradivarius (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 13:39, Wednesday, September 27, 2023 (UTC)
Function overview: Automatically populate Module:Disambiguation/templates Module:Disambiguation/templates/sandbox with a list of disambiguation templates and their redirects, and if necessary issue an edit request to update Module:Disambiguation/templates.
Automatic, Supervised, or Manual: Automatic
Programming language(s): Python (Pywikibot framework)
Source code available: https://github.com/mrstradivarius/dabtemplates
Links to relevant discussions (where appropriate): Module talk:Disambiguation#Bot for updating template list
Edit period(s): Daily
Estimated number of pages affected: 1 2
Namespace(s): The Module namespace
Exclusion compliant (Yes/No): Yes
Adminbot (Yes/No): Yes No
Function details: The bot iterates through all templates in Category:Disambiguation message boxes. Non-templates are ignored, as are templates in the bot's exclusion list (currently Template:Dmbox is ignored). The bot creates a list of all of these templates, and all of their redirects, formats it as a Lua table, and saves the result at Module:Disambiguation/templates Module:Disambiguation/templates/sandbox. The top comment of the module is parsed from the existing module at Module:Disambiguation/templates. Saving is skipped if the module's content would not change. I have saved sample output from the bot here. Module:Disambiguation/templates is fully protected as it is used in Module:Disambiguation, which is currently transcluded on roughly 15.7 million pages, so the bot needs permission to edit protected pages. If Module:Disambiguation/templates/sandbox was updated, and if its new content is different from that of Module:Disambiguation/templates, then an edit request to update Module:Disambiguation/templates is added to Module talk:Disambiguation. There is a sample edit request here.
Discussion
edit- This should ideally be fixed in MediaWiki itself (phab:T71441). But something is better than nothing. Please notify WP:AN as well per WP:ADMINBOT. Approved for trial (1 week). Please provide a link to the relevant contributions and/or diffs when the trial is complete. – SD0001 (talk) 18:38, 27 September 2023 (UTC)[reply]
- WP:AN notified here. — Mr. Stradivarius ♪ talk ♪ 00:38, 28 September 2023 (UTC)[reply]
This seems like serious overkill. New templates only will be added very occasionally. Wouldn't it be better to have a bot edit from time to time a separate list of all these templates, and if and when there are changes, let an admin update the module page manually (while checking that no one has added or removed a template by mistake or maliciously at the same time, something a bot won't do)? Granting admin status for a bot that will only really need to make a change once every month or so is not a good idea IMO (benefit-risk balancewise). Fram (talk) 08:44, 28 September 2023 (UTC)[reply]
- @Fram: The likely outcome of making this a manual process is that the module will be rarely updated, if ever. This means it would be inaccurate for long periods of time after templates are added or removed. On the other hand, if templates are added or removed from the category by mistake or maliciously, then presumably someone will notice this and revert the change. If the module is updated automatically, then in this situation it would be inaccurate for only a short amount of time (maybe a day or two, or no days at all if the change is reverted quickly enough). Using a bot to update the module seems like a better choice from this perspective. — Mr. Stradivarius ♪ talk ♪ 09:56, 28 September 2023 (UTC)[reply]
- Why would it be swiftly noticed if someone removes a template from the list by mistake, but not if a template should be on it but isn't? And if the bot writes to a separate page and some admins put this on their watchlist, it is easy to see when a change is expected (page appears on watchlist) and can then be executed with care. Admin bots should be very rare (e.g. the proxy blocking one), and having one for this rarely necessary task (it will run once a day, but how often will it actually need to edit?) doesn't seem sensible. What is the effect of a disambig template not being in that list anyway? When a page is added to that list (manually or by bot), what is the effect vs. if it isn't on that list? Fram (talk) 10:06, 28 September 2023 (UTC)[reply]
- I think Fram's idea is for the bot to post a {{edit protected}} on the talk page if the list is outdated, so it doesn't need admin rights. From experience those tend to get handled (often by me) in a few days at most. * Pppery * it has begun... 03:35, 30 September 2023 (UTC)[reply]
- @Fram and Pppery: I have changed the bot to edit the module sandbox and then create an edit request, rather than editing the module itself. I do admit that if the bot creates an edit request then there will be no problem with the module being rarely updated, as the edit request categories are patrolled fairly frequently. Personally, this seems too much like pointless busywork and I would prefer that the bot edits the main module directly, but if this is what it takes to get the bot approved then I'll accept that. As for Fram's question about what the effect of a disambig template not being in the list is: the answer is that Module:Disambiguation will classify pages using that template as articles, when they are in fact disambiguation pages. This has downstream effects, e.g. Template:Pagetype will produce "article" for the relevant pages instead of "page", but probably nothing that will completely break the wiki. — Mr. Stradivarius ♪ talk ♪ 15:26, 9 October 2023 (UTC)[reply]
Trial complete. Due to discussion above, I changed the bot to edit Module:Disambiguation/templates/sandbox and issue an edit request at Module talk:Disambiguation, instead of editing Module:Disambiguation/templates directly. Also, due to discussion this discussion I changed the format of the Lua module to be closer to the existing format. I have updated the description above to reflect these changes. The bot has made the following edits since those changes:
- 10 October 2023: sandbox edit test, edit request test
- 10 October 2023: sandbox edit, edit request
- 19 October 2023: sandbox edit, edit request
See here for all contributions related to this task. — Mr. Stradivarius ♪ talk ♪ 06:17, 22 October 2023 (UTC)[reply]
Approved. No issues. – SD0001 (talk) 18:24, 22 October 2023 (UTC)[reply]
- The above discussion is preserved as an archive of the debate. Please do not modify it. To request review of this BRFA, please start a new section at Wikipedia:Bots/Noticeboard.