Wikipedia:Bots/Requests for approval/B-bot 3


 * 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

B-bot 3
Operator:

Time filed: 23:39, Sunday, May 24, 2015 (UTC)

Automatic, Supervised, or Manual: Automatic

Programming language(s): C#

Source code available: User:B-bot/source/OTRS Dated Filer

Function overview: 1. If the monthly OTRS pending and OTRS received categories, e.g. Category:Items pending OTRS confirmation of permission as of May 2015 and Category:Wikipedia files with unconfirmed permission received by OTRS as of May 2015, do not exist for either the current month or for next month, create them. 2. For any OTRS pending or OTRS received tag, if the tag is not dated, add the appropriate date.

Links to relevant discussions (where appropriate): OTRS_noticeboard

Edit period(s): Daily

Estimated number of pages affected: Lots initially (there are 400 or so pages to initially be tagged) and thereafter probably around 10 per day on average.

Exclusion compliant (Yes/No): Not applicable, no users are notified by this task.

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

Function details:


 * 1) Check to see if the current month's OTRS pending category exists and if not, create it using  .  Do the same for next month.
 * 2) Check to see if the current month's OTRS received category exists and if not, create it using  .  Do the same for next month.
 * 3) Patrol the category Category:Items pending OTRS confirmation of permission as of unknown date, adding year|month|day based on the last edit date.
 * 4) Patrol the category Category:Wikipedia files with unconfirmed permission received by OTRS as of unknown date, adding year|month|day based on the last edit date.

This is a precursor to the next task, which will be automatically giving a final warning / request for follow-up if we have not received appropriate permission in more than OTRS backlog days.

Discussion
This is running in test mode at User:B-bot/Test page. --B (talk) 23:56, 24 May 2015 (UTC)
 * The test page looks fine. --Stefan2 (talk) 20:22, 27 May 2015 (UTC)


 * Note, I have, subsequent to this test, run another test on the test page. The relevant test can be found in the page history at . --B (talk) 10:43, 29 May 2015 (UTC)

-- Magioladitis (talk) 11:15, 29 May 2015 (UTC)
 * Underway. User:B-bot/Event_log --B (talk) 11:44, 29 May 2015 (UTC)
 * The process was successful on OTRS pending but failed on OTRS received because the categories were inconsistently named. I have better organized the categories in Category:Wikipedia OTRS, rather than putting all of the dated categories directly under this main one.  If you look at Category:Wikipedia files with unconfirmed permission received by OTRS, you will see at the top the two dated categories (May and June) that the bot creates.  You then see the "unknown date" category where ones that haven't yet been dated are stored and then three other auto-populated date-based categories.  Category:Wikipedia pages with unconfirmed permission received by OTRS has the same thing for non-file pages.  It is going to take a little time for some of these auto-populated categories to get auto-populated because I just changed the template to have the consistent name.  I re-ran the process (with a maximum number of images set at 2) and will re-run it again tonight after the categories have had time to play go fetch. The results are at User:B-bot/Event_log. --B (talk) 13:19, 29 May 2015 (UTC)


 * After several attempts where I had to fix a few things, the process worked successfully at User:B-bot/Event_log. (I had it capped at five images for each of the three segments.)  I added a new function to auto-create monthly categories for old pages or files - I didn't realize it until doing some of these that there are a lot of PAGES (not files) that have been tagged for a VERY long time - five years in some cases.  So this process will be good for being able to readily identify those.   has the edits involved in this successful test. --B (talk) 20:23, 29 May 2015 (UTC)
 * I have checked some random files in subcategories to Category:Items pending OTRS confirmation of permission to which the bot added dates, and those look fine.
 * What will happen if the bot can't edit a page which uses OTRS pending? For example, the bot will not be able to edit User:Rjd0060/OTRS-Text.js or MediaWiki:FileUploadWizard.js, which are both 'using' the template due to bad script coding. --Stefan2 (talk) 20:26, 29 May 2015 (UTC)
 * I actually encountered that problem and it crashed. I put a try/catch around it so I will trap it and log an error.  My intention is to modify the template so that it will not put the page in the category at all if it ends in .js, but for now, I'm just trapping the error.  I also noticed that a handful of user talk pages had OTRS pending tags where users had incorrectly added the template there instead of on the image (or article talk page).  The same problem could arise here where the user talk page is protected and the behavior would be the same - it would get an exception, which is trapped and it will log it to its event log.  Earlier today, I went through all of the user talk pages in the category that were actual user talk pages (not the talk page of a draft in user space), commented out the template, and left a message for the owner.  A possible future feature of this bot would be to automate that process - there is never a case where a user talk page should have OTRS pending on it and if we catch them quickly rather than months down the line, we might help them put it in the right place and prevent the image from being deleted prematurely. --B (talk) 20:47, 29 May 2015 (UTC)

--B (talk) 20:49, 29 May 2015 (UTC)
 * There is always a risk that the template is used at the wrong place, for example added to discussions by new users who don't know about tl. If you are somehow able to detect them, then fine. If not, then they will be spotted in the monthly categories after a long time when the intended files or articles already have been deleted. --Stefan2 (talk) 21:26, 29 May 2015 (UTC)
 * If it is in a base user talk page (not a subpage), then I could simply always regard that as incorrect and log an error. (I don't really want to automatically remove it - I'd rather just notify myself so that I can take care of it and engage the user to ask them what it was intended for, or, if I can tell myself, just add it to the right place myself.)  If the tag is on an article talk page (when it was intended for an image page), I don't know that there's really a way good way to automatically detect that because it's perfectly legitimate for the tag to be on the article talk page.  --B (talk) 22:01, 29 May 2015 (UTC)
 * I have added a check so that if the tag is on a user talk page, I will log an error (which I can manually follow up on to either remove the tag or move it to the image where the user really wants it) . Also, it's not really related to the bot, but I have modified MediaWiki:FileUploadWizard.js to automatically add the date ... so anyone who uses the upload form to put an OTRS pending tag in place will get the date with it automatically.  --B (talk) 13:58, 31 May 2015 (UTC)
 * User:B: Instead of doing this, it may a good idea to put nowiki tags on the page. It currently looks as if the script uses a huge variety of different templates which might put the script in other unexpected categories. Nowiki would solve this. Compare with how I am doing it at User:Stefan2/common.js. --Stefan2 (talk) 16:07, 31 May 2015 (UTC)


 * Is there anything else to do for approval? --B (talk) 13:58, 31 May 2015 (UTC)

-- Magioladitis (talk) 08:10, 4 June 2015 (UTC)
 * Thanks. --B (talk) 12:21, 4 June 2015 (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.