coren has uploaded a new change for review.

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

Change subject: Replicas: include a restricted watchlist view
......................................................................

Replicas: include a restricted watchlist view

Groups by page, and provides count of watchers.

Bug: T59617
Change-Id: I8ae21b0682b361bbea4beca7b86c804d37e5c276
---
M maintain-replicas/maintain-replicas.pl
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software 
refs/changes/18/225218/1

diff --git a/maintain-replicas/maintain-replicas.pl 
b/maintain-replicas/maintain-replicas.pl
index c798f2f..3ff297a 100755
--- a/maintain-replicas/maintain-replicas.pl
+++ b/maintain-replicas/maintain-replicas.pl
@@ -318,6 +318,10 @@
                     up_property, up_value',
         'where' => 'user_id=up_user and up_property like pw_property', },
 
+    'watchlist_counts' => {
+        'source' => 'watchlist',
+        'view'   => 'select count(*) as wl_count, wl_namespace, wl_title',
+        'group'  => 'wl_namespace, wl_title having wl_count >= 30', },
 );
 
 my $dbuser;
@@ -526,6 +530,7 @@
                . $customviews{$view}->{'view'}
                . " FROM " . join(',', @sources);
             $q .= " WHERE " . $customviews{$view}->{'where'} if defined 
$customviews{$view}->{'where'};
+            $q .= " GROUP BY " . $customviews{$view}->{'group'} if defined 
$customviews{$view}->{'group'};
             $q =~ s/\s+/ /g;
             $q .= ";";
             sql($q);

-- 
To view, visit https://gerrit.wikimedia.org/r/225218
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8ae21b0682b361bbea4beca7b86c804d37e5c276
Gerrit-PatchSet: 1
Gerrit-Project: operations/software
Gerrit-Branch: master
Gerrit-Owner: coren <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to