Commons:Bots/Requests/HersfoldOTRSBot

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

HersfoldOTRSBot

Operator: Hersfold (talk/work)

Bot's tasks for which permission is being sought: HersfoldOTRSBot will go through Category:OTRS pending in search of files that have not received OTRS confirmation in over 30 days. These will have their {{OTRS pending}} tags removed and replaced with {{subst:nopd}} for deletion in 15 days. The bot will then notify uploaders of these images with {{subst:Noticket}}.

Automatic or Manually Assisted: Automatic. The bot will run automatically after being manually logged in; anything the bot can't handle is reported back to the operator for manual review.

Edit type (e.g. Continuous, daily, one time run): Roughly daily when I'm online

Maximum edit rate (eg edits per minute): Default for Wiki.java; I believe this is 1 edit per 10 seconds.

Bot flag requested: (Y/N): Yes.

Programming Language(s): Java, using MER-C's Wiki.java class

Rjd0060 should be by shortly with some more information about this request. Hersfold (talk/work) 19:02, 4 June 2009 (UTC)[reply]

Discussion

  •  Support There have been a couple of discussions about getting this done and we're finally ready, which is great. The first discussion was back in March (see here and the process was agreed to, just never implemented). The second discussion was restarted at Commons:OTRS/Noticeboard#Category:OTRS pending and was "advertised" at the Village pump and the administrators noticeboard. We should be all set to go now, pending this bots approval. The task is extremely tedious and this bot is very much needed. The current backlogs are quite large. Thanks. - Rjd0060 (talk) 19:12, 4 June 2009 (UTC)[reply]
  • This kind of feature is indeed needed, and the procedure described here is what has been agreed upon on the local OTRS noticeboard. I think it would be nice if the bot could list or categorise somewhere (in a unique page or cat), the overdue files (nopd + 15 days). Take it as a feature suggestion for now or the future. --Eusebius (talk) 20:23, 4 June 2009 (UTC)[reply]
The bot will add Template:No OTRS permission since tag to the image page (by using {{subst:nopd}}), which will automatically add files to Category:No OTRS permission after 15 days (some sort of template magic does this - the page won't actually be in the category until 15 days passes). - Rjd0060 (talk) 21:00, 4 June 2009 (UTC)[reply]
Sounds nice. --Eusebius (talk) 21:03, 4 June 2009 (UTC)[reply]
  • This will indeed be very useful. Can you find two or three example files and make a test run? --MichaelMaggs (talk) 20:26, 4 June 2009 (UTC)[reply]
    I've made some tests on testwiki already, and they seem to have performed well. I can do a live trial run with some of the files currently due for this process if you'd like; the bot has a feature where it'll do a given number of edits and then stop itself. I'm not sure how approvals work here, though - do I need some sort of green light to do a live test? Hersfold (talk/work) 21:21, 4 June 2009 (UTC)[reply]
    MichaelMaggs is a bureaucrat and they are the ones who act on these requests. You should probably go ahead and run the bot on a few images (at least I think that is what he requested - could be wrong). - Rjd0060 (talk) 21:23, 4 June 2009 (UTC)[reply]
    Oh, alright then. I'll set the bot up for a test to process three images (six edits; the bot will pick which files, although it'll probably the first three alphabetically in the oldest category), but I will not run the test until I'm sure that's what I'm supposed to be doing. Hersfold (talk/work) 21:34, 4 June 2009 (UTC)[reply]
    Since I'm going to be away from the computer this weekend, I'm going to go ahead and run the test now; the bot is set to process three images, making a total of six edits. This will tag the images for deletion and notify the uploaders. I'll post the results of the test here and in the bot's userspace once complete. Hersfold (talk/work) 03:54, 5 June 2009 (UTC)[reply]
First test failed; the bot hit a null pointer while gathering the list of files and blew up. It got through several dozen categories, though, so not sure what caused it yet. Hersfold (talk/work) 04:06, 5 June 2009 (UTC)[reply]
Problem has been tracked to Category:OTRS pending as of 5 May 2009; not sure what the exact problem is just yet, but it's especially baffling because my tests included a category by that same name. Hersfold (talk/work) 04:23, 5 June 2009 (UTC)[reply]
Since the program seems to work as expected in debug mode, I assume this is a timing error. I'm now going to run version 0.2.2beta, which has a time delay of half a second built in between every category. This should make the server happier, as well as give the bot time to think. Hopefully it'll work. Hersfold (talk/work) 04:31, 5 June 2009 (UTC)[reply]
That didn't work either; I'm going to keep working on this, and will let you know when the test is successful. Hersfold (talk/work) 04:55, 5 June 2009 (UTC)[reply]
I've kept working on this, and talked to someone else; from what we've done and what the bot is doing, he's convinced Java is doing something it's not supposed to be doing with memory, which is causing it to overwrite something, get a null pointer, and crash. Basically, the backlog is too big for the bot to handle all at once (even though it's only going to process three files this test run, it still pulls the entire list). Hoping that is in fact the case, I've set the bot to now only deal with 50 categories worth of files during a single run. The current backlog is 157 categories, so it'll need to be run four times to get that cleared, but I figure that's better than crossing fingers and hoping it doesn't crash.
An editing trial run with these conditions will be run shortly. Hersfold (talk/work) 15:55, 5 June 2009 (UTC)[reply]
Test failed again, this time for a different reason. Results of both tests are posted at User:HersfoldOTRSBot/Operation logs. Hersfold (talk/work) 16:21, 5 June 2009 (UTC)[reply]
I've fixed the bug - it wasn't anything to do with my code, rather Wiki.java was double-encoding a query when it shouldn't have been. User:Ninù's username made the bot explode as a result. It's fixed, and now should be fully functional. I can run another trial if desired. Hersfold (talk/work) 16:49, 5 June 2009 (UTC)[reply]
Was this (where the bot was using )) instead of }}) fixed as well? - Rjd0060 (talk) 17:24, 5 June 2009 (UTC)[reply]
Yes, that's been corrected in the program. Hersfold (talk/work) 19:44, 5 June 2009 (UTC)[reply]

Thanks for the trials. As Rjd0060 suggested above, I was asking for a few "live" tests, so we can check that everything looks OK on the logs. All looks good to me now, and unless anyone has any comments I will grant the bot flag on Sunday. I might just tweak the wording that's being left on the uploader's page, though. Hope that's OK. --MichaelMaggs (talk) 20:33, 5 June 2009 (UTC)-[reply]

Go right ahead, of course. The template is at Template:Noticket. - Rjd0060 (talk) 00:45, 6 June 2009 (UTC)[reply]
I have made the tweaks. --MichaelMaggs (talk) 11:03, 6 June 2009 (UTC)[reply]

✓ Done. Approved and bot flag granted. --MichaelMaggs (talk) 09:05, 7 June 2009 (UTC)[reply]

Thanks! I'll be sure to keep a close eye on it the first few runs to knock out any remaining problems. Hersfold (talk/work) 17:53, 7 June 2009 (UTC)[reply]
This seems a very important task and the templates being used seem quite thorough. Normally we like to wait a few more days before flagging, though, but no worries I guess. ++Lar: t/c 20:15, 7 June 2009 (UTC)[reply]
The edits aren't being marked as bot edits right now, by the way (I'm not sure why). Everything does seem to be working fine though. As you say, the templates are very clear and give good instruction on how to resolve the issues. - Rjd0060 (talk) 20:20, 7 June 2009 (UTC)[reply]