Wikipedia:Bots/Requests for approval/TFA Protector Bot: Difference between revisions
Content deleted Content added
mNo edit summary |
m Fix Linter errors. |
||
(20 intermediate revisions by 7 users not shown) | |||
Line 1:
<noinclude>[[Category:
#A0FFA0; margin:2em 0 0 0; padding:0 10px 0 10px; border:1px solid #AAAAAA;">
:''The following discussion is an archived debate. <span style="color:red">'''Please do not modify it.'''</span> To request review of this BRFA, please start a new section at [[WT:BRFA]].'' The result of the discussion was [[File:Symbol keep vote.svg|20px|alt=|link=]] '''Approved'''{{#ifeq:yes|yes|.}}<!-- from Template:Bot Top-->
==[[User:TFA Protector Bot]]==
{{Newbot|TFA Protector Bot|}}
Line 58 ⟶ 60:
*:Alternatively, [[WP:FAP]] could be revived, cascade protected and the bot could transclude all the templates from TFA onto that page, instead of protecting each template. <strong style="font-variant:small-caps">[[User:WJBscribe|WJBscribe]] [[User talk:WJBscribe|(talk)]]</strong> 22:51, 9 May 2013 (UTC)
*::That sounds like a better idea to me. I think that we should stick to just move protection for this task, and look into using [[WP:FAP]] in another BRFA. [[User:Legoktm|Legoktm]] ([[User talk:Legoktm|talk]]) 04:21, 13 May 2013 (UTC)
*I'm hopeless at python, and I still am not used to legoktm being highlighted blue now. but I don't see any issues with this bot.—[[User:C678|<span style="color:green;font-family:Neuropol">cyberpower</span>]] [[User talk:C678|<sup style="color:olive;font-family:arnprior">Chat</sup>]]<sub style="margin-left:-4.4ex;color:olive;font-family:arnprior">Online</sub> 03:17, 10 May 2013 (UTC)
I reviewed the code, and I have the following comments/questions:
Line 64 ⟶ 66:
# I see the bot is supposed to run at 5 minutes before midnight. If this is somehow delayed, it looks like the bot will skip today and go protect tomorrow's FA instead.
# What happens if the listed FA title happens to be a redirect? Will it move-protect the page or the redirect? For that matter, what makes sense for it to do there? Off the top of my head, it seems that move-protecting the page and both move- and edit-protecting the redirect would make the most sense.
# I note the query you are performing will set the protections to just move protection, removing any other protection (e.g. edit protection). This is obviously not right. <small>While {{
# I wonder if the bot should try to restore the old move semi-protection after the page is off the main page.
Item #4 is a blocking problem. HTH. [[User:Anomie|Anomie]][[User talk:Anomie|⚔]] 12:32, 13 May 2013 (UTC)
Line 88 ⟶ 90:
:# Hrm. Ok.
: [[User:Anomie|Anomie]][[User talk:Anomie|⚔]] 10:47, 5 June 2013 (UTC)
::1. Seems I had this fixed locally, just never pushed to github.
::3. Implemented. Though, the bot should probably re-instate edit semiprotection if it existed on the redirect...
::4. Done as well. It seems some pages (noticed it on the main page) have "aft" protection, so will be useful. Any protection entry with the 'source' key is just ignored, and anything with 'cascade' will cause &cascade=1 to be set.
::[[User:Legoktm|Legoktm]] ([[User talk:Legoktm|talk]]) 08:11, 26 June 2013 (UTC)
::: Ok, new review (of [https://github.com/legoktm/tfa-protector-bot/blob/fc3c372f4c6c0105b5c8e1b6c506b730471f7a89/TFAdefenderbot.py this version]):
:::# It looks like do_page() will reach the end of the function without returning any specific value if the page is not a redirect and should_we_protect() returns a falsey value. That would prematurely terminate the loop in main().
:::# You're using p_status rather than real_p_status when calling should_we_protect() on the redirect target.
:::# Err... You're passing the date instead of p_status when calling protect() in the non-redirect case?
:::# Your loop in prot_status should be where protections with 'source' set are ignored. As it is, a direct protection may be overwritten with a 'source' protection if the page is protected both directly and by cascading.
:::# Does the + operator instead of .append() on lines 70-71 do the right thing?
:::# As mentioned, it would be good to re-set an overridden edit semi-protection on the redirect after the TFA protection expires.
::: Something good for preliminary testing would be to comment out lines 72-74 (the actual submission of the action=protect query) and instead just print params, to make sure the rest of the bot runs correctly (I do this sort of thing with pretty much every change I make to any of AnomieBOT's tasks). Good also would be to somehow feed in test pages to make sure all the code paths in do_page and its sub-functions are hit. [[User:Anomie|Anomie]][[User talk:Anomie|⚔]] 12:07, 26 June 2013 (UTC)
A long time ago [[User:east718|east]] used to run a bot under his main account to do this (as you [https://en.wikipedia.org/w/index.php?title=Special%3ALog&type=protect&user=East718&page=&year=&month=-1&tagfilter=&hide_patrol_log=1&hide_review_log=1 can see] he didn't even bother to hide it), it'll be nice to get an approved bot doing this.
@[[User:Legoktm|Legoktm]] any progress on #3 and 4? Apart from those I'm happy to approve the bot for a trial. --[[User_talk:Chris G|<span style="color:Green; font-weight: bold;">Chris</span>]] 13:02, 24 June 2013 (UTC)
:Responded above. [[User:Legoktm|Legoktm]] ([[User talk:Legoktm|talk]]) 08:11, 26 June 2013 (UTC)
*Ooh, this new (to me me at least :P) notification feature is cool. I uploaded the source code for my old bot [[user:east718/tfabot|here]], maybe you can crib some ideas like IRC notifications or move vandalism done shortly before the protection cronjob. I know for sure that questions #3 and #4 are accounted for in my bot, I learned those mistakes the hard way. Be aware that my code is uncommented, messy (and that's being charitable), and was built on top of a fork of a now five year old version of pywikipedia. Good luck with your bot. <span style="white-space:nowrap">— [[user:east718|<
**Thanks! If the bot protects as soon as the page is selected, it should reduce the chance of page-move vandalism, but a separate IRC bot notifying that it was recently moved is a good idea. I'll try and write a bot to do that soon. [[User:Legoktm|Legoktm]] ([[User talk:Legoktm|talk]]) 08:11, 26 June 2013 (UTC)
{{tlx|OperatorAssistanceNeeded|D}} Is this still an active bot request or has this gone stale? [[User:Hasteur|Hasteur]] ([[User talk:Hasteur|talk]]) 18:58, 31 July 2013 (UTC)
:I haven't had time to work on it lately, but I'll try and get it done during Wikimania. [[User:Legoktm|Legoktm]] ([[User talk:Legoktm|talk]]) 03:42, 1 August 2013 (UTC)
{{tl|OperatorAssistanceNeeded|D}} Poking again. Wikimania has come and gone. Active/Stale? [[User:Hasteur|Hasteur]] ([[User talk:Hasteur|talk]]) 23:41, 19 September 2013 (UTC)
The dropdown list of protection reasons now includes "Forthcoming TFA" which might help - what I've been doing recently is adding a wikilink to the TFA blurb for that date/article in the "other/additional reason" field, which might be a useful habit for the bot to copy. [[User:Bencherlite|Bencherlite]][[User talk:Bencherlite|<i><sup>Talk</sup></i>]] 10:30, 15 October 2013 (UTC)
▲*Ooh, this new (to me me at least :P) notification feature is cool. I uploaded the source code for my old bot [[user:east718/tfabot|here]], maybe you can crib some ideas like IRC notifications or move vandalism done shortly before the protection cronjob. I know for sure that questions #3 and #4 are accounted for in my bot, I learned those mistakes the hard way. Be aware that my code is uncommented, messy (and that's being charitable), and was built on top of a fork of a now five year old version of pywikipedia. Good luck with your bot. <span style="white-space:nowrap">— [[user:east718|<font color="#000">east718</font>]] | [[user talk:east718#top|<font color="#000">talk</font>]] | 15:29, 24 June 2013 (UTC)</span>
:{{tlx|OperatorAssistanceNeeded|D}} So, here we are six months on. Done yet? [[User_talk:Josh Parris|Josh Parris]] 11:21, 5 November 2013 (UTC)
::I did a dry run and everything worked fine. Could I get a trial to run on my main account? [[User:Legoktm|Legoktm]] ([[User talk:Legoktm|talk]]) 05:06, 10 November 2013 (UTC)
===Trial===
{{BotTrial|days=5}} Naturally, report mishaps. Complain if trial parameters are unsuitable. [[User_talk:Josh Parris|Josh Parris]] 06:48, 10 November 2013 (UTC)
:Thanks. [[User:Bencherlite|Bencherlite]], when you queue up the next set of TFA's could you not protect them and ping me so I can run the script? [[User:Legoktm|Legoktm]] ([[User talk:Legoktm|talk]]) 18:36, 13 November 2013 (UTC)
::Will do. [[User:Bencherlite|Bencherlite]][[User talk:Bencherlite|<i><sup>Talk</sup></i>]] 18:41, 13 November 2013 (UTC)
:::I note that according to [[Special:Log/TFA_Protector_Bot]] nothing has happened in the past week. What's the cause? [[User_talk:Josh Parris|Josh Parris]] 22:37, 20 November 2013 (UTC)
::::The bot doesn't have admin powers (yet) so I'm not surprised that log is empty - I assume that {{u|Legoktm}} will be protecting the couple of TFAs I've scheduled in the last couple of days by running the script through his own account before he seeks +bot+sysop for the bot. [[User:Bencherlite|Bencherlite]][[User talk:Bencherlite|<i><sup>Talk</sup></i>]] 22:44, 20 November 2013 (UTC)
{{BotTrialComplete}}...or close enough. [[Operation Crossroads]] and [[Ambohimanga]] were protected. Some things I noticed and had to accommodate for:
*Template:TFA title/ subpages are created by AnomieBOT II and may not exist even if the TFA has been scheduled. The bot now falls back upon WP:TFA/ subpages and uses the same regexes as AnomieBOT to determine the page title.
*If a TFA is missing, the bot will look at least 35 days in the future from today before stopping.
[[User:Legoktm|Legoktm]] ([[User talk:Legoktm|talk]]) 17:58, 21 November 2013 (UTC)
A trusted operator, with a useful and uncontroversial task. {{BotApproved}} Seriously. [[User_talk:Josh Parris|Josh Parris]] 20:56, 21 November 2013 (UTC)
:''The above discussion is preserved as an archive of the debate. <span style="color:red">'''Please do not modify it.'''</span> To request review of this BRFA, please start a new section at [[WT:BRFA]].''<!-- from Template:Bot Bottom --></div>
|