Page MenuHomePhabricator

create "checkpage" option and global "-enable" argument
Open, HighPublic

Description

Originally from: http://sourceforge.net/p/pywikipediabot/feature-requests/312/
Reported by: @Avicennasis
Created on: 2012-06-18 05:17:33
Subject: -enable arg to all scripts
Original description:
It would be handy to have an optional -enable "Checkpage" option built into scripts by default - so that a bot can deactivated by non-admins, if so needed.


URL: https://sourceforge.net/p/pywikipediabot/feature-requests/312
See Also:
T63555: Check for new messages on wiki during bot run

Details

Reference
bz55032

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:15 AM
bzimport added a project: Pywikibot-General.
bzimport set Reference to bz55032.
Legoktm created this task.Oct 5 2013, 4:07 AM

What is the behaviour you would want/expect when 'Checkpage' is enabled?

A simple boolean value - if the arg is used, read checkpage - if 'true', continue script - if false, stop and exit script.

I know some of the scripts have a "enablePage" - but a lot of them don't.

That doesn't tell me anything about what it should do. What is 'checkpage'? What should the bot do with it? When? What should it do in which case?

Exactly what the '-enable:' parameter does in lonelypages.py - http://svn.wikimedia.org/svnroot/pywikipedia/trunk/pywikipedia/lonelypages.py

This behavior is not the same as blocking a bot by admins; it only prohibits the next start of the bot. So I am not sure if this is what you want to.

True, it is different then an admin stopping the bot via blocking, which of course would be instant. I was thinking more of implementations on cron - allowing any user to 'disable' the next run of a cronjob'd script until the BotOp is online/able to address a problem that may have arisen.

\(Alternatively, one could rewrite the -enable option to be checked every 10-25 pages, and so stop a bot from running even in 'mid-script'.\)

reflinks.py also implements a similar system ('stopPage'). It checks the latest revid (not the content), but every 20 edits.

Change 137980 had a related patch set uploaded by Ricordisamoa:
PROOF-OF-CONCEPT: check own talk, a custom page, and notifications

https://gerrit.wikimedia.org/r/137980

jayvdb added a comment.Oct 7 2014, 7:45 AM

no code to review yet

Change 137980 had a related patch set uploaded (by Ricordisamoa):
PROOF-OF-CONCEPT: check own talk, a custom page, and notifications

https://gerrit.wikimedia.org/r/137980

Change 137980 abandoned by Ricordisamoa:
PROOF-OF-CONCEPT: check own talk, a custom page, and notifications

Reason:
John Vandenberg

https://gerrit.wikimedia.org/r/137980

Ricordisamoa removed Ricordisamoa as the assignee of this task.Jul 9 2015, 11:14 AM
Ricordisamoa removed a project: Patch-For-Review.
Ricordisamoa set Security to None.
Ricordisamoa removed a subscriber: gerritbot.

Not to be seen in compat.

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 25 2015, 7:42 AM
Restricted Application added a subscriber: Cyberpower678. · View Herald TranscriptAug 14 2017, 11:01 PM
Dvorapa added a comment.EditedAug 14 2017, 11:18 PM

I think the best approach would be the one from reflinks:

user-config.py
stop_page = "User talk:MyBot"
generate_user_files.py
stop_page = "User talk:" + username
bot.py (taken from reflinks.py)
stop_page_rev_id = stop_page.latest_revision_id

...

if editedpages % 20 == 0:
    actual_rev = stop_page.latest_revision_id
    if actual_rev != stop_page_rev_id:
        pywikibot.output('Bot was interrupted by stop page!')
        return
Global arguments
-stoppage:"User:MyBot/Different Stop Page For This Job"
Cirdan added a subscriber: Cirdan.Jun 5 2018, 7:36 PM