Wikipedia:Bots/Requests for approval/FireflyBot II


 * The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at Bots/Noticeboard. The result of the discussion was

FireflyBot II
Operator:

Time filed: 17:28, Monday, March 15, 2021 (UTC)

Automatic, Supervised, or Manual: automatic

Programming language(s): Python

Source code available: https://github.com/rwjuk/pcr_bug_bot

Function overview: Accept edits from autoconfirmed editors that have become stuck in the pending changes queue because of T275322.

Links to relevant discussions (where appropriate): this BOTREQ thread, prompted by this VPT thread

Edit period(s): Continuous, once a minute maximum

Estimated number of pages affected: Unknown

Exclusion compliant (Yes/No): Not applicable

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

Function details: Owing to a bug/bugs with FlaggedRevs (see T275322), the MediaWiki extension that handles pending changes, edits from (auto)confirmed editors that should be automatically accepted are sometimes left in the pending queue.

This prompted a BOTREQ to create a bot to accept these edits, as they do not (according to how PC is intended to work on enwiki) require human review and would have been automatically accepted were FlaggedRevs not buggy. I will write up an explanation of this and some 'frequently expected questions' in the bot's userspace and link to it along with the BRFA in the acceptance summary.

Assuming this BRFA passes, the bot account will need, but probably won't need   (hence the separate account given 'advanced' permissions are needed). I intend to run it on toolforge - kicking off a run once a minute. If a previous run is still running after 60 seconds, a second instance will not be started.

Discussion

 * Can you do a test in a dry-run mode to log edits the bot would approve, over the course of a few hours or so? —&#8239; The Earwig (talk) 19:29, 15 March 2021 (UTC)
 * That would be easy enough - I’ll have it log to a userspace page tomorrow. ƒirefly  ( t · c ) 20:28, 15 March 2021 (UTC)
 * Logging revisions that the bot would accept here. ƒirefly  ( t · c ) 14:22, 16 March 2021 (UTC)
 * Two questions about behavior:1. The SQL in  does not seem to enforce that edits by auto-acceptable users are contiguous with the most recently accepted revision; i.e., the bot will accept revisions that follow an unreviewed revision incorrectly. An example from your log is 1012696596; there are unreviewed IP edits before this one that should not be accepted.2. Your permission check is based on the groups the user has when the bot examines the edit, not when the edit was made. Since the bot is constantly reexamining the same pending edits until they are accepted—which could take hours—I think it's possible a user will become autoconfirmed and the bot will accept their pending changes inappropriately?—&#8239; The Earwig (talk) 05:00, 18 March 2021 (UTC)
 * Good catch on both of those - I hadn't considered the possibility of users becoming autoconfirmed in the time while their edit sits in the queue. An edge case, but one we should absolutely handle.  ƒirefly  ( t · c )
 * Code now reworked to (a) walk the revision chain up from the last accepted revision, stopping when it encounters a revision by a non-autoconfirmed user, and (b) store all revisions that the bot has "seen" and only check them once, that way if a user becomes autoconfirmed while their edits are in the PC queue, the bot won't wrongly accept them. Public source code update TBD. ƒirefly  ( t · c ) 19:41, 27 March 2021 (UTC)
 * Reviewer granted on the bot account. Ready for real-world testing when you are. To state the obvious, keep a careful eye on the bot's operation to make sure things are going as expected. —&#8239; The Earwig (talk) 05:16, 29 March 2021 (UTC)
 * Trial running, will keep an eye on it as you say. ƒirefly  ( t · c ) 14:04, 2 April 2021 (UTC)
 * - the log of revisions accepted is here, and also of course here. ƒirefly  ( t · c ) 13:35, 10 April 2021 (UTC)
 * Thanks. The accepts all look good to me. Two questions: the log entries all have an unusual tag mentioning quality example (I see "⧼revreview-hist-quality⧽" instead of "accepted revision") and why was nothing accepted after 19:07 7 April (and only two items on that day?) Can you post the updated code? —&#8239; The Earwig (talk) 05:22, 11 April 2021 (UTC)
 * I can answer the first of those questions, thats because of a bug in FlaggedRevs. Basically thanks to a bug the default behavior was switched to accepting changes as quality and then that entire part of the code was deleted as a part of T277883 which is causing these tags to appear. The relevant tasks are T278904 (changes are being marked as quality) and T279761 (⧼revreview-hist-quality⧽ is shown). TL/DR: FlaggedRevs issue nothing to do with the bot.  Asartea  Talk  undefined  Contribs  16:41, 11 April 2021 (UTC)
 * Asartea has answered the first question, as for why no acceptances after 1907 on April 7 - not sure! It's entirely possible that the work being done on FlaggedRevs has either ameliorated or completely fixed this bug, hence there were no revisions that needed accepting. As for the source code, I will happily post it once I've fished it out of my backups tomorrow. Lesson here - don't sleepily  the wrong blasted repo. Once I've got the code back where it belongs I'll keep the bot logging in userspace - it's possible it won't be needed if the bug has been fixed.  ƒirefly  ( t · c ) 16:51, 11 April 2021 (UTC)
 * OK, thanks. Let's do that to make sure there's still an issue, and if so, I will approve it. —&#8239; The Earwig (talk) 17:43, 11 April 2021 (UTC)


 * Code now available here, bot logging in userspace once again. ƒirefly  ( t · c ) 12:52, 14 April 2021 (UTC)


 * Looks like you have a bug in your SQL on line 44: your WHERE clause should be filtering on  instead of  . Also consider using parameterized queries instead of string interpolation, even though they're integers. Despite this, the bot's log indicates the issue is still present, so:  —&#8239; The Earwig (talk) 00:07, 15 April 2021 (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 Bots/Noticeboard.