Wikipedia:Bots/Requests for approval/Cerabot 2


 * The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA. The result of the discussion was Symbol keep vote.svg Approved

Cerabot 2
Operator:

Time filed: 18:58, Friday October 12, 2012 (UTC)

Automatic, Supervised, or Manual: Automatic partially-supervised

Programming language(s): Python

Source code available: Yes.

Function overview: Date maintenance tags.

Links to relevant discussions (where appropriate):

Edit period(s): Four times an hour.

Estimated number of pages affected: Several thousand.

Exclusion compliant (Yes/No): Yes.

Already has a bot flag (Yes/No): No

Function details: The bot dates maintenance tags listed here with their respective templates listed here. It utilizes parts of the pywikipedia toolkit. It was originally designed by Legoktm, but I've corrected several bugs and added a bit of robustness to the bot's performance. Aside from it's normal dating functions, the bot would convert template redirects to their respective targets and convert " " to "2012" if it finds that (and it has when I conducted testing). It would also correct the names of months. So: "october" becomes "October" and "sept" becomes "September". The bot retrieves a list of pages from this category. I have already tested the bot and I've concluded it works as it should. Anomie's bot does this already but, as we've seen with Rich Farmborough's bot, things happen that render people unable to complete tasks and it always helps to have a backup bot. The bot also corrects the capitalization on the templates it dates, and, at times, may correct the capitalization of other templates that have to the names in the list the bot compiles. This is rare and I'm working on fixing this, which I'm confident I will do in the future.

Discussion

 * This bot appears to have edited since this BRFA was filed. Bots may not edit outside their own or their operator's userspace unless approved or approved for trial. AnomieBOT ⚡ 23:54, 12 October 2012 (UTC)
 * Yes, I started a crontab and forgot to add a stop page feature. The bot will have to continue running and then by the time the crontab calls it another time I'll have the stop page feature written. -- ceradon talk contribs   23:57, 12 October 2012 (UTC)

A few lot of comments: HTH. Anomie⚔ 03:30, 13 October 2012 (UTC)
 * 1) I like that you're using a real parser, rather than trying to manipulate templates using regular expressions.
 * 2) Is it really necessary for your bot to capitalize random templates, as in [//en.wikipedia.org/w/index.php?title=Munich_massacre&diff=prev&oldid=517491192 this edit]? This is one of the things that has caused trouble for other bots in the past.
 * 3) Your bot does not include any delay for recently-edited pages. This leads to edit conflicts and complaints from the edit-conflicted users. inuse should also be honored.
 * 4) Edits such as [//en.wikipedia.org/w/index.php?title=Notre_Dame_High_School_%28New_Jersey%29&diff=prev&oldid=517238905 this] (second-to-last changed line) are questionable.
 * 5) Edits such as [//en.wikipedia.org/w/index.php?title=The_Cavaliers_Drum_and_Bugle_Corps&diff=prev&oldid=517290209 this] (for very long section) and [//en.wikipedia.org/w/index.php?title=Lake_Mission_Viejo&diff=prev&oldid=517085744 this] are also likely to get complaints.
 * 6) Looking at your code, it seems like it will only date templates that are listed at both WP:AWB/TR and WP:AWB/DT?
 * 7) It appears that the code at lines 164–172 will never be reached? I'd expect either   or   would be true, leaving the other   blocks to never be reached.
 * 8) Your bot reports "and date cleanup" even when it has done no cleanup. The first reason is that it will "change" a valid date to itself and count that as date cleanup; the second is that if it does do date cleanup but does not find any template actually missing a date, it will add the comment about date cleanup to the next page it does edit whether or not any date cleanup was actually done because   is not cleared except on edit. Why not just use a local variable?
 * 9) You're missing a close-paren in the edit summary.
 * 10) If there is a page the bot cannot fix (which tends to happen a few times a day, with people substing maintenance tags or adding the maintenance categories directly instead of using the templates), your bot will attempt to process the page every time it runs. This probably isn't a huge waste of resources, but OTOH if you can easily have the bot remember the last revid it has tried for each page and not try again it wouldn't hurt.

Just a note, I did some minor code review in the github comments. Ceradon, I fixed the capitalization error in this commit which you can just copy. LegoKontribsTalkM 08:40, 13 October 2012 (UTC)
 * Can someone pose a verdict on this request, please? I think all of the concerns voiced by Anomie have been addressed. -- ceradon talk contribs   20:41, 17 October 2012 (UTC)
 * I've only had time for a quick glance so I may be mistaken, but it looks like at least #3 and #6 are still present. #3 appears to be partially done; I see a function that purports to check for inuse, but nothing checking for recent edits. For other reviewers, I also note it seems most of the actual code is in awb_gen_fixes.py rather than the file linked above. Anomie⚔ 03:48, 18 October 2012 (UTC)
 * I fixed #6 (now dates templates only based on their inclusion on WP:AWB/DT).
 * Anomie, how long should the bot wait for no edits to date a template? Legoktm (talk) 05:06, 18 October 2012 (UTC)
 * AnomieBOT waits 20 minutes since the last time the article was [//en.wikipedia.org/w/api.php?action=query&titles=Main_page&prop=info "touched"], mainly because querying "touched" is cheaper than querying the last revision for the bunches of pages and it gives approximately the same result. Anomie⚔ 10:51, 18 October 2012 (UTC)
 * Ok, pywikibot has a page.editTime function which I believe does the same thing. I pushed an update which Ceradon can pull. Legoktm (talk) 16:22, 18 October 2012 (UTC)

I notice the bot still appears to be editing, although you said over 10 days ago you were going to add a stop page feature. It looks like you're continuing to test the bot, despite there being no approval for a trial. I haven't looked at the code, so can't really confirm if the issues mentioned by Anomie have been fixed yet, I'm not sure if Anomie plans to look at that in more detail or not. I do note that the bot is continuing to make edits like those pointed out in item #5 above, e.g. in this edit. - Kingpin13 (talk) 21:47, 23 October 2012 (UTC)
 * Just use the emergency "off button". Anomie⚔ 01:13, 24 October 2012 (UTC)
 * I did shut it off. I turned it on to test, but I forgot to turn it off and the crontab kept going. I think the bot has already been trialed enough. The version of the code in the git repository is the current version running on the Toolserver. I have to attend my cousins wedding in a few days tomorrow and I'll have limited access to computers. I would have liked to have this approved and running before then but that obviously won't happen. Do to this request what you must... -- ceradon talk contribs   01:37, 24 October 2012 (UTC)

Ceradon asked me on IRC to take another look at this. It appears that issues #4, #5, and #6 are still present. And #10, although that one isn't really a big deal. It looks like #2, #3, #7, #8, and #9 are fixed. I haven't checked to see if there are any new issues. Anomie⚔ 22:16, 6 November 2012 (UTC)
 * Problems #4 and #6 have been corrected assuredly. Regarding #5, the problem with this has yet to be corrected. This is because I can't gather the logic to accomplish this. Any ideas? -- ceradon talk contribs   23:20, 6 November 2012 (UTC)
 * I see you've just updated the code on GitHub since I wrote my previous comment. At a glance, now #6 appears fixed. Which line(s) are the code that prevents #4? I still don't see it. For #5, you need to check if Date exists, or dates, or if the first few unnamed parameters contain a date (but don't screw up afd-merge from or afd-merge to!). Anomie⚔ 23:29, 6 November 2012 (UTC)
 * Ceradon, I'd suggest doing a match for an unnamed parameter, containing only a date. If so, change it to the named parameter, or remove if there is already a named one (unless your bot only parses those without the parameter, I haven't checked.  Hazard-SJ  ✈   00:01, 17 November 2012 (UTC)
 * I had several other commitments I had to live up to recently, but the bot's coding will now receive my full attention (or at least a fair portion of it if nothing else pops up). ceradon talk contribs   03:22, 24 November 2012 (UTC)


 *  MBisanz  talk 14:48, 26 November 2012 (UTC)


 * Any updates?  MBisanz  talk 01:03, 31 December 2012 (UTC)
 * I'll begin the trial sometime tonight. -- ceradon talk contribs   23:38, 2 January 2013 (UTC)
 * I'm sorry for the delay, I ran into problems with my Toolserver account. These should be fixed as soon as I run into DaB. on IRC, sometime tomorrow.
 * How's your toolserver issue going. Are you ready to commence a trial?  If not this request will be marked as expired.— cyberpower ChatOffline 19:37, 28 January 2013 (UTC)
 * To me it looks like your bot could also be run on wikimedia labs. Maybe worth a look?  ·Add§hore·  T alk T o M e ! 14:29, 9 February 2013 (UTC)
 * There's no need to mark this as expired. I'm in the process of moving operations to the Wikimedia Labs cluster and will start the trial as soon as I possibly can. -- ceradon talk contribs   05:45, 11 February 2013 (UTC)
 * Okey, thanks for letting us know. We won't expire it.  MBisanz  talk 15:45, 11 February 2013 (UTC)

Everything with Cerabot is moving along well, I felt that Pywikipedia had become too cumbersome and difficult to use so I've decided to use Mr.Z-man's wikitools framework. It's simpler and easier to use. The new code is right here on GitHub. Cheers, -- ceradon talk contribs   01:50, 26 February 2013 (UTC)
 * The first few edits contained a lot of errors which have since been corrected. The newly completed code for the task is in the above link. Cheers, -- ceradon talk contribs   01:27, 3 March 2013 (UTC)
 * All looks good.  ·Add§hore·  Talk To Me! 23:56, 3 March 2013 (UTC)
 * 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 WT:BRFA.