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

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:15 AM
bzimport set Reference to bz55032.

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?

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

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 a project: Patch-For-Review.
Ricordisamoa set Security to None.
Ricordisamoa removed a subscriber: gerritbot.

Not to be seen in compat.

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"