Wikipedia:Bots/Requests for approval/MajavahBot


 * 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

MajavahBot
Operator:

Time filed: 09:02, Saturday, November 23, 2019 (UTC)

Automatic, Supervised, or Manual: automatic

Programming language(s): Python

Source code available: https://github.com/supertassu/majavahbot

Function overview: This bot will patrol WP:EFFPR and automatically 1) add messages such as "User blocked" and "Private filter" from, 2) add or fix typos or formatting in filter title in reports and 3) archive old reports.

Links to relevant discussions (where appropriate): Edit filter/Noticeboard

Edit period(s): Continuous

Estimated number of pages affected: WP:EFFPR + archive page

Exclusion compliant (Yes/No): Yes

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

Function details: Using EventStreams, the bot will listen to changes on the false positive page, and automatically clerks the reports. Some checks (filter private, task name) are only ran when a new report is added and some (archive, user blocked) are ran after every edit to the page.

About the archiving function: Similar to RFPP, the bot will maintain a rolling archive of 25 (configurable) last reports on a separate page. All reports older will be hidden in page histories. Reports will be archived based on when the last comment was posted, and comments posted on the report can be used to change the delay (for example, if template is used, the report will be archived in 1h after the reply instead of 48h which is used as a default).

Discussion

 * I see that that noticeboard is currently archived by Lowercase sigmabot III. I am a little unsure what add or fix typos or formatting in filter title in reports means; can you clarify? Jo-Jo Eumerus (talk) 13:25, 23 November 2019 (UTC)
 * The noticeboard is currently archived by Sigmabot, however it isn't very great at the reports page (more reasoning in discussion linked above). The fixing filter title in reports means that if the user creating a report there either does not fill in title of the affected page at all or if there's an obvious mistake (capitalization in later chars or directly pasting in page URL instead of name) in the report, the bot will correct that. Regards, Majavah (t/c) 14:03, 23 November 2019 (UTC) (typo fixed at 21:09, 23 November 2019 (UTC))
 * BAG assistance needed I'm requesting BAG assistance as it's been over a week since the last reply. Majavah (t/c) 08:06, 3 December 2019 (UTC)
 * For this trial, have the bot make edits to a subpage in its user space; archives should go to another subpage. This way we can tell if the bot works without potentially messing with the main EFFPR page. Code looks good to me; interesting strategy to make a Pywikibot wrapper. The field  in database.py looks a bit suspicious to me, but it'll probably be fine. Thank you for writing this bot! Enterprisey (talk!) 18:17, 3 December 2019 (UTC)
 * Great, I'll start the trial at tomorrow as I'm having some issues with Toolforge's job engine (most likely user error). And yes,  in database.py is really hacky, however it works(TM) and it does not keep a database connection open when not necessary to comply with replica database guidelines on wikitech. --Majavah (t/c) 19:12, 3 December 2019 (UTC)
 * , good to hear. And one more thing: the bot's configuration page, being currently semi-protected, is of course editable by any autoconfirmed user. That's not ideal, so it should be moved to a JSON contentmodel (ie the page title should end in .json) so that only the bot account (and interface admins) can edit it. Enterprisey (talk!) 00:32, 4 December 2019 (UTC)
 * Note: any admin can edit user json pages. Also, moving it to a .json page wouldn't change the content model; it would need to be recreated DannyS712 (talk) 01:45, 4 December 2019 (UTC)
 * I've corrected my comment (thanks for pointing that out), and yeah, I'll change the content model when it gets moved. Enterprisey (talk!) 02:14, 4 December 2019 (UTC)
 * which would mean that the bot op cannot edit the config - maybe ecp protection? DannyS712 (talk) 02:23, 4 December 2019 (UTC)
 * The bot op could still log in using the bot account. Alternatively, and this is probably a better idea, the bot op could put it in their own userspace. Enterprisey (talk!) 02:27, 4 December 2019 (UTC)
 * This was discussed on the edit filter noticeboard (Edit_filter_noticeboard), and it was agreed that it should be possible for at least edit filter managers to adjust the config without bugging me. Majavah (t/c) 07:07, 4 December 2019 (UTC)
 * Also, I've started the trial, and on the database it's marked to end at 2019-12-11 07:27:28 UTC. Majavah (t/c) 07:53, 4 December 2019 (UTC)
 * I fixed a few edge cases in the beginning. Majavah (t/c) 17:59, 11 December 2019 (UTC)
 * Will get to reading through the contribs in the next few days; sorry for the delay. Enterprisey (talk!) 06:47, 19 December 2019 (UTC)
 * I see the bot's made five edits to the report page (and two to the archive) all of which look good. Bugs - if any - are more likely to show up with a slightly longer run that includes more edits, so approved for a trial of 50 edits or 30 days, whichever comes first. This is just me being a little cautious because the bot will be editing alongside humans (especially new users & IPs). Very sorry for the extended delay; my schedule has taken a turn for the better, so I expect to be much more responsive this year. Enterprisey (talk!) 07:00, 2 January 2020 (UTC)
 * Also, for the trial, it would be nice if you would run the bot on the live EFFPR content (so it would get the actual reports), but instead of saving the page to EFFPR it would save to the trial page you've created. Enterprisey (talk!) 07:03, 2 January 2020 (UTC)
 * By "run the bot on the live EFFPR content (so it would get the actual reports), but instead of saving the page to EFFPR it would save to the trial page you've created", do you mean that the bot will listen on changes on the actual page but save (not read) to the test page? Majavah (t/c) 09:41, 2 January 2020 (UTC)
 * , yes, precisely. Enterprisey (talk!) 06:48, 5 January 2020 (UTC)
 * Great, thanks. I've started the trial, it will write to User:MajavahBot/EFFP Helper Test/Report page and archive to User:MajavahBot/EFFP Helper Test/Rolling archive page. Majavah (t/c) 10:14, 5 January 2020 (UTC)
 * . The bot got confused a couple of times because some threads were present both in the archive and on EFFPR. Majavah (t/c) 14:53, 7 January 2020 (UTC)
 * Ok, I've been reading through the bot's edits. Some notes:
 * Just looking at the very final edit made by the bot, it looks like the "pagenameadded" message was inserted even though the page title in the original seemed to be there. I don't immediately see anything wrong with the code (i.e. the specified config's regex seems to have a match in the original report). Feel free to keep testing in the bot's userspace as much as you want, since BOTPOL says nothing about that.
 * Actually, the "add missing page" seemed to work pretty well here (compare original), so great job with that.
 * The code seems to assume that reports were always made on the reporter's most recent flagged edit. Probably a reasonable assumption.
 * 1 hour for archives seems pretty short. The test report page was much shorter than EFFPR - in fact, the test report page seemed to contain at most one report most of the time. Might be a bug. I feel like the humans working on EFFPR will be a bit surprised at first that the page got so much shorter; perhaps try to keep the length of the test report page about the same length as EFFPR? (this may require a really long archive length, I don't know)
 * The edit summaries are very long, and should be much shorter. I would suggest something like "archived X sections and modified Y sections", and/or the current status of the page (much like the summaries used by the AIV clerk bot).
 * I found the "add missing page" edit by searching the summaries for the string "task 1a". I haven't yet found an example of the other parts (detection of blocks or private filters) working. If you know for certain that they worked in a certain edit feel free to link them here.
 * Generally, great stuff so far, and please run the bot again for about 3-4 days or so (or 50 edits) once these issues are resolved one way or another. Enterprisey (talk!) 05:10, 10 January 2020 (UTC)
 * (and a ping: ) Enterprisey (talk!) 05:11, 10 January 2020 (UTC)
 * I would support having easily configurable archiving times at Edit_filter/False_positives/Reports/Archive_config or something. It will likely take some tweaking to find what is appropriate for each type of result which would be faster if anyone can modify it. ‑‑Trialpears (talk) 08:14, 10 January 2020 (UTC)
 * Hi folks, I'll be really busy the following weekend, but anyways I wanted to comment on your points:
 * I have no idea about that one edit adding page name when it's already there, so I'll do some investigative work.
 * The edit summaries are very long as it's "archiving" most reports on every edit. I'll condense them, even thru that will most likely not be a problem when it's reading and writing to same page.
 * Yes, the page is short, it's not a bug. EFFPR is not a busy noticeboard. Most reports are (with current config) kept for an hour or two after being handled, and personally I think old handled reports should not be kept there extended times.
 * Special:Diff/934238209 seems to be a case where a filter was private but it wasn't notified. Will investigate.
 * For blocked notices, there's a design issue: as the bot only edits after the page was edited by someone else, the user needs to be blocked before someone adds new report without a human adding blocked notice, I don't think that happened in this trial (I don't think there even was a blocked notice at all during that time)
 * For there already is: User:MajavahBot/EFFP Helper Configuration
 * (also ping ) Majavah (t/c) 14:54, 10 January 2020 (UTC)
 * , feel free to run the bot for about 3-4 days or 50 edits on your own userspace once you're satisfied that the bugs and stuff have been worked out. No need to formally approve for trial because the bot's only editing its own userspace. I think once that goes well we can either approve outright or approve for a trial where the bot edits EFFPR directly. Enterprisey (talk!) 02:15, 23 January 2020 (UTC)
 * Hi, and thanks for the reminder. I've been busy with life, I think I'll have time for this today or tomorrow. Majavah (t/c) 07:12, 23 January 2020 (UTC)
 * Mystery solved. This is awkward. Majavah (t/c) 11:32, 25 January 2020 (UTC)
 * Hi  Did another run of 50 edits and everything seems to be working as intended. "Blocked" message is seen at Special:Diff/937528087 (original edit at Special:Diff/937528061, where template was used incorrectly). Majavah (t/c) 18:37, 28 January 2020 (UTC)
 * , hmm, minor issue: that diff (937528087) doesn't look very clean in the wikitext. Would it be possible to fix up the template so that it wouldn't produce the big switch statement and instead produce the message directly? Enterprisey (talk!) 04:35, 3 February 2020 (UTC)
 * That switch statement was added by the user making the edit, not the bot. I believe they substed the template. Majavah (t/c) 10:18, 3 February 2020 (UTC)
 * I've Unsubstified EFFP so this shouldn't happen again. ‑‑Trialpears (talk) 10:28, 3 February 2020 (UTC)
 * BAG assistance needed. Majavah (t/c) 06:52, 10 February 2020 (UTC)
 * Looks good! Enterprisey (talk!) 05:29, 6 March 2020 (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.