[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceSkin[REL1_27]: Updated scrollToTop with new icon class

2016-12-14 Thread Robert Vogel (Code Review)
Robert Vogel has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327215 )

Change subject: Updated scrollToTop with new icon class
..


Updated scrollToTop with new icon class

Change-Id: Ie818c81fc4b91bc95bdced059f3ed9c384921761
---
M resources/components/skin.scrollToTop.js
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Robert Vogel: Verified; Looks good to me, approved



diff --git a/resources/components/skin.scrollToTop.js 
b/resources/components/skin.scrollToTop.js
index 992356f..f9d32cf 100644
--- a/resources/components/skin.scrollToTop.js
+++ b/resources/components/skin.scrollToTop.js
@@ -6,7 +6,7 @@
'a',
{
href: '#',
-   class: 'bs-top icon-arrow-up5',
+   class: 'bs-top bs-icon-arrow-o-up',
id: 'bs-top',
title: mw.message('bs-to-top-desc').plain()
},
@@ -42,4 +42,4 @@
offset: 300
};
 
-})( mediaWiki, jQuery, blueSpice, document);
\ No newline at end of file
+})( mediaWiki, jQuery, blueSpice, document);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie818c81fc4b91bc95bdced059f3ed9c384921761
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSpiceSkin
Gerrit-Branch: REL1_27
Gerrit-Owner: Robert Vogel 
Gerrit-Reviewer: ItSpiderman 
Gerrit-Reviewer: Robert Vogel 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: db-eqiad.php: Depool db1071 for maintenance

2016-12-14 Thread Marostegui (Code Review)
Marostegui has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327459 )

Change subject: db-eqiad.php: Depool db1071 for maintenance
..

db-eqiad.php: Depool db1071 for maintenance

db1071 needs an ALTER table. It is serving API, so in order to
help with the API load I have pooled db1082 in temporarily

Bug: T150644
Change-Id: I952c11d5e6fbdf69a2531ea5959379a8b800ea84
---
M wmf-config/db-eqiad.php
1 file changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/59/327459/1

diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index 4bec7dd..03568f6 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -143,8 +143,8 @@
'db1026' => 1,   # 1.4TB  64GB, watchlist, recentchanges, 
contributions, logpager
'db1045' => 0,   # 1.4TB  64GB, vslow, dump
'db1070' => 50,  # 2.8TB 160GB, api, old master
-   'db1071' => 50,  # 2.8TB 160GB, api
-   'db1082' => 500, # 3.6TB 512GB
+#  'db1071' => 50,  # 2.8TB 160GB, api #T150644
+   'db1082' => 300, # 3.6TB 512GB  #temporarily serving api 
#T150644
'db1087' => 500, # 3.6TB 512GB
'db1092' => 500, # 3.6TB 512GB
],
@@ -358,8 +358,9 @@
'db1045' => 1,
],
'api' => [
-   'db1070' => 1,
-   'db1071' => 1,
+   'db1070' => 3,
+#  'db1071' => 1,
+   'db1082' => 1,
],
'watchlist' => [
'db1026' => 1,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I952c11d5e6fbdf69a2531ea5959379a8b800ea84
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Marostegui 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] translatewiki[master]: Support %s and %1$s as insertable parameters in the lib.revi...

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/326186 )

Change subject: Support %s and %1$s as insertable parameters in the lib.reviews 
project
..


Support %s and %1$s as insertable parameters in the lib.reviews project

Bug: T150244
Change-Id: I82cd70bd492cc5cb881b63e807de12421ad3066b
---
A groups/lib.reviews/LibReviewsInsertablesSuggester.php
M groups/lib.reviews/lib.reviews.yaml
2 files changed, 35 insertions(+), 0 deletions(-)

Approvals:
  jenkins-bot: Verified
  Nikerabbit: Looks good to me, approved



diff --git a/groups/lib.reviews/LibReviewsInsertablesSuggester.php 
b/groups/lib.reviews/LibReviewsInsertablesSuggester.php
new file mode 100644
index 000..0aba682
--- /dev/null
+++ b/groups/lib.reviews/LibReviewsInsertablesSuggester.php
@@ -0,0 +1,29 @@
+https://gerrit.wikimedia.org/r/326186
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I82cd70bd492cc5cb881b63e807de12421ad3066b
Gerrit-PatchSet: 2
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: MtDu 
Gerrit-Reviewer: Amire80 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] translatewiki[master]: Support %1$s and %s as insertable parameters in the MantisBT...

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/326179 )

Change subject: Support %1$s and %s as insertable parameters in the MantisBT 
project
..


Support %1$s and %s as insertable parameters in the MantisBT project

Bug: T150250
Change-Id: Ica2197ecb766e201e03c3014182aed562cd38d03
---
M groups/MantisBT/MantisBT.yaml
A groups/MantisBT/MantisBTInsertablesSuggester.php
2 files changed, 35 insertions(+), 0 deletions(-)

Approvals:
  jenkins-bot: Verified
  Nikerabbit: Looks good to me, approved



diff --git a/groups/MantisBT/MantisBT.yaml b/groups/MantisBT/MantisBT.yaml
index 4c24507..e273b8c 100644
--- a/groups/MantisBT/MantisBT.yaml
+++ b/groups/MantisBT/MantisBT.yaml
@@ -163,3 +163,9 @@
 
 FILES:
   sourcePattern: 
"%GROUPROOT%/mantis/plugins/XmlImportExport/lang/strings_%CODE%.txt"
+
+INSERTABLES:
+  class: MantisBTInsertablesSuggester
+
+AUTOLOAD:
+  MantisBTInsertablesSuggester: MantisBTInsertablesSuggester.php
diff --git a/groups/MantisBT/MantisBTInsertablesSuggester.php 
b/groups/MantisBT/MantisBTInsertablesSuggester.php
new file mode 100644
index 000..c8bd2ee
--- /dev/null
+++ b/groups/MantisBT/MantisBTInsertablesSuggester.php
@@ -0,0 +1,29 @@
+https://gerrit.wikimedia.org/r/326179
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ica2197ecb766e201e03c3014182aed562cd38d03
Gerrit-PatchSet: 5
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: MtDu 
Gerrit-Reviewer: Amire80 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix linking Special:ChangeContentModel from action=info

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/318695 )

Change subject: Fix linking Special:ChangeContentModel from action=info
..


Fix linking Special:ChangeContentModel from action=info

Just link the special page, when it is there, means checking
$wgContentHandlerUseDB

Change Title::quickUserCan to Title::userCan and pass a user object to
avoid a global..
Change some other places to use the local variable, instead of calling
the context source again.

Change-Id: I561899446235165fb77b626b55f35ce716d798c9
---
M includes/actions/InfoAction.php
1 file changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php
index be3be85..705f5fd 100644
--- a/includes/actions/InfoAction.php
+++ b/includes/actions/InfoAction.php
@@ -262,7 +262,7 @@
$pageLang = $title->getPageLanguage()->getCode();
 
if ( $config->get( 'PageLanguageUseDB' )
-   && $this->getTitle()->userCan( 'pagelang', 
$this->getUser() )
+   && $title->userCan( 'pagelang', $user )
) {
// Link to Special:PageLanguage with pre-filled page 
title if user has permissions
$titleObj = SpecialPage::getTitleFor( 'PageLanguage', 
$title->getPrefixedText() );
@@ -282,7 +282,9 @@
// Content model of the page
$modelHtml = htmlspecialchars( 
ContentHandler::getLocalizedName( $title->getContentModel() ) );
// If the user can change it, add a link to 
Special:ChangeContentModel
-   if ( $title->quickUserCan( 'editcontentmodel' ) ) {
+   if ( $config->get( 'ContentHandlerUseDB' )
+   && $title->userCan( 'editcontentmodel', $user )
+   ) {
$modelHtml .= ' ' . $this->msg( 'parentheses' 
)->rawParams( $linkRenderer->makeLink(
SpecialPage::getTitleValueFor( 
'ChangeContentModel', $title->getPrefixedText() ),
$this->msg( 'pageinfo-content-model-change' 
)->text()
@@ -474,7 +476,7 @@
}
$expiry = $title->getRestrictionExpiry( 
$restrictionType );
$formattedexpiry = $this->msg( 'parentheses',
-   $this->getLanguage()->formatExpiry( $expiry ) 
)->escaped();
+   $lang->formatExpiry( $expiry ) )->escaped();
$message .= $this->msg( 'word-separator' )->escaped() . 
$formattedexpiry;
 
// Messages: restriction-edit, restriction-move, 
restriction-create,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I561899446235165fb77b626b55f35ce716d798c9
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 
Gerrit-Reviewer: Glaisher 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Umherirrender 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: BSAvatars: Fixed blank profile image issue

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327201 )

Change subject: BSAvatars: Fixed blank profile image issue
..


BSAvatars: Fixed blank profile image issue

Change-Id: If4e6f90750835f7684ea9bae26c3b1adeb78ac79
---
M Avatars/Avatars.class.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Mglaser: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Avatars/Avatars.class.php b/Avatars/Avatars.class.php
index a1218c9..6c41486 100644
--- a/Avatars/Avatars.class.php
+++ b/Avatars/Avatars.class.php
@@ -217,7 +217,7 @@
throw new MWException('FATAL: Avatar 
generator not found!');
break;
}
-   $oStatus = 
BsFileSystemHelper::saveToDataDirectory($sAvatarFileName, $sRawPNGAvatar, 
'avatars');
+   $oStatus = 
BsFileSystemHelper::saveToDataDirectory($sAvatarFileName, $sRawPNGAvatar, 
'Avatars');
if (!$oStatus->isGood())
throw new MWException('FATAL: Avatar could not 
be saved!');
# found no way to regenerate thumbs. just delete thumb 
folder if it exists

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If4e6f90750835f7684ea9bae26c3b1adeb78ac79
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Robert Vogel 
Gerrit-Reviewer: Mglaser 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: varnishxcps: use varnishncsa to read log entries from the VSM

2016-12-14 Thread Ema (Code Review)
Ema has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/326965 )

Change subject: varnishxcps: use varnishncsa to read log entries from the VSM
..


varnishxcps: use varnishncsa to read log entries from the VSM

varnsihlog.py and python-varnishapi are not performant enough to read
from the VSM without overruns. As an alternative approach, call
varnishncsa instead.

We define a base class called cachestats.CacheStatsSender responsible
for: i) abstracting away the statsd-related operation, which are common
to all our varnish python stats modules, and ii) calling an external
command (varnishncsa) to read the shared memory log. Another class
called XcpsCacheStatsSender is responsible for dealing with the
xcps-specific details of parsing X-Connection-Properties and generating
the stats.

Bug: T151643
Change-Id: Ied623dfbbd5004e129761287e2e566492a0ed1a7
---
A modules/varnish/files/cachestats.py
M modules/varnish/files/varnishxcps
M modules/varnish/manifests/common.pp
M modules/varnish/manifests/logging/xcps.pp
4 files changed, 151 insertions(+), 71 deletions(-)

Approvals:
  Ema: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/varnish/files/cachestats.py 
b/modules/varnish/files/cachestats.py
new file mode 100644
index 000..fa3ee28
--- /dev/null
+++ b/modules/varnish/files/cachestats.py
@@ -0,0 +1,111 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+  cachestats
+  ~~
+  cachestats.CacheStatsSender is responsible for abstracting away any
+  statsd-related operation, common to all our varnish python stats modules, as
+  well as calling an external command (eg: varnishncsa) to read from VSM.
+  Subclasses are responsible for dealing with the details of parsing the log
+  entries and generating stats.
+
+  Copyright 2016 Emanuele Rocca 
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+"""
+
+import argparse
+import io
+import os
+import socket
+import time
+import urlparse
+
+from subprocess import PIPE, Popen
+
+
+def parse_statsd_server_string(server_string):
+"""Convert statsd server string into (hostname, port) tuple."""
+parsed = urlparse.urlparse('//' + server_string)
+return parsed.hostname, parsed.port or 8125
+
+
+def parse_prefix_string(key_prefix):
+key_prefix = key_prefix.strip('.')
+if not key_prefix:
+raise ValueError('Key prefix must not be empty')
+return key_prefix
+
+
+class CacheStatsSender(object):
+
+cmd = []
+description = ''
+
+def __init__(self, argument_list):
+"""Parse CLI arguments, initialize self.stats and statsd socket.
+
+argument_list is a list such as ['--foo', 'FOO', '--bar', 'BAR']"""
+ap = argparse.ArgumentParser(
+description=self.description,
+epilog='If no statsd server is specified, '
+   'prints stats to stdout instead.')
+
+ap.add_argument('--statsd-server', help='statsd server',
+type=parse_statsd_server_string, default=None)
+ap.add_argument('--key-prefix', help='metric key prefix',
+type=parse_prefix_string, default='varnish.clients')
+ap.add_argument('--interval', help='send interval',
+type=int, default=30)
+self.args = ap.parse_args(argument_list)
+
+self.next_pub = time.time() + self.args.interval
+
+self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+self.stats = {}
+
+def gen_stats(self, record):
+"""Update the self.stats dictionary. Implementation left to the
+subclasses"""
+raise NotImplementedError()
+
+def handle_record(self, record):
+"""Update the self.stats dictionary by calling self.gen_stats. Send
+stats to statsd at regular intervals defined by self.args.interval"""
+self.gen_stats(record)
+
+now = time.time()
+if now >= self.next_pub:
+self.next_pub = now + self.args.interval
+buf = io.BytesIO()
+while self.stats:
+metric = '%s:%s|c\n' % self.stats.popitem()
+buf.write(metric.encode('utf-8'))
+buf.seek(io.SEEK_SET)
+if self.args.statsd_server:
+self.sock.sendto(buf.read(), self.args.statsd_server)
+else:
+print(buf.read().decode('utf-8', 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: BSAvatars: Fixed blank profile image issue

2016-12-14 Thread Mglaser (Code Review)
Mglaser has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327458 )

Change subject: BSAvatars: Fixed blank profile image issue
..

BSAvatars: Fixed blank profile image issue

Change-Id: If4e6f90750835f7684ea9bae26c3b1adeb78ac79
---
M Avatars/Avatars.class.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/58/327458/1

diff --git a/Avatars/Avatars.class.php b/Avatars/Avatars.class.php
index a1218c9..6c41486 100644
--- a/Avatars/Avatars.class.php
+++ b/Avatars/Avatars.class.php
@@ -217,7 +217,7 @@
throw new MWException('FATAL: Avatar 
generator not found!');
break;
}
-   $oStatus = 
BsFileSystemHelper::saveToDataDirectory($sAvatarFileName, $sRawPNGAvatar, 
'avatars');
+   $oStatus = 
BsFileSystemHelper::saveToDataDirectory($sAvatarFileName, $sRawPNGAvatar, 
'Avatars');
if (!$oStatus->isGood())
throw new MWException('FATAL: Avatar could not 
be saved!');
# found no way to regenerate thumbs. just delete thumb 
folder if it exists

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If4e6f90750835f7684ea9bae26c3b1adeb78ac79
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_27
Gerrit-Owner: Mglaser 
Gerrit-Reviewer: Robert Vogel 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...LoginNotify[master]: Add README

2016-12-14 Thread Niharika29 (Code Review)
Niharika29 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327457 )

Change subject: Add README
..

Add README

Change-Id: I11a0592eeb59a8c4876ac1e01f421fb1aa8decde
---
A README.md
1 file changed, 28 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LoginNotify 
refs/changes/57/327457/1

diff --git a/README.md b/README.md
new file mode 100644
index 000..0b45a16
--- /dev/null
+++ b/README.md
@@ -0,0 +1,28 @@
+The LoginNotify extension notifies you when someone logs into your account. It 
can be configured to give warnings after a certain number of failed login 
attempts (The number is configurable, and can be different between unknown 
IPs/devices and known IP/devices). It can also give echo/email notices for 
successful logins from IPs you don't normally use. It can optionally integrate 
into the CheckUser extension in order to determine if the login is from an IP 
address you don't normally use. It can also set a cookie to try and determine 
if the login is from a device you normally use.
+
+ Installation
+* This extension requires the Echo extension to be installed. This extension 
can optionally integrate with the CheckUser extension if it is installed, but 
does not require it.
+* Download and place the file(s) in a directory called LoginNotify in your 
extensions/ folder.
+* Add the following code at the bottom of your LocalSettings.php: 
`wfLoadExtension( 'LoginNotify' );`
+* Navigate to Special:Version on your wiki to verify that the extension is 
successfully installed.
+
+ Configuration parameters
+
+   "LoginNotifyAttemptsKnownIP": 10,
+   "LoginNotifyExpiryKnownIP": 604800,
+   "LoginNotifyAttemptsNewIP": 3,
+   "LoginNotifyExpiryNewIP": 1209600,
+   "LoginNotifyCheckKnownIPs": true,
+   "LoginNotifyEnableOnSuccess": true,
+   "@doc": "Enable notification for users with certain rights. To disable 
set to false",
+   "LoginNotifyEnableForPriv": [ "editinterface", "userrights" ],
+   "@doc": "Override this to use a different secret than $wgSecretKey",
+   "LoginNotifySecretKey": null,
+   "@doc": "Expiry in seconds. Default is 180 days",
+   "LoginNotifyCookieExpire": 15552000,
+   "@doc": "Override to allow sharing login cookies between sites on 
different subdomains",
+   "LoginNotifyCookieDomain": null,
+   "LoginNotifyMaxCookieRecords": 6,
+   "@doc": "Set to false to disable caching IPs in memcache. Set to 0 to 
cache forever. Default 60 days.",
+   "LoginNotifyCacheLoginIPExpiry": 5184000
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I11a0592eeb59a8c4876ac1e01f421fb1aa8decde
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LoginNotify
Gerrit-Branch: master
Gerrit-Owner: Niharika29 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/discovery-stats[production]: Add client usage of structured data

2016-12-14 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327456 )

Change subject: Add client usage of structured data
..

Add client usage of structured data

Really gotta add the ability to do this kind of stuff to reportupdater,
but no time right now.

Bug: T153272
Change-Id: I40bac9a1c7ae38455fc0111fc2b4c1bb1206a4cf
(cherry picked from commit 19a55d34739923181789f456401978e2abb6f960)
---
A bin/daily.sh
M src/Graphite.php
A structured-usage.php
3 files changed, 64 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/discovery-stats 
refs/changes/56/327456/1

diff --git a/bin/daily.sh b/bin/daily.sh
new file mode 100755
index 000..1a411af
--- /dev/null
+++ b/bin/daily.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+BASEDIR=`dirname "$0"`/..
+
+/usr/bin/php $BASEDIR/structured-usage.php
diff --git a/src/Graphite.php b/src/Graphite.php
index 7a65164..85e848d 100644
--- a/src/Graphite.php
+++ b/src/Graphite.php
@@ -16,8 +16,11 @@
 $this->timestamp = time();
 }
 
-public function record( $metric, $value ) {
-$packet = "{$metric} {$value} {$this->timestamp}";
+public function record( $metric, $value, $timestamp = null ) {
+if ( $timestamp === null ) {
+$timestamp = $this->timestamp;
+}
+$packet = "{$metric} {$value} {$timestamp}";
 $nc = "nc -q0 {$this->host} {$this->port}";
 $command = "echo \"$packet\" | $nc";
 
diff --git a/structured-usage.php b/structured-usage.php
new file mode 100644
index 000..06456a3
--- /dev/null
+++ b/structured-usage.php
@@ -0,0 +1,54 @@
+getSites() as $site ) {
+$dbName = $site->getDbName();
+// Can't quote it, have to validate
+if ( !preg_match( '/^[a-z0-9_]+$/', $dbName ) ) {
+throw new \Exception( "Invalid database '$dbName'" );
+}
+if ( $site->isPrivate() || in_array( $dbName, $wikiBlacklist ) ) {
+continue;
+}
+
+query( "USE $dbName" );
+$siteKey = $site->getFamily() . '.' . $site->getCode();
+
+$res = query( "SELECT count(*) AS num FROM page_props WHERE 
pp_propname='jsonconfig_getdata'" );
+if ( $res && ( $row = $res->fetch() ) && $row['num'] ) {
+$graphite->record( "daily.structured-data.client.pagecount.$siteKey",
+$row['num'],
+$timestamp
+);
+}
+}
+
+function query( $sql ) {
+global $db;
+
+$res = $db->query( $sql );
+if ( !$res ) {
+$err = $db->errorInfo();
+throw new \Exception( "{$err[0]}: {$err[2]}" );
+}
+
+return $res;
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I40bac9a1c7ae38455fc0111fc2b4c1bb1206a4cf
Gerrit-PatchSet: 1
Gerrit-Project: analytics/discovery-stats
Gerrit-Branch: production
Gerrit-Owner: MaxSem 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/discovery-stats[production]: Add client usage of structured data

2016-12-14 Thread MaxSem (Code Review)
MaxSem has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327456 )

Change subject: Add client usage of structured data
..


Add client usage of structured data

Really gotta add the ability to do this kind of stuff to reportupdater,
but no time right now.

Bug: T153272
Change-Id: I40bac9a1c7ae38455fc0111fc2b4c1bb1206a4cf
(cherry picked from commit 19a55d34739923181789f456401978e2abb6f960)
---
A bin/daily.sh
M src/Graphite.php
A structured-usage.php
3 files changed, 64 insertions(+), 2 deletions(-)

Approvals:
  MaxSem: Verified; Looks good to me, approved



diff --git a/bin/daily.sh b/bin/daily.sh
new file mode 100755
index 000..1a411af
--- /dev/null
+++ b/bin/daily.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+BASEDIR=`dirname "$0"`/..
+
+/usr/bin/php $BASEDIR/structured-usage.php
diff --git a/src/Graphite.php b/src/Graphite.php
index 7a65164..85e848d 100644
--- a/src/Graphite.php
+++ b/src/Graphite.php
@@ -16,8 +16,11 @@
 $this->timestamp = time();
 }
 
-public function record( $metric, $value ) {
-$packet = "{$metric} {$value} {$this->timestamp}";
+public function record( $metric, $value, $timestamp = null ) {
+if ( $timestamp === null ) {
+$timestamp = $this->timestamp;
+}
+$packet = "{$metric} {$value} {$timestamp}";
 $nc = "nc -q0 {$this->host} {$this->port}";
 $command = "echo \"$packet\" | $nc";
 
diff --git a/structured-usage.php b/structured-usage.php
new file mode 100644
index 000..06456a3
--- /dev/null
+++ b/structured-usage.php
@@ -0,0 +1,54 @@
+getSites() as $site ) {
+$dbName = $site->getDbName();
+// Can't quote it, have to validate
+if ( !preg_match( '/^[a-z0-9_]+$/', $dbName ) ) {
+throw new \Exception( "Invalid database '$dbName'" );
+}
+if ( $site->isPrivate() || in_array( $dbName, $wikiBlacklist ) ) {
+continue;
+}
+
+query( "USE $dbName" );
+$siteKey = $site->getFamily() . '.' . $site->getCode();
+
+$res = query( "SELECT count(*) AS num FROM page_props WHERE 
pp_propname='jsonconfig_getdata'" );
+if ( $res && ( $row = $res->fetch() ) && $row['num'] ) {
+$graphite->record( "daily.structured-data.client.pagecount.$siteKey",
+$row['num'],
+$timestamp
+);
+}
+}
+
+function query( $sql ) {
+global $db;
+
+$res = $db->query( $sql );
+if ( !$res ) {
+$err = $db->errorInfo();
+throw new \Exception( "{$err[0]}: {$err[2]}" );
+}
+
+return $res;
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I40bac9a1c7ae38455fc0111fc2b4c1bb1206a4cf
Gerrit-PatchSet: 1
Gerrit-Project: analytics/discovery-stats
Gerrit-Branch: production
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: MaxSem 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PageAssessments[master]: Re-index the array of excluded namespace IDs

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327141 )

Change subject: Re-index the array of excluded namespace IDs
..


Re-index the array of excluded namespace IDs

The NamespaceInputWidget expects an array of IDs to exclude, but
was being passed an object. This is fixed by reindexing the
array that's passed to it, meaning that JS can treat it as an
array.

Bug: T153165
Change-Id: Idb24ca0e470699f4347936db3903fe2ccc1297c6
---
M src/NamespaceSelect.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Kaldari: Looks good to me, approved



diff --git a/src/NamespaceSelect.php b/src/NamespaceSelect.php
index 49a09b4..864fac3 100644
--- a/src/NamespaceSelect.php
+++ b/src/NamespaceSelect.php
@@ -21,9 +21,9 @@
 */
public function getInputOOUI( $value ) {
$nsIds = array_keys( MWNamespace::getCanonicalNamespaces() );
-   $excludedNsIds = array_filter( $nsIds, function( $ns ) {
+   $excludedNsIds = array_values( array_filter( $nsIds, function( 
$ns ) {
return MWNamespace::isTalk( $ns );
-   } );
+   } ) );
$widget = new NamespaceInputWidget( [
'value' => $value,
'name' => $this->mName,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idb24ca0e470699f4347936db3903fe2ccc1297c6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageAssessments
Gerrit-Branch: master
Gerrit-Owner: Samwilson 
Gerrit-Reviewer: Kaldari 
Gerrit-Reviewer: Samwilson 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: SpecialRunJobs: Use wfHttpError to generate error messages

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/312650 )

Change subject: SpecialRunJobs: Use wfHttpError to generate error messages
..


SpecialRunJobs: Use wfHttpError to generate error messages

wfHttpError generates HTML so the content fits to the Content-Type.

Bug: T146546
Change-Id: Ia90f22564ecb3807aff3b787242bc74fe1678def
---
M includes/specials/SpecialRunJobs.php
1 file changed, 6 insertions(+), 10 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialRunJobs.php 
b/includes/specials/SpecialRunJobs.php
index e1e2049..761610e 100644
--- a/includes/specials/SpecialRunJobs.php
+++ b/includes/specials/SpecialRunJobs.php
@@ -41,14 +41,10 @@
public function execute( $par = '' ) {
$this->getOutput()->disable();
if ( wfReadOnly() ) {
-   // HTTP 423 Locked
-   HttpStatus::header( 423 );
-   print 'Wiki is in read-only mode';
-
+   wfHttpError( 423, 'Locked', 'Wiki is in read-only 
mode.' );
return;
} elseif ( !$this->getRequest()->wasPosted() ) {
-   HttpStatus::header( 400 );
-   print 'Request must be POSTed';
+   wfHttpError( 400, 'Bad Request', 'Request must be 
POSTed.' );
return;
}
 
@@ -58,8 +54,9 @@
$params = array_intersect_key( 
$this->getRequest()->getValues(), $required + $optional );
$missing = array_diff_key( $required, $params );
if ( count( $missing ) ) {
-   HttpStatus::header( 400 );
-   print 'Missing parameters: ' . implode( ', ', 
array_keys( $missing ) );
+   wfHttpError( 400, 'Bad Request',
+   'Missing parameters: ' . implode( ', ', 
array_keys( $missing ) )
+   );
return;
}
 
@@ -71,8 +68,7 @@
$verified = is_string( $providedSignature )
&& hash_equals( $correctSignature, $providedSignature );
if ( !$verified || $params['sigexpiry'] < time() ) {
-   HttpStatus::header( 400 );
-   print 'Invalid or stale signature provided';
+   wfHttpError( 400, 'Bad Request', 'Invalid or stale 
signature provided.' );
return;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia90f22564ecb3807aff3b787242bc74fe1678def
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Fomafix 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add maintenance/view.php for viewing page contents

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/323142 )

Change subject: Add maintenance/view.php for viewing page contents
..


Add maintenance/view.php for viewing page contents

Use case:
  php maintenance/view.php Foo_bar | \
  sed s/foo/bar/ | \
  php maintenance/edit.php Foo_bar

Adapted from maintenance/edit.php and RawAction.php.

Change-Id: I170ac989e0a5b21a22054b549d62023014cb658a
---
M autoload.php
A maintenance/view.php
2 files changed, 60 insertions(+), 0 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/autoload.php b/autoload.php
index 30ef985..4231c1f 100644
--- a/autoload.php
+++ b/autoload.php
@@ -1522,6 +1522,7 @@
'VFormHTMLForm' => __DIR__ . '/includes/htmlform/VFormHTMLForm.php',
'ValidateRegistrationFile' => __DIR__ . 
'/maintenance/validateRegistrationFile.php',
'ViewAction' => __DIR__ . '/includes/actions/ViewAction.php',
+   'ViewCLI' => __DIR__ . '/maintenance/view.php',
'VirtualRESTService' => __DIR__ . 
'/includes/libs/virtualrest/VirtualRESTService.php',
'VirtualRESTServiceClient' => __DIR__ . 
'/includes/libs/virtualrest/VirtualRESTServiceClient.php',
'WANObjectCache' => __DIR__ . 
'/includes/libs/objectcache/WANObjectCache.php',
diff --git a/maintenance/view.php b/maintenance/view.php
new file mode 100644
index 000..af7eb2d
--- /dev/null
+++ b/maintenance/view.php
@@ -0,0 +1,59 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Maintenance
+ */
+
+require_once __DIR__ . '/Maintenance.php';
+
+/**
+ * Maintenance script to show page contents.
+ *
+ * @ingroup Maintenance
+ */
+class ViewCLI extends Maintenance {
+   public function __construct() {
+   parent::__construct();
+   $this->addDescription( 'Show article contents on the command 
line' );
+   $this->addArg( 'title', 'Title of article to view' );
+   }
+
+   public function execute() {
+   $title = Title::newFromText( $this->getArg() );
+   if ( !$title ) {
+   $this->error( "Invalid title", true );
+   }
+
+   $page = WikiPage::factory( $title );
+
+   $content = $page->getContent( Revision::RAW );
+   if ( !$content ) {
+   $this->error( "Page has no content", true );
+   }
+   if ( !$content instanceof TextContent ) {
+   $this->error( "Non-text content models not supported", 
true );
+   }
+
+   $this->output( $content->getNativeData() );
+   }
+}
+
+$maintClass = "ViewCLI";
+require_once RUN_MAINTENANCE_IF_MAIN;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I170ac989e0a5b21a22054b549d62023014cb658a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] translatewiki[master]: [MediaWiki] Remove revid from the list of optional messages

2016-12-14 Thread Amire80 (Code Review)
Amire80 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327448 )

Change subject: [MediaWiki] Remove revid from the list of optional messages
..

[MediaWiki] Remove revid from the list of optional messages

Now that Id53350490b3d1202328dedbd397e21828d3ac01b is merged,
it's certain that the message should be translated.

Change-Id: I940c14e5206fb1bf87442428052cef5c9259abde
---
M groups/MediaWiki/MediaWiki.yaml
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/48/327448/1

diff --git a/groups/MediaWiki/MediaWiki.yaml b/groups/MediaWiki/MediaWiki.yaml
index 8963c98..1fc0906 100644
--- a/groups/MediaWiki/MediaWiki.yaml
+++ b/groups/MediaWiki/MediaWiki.yaml
@@ -219,7 +219,6 @@
 - rc-change-size
 - recentchanges-legend-plusminus
 - resetpass_text
-- revid
 - seconds-abbrev
 - semicolon-separator
 - shared-repo-name-wikimediacommons

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I940c14e5206fb1bf87442428052cef5c9259abde
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Amire80 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RELEASE-NOTES: Fixup for dfb50ab9f3

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327444 )

Change subject: RELEASE-NOTES: Fixup for dfb50ab9f3
..


RELEASE-NOTES: Fixup for dfb50ab9f3

Change-Id: Ibe2efcd11c3f97ca343f43168bde278e44537be9
---
M RELEASE-NOTES-1.29
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29
index 5ff4ca9..4e6396b 100644
--- a/RELEASE-NOTES-1.29
+++ b/RELEASE-NOTES-1.29
@@ -22,7 +22,7 @@
   code for ApiBase::parseMsg() will no longer work.
 * ApiBase::$messageMap is no longer public. Code attempting to access it will
   result in a PHP fatal error.
-* $wgUserEmailUseReplyTo is now false by default to work around restrictive 
DMARC policies.
+* $wgUserEmailUseReplyTo is now true by default to work around restrictive 
DMARC policies.
 
 === New features in 1.29 ===
 * (T5233) A cookie can now be set when a user is autoblocked, to track that 
user if

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe2efcd11c3f97ca343f43168bde278e44537be9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Majr 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...StopForumSpam[master]: Drop pre-1.24 compat

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327430 )

Change subject: Drop pre-1.24 compat
..


Drop pre-1.24 compat

Change-Id: I5016f5a3859cf4323dbd2b3b91a9a569b8c74fc8
---
M BlacklistUpdate.php
M StopForumSpam.php
M ext.SFS.formhack.js
3 files changed, 3 insertions(+), 33 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/BlacklistUpdate.php b/BlacklistUpdate.php
index 6fe7157..4d9b169 100644
--- a/BlacklistUpdate.php
+++ b/BlacklistUpdate.php
@@ -70,15 +70,7 @@
 
private function saveData() {
global $wgMemc, $wgSFSBlacklistCacheDuration;
-   if ( is_callable( array( $wgMemc, 'setMulti' ) ) ) {
-   // Available since 1.24
-   $wgMemc->setMulti( $this->data, 
$wgSFSBlacklistCacheDuration );
-   } else {
-   foreach ( $this->data as $key => $val ) {
-   $wgMemc->set( $key, $val, 
$wgSFSBlacklistCacheDuration );
-   }
-   }
-
+   $wgMemc->setMulti( $this->data, $wgSFSBlacklistCacheDuration );
}
 
/**
@@ -124,4 +116,4 @@
}
$this->usedKeys = $state['usedKeys'];
}
-}
\ No newline at end of file
+}
diff --git a/StopForumSpam.php b/StopForumSpam.php
index 99cf26f..38de890 100644
--- a/StopForumSpam.php
+++ b/StopForumSpam.php
@@ -77,8 +77,6 @@
 $wgAutoloadClasses['BlacklistUpdate'] = __DIR__ . '/BlacklistUpdate.php';
 
 $wgHooks['SpecialPageBeforeFormDisplay'][] = 
'SFSHooks::onSpecialPageBeforeFormDisplay';
-$wgHooks['SpecialBlockBeforeFormDisplay'][] =
-   array( 'SFSHooks::onSpecialPageBeforeFormDisplay', 'Block' ); // 1.23 
compat
 $wgHooks['SpecialBlockModifyFormFields'][] = 
'SFSHooks::onSpecialBlockModifyFormFields';
 $wgHooks['BlockIpComplete'][] = 'SFSHooks::onBlockIpComplete';
 $wgHooks['AbuseFilter-computeVariable'][] = 
'SFSHooks::abuseFilterComputeVariable';
diff --git a/ext.SFS.formhack.js b/ext.SFS.formhack.js
index cf814f7..4302e55 100644
--- a/ext.SFS.formhack.js
+++ b/ext.SFS.formhack.js
@@ -4,27 +4,7 @@
 ( function ( mw, $ ) {
$( function () {
var $blockTarget = $( '#mw-bi-target' ),
-   $SFSbox;
-
-   // Back-compat for pre-1.23
-   $SFSbox = $( '#mw-input-wpSFS' );
-   if ( $SFSbox.length === 0 ) {
-   $SFSbox = $( '' )
-   .addClass( 'mw-htmlform-field-HTMLCheckField' )
-   .append( '' )
-   .append( $( '' )
-   .addClass( 'mw-input' )
-   .append( '' )
-   .append( '' )
-   .append( $( '' )
-   .attr( 'for', 'mw-input-wpSFS' )
-   .text( mw.message( 
'stopforumspam-checkbox' ).text() )
-   )
-   );
-
-   $( '#mw-input-wpHardBlock' ).closest( 'tr' ).after( 
$SFSbox );
-   }
-
+   $SFSbox = $( '#mw-input-wpSFS' );
 
function updateBlockOptions( instant ) {
var blocktarget = $.trim( $blockTarget.val() ),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5016f5a3859cf4323dbd2b3b91a9a569b8c74fc8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/StopForumSpam
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...StopForumSpam[master]: Add GPL file headers

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327431 )

Change subject: Add GPL file headers
..


Add GPL file headers

Change-Id: I74da975ef55a4a2e436166d6b7a7ed94d767f8aa
---
M BlacklistUpdate.php
M StopForumSpam.body.php
M StopForumSpam.hooks.php
M updateBlacklist.php
4 files changed, 73 insertions(+), 4 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/BlacklistUpdate.php b/BlacklistUpdate.php
index 4d9b169..de37aff 100644
--- a/BlacklistUpdate.php
+++ b/BlacklistUpdate.php
@@ -1,4 +1,22 @@
 http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
 
 class BlacklistUpdate implements DeferrableUpdate {
private $lineNo, $usedKeys, $data, $skipLines, $finished = false;
diff --git a/StopForumSpam.body.php b/StopForumSpam.body.php
index 17ce8c4..2c92e3b 100644
--- a/StopForumSpam.body.php
+++ b/StopForumSpam.body.php
@@ -1,4 +1,22 @@
 http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
 
 class StopForumSpam {
 
diff --git a/StopForumSpam.hooks.php b/StopForumSpam.hooks.php
index f0a57d4..a0a7276 100644
--- a/StopForumSpam.hooks.php
+++ b/StopForumSpam.hooks.php
@@ -1,5 +1,22 @@
 http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
 
 class SFSHooks {
 
diff --git a/updateBlacklist.php b/updateBlacklist.php
index 92c1dfb..7f29c1f 100644
--- a/updateBlacklist.php
+++ b/updateBlacklist.php
@@ -1,7 +1,21 @@
 http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
  */
 
 $IP = getenv( 'MW_INSTALL_PATH' );
@@ -9,9 +23,11 @@
$IP = __DIR__ . '/../..';
 }
 
-// Require base maintenance class
 require_once( "$IP/maintenance/Maintenance.php" );
 
+/**
+ * Reads the blacklist file and sticks it in memcache
+ */
 class SFSBlacklistUpdate extends Maintenance {
 
public function execute() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I74da975ef55a4a2e436166d6b7a7ed94d767f8aa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/StopForumSpam
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...JsonConfig[master]: Cleanup tabular data HTML/CSS

2016-12-14 Thread Yurik (Code Review)
Yurik has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327445 )

Change subject: Cleanup tabular data HTML/CSS
..

Cleanup tabular data HTML/CSS

Bug: T153290
Change-Id: I3ceb45a9feb1ec1daeb798f8bba1ce83276431ac
---
M includes/JCTabularContentView.php
M includes/JCUtils.php
M modules/JsonConfig.css
3 files changed, 177 insertions(+), 72 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/JsonConfig 
refs/changes/45/327445/1

diff --git a/includes/JCTabularContentView.php 
b/includes/JCTabularContentView.php
index 490a38f..cca860f 100644
--- a/includes/JCTabularContentView.php
+++ b/includes/JCTabularContentView.php
@@ -18,91 +18,114 @@
 * Called from an override of AbstractContent::fillParserOutput()
 *
 * @param JCContent|JCTabularContent $content
-* @param Title $title Context title for parsing
+* @param Title $pageTitle Context title for parsing
 * @param int|null $revId Revision ID (for {{REVISIONID}})
 * @param ParserOptions $options Parser options
 * @param bool $generateHtml Whether or not to generate HTML
 * @param ParserOutput &$output The output object to fill (reference).
 * @return string
 */
-   public function valueToHtml( JCContent $content, Title $title, $revId, 
ParserOptions $options,
-$generateHtml, 
ParserOutput &$output ) {
+   public function valueToHtml( JCContent $content, Title $pageTitle, 
$revId,
+ParserOptions 
$options, $generateHtml, ParserOutput &$output ) {
 
// Use user's language, and split parser cache.  This should 
not have a big
// impact because data namespace is rarely viewed, but viewing 
it localized
// will be valuable
$lang = $options->getUserLangObj();
 
-   $okClass = [ ];
-   $infoClass = [ 'class' => 'mw-jsonconfig-value-info' ];
-   $errorClass = [ 'class' => 'mw-jsonconfig-error' ];
-   $result = [ ];
+   $infoClass = [ 'class' => 'mw-tabular-value-info' ];
+   $titleHeaders = [];
+   $nameHeaders = [];
+   $typeHeaders = [];
+   $rows = [];
+   $headerAttributes = [];
 
-   $dataAttrs = [ 'class' => 'mw-jsonconfig sortable' ];
+   // Helper to add a class value to an array of attributes
+   $addErr = function ( array $attrs, $isValid ) {
+   if ( !$isValid ) {
+   $attrs['class'] = 'mw-tabular-error';
+   }
+   return $attrs;
+   };
+
+   // Helper to create a  element out of an array of raw HTML 
values
+   $makeRow = function ( array $values, array $attrs = [] ) {
+   return Html::rawElement( 'tr', $attrs, implode( '', 
$values ) );
+   };
+
+   $dataAttrs = [ 'class' => 'mw-tabular sortable' ];
if ( !$content->getValidationData() || 
$content->getValidationData()->error() ) {
-   $dataAttrs['class'] .= ' mw-jsonconfig-error';
+   $dataAttrs['class'] .= ' mw-tabular-error';
}
+
$flds = $content->getField( [ 'schema', 'fields' ] );
if ( $flds && !$flds->error() ) {
-   $vals = [ ];
foreach ( $flds->getValue() as $fld ) {
$name = $content->getField( 'name', $fld );
+   $nameIsValid = $name && !$name->error();
+   $name = $nameIsValid ? $name->getValue() : '';
+
+   $title = $content->getField( 'title', $fld );
+   $titleIsValid = $title && !$title->error();
+   $title =
+   $titleIsValid ? 
JCUtils::pickLocalizedString( $title->getValue(), $lang, $name )
+   : '';
+
$type = $content->getField( 'type', $fld );
-   $label = $content->getField( 'title', $fld );
+   $typeIsValid = $type && !$type->error();
+   $type = $typeIsValid ? $type->getValue() : '';
 
-   if ( $name && !$name->error() && $type && 
!$type->error() &&
-( !$label || !$label->error() )
-   ) {
-   $labelAttrs = $okClass;
-   } else {
-   $labelAttrs = $errorClass;
+  

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RELEASE-NOTES: Fixup for dfb50ab9f3

2016-12-14 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327444 )

Change subject: RELEASE-NOTES: Fixup for dfb50ab9f3
..

RELEASE-NOTES: Fixup for dfb50ab9f3

Change-Id: Ibe2efcd11c3f97ca343f43168bde278e44537be9
---
M RELEASE-NOTES-1.29
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/44/327444/1

diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29
index 5ff4ca9..4e6396b 100644
--- a/RELEASE-NOTES-1.29
+++ b/RELEASE-NOTES-1.29
@@ -22,7 +22,7 @@
   code for ApiBase::parseMsg() will no longer work.
 * ApiBase::$messageMap is no longer public. Code attempting to access it will
   result in a PHP fatal error.
-* $wgUserEmailUseReplyTo is now false by default to work around restrictive 
DMARC policies.
+* $wgUserEmailUseReplyTo is now true by default to work around restrictive 
DMARC policies.
 
 === New features in 1.29 ===
 * (T5233) A cookie can now be set when a user is autoblocked, to track that 
user if

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe2efcd11c3f97ca343f43168bde278e44537be9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Back off from job types longer for DB read-only errors

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/326244 )

Change subject: Back off from job types longer for DB read-only errors
..


Back off from job types longer for DB read-only errors

Such error are likely to persist longer than other random
exceptions. In that case, it is better to avoid burning
through the job retry count.

Change-Id: I6785bd608856f98d21e0b0b05d3899a7081c38e2
---
M includes/jobqueue/JobRunner.php
1 file changed, 12 insertions(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php
index 990f112..cacccbe 100644
--- a/includes/jobqueue/JobRunner.php
+++ b/includes/jobqueue/JobRunner.php
@@ -46,6 +46,7 @@
const MAX_ALLOWED_LAG = 3; // abort if more than this much DB lag is 
present
const LAG_CHECK_PERIOD = 1.0; // check replica DB lag this many seconds
const ERROR_BACKOFF_TTL = 1; // seconds to back off a queue due to 
errors
+   const READONLY_BACKOFF_TTL = 30; // seconds to back off a queue due to 
read-only errors
 
/**
 * @param callable $debug Optional debug output handler
@@ -190,7 +191,7 @@
 
// Back off of certain jobs for a while (for 
throttling and for errors)
if ( $info['status'] === false && mt_rand( 0, 
49 ) == 0 ) {
-   $ttw = max( $ttw, 
self::ERROR_BACKOFF_TTL ); // too many errors
+   $ttw = max( $ttw, 
$this->getErrorBackoffTTL( $info['error'] ) );
$backoffDeltas[$jType] = isset( 
$backoffDeltas[$jType] )
? $backoffDeltas[$jType] + $ttw
: $ttw;
@@ -254,6 +255,16 @@
}
 
/**
+* @param string $error
+* @return int TTL in seconds
+*/
+   private function getErrorBackoffTTL( $error ) {
+   return strpos( $error, 'DBReadOnlyError' ) !== false
+   ? self::READONLY_BACKOFF_TTL
+   : self::ERROR_BACKOFF_TTL;
+   }
+
+   /**
 * @param Job $job
 * @param LBFactory $lbFactory
 * @param StatsdDataFactory $stats

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6785bd608856f98d21e0b0b05d3899a7081c38e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Escape return path extra params to php mail()

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/326260 )

Change subject: Escape return path extra params to php mail()
..


Escape return path extra params to php mail()

PHP only escapes some dangerous shell characters. This is a hardening
measure, as MW's sanitizeEmail routines should also have prevented
evil characters from being in mail addresses in the first place.

Bug: T152717
Change-Id: I3736d612ed40d257ee3dde8e98eb30ccf432670a
---
M includes/mail/UserMailer.php
1 file changed, 8 insertions(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/mail/UserMailer.php b/includes/mail/UserMailer.php
index c8e..21effa0 100644
--- a/includes/mail/UserMailer.php
+++ b/includes/mail/UserMailer.php
@@ -268,7 +268,14 @@
// Add the envelope sender address using the -f command line 
option when PHP mail() is used.
// Will default to the $from->address when the 
UserMailerChangeReturnPath hook fails and the
// generated VERP address when the hook runs effectively.
-   $extraParams .= ' -f ' . $returnPath;
+
+   // PHP runs this through escapeshellcmd(). However that's not 
sufficient
+   // escaping (e.g. due to spaces). MediaWiki's email sanitizer 
should generally
+   // be good enough, but just in case, put in double quotes, and 
remove any
+   // double quotes present (" is not allowed in emails, so should 
have no
+   // effect, although this might cause apostrophees to be double 
escaped)
+   $returnPathCLI = '"' . str_replace( '"', '', $returnPath ) . 
'"';
+   $extraParams .= ' -f ' . $returnPathCLI;
 
$headers['Return-Path'] = $returnPath;
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3736d612ed40d257ee3dde8e98eb30ccf432670a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff 
Gerrit-Reviewer: Dpatrick 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: A full word instead of an acronym for the revid message

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/325675 )

Change subject: A full word instead of an acronym for the revid message
..


A full word instead of an acronym for the revid message

There is no technical reason for this message to be so brief
and writing the whole word makes it more easily readable and translatable.

Change-Id: Id53350490b3d1202328dedbd397e21828d3ac01b
---
M languages/i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified
  Anomie: Looks good to me, but someone else must approve



diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 2004e0f..882357f 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -4250,6 +4250,6 @@
"restrictionsfield-badip": "Invalid IP address or range: $1",
"restrictionsfield-label": "Allowed IP ranges:",
"restrictionsfield-help": "One IP address or CIDR range per line. To 
enable everything, use0.0.0.0/0::/0",
-   "revid": "r$1",
+   "revid": "revision $1",
"pageid": "page ID $1"
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id53350490b3d1202328dedbd397e21828d3ac01b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Amire80 
Gerrit-Reviewer: Amire80 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Always show exceptions of type 'error' in LTR

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/326873 )

Change subject: Always show exceptions of type 'error' in LTR
..


Always show exceptions of type 'error' in LTR

Bug: T153027
Change-Id: Iad5b9a01f5b8cdaa2ed94b3ece937acc1f6faa60
---
M includes/exception/MWExceptionRenderer.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/exception/MWExceptionRenderer.php 
b/includes/exception/MWExceptionRenderer.php
index b600f42..a569bcd 100644
--- a/includes/exception/MWExceptionRenderer.php
+++ b/includes/exception/MWExceptionRenderer.php
@@ -207,14 +207,14 @@
 */
public static function getHTML( $e ) {
if ( self::showBackTrace( $e ) ) {
-   $html = "" .
+   $html = "" .
nl2br( htmlspecialchars( 
MWExceptionHandler::getLogMessage( $e ) ) ) .
'Backtrace:' .
nl2br( htmlspecialchars( 
MWExceptionHandler::getRedactedTraceAsString( $e ) ) ) .
"\n";
} else {
$logId = WebRequest::getRequestId();
-   $html = "" .
+   $html = "" .
'[' . $logId . '] ' .
gmdate( 'Y-m-d H:i:s' ) . ": " .
self::msg( "internalerror-fatal-exception",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iad5b9a01f5b8cdaa2ed94b3ece937acc1f6faa60
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Huji 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...StopForumSpam[master]: Run phplint and phpcs with "composer test", and fix errors

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327443 )

Change subject: Run phplint and phpcs with "composer test", and fix errors
..

Run phplint and phpcs with "composer test", and fix errors

Change-Id: I779c5583cfa6cbcc9474bd382c8ce2698d4f4358
---
A .gitignore
M BlacklistUpdate.php
M StopForumSpam.body.php
M StopForumSpam.hooks.php
M StopForumSpam.php
A composer.json
A phpcs.xml
M tests/phpunit/StopForumSpamTest.php
M updateBlacklist.php
9 files changed, 83 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/StopForumSpam 
refs/changes/43/327443/1

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..af1f417
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+composer.lock
+/vendor
diff --git a/BlacklistUpdate.php b/BlacklistUpdate.php
index de37aff..dfcd5f7 100644
--- a/BlacklistUpdate.php
+++ b/BlacklistUpdate.php
@@ -22,7 +22,8 @@
private $lineNo, $usedKeys, $data, $skipLines, $finished = false;
 
public function doUpdate() {
-   global $wgSFSIPListLocation, $wgSFSIPThreshold, 
$wgSFSValidateIPList, $wgSFSBlacklistCacheDuration, $wgMemc;
+   global $wgSFSIPListLocation, $wgSFSIPThreshold, 
$wgSFSValidateIPList,
+   $wgSFSBlacklistCacheDuration, $wgMemc;
if ( $wgSFSIPListLocation === false ) {
wfDebugLog( 'StopForumSpam', '$wgSFSIPListLocation has 
not been configured properly.' );
return;
@@ -41,15 +42,16 @@
$wgMemc->delete( 
StopForumSpam::getBlacklistUpdateStateKey() );
}
 
-   // For batching purposes, this saves our current progress so we 
know where to pick up in case we run out of time
-   register_shutdown_function( array( $this, 'saveState' ) );
+   // For batching purposes, this saves our current progress so we
+   // know where to pick up in case we run out of time
+   register_shutdown_function( [ $this, 'saveState' ] );
 
// Try to keep this running even if the user hits the stop 
button
ignore_user_abort( true );
 
-   $this->data = array();
+   $this->data = [];
$this->lineNo = 0;
-   $this->usedKeys = array();
+   $this->usedKeys = [];
$this->skipLines = 0;
$this->restoreState( $state );
$fh = fopen( $wgSFSIPListLocation, 'rb' );
@@ -59,7 +61,9 @@
$this->lineNo++;
if ( $this->lineNo < $this->skipLines ) {
continue;
-   } elseif ( $ip === array( null ) || ( 
$wgSFSValidateIPList && ( !IP::isValid( $ip[0] ) || IP::isIPv6( $ip[0] ) ) ) ) {
+   } elseif ( $ip === [ null ] || ( $wgSFSValidateIPList
+   && ( !IP::isValid( $ip[0] ) || 
IP::isIPv6( $ip[0] ) ) )
+   ) {
continue; // discard invalid lines
} elseif ( isset( $ip[1] ) && $ip[1] < 
$wgSFSIPThreshold ) {
continue; // wasn't hit enough times
@@ -106,11 +110,11 @@
$this->saveData();
 
// Save where we left off
-   $wgMemc->set( StopForumSpam::getBlacklistUpdateStateKey(), 
array(
+   $wgMemc->set( StopForumSpam::getBlacklistUpdateStateKey(), [
'skipLines' => $this->lineNo,
'usedKeys' => array_keys( $this->data ),
'filemtime' => filemtime( $wgSFSIPListLocation )
-   ), 0 );
+   ], 0 );
 
if ( ob_get_level() ) {
ob_end_clean();
diff --git a/StopForumSpam.body.php b/StopForumSpam.body.php
index 2c92e3b..101e1ba 100644
--- a/StopForumSpam.body.php
+++ b/StopForumSpam.body.php
@@ -52,26 +52,29 @@
 
$ips = self::getUserIPs( $user );
if ( $ips === false ) {
-   wfDebugLog( 'StopForumSpam', 'IP info is not stored in 
recentchanges nor CheckUser extension, bailing' );
+   wfDebugLog( 'StopForumSpam',
+   'IP info is not stored in recentchanges nor 
CheckUser extension, bailing'
+   );
return false;
-   } elseif( !$ips ) {
-   wfDebugLog( 'StopForumSpam', "Couldn't find any IPs for 
\"{$user->getName()}\"");
+   } elseif ( !$ips ) {
+   wfDebugLog( 'StopForumSpam', "Couldn't find any IPs for 
\"{$user->getName()}\"" );
return false;
}
 
$email = $user->getEmail();
 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: toollabs: Include openstack::clientlib on web hosts

2016-12-14 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327228 )

Change subject: toollabs: Include openstack::clientlib on web hosts
..

toollabs: Include openstack::clientlib on web hosts

This allows us to enumerate instances for e.g. watroles

Change-Id: I8c2d85a01ecd01e7dd4a423d8dc6d5c9123e1b0c
---
M modules/role/manifests/toollabs/node/web.pp
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/28/327228/1

diff --git a/modules/role/manifests/toollabs/node/web.pp 
b/modules/role/manifests/toollabs/node/web.pp
index 4a111cb..cc57d97 100644
--- a/modules/role/manifests/toollabs/node/web.pp
+++ b/modules/role/manifests/toollabs/node/web.pp
@@ -17,6 +17,7 @@
 
 include ::toollabs::node::all
 include gridengine::submit_host
+include ::openstack::clientlib
 
 # New style webservices!
 package { 'toollabs-webservice':

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c2d85a01ecd01e7dd4a423d8dc6d5c9123e1b0c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Don't require documentation for test cases

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327440 )

Change subject: Don't require documentation for test cases
..

Don't require documentation for test cases

Change-Id: I375ea9c889f40a230e30529f442cd93e7959113d
---
M MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/40/327440/1

diff --git a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php 
b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
index cfe9e74..fa3464f 100644
--- a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
+++ b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
@@ -39,6 +39,10 @@
 * @return void
 */
public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) {
+   if ( substr( $phpcsFile->getFilename(), -8 ) === 'Test.php' ) {
+   // Don't check documentation for test cases
+   return;
+   }
$tokens = $phpcsFile->getTokens();
$find   = PHP_CodeSniffer_Tokens::$methodPrefixes;
$find[] = T_WHITESPACE;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I375ea9c889f40a230e30529f442cd93e7959113d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Don't require @return annotations for plain "return; "

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327441 )

Change subject: Don't require @return annotations for plain "return;"
..

Don't require @return annotations for plain "return;"

Change-Id: I67731467e43052a97c66fac8ffb2e1ee03eb0238
---
M MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
M MediaWiki/Tests/files/Commenting/commenting_function.php
M MediaWiki/Tests/files/Commenting/commenting_function.php.fixed
3 files changed, 32 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/41/327441/1

diff --git a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php 
b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
index fa3464f..60b2afe 100644
--- a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
+++ b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
@@ -113,6 +113,14 @@
if ( $returnToken === false ) {
return;
}
+
+   while ( isset( $tokens[$returnToken+1] ) && 
$tokens[$returnToken+1]['code'] === T_SEMICOLON ) {
+   $returnToken = $phpcsFile->findNext( T_RETURN, 
$returnToken + 1, $endFunction );
+   if ( $returnToken === false ) {
+   return;
+   }
+   }
+
$return = null;
foreach ( $tokens[$commentStart]['comment_tags'] as $tag ) {
if ( $tokens[$tag]['content'] === '@return' ) {
diff --git a/MediaWiki/Tests/files/Commenting/commenting_function.php 
b/MediaWiki/Tests/files/Commenting/commenting_function.php
index 15563b9..ffe62f1 100644
--- a/MediaWiki/Tests/files/Commenting/commenting_function.php
+++ b/MediaWiki/Tests/files/Commenting/commenting_function.php
@@ -32,6 +32,18 @@
public function __construct( $a ) {
$this->test( $a );
}
+
+   /**
+* A blank return does not require a return tag
+*/
+   public function emptyReturn() {
+   if ( $fooBar ) {
+   return;
+   }
+
+   baz();
+   }
+
/**
 * Single Test function.
 *
diff --git a/MediaWiki/Tests/files/Commenting/commenting_function.php.fixed 
b/MediaWiki/Tests/files/Commenting/commenting_function.php.fixed
index ef12d1e..96b2041 100644
--- a/MediaWiki/Tests/files/Commenting/commenting_function.php.fixed
+++ b/MediaWiki/Tests/files/Commenting/commenting_function.php.fixed
@@ -32,6 +32,18 @@
public function __construct( $a ) {
$this->test( $a );
}
+
+   /**
+* A blank return does not require a return tag
+*/
+   public function emptyReturn() {
+   if ( $fooBar ) {
+   return;
+   }
+
+   baz();
+   }
+
/**
 * Single Test function.
 *

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I67731467e43052a97c66fac8ffb2e1ee03eb0238
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Allow filtering documentation requirements based on visibility

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327442 )

Change subject: Allow filtering documentation requirements based on visibility
..

Allow filtering documentation requirements based on visibility

* Don't require documentation for private methods
* Allow repos to opt-out of requiring documentation for protected
methods

Change-Id: Ib0eb21d300c5dc583022618dc140beaac08e6e38
---
M MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
1 file changed, 13 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/42/327442/1

diff --git a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php 
b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
index 60b2afe..f831d05 100644
--- a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
+++ b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
@@ -44,6 +44,18 @@
return;
}
$tokens = $phpcsFile->getTokens();
+   // Identify the visiblity of the function
+   $visibility = $phpcsFile->findPrevious( [ T_PUBLIC, 
T_PROTECTED, T_PRIVATE ], $stackPtr - 1 );
+   $visStr = 'Public';
+   if ( $visibility && $visibility['line'] == 
$tokens[$stackPtr]['line'] ) {
+   if ( $visibility['code'] == T_PRIVATE ) {
+   // Don't check documentation for private 
functions
+   return;
+   } elseif ( $visibility['code'] == T_PROTECTED ) {
+   $visStr = 'Protected';
+   }
+   }
+
$find   = PHP_CodeSniffer_Tokens::$methodPrefixes;
$find[] = T_WHITESPACE;
$commentEnd = $phpcsFile->findPrevious( $find, ( $stackPtr - 1 
), null, true );
@@ -60,7 +72,7 @@
if ( $tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG
&& $tokens[$commentEnd]['code'] !== T_COMMENT
) {
-   $phpcsFile->addError( 'Missing function doc comment', 
$stackPtr, 'Missing' );
+   $phpcsFile->addError( 'Missing function doc comment', 
$stackPtr, "Missing.$visStr" );
$phpcsFile->recordMetric( $stackPtr, 'Function has doc 
comment', 'no' );
return;
} else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib0eb21d300c5dc583022618dc140beaac08e6e38
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Fix test result parsing, and correct new errors that were ex...

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/324376 )

Change subject: Fix test result parsing, and correct new errors that were 
exposed
..


Fix test result parsing, and correct new errors that were exposed

The testFile test compares the expected output of each test with
what it gets from phpcs, and it does this by stripping out irrelevant
output from these two sources before comparing them. The output
in most cases is framed by two lines of hyphens at top and bottom,
and MediaWikiStandardTest::prepareOutput was using these as markers
for the content it was interested in.

However there are various phpcs results that only have one line of
hyphens (such as 'undefined index' errors), and so these were being
discarded.

The fix here is to only discard lines that we know we don't care
about: empty ones, ones with all hyphens, and ones that start with
'Time: ', 'FOUND ', or 'FILE: '. If there are others, they do not
currently show up in any phpcs results (but if they do one day for
new tests, we can deal with them then).

This change to the test highlighted a bunch of existing errors in
the test files, and so these have been fixed. Including the one that
initially prompted this bug report: this involved rearranging when
some fields of tokens are checked, to avoid undefined index errors.

Also remove some unused code and comment (we do check
constructors).

Bug: T146439
Change-Id: I1be4e021e559b2a5efd1c1361a8b574e076e11dc
---
M MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
M MediaWiki/Sniffs/WhiteSpace/SpaceBeforeControlStructureBraceSniff.php
M MediaWiki/Tests/MediaWikiStandardTest.php
M 
MediaWiki/Tests/files/ExtraCharacters/extra_characters_before_phpopen_tag_fail.php
M 
MediaWiki/Tests/files/ExtraCharacters/extra_characters_before_phpopen_tag_fail.php.expect
M 
MediaWiki/Tests/files/ExtraCharacters/extra_characters_before_phpopen_tag_fail.php.fixed
M 
MediaWiki/Tests/files/ExtraCharacters/extra_characters_before_phpopen_tag_pass.php
M 
MediaWiki/Tests/files/ExtraCharacters/parenthesis_after_keyword_tag_fail.php.expect
M MediaWiki/Tests/files/WhiteSpace/space_before_class_brace.php.expect
9 files changed, 24 insertions(+), 40 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php 
b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
index f988be4..cfe9e74 100644
--- a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
+++ b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
@@ -99,13 +99,11 @@
 */
protected function processReturn( PHP_CodeSniffer_File $phpcsFile, 
$stackPtr, $commentStart ) {
$tokens = $phpcsFile->getTokens();
-   // Skip constructor and destructor.
-   $methodName = $phpcsFile->getDeclarationName( $stackPtr );
-   $endFunction = $tokens[$stackPtr]['scope_closer'];
// Return if no scope_opener.
if ( !isset( $tokens[$stackPtr]['scope_opener'] ) ) {
return;
}
+   $endFunction = $tokens[$stackPtr]['scope_closer'];
$returnToken = $phpcsFile->findNext( T_RETURN, $stackPtr + 1, 
$endFunction );
// Return if the function has no return.
if ( $returnToken === false ) {
diff --git 
a/MediaWiki/Sniffs/WhiteSpace/SpaceBeforeControlStructureBraceSniff.php 
b/MediaWiki/Sniffs/WhiteSpace/SpaceBeforeControlStructureBraceSniff.php
index 834bb5e..0523c24 100644
--- a/MediaWiki/Sniffs/WhiteSpace/SpaceBeforeControlStructureBraceSniff.php
+++ b/MediaWiki/Sniffs/WhiteSpace/SpaceBeforeControlStructureBraceSniff.php
@@ -33,24 +33,25 @@
 */
public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) {
$tokens = $phpcsFile->getTokens();
-   $closeBracket = $tokens[$stackPtr + 2]['parenthesis_closer'];
-   $openBrace = $tokens[$stackPtr]['scope_opener'];
-   $closeBracketLine = $tokens[$closeBracket]['line'];
-   $openBraceLine = $tokens[$openBrace]['line'];
-   $lineDifference = ( $openBraceLine - $closeBracketLine );
-   if ( isset( $tokens[$stackPtr]['scope_opener'] ) == false ||
-   $tokens[$stackPtr]['scope_opener'] === false ||
-   $tokens[$openBrace]['content'] !== '{'
-   ) {
+   if ( !isset( $tokens[$stackPtr]['scope_opener'] ) ||
+   $tokens[$stackPtr]['scope_opener'] === false ) {
return;
}
-
+   $openBrace = $tokens[$stackPtr]['scope_opener'];
+   if ( $tokens[$openBrace]['content'] !== '{' ) {
+   return;
+   }
if ( $tokens[$stackPtr + 1]['code'] !== T_WHITESPACE

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: beta: Remove duplicate entry for wikidata in $wgLogo

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327439 )

Change subject: beta: Remove duplicate entry for wikidata in $wgLogo
..

beta: Remove duplicate entry for wikidata in $wgLogo

Change-Id: I76d3f23903283670121aec3b67470deeff008a13
---
M wmf-config/InitialiseSettings-labs.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/39/327439/1

diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 0f467bd..10eb00b 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -163,7 +163,6 @@
'default' => 
'/static/images/project-logos/betawiki.png',
'commonswiki' => 
'/static/images/project-logos/betacommons.png',
'wikibooks' => 
'/static/images/project-logos/betacommons.png',
-   'wikidata' => 
'/static/images/project-logos/betacommons.png',
'wikidata' => 
'/static/images/project-logos/betawikidata.png',
'wikinews' => 
'/static/images/project-logos/betacommons.png',
'wikiquote' => 
'/static/images/project-logos/betacommons.png',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76d3f23903283670121aec3b67470deeff008a13
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: beta: Set $wgLinterStatsdSampleFactor

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327438 )

Change subject: beta: Set $wgLinterStatsdSampleFactor
..

beta: Set $wgLinterStatsdSampleFactor

10 seems reasonable given the frequency of edits on beta.

Change-Id: I6d1c4755d92a0b9621c3856b4e24905ff8e8aafb
---
M wmf-config/InitialiseSettings-labs.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/38/327438/1

diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 2130cf5..0f467bd 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -582,6 +582,9 @@
'default' => [
'10.68.20.142' => true // 
deployment-parsoid09.deployment-prep.eqiad.wmflabs
]
-   ]
+   ],
+   'wgLinterStatsdSampleFactor' => [
+   'default' => 10,
+   ],
];
 } # wmflLabsSettings()

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d1c4755d92a0b9621c3856b4e24905ff8e8aafb
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...StopForumSpam[master]: Move tests in to tests/phpunit/ directory

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327433 )

Change subject: Move tests in to tests/phpunit/ directory
..

Move tests in to tests/phpunit/ directory

Change-Id: I8bf0bfde539276ba28bc5a5d8cf5d96d5e5cdc56
---
M StopForumSpam.hooks.php
M extension.json
R tests/phpunit/StopForumSpamTest.php
R tests/phpunit/sample_blacklist.txt
R tests/phpunit/sample_blacklist_all.txt
5 files changed, 1 insertion(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/StopForumSpam 
refs/changes/33/327433/1

diff --git a/StopForumSpam.hooks.php b/StopForumSpam.hooks.php
index a0a7276..fb040dd 100644
--- a/StopForumSpam.hooks.php
+++ b/StopForumSpam.hooks.php
@@ -207,13 +207,4 @@
 
return true;
}
-
-   /**
-* Load our unit tests
-*/
-   public static function onUnitTestsList( &$files ) {
-   $files = array_merge( $files, glob( __DIR__ . 
'/tests/*Test.php' ) );
-
-   return true;
-   }
 }
diff --git a/extension.json b/extension.json
index e96f97e..068200c 100644
--- a/extension.json
+++ b/extension.json
@@ -52,8 +52,7 @@
"AbuseFilter-generateUserVars": 
"SFSHooks::abuseFilterGenerateUserVars",
"AbuseFilter-builder": "SFSHooks::abuseFilterBuilder",
"getUserPermissionsErrorsExpensive": 
"SFSHooks::onGetUserPermissionsErrorsExpensive",
-   "OtherBlockLogLink": "SFSHooks::onOtherBlockLogLink",
-   "UnitTestsList": "SFSHooks::onUnitTestsList"
+   "OtherBlockLogLink": "SFSHooks::onOtherBlockLogLink"
},
"config": {
"SFSAPIKey": {
diff --git a/tests/StopForumSpamTest.php b/tests/phpunit/StopForumSpamTest.php
similarity index 100%
rename from tests/StopForumSpamTest.php
rename to tests/phpunit/StopForumSpamTest.php
diff --git a/tests/sample_blacklist.txt b/tests/phpunit/sample_blacklist.txt
similarity index 100%
rename from tests/sample_blacklist.txt
rename to tests/phpunit/sample_blacklist.txt
diff --git a/tests/sample_blacklist_all.txt 
b/tests/phpunit/sample_blacklist_all.txt
similarity index 100%
rename from tests/sample_blacklist_all.txt
rename to tests/phpunit/sample_blacklist_all.txt

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8bf0bfde539276ba28bc5a5d8cf5d96d5e5cdc56
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/StopForumSpam
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Linter[master]: Display count of lint errors on ?action=info

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327437 )

Change subject: Display count of lint errors on ?action=info
..

Display count of lint errors on ?action=info

Change-Id: Ifcdfcb365e5ff6106b521d58a06df8c006772473
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/Database.php
M includes/Hooks.php
5 files changed, 39 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Linter 
refs/changes/37/327437/1

diff --git a/extension.json b/extension.json
index 98fc55d..7d2c51b 100644
--- a/extension.json
+++ b/extension.json
@@ -28,6 +28,7 @@
"LoadExtensionSchemaUpdates": 
"MediaWiki\\Linter\\Hooks::onLoadExtensionSchemaUpdates",
"EditFormInitialText": 
"MediaWiki\\Linter\\Hooks::onEditFormInitialText",
"APIQuerySiteInfoGeneralInfo": 
"MediaWiki\\Linter\\Hooks::onAPIQuerySiteInfoGeneralInfo",
+   "InfoAction": "MediaWiki\\Linter\\Hooks::onInfoAction",
"WikiPageDeletionUpdates": 
"MediaWiki\\Linter\\Hooks::onWikiPageDeletionUpdates"
},
"APIModules": {
diff --git a/i18n/en.json b/i18n/en.json
index 5ab4f95..283dfe0 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -31,6 +31,7 @@
"linker-page-edit": "edit",
"linter-heading-errors": "Errors",
"linter-heading-warnings": "Warnings",
+   "pageinfo-linter": "Lint errors",
"apihelp-query+linterrors-description": "Get a list of lint errors",
"apihelp-query+linterrors-param-categories": "Categories of lint 
errors",
"apihelp-query+linterrors-param-limit": "Number of results to query",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 750c46b..530e81d 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -33,6 +33,7 @@
"linker-page-edit": "Link text for edit link in 
{{msg-mw|linker-page-title-edit}} and 
{{msg-mw|linker-page-title-edit-template}}\n{{Identical|Edit}}",
"linter-heading-errors": "Heading on [[Special:LintErrors]]",
"linter-heading-warnings": "Heading on [[Special:LintErrors]]",
+   "pageinfo-linter": "Heading on ?action=info for a page if it has lint 
errors",
"apihelp-query+linterrors-description": 
"{{doc-apihelp-description|query+linterrors}}",
"apihelp-query+linterrors-param-categories": 
"{{doc-apihelp-param|query+linterrors|categories}}",
"apihelp-query+linterrors-param-limit": 
"{{doc-apihelp-param|query+linterrors|limit}}",
diff --git a/includes/Database.php b/includes/Database.php
index 11d61ab..471b8d7 100644
--- a/includes/Database.php
+++ b/includes/Database.php
@@ -199,11 +199,19 @@
/**
 * @return int[]
 */
-   public function getTotals() {
+   public function getTotalsForPage() {
+   return $this->getTotals( [ 'linter_page' => $this->pageId ] );
+   }
+
+   /**
+* @param array $conds Query conditions
+* @return int[]
+*/
+   public function getTotals( $conds = [] ) {
$rows = wfGetDB( DB_SLAVE )->select(
'linter',
[ 'linter_cat', 'COUNT(*) AS count' ],
-   [],
+   $conds,
__METHOD__,
[ 'GROUP BY' => 'linter_cat' ]
);
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 7f4d901..ad541da 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -24,6 +24,7 @@
 use Content;
 use DatabaseUpdater;
 use EditPage;
+use IContextSource;
 use MWCallableUpdate;
 use WikiPage;
 
@@ -101,4 +102,29 @@
'warnings' => $catManager->getWarnings(),
];
}
+
+   /**
+* Hook: InfoAction
+*
+* Display quick summary of errors for this page on ?action=info
+*
+* @param IContextSource $context
+* @param array $pageInfo
+*/
+   public static function onInfoAction( IContextSource $context, array 
&$pageInfo ) {
+   $pageId = $context->getTitle()->getArticleID();
+   if ( !$pageId ) {
+   return;
+   }
+   $database = new Database( $pageId );
+   $totals = array_filter( $database->getTotalsForPage() );
+   if ( !$totals ) {
+   // No errors, yay!
+   return;
+   }
+
+   foreach ( $totals as $name => $count ) {
+   $pageInfo['linter'][] = [ $context->msg( 
"linter-category-$name" ), htmlspecialchars( $count ) ];
+   }
+   }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifcdfcb365e5ff6106b521d58a06df8c006772473
Gerrit-PatchSet: 1
Gerrit-Project: 

[MediaWiki-commits] [Gerrit] mediawiki...Linter[master]: Add __METHOD__ to MWCallableUpdate

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327435 )

Change subject: Add __METHOD__ to MWCallableUpdate
..

Add __METHOD__ to MWCallableUpdate

For stats and debugging purposes.

Change-Id: I5acd7fad0a9f09519595c2fa1f6232bb2624a713
---
M includes/Hooks.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Linter 
refs/changes/35/327435/1

diff --git a/includes/Hooks.php b/includes/Hooks.php
index 81d4d47..f4ca189 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -82,6 +82,6 @@
$updates[] = new MWCallableUpdate( function() use ( $id ) {
$database = new Database( $id );
$database->setForPage( [] );
-   } );
+   }, __METHOD__ );
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5acd7fad0a9f09519595c2fa1f6232bb2624a713
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Linter
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...StopForumSpam[master]: Add extension.json, deprecate PHP entry point

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327432 )

Change subject: Add extension.json, deprecate PHP entry point
..

Add extension.json, deprecate PHP entry point

Change-Id: Ia0cd1358abdcc522184f917ec300906590c31926
---
M StopForumSpam.php
A extension.json
2 files changed, 93 insertions(+), 104 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/StopForumSpam 
refs/changes/32/327432/1

diff --git a/StopForumSpam.php b/StopForumSpam.php
index 38de890..6cae80b 100644
--- a/StopForumSpam.php
+++ b/StopForumSpam.php
@@ -1,107 +1,14 @@
 https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
+   );
+   return true;
+} else {
+   die( 'This version of the StopFormSpam extension requires MediaWiki 
1.25+' );
 }
-
-/**
- * StopForumSpam.com is a website dedicated to
- * stopping spam. This extension helps
- * by utilizing and contributing to their
- * data.
- *
- * @see http://stopforumspam.com/faq
- * @author Kunal Mehta 
- * @license GPL v2 or higher
- */
-
-/**
- * Your API key for stopforumspam.com
- * @see http://stopforumspam.com/signup
- */
-$wgSFSAPIKey = '';
-
-/**
- * Location on the server where the IP blacklist can be found
- * File should be unzipped and in the "Record summary" format
- * @see http://www.stopforumspam.com/downloads/
- */
-$wgSFSIPListLocation = false;
-
-/**
- * Whether to validate the IP addresses in the blacklist file
- * Adds a bit of processing time, but safer.
- */
-$wgSFSValidateIPList = true;
-
-/**
- * Whether to update the IP blacklist as a DeferredUpdate at the end of a 
pageload
- * (warning: can be very slow depending on your processor speed and cache 
settings)
- * If disabled, you will need to run the updateBlacklist.php maintenance 
script,
- * setting up a cron job to do this is recommended.
- */
-$wgSFSEnableDeferredUpdates = true;
-
-/**
- * How many times an IP needs to be reported before it is added to the 
blacklist
- * This corresponds to the 2nd field in the record summary CSV
- */
-$wgSFSIPThreshold = 5;
-
-/*
- * How long (in seconds) the IP blacklist should be cached for
- * If you are using the 7 day blacklist, try 5 days (432000)
- * If you are using the 30 day blacklist, try 14 days (1209600)
- * The default is 5 days
- */
-$wgSFSBlacklistCacheDuration = 432000;
-
-/**
- * Whether to enable the confidence variable for Extension:AbuseFilter
- * The variable will make external API requests
- */
-$wgSFSEnableConfidenceVariable = true;
-
-$wgExtensionCredits['antispam'][] = array(
-   'path' => __FILE__,
-   'name' => 'StopForumSpam',
-   'author' => array( 'Kunal Mehta', 'Ryan Schmidt' ),
-   'url' => 'https://www.mediawiki.org/wiki/Extension:StopForumSpam',
-   'descriptionmsg' => 'stopforumspam-desc',
-   'version' => '0.2.0',
-   'license-name' => 'GPL-2.0+',
-);
-
-$wgAutoloadClasses['SFSHooks'] = __DIR__ . '/StopForumSpam.hooks.php';
-$wgAutoloadClasses['StopForumSpam'] = __DIR__ . '/StopForumSpam.body.php';
-$wgAutoloadClasses['BlacklistUpdate'] = __DIR__ . '/BlacklistUpdate.php';
-
-$wgHooks['SpecialPageBeforeFormDisplay'][] = 
'SFSHooks::onSpecialPageBeforeFormDisplay';
-$wgHooks['SpecialBlockModifyFormFields'][] = 
'SFSHooks::onSpecialBlockModifyFormFields';
-$wgHooks['BlockIpComplete'][] = 'SFSHooks::onBlockIpComplete';
-$wgHooks['AbuseFilter-computeVariable'][] = 
'SFSHooks::abuseFilterComputeVariable';
-$wgHooks['AbuseFilter-generateUserVars'][] = 
'SFSHooks::abuseFilterGenerateUserVars';
-$wgHooks['AbuseFilter-builder'][] = 'SFSHooks::abuseFilterBuilder';
-$wgHooks['getUserPermissionsErrorsExpensive'][] = 
'SFSHooks::onGetUserPermissionsErrorsExpensive';
-$wgHooks['OtherBlockLogLink'][] = 'SFSHooks::onOtherBlockLogLink';
-$wgHooks['UnitTestsList'][] = 'SFSHooks::onUnitTestsList';
-
-$wgMessagesDirs['StopForumSpam'] = __DIR__ . '/i18n';
-
-$wgResourceModules['ext.SFS.formhack'] = array(
-   'scripts' => array(
-   'ext.SFS.formhack.js',
-   ),
-   'dependencies' => array(
-   'mediawiki.jqueryMsg',
-   'mediawiki.special.block', // not sure if this is actually 
required
-   ),
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'StopForumSpam',
-);
-
-$wgGroupPermissions['sysop']['stopforumspam'] = true;
-$wgGroupPermissions['sysop']['sfsblock-bypass'] = true;
-$wgAvailableRights[] = 'sfsblock-bypass';
-$wgAvailableRights[] = 'stopforumspam';
-
diff --git a/extension.json b/extension.json
new file mode 100644
index 000..e96f97e
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,82 @@
+{
+   "name": "StopForumSpam",
+   "version": "0.2.0",
+   "author": [
+   "Kunal Mehta",
+   "Ryan Schmidt"
+   ],
+   "url": "https://www.mediawiki.org/wiki/Extension:StopForumSpam;,
+   "descriptionmsg": "stopforumspam-desc",
+   

[MediaWiki-commits] [Gerrit] mediawiki...StopForumSpam[master]: Add GPL file headers

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327431 )

Change subject: Add GPL file headers
..

Add GPL file headers

Change-Id: I74da975ef55a4a2e436166d6b7a7ed94d767f8aa
---
M BlacklistUpdate.php
M StopForumSpam.body.php
M StopForumSpam.hooks.php
M updateBlacklist.php
4 files changed, 73 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/StopForumSpam 
refs/changes/31/327431/1

diff --git a/BlacklistUpdate.php b/BlacklistUpdate.php
index 4d9b169..de37aff 100644
--- a/BlacklistUpdate.php
+++ b/BlacklistUpdate.php
@@ -1,4 +1,22 @@
 http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
 
 class BlacklistUpdate implements DeferrableUpdate {
private $lineNo, $usedKeys, $data, $skipLines, $finished = false;
diff --git a/StopForumSpam.body.php b/StopForumSpam.body.php
index 17ce8c4..2c92e3b 100644
--- a/StopForumSpam.body.php
+++ b/StopForumSpam.body.php
@@ -1,4 +1,22 @@
 http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
 
 class StopForumSpam {
 
diff --git a/StopForumSpam.hooks.php b/StopForumSpam.hooks.php
index f0a57d4..a0a7276 100644
--- a/StopForumSpam.hooks.php
+++ b/StopForumSpam.hooks.php
@@ -1,5 +1,22 @@
 http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
 
 class SFSHooks {
 
diff --git a/updateBlacklist.php b/updateBlacklist.php
index 92c1dfb..7f29c1f 100644
--- a/updateBlacklist.php
+++ b/updateBlacklist.php
@@ -1,7 +1,21 @@
 http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
  */
 
 $IP = getenv( 'MW_INSTALL_PATH' );
@@ -9,9 +23,11 @@
$IP = __DIR__ . '/../..';
 }
 
-// Require base maintenance class
 require_once( "$IP/maintenance/Maintenance.php" );
 
+/**
+ * Reads the blacklist file and sticks it in memcache
+ */
 class SFSBlacklistUpdate extends Maintenance {
 
public function execute() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I74da975ef55a4a2e436166d6b7a7ed94d767f8aa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/StopForumSpam
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...StopForumSpam[master]: Drop pre-1.24 compat

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327430 )

Change subject: Drop pre-1.24 compat
..

Drop pre-1.24 compat

Change-Id: I5016f5a3859cf4323dbd2b3b91a9a569b8c74fc8
---
M BlacklistUpdate.php
M StopForumSpam.php
M ext.SFS.formhack.js
3 files changed, 3 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/StopForumSpam 
refs/changes/30/327430/1

diff --git a/BlacklistUpdate.php b/BlacklistUpdate.php
index 6fe7157..4d9b169 100644
--- a/BlacklistUpdate.php
+++ b/BlacklistUpdate.php
@@ -70,15 +70,7 @@
 
private function saveData() {
global $wgMemc, $wgSFSBlacklistCacheDuration;
-   if ( is_callable( array( $wgMemc, 'setMulti' ) ) ) {
-   // Available since 1.24
-   $wgMemc->setMulti( $this->data, 
$wgSFSBlacklistCacheDuration );
-   } else {
-   foreach ( $this->data as $key => $val ) {
-   $wgMemc->set( $key, $val, 
$wgSFSBlacklistCacheDuration );
-   }
-   }
-
+   $wgMemc->setMulti( $this->data, $wgSFSBlacklistCacheDuration );
}
 
/**
@@ -124,4 +116,4 @@
}
$this->usedKeys = $state['usedKeys'];
}
-}
\ No newline at end of file
+}
diff --git a/StopForumSpam.php b/StopForumSpam.php
index 99cf26f..38de890 100644
--- a/StopForumSpam.php
+++ b/StopForumSpam.php
@@ -77,8 +77,6 @@
 $wgAutoloadClasses['BlacklistUpdate'] = __DIR__ . '/BlacklistUpdate.php';
 
 $wgHooks['SpecialPageBeforeFormDisplay'][] = 
'SFSHooks::onSpecialPageBeforeFormDisplay';
-$wgHooks['SpecialBlockBeforeFormDisplay'][] =
-   array( 'SFSHooks::onSpecialPageBeforeFormDisplay', 'Block' ); // 1.23 
compat
 $wgHooks['SpecialBlockModifyFormFields'][] = 
'SFSHooks::onSpecialBlockModifyFormFields';
 $wgHooks['BlockIpComplete'][] = 'SFSHooks::onBlockIpComplete';
 $wgHooks['AbuseFilter-computeVariable'][] = 
'SFSHooks::abuseFilterComputeVariable';
diff --git a/ext.SFS.formhack.js b/ext.SFS.formhack.js
index cf814f7..4302e55 100644
--- a/ext.SFS.formhack.js
+++ b/ext.SFS.formhack.js
@@ -4,27 +4,7 @@
 ( function ( mw, $ ) {
$( function () {
var $blockTarget = $( '#mw-bi-target' ),
-   $SFSbox;
-
-   // Back-compat for pre-1.23
-   $SFSbox = $( '#mw-input-wpSFS' );
-   if ( $SFSbox.length === 0 ) {
-   $SFSbox = $( '' )
-   .addClass( 'mw-htmlform-field-HTMLCheckField' )
-   .append( '' )
-   .append( $( '' )
-   .addClass( 'mw-input' )
-   .append( '' )
-   .append( '' )
-   .append( $( '' )
-   .attr( 'for', 'mw-input-wpSFS' )
-   .text( mw.message( 
'stopforumspam-checkbox' ).text() )
-   )
-   );
-
-   $( '#mw-input-wpHardBlock' ).closest( 'tr' ).after( 
$SFSbox );
-   }
-
+   $SFSbox = $( '#mw-input-wpSFS' );
 
function updateBlockOptions( instant ) {
var blocktarget = $.trim( $blockTarget.val() ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5016f5a3859cf4323dbd2b3b91a9a569b8c74fc8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/StopForumSpam
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Linter[master]: Add Linter categories to action=query=siteinfo

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327436 )

Change subject: Add Linter categories to action=query=siteinfo
..

Add Linter categories to action=query=siteinfo

Bug: T153056
Change-Id: Ieed01741d31c9e268a8769a5bc5d566d8020e760
---
M extension.json
M includes/Hooks.php
2 files changed, 18 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Linter 
refs/changes/36/327436/1

diff --git a/extension.json b/extension.json
index 0996932..98fc55d 100644
--- a/extension.json
+++ b/extension.json
@@ -27,6 +27,7 @@
"Hooks": {
"LoadExtensionSchemaUpdates": 
"MediaWiki\\Linter\\Hooks::onLoadExtensionSchemaUpdates",
"EditFormInitialText": 
"MediaWiki\\Linter\\Hooks::onEditFormInitialText",
+   "APIQuerySiteInfoGeneralInfo": 
"MediaWiki\\Linter\\Hooks::onAPIQuerySiteInfoGeneralInfo",
"WikiPageDeletionUpdates": 
"MediaWiki\\Linter\\Hooks::onWikiPageDeletionUpdates"
},
"APIModules": {
diff --git a/includes/Hooks.php b/includes/Hooks.php
index f4ca189..7f4d901 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -20,6 +20,7 @@
 
 namespace MediaWiki\Linter;
 
+use ApiQuerySiteInfo;
 use Content;
 use DatabaseUpdater;
 use EditPage;
@@ -84,4 +85,20 @@
$database->setForPage( [] );
}, __METHOD__ );
}
+
+   /**
+* Hook: APIQuerySiteInfoGeneralInfo
+*
+* Expose categories via action=query=siteinfo
+*
+* @param ApiQuerySiteInfo $api
+* @param array $data
+*/
+   public static function onAPIQuerySiteInfoGeneralInfo( ApiQuerySiteInfo 
$api, array &$data ) {
+   $catManager = new CategoryManager();
+   $data['linter'] = [
+   'errors' => $catManager->getErrors(),
+   'warnings' => $catManager->getWarnings(),
+   ];
+   }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieed01741d31c9e268a8769a5bc5d566d8020e760
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Linter
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...StopForumSpam[master]: Improve extension description

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327434 )

Change subject: Improve extension description
..

Improve extension description

The main purpose of the extension these days is now the blocklist
functionality, so generalize it a bit.

Change-Id: Ie5aed7f5ccca3cc6500dd41f18e548984beb8aff
---
M i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/StopForumSpam 
refs/changes/34/327434/1

diff --git a/i18n/en.json b/i18n/en.json
index 20c6bdb..b8688be 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -4,7 +4,7 @@
"Kunal Mehta"
]
},
-   "stopforumspam-desc": "Allows administrators to send data to 
[http://stopforumspam.com/ stopforumspam.com]",
+   "stopforumspam-desc": "Integration with [http://stopforumspam.com/ 
stopforumspam.com]",
"stopforumspam-checkbox": "Send user information to stopforumspam.com",
"abusefilter-edit-builder-vars-sfs-confidence": "stopforumspam.com 
confidence level",
"stopforumspam-blocked": "Editing from your IP address ($1) has been 
blocked since it has recently been used to spam websites.",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie5aed7f5ccca3cc6500dd41f18e548984beb8aff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/StopForumSpam
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[wmf/1.29.0-wmf.6]: Resolve URLs in show preview against correct base

2016-12-14 Thread Jforrester (Code Review)
Jforrester has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327429 )

Change subject: Resolve URLs in show preview against correct base
..

Resolve URLs in show preview against correct base

Bug: T153277
Change-Id: Icaa6de4618de008fb2024d1dd428114688cb1043
(cherry picked from commit 9728d781260ffeab6284203a6a471e9547e0c5fc)
---
M modules/ve-mw/init/ve.init.mw.ArticleTarget.js
M modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
2 files changed, 10 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/29/327429/1

diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js 
b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
index 4ac11c3..45e2a79 100644
--- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
+++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
@@ -1007,12 +1007,18 @@
wikitext: wikitext,
pst: true
} ).always( function ( response, details ) {
+   var doc, body;
if ( ve.getProp( response, 'visualeditor', 'result' ) 
=== 'success' ) {
-   target.saveDialog.showPreview( 
response.visualeditor.content );
+   doc = target.parseDocument( 
response.visualeditor.content, 'visual' );
+   body = doc.body;
+   // Import body to current document, then 
resolve attributes against original document (parseDocument called #fixBase)
+   document.adoptNode( body );
+   ve.resolveAttributes( body, doc, 
ve.dm.Converter.static.computedAttributes );
+   target.saveDialog.showPreview( $( body 
).contents() );
} else {
target.saveDialog.showPreview( $( '' ).text(
ve.msg( 
'visualeditor-loaderror-message', ve.getProp( details, 'error', 'info' ) || 
'Failed to connect' )
-   ).html() );
+   ) );
}
target.bindSaveDialogClearDiff();
} );
diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
index 0cd2131..b712e7f 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
@@ -127,10 +127,10 @@
 /**
  * Set preview content and show preview panel.
  *
- * @param {string} content Preview HTML
+ * @param {jQuery} content Preview content
  */
 ve.ui.MWSaveDialog.prototype.showPreview = function ( content ) {
-   this.$previewViewer.html( content );
+   this.$previewViewer.empty().append( content );
mw.hook( 'wikipage.content' ).fire( this.$previewViewer );
this.actions.setAbilities( { approve: true } );
this.popPending();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icaa6de4618de008fb2024d1dd428114688cb1043
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.29.0-wmf.6
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Esanders 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[wmf/1.29.0-wmf.6]: Properly clear this.section when switching from VE

2016-12-14 Thread Jforrester (Code Review)
Jforrester has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327428 )

Change subject: Properly clear this.section when switching from VE
..

Properly clear this.section when switching from VE

Bug: T153276
Change-Id: Idc251c73c03bf87b6e6ca716be98b38d4fb68c5e
(cherry picked from commit 17a164363ba1f0a4bfb9f7190c810df0db9d856f)
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/28/327428/1

diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
index 290fe93..85d5037 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
@@ -1631,12 +1631,15 @@
var uri, oldid, prefPromise, dataPromise,
target = this;
 
+   // We may have this.section but VE is always full page at the moment
+   this.section = null;
+
if ( ve.init.target.isModeAvailable( 'source' ) && !leaveVE ) {
if ( discardChanges ) {
dataPromise = mw.libs.ve.targetLoader.requestPageData(
'source',
this.pageName,
-   null, // We may have this.section but VE is 
always full page at the moment
+   this.section,
this.requestedRevId,
this.constructor.name
).then(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc251c73c03bf87b6e6ca716be98b38d4fb68c5e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.29.0-wmf.6
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Esanders 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Properly clear this.section when switching from VE

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327414 )

Change subject: Properly clear this.section when switching from VE
..


Properly clear this.section when switching from VE

Bug: T153276
Change-Id: Idc251c73c03bf87b6e6ca716be98b38d4fb68c5e
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
index 290fe93..85d5037 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
@@ -1631,12 +1631,15 @@
var uri, oldid, prefPromise, dataPromise,
target = this;
 
+   // We may have this.section but VE is always full page at the moment
+   this.section = null;
+
if ( ve.init.target.isModeAvailable( 'source' ) && !leaveVE ) {
if ( discardChanges ) {
dataPromise = mw.libs.ve.targetLoader.requestPageData(
'source',
this.pageName,
-   null, // We may have this.section but VE is 
always full page at the moment
+   this.section,
this.requestedRevId,
this.constructor.name
).then(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idc251c73c03bf87b6e6ca716be98b38d4fb68c5e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: add AppTextViewTest

2016-12-14 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327427 )

Change subject: Hygiene: add AppTextViewTest
..

Hygiene: add AppTextViewTest

This tests shows that simple usage doesn't cause incorrect leading.

Bug: T152213
Change-Id: I4e2c3bb32862b9fa360ab885b9b91e8e1fde7909
---
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLayoutDirection-480dp-en-ltr-font1.0x-light.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLayoutDirection-480dp-en-rtl-font1.0x-light.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLeading-320dp-en-ltr-font1.0x-light.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLeading-320dp-en-ltr-font1.5x-light.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLeading-480dp-en-ltr-font1.0x-light.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLeading-480dp-en-ltr-font1.5x-light.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testWidth-320dp-en-ltr-font1.0x-light-long_text.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testWidth-320dp-en-ltr-font1.0x-light-null_text.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testWidth-320dp-en-ltr-font1.0x-light-short_text.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testWidth-320dp-en-ltr-font1.5x-light-long_text.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testWidth-320dp-en-ltr-font1.5x-light-null_text.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testWidth-320dp-en-ltr-font1.5x-light-short_text.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testWidth-480dp-en-ltr-font1.0x-light-long_text.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testWidth-480dp-en-ltr-font1.0x-light-null_text.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testWidth-480dp-en-ltr-font1.0x-light-short_text.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testWidth-480dp-en-ltr-font1.5x-light-long_text.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testWidth-480dp-en-ltr-font1.5x-light-null_text.png
A 
app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testWidth-480dp-en-ltr-font1.5x-light-short_text.png
A app/src/androidTest/java/org/wikipedia/views/AppTextViewTest.java
19 files changed, 61 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/27/327427/1

diff --git 
a/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLayoutDirection-480dp-en-ltr-font1.0x-light.png
 
b/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLayoutDirection-480dp-en-ltr-font1.0x-light.png
new file mode 100644
index 000..d347971
--- /dev/null
+++ 
b/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLayoutDirection-480dp-en-ltr-font1.0x-light.png
Binary files differ
diff --git 
a/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLayoutDirection-480dp-en-rtl-font1.0x-light.png
 
b/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLayoutDirection-480dp-en-rtl-font1.0x-light.png
new file mode 100644
index 000..ea0af03
--- /dev/null
+++ 
b/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLayoutDirection-480dp-en-rtl-font1.0x-light.png
Binary files differ
diff --git 
a/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLeading-320dp-en-ltr-font1.0x-light.png
 
b/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLeading-320dp-en-ltr-font1.0x-light.png
new file mode 100644
index 000..94dc452
--- /dev/null
+++ 
b/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLeading-320dp-en-ltr-font1.0x-light.png
Binary files differ
diff --git 
a/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLeading-320dp-en-ltr-font1.5x-light.png
 
b/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLeading-320dp-en-ltr-font1.5x-light.png
new file mode 100644
index 000..e3c63f1
--- /dev/null
+++ 
b/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLeading-320dp-en-ltr-font1.5x-light.png
Binary files differ
diff --git 
a/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLeading-480dp-en-ltr-font1.0x-light.png
 
b/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLeading-480dp-en-ltr-font1.0x-light.png
new file mode 100644
index 000..dffc44c
--- /dev/null
+++ 
b/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLeading-480dp-en-ltr-font1.0x-light.png
Binary files differ
diff --git 
a/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLeading-480dp-en-ltr-font1.5x-light.png
 
b/app/screenshots-ref/org.wikipedia.views.AppTextViewTest.testLeading-480dp-en-ltr-font1.5x-light.png
new file mode 100644
index 000..a990a0c
--- /dev/null
+++ 

[MediaWiki-commits] [Gerrit] analytics/discovery-stats[master]: Add client usage of structured data

2016-12-14 Thread Yurik (Code Review)
Yurik has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327418 )

Change subject: Add client usage of structured data
..


Add client usage of structured data

Really gotta add the ability to do this kind of stuff to reportupdater,
but no time right now.

Bug: T153272
Change-Id: I40bac9a1c7ae38455fc0111fc2b4c1bb1206a4cf
---
A bin/daily.sh
M src/Graphite.php
A structured-usage.php
3 files changed, 64 insertions(+), 2 deletions(-)

Approvals:
  Yurik: Verified; Looks good to me, approved



diff --git a/bin/daily.sh b/bin/daily.sh
new file mode 100755
index 000..1a411af
--- /dev/null
+++ b/bin/daily.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+BASEDIR=`dirname "$0"`/..
+
+/usr/bin/php $BASEDIR/structured-usage.php
diff --git a/src/Graphite.php b/src/Graphite.php
index 7a65164..85e848d 100644
--- a/src/Graphite.php
+++ b/src/Graphite.php
@@ -16,8 +16,11 @@
 $this->timestamp = time();
 }
 
-public function record( $metric, $value ) {
-$packet = "{$metric} {$value} {$this->timestamp}";
+public function record( $metric, $value, $timestamp = null ) {
+if ( $timestamp === null ) {
+$timestamp = $this->timestamp;
+}
+$packet = "{$metric} {$value} {$timestamp}";
 $nc = "nc -q0 {$this->host} {$this->port}";
 $command = "echo \"$packet\" | $nc";
 
diff --git a/structured-usage.php b/structured-usage.php
new file mode 100644
index 000..06456a3
--- /dev/null
+++ b/structured-usage.php
@@ -0,0 +1,54 @@
+getSites() as $site ) {
+$dbName = $site->getDbName();
+// Can't quote it, have to validate
+if ( !preg_match( '/^[a-z0-9_]+$/', $dbName ) ) {
+throw new \Exception( "Invalid database '$dbName'" );
+}
+if ( $site->isPrivate() || in_array( $dbName, $wikiBlacklist ) ) {
+continue;
+}
+
+query( "USE $dbName" );
+$siteKey = $site->getFamily() . '.' . $site->getCode();
+
+$res = query( "SELECT count(*) AS num FROM page_props WHERE 
pp_propname='jsonconfig_getdata'" );
+if ( $res && ( $row = $res->fetch() ) && $row['num'] ) {
+$graphite->record( "daily.structured-data.client.pagecount.$siteKey",
+$row['num'],
+$timestamp
+);
+}
+}
+
+function query( $sql ) {
+global $db;
+
+$res = $db->query( $sql );
+if ( !$res ) {
+$err = $db->errorInfo();
+throw new \Exception( "{$err[0]}: {$err[2]}" );
+}
+
+return $res;
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I40bac9a1c7ae38455fc0111fc2b4c1bb1206a4cf
Gerrit-PatchSet: 3
Gerrit-Project: analytics/discovery-stats
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Yurik 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Add class to IPA container, do not use inline style

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/309170 )

Change subject: Add class to IPA container, do not use inline style
..


Add class to IPA container, do not use inline style

This is error prone and there are certain articles where this
will display incorrectly. Using a class allows consumers of the
API to handle this edge case as they wish.

This is applied inside the new /formatted endpoint but not
inside the old mobile content service for backwards compatibility

Additional changes:
* Any instance of removeNodes has been renamed and repurposed
as a legacy parameter.

Bug: T141835
Change-Id: Ica509ac9d2b643be044f4b0be3181a9bc7bc911d
---
M lib/parsoid-access.js
M lib/transformations/hideIPA.js
M lib/transforms.js
M routes/mobile-sections.js
M test/features/mobile-sections/pagecontent-v2.js
M test/features/mobile-sections/pagecontent.js
6 files changed, 72 insertions(+), 30 deletions(-)

Approvals:
  BearND: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/parsoid-access.js b/lib/parsoid-access.js
index 045581f..1cc290e 100644
--- a/lib/parsoid-access.js
+++ b/lib/parsoid-access.js
@@ -129,9 +129,12 @@
 /**
  * @param {Object} app: the application object
  * @param {Object} req: the request object
+ * @param {Boolean} [legacy] if enabled will apply additional transformations
+ * including a legacy version of relocation of first paragraph
+ * and hiding IPA via an inline style rather than clas.
  * @return {promise} Returns a promise to retrieve the page content from 
Parsoid
  */
-function pageContentPromise(app, req) {
+function pageContentPromise(app, req, legacy) {
 return getParsoidHtml(app, req)
 .then((response) => {
 const page = { revision: getRevisionFromEtag(response.headers) };
@@ -142,7 +145,7 @@
 parseProperty.parseGeo(doc, page);
 parseProperty.parseSpokenWikipedia(doc, page);
 
-transforms.stripUnneededMarkup(doc);
+transforms.stripUnneededMarkup(doc, legacy);
 addSectionDivs(doc);
 transforms.addRequiredMarkup(doc);
 
diff --git a/lib/transformations/hideIPA.js b/lib/transformations/hideIPA.js
index 0b7e4b6..bc94e43 100644
--- a/lib/transformations/hideIPA.js
+++ b/lib/transformations/hideIPA.js
@@ -10,7 +10,11 @@
 
 'use strict';
 
-function hideIPA(content) {
+/**
+ * @param {Document} content
+ * @param {Boolean} [legacy]
+ */
+function hideIPA(content, legacy) {
 const spans = content.querySelectorAll("span.IPA");
 for (let i = 0; i < spans.length; i++) {
 const parentSpan = spans[i].parentNode;
@@ -41,8 +45,12 @@
 containerSpan.appendChild(buttonDiv);
 containerSpan.appendChild(parentSpan);
 
-// set initial visibility
-parentSpan.style.display = 'none';
+if (legacy) {
+parentSpan.style.display = 'none';
+}
+// markup parent with class so that it can be hidden if required
+const parentSpanClass = parentSpan.className;
+parentSpan.className = parentSpanClass ? `${parentSpanClass} mcs-ipa` 
: 'mcs-ipa';
 }
 }
 
diff --git a/lib/transforms.js b/lib/transforms.js
index b660912..481bd90 100644
--- a/lib/transforms.js
+++ b/lib/transforms.js
@@ -194,9 +194,9 @@
 /**
  * Destructive, non-Parsoid-specific transforms previously performed in the 
app.
  */
-function _removeUnwantedWikiContentForApp(doc) {
+function _removeUnwantedWikiContentForApp(doc, legacy) {
 hideRedLinks.hideRedLinks(doc);
-hideIPA.hideIPA(doc);
+hideIPA.hideIPA(doc, legacy);
 }
 
 // /**
@@ -222,12 +222,12 @@
 /**
  * Nukes stuff from the DOM we don't want for pages from Parsoid.
  */
-transforms.stripUnneededMarkup = function(doc) {
+transforms.stripUnneededMarkup = function(doc, legacy) {
 _runAllSectionsTransforms(doc);
 // runLeadSectionTransforms(doc);
 _applyOptionalParsoidSpecificTransformations(doc);
 
-_removeUnwantedWikiContentForApp(doc);
+_removeUnwantedWikiContentForApp(doc, legacy);
 };
 
 transforms.addRequiredMarkup = function(doc) {
diff --git a/routes/mobile-sections.js b/routes/mobile-sections.js
index 75bd57c..1340913 100644
--- a/routes/mobile-sections.js
+++ b/routes/mobile-sections.js
@@ -77,13 +77,13 @@
 
 /*
  * @param {Object} input
- * @param {Boolean} [removeNodes] whether to remove nodes from the lead text
+ * @param {Boolean} [legacy] whether to perform legacy transformations
  * @return {Object} lead json
  */
-function buildLead(input, removeNodes) {
+function buildLead(input, legacy) {
 const lead = domino.createDocument(input.page.sections[0].text);
 
-if (!removeNodes) {
+if (legacy) {
 // Move the first good paragraph up for any page except main pages.
 // It's ok to do unconditionally since we throw away the page
 // content if this turns out to be a main page.
@@ -91,16 +91,16 @@
   

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Resolve URLs in show preview against correct base

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327425 )

Change subject: Resolve URLs in show preview against correct base
..


Resolve URLs in show preview against correct base

Bug: T153277
Change-Id: Icaa6de4618de008fb2024d1dd428114688cb1043
---
M modules/ve-mw/init/ve.init.mw.ArticleTarget.js
M modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
2 files changed, 10 insertions(+), 4 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js 
b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
index a68c233..848de5a 100644
--- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
+++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
@@ -1007,12 +1007,18 @@
wikitext: wikitext,
pst: true
} ).always( function ( response, details ) {
+   var doc, body;
if ( ve.getProp( response, 'visualeditor', 'result' ) 
=== 'success' ) {
-   target.saveDialog.showPreview( 
response.visualeditor.content );
+   doc = target.parseDocument( 
response.visualeditor.content, 'visual' );
+   body = doc.body;
+   // Import body to current document, then 
resolve attributes against original document (parseDocument called #fixBase)
+   document.adoptNode( body );
+   ve.resolveAttributes( body, doc, 
ve.dm.Converter.static.computedAttributes );
+   target.saveDialog.showPreview( $( body 
).contents() );
} else {
target.saveDialog.showPreview( $( '' ).text(
ve.msg( 
'visualeditor-loaderror-message', ve.getProp( details, 'error', 'info' ) || 
'Failed to connect' )
-   ).html() );
+   ) );
}
target.bindSaveDialogClearDiff();
} );
diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
index 0cd2131..b712e7f 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
@@ -127,10 +127,10 @@
 /**
  * Set preview content and show preview panel.
  *
- * @param {string} content Preview HTML
+ * @param {jQuery} content Preview content
  */
 ve.ui.MWSaveDialog.prototype.showPreview = function ( content ) {
-   this.$previewViewer.html( content );
+   this.$previewViewer.empty().append( content );
mw.hook( 'wikipage.content' ).fire( this.$previewViewer );
this.actions.setAbilities( { approve: true } );
this.popPending();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icaa6de4618de008fb2024d1dd428114688cb1043
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...FlaggedRevs[master]: Autopromote: Remove superflous condition in APCOND_EDITCOUNT

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/264232 )

Change subject: Autopromote: Remove superflous condition in APCOND_EDITCOUNT
..


Autopromote: Remove superflous condition in APCOND_EDITCOUNT

This removes an extra condition in the core APCOND_EDITCOUNT autopromote
criteria. Although it is stated that we can exclude the last X days from
the edit counts, this is not possible for core APCOND_EDITCOUNT as seen
in Autopromote.php. This only works for FlaggedRevs' autopromote
conditions APCOND_FR_CONTENTEDITCOUNT and APCOND_FR_CHECKEDEDITCOUNT.

Change-Id: Ie3d9af5f97d03fb2d3a7d913f3a9210cc7dbd0b4
---
M FlaggedRevs.php
M FlaggedRevs.setup.php
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/FlaggedRevs.php b/FlaggedRevs.php
index d78e9e1..52041a8 100644
--- a/FlaggedRevs.php
+++ b/FlaggedRevs.php
@@ -130,7 +130,7 @@
 $wgFlaggedRevsAutopromote = array(
'days'  => 60, # days since registration
'edits' => 250, # total edit count
-   'excludeLastDays'   => 1, # exclude the last X days of edits from 
edit counts
+   'excludeLastDays'   => 1, # exclude the last X days of edits from 
below edit counts
'benchmarks'=> 15, # number of "spread out" edits
'spacing'   => 3, # number of days between these edits (the 
"spread")
// Either totalContentEdits reqs OR totalCheckedEdits requirements 
needed
@@ -151,7 +151,7 @@
 $wgFlaggedRevsAutoconfirm = array(
'days'  => 30, # days since registration
'edits' => 50, # total edit count
-   'excludeLastDays'   => 2, # exclude the last X days of edits from 
edit counts
+   'excludeLastDays'   => 2, # exclude the last X days of edits from 
below edit counts
'benchmarks'=> 7, # number of "spread out" edits
'spacing'   => 3, # number of days between these edits (the 
"spread")
// Either totalContentEdits reqs OR totalCheckedEdits requirements 
needed
diff --git a/FlaggedRevs.setup.php b/FlaggedRevs.setup.php
index cefde40..b48ab72 100644
--- a/FlaggedRevs.setup.php
+++ b/FlaggedRevs.setup.php
@@ -60,7 +60,7 @@
if ( is_array( $req ) ) {
$criteria = array( '&', // AND
array( APCOND_AGE, $req['days']*86400 ),
-   array( APCOND_EDITCOUNT, $req['edits'], 
$req['excludeLastDays']*86400 ),
+   array( APCOND_EDITCOUNT, $req['edits'] ),
array( APCOND_FR_EDITSUMMARYCOUNT, 
$req['editComments'] ),
array( APCOND_FR_UNIQUEPAGECOUNT, 
$req['uniqueContentPages'] ),
array( APCOND_FR_EDITSPACING, $req['spacing'], 
$req['benchmarks'] ),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie3d9af5f97d03fb2d3a7d913f3a9210cc7dbd0b4
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: Cenarium 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: Luke081515 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PageAssessments[master]: Adding IGNORE in case 2 records for the same project are add...

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327399 )

Change subject: Adding IGNORE in case 2 records for the same project are added 
at once
..


Adding IGNORE in case 2 records for the same project are added at once

If duplicate assessment records for the same project are added to an
article, we should ignore the duplicates. Otherwise it causes
duplicate key errors.

Also adding more code comments.

Bug: T152080
Change-Id: I417f25bb52c9b064f736b00b756ec29217dd5f78
---
M PageAssessmentsBody.php
1 file changed, 11 insertions(+), 3 deletions(-)

Approvals:
  jenkins-bot: Verified
  Samwilson: Looks good to me, approved



diff --git a/PageAssessmentsBody.php b/PageAssessmentsBody.php
index baba514..0c3dde3 100644
--- a/PageAssessmentsBody.php
+++ b/PageAssessmentsBody.php
@@ -43,19 +43,25 @@
 
$pageId = $titleObj->getArticleID();
$revisionId = $titleObj->getLatestRevID();
-   // Compile a list of projects to find out which ones to be 
deleted afterwards
+   // Compile a list of projects found in the parserData to find 
out which
+   // assessment records need to be inserted, deleted, or updated.
$projects = array();
foreach ( $assessmentData as $parserData ) {
+   // If the name of the project is set...
if ( isset( $parserData[0] ) && $parserData[0] !== '' ) 
{
-   // For each project, get the corresponding ID 
from page_assessments_projects table
+   // ...get the corresponding ID from 
page_assessments_projects table.
$projectId = self::getProjectId( $parserData[0] 
);
+   // If there is no existing project by that 
name, add it to the table.
if ( $projectId === false ) {
$projectId = self::insertProject( 
$parserData[0] );
}
+   // Add the project's ID to the array.
$projects[$parserData[0]] = $projectId;
}
}
+   // Get a list of all the projects previously assigned to the 
page.
$projectsInDb = self::getAllProjects( $pageId, 
self::READ_LATEST );
+
$toInsert = array_diff( $projects, $projectsInDb );
$toDelete = array_diff( $projectsInDb, $projects );
$toUpdate = array_intersect( $projects, $projectsInDb );
@@ -203,7 +209,9 @@
 */
public static function insertRecord( $values ) {
$dbw = wfGetDB( DB_MASTER );
-   $dbw->insert( 'page_assessments', $values, __METHOD__ );
+   // Use IGNORE in case 2 records for the same project are added 
at once.
+   // This normally shouldn't happen, but is possible. (See 
T152080)
+   $dbw->insert( 'page_assessments', $values, __METHOD__, [ 
'IGNORE' ] );
return true;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I417f25bb52c9b064f736b00b756ec29217dd5f78
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/PageAssessments
Gerrit-Branch: master
Gerrit-Owner: Kaldari 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: MusikAnimal 
Gerrit-Reviewer: Niharika29 
Gerrit-Reviewer: Samwilson 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: hhvm: add missing " in hhvm.default.systemd.erb

2016-12-14 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327426 )

Change subject: hhvm: add missing " in hhvm.default.systemd.erb
..

hhvm: add missing " in hhvm.default.systemd.erb

This popped up as " /etc/init.d/hhvm: 10: /etc/default/hhvm: Syntax
error: Unterminated quoted string" on mw1201 (and others).

Change-Id: I0e14f3509c3ed5ac44adfbad101efc8abe553acb
---
M modules/hhvm/templates/hhvm.default.systemd.erb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/26/327426/1

diff --git a/modules/hhvm/templates/hhvm.default.systemd.erb 
b/modules/hhvm/templates/hhvm.default.systemd.erb
index 389cd82..aced7f6 100644
--- a/modules/hhvm/templates/hhvm.default.systemd.erb
+++ b/modules/hhvm/templates/hhvm.default.systemd.erb
@@ -3,7 +3,7 @@
 
 # Run the FastCGI server as this user.
 RUN_AS_USER="<%= @user %>"
-RUN_AS_GROUP="<%= @group %>
+RUN_AS_GROUP="<%= @group %>"
 
 ## Add additional arguments to the hhvm service start up that you can't put in 
CONFIG_FILE for some reason.
 # ADDITIONAL_ARGS=

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e14f3509c3ed5ac44adfbad101efc8abe553acb
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Resolve URLs in show preview against correct base

2016-12-14 Thread Esanders (Code Review)
Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327425 )

Change subject: Resolve URLs in show preview against correct base
..

Resolve URLs in show preview against correct base

Bug: T153277
Change-Id: Icaa6de4618de008fb2024d1dd428114688cb1043
---
M modules/ve-mw/init/ve.init.mw.ArticleTarget.js
M modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
2 files changed, 11 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/25/327425/1

diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js 
b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
index a68c233..5c2a57a 100644
--- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
+++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
@@ -1007,12 +1007,18 @@
wikitext: wikitext,
pst: true
} ).always( function ( response, details ) {
+   var doc, body;
if ( ve.getProp( response, 'visualeditor', 'result' ) 
=== 'success' ) {
-   target.saveDialog.showPreview( 
response.visualeditor.content );
+   doc = target.parseDocument( 
response.visualeditor.content, 'visual' );
+   body = doc.body;
+   // Import body to current document, then 
resolve attributes against original document (parseDocument called #fixBase)
+   document.importNode( body );
+   ve.resolveAttributes( body, doc, 
ve.dm.Converter.static.computedAttributes );
+   target.saveDialog.showPreview( $( body 
).contents() );
} else {
target.saveDialog.showPreview( $( '' ).text(
ve.msg( 
'visualeditor-loaderror-message', ve.getProp( details, 'error', 'info' ) || 
'Failed to connect' )
-   ).html() );
+   ) );
}
target.bindSaveDialogClearDiff();
} );
diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
index 0cd2131..d09cbad 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
@@ -127,10 +127,10 @@
 /**
  * Set preview content and show preview panel.
  *
- * @param {string} content Preview HTML
+ * @param {jQuery} content Preview content
  */
-ve.ui.MWSaveDialog.prototype.showPreview = function ( content ) {
-   this.$previewViewer.html( content );
+ve.ui.MWSaveDialog.prototype.showPreview = function ( element ) {
+   this.$previewViewer.empty().append( element );
mw.hook( 'wikipage.content' ).fire( this.$previewViewer );
this.actions.setAbilities( { approve: true } );
this.popPending();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icaa6de4618de008fb2024d1dd428114688cb1043
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Add a daily discovery stats cron

2016-12-14 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327424 )

Change subject: Add a daily discovery stats cron
..

Add a daily discovery stats cron

Bug: T153272
Change-Id: I6b3306d39774ab9a9f23ce2cc0fdfc0ffad1e21b
Depends-On: I40bac9a1c7ae38455fc0111fc2b4c1bb1206a4cf
---
M modules/statistics/manifests/discovery.pp
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/24/327424/1

diff --git a/modules/statistics/manifests/discovery.pp 
b/modules/statistics/manifests/discovery.pp
index bb74c77..64bef37 100644
--- a/modules/statistics/manifests/discovery.pp
+++ b/modules/statistics/manifests/discovery.pp
@@ -73,4 +73,11 @@
 user=> $user,
   }
 
+  cron { 'discovery-stats-daily':
+command => "${scripts_dir}/bin/daily.sh >> ${log_dir}/daily.log 2>&1",
+hour=> 3,
+minute  => '14',
+require => Git::Clone['analytics/discovery-stats'],
+user=> $user,
+  }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6b3306d39774ab9a9f23ce2cc0fdfc0ffad1e21b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: MaxSem 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...UploadWizard[wmf/1.29.0-wmf.6]: mw.FormDataTransport: Update check for already completed chu...

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327400 )

Change subject: mw.FormDataTransport: Update check for already completed 
chunked uploads
..


mw.FormDataTransport: Update check for already completed chunked uploads

MediaWiki core commit 4e6810e4a2c1d821d8d108c7974ac16917561764
caused the error message to change.

(We're working to switch the error format to the new one introduced in
that commit, but I58b9a7ed054ad0084bcd7180d92bd69ccc7ed129 is still
work in progress.)

Bug: T153231
Change-Id: I8d5d9fd23bc649bd85a4aeaa0ea3bf20d20a4cf2
(cherry picked from commit 3e14eac7fb0ad7e919a6ea6c3f68a03ae43ddecf)
---
M resources/transports/mw.FormDataTransport.js
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/transports/mw.FormDataTransport.js 
b/resources/transports/mw.FormDataTransport.js
index 6208577..812cd35 100644
--- a/resources/transports/mw.FormDataTransport.js
+++ b/resources/transports/mw.FormDataTransport.js
@@ -275,7 +275,7 @@
if (
response.error &&
response.error.code === 'stashfailed' &&
-   response.error.info === 'Chunked upload 
is already completed, check status for details'
+   response.error.info === 'Chunked upload 
is already completed, check status for details.'
) {
return transport.retryWithMethod( 
'checkStatus' );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8d5d9fd23bc649bd85a4aeaa0ea3bf20d20a4cf2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: wmf/1.29.0-wmf.6
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Beta Cluster: Make it easy to run Flow scripts only on enabl...

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327377 )

Change subject: Beta Cluster: Make it easy to run Flow scripts only on enabled 
wikis
..


Beta Cluster: Make it easy to run Flow scripts only on enabled wikis

Add flow_computed_labs.dblist, so we can use that to run
foreachwikiindblist without getting a huge number of errors (which
happens if you use flow.dblist).

Change-Id: I80dd50888d6ff58dfa24f47d62d0dbc4c73202af
---
A dblists/flow_computed_labs.dblist
A dblists/flow_only_labs.dblist
M tests/dblistTest.php
M wmf-config/InitialiseSettings-labs.php
4 files changed, 21 insertions(+), 5 deletions(-)

Approvals:
  Alex Monk: Looks good to me, approved
  Catrope: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/dblists/flow_computed_labs.dblist 
b/dblists/flow_computed_labs.dblist
new file mode 100644
index 000..faf230c
--- /dev/null
+++ b/dblists/flow_computed_labs.dblist
@@ -0,0 +1 @@
+%% all-labs.dblist - nonflow.dblist - private.dblist - fishbowl.dblist + 
flow_only_labs.dblist
diff --git a/dblists/flow_only_labs.dblist b/dblists/flow_only_labs.dblist
new file mode 100644
index 000..3335cc5
--- /dev/null
+++ b/dblists/flow_only_labs.dblist
@@ -0,0 +1,2 @@
+enwiki
+en_rtlwiki
diff --git a/tests/dblistTest.php b/tests/dblistTest.php
index 78b6c89..ea3c78d 100644
--- a/tests/dblistTest.php
+++ b/tests/dblistTest.php
@@ -55,9 +55,12 @@
# FIXME ideally we want to clean those files from any old 
dbnames
$skip = array(
 
-   # 'all-labs' is for the 'beta' project which has wikis 
not yet
-   # available in production ('all'). So we do not verify 
it.
+   # 'all-labs' and 'flow_only_labs' are for the 'beta' 
project, which
+   # has wikis not yet available in production ('all'). So 
we do not
+   # verify it.
'all-labs',
+   'flow_computed_labs',
+   'flow_only_labs',
 
'closed',
'deleted',
diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 2130cf5..8619227 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -26,9 +26,19 @@
// Add a wikitag of 'beta' that can be used to merge beta specific and
// default settings by using `'+beta' => array(...),`
$wgConf->siteParamsCallback = function( $conf, $wiki ) {
+   $wikiTags = [ 'beta' ];
+
+   $betaDblistTags = [ 'flow_only_labs' ];
+   foreach ( $betaDblistTags as $tag ) {
+   $dblist = MWWikiversions::readDbListFile( $tag );
+   if ( in_array( $wiki, $dblist ) ) {
+   $wikiTags[] = $tag;
+   }
+   }
+
return [
'params' => [ 'variant' => 'beta' ],
-   'tags' => [ 'beta' ],
+   'tags' => $wikiTags
];
};
 
@@ -355,8 +365,8 @@
],
 
'wmgUseFlow' => [
-   'enwiki' => true,
-   'en_rtlwiki' => true,
+   // 'flow_computed_labs' is full set applicable on Beta 
Cluster.
+   'flow_only_labs' => true,
],
# No separate Flow DB or cluster (yet) for labs.
'-wmgFlowDefaultWikiDb' => [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I80dd50888d6ff58dfa24f47d62d0dbc4c73202af
Gerrit-PatchSet: 4
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Mooeypoo 
Gerrit-Reviewer: Sbisson 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[wmf/1.29.0-wmf.6]: Fix fullscreen map not closing properly

2016-12-14 Thread Yurik (Code Review)
Yurik has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327423 )

Change subject: Fix fullscreen map not closing properly
..

Fix fullscreen map not closing properly

Bug: T153100
Change-Id: I6288b79483962f06b031e9b77f19826c1f311525
(cherry picked from commit 6baad5148be53d7880bff35129e8be9663a0c70c)
---
M modules/dialog/index.js
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer 
refs/changes/23/327423/1

diff --git a/modules/dialog/index.js b/modules/dialog/index.js
index 683da45..b735471 100644
--- a/modules/dialog/index.js
+++ b/modules/dialog/index.js
@@ -98,6 +98,7 @@
 
if ( map.useRouter && !routerEnabled ) {
router.on( 'route', 
closeIfNotMapRoute );
+   router.route( '', 
closeIfNotMapRoute );
routerEnabled = true;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6288b79483962f06b031e9b77f19826c1f311525
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: wmf/1.29.0-wmf.6
Gerrit-Owner: Yurik 
Gerrit-Reviewer: JGirault 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[wmf/1.29.0-wmf.6]: Revert "Add Terms of Use link on static and dynamic maps"

2016-12-14 Thread Alex Monk (Code Review)
Alex Monk has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327422 )

Change subject: Revert "Add Terms of Use link on static and dynamic maps"
..


Revert "Add Terms of Use link on static and dynamic maps"

This reverts commit eb2d8ca7b2f64e3bf967468ab6be09765d57c4d1.

Change-Id: Ia315d2a1cb3c0cee97ff363adb99482fecc0e4c0
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M modules/staticframe/staticframe.js
M styles/control-attribution.less
5 files changed, 12 insertions(+), 37 deletions(-)

Approvals:
  Alex Monk: Verified; Looks good to me, approved



diff --git a/extension.json b/extension.json
index 73935eb..6b2729d 100644
--- a/extension.json
+++ b/extension.json
@@ -300,7 +300,6 @@
"modules/staticframe/staticframe.js"
],
"messages": [
-   "kartographer-attribution-short",
"kartographer-fullscreen-text"
],
"targets": [
diff --git a/i18n/en.json b/i18n/en.json
index 016f501..ba868dd 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -14,10 +14,9 @@
"apihelp-query+mapdata-param-continue": "Use this parameter to continue 
iterating through results",
"apihelp-query+mapdata-param-groups": "Pipe-separated groups to return 
data for",
"apihelp-query+mapdata-param-limit": "Data for how many pages to 
return",
-   "kartographer-attribution": 
"[https://wikimediafoundation.org/wiki/Maps_Terms_of_Use Wikimedia maps] | Map 
data © [https://www.openstreetmap.org/copyright OpenStreetMap contributors]",
+   "kartographer-attribution": "Wikimedia maps | Map data © 
[https://www.openstreetmap.org/copyright OpenStreetMap contributors]",
"kartographer-attribution-externaldata": "$1: $2",
"kartographer-attribution-externaldata-query": "query",
-   "kartographer-attribution-short": 
"[https://wikimediafoundation.org/wiki/Maps_Terms_of_Use Wikimedia] | © 
[https://www.openstreetmap.org/copyright OpenStreetMap]",
"kartographer-broken-category": "Pages with broken maps",
"kartographer-broken-category-desc": "The page includes an invalid map 
usage",
"kartographer-desc": "Allows maps to be added to the wiki pages",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 2f6b323..54569f2 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -18,10 +18,9 @@
"apihelp-query+mapdata-param-continue": 
"{{doc-apihelp-param|query+mapdata|continue}}",
"apihelp-query+mapdata-param-groups": 
"{{doc-apihelp-param|query+mapdata|groups}}",
"apihelp-query+mapdata-param-limit": 
"{{doc-apihelp-param|query+mapdata|limit}}",
-   "kartographer-attribution": "Attribution text shown at the bottom of 
the map.",
-   "kartographer-attribution-externaldata": "Formats external data layer 
attribution: $1 is external data service (e.g. Wikidata), $2 is link to 
external data link (e.g. query).",
+   "kartographer-attribution": "Attribution text shown at the bottom of 
the map. $1 is external data service (e.g. Wikidata), $2 is link to external 
data link (e.g. query)",
+   "kartographer-attribution-externaldata": "Formats external data layer 
attribution",
"kartographer-attribution-externaldata-query": "Label for external data 
'query'.\n{{Identical|Query}}",
-   "kartographer-attribution-short": "Shorter version of the attribution 
text shown at the bottom of the map, for static maps embedded in the article.",
"kartographer-broken-category": "Name of the tracking category",
"kartographer-broken-category-desc": "Description on 
[[Special:TrackingCategories]] for the {{msg-mw|kartographer-broken-category}} 
tracking category.",
"kartographer-desc": 
"{{desc|name=Kartographer|url=https://www.mediawiki.org/wiki/Extension:Kartographer}};,
diff --git a/modules/staticframe/staticframe.js 
b/modules/staticframe/staticframe.js
index ac36428..09e55dc 100644
--- a/modules/staticframe/staticframe.js
+++ b/modules/staticframe/staticframe.js
@@ -90,11 +90,6 @@
$div = $( '' ).append( button.$element );
 
$container.append( $div );
-   $container.append(
-   '' +
-   mw.message( 
'kartographer-attribution-short' ).parse() +
-   ''
-   );
} );
 
$container.attr( 'href', '#/map/' + index );
diff --git a/styles/control-attribution.less b/styles/control-attribution.less
index 75e5233..a7f1af1 100644
--- a/styles/control-attribution.less
+++ b/styles/control-attribution.less
@@ -1,40 +1,23 @@
 /* == Attribution control == */
-@import '../lib/wmui-base.less';
-

[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[wmf/1.29.0-wmf.6]: Revert "Add Terms of Use link on static and dynamic maps"

2016-12-14 Thread Alex Monk (Code Review)
Hello JGirault, Yurik, jenkins-bot,

I'd like you to do a code review.  Please visit

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

to review the following change.


Change subject: Revert "Add Terms of Use link on static and dynamic maps"
..

Revert "Add Terms of Use link on static and dynamic maps"

This reverts commit eb2d8ca7b2f64e3bf967468ab6be09765d57c4d1.

Change-Id: Ia315d2a1cb3c0cee97ff363adb99482fecc0e4c0
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M modules/staticframe/staticframe.js
M styles/control-attribution.less
5 files changed, 12 insertions(+), 37 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer 
refs/changes/22/327422/1

diff --git a/extension.json b/extension.json
index 73935eb..6b2729d 100644
--- a/extension.json
+++ b/extension.json
@@ -300,7 +300,6 @@
"modules/staticframe/staticframe.js"
],
"messages": [
-   "kartographer-attribution-short",
"kartographer-fullscreen-text"
],
"targets": [
diff --git a/i18n/en.json b/i18n/en.json
index 016f501..ba868dd 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -14,10 +14,9 @@
"apihelp-query+mapdata-param-continue": "Use this parameter to continue 
iterating through results",
"apihelp-query+mapdata-param-groups": "Pipe-separated groups to return 
data for",
"apihelp-query+mapdata-param-limit": "Data for how many pages to 
return",
-   "kartographer-attribution": 
"[https://wikimediafoundation.org/wiki/Maps_Terms_of_Use Wikimedia maps] | Map 
data © [https://www.openstreetmap.org/copyright OpenStreetMap contributors]",
+   "kartographer-attribution": "Wikimedia maps | Map data © 
[https://www.openstreetmap.org/copyright OpenStreetMap contributors]",
"kartographer-attribution-externaldata": "$1: $2",
"kartographer-attribution-externaldata-query": "query",
-   "kartographer-attribution-short": 
"[https://wikimediafoundation.org/wiki/Maps_Terms_of_Use Wikimedia] | © 
[https://www.openstreetmap.org/copyright OpenStreetMap]",
"kartographer-broken-category": "Pages with broken maps",
"kartographer-broken-category-desc": "The page includes an invalid map 
usage",
"kartographer-desc": "Allows maps to be added to the wiki pages",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 2f6b323..54569f2 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -18,10 +18,9 @@
"apihelp-query+mapdata-param-continue": 
"{{doc-apihelp-param|query+mapdata|continue}}",
"apihelp-query+mapdata-param-groups": 
"{{doc-apihelp-param|query+mapdata|groups}}",
"apihelp-query+mapdata-param-limit": 
"{{doc-apihelp-param|query+mapdata|limit}}",
-   "kartographer-attribution": "Attribution text shown at the bottom of 
the map.",
-   "kartographer-attribution-externaldata": "Formats external data layer 
attribution: $1 is external data service (e.g. Wikidata), $2 is link to 
external data link (e.g. query).",
+   "kartographer-attribution": "Attribution text shown at the bottom of 
the map. $1 is external data service (e.g. Wikidata), $2 is link to external 
data link (e.g. query)",
+   "kartographer-attribution-externaldata": "Formats external data layer 
attribution",
"kartographer-attribution-externaldata-query": "Label for external data 
'query'.\n{{Identical|Query}}",
-   "kartographer-attribution-short": "Shorter version of the attribution 
text shown at the bottom of the map, for static maps embedded in the article.",
"kartographer-broken-category": "Name of the tracking category",
"kartographer-broken-category-desc": "Description on 
[[Special:TrackingCategories]] for the {{msg-mw|kartographer-broken-category}} 
tracking category.",
"kartographer-desc": 
"{{desc|name=Kartographer|url=https://www.mediawiki.org/wiki/Extension:Kartographer}};,
diff --git a/modules/staticframe/staticframe.js 
b/modules/staticframe/staticframe.js
index ac36428..09e55dc 100644
--- a/modules/staticframe/staticframe.js
+++ b/modules/staticframe/staticframe.js
@@ -90,11 +90,6 @@
$div = $( '' ).append( button.$element );
 
$container.append( $div );
-   $container.append(
-   '' +
-   mw.message( 
'kartographer-attribution-short' ).parse() +
-   ''
-   );
} );
 
$container.attr( 'href', '#/map/' + index );
diff --git a/styles/control-attribution.less b/styles/control-attribution.less
index 75e5233..a7f1af1 100644
--- a/styles/control-attribution.less
+++ 

[MediaWiki-commits] [Gerrit] integration/docroot[master]: doc: Move VisualEditor under MediaWiki extensions

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/316202 )

Change subject: doc: Move VisualEditor under MediaWiki extensions
..


doc: Move VisualEditor under MediaWiki extensions

The API documenation is for the MediaWiki extension, not the standalone
library (though we should publish separate documentation for that too).

Change-Id: Ic442351eeb6e91cf211e4f260b20d3b3a06f2d9a
---
M org/wikimedia/doc/default.html
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/org/wikimedia/doc/default.html b/org/wikimedia/doc/default.html
index a32931c..e11bd19 100644
--- a/org/wikimedia/doc/default.html
+++ b/org/wikimedia/doc/default.html
@@ -26,7 +26,6 @@
Timestamp
Unicode JS
utfnormal
-   VisualEditor
WaitConditionLoop
WrappedString
 
@@ -55,6 +54,7 @@
PHP


+   VisualEditor
 
 Pywikibot
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic442351eeb6e91cf211e4f260b20d3b3a06f2d9a
Gerrit-PatchSet: 2
Gerrit-Project: integration/docroot
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Make 'flow-skip-summary' clearer

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/313773 )

Change subject: Make 'flow-skip-summary' clearer
..


Make 'flow-skip-summary' clearer

"Skip summary" seems like it is asking for a summary of why it is being
skipped. A plain "Skip" makes more sense and conveys that you can skip
the form rather than the implied but unclear "Skip [adding a] summary".

Change-Id: I55672163df2bb1b6b85214f58e18ba1a3751f3d2
---
M i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index f1fa1bd..f349246 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -75,7 +75,7 @@
"flow-post-actions": "Actions",
"flow-topic-actions": "Actions",
"flow-cancel": "Cancel",
-   "flow-skip-summary": "Skip summary",
+   "flow-skip-summary": "Skip",
"flow-edit-summary-placeholder": "Describe briefly the outcome of this 
discussion",
"flow-summary-authored": "Summary by $1",
"flow-summary-edited": "Summary last {{GENDER:$1|edited}} by $1",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I55672163df2bb1b6b85214f58e18ba1a3751f3d2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Pginer 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: scap clean: provide l10n-only option for pruning stuff

2016-12-14 Thread Chad (Code Review)
Chad has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327421 )

Change subject: scap clean: provide l10n-only option for pruning stuff
..

scap clean: provide l10n-only option for pruning stuff

Change-Id: If43d185beed733ad1437a0dd3c2976037dcd1171
---
M scap/plugins/clean.py
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/21/327421/1

diff --git a/scap/plugins/clean.py b/scap/plugins/clean.py
index 495f2ce..c999f7f 100644
--- a/scap/plugins/clean.py
+++ b/scap/plugins/clean.py
@@ -12,6 +12,8 @@
 """ Scap sub-command to clean old branches """
 
 @cli.argument('branch', help='The name of the branch to clean.')
+@cli.argument('--l10n-only', action='store_true',
+  help='Only prune old l10n cache files.')
 def main(self, *extra_args):
 """ Clean old branches from the cluster for space savings! """
 
@@ -41,5 +43,7 @@
 '%d apaches had clean errors', failed)
 
 def _clean_command(self, location):
-return 'rm -fR %s' % os.path.join(
-location, 'php-%s' % self.arguments.branch)
+path = os.path.join(location, 'php-%s' % self.arguments.branch)
+if self.arguments.l10n_only:
+path = os.path.join(path, 'cache', 'l10n', '*.cdb')
+return 'rm -fR %s' % path

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If43d185beed733ad1437a0dd3c2976037dcd1171
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Chad 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Use getimagesizefromstring() instead of getimagesize()

2016-12-14 Thread Rudloff (Code Review)
Rudloff has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327420 )

Change subject: Use getimagesizefromstring() instead of getimagesize()
..

Use getimagesizefromstring() instead of getimagesize()

getimagesize() outputs warnings when the file does not exist
or when allow_url_fopen is disabled.
Now we use MWHttpRequest to retrieve the file instead
so we don't have a warning if the file can't be retrieved.

Bug: T153250
Change-Id: If1365924e52625a0c6346411faae300b2f83c25a
---
M includes/api/ApiWebappManifest.php
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/20/327420/1

diff --git a/includes/api/ApiWebappManifest.php 
b/includes/api/ApiWebappManifest.php
index cac0de7..8e09508 100644
--- a/includes/api/ApiWebappManifest.php
+++ b/includes/api/ApiWebappManifest.php
@@ -28,11 +28,16 @@
$appleTouchIcon = $config->get( 'AppleTouchIcon' );
if ( $appleTouchIcon !== false ) {
$appleTouchIconUrl = wfExpandUrl( $appleTouchIcon, 
PROTO_RELATIVE );
-   $appleTouchIconSize = getimagesize( $appleTouchIconUrl 
);
+   $request = MWHttpRequest::factory( $appleTouchIconUrl );
+   $request->execute();
+   $appleTouchIconContent = $request->getContent();
+   if ( !empty( $appleTouchIconContent ) ) {
+   $appleTouchIconSize = getimagesizefromstring( 
$appleTouchIconContent );
+   }
$icon = [
'src' => $appleTouchIcon
];
-   if ( $appleTouchIconSize !== false ) {
+   if ( isset( $appleTouchIconSize ) && 
$appleTouchIconSize !== false ) {
$icon['sizes'] = 
$appleTouchIconSize[0].'x'.$appleTouchIconSize[1];
$icon['type'] = $appleTouchIconSize['mime'];
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If1365924e52625a0c6346411faae300b2f83c25a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Rudloff 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [wip] Create active/inactive behavior for complementary filters

2016-12-14 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327419 )

Change subject: [wip] Create active/inactive behavior for complementary filters
..

[wip] Create active/inactive behavior for complementary filters

Filters that are complementary or that contain one another should
indicate that they are inactive (or ineffective/disabled/excluded)
from the search.

Bug: T149452
Change-Id: Ie58493ef940698dddb04362473664c404f392b2b
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterItem.js
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterCapsuleMultiselectWidget.less
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterGroupWidget.less
M resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterItemWidget.less
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterGroupWidget.js
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterItemWidget.js
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js
8 files changed, 131 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/19/327419/1

diff --git a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterItem.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterItem.js
index 97ff4e2..e62b866 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterItem.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterItem.js
@@ -11,6 +11,7 @@
 * @cfg {string} [label] The label for the filter
 * @cfg {string} [description] The description of the filter
 * @cfg {boolean} [selected] Filter is selected
+* @cfg {boolean} [active=true] The filter is active and affecting the 
result
 */
mw.rcfilters.dm.FilterItem = function MwRcfiltersDmFilterItem( name, 
config ) {
config = config || {};
@@ -24,6 +25,7 @@
this.description = config.description;
 
this.selected = !!config.selected;
+   this.active = config.active === undefined ? true : 
!!config.active;
};
 
/* Initialization */
@@ -35,7 +37,6 @@
 
/**
 * @event update
-* @param {boolean} isSelected Filter is selected
 *
 * The state of this filter has changed
 */
@@ -88,6 +89,30 @@
};
 
/**
+* Check if this filter is active
+*
+* @return {boolean} Filter is active
+*/
+   mw.rcfilters.dm.FilterItem.prototype.isActive = function () {
+   return this.active;
+   };
+
+   /**
+* Toggle the selected state of the item
+*
+* @param {boolean} [isSelected] Filter is selected
+* @fires update
+*/
+   mw.rcfilters.dm.FilterItem.prototype.toggleActive = function ( isActive 
) {
+   isActive = isActive === undefined ? !this.active : isActive;
+
+   if ( this.active !== isActive ) {
+   this.active = isActive;
+   this.emit( 'update' );
+   }
+   };
+
+   /**
 * Toggle the selected state of the item
 *
 * @param {boolean} [isSelected] Filter is selected
@@ -98,7 +123,8 @@
 
if ( this.selected !== isSelected ) {
this.selected = isSelected;
-   this.emit( 'update', this.selected );
+   this.emit( 'update' );
}
};
+
 }( mediaWiki ) );
diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
index 60826a2..cf7aff7 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
@@ -45,6 +45,7 @@
 * @event itemUpdate
 * @param {mw.rcfilters.dm.FilterItem} item Filter item updated
 * @param {boolean} isSelected Filter is selected
+* @param {boolean} isActive Filter is active
 *
 * Filter item has changed
 */
@@ -58,10 +59,47 @@
 * @param {boolean} isSelected Filter item is selected
 * @fires filterUpdate
 */
-   mw.rcfilters.dm.FiltersViewModel.prototype.onFilterItemUpdate = 
function ( item, isSelected ) {
+   mw.rcfilters.dm.FiltersViewModel.prototype.onFilterItemUpdate = 
function ( item ) {
// Update parameter state
this.updateParameters( this.getFiltersToParameters() );
-   this.emit( 'itemUpdate', item, isSelected );
+
+   this.calculateActiveFilters( item );
+
+   this.emit( 'itemUpdate', item, item.isSelected(), 
item.isActive() );
+   };
+
+   

[MediaWiki-commits] [Gerrit] analytics/discovery-stats[master]: WIP: add client usage of structured data

2016-12-14 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327418 )

Change subject: WIP: add client usage of structured data
..

WIP: add client usage of structured data

Really gotta add the ability to do this kind of stuff to reportupdater,
but no time right now.

Bug: T153272
Change-Id: I40bac9a1c7ae38455fc0111fc2b4c1bb1206a4cf
---
A bin/daily.sh
A structured-usage.php
2 files changed, 53 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/discovery-stats 
refs/changes/18/327418/1

diff --git a/bin/daily.sh b/bin/daily.sh
new file mode 100755
index 000..1a411af
--- /dev/null
+++ b/bin/daily.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+BASEDIR=`dirname "$0"`/..
+
+/usr/bin/php $BASEDIR/structured-usage.php
diff --git a/structured-usage.php b/structured-usage.php
new file mode 100644
index 000..c6a3e02
--- /dev/null
+++ b/structured-usage.php
@@ -0,0 +1,48 @@
+getSites() as $site ) {
+$dbName = $site->getDbName();
+// Can't quote it, have to validate
+if ( !preg_match( '/^[a-z0-9_]+$/', $dbName ) ) {
+throw new \Exception( "Invalid database '$dbName'" );
+}
+if ( $site->isPrivate() || in_array( $dbName, $wikiBlacklist ) ) {
+continue;
+}
+
+query( "USE $dbName" );
+$siteKey = $site->getFamily() . '.' . $site->getCode();
+
+$res = query( "SELECT count(*) AS num FROM page_props WHERE 
pp_propname='jsonconfig_getdata'" );
+if ( $res && ( $row = $res->fetch() ) ) {
+$graphite->record( "daily.structured-data.client.pagecount.$siteKey", 
$row['num'] );
+}
+}
+
+function query( $sql ) {
+global $db;
+
+$res = $db->query( $sql );
+if ( !$res ) {
+$err = $db->errorInfo();
+throw new \Exception( "{$err[0]}: {$err[2]}" );
+}
+
+return $res;
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I40bac9a1c7ae38455fc0111fc2b4c1bb1206a4cf
Gerrit-PatchSet: 1
Gerrit-Project: analytics/discovery-stats
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Do not return the current wikis when detecting query languages

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327031 )

Change subject: Do not return the current wikis when detecting query languages
..


Do not return the current wikis when detecting query languages

This case was missed when the interwiki resolver was implemented
on top of existing cirrus config.
InterwikiResolver implementations should not return the current
wiki otherwise some code that uses it may wrongly assume that
it's a different wiki.

Bug: T153051
Change-Id: I2a985b6cdc3fa1a040814994faeda3f1f26d32f5
---
M includes/CirrusConfigInterwikiResolver.php
M includes/CirrusSearch.php
M tests/unit/InterwikiResolverTest.php
3 files changed, 38 insertions(+), 3 deletions(-)

Approvals:
  Smalyshev: Looks good to me, approved
  Tjones: Looks good to me, but someone else must approve
  Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/CirrusConfigInterwikiResolver.php 
b/includes/CirrusConfigInterwikiResolver.php
index 503da42..43f0fb3 100644
--- a/includes/CirrusConfigInterwikiResolver.php
+++ b/includes/CirrusConfigInterwikiResolver.php
@@ -46,6 +46,9 @@
if ( is_null ( $crossLanguage ) ) {
$crossLanguage = [];
}
+   $crossLanguage = array_filter( $crossLanguage, function( $entry 
) {
+   return $entry !== $this->config->getWikiId();
+   } );
$prefixesByWiki = array_flip( $sisterProjects ) + array_flip( 
$crossLanguage );
return [
'sister_projects' => $sisterProjects,
diff --git a/includes/CirrusSearch.php b/includes/CirrusSearch.php
index 7424603..a5d6e53 100644
--- a/includes/CirrusSearch.php
+++ b/includes/CirrusSearch.php
@@ -205,6 +205,15 @@
continue;
}
$lang = $detector->detect( $this, $term );
+   if ( $lang === $this->config->get( 'wgLanguageCode' ) ) 
{
+   // The query is in the wiki language so we
+   // don't need to actually try another wiki.
+   // Note that this may not be very accurate for
+   // wikis that use deprecated language codes
+   // but the interwiki resolver should not return
+   // ourselves.
+   continue;
+   }
$wiki = MediaWikiServices::getInstance()
->getService( InterwikiResolver::SERVICE )
->getSameProjectWikiByLang( $lang );
diff --git a/tests/unit/InterwikiResolverTest.php 
b/tests/unit/InterwikiResolverTest.php
index ede0aef..972f390 100644
--- a/tests/unit/InterwikiResolverTest.php
+++ b/tests/unit/InterwikiResolverTest.php
@@ -21,6 +21,7 @@
$this->assertEquals( 'no', $resolver->getInterwikiPrefix( 
'nowiki' ) );
$this->assertEquals( 'b', $resolver->getInterwikiPrefix( 
'enwikibooks' ) );
$this->assertEquals( null, $resolver->getInterwikiPrefix( 
'simplewiki' ) );
+   $this->assertEquals( null, $resolver->getInterwikiPrefix( 
'enwiki' ) );
 
// Test sister projects
$this->assertArrayHasKey( 'voy', 
$resolver->getSisterProjectPrefixes() );
@@ -45,6 +46,12 @@
[],
$resolver->getSameProjectWikiByLang( 'ccc' )
);
+   $this->assertEquals(
+   [],
+   $resolver->getSameProjectWikiByLang( 'en' ),
+   'enwiki should not find itself.'
+   );
+
}
 
/**
@@ -187,11 +194,20 @@
'crosslang', 'nl',
[],
],
+   'enwikinews cross lang lookup should not find itself' 
=> [
+   'enwikinews',
+   'crosslang', 'en',
+   [],
+   ],
];
}
 
private function getCirrusConfigInterwikiResolver() {
-   $this->setMwGlobals( [
+   $wikiId = 'enwiki';
+   $myGlobals = [
+   'wgDBprefix' => null,
+   'wgDBName' => $wikiId,
+   'wgLanguageCode' => 'en',
'wgCirrusSearchInterwikiSources' => [
'voy' => 'enwikivoyage',
'wikt' => 'enwiktionary',
@@ -200,14 +216,21 @@
'wgCirrusSearchLanguageToWikiMap' => [
'fr' => 'fr',

[MediaWiki-commits] [Gerrit] mediawiki...GlobalPreferences[master]: Use CentralIdLookup instead of hardcoding CentralAuth

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/317014 )

Change subject: Use CentralIdLookup instead of hardcoding CentralAuth
..


Use CentralIdLookup instead of hardcoding CentralAuth

Change-Id: I636b231d1d141ad3bbe76c3834af5229e1f05e1d
---
M GlobalPreferences.body.php
1 file changed, 3 insertions(+), 16 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/GlobalPreferences.body.php b/GlobalPreferences.body.php
index c98477c..74008a6 100644
--- a/GlobalPreferences.body.php
+++ b/GlobalPreferences.body.php
@@ -35,13 +35,8 @@
// No prefs for anons, sorry :(
return false;
}
-   if ( class_exists( 'CentralAuthUser' ) ) {
-   $caUser = CentralAuthUser::getInstance( $user );
-   return $caUser->exists();
-   }
 
-   // Assume that we're using shared user tables...
-   return true;
+   return self::getUserID( $user ) !== 0;
}
 
/**
@@ -51,16 +46,8 @@
 * @return int
 */
public static function getUserID( User $user ) {
-   if ( !self::isUserGlobalized( $user ) ) {
-   return 0;
-   }
-   if ( class_exists( 'CentralAuthUser' ) ) {
-   $caUser = CentralAuthUser::getInstance( $user );
-   return $caUser->getId();
-   } else {
-   // shared user tables use the same user_id
-   return $user->getId();
-   }
+   $lookup = CentralIdLookup::factory();
+   return $lookup->centralIdFromLocalUser( $user );
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I636b231d1d141ad3bbe76c3834af5229e1f05e1d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GlobalPreferences
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: FlowFixInconsistentBoards: Run in update.php, fix updatelog

2016-12-14 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327417 )

Change subject: FlowFixInconsistentBoards: Run in update.php, fix updatelog
..

FlowFixInconsistentBoards: Run in update.php, fix updatelog

It was removed from update.php due to slowing down Beta.
It's now quick enough that this isn't an issue, and the updatelog
issue (causing it to re-run multiple times) if fixed here.

Bug: T148057
Change-Id: I39f18db334a8660818211bcc6e8060d6bad85932
---
M Hooks.php
M maintenance/FlowFixInconsistentBoards.php
2 files changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/17/327417/1

diff --git a/Hooks.php b/Hooks.php
index 1bbf2ff..59023cf 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -319,6 +319,9 @@
require_once __DIR__.'/maintenance/FlowPopulateRefId.php';
$updater->addPostDatabaseUpdateMaintenance( 'FlowPopulateRefId' 
);
 
+   require_once 
__DIR__.'/maintenance/FlowFixInconsistentBoards.php';
+   $updater->addPostDatabaseUpdateMaintenance( 
'FlowFixInconsistentBoards' );
+
/*
 * Add primary key, but only after we've made sure the newly 
added
 * column has been populated (otherwise they'd all be null 
values)
diff --git a/maintenance/FlowFixInconsistentBoards.php 
b/maintenance/FlowFixInconsistentBoards.php
index fe3468c..f1fd507 100644
--- a/maintenance/FlowFixInconsistentBoards.php
+++ b/maintenance/FlowFixInconsistentBoards.php
@@ -164,6 +164,8 @@
break;
}
}
+
+   return true;
}
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I39f18db334a8660818211bcc6e8060d6bad85932
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Bug T153233

2016-12-14 Thread Ghybu (Code Review)
Ghybu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327412 )

Change subject: Bug T153233
..

Bug T153233

Change-Id: I488129a002a92481412667706dbd2c534aa8d45b
---
M languages/messages/MessagesKu_latn.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/12/327412/2

diff --git a/languages/messages/MessagesKu_latn.php 
b/languages/messages/MessagesKu_latn.php
index c97ef25..32844a2 100644
--- a/languages/messages/MessagesKu_latn.php
+++ b/languages/messages/MessagesKu_latn.php
@@ -109,3 +109,4 @@
'pagesincategory_pages' => [ '0', 'rûpel', 'pages' ],
 ];
 
+$linkTrail = '/^([a-zçêîşûẍḧÇÊÎŞÛẌḦ]+)(.*)$/sDu';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I488129a002a92481412667706dbd2c534aa8d45b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ghybu 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable per-page language choice on wikis with Translate

2016-12-14 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327416 )

Change subject: Enable per-page language choice on wikis with Translate
..

Enable per-page language choice on wikis with Translate

Bug: T153209
Change-Id: I5b79dae7766b5a95951f14ab05058520ef43ffef
---
M wmf-config/CommonSettings.php
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/16/327416/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index ca36b4e..702259e 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2403,12 +2403,16 @@
$wgGroupPermissions['translationadmin']['pagetranslation'] = true;
$wgGroupPermissions['translationadmin']['translate-manage'] = true;
$wgGroupPermissions['translationadmin']['translate-import'] = true; // 
T42341
+   $wgGroupPermissions['translationadmin']['pagelang'] = true; // T153209
$wgGroupPermissions['user']['translate-messagereview'] = true;
$wgGroupPermissions['user']['translate-groupreview'] = true;
+   $wgGroupPermissions['sysop']['pagelang'] = true; // T153209
 
$wgTranslateDocumentationLanguageCode = 'qqq';
$wgExtraLanguageNames['qqq'] = 'Message documentation'; # No linguistic 
content. Used for documenting messages
 
+   $wgPageLanguageUseDB = true; // T153209
+
// TODO: proper integration with new CirrusSearch config
$wgTranslateExtensionDefaultCluster = 'eqiad';
$wgTranslateTranslationServices = [];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b79dae7766b5a95951f14ab05058520ef43ffef
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: TTO 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MWSearch[master]: Empty out dead extension

2016-12-14 Thread Chad (Code Review)
Chad has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327415 )

Change subject: Empty out dead extension
..

Empty out dead extension

Change-Id: I88c654bd390a8a4ed20943e464ee51c47a6be231
---
D .gitignore
D .gitreview
D Gruntfile.js
D MWSearch.i18n.php
D MWSearch.php
D MWSearchUpdateHook.php
D MWSearchUpdater.php
D MWSearch_body.php
A OBSOLETE
D i18n/ace.json
D i18n/af.json
D i18n/an.json
D i18n/ar.json
D i18n/arz.json
D i18n/ast.json
D i18n/ba.json
D i18n/bar.json
D i18n/bcc.json
D i18n/be-tarask.json
D i18n/bg.json
D i18n/bn.json
D i18n/br.json
D i18n/bs.json
D i18n/ca.json
D i18n/ce.json
D i18n/cs.json
D i18n/cy.json
D i18n/da.json
D i18n/de.json
D i18n/diq.json
D i18n/dsb.json
D i18n/el.json
D i18n/en.json
D i18n/eo.json
D i18n/es.json
D i18n/et.json
D i18n/eu.json
D i18n/fa.json
D i18n/fi.json
D i18n/fr.json
D i18n/frp.json
D i18n/fur.json
D i18n/gl.json
D i18n/gsw.json
D i18n/he.json
D i18n/hi.json
D i18n/hil.json
D i18n/hr.json
D i18n/hsb.json
D i18n/ht.json
D i18n/hu.json
D i18n/ia.json
D i18n/id.json
D i18n/ig.json
D i18n/it.json
D i18n/ja.json
D i18n/jv.json
D i18n/ka.json
D i18n/ko.json
D i18n/ksh.json
D i18n/lb.json
D i18n/li.json
D i18n/lt.json
D i18n/lv.json
D i18n/map-bms.json
D i18n/mk.json
D i18n/ml.json
D i18n/mr.json
D i18n/ms.json
D i18n/mt.json
D i18n/nah.json
D i18n/nb.json
D i18n/nds.json
D i18n/new.json
D i18n/nl.json
D i18n/nn.json
D i18n/oc.json
D i18n/pl.json
D i18n/pms.json
D i18n/pt-br.json
D i18n/pt.json
D i18n/qqq.json
D i18n/ro.json
D i18n/roa-tara.json
D i18n/ru.json
D i18n/rue.json
D i18n/sah.json
D i18n/si.json
D i18n/sk.json
D i18n/sl.json
D i18n/sr-ec.json
D i18n/sr-el.json
D i18n/stq.json
D i18n/su.json
D i18n/sv.json
D i18n/te.json
D i18n/tg-cyrl.json
D i18n/tg-latn.json
D i18n/th.json
D i18n/tk.json
D i18n/tl.json
D i18n/tr.json
D i18n/tzm.json
D i18n/uk.json
D i18n/ur.json
D i18n/vec.json
D i18n/vi.json
D i18n/vo.json
D i18n/wa.json
D i18n/yi.json
D i18n/yue.json
D i18n/zh-hans.json
D i18n/zh-hant.json
D luceneUpdate.php
D package.json
115 files changed, 1 insertion(+), 2,471 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MWSearch 
refs/changes/15/327415/1

diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 1689d7a..000
--- a/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*~
-*.kate-swp
-.*.swp
-node_modules/**
diff --git a/.gitreview b/.gitreview
deleted file mode 100644
index ab2da39..000
--- a/.gitreview
+++ /dev/null
@@ -1,5 +0,0 @@
-[gerrit]
-host=gerrit.wikimedia.org
-port=29418
-project=mediawiki/extensions/MWSearch.git
-track=1
diff --git a/Gruntfile.js b/Gruntfile.js
deleted file mode 100644
index 7756e75..000
--- a/Gruntfile.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*jshint node:true */
-module.exports = function ( grunt ) {
-   grunt.loadNpmTasks( 'grunt-jsonlint' );
-   grunt.loadNpmTasks( 'grunt-banana-checker' );
-
-   grunt.initConfig( {
-   banana: {
-   all: 'i18n/'
-   },
-   jsonlint: {
-   all: [
-   '**/*.json',
-   '!node_modules/**'
-   ]
-   }
-   } );
-
-   grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
-   grunt.registerTask( 'default', 'test' );
-};
diff --git a/MWSearch.i18n.php b/MWSearch.i18n.php
deleted file mode 100644
index ae657a2..000
--- a/MWSearch.i18n.php
+++ /dev/null
@@ -1,35 +0,0 @@
-https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
- *
- * Beginning with MediaWiki 1.23, translation strings are stored in json files,
- * and the EXTENSION.i18n.php file only exists to provide compatibility with
- * older releases of MediaWiki. For more information about this migration, see:
- * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
- *
- * This shim maintains compatibility back to MediaWiki 1.17.
- */
-$messages = array();
-if ( !function_exists( 'wfJsonI18nShim503bc7bff6f40556' ) ) {
-   function wfJsonI18nShim503bc7bff6f40556( $cache, $code, &$cachedData ) {
-   $codeSequence = array_merge( array( $code ), 
$cachedData['fallbackSequence'] );
-   foreach ( $codeSequence as $csCode ) {
-   $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json";
-   if ( is_readable( $fileName ) ) {
-   $data = FormatJson::decode( file_get_contents( 
$fileName ), true );
-   foreach ( array_keys( $data ) as $key ) {
-   if ( $key === '' || $key[0] === '@' ) {
-   unset( $data[$key] );
-   }
-   }
-   $cachedData['messages'] = array_merge( $data, 

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Properly clear this.section when switching from VE

2016-12-14 Thread Esanders (Code Review)
Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327414 )

Change subject: Properly clear this.section when switching from VE
..

Properly clear this.section when switching from VE

Bug: T153276
Change-Id: Idc251c73c03bf87b6e6ca716be98b38d4fb68c5e
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/14/327414/1

diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
index 290fe93..85d5037 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
@@ -1631,12 +1631,15 @@
var uri, oldid, prefPromise, dataPromise,
target = this;
 
+   // We may have this.section but VE is always full page at the moment
+   this.section = null;
+
if ( ve.init.target.isModeAvailable( 'source' ) && !leaveVE ) {
if ( discardChanges ) {
dataPromise = mw.libs.ve.targetLoader.requestPageData(
'source',
this.pageName,
-   null, // We may have this.section but VE is 
always full page at the moment
+   this.section,
this.requestedRevId,
this.constructor.name
).then(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc251c73c03bf87b6e6ca716be98b38d4fb68c5e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable per-page language choice on beta cluster

2016-12-14 Thread TTO (Code Review)
TTO has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327413 )

Change subject: Enable per-page language choice on beta cluster
..

Enable per-page language choice on beta cluster

Bug: T153209
Change-Id: I4a12c4f83ca8cb4ca5fc3f97e5fd0f3edc7f3721
---
M wmf-config/CommonSettings-labs.php
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/13/327413/1

diff --git a/wmf-config/CommonSettings-labs.php 
b/wmf-config/CommonSettings-labs.php
index 496152f..7f7bd07 100644
--- a/wmf-config/CommonSettings-labs.php
+++ b/wmf-config/CommonSettings-labs.php
@@ -335,6 +335,13 @@
wfLoadExtension( 'Linter' );
 }
 
+if ( $wmgUseTranslate ) {
+   // test of T153209
+   $wgGroupPermissions['translationadmin']['pagelang'] = true;
+   $wgGroupPermissions['sysop']['pagelang'] = true;
+   $wgPageLanguageUseDB = true;
+}
+
 $wgMessageCacheType = CACHE_ACCEL;
 
 // Let Beta Cluster Commons do upload-from-URL from production Commons.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a12c4f83ca8cb4ca5fc3f97e5fd0f3edc7f3721
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: TTO 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.29.0-wmf.5]: Fix submodules URL for Gerrit syncronisation

2016-12-14 Thread Chad (Code Review)
Chad has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/326947 )

Change subject: Fix submodules URL for Gerrit syncronisation
..


Fix submodules URL for Gerrit syncronisation

Bug: T152663
Change-Id: I1099980e7d254163e10b6a1978df4340a84af0fd
---
M .gitmodules
1 file changed, 165 insertions(+), 165 deletions(-)

Approvals:
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.gitmodules b/.gitmodules
index 0d7df71..a5b9e4a 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,660 +1,660 @@
 [submodule "extensions/CentralNotice"]
path = extensions/CentralNotice
-   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/CentralNotice.git
+   url = https://gerrit.wikimedia.org/r/mediawiki/extensions/CentralNotice
branch = wmf_deploy
 [submodule "extensions/Wikidata"]
path = extensions/Wikidata
-   url = https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Wikidata.git
+   url = https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikidata
branch = wmf/1.29.0-wmf.5
 [submodule "extensions/SemanticMediaWiki"]
path = extensions/SemanticMediaWiki
-   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticMediaWiki.git
+   url = 
https://gerrit.wikimedia.org/r/mediawiki/extensions/SemanticMediaWiki
branch = 1.8.x
 [submodule "extensions/SemanticResultFormats"]
path = extensions/SemanticResultFormats
-   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticResultFormats.git
+   url = 
https://gerrit.wikimedia.org/r/mediawiki/extensions/SemanticResultFormats
branch = 1.8.x
 [submodule "extensions/Validator"]
path = extensions/Validator
-   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Validator.git
+   url = https://gerrit.wikimedia.org/r/mediawiki/extensions/Validator
branch = 0.5.x
 [submodule "extensions/AbuseFilter"]
path = extensions/AbuseFilter
-   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AbuseFilter.git
+   url = https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter
branch = wmf/1.29.0-wmf.5
 [submodule "extensions/AccountAudit"]
path = extensions/AccountAudit
-   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AccountAudit.git
+   url = https://gerrit.wikimedia.org/r/mediawiki/extensions/AccountAudit
branch = wmf/1.29.0-wmf.5
 [submodule "extensions/ActiveAbstract"]
path = extensions/ActiveAbstract
-   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ActiveAbstract.git
+   url = https://gerrit.wikimedia.org/r/mediawiki/extensions/ActiveAbstract
branch = wmf/1.29.0-wmf.5
 [submodule "extensions/AntiSpoof"]
path = extensions/AntiSpoof
-   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AntiSpoof.git
+   url = https://gerrit.wikimedia.org/r/mediawiki/extensions/AntiSpoof
branch = wmf/1.29.0-wmf.5
 [submodule "extensions/ApiFeatureUsage"]
path = extensions/ApiFeatureUsage
-   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ApiFeatureUsage.git
+   url = 
https://gerrit.wikimedia.org/r/mediawiki/extensions/ApiFeatureUsage
branch = wmf/1.29.0-wmf.5
 [submodule "extensions/Babel"]
path = extensions/Babel
-   url = https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Babel.git
+   url = https://gerrit.wikimedia.org/r/mediawiki/extensions/Babel
branch = wmf/1.29.0-wmf.5
 [submodule "extensions/BetaFeatures"]
path = extensions/BetaFeatures
-   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/BetaFeatures.git
+   url = https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures
branch = wmf/1.29.0-wmf.5
 [submodule "extensions/BounceHandler"]
path = extensions/BounceHandler
-   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/BounceHandler.git
+   url = https://gerrit.wikimedia.org/r/mediawiki/extensions/BounceHandler
branch = wmf/1.29.0-wmf.5
 [submodule "extensions/Calendar"]
path = extensions/Calendar
-   url = https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Calendar.git
+   url = https://gerrit.wikimedia.org/r/mediawiki/extensions/Calendar
branch = wmf/1.29.0-wmf.5
 [submodule "extensions/Campaigns"]
path = extensions/Campaigns
-   url = 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Campaigns.git
+   url = https://gerrit.wikimedia.org/r/mediawiki/extensions/Campaigns
branch = wmf/1.29.0-wmf.5
 [submodule "extensions/Capiunto"]
path = extensions/Capiunto
-   url = https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Capiunto.git
+   url = https://gerrit.wikimedia.org/r/mediawiki/extensions/Capiunto
branch = wmf/1.29.0-wmf.5
 [submodule 

[MediaWiki-commits] [Gerrit] mediawiki/core[refs/meta/config]: Fix submodules for skins

2016-12-14 Thread Chad (Code Review)
Chad has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327408 )

Change subject: Fix submodules for skins
..


Fix submodules for skins

Change-Id: Ied6e8f1750e89b29c2eeaa1c8754523da4b75ca8
---
M project.config
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Chad: Verified; Looks good to me, approved



diff --git a/project.config b/project.config
index 853e628..2608449 100644
--- a/project.config
+++ b/project.config
@@ -14,5 +14,7 @@
create = block group Registered Users
 [allowSuperproject "mediawiki/extensions"]
all = refs/heads/*:refs/heads/*
+[allowSuperproject "mediawiki/skins"]
+   all = refs/heads/*:refs/heads/*
 [allowSuperproject "mediawiki/core"]
all = refs/heads/*:refs/heads/*

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ied6e8f1750e89b29c2eeaa1c8754523da4b75ca8
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: refs/meta/config
Gerrit-Owner: Paladox 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: Thcipriani 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[wmf/1.29.0-wmf.6]: Add Terms of Use link on static and dynamic maps

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327274 )

Change subject: Add Terms of Use link on static and dynamic maps
..


Add Terms of Use link on static and dynamic maps

- Adding shorter attribution text for static maps
- Adding link to Terms of Use for dynamic maps

Bug: T151906
Bug: T151900
Change-Id: Id2f67dfa2886147be126ce50b104278eba8c037e
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M modules/staticframe/staticframe.js
M styles/control-attribution.less
5 files changed, 37 insertions(+), 12 deletions(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index 6b2729d..73935eb 100644
--- a/extension.json
+++ b/extension.json
@@ -300,6 +300,7 @@
"modules/staticframe/staticframe.js"
],
"messages": [
+   "kartographer-attribution-short",
"kartographer-fullscreen-text"
],
"targets": [
diff --git a/i18n/en.json b/i18n/en.json
index ba868dd..016f501 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -14,9 +14,10 @@
"apihelp-query+mapdata-param-continue": "Use this parameter to continue 
iterating through results",
"apihelp-query+mapdata-param-groups": "Pipe-separated groups to return 
data for",
"apihelp-query+mapdata-param-limit": "Data for how many pages to 
return",
-   "kartographer-attribution": "Wikimedia maps | Map data © 
[https://www.openstreetmap.org/copyright OpenStreetMap contributors]",
+   "kartographer-attribution": 
"[https://wikimediafoundation.org/wiki/Maps_Terms_of_Use Wikimedia maps] | Map 
data © [https://www.openstreetmap.org/copyright OpenStreetMap contributors]",
"kartographer-attribution-externaldata": "$1: $2",
"kartographer-attribution-externaldata-query": "query",
+   "kartographer-attribution-short": 
"[https://wikimediafoundation.org/wiki/Maps_Terms_of_Use Wikimedia] | © 
[https://www.openstreetmap.org/copyright OpenStreetMap]",
"kartographer-broken-category": "Pages with broken maps",
"kartographer-broken-category-desc": "The page includes an invalid map 
usage",
"kartographer-desc": "Allows maps to be added to the wiki pages",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 54569f2..2f6b323 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -18,9 +18,10 @@
"apihelp-query+mapdata-param-continue": 
"{{doc-apihelp-param|query+mapdata|continue}}",
"apihelp-query+mapdata-param-groups": 
"{{doc-apihelp-param|query+mapdata|groups}}",
"apihelp-query+mapdata-param-limit": 
"{{doc-apihelp-param|query+mapdata|limit}}",
-   "kartographer-attribution": "Attribution text shown at the bottom of 
the map. $1 is external data service (e.g. Wikidata), $2 is link to external 
data link (e.g. query)",
-   "kartographer-attribution-externaldata": "Formats external data layer 
attribution",
+   "kartographer-attribution": "Attribution text shown at the bottom of 
the map.",
+   "kartographer-attribution-externaldata": "Formats external data layer 
attribution: $1 is external data service (e.g. Wikidata), $2 is link to 
external data link (e.g. query).",
"kartographer-attribution-externaldata-query": "Label for external data 
'query'.\n{{Identical|Query}}",
+   "kartographer-attribution-short": "Shorter version of the attribution 
text shown at the bottom of the map, for static maps embedded in the article.",
"kartographer-broken-category": "Name of the tracking category",
"kartographer-broken-category-desc": "Description on 
[[Special:TrackingCategories]] for the {{msg-mw|kartographer-broken-category}} 
tracking category.",
"kartographer-desc": 
"{{desc|name=Kartographer|url=https://www.mediawiki.org/wiki/Extension:Kartographer}};,
diff --git a/modules/staticframe/staticframe.js 
b/modules/staticframe/staticframe.js
index 09e55dc..ac36428 100644
--- a/modules/staticframe/staticframe.js
+++ b/modules/staticframe/staticframe.js
@@ -90,6 +90,11 @@
$div = $( '' ).append( button.$element );
 
$container.append( $div );
+   $container.append(
+   '' +
+   mw.message( 
'kartographer-attribution-short' ).parse() +
+   ''
+   );
} );
 
$container.attr( 'href', '#/map/' + index );
diff --git a/styles/control-attribution.less b/styles/control-attribution.less
index a7f1af1..75e5233 100644
--- a/styles/control-attribution.less
+++ b/styles/control-attribution.less
@@ -1,23 +1,40 @@
 /* == Attribution 

[MediaWiki-commits] [Gerrit] mediawiki...Linter[master]: Add severity for error categories

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327410 )

Change subject: Add severity for error categories
..

Add severity for error categories

Categories can now have a severity level of "error" or "warning"
designated, which places them in a different heading on
Special:LintErrors.

Bug: T152822
Change-Id: I1276b9502d90765e88dcb8ea78569dee910c5d88
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/CategoryManager.php
M includes/LintErrorsPager.php
M includes/SpecialLintErrors.php
6 files changed, 98 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Linter 
refs/changes/10/327410/1

diff --git a/extension.json b/extension.json
index 42b7614..0996932 100644
--- a/extension.json
+++ b/extension.json
@@ -55,12 +55,30 @@
},
"config": {
"LinterCategories": {
-   "fostered": true,
-   "obsolete-tag": true,
-   "bogus-image-options": true,
-   "missing-end-tag": true,
-   "stripped-tag": true,
-   "self-closed-tag": true
+   "fostered": {
+   "severity": "error",
+   "enabled": true
+   },
+   "obsolete-tag": {
+   "severity": "warning",
+   "enabled": true
+   },
+   "bogus-image-options": {
+   "severity": "error",
+   "enabled": true
+   },
+   "missing-end-tag": {
+   "severity": "error",
+   "enabled": true
+   },
+   "stripped-tag": {
+   "severity": "error",
+   "enabled": true
+   },
+   "self-closed-tag": {
+   "severity": "warning",
+   "enabled": true
+   }
},
"LinterSubmitterWhitelist": {
"127.0.0.1": true
diff --git a/i18n/en.json b/i18n/en.json
index bc784f9..5ab4f95 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -29,6 +29,8 @@
"linter-numerrors": "($1 {{PLURAL:$1|error|errors}})",
"linker-page-title-edit": "$1 ($2)",
"linker-page-edit": "edit",
+   "linter-heading-errors": "Errors",
+   "linter-heading-warnings": "Warnings",
"apihelp-query+linterrors-description": "Get a list of lint errors",
"apihelp-query+linterrors-param-categories": "Categories of lint 
errors",
"apihelp-query+linterrors-param-limit": "Number of results to query",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index be13a9d..750c46b 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -31,6 +31,8 @@
"linter-numerrors": "Shown after a category link to indicate how many 
errors are in that category. $1 is the number of errors, and can be used for 
PLURAL.\n{{Identical|Error}}",
"linker-page-title-edit": "Used in a table cell. $1 is a link to the 
page, $2 is a link to edit that page, the link text is 
{{msg-mw|linker-page-edit}}",
"linker-page-edit": "Link text for edit link in 
{{msg-mw|linker-page-title-edit}} and 
{{msg-mw|linker-page-title-edit-template}}\n{{Identical|Edit}}",
+   "linter-heading-errors": "Heading on [[Special:LintErrors]]",
+   "linter-heading-warnings": "Heading on [[Special:LintErrors]]",
"apihelp-query+linterrors-description": 
"{{doc-apihelp-description|query+linterrors}}",
"apihelp-query+linterrors-param-categories": 
"{{doc-apihelp-param|query+linterrors|categories}}",
"apihelp-query+linterrors-param-limit": 
"{{doc-apihelp-param|query+linterrors|limit}}",
diff --git a/includes/CategoryManager.php b/includes/CategoryManager.php
index 97c30c9..ac3107c 100644
--- a/includes/CategoryManager.php
+++ b/includes/CategoryManager.php
@@ -25,6 +25,9 @@
  */
 class CategoryManager {
 
+   const ERROR = 'error';
+   const WARNING = 'warning';
+
/**
 * Map of category names to their hardcoded
 * numerical ids for use in the database
@@ -41,13 +44,51 @@
];
 
/**
+* @var string[]
+*/
+   private $errors = [];
+
+   /**
+* @var string[]
+*/
+   private $warnings = [];
+
+   public function __construct() {
+   global $wgLinterCategories;
+   foreach ( $wgLinterCategories as $name => $info ) {
+   if ( $info['enabled'] ) {
+   if ( $info['severity'] === self::ERROR ) {
+   

[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[wmf/1.29.0-wmf.6]: Implement third phase of event logging (Wikivoyage specific)

2016-12-14 Thread Yurik (Code Review)
Yurik has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327409 )

Change subject: Implement third phase of event logging (Wikivoyage specific)
..

Implement third phase of event logging (Wikivoyage specific)

* Data layers now have a convenient reference to their corresponding data group

Bug: T151929
Change-Id: I2545a2258dfc3772acf56a5c0589002e18be1b30
(cherry picked from commit 0fe9218db2af6bb9d2d6afbabfa00981fc3c1cd4)
---
M modules/box/Map.js
M modules/wikivoyage/ControlLayers.js
M modules/wikivoyage/ControlNearby.js
M modules/wikivoyage/WVMapLayers.js
M modules/wikivoyage/wikivoyage.js
5 files changed, 77 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer 
refs/changes/09/327409/1

diff --git a/modules/box/Map.js b/modules/box/Map.js
index 9de5370..7309392 100644
--- a/modules/box/Map.js
+++ b/modules/box/Map.js
@@ -296,7 +296,8 @@
 
if ( this.parentMap ) {
$.each( this.parentMap.dataLayers, function ( 
groupId, layer ) {
-   map.addGeoJSONLayer( groupId, 
layer.getGeoJSON(), layer.options );
+   var newLayer = map.addGeoJSONLayer( 
groupId, layer.getGeoJSON(), layer.options );
+   newLayer.dataGroup = layer.group;
} );
ready();
return;
@@ -387,13 +388,15 @@
 
$.each( dataGroups, function ( key, group ) {
var layerOptions = {
-   attribution: group.attribution
-   };
+   attribution: 
group.attribution
+   },
+   layer;
if ( group.isExternal ) {
layerOptions.name = 
group.attribution;
}
if ( !$.isEmptyObject( 
group.getGeoJSON() ) ) {
-   map.addGeoJSONLayer( group.id, 
group.getGeoJSON(), layerOptions );
+   layer = map.addGeoJSONLayer( 
group.id, group.getGeoJSON(), layerOptions );
+   layer.dataGroup = group;
} else {
mw.log.warn( 'Layer not found 
or contains no data: "' + group.id + '"' );
}
@@ -423,12 +426,14 @@
var groupId = inlineDataLayerKey + 
inlineDataLayerId++,
layerOptions = {
attribution: 
group.attribution || options.attribution
-   };
+   },
+   layer;
if ( group.isExternal ) {
layerOptions.name = 
group.attribution;
}
if ( !$.isEmptyObject( 
group.getGeoJSON() ) ) {
-   map.addGeoJSONLayer( groupId, 
group.getGeoJSON(), layerOptions );
+   layer = map.addGeoJSONLayer( 
groupId, group.getGeoJSON(), layerOptions );
+   layer.dataGroup = layer;
} else {
mw.log.warn( 'Layer not found 
or contains no data: "' + groupId + '"' );
}
diff --git a/modules/wikivoyage/ControlLayers.js 
b/modules/wikivoyage/ControlLayers.js
index de20388..351d3ca 100644
--- a/modules/wikivoyage/ControlLayers.js
+++ b/modules/wikivoyage/ControlLayers.js
@@ -33,6 +33,9 @@
if ( !obj.overlay && label.childNodes[ 0 ].checked ) {
this._previousSelected = label.childNodes[ 0 ];
}
+   if ( obj.layer.dataGroup ) {
+   label.childNodes[ 0 ].className += ' 
leaflet-control-layers-data-layer';
+   }
},
 
/**
@@ -41,6 +44,7 @@
 */
_onInputClick: function ( event ) {
var self = this,
+   map = this._map,
proto = 

[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Revert some of "Drop native LST altogether"

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327285 )

Change subject: Revert some of "Drop native LST altogether"
..


Revert some of "Drop native LST altogether"

 * This reverts some of commit 023b37b3ed7b102c95e118c1d2fd6bfed63d892f.

 * We need to keep serialization around to be backwards compatible with
   stored content.

Change-Id: I751b62e40d3842c8d0e891a132e967df33501903
---
M lib/config/baseconfig/enwiki.json
A lib/ext/LST/index.js
M tests/parserTests.txt
3 files changed, 89 insertions(+), 1 deletion(-)

Approvals:
  Subramanya Sastry: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/config/baseconfig/enwiki.json 
b/lib/config/baseconfig/enwiki.json
index ea7858d..524e179 100644
--- a/lib/config/baseconfig/enwiki.json
+++ b/lib/config/baseconfig/enwiki.json
@@ -1296,7 +1296,8 @@
 "extensiontags": [
   "",
   "",
-  ""
+  "",
+  ""
 ],
 "general": {
   "mainpage": "Main Page",
diff --git a/lib/ext/LST/index.js b/lib/ext/LST/index.js
new file mode 100644
index 000..85b945c
--- /dev/null
+++ b/lib/ext/LST/index.js
@@ -0,0 +1,50 @@
+'use strict';
+
+var ParsoidExtApi = 
module.parent.require('./extapi.js').versionCheck('^0.6.1');
+
+var DU = ParsoidExtApi.DOMUtils;
+var Promise = ParsoidExtApi.Promise;
+
+// TODO: We're keeping this serial handler around to remain backwards
+// compatible with stored content version 1.3.0 and below.  Remove it
+// when those versions are no longer supported.
+var serialHandler = {
+   handle: Promise.method(function(node, state, wrapperUnmodified) {
+   var env = state.env;
+   var typeOf = node.getAttribute('typeof') || '';
+   var dp = DU.getDataParsoid(node);
+   var src;
+   if (dp.src) {
+   src = dp.src;
+   } else if (typeOf.match('begin')) {
+   src = '';
+   } else if (typeOf.match('end')) {
+   src = '';
+   } else {
+   env.log('error', 'LST  without content in: ' + 
node.outerHTML);
+   src = '';
+   }
+   return src;
+   }),
+};
+
+module.exports = function() {
+   this.config = {
+   // FIXME: This is registering  as 
an ext
+   // tag.  All the more reason to get rid of this file altogether.
+   tags: [
+   {
+   name: 'labeledsectiontransclusion',
+   serialHandler: serialHandler,
+   },
+   {
+   name: 'labeledsectiontransclusion/begin',
+   serialHandler: serialHandler,
+   },
+   {
+   name: 'labeledsectiontransclusion/end',
+   serialHandler: serialHandler,
+   },
+   ],
+   };
+};
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index 47401bc..bd7a2bf 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -22912,6 +22912,43 @@
 foo
 !! end
 
+ 
+ Parsoid-only testing of Parsoid's impl of LST
+ Not implemented yet, see
+ https://www.mediawiki.org/wiki/Parsoid/HTML_based_LST
+ 
+
+## We still need to support serializing the older format while content is 
stored.
+!! test
+LST Sections: Backwards compatibility
+!! options
+parsoid={
+  "suppressErrors": true,
+  "modes": ["html2wt"]
+}
+!! wikitext
+
+
+!! html/parsoid
+
+
+!! end
+
+## The unconventional output is the result of `usePHPPreProcessor` being
+## disabled in parserTests.js.  This test is mainly just to show  is
+## recognized as an extension tag w/o a native handler.
+!! test
+LST Sections: Newfangled approach
+!! options
+parsoid={ "suppressErrors": true }
+!! wikitext
+
+
+!! html/parsoid
+section begin="2011-05-16" 
/>
+section 
end="2014-04-10 (MW 1.23wmf22)" />
+!! end
+
 #- Test stripping of empty nodes in template content --
 !!test
 Empty LI and TR nodes should be stripped from template content

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I751b62e40d3842c8d0e891a132e967df33501903
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra 
Gerrit-Reviewer: C. Scott Ananian 
Gerrit-Reviewer: Subramanya Sastry 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list

[MediaWiki-commits] [Gerrit] mediawiki/core[refs/meta/config]: Fix submodules for skins

2016-12-14 Thread Paladox (Code Review)
Paladox has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327408 )

Change subject: Fix submodules for skins
..

Fix submodules for skins

Change-Id: Ied6e8f1750e89b29c2eeaa1c8754523da4b75ca8
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/08/327408/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied6e8f1750e89b29c2eeaa1c8754523da4b75ca8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: refs/meta/config
Gerrit-Owner: Paladox 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[refs/meta/config]: Fix submodules

2016-12-14 Thread 20after4 (Code Review)
20after4 has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327406 )

Change subject: Fix submodules
..


Fix submodules

Change-Id: I85d28444bcd2db8729bad127157a483667cd6332
---
M project.config
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  20after4: Verified; Looks good to me, approved



diff --git a/project.config b/project.config
index 0c68944..853e628 100644
--- a/project.config
+++ b/project.config
@@ -12,3 +12,7 @@
mergeContent = true
 [access "refs/tags/wmf/*"]
create = block group Registered Users
+[allowSuperproject "mediawiki/extensions"]
+   all = refs/heads/*:refs/heads/*
+[allowSuperproject "mediawiki/core"]
+   all = refs/heads/*:refs/heads/*

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I85d28444bcd2db8729bad127157a483667cd6332
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: refs/meta/config
Gerrit-Owner: Paladox 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Thcipriani 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.29.0-wmf.5]: Update VisualEditor for I0dc6be0d, I0b43fd65, Ida6ffffa

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327403 )

Change subject: Update VisualEditor for I0dc6be0d, I0b43fd65, Ida6a
..


Update VisualEditor for I0dc6be0d, I0b43fd65, Ida6a

Change-Id: I1927557dbc4d7927a2fa5bd818e32762f0b9dff7
---
M extensions/VisualEditor
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extensions/VisualEditor b/extensions/VisualEditor
index 2dd202e..b132e5f 16
--- a/extensions/VisualEditor
+++ b/extensions/VisualEditor
@@ -1 +1 @@
-Subproject commit 2dd202ecc1213ede5f4c437b080c63e044ae4a16
+Subproject commit b132e5ff270e4817b28da6e82dd01fc1c6d8b667

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1927557dbc4d7927a2fa5bd818e32762f0b9dff7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.29.0-wmf.5
Gerrit-Owner: Alex Monk 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[refs/meta/config]: Fix submodules

2016-12-14 Thread Paladox (Code Review)
Paladox has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327406 )

Change subject: Fix submodules
..

Insert the description of the change.

Change-Id: I85d28444bcd2db8729bad127157a483667cd6332
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/06/327406/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I85d28444bcd2db8729bad127157a483667cd6332
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: refs/meta/config
Gerrit-Owner: Paladox 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: enable instance restbase1016-c.codfw.wmnet

2016-12-14 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327260 )

Change subject: enable instance restbase1016-c.codfw.wmnet
..


enable instance restbase1016-c.codfw.wmnet

Bug: T151086
Change-Id: I5c9710951c783dec5db55158a094d996bbfd0fc8
---
M hieradata/hosts/restbase1016.yaml
1 file changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Eevans: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/hieradata/hosts/restbase1016.yaml 
b/hieradata/hosts/restbase1016.yaml
index ffc8a2f..5ef4ad8 100644
--- a/hieradata/hosts/restbase1016.yaml
+++ b/hieradata/hosts/restbase1016.yaml
@@ -11,8 +11,8 @@
 listen_address: 10.64.0.33
 rpc_address: 10.64.0.33
 rpc_interface: eth0
-#  c:
-#jmx_port: 7191
-#listen_address: 10.64.0.34
-#rpc_address: 10.64.0.34
-#rpc_interface: eth0
+  c:
+jmx_port: 7191
+listen_address: 10.64.0.34
+rpc_address: 10.64.0.34
+rpc_interface: eth0

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5c9710951c783dec5db55158a094d996bbfd0fc8
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Eevans 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Eevans 
Gerrit-Reviewer: Filippo Giunchedi 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.29.0-wmf.5]: Update VisualEditor for I0dc6be0d, I0b43fd65, Ida6ffffa

2016-12-14 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327403 )

Change subject: Update VisualEditor for I0dc6be0d, I0b43fd65, Ida6a
..

Update VisualEditor for I0dc6be0d, I0b43fd65, Ida6a

Change-Id: I1927557dbc4d7927a2fa5bd818e32762f0b9dff7
---
M extensions/VisualEditor
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/03/327403/1

diff --git a/extensions/VisualEditor b/extensions/VisualEditor
index 2dd202e..b132e5f 16
--- a/extensions/VisualEditor
+++ b/extensions/VisualEditor
@@ -1 +1 @@
-Subproject commit 2dd202ecc1213ede5f4c437b080c63e044ae4a16
+Subproject commit b132e5ff270e4817b28da6e82dd01fc1c6d8b667

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1927557dbc4d7927a2fa5bd818e32762f0b9dff7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.29.0-wmf.5
Gerrit-Owner: Alex Monk 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Flow[wmf/1.29.0-wmf.5]: FlowFixInconsistentBoards: Don't output non-critical error info

2016-12-14 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327402 )

Change subject: FlowFixInconsistentBoards: Don't output non-critical error info
..

FlowFixInconsistentBoards: Don't output non-critical error info

Only check $workflowByPageId if we're about to fix a board
with an inconsistent title.

If we're not even attempting a title fix, this hurts performance and
makes the output longer.

Bug: T148057
Change-Id: I42872d8784298936144c23c6801843a67b2b1bbd
(cherry picked from commit 214b00e4ce30e8afd2acbf6e04a336f3ced784a7)
---
M maintenance/FlowFixInconsistentBoards.php
1 file changed, 25 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/02/327402/1

diff --git a/maintenance/FlowFixInconsistentBoards.php 
b/maintenance/FlowFixInconsistentBoards.php
index 08f6a8f..fe3468c 100644
--- a/maintenance/FlowFixInconsistentBoards.php
+++ b/maintenance/FlowFixInconsistentBoards.php
@@ -98,6 +98,10 @@
 
$checkedCount = 0;
$inconsistentCount = 0;
+
+   // Not all of $inconsistentCount are fixable by the current 
script.
+   $fixableInconsistentCount = 0;
+
foreach ( $iterator as $rows ) {
foreach ( $rows as $row ) {
$checkedCount++;
@@ -121,22 +125,24 @@
continue;
}
 
-   $pageId = (int)$row->page_id;
-
-   // Sanity check, or this will fail in BoardMover
-   $workflowByPageId = $this->storage->find( 
'Workflow', array(
-   'workflow_wiki' => wfWikiID(),
-   'workflow_page_id' => $pageId,
-   ) );
-
-   if ( !$workflowByPageId ) {
-   $this->error( "ERROR: '$coreTitle' has 
page ID '$pageId', but no workflow is linked to this page ID" );
-   continue;
-   }
-
if ( !$workflow->matchesTitle( $coreTitle ) ) {
+   $pageId = (int)$row->page_id;
+
$workflowTitle = 
$workflow->getOwnerTitle();
$this->output( "INCONSISTENT: Core 
title for '$workflowIdAlphadecimal' is '$coreTitle', but Flow title is 
'$workflowTitle'\n" );
+
+   $inconsistentCount++;
+
+   // Sanity check, or this will fail in 
BoardMover
+   $workflowByPageId = 
$this->storage->find( 'Workflow', array(
+   'workflow_wiki' => 
wfWikiID(),
+   'workflow_page_id' => 
$pageId,
+   ) );
+
+   if ( !$workflowByPageId ) {
+   $this->error( "ERROR: 
'$coreTitle' has page ID '$pageId', but no workflow is linked to this page ID" 
);
+   continue;
+   }
 
if ( !$dryRun ) {
$this->boardMover->move( 
$pageId, $coreTitle );
@@ -144,16 +150,17 @@
$this->output( "FIXED: Updated 
'$workflowIdAlphadecimal' to match core title, '$coreTitle'\n" );
}
 
-   $inconsistentCount++;
-   if ( $limit !== null && 
$inconsistentCount >= $limit ) {
+   $fixableInconsistentCount++;
+
+   if ( $limit !== null && 
$fixableInconsistentCount >= $limit ) {
break;
}
}
}
 
-   $action = $dryRun ? 'Identified' : 'Fixed';
-   $this->output( "Checked a total of $checkedCount Flow 
boards.  $action a total of $inconsistentCount inconsistent boards.\n" );
-   if ( $limit !== null && $inconsistentCount >= $limit ) {
+   $action = $dryRun ? 'identified as fixable' : 'fixed';
+   $this->output( "\nChecked a total of $checkedCount Flow 
boards.  Of those, $inconsistentCount boards had an inconsistent title; 
$fixableInconsistentCount were $action.\n" );
+   if ( $limit !== null && $fixableInconsistentCount >= 

[MediaWiki-commits] [Gerrit] wikimedia...dash[master]: WIP top 10 days / hours

2016-12-14 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327401 )

Change subject: WIP top 10 days / hours
..

WIP top 10 days / hours

TODO: wire up filters

Bug: T152028
Change-Id: I183615c9cb077f078cafa9602fe36aa8fcfbe31a
---
M routes/data.js
A schema/0005_top10.sql
M src/app/startup.js
A src/components/widgets/top10/top10.html
A src/components/widgets/top10/top10.js
A widgets/top10.js
6 files changed, 159 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/01/327401/1

diff --git a/routes/data.js b/routes/data.js
index 599b3f1..3319b30 100644
--- a/routes/data.js
+++ b/routes/data.js
@@ -329,13 +329,13 @@
return;
}
}
-   sqlQuery = sqlQuery.replace( '[[WHERE]]', whereClause );
+   sqlQuery = sqlQuery.replace( /\[\[WHERE\]\]/g, whereClause );
for ( i = 0; i < joins.length; i++ ) {
joinClause += widget.optionalJoins[joins[i]].text + ' ';
}
-   sqlQuery = sqlQuery.replace( '[[JOINS]]', joinClause );
-   sqlQuery = sqlQuery.replace( '[[GROUP]]', groupClause );
-   sqlQuery = sqlQuery.replace( '[[SELECTGROUP]]', selectGroup );
+   sqlQuery = sqlQuery.replace( /\[\[JOINS\]\]/g, joinClause );
+   sqlQuery = sqlQuery.replace( /\[\[GROUP\]\]/g, groupClause );
+   sqlQuery = sqlQuery.replace( /\[\[SELECTGROUP\]\]/g, selectGroup );
 
connection = mysql.createConnection({
host: config.dbserver,
diff --git a/schema/0005_top10.sql b/schema/0005_top10.sql
new file mode 100644
index 000..2f68aa6
--- /dev/null
+++ b/schema/0005_top10.sql
@@ -0,0 +1,2 @@
+INSERT IGNORE INTO dash_widget (code, display_name, description, preview_path)
+   VALUES ('top10', 'Top 10 days and hours', 'Best 10 days and hours in 
the history of fundraising.', 'images/top10.png');
diff --git a/src/app/startup.js b/src/app/startup.js
index 775e4bd..42cd8eb 100644
--- a/src/app/startup.js
+++ b/src/app/startup.js
@@ -29,6 +29,7 @@
ko.components.register( 'distance-to-goal-chart', { 
require: 'components/widgets/distance-to-goal-chart/distance-to-goal-chart' });
ko.components.register( 'donation-age',   { 
require: 'components/widgets/donation-age/donation-age' });
ko.components.register( 'fraud-gauge',{ 
require: 'components/widgets/fraud-gauge/fraud-gauge' });
+   ko.components.register( 'top10',  { 
require: 'components/widgets/top10/top10' });
ko.components.register( 'totals-earned-chart',{ 
require: 'components/widgets/totals-earned-chart/totals-earned-chart' });
ko.components.register( 'x-by-y', { 
require: 'components/widgets/x-by-y/x-by-y' });
 
diff --git a/src/components/widgets/top10/top10.html 
b/src/components/widgets/top10/top10.html
new file mode 100644
index 000..3947765
--- /dev/null
+++ b/src/components/widgets/top10/top10.html
@@ -0,0 +1,70 @@
+
+   
+   
+   
+   
+   
+
+ Saved
+
+   
+   
+   
+   
+   
+   Top 10 days
+   
+   : 
$
+   
+   
+   
+   Top 10 hours
+   
+   : 
$
+   
+   
+   
+   
+   
+   
+   
+   Close
+   Filters
+   
+   
+   
+   
+   
+   
+   
+   
+
+   
+   
+   
+   
+   Close
+   Top 10 SQL:
+   
+   
+   
+   
+   
+   
+   
+
+   
+   
+   
+   
+   Remove this widget from the 
board?
+   
+   
+OK
+Cancel
+   
+   
+   
+   
+
+
diff --git a/src/components/widgets/top10/top10.js 

[MediaWiki-commits] [Gerrit] mediawiki...UploadWizard[wmf/1.29.0-wmf.6]: mw.FormDataTransport: Update check for already completed chu...

2016-12-14 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327400 )

Change subject: mw.FormDataTransport: Update check for already completed 
chunked uploads
..

mw.FormDataTransport: Update check for already completed chunked uploads

MediaWiki core commit 4e6810e4a2c1d821d8d108c7974ac16917561764
caused the error message to change.

(We're working to switch the error format to the new one introduced in
that commit, but I58b9a7ed054ad0084bcd7180d92bd69ccc7ed129 is still
work in progress.)

Bug: T153231
Change-Id: I8d5d9fd23bc649bd85a4aeaa0ea3bf20d20a4cf2
(cherry picked from commit 3e14eac7fb0ad7e919a6ea6c3f68a03ae43ddecf)
---
M resources/transports/mw.FormDataTransport.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/00/327400/1

diff --git a/resources/transports/mw.FormDataTransport.js 
b/resources/transports/mw.FormDataTransport.js
index 6208577..812cd35 100644
--- a/resources/transports/mw.FormDataTransport.js
+++ b/resources/transports/mw.FormDataTransport.js
@@ -275,7 +275,7 @@
if (
response.error &&
response.error.code === 'stashfailed' &&
-   response.error.info === 'Chunked upload 
is already completed, check status for details'
+   response.error.info === 'Chunked upload 
is already completed, check status for details.'
) {
return transport.retryWithMethod( 
'checkStatus' );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d5d9fd23bc649bd85a4aeaa0ea3bf20d20a4cf2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: wmf/1.29.0-wmf.6
Gerrit-Owner: Bartosz Dziewoński 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PageAssessments[master]: Adding IGNORE in case 2 records for the same project are add...

2016-12-14 Thread Kaldari (Code Review)
Kaldari has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327399 )

Change subject: Adding IGNORE in case 2 records for the same project are added 
at once
..

Adding IGNORE in case 2 records for the same project are added at once

Also adding more code comments.

Bug: T152080
Change-Id: I417f25bb52c9b064f736b00b756ec29217dd5f78
---
M PageAssessmentsBody.php
1 file changed, 11 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageAssessments 
refs/changes/99/327399/1

diff --git a/PageAssessmentsBody.php b/PageAssessmentsBody.php
index baba514..b5b0438 100644
--- a/PageAssessmentsBody.php
+++ b/PageAssessmentsBody.php
@@ -43,19 +43,25 @@
 
$pageId = $titleObj->getArticleID();
$revisionId = $titleObj->getLatestRevID();
-   // Compile a list of projects to find out which ones to be 
deleted afterwards
+   // Compile a list of projects found in the parserData to find 
out which
+   // projects need to be inserted, deleted, or updated.
$projects = array();
foreach ( $assessmentData as $parserData ) {
+   // If the name of the project is set...
if ( isset( $parserData[0] ) && $parserData[0] !== '' ) 
{
-   // For each project, get the corresponding ID 
from page_assessments_projects table
+   // ...get the corresponding ID from 
page_assessments_projects table.
$projectId = self::getProjectId( $parserData[0] 
);
+   // If there is no existing project by that 
name, add it to the table.
if ( $projectId === false ) {
$projectId = self::insertProject( 
$parserData[0] );
}
+   // Add the project's ID to the array.
$projects[$parserData[0]] = $projectId;
}
}
+   // Get a list of all the projects previously assigned to this 
page.
$projectsInDb = self::getAllProjects( $pageId, 
self::READ_LATEST );
+
$toInsert = array_diff( $projects, $projectsInDb );
$toDelete = array_diff( $projectsInDb, $projects );
$toUpdate = array_intersect( $projects, $projectsInDb );
@@ -203,7 +209,9 @@
 */
public static function insertRecord( $values ) {
$dbw = wfGetDB( DB_MASTER );
-   $dbw->insert( 'page_assessments', $values, __METHOD__ );
+   // Use IGNORE in case 2 records for the same project are added 
at once.
+   // This normally shouldn't happen, but is possible. (See 
T152080)
+   $dbw->insert( 'page_assessments', $values, __METHOD__, [ 
'IGNORE' ] );
return true;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I417f25bb52c9b064f736b00b756ec29217dd5f78
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageAssessments
Gerrit-Branch: master
Gerrit-Owner: Kaldari 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[wmf/1.29.0-wmf.5]: Fix wikitext handling of DataTransferHandlers when IVStore i...

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327395 )

Change subject: Fix wikitext handling of DataTransferHandlers when IVStore is 
used
..


Fix wikitext handling of DataTransferHandlers when IVStore is used

Bug: T153269
Change-Id: Ida6ac6e6a65784dc84a388d3702680a79db9
(cherry picked from commit c92418e4dae7a77139ebae3a604ce29dab32a448)
---
M modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js 
b/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
index 417b5d2..03d9140 100644
--- a/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
+++ b/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
@@ -50,7 +50,11 @@
if ( typeof dataOrDoc === 'string' || ( Array.isArray( 
dataOrDoc ) && dataOrDoc.every( isPlain ) ) ) {
resolve( dataOrDoc );
} else {
-   doc = dataOrDoc instanceof ve.dm.Document ? dataOrDoc : 
new ve.dm.Document( dataOrDoc );
+   doc = dataOrDoc instanceof ve.dm.Document ?
+   dataOrDoc :
+   // The handler may have also written items to 
the store
+   new ve.dm.Document( new 
ve.dm.ElementLinearData( handler.surface.getModel().getDocument().getStore(), 
dataOrDoc ) );
+
ve.init.target.getWikitextFragment( doc, false )
.done( resolve )
.fail( function () {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ida6ac6e6a65784dc84a388d3702680a79db9
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.29.0-wmf.5
Gerrit-Owner: Alex Monk 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...AdvancedMeta[master]: Replaced deprecated hooks

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/325735 )

Change subject: Replaced deprecated hooks
..


Replaced deprecated hooks

* ArticleInsertComplete with PageContentInsertComplete
* ArticleSave with PageContentSave
* Also made hook definitions explicit

Bug: T151973
Change-Id: Ia1cf2c80b366ee0185db1df7f3eb5cf53fcac965
---
M AdvancedMeta.class.php
1 file changed, 38 insertions(+), 27 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/AdvancedMeta.class.php b/AdvancedMeta.class.php
index 85369f8..394d401 100644
--- a/AdvancedMeta.class.php
+++ b/AdvancedMeta.class.php
@@ -30,21 +30,21 @@
global $wgHooks;
 
// Inserts HTML for meta input fields into the edit page.
-   $wgHooks['ParserBeforeTidy'][] = $this;
+   $wgHooks['ParserBeforeTidy'][] = [ $this, 'onParserBeforeTidy' 
];
 
-   // Before the updated text and properties of an article are 
saved to the database
+   // Before the updated text and properties of a wikiPage are 
saved to the database
// the new meta info is saved too
-   $wgHooks['ArticleSave'][] = $this;
+   $wgHooks['PageContentSave'][] = [ $this, 'onPageContentSave' ];
 
-   // If a new article is created the meta is temporarily saved as 
article ID '0'
-   // Move it to the newly created article now
-   $wgHooks['ArticleInsertComplete'][] = $this;
+   // If a new wikiPage is created the meta is temporarily saved 
as article ID '0'
+   // Move it to the newly created wikiPage now
+   $wgHooks['PageContentInsertComplete'][] = [ $this, 
'onPageContentInsertComplete' ];
 
// Insert meta into article
-   $wgHooks['OutputPageBeforeHTML'][] = $this;
+   $wgHooks['OutputPageBeforeHTML'][] = [ $this, 
'onOutputPageBeforeHTML' ];
 
// Title Alias
-   $wgHooks['BeforePageDisplay'][] = $this;
+   $wgHooks['BeforePageDisplay'][] = [ $this, 
'onBeforePageDisplay' ];
}
 
/**
@@ -187,18 +187,28 @@
}
 
/**
-* Hook 2: Called during function doEdit() in /includes/Article.php
+* Hook 2: Called during function doEditContent() in 
/includes/page/WikiPage.php
 * Adds the new meta information to the database when an article is 
saved
 *
-* @param object $article The entire article and it's properties
-* @param object $user The user updating the article
+* @param object $wikiPage The entire Wikipage and its properties
+* @param object $user The User saving the article
+* @param object $content The new article content, as a Content object
+* @param string $summary The article summary, as a comment
+* @param boolean $isMinor Minor flag
+* @param boolean $isWatch Watch flag (not used, always null)
+* @param boolean $section section number (not used, always null)
+* @param unknown $flags Flags passed to Wikipage::doEditContent()
+* @param object $status
+*
 * @return true
 *
-* @global indexedpages , array of namespaces that should be indexed
+* @global indexedpages, array of namespaces that should be indexed
 *
 */
-   public function onArticleSave( &$article, &$user ) {
-   $id = $article->mTitle->getArticleID();
+   public function onPageContentSave( &$wikiPage, &$user, &$content, 
&$summary, $isMinor,
+   $isWatch, $section, &$flags, &$status ) {
+
+   $id = $wikiPage->getTitle()->getArticleID();
 
// can this user edit meta for this page?
if ( !$this->canEditMeta() ) {
@@ -238,27 +248,28 @@
 * Hook 3: Called during function doEdit() in /includes/Article.php
 * Move the new meta information from a temporary id='0' to the new 
article's id
 *
-* @param object $article : the article (object) saved
-* @param object $user : the user (object) who saved the article
-* @param string $text : the new article content
-* @param string $summary : the article summary (comment)
-* @param bool $minoredit : minor edit flag
-* @param bool $watchthis : not used as of 1.8 (automatically set to 
"null")
-* @param bool $sectionanchor : not used as of 1.8 (automatically set 
to "null")
-* @param unknown $flags : bitfield, see source code for details; 
passed to Article::doedit()
-* @param object $revision : The newly inserted revision object (as of 
1.11.0)
+* @param object $wikiPage The entire Wikipage created and its 
properties
+* @param object $user The User creating the article
+* @param object 

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Allow 'T-' prefixed sections, and redirect if section link t...

2016-12-14 Thread Esanders (Code Review)
Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327398 )

Change subject: Allow 'T-' prefixed sections, and redirect if section link 
title isn't current page
..

Allow 'T-' prefixed sections, and redirect if section link title isn't current 
page

Bug: T153176
Change-Id: Ic6fda78d00715777df4a273e7d3e150f20185185
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
1 file changed, 11 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/98/327398/1

diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index 2abcf62..b1e8406 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -103,8 +103,8 @@
 
function parseSection( section ) {
var parsedSection = section;
-   // Section must be 'new' or a number
-   if ( section !== 'new' ) {
+   // Section must be a number, 'new' or 'T-' prefixed
+   if ( section !== 'new' && section.indexOf( 'T-' ) !== 0 ) {
parsedSection = +section;
if ( isNaN( parsedSection ) ) {
parsedSection = null;
@@ -660,9 +660,16 @@
 * @param {number|string} [section] Override edit section, 
taken from link URL if not specified
 */
onEditSectionLinkClick: function ( mode, e, section ) {
-   var targetPromise;
+   var targetPromise,
+   uri = new mw.Uri( e.target.href ),
+   title = mw.Title.newFromText( uri.query.title 
|| '' );
+
if ( !init.isUnmodifiedLeftClick( e ) ) {
return;
+   }
+   if ( title && title.getPrefixedText() !== new mw.Title( 
mw.config.get( 'wgRelevantPageName' ) ).getPrefixedText() ) {
+   // title param doesn't match current page, let 
default event happen (navigate to other page)
+   return true;
}
e.preventDefault();
if ( isLoading ) {
@@ -690,7 +697,7 @@
} else {
// Use section from URL
if ( section === undefined ) {
-   section = parseSection( new mw.Uri( 
e.target.href ).query.section );
+   section = parseSection( 
uri.query.section );
}
targetPromise = getTarget( mode, section );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic6fda78d00715777df4a273e7d3e150f20185185
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[wmf/1.29.0-wmf.5]: Fix DataTransferHandlers when loading source editor directly...

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327389 )

Change subject: Fix DataTransferHandlers when loading source editor directly 
(no etag)
..


Fix DataTransferHandlers when loading source editor directly (no etag)

Bug: T153268
Change-Id: I0b43fd651e26c3d74a5f29e8ed80e5dee28ac399
(cherry picked from commit 1b726dc9bcb5d0ba654a39ae4406845a27dcacdb)
---
M modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js 
b/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
index 0a2609a..417b5d2 100644
--- a/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
+++ b/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
@@ -51,7 +51,7 @@
resolve( dataOrDoc );
} else {
doc = dataOrDoc instanceof ve.dm.Document ? dataOrDoc : 
new ve.dm.Document( dataOrDoc );
-   ve.init.target.getWikitextFragment( doc )
+   ve.init.target.getWikitextFragment( doc, false )
.done( resolve )
.fail( function () {
handler.abort();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b43fd651e26c3d74a5f29e8ed80e5dee28ac399
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.29.0-wmf.5
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Echo[wmf/1.29.0-wmf.6]: Follow-up d66771523c2: unbreak ext.echo.emailicons module

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327393 )

Change subject: Follow-up d66771523c2: unbreak ext.echo.emailicons module
..


Follow-up d66771523c2: unbreak ext.echo.emailicons module

When generating extension.json, I missed the fact that
this module has a dynamic localBasePath (set to $wgExtensionDirectory),
and this turned into "localBasePath": null.

Instead, register this module dynamically.

Bug: T153261
Change-Id: I61709d6ea0948dd983ab41c9457adda434525bb7
(cherry picked from commit b758cc5d5af7b693cb26413b58cd1fea1f798c55)
---
M Hooks.php
M extension.json
2 files changed, 8 insertions(+), 6 deletions(-)

Approvals:
  20after4: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Hooks.php b/Hooks.php
index 7d56ae1..286768e 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -153,6 +153,14 @@
}
 
$resourceLoader->register( 'ext.echo.logger', $definition );
+
+   global $wgExtensionDirectory;
+   $resourceLoader->register( 'ext.echo.emailicons', [
+   'class' => 'ResourceLoaderEchoImageModule',
+   'selector' => '.mw-echo-icon-{name}',
+   'localBasePath' => $wgExtensionDirectory,
+   'remoteExtPath' => 'Echo/modules'
+   ] );
}
 
/**
diff --git a/extension.json b/extension.json
index bb252f6..4a60aeb 100644
--- a/extension.json
+++ b/extension.json
@@ -521,12 +521,6 @@
"rootPath": "icons",
"selectorWithoutVariant": ".oo-ui-icon-{name}",
"selectorWithVariant": 
".oo-ui-image-{variant}.oo-ui-icon-{name}"
-   },
-   "ext.echo.emailicons": {
-   "class": "ResourceLoaderEchoImageModule",
-   "selector": ".mw-echo-icon-{name}",
-   "localBasePath": null,
-   "remoteExtPath": "Echo/modules"
}
},
"ResourceFileModulePaths": {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I61709d6ea0948dd983ab41c9457adda434525bb7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: wmf/1.29.0-wmf.6
Gerrit-Owner: 20after4 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Linter[master]: Record totals in categories in statsd

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/325892 )

Change subject: Record totals in categories in statsd
..


Record totals in categories in statsd

For historical purposes so we can see new errors being added/fixed.

Bug: T152664
Change-Id: Icec62d236351e43ec397ac448805ab16131c943c
---
M extension.json
M includes/RecordLintJob.php
2 files changed, 30 insertions(+), 1 deletion(-)

Approvals:
  Addshore: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Arlolra: Looks good to me, approved



diff --git a/extension.json b/extension.json
index f00ede7..42b7614 100644
--- a/extension.json
+++ b/extension.json
@@ -64,7 +64,8 @@
},
"LinterSubmitterWhitelist": {
"127.0.0.1": true
-   }
+   },
+   "LinterStatsdSampleFactor": false
},
"manifest_version": 1
 }
diff --git a/includes/RecordLintJob.php b/includes/RecordLintJob.php
index 518ea42..ab2eeab 100644
--- a/includes/RecordLintJob.php
+++ b/includes/RecordLintJob.php
@@ -21,6 +21,7 @@
 namespace MediaWiki\Linter;
 
 use Job;
+use MediaWiki\MediaWikiServices;
 use Title;
 
 class RecordLintJob extends Job {
@@ -62,7 +63,34 @@
}
 
$lintDb->setForPage( $toSet );
+   $this->updateStats( $lintDb );
+
return true;
}
 
+   /**
+* Send stats to statsd
+*
+* @param Database $lintDb
+*/
+   protected function updateStats( Database $lintDb ) {
+   global $wgLinterStatsdSampleFactor;
+
+   if ( $wgLinterStatsdSampleFactor === false ) {
+   // Not enabled at all
+   return;
+   } elseif ( mt_rand( 1, $wgLinterStatsdSampleFactor ) != 1 ) {
+   return;
+   }
+
+   $totals = $lintDb->getTotals();
+
+   $stats = 
MediaWikiServices::getInstance()->getStatsdDataFactory();
+   foreach ( $totals as $name => $count ) {
+   $stats->gauge( "linter.category.$name", $count );
+   }
+
+   $stats->gauge( "linter.totals", array_sum( $totals ) );
+   }
+
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icec62d236351e43ec397ac448805ab16131c943c
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Linter
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Arlolra 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[wmf/1.29.0-wmf.6]: Fix wikitext handling of DataTransferHandlers when IVStore i...

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327392 )

Change subject: Fix wikitext handling of DataTransferHandlers when IVStore is 
used
..


Fix wikitext handling of DataTransferHandlers when IVStore is used

Bug: T153269
Change-Id: Ida6ac6e6a65784dc84a388d3702680a79db9
(cherry picked from commit c92418e4dae7a77139ebae3a604ce29dab32a448)
---
M modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js 
b/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
index 417b5d2..03d9140 100644
--- a/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
+++ b/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
@@ -50,7 +50,11 @@
if ( typeof dataOrDoc === 'string' || ( Array.isArray( 
dataOrDoc ) && dataOrDoc.every( isPlain ) ) ) {
resolve( dataOrDoc );
} else {
-   doc = dataOrDoc instanceof ve.dm.Document ? dataOrDoc : 
new ve.dm.Document( dataOrDoc );
+   doc = dataOrDoc instanceof ve.dm.Document ?
+   dataOrDoc :
+   // The handler may have also written items to 
the store
+   new ve.dm.Document( new 
ve.dm.ElementLinearData( handler.surface.getModel().getDocument().getStore(), 
dataOrDoc ) );
+
ve.init.target.getWikitextFragment( doc, false )
.done( resolve )
.fail( function () {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ida6ac6e6a65784dc84a388d3702680a79db9
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.29.0-wmf.6
Gerrit-Owner: Alex Monk 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[wmf/1.29.0-wmf.6]: Use deep clone for empty convertFromSource

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327374 )

Change subject: Use deep clone for empty convertFromSource
..


Use deep clone for empty convertFromSource

Bug: T153254
Change-Id: I0dc6be0d20020e3fb385c9d065f9395dbda5a6b6
(cherry picked from commit 854256bb8e5b5a8298d8904f1e938722cb4140c1)
---
M modules/ve-mw/dm/ve.dm.MWWikitextSurfaceFragment.js
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/dm/ve.dm.MWWikitextSurfaceFragment.js 
b/modules/ve-mw/dm/ve.dm.MWWikitextSurfaceFragment.js
index 68c5850..5cd872c 100644
--- a/modules/ve-mw/dm/ve.dm.MWWikitextSurfaceFragment.js
+++ b/modules/ve-mw/dm/ve.dm.MWWikitextSurfaceFragment.js
@@ -155,7 +155,7 @@
var parsePromise;
if ( !source ) {
parsePromise = $.Deferred().resolve(
-   this.getDocument().shallowCloneFromRange( new ve.Range( 
0 ) )
+   this.getDocument().cloneFromRange( new ve.Range( 0 ) )
).promise();
} else {
parsePromise = new mw.Api().post( {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0dc6be0d20020e3fb385c9d065f9395dbda5a6b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.29.0-wmf.6
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] wikimedia...dash[master]: WIP clean up subscriptions and timers

2016-12-14 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327397 )

Change subject: WIP clean up subscriptions and timers
..

WIP clean up subscriptions and timers

Bug: T152722
Change-Id: I7c04e294da52cd832f49e32eaa4935e517182055
---
M src/app/widgetBase.js
1 file changed, 16 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/97/327397/1

diff --git a/src/app/widgetBase.js b/src/app/widgetBase.js
index ae2539b..1ee0bd0 100644
--- a/src/app/widgetBase.js
+++ b/src/app/widgetBase.js
@@ -14,6 +14,10 @@
 
var self = this;
 
+   // Things to clean up when the widget is removed
+   self.disposables = [];
+   self.timers = [];
+
self.retrievedResults   = ko.observable();
self.queryStringSQL = ko.observable('This widget hasn\'t 
been set up yet!');
self.tempConfig = ko.observable();
@@ -351,10 +355,21 @@
}, 50 );
return;
}
-   parent[member].subscribe( callback );
+   self.disposables.push( parent[member].subscribe( 
callback ) );
callback();
};
 
+   self.dispose = function() {
+   ko.utils.arrayForEach( this.disposables, function( 
disposable ) {
+   if ( disposable && disposable.dispose ) {
+   disposable.dispose();
+   }
+   } );
+   ko.utils.arrayForEach( this.timers, function( timer ) {
+   window.clearTimeout( timer );
+   } );
+   };
+
return this;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c04e294da52cd832f49e32eaa4935e517182055
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[wmf/1.29.0-wmf.5]: Use deep clone for empty convertFromSource

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327375 )

Change subject: Use deep clone for empty convertFromSource
..


Use deep clone for empty convertFromSource

Bug: T153254
Change-Id: I0dc6be0d20020e3fb385c9d065f9395dbda5a6b6
(cherry picked from commit 854256bb8e5b5a8298d8904f1e938722cb4140c1)
---
M modules/ve-mw/dm/ve.dm.MWWikitextSurfaceFragment.js
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/dm/ve.dm.MWWikitextSurfaceFragment.js 
b/modules/ve-mw/dm/ve.dm.MWWikitextSurfaceFragment.js
index 68c5850..5cd872c 100644
--- a/modules/ve-mw/dm/ve.dm.MWWikitextSurfaceFragment.js
+++ b/modules/ve-mw/dm/ve.dm.MWWikitextSurfaceFragment.js
@@ -155,7 +155,7 @@
var parsePromise;
if ( !source ) {
parsePromise = $.Deferred().resolve(
-   this.getDocument().shallowCloneFromRange( new ve.Range( 
0 ) )
+   this.getDocument().cloneFromRange( new ve.Range( 0 ) )
).promise();
} else {
parsePromise = new mw.Api().post( {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0dc6be0d20020e3fb385c9d065f9395dbda5a6b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.29.0-wmf.5
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[wmf/1.29.0-wmf.6]: Fix DataTransferHandlers when loading source editor directly...

2016-12-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327390 )

Change subject: Fix DataTransferHandlers when loading source editor directly 
(no etag)
..


Fix DataTransferHandlers when loading source editor directly (no etag)

Bug: T153268
Change-Id: I0b43fd651e26c3d74a5f29e8ed80e5dee28ac399
(cherry picked from commit 1b726dc9bcb5d0ba654a39ae4406845a27dcacdb)
---
M modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js 
b/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
index 0a2609a..417b5d2 100644
--- a/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
+++ b/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
@@ -51,7 +51,7 @@
resolve( dataOrDoc );
} else {
doc = dataOrDoc instanceof ve.dm.Document ? dataOrDoc : 
new ve.dm.Document( dataOrDoc );
-   ve.init.target.getWikitextFragment( doc )
+   ve.init.target.getWikitextFragment( doc, false )
.done( resolve )
.fail( function () {
handler.abort();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b43fd651e26c3d74a5f29e8ed80e5dee28ac399
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.29.0-wmf.6
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Hygiene: remove extracts.js

2016-12-14 Thread BearND (Code Review)
BearND has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327396 )

Change subject: Hygiene: remove extracts.js
..

Hygiene: remove extracts.js

Follow-up of Idc70d6e989a67421ee5af1b0d2350cfc06a3da94.
Should have removed that then.

Change-Id: I35ee543be4c9ae6d14857fefc1ef42b64f18fa34
---
D lib/extract.js
1 file changed, 0 insertions(+), 112 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/96/327396/1

diff --git a/lib/extract.js b/lib/extract.js
deleted file mode 100644
index 9142f97..000
--- a/lib/extract.js
+++ /dev/null
@@ -1,112 +0,0 @@
-'use strict';
-
-/**
- Article extracts
- */
-
-/**
- * @param {string} [str]
- * @return {string} str, less parenthetical expressions and their leading 
whitespace, if balanced.
- */
-function removeParens(str) {
-function count(paren) {
-return ((str || '').match(new RegExp(`\\${paren}`, 'g')) || []).length;
-}
-
-const openCount = count('(');
-const closeCount = count(')');
-const regex = /\s*\([^()]*\)/g;
-return openCount && openCount === closeCount ? 
removeParens(str.replace(regex, '')) : str;
-}
-
-/**
- * Find all matches of regex in text, calling callback with each match object
- *
- * TODO: remove when switching to Parsoid. Copied from:
- * 
https://github.com/wikimedia/mediawiki-services-cxserver/blob/0d21a808f7ab6b82086171af927467c1b9460626/lineardoc/Utils.js
- *
- * @param {string} text The text to search
- * @param {Regex} regex The regex to search; should be created for this 
function call
- * @param {Function} callback Function to call with each match
- * @return {Array} The return values from the callback
- */
-function findAll(text, regex, callback) {
-const boundaries = [];
-do {
-const match = regex.exec(text);
-if (match === null) {
-break;
-}
-const boundary = callback(text, match);
-if (boundary !== null) {
-boundaries.push(boundary);
-}
-} while (regex.test(text));
-return boundaries;
-}
-
-/**
- * Test a possible English sentence boundary match
- *
- * TODO: remove when switching to Parsoid. Copied from:
- * 
https://github.com/wikimedia/mediawiki-services-cxserver/blob/0d21a808f7ab6b82086171af927467c1b9460626/segmentation/languages/SegmenterDefault.js
- *
- * @param {string} text The plaintext to segment
- * @param {Object} match The possible boundary match (returned by regex.exec)
- * @return {number|null} The boundary offset, or null if not a sentence 
boundary
- */
-function findBoundary(text, match) {
-const tail = text.slice(match.index + 1, text.length);
-const head = text.slice(0, match.index);
-
-// Trailing non-final punctuation: not a sentence boundary
-if (tail.match(/^[,;:]/)) {
-return null;
-}
-// Next word character is number or lower-case: not a sentence boundary
-if (tail.match(/^\W*[0-9a-z]/)) {
-return null;
-}
-
-// Do not break in abbreviations. Example D. John, St. Peter
-const lastWord = head.match(/(\w*)$/)[0];
-// Exclude at most 2 letter abbreviations. Examples: T. Dr. St. Jr. Sr. 
Ms. Mr.
-// But not all caps like "UK." as in  "UK. Not US",
-if (lastWord.length <= 2 && lastWord.match(/^\W*[A-Z][a-z]?$/) && 
tail.match(/^\W*[A-Z]/)) {
-return null;
-}
-
-// Include any closing punctuation and trailing space
-return match.index + 1 + tail.match(/^['”"’]*\s*/)[0].length;
-}
-
-/**
- * Find English sentence boundaries
- *
- * TODO: remove when switching to Parsoid. Copied from:
- * 
https://github.com/wikimedia/mediawiki-services-cxserver/blob/0d21a808f7ab6b82086171af927467c1b9460626/segmentation/languages/SegmenterDefault.js
- *
- * @param {string} text The plaintext to segment
- * @returns {number[]} Sentence boundary offsets
- */
-function getBoundaries(text) {
-// Regex to find possible English sentence boundaries.
-// Must not use a shared regex instance (re.lastIndex is used)
-return findAll(text, /[.!?]/g, findBoundary);
-}
-
-function format(extract) {
-const MAX_SENTENCES = 2;
-const cleanStr = removeParens(extract.replace(/\s+/g, ' '));
-const boundaries = getBoundaries(cleanStr);
-const cleanStrEndIndex = boundaries[Math.min(boundaries.length, 
MAX_SENTENCES - 1)];
-
-const ret = cleanStr.slice(0, cleanStrEndIndex).trim();
-if (ret !== '…' && ret !== '..') {
-return ret;
-}
-}
-
-module.exports = {
-format
-};

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35ee543be4c9ae6d14857fefc1ef42b64f18fa34
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: BearND 

___

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[wmf/1.29.0-wmf.5]: Fix wikitext handling of DataTransferHandlers when IVStore i...

2016-12-14 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327395 )

Change subject: Fix wikitext handling of DataTransferHandlers when IVStore is 
used
..

Fix wikitext handling of DataTransferHandlers when IVStore is used

Bug: T153269
Change-Id: Ida6ac6e6a65784dc84a388d3702680a79db9
(cherry picked from commit c92418e4dae7a77139ebae3a604ce29dab32a448)
---
M modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/95/327395/1

diff --git a/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js 
b/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
index 0a2609a..03d9140 100644
--- a/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
+++ b/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js
@@ -50,8 +50,12 @@
if ( typeof dataOrDoc === 'string' || ( Array.isArray( 
dataOrDoc ) && dataOrDoc.every( isPlain ) ) ) {
resolve( dataOrDoc );
} else {
-   doc = dataOrDoc instanceof ve.dm.Document ? dataOrDoc : 
new ve.dm.Document( dataOrDoc );
-   ve.init.target.getWikitextFragment( doc )
+   doc = dataOrDoc instanceof ve.dm.Document ?
+   dataOrDoc :
+   // The handler may have also written items to 
the store
+   new ve.dm.Document( new 
ve.dm.ElementLinearData( handler.surface.getModel().getDocument().getStore(), 
dataOrDoc ) );
+
+   ve.init.target.getWikitextFragment( doc, false )
.done( resolve )
.fail( function () {
handler.abort();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida6ac6e6a65784dc84a388d3702680a79db9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.29.0-wmf.5
Gerrit-Owner: Alex Monk 
Gerrit-Reviewer: Esanders 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


  1   2   3   4   5   >