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.
((OperatorAssistanceNeeded|D))
Any progress? Primefac (talk) 15:38, 10 November 2020 (UTC)[reply]
Approved. Primefac (talk) 01:27, 16 November 2020 (UTC)[reply]