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

Operator: DannyS712 (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)

Time filed: 10:26, Sunday, July 26, 2020 (UTC)

Automatic, Supervised, or Manual: automatic

Programming language(s): Javascript

Source code available: Not written yet

Function overview: Automatically unpatrol pages created by global rollbackers

Links to relevant discussions (where appropriate): Wikipedia_talk:New_pages_patrol/Reviewers/Archive_37#Autopatrol_and_global_rollback

Edit period(s): Continuous

Estimated number of pages affected: Likely no more than a handful per day

Exclusion compliant (Yes/No): No

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

Function details: See Wikipedia talk:New pages patrol/Reviewers#Autopatrol and global rollback. Users with global rollback that create pages here on enwiki are autopatrolled. For those users that lack local autopatrol, automatically un-patrol the pages that they create that are in the page curation system, so that they can be reviewed normally.

Pages to unpatrol will be fetched from the replicas using the query below. This filters for pages that last had their review status changed by global rollbackers where

/* Value for pagetriage_page.ptrp_reviewed for autopatrol */
SET @autopatrol_status = 3;

/* Value for global_user_groups.gug_user for global rollbackers */
SET @global_group = 'global-rollbacker';

SELECT
	pg.page_id AS 'Target page id',
    gu.gu_name AS 'Creator (name)',
    a.actor_user AS 'Creator (user id)',
    ptrp.*,
    pg.*
FROM centralauth_p.global_user_groups gug
JOIN centralauth_p.globaluser gu
	ON gu.gu_id = gug.gug_user
JOIN actor a
	ON a.actor_name = gu.gu_name
JOIN pagetriage_page ptrp
	ON ptrp.ptrp_last_reviewed_by = a.actor_user
JOIN page pg
	ON pg.page_id = ptrp.ptrp_page_id
WHERE gug.gug_group = @global_group

/* Global rollbackers can be new page reviewers, only care about pages that they autopatrolled */
AND ptrp.ptrp_reviewed = @autopatrol_status

/* The focus is on articles, global rollbackers can be trusted not to abuse user pages */
AND pg.page_namespace = 0

/* Global rollbackers can also be locally autopatrolled. Exclude users in the relevant local groups */
AND NOT EXISTS (
	SELECT 1
	FROM user_groups ug
	WHERE ug.ug_user = a.actor_user
	AND ug.ug_group IN ('autoreviewer', 'sysop')
)

Testing the query correctly flagged some recent pages I and other global rollbackers created.

Discussion

[edit]
@DannyS712: to unpatrol a page we need phab:T22399.--GZWDer (talk) 10:52, 30 July 2020 (UTC)[reply]
@GZWDer: Not with page curation - that is for rc patrolling. See https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/includes/Api/ApiPageTriageAction.php DannyS712 (talk) 10:53, 30 July 2020 (UTC)[reply]
Approved for trial (25 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. And yes, I realize these aren't "edits", but please post the log of un-patrols here when complete. Primefac (talk) 22:06, 2 August 2020 (UTC)[reply]
Will do. Unfortunately, the replicas are currently lagging, so it might be a bit before I can do this DannyS712 (talk) 22:08, 2 August 2020 (UTC)[reply]
Update - haven't gotten to this yet due to some other commitments, but I should be able to do it soon DannyS712 (talk) 05:21, 18 August 2020 (UTC)[reply]

((OperatorAssistanceNeeded|D)) Any progress? Primefac (talk) 15:38, 10 November 2020 (UTC)[reply]

Sorry, kind of forgot about this. Will try to do soon DannyS712 (talk) 16:36, 10 November 2020 (UTC)[reply]
@Primefac so I wrote the code, but running it a single time would result in unpatrolling 31 different pages, since that is the current number still in the page triage queue - is it okay to do a full run, or should I figure out how to add limits? The bot will be reporting the pages to unpatrol at User:DannyS712 bot III/Unreviewed.json, and since I ran it once in dry mode you can see the 31 pages that would be unpatrolled in such an initial run. Thanks, --DannyS712 (talk) 02:08, 11 November 2020 (UTC)[reply]
That's fine, rather have more data than less. Primefac (talk) 18:15, 11 November 2020 (UTC)[reply]
Trial complete. 31 pages unreviewed, see [1] DannyS712 (talk) 18:27, 11 November 2020 (UTC)[reply]
@DannyS712: This query is using cross-database joins, which I guess will no longer work soon – see wikitech:wiki/News/Wiki_Replicas_2020_Redesign & phab:T260389. – SD0001 (talk) 18:46, 11 November 2020 (UTC)[reply]
Hmm, I'll have to figure that out eventually, but at least for now it should work for a few months DannyS712 (talk) 18:50, 11 November 2020 (UTC)[reply]
Please get to work on that. Primefac (talk) 01:27, 16 November 2020 (UTC)[reply]

 Approved. Primefac (talk) 01:27, 16 November 2020 (UTC)[reply]

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 Wikipedia:Bots/Noticeboard.