[MediaWiki-commits] [Gerrit] operations/puppet[production]: Add Html5Depurate module and role

2016-07-25 Thread Tim Starling (Code Review)
Tim Starling has uploaded a new change for review.

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

Change subject: Add Html5Depurate module and role
..

Add Html5Depurate module and role

Change-Id: I606a3645b865ef5d9c96c8f44b0f0cc4b9e3122b
---
A modules/html5depurate/manifests/init.pp
A modules/html5depurate/templates/default.erb
A modules/html5depurate/templates/html5depurate.conf.erb
A modules/html5depurate/templates/security.policy.erb
A modules/role/manifests/html5depurate/server.pp
5 files changed, 91 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/62/301062/1

diff --git a/modules/html5depurate/manifests/init.pp 
b/modules/html5depurate/manifests/init.pp
new file mode 100644
index 000..ad5ae38
--- /dev/null
+++ b/modules/html5depurate/manifests/init.pp
@@ -0,0 +1,48 @@
+# Class for installing an Html5Depurate service
+# https://www.mediawiki.org/wiki/Html5Depurate
+#
+# Parameters:
+# - $listen_host: The IP address or hostname to listen on. Use 0.0.0.0 for
+#   a public service. Note that there is no authentication.
+# - $port: The port to listen on
+# - $max_memory_mb: The maximum memory used by the Java VM, in megabytes
+#
+class html5depurate(
+$listen_host = '127.0.0.1',
+$port  = 4339,
+$max_memory_mb = 500
+)
+{
+package { 'html5depurate':
+ensure  => installed,
+}
+
+file { '/etc/html5depurate/html5depurate.conf':
+owner   => 'root',
+group   => 'root',
+mode=> '0444',
+require => Package['html5depurate'],
+content => template('html5depurate/html5depurate.conf.erb'),
+}
+
+file { '/etc/html5depurate/security.policy':
+owner   => 'root',
+group   => 'root',
+mode=> '0444',
+require => Package['html5depurate'],
+content => template('html5depurate/security.policy.erb'),
+}
+
+file { '/etc/default/html5depurate':
+owner   => 'root',
+group   => 'root',
+mode=> '0444',
+require => Package['html5depurate'],
+content => template('html5depurate/default.erb'),
+}
+
+service { 'html5depurate':
+ensure  => running,
+require => Package['html5depurate'],
+}
+}
diff --git a/modules/html5depurate/templates/default.erb 
b/modules/html5depurate/templates/default.erb
new file mode 100644
index 000..5aabdc6
--- /dev/null
+++ b/modules/html5depurate/templates/default.erb
@@ -0,0 +1 @@
+JAVA_ARGS="-Xmx<% @max_memory_mb %>M -XX:MaxGCPauseMillis=200"
diff --git a/modules/html5depurate/templates/html5depurate.conf.erb 
b/modules/html5depurate/templates/html5depurate.conf.erb
new file mode 100644
index 000..480dedf
--- /dev/null
+++ b/modules/html5depurate/templates/html5depurate.conf.erb
@@ -0,0 +1,7 @@
+# Max POST size, in bytes.
+maxPostSize = 1
+
+# Host or IP and port on which Html5depurate will listen.
+host = <%= @listen_host %>
+port = <%= @port %>
+
diff --git a/modules/html5depurate/templates/security.policy.erb 
b/modules/html5depurate/templates/security.policy.erb
new file mode 100644
index 000..96a6ecd
--- /dev/null
+++ b/modules/html5depurate/templates/security.policy.erb
@@ -0,0 +1,19 @@
+grant {
+   // Config files
+   permission java.io.FilePermission "/etc/html5depurate/-", "read";
+
+   // Resources within jar files
+   permission java.io.FilePermission "/usr/lib/html5depurate/-", "read";
+
+   // Listen on the HTTP port
+   permission java.net.SocketPermission "localhost:<%= @port %>", "listen";
+   permission java.net.SocketPermission "<%= @listen_host %>:<%= @port 
%>", "listen";
+
+   // Accept permissions need to be granted to the remote host on its 
ephemeral port
+   permission java.net.SocketPermission "localhost", "accept,resolve";
+   permission java.net.SocketPermission "<%= @listen_host %>", 
"accept,resolve";
+
+   // Other permissions
+   permission java.util.PropertyPermission "*", "read";
+   permission java.lang.RuntimePermission "modifyThread";
+};
diff --git a/modules/role/manifests/html5depurate/server.pp 
b/modules/role/manifests/html5depurate/server.pp
new file mode 100644
index 000..a758434
--- /dev/null
+++ b/modules/role/manifests/html5depurate/server.pp
@@ -0,0 +1,16 @@
+# Class for installing an Html5Depurate service
+# https://www.mediawiki.org/wiki/Html5Depurate
+class role::html5depurate::server {
+system::role { 'role::html5depurate::server':
+description => 'Html5Depurate server'
+}
+
+$max_memory_mb = ceiling($::memorysize_mb * 0.5)
+
+class { '::html5depurate':
+listen_host => '0.0.0.0',
+max_memory_mb   => $max_memory_mb
+}
+
+include ::html5depurate::monitoring
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/301062

[MediaWiki-commits] [Gerrit] mediawiki...PoolCounter[master]: Update arrays, calls to deprecated functions

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update arrays, calls to deprecated functions
..


Update arrays, calls to deprecated functions

Change-Id: Iac94789f274ab2d8da179b00db288185b3150834
---
M PoolCounterClient_body.php
1 file changed, 23 insertions(+), 5 deletions(-)

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



diff --git a/PoolCounterClient_body.php b/PoolCounterClient_body.php
index 8353f0c..18e080a 100644
--- a/PoolCounterClient_body.php
+++ b/PoolCounterClient_body.php
@@ -2,9 +2,13 @@
 
 class PoolCounter_ConnectionManager {
public $hostNames;
-   public $conns = array();
-   public $refCounts = array();
+   public $conns = [];
+   public $refCounts = [];
 
+   /**
+* @param array $conf
+* @throws MWException
+*/
function __construct( $conf ) {
$this->hostNames = $conf['servers'];
$this->timeout = isset( $conf['timeout'] ) ? $conf['timeout'] : 
0.1;
@@ -20,12 +24,13 @@
 * @return Status
 */
function get( $key ) {
-   $hashes = array();
+   $hashes = [];
foreach ( $this->hostNames as $hostName ) {
$hashes[$hostName] = md5( $hostName . $key );
}
asort( $hashes );
$errno = $errstr = '';
+   $conn = null;
foreach ( $hashes as $hostName => $hash ) {
if ( isset( $this->conns[$hostName] ) ) {
$this->refCounts[$hostName]++;
@@ -35,9 +40,9 @@
if ( count( $parts ) < 2 ) {
$parts[] = 7531;
}
-   wfSuppressWarnings();
+   MediaWiki\suppressWarnings();
$conn = $this->open( $parts[0], $parts[1], $errno, 
$errstr );
-   wfRestoreWarnings();
+   MediaWiki\restoreWarnings();
if ( $conn ) {
break;
}
@@ -53,6 +58,11 @@
 
/**
 * Open a socket. Just a wrapper for fsockopen()
+* @param string $host
+* @param int $port
+* @param $errno
+* @param $errstr
+* @return null|resource
 */
private function open( $host, $port, &$errno, &$errstr ) {
// If connect_timeout is set, we try to open the socket twice.
@@ -67,6 +77,7 @@
$timeout = $this->timeout;
}
 
+   $fp = null;
while ( true ) {
$fp = fsockopen( $host, $port, $errno, $errstr, 
$timeout );
if ( $fp !== false || --$tries < 1 ) {
@@ -102,11 +113,18 @@
 * releases all locks acquired.
 */
private $conn;
+
/**
 * @var PoolCounter_ConnectionManager
 */
static private $manager;
 
+   /**
+* PoolCounter_Client constructor.
+* @param array $conf
+* @param string $type
+* @param string $key
+*/
function __construct( $conf, $type, $key ) {
parent::__construct( $conf, $type, $key );
if ( !self::$manager ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iac94789f274ab2d8da179b00db288185b3150834
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PoolCounter
Gerrit-Branch: master
Gerrit-Owner: Reedy 
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...EventLogging[master]: Fix mixed leading whitespace

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix mixed leading whitespace
..


Fix mixed leading whitespace

Change-Id: I73b9b0ff6e3a6ec82782e2bd1437c180ce7c2423
---
M includes/JsonSchema.php
1 file changed, 5 insertions(+), 5 deletions(-)

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



diff --git a/includes/JsonSchema.php b/includes/JsonSchema.php
index 5d65cd0..085ba8b 100644
--- a/includes/JsonSchema.php
+++ b/includes/JsonSchema.php
@@ -364,11 +364,11 @@
// additionalProperties can *either* be a boolean or 
can be
// defined as a schema (an object)
if ( gettype( $snode['additionalProperties'] ) == 
"boolean" ) {
-   if ( !$snode['additionalProperties'] ) {
-   $msg = JsonUtil::uiMessage( 
'jsonschema-invalidkey',
-   $key, 
$this->getDataPathTitles() );
-   throw new JsonSchemaException( $msg );
-   }
+   if ( !$snode['additionalProperties'] ) {
+   $msg = JsonUtil::uiMessage( 
'jsonschema-invalidkey',
+   
$key, $this->getDataPathTitles() );
+   throw new JsonSchemaException( $msg );
+   }
} else {
$schemadata = $snode['additionalProperties'];
$nodename = $key;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I73b9b0ff6e3a6ec82782e2bd1437c180ce7c2423
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Reedy 
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...PoolCounter[master]: Split PoolCounter_ConnectionManager into seperate file

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Split PoolCounter_ConnectionManager into seperate file
..


Split PoolCounter_ConnectionManager into seperate file

Change-Id: I5b375819cfe10b577aba63646a98dc76042a7bd5
---
M PoolCounterClient_body.php
A PoolCounter_ConnectionManager.php
M extension.json
3 files changed, 109 insertions(+), 108 deletions(-)

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



diff --git a/PoolCounterClient_body.php b/PoolCounterClient_body.php
index 18e080a..4e76bac 100644
--- a/PoolCounterClient_body.php
+++ b/PoolCounterClient_body.php
@@ -1,112 +1,5 @@
 hostNames = $conf['servers'];
-   $this->timeout = isset( $conf['timeout'] ) ? $conf['timeout'] : 
0.1;
-   $this->connect_timeout = isset( $conf['connect_timeout'] ) ?
-   $conf['connect_timeout'] : 0;
-   if ( !count( $this->hostNames ) ) {
-   throw new MWException( __METHOD__ . ': no servers 
configured' );
-   }
-   }
-
-   /**
-* @param $key
-* @return Status
-*/
-   function get( $key ) {
-   $hashes = [];
-   foreach ( $this->hostNames as $hostName ) {
-   $hashes[$hostName] = md5( $hostName . $key );
-   }
-   asort( $hashes );
-   $errno = $errstr = '';
-   $conn = null;
-   foreach ( $hashes as $hostName => $hash ) {
-   if ( isset( $this->conns[$hostName] ) ) {
-   $this->refCounts[$hostName]++;
-   return Status::newGood( $this->conns[$hostName] 
);
-   }
-   $parts = explode( ':', $hostName, 2 );
-   if ( count( $parts ) < 2 ) {
-   $parts[] = 7531;
-   }
-   MediaWiki\suppressWarnings();
-   $conn = $this->open( $parts[0], $parts[1], $errno, 
$errstr );
-   MediaWiki\restoreWarnings();
-   if ( $conn ) {
-   break;
-   }
-   }
-   if ( !$conn ) {
-   return Status::newFatal( 
'poolcounter-connection-error', $errstr );
-   }
-   wfDebug( "Connected to pool counter server: $hostName\n" );
-   $this->conns[$hostName] = $conn;
-   $this->refCounts[$hostName] = 1;
-   return Status::newGood( $conn );
-   }
-
-   /**
-* Open a socket. Just a wrapper for fsockopen()
-* @param string $host
-* @param int $port
-* @param $errno
-* @param $errstr
-* @return null|resource
-*/
-   private function open( $host, $port, &$errno, &$errstr ) {
-   // If connect_timeout is set, we try to open the socket twice.
-   // You usually want to set the connection timeout to a very
-   // small value so that in case of failure of a server the
-   // connection to poolcounter is not a SPOF.
-   if ( $this->connect_timeout > 0 ) {
-   $tries = 2;
-   $timeout = $this->connect_timeout;
-   } else {
-   $tries = 1;
-   $timeout = $this->timeout;
-   }
-
-   $fp = null;
-   while ( true ) {
-   $fp = fsockopen( $host, $port, $errno, $errstr, 
$timeout );
-   if ( $fp !== false || --$tries < 1 ) {
-   break;
-   }
-   usleep( 1000 );
-   }
-
-   return $fp;
-   }
-
-   /**
-* @param $conn
-*/
-   function close( $conn ) {
-   foreach ( $this->conns as $hostName => $otherConn ) {
-   if ( $conn === $otherConn ) {
-   if ( $this->refCounts[$hostName] ) {
-   $this->refCounts[$hostName]--;
-   }
-   if ( !$this->refCounts[$hostName] ) {
-   fclose( $conn );
-   unset( $this->conns[$hostName] );
-   }
-   }
-   }
-   }
-}
-
 class PoolCounter_Client extends PoolCounter {
/**
 * @var resource the socket connection to the poolcounter.  Closing this
diff --git a/PoolCounter_ConnectionManager.php 
b/PoolCounter_ConnectionManager.php
new file mode 100644
index 000..a1f5b62
--- /dev/null
+++ b/PoolCounter_ConnectionManager.php
@@ -0,0 +1,108 @@
+hostNames = $conf['servers'];
+   

[MediaWiki-commits] [Gerrit] operations/puppet[production]: ldap: Vastly simplify modify-ldap-group

2016-07-25 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: ldap: Vastly simplify modify-ldap-group
..

ldap: Vastly simplify modify-ldap-group

I'll follow this up with actual documentation on how to do
common LDAP changes!

This is also maintained upstream code, and also has the
advantage of making you notice that our LDAP groups are
super cluttered with people whose access we never remove.

Bug: T114063
Change-Id: Iad66cf8c1be0d970c94630ed53371e4bc68c9647
---
A modules/ldap/files/modify-ldap-group
D modules/ldap/files/scripts/modify-ldap-group
M modules/ldap/manifests/client/utils.pp
M modules/ldap/manifests/management.pp
4 files changed, 16 insertions(+), 150 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/59/301059/1

diff --git a/modules/ldap/files/modify-ldap-group 
b/modules/ldap/files/modify-ldap-group
new file mode 100755
index 000..8858039
--- /dev/null
+++ b/modules/ldap/files/modify-ldap-group
@@ -0,0 +1,9 @@
+#!/bin/bash
+[ $# -eq 0 ] && {
+echo "Usage: $0 groupname";
+echo "Provide name of the group to modify"
+exit 1;
+}
+GROUP="$1"
+
+ldapvi -b ou=groups uid="$GROUP"
\ No newline at end of file
diff --git a/modules/ldap/files/scripts/modify-ldap-group 
b/modules/ldap/files/scripts/modify-ldap-group
deleted file mode 100755
index 6c7978d..000
--- a/modules/ldap/files/scripts/modify-ldap-group
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/usr/bin/python
-
-#
-### THIS FILE IS MANAGED BY PUPPET
-### puppet:///modules/ldap/scripts/modify-ldap-group
-#
-
-import sys
-import grp
-import traceback
-import ldapsupportlib
-import copy
-from optparse import OptionParser
-
-try:
-import ldap
-import ldap.modlist
-except ImportError:
-sys.stderr.write("Unable to import LDAP library.\n")
-sys.exit(1)
-
-
-def main():
-parser = OptionParser(conflict_handler="resolve")
-parser.set_usage('modify-ldap-group [options]  [--rename 
]\nexample: modify-ldap-group --gid=501 wikidev')
-
-ldapSupportLib = ldapsupportlib.LDAPSupportLib()
-ldapSupportLib.addParserOptions(parser, "scriptuser")
-
-parser.add_option("-m", "--directorymanager", action="store_true", 
dest="directorymanager", help="Use the Directory Manager's credentials, rather 
than your own")
-parser.add_option("--gid", action="store", dest="gidNumber", help="Set the 
group's gid")
-parser.add_option("--rename", action="store_true", dest="rename", 
help="Rename the user")
-parser.add_option("--addmembers", action="store", dest="addMembers", 
help="Add a comma separated list of users to this group")
-parser.add_option("--deletemembers", action="store", dest="deleteMembers", 
help="Delete a comma separated list of users from this")
-(options, args) = parser.parse_args()
-
-if len(args) != 1:
-if options.rename and len(args) != 2:
-parser.error("modify-ldap-group expects exactly two arguments when 
using rename.")
-elif not options.rename:
-parser.error("modify-ldap-group expects exactly one argument, 
unless using --rename.")
-
-ldapSupportLib.setBindInfoByOptions(options, parser)
-
-base = ldapSupportLib.getBase()
-
-ds = ldapSupportLib.connect()
-
-# w00t We're in!
-try:
-groupname = args[0]
-PosixData = ds.search_s("ou=groups," + base, ldap.SCOPE_SUBTREE, 
"(&(objectclass=posixGroup)(cn=" + groupname + "))")
-if not PosixData:
-raise ldap.NO_SUCH_OBJECT()
-dn = PosixData[0][0]
-
-if options.rename:
-newgroupname = args[1]
-
-# Rename the entry
-newrdn = 'cn=' + newgroupname
-ds.rename_s(dn, newrdn)
-else:
-PosixData = PosixData[0][1]
-NewPosixData = copy.deepcopy(PosixData)
-if options.gidNumber:
-try:
-groupcheck = grp.getgrgid(options.gidNumber)
-raise ldap.TYPE_OR_VALUE_EXISTS()
-except KeyError:
-NewPosixData['gidNumber'] = options.gidNumber
-if options.addMembers:
-raw_members = options.addMembers.split(',')
-for raw_member in raw_members:
-try:
-user=ds.search_s("ou=people," + base, 
ldap.SCOPE_SUBTREE, "uid=%s" % raw_member, ("dn",))
-if len(user) == 0:
-sys.stderr.write(raw_member + " doesn't exist, and 
won't be added to the group.\n")
-return
-if len(user) > 1:
-sys.stderr.write(raw_member + " exist multiple 
times, this is so wrong, abandon all hope\n")
-

[MediaWiki-commits] [Gerrit] operations/puppet[production]: WIP replacement of modify-ldap-groups

2016-07-25 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: WIP replacement of modify-ldap-groups
..

WIP replacement of modify-ldap-groups

Change-Id: Ibc9e5bf28826804e90b9ae143bcdd4cf0020b11d
---
M modules/ldap/files/scripts/modify-ldap-group
1 file changed, 91 insertions(+), 132 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/58/301058/1

diff --git a/modules/ldap/files/scripts/modify-ldap-group 
b/modules/ldap/files/scripts/modify-ldap-group
index 6c7978d..9dd3c22 100755
--- a/modules/ldap/files/scripts/modify-ldap-group
+++ b/modules/ldap/files/scripts/modify-ldap-group
@@ -1,143 +1,102 @@
-#!/usr/bin/python
-
-#
-### THIS FILE IS MANAGED BY PUPPET
-### puppet:///modules/ldap/scripts/modify-ldap-group
-#
-
-import sys
-import grp
-import traceback
-import ldapsupportlib
-import copy
-from optparse import OptionParser
-
-try:
-import ldap
-import ldap.modlist
-except ImportError:
-sys.stderr.write("Unable to import LDAP library.\n")
-sys.exit(1)
+#!/usr/bin/python3
+"""
+Add / Remove users from LDAP group
+"""
+import ldap3
+import yaml
+import argparse
 
 
-def main():
-parser = OptionParser(conflict_handler="resolve")
-parser.set_usage('modify-ldap-group [options]  [--rename 
]\nexample: modify-ldap-group --gid=501 wikidev')
+def get_members_list(conn, basedn, group, user):
+"""
+Get list of members of the given group
+"""
+conn.search(
+'ou=groups,{base}'.format(base=basedn),
+'(cn={group})'.format(group=group),
+ldap3.SEARCH_SCOPE_WHOLE_SUBTREE,
+attributes=['member']
+)
+return conn.response[0]['attributes']['member']
 
-ldapSupportLib = ldapsupportlib.LDAPSupportLib()
-ldapSupportLib.addParserOptions(parser, "scriptuser")
 
-parser.add_option("-m", "--directorymanager", action="store_true", 
dest="directorymanager", help="Use the Directory Manager's credentials, rather 
than your own")
-parser.add_option("--gid", action="store", dest="gidNumber", help="Set the 
group's gid")
-parser.add_option("--rename", action="store_true", dest="rename", 
help="Rename the user")
-parser.add_option("--addmembers", action="store", dest="addMembers", 
help="Add a comma separated list of users to this group")
-parser.add_option("--deletemembers", action="store", dest="deleteMembers", 
help="Delete a comma separated list of users from this")
-(options, args) = parser.parse_args()
+def add_member(conn, basedn, group, user):
+"""
+Adds user to group as a mmeber
+"""
+userdn = 'uid={user},ou=people,{base}'.format(
+user=user,
+base=basedn,
+)
+groupdn = 'cn={group},ou=groups,{base}'.format(
+group=group,
+base=basedn,
+)
+members = get_members_list(conn, basedn, group, user)
+if userdn in members:
+raise Exception("User already is member of given group")
+members.append(userdn)
+op = {
+'member': [(ldap3.MODIFY_REPLACE, [members])]
+}
+return conn.modify(groupdn, op).result
 
-if len(args) != 1:
-if options.rename and len(args) != 2:
-parser.error("modify-ldap-group expects exactly two arguments when 
using rename.")
-elif not options.rename:
-parser.error("modify-ldap-group expects exactly one argument, 
unless using --rename.")
 
-ldapSupportLib.setBindInfoByOptions(options, parser)
+def remove_member(conn, basedn, group, user):
+"""
+Remove user from group as a member
+"""
+userdn = 'uid={user},ou=people,{base}'.format(
+user=user,
+base=basedn,
+)
+groupdn = 'cn={group},ou=groups,{base}'.format(
+group=group,
+base=basedn,
+)
+members = get_members_list(conn, basedn, group, user)
+if userdn not in members:
+raise Exception("User already is not a member of given group")
+members.remove(userdn)
+op = {
+'member': [(ldap3.MODIFY_REPLACE, [members])]
+}
+return conn.modify(groupdn, op).result
 
-base = ldapSupportLib.getBase()
 
-ds = ldapSupportLib.connect()
+if __name__ == '__main__':
+parser = argparse.ArgumentParser()
+parser.add_argument(
+'action',
+help='Action to perform',
+choices=['adduser', 'removeuser'],
+)
+parser.add_argument(
+'group',
+help='Name of group to modify',
+)
+parser.add_argument(
+'user',
+help='Name of user to add/remove'
+)
+parser.add_argument(
+'--ldapconfig',
+help='Path to LDAP connection config in YAML format',
+default='/etc/ldap.scriptuser.yaml',
+)
 
-# w00t We're in!
-try:
-groupname = args[0]
-   

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: flake8 v3 is not stable

2016-07-25 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

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

Change subject: flake8 v3 is not stable
..

flake8 v3 is not stable

Change-Id: I5e47fd359d06142242ac25ee018c7edc1dd9a703
---
M tox.ini
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/57/301057/1

diff --git a/tox.ini b/tox.ini
index 541b1cb..8916507 100644
--- a/tox.ini
+++ b/tox.ini
@@ -50,7 +50,7 @@
 flake8 --version
 flake8 --doctests {posargs}
 basepython = python2.7
-deps = flake8
+deps = flake8<3
pyflakes >= 1.1
hacking
flake8-docstrings>=0.2.6

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e47fd359d06142242ac25ee018c7edc1dd9a703
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg 

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Reduce mayhem caused by ?oldid=currentRevId

2016-07-25 Thread Catrope (Code Review)
Catrope has uploaded a new change for review.

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

Change subject: Reduce mayhem caused by ?oldid=currentRevId
..

Reduce mayhem caused by ?oldid=currentRevId

If you viewed a page with an ?oldid= query parameter set to the ID
of the current revision, some parts of VE would believe we were
in oldid mode (because there's an oldid present), but others
wouldn't (because the revid we're editing equals the newest revid).
This caused bugs when opening the editor a second time after saving
(which is normally impossible to do after an oldid-mode edit, because
we navigate to a new page after an oldid save, but we don't do that
in this case).

Ensure that:
* The internal state of DesktopArticleTarget is updated correctly
  after saving in this case
* The ?oldid= parameter is removed from the URL after saving
* DesktopArticleTarget.init doesn't preload the article HTML
  on a second/subsequent editor load: this causes issues because
  it caches the oldid, and generally speaking the Target's internal
  state is not considered

Bug: T141330
Change-Id: I74034328797c59f7249f1f6f4f53a92ee1c26334
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
2 files changed, 31 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/56/301056/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 64c6d4e..06cbf5f 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
@@ -25,6 +25,7 @@
tabPreference, userPrefEnabled, userPrefPreferShow, 
initialWikitext, oldid,
onlyTabIsVE,
active = false,
+   targetLoaded = false,
progressStep = 0,
progressSteps = [
[ 30, 3000 ],
@@ -154,6 +155,7 @@
}
} );
target.setContainer( $( '#content' ) );
+   targetLoaded = true;
return target;
}, function ( e ) {
mw.log.warn( 'VisualEditor failed to 
load: ' + e );
@@ -205,19 +207,25 @@
 * @param {boolean} [modified] The page was been modified before 
loading (e.g. in source mode)
 */
function activateTarget( targetPromise, modified ) {
-   // The TargetLoader module is loaded in the bottom queue, so it 
should have been
-   // requested already but it might not have finished loading yet
-   var dataPromise = mw.loader.using( 
'ext.visualEditor.targetLoader' )
-   .then( function () {
-   return mw.libs.ve.targetLoader.requestPageData(
-   mw.config.get( 'wgRelevantPageName' ),
-   oldid,
-   'mwTarget', // 
ve.init.mw.DesktopArticleTarget.static.name
-   modified
-   );
-   } )
-   .done( incrementLoadingProgress )
-   .fail( handleLoadFailure );
+   var dataPromise;
+   // Only call requestPageData early if the target object isn't 
there yet.
+   // If the target object is there, this is a second or 
subsequent load, and the
+   // internal state of the target object can influence the load 
request.
+   if ( !targetLoaded ) {
+   // The TargetLoader module is loaded in the bottom 
queue, so it should have been
+   // requested already but it might not have finished 
loading yet
+   dataPromise = mw.loader.using( 
'ext.visualEditor.targetLoader' )
+   .then( function () {
+   return 
mw.libs.ve.targetLoader.requestPageData(
+   mw.config.get( 
'wgRelevantPageName' ),
+   oldid,
+   'mwTarget', // 
ve.init.mw.DesktopArticleTarget.static.name
+   modified
+   );
+   } )
+   .done( incrementLoadingProgress )
+   .fail( handleLoadFailure );
+   }
 
setEditorPreference( 'visualeditor' );
 
diff 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Override MediaHandlers in tests using MediaWikiServices

2016-07-25 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Override MediaHandlers in tests using MediaWikiServices
..

Override MediaHandlers in tests using MediaWikiServices

Change-Id: Ie39fd9243e7817191b87179f792d932f7b96de0c
---
M includes/media/MediaHandlerFactory.php
M tests/TestsAutoLoader.php
M tests/phpunit/includes/GlobalFunctions/wfThumbIsStandardTest.php
M tests/phpunit/includes/parser/NewParserTest.php
A tests/phpunit/mocks/media/MockMediaHandlerFactory.php
5 files changed, 86 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/55/301055/1

diff --git a/includes/media/MediaHandlerFactory.php 
b/includes/media/MediaHandlerFactory.php
index 4c2b4a7..4c0fed3 100644
--- a/includes/media/MediaHandlerFactory.php
+++ b/includes/media/MediaHandlerFactory.php
@@ -45,25 +45,37 @@
$this->registry = $registry;
}
 
+   protected function getHandlerClass( $type) {
+   if ( isset( $this->registry[$type] ) ) {
+   return $this->registry[$type];
+   } else {
+   return false;
+   }
+   }
+
/**
 * @param string $type mimetype
 * @return bool|MediaHandler
 */
public function getHandler( $type ) {
-   if ( !isset( $this->registry[$type] ) ) {
-   wfDebug( __METHOD__ . ": no handler found for $type.\n" 
);
-
-   return false;
+   if ( isset( $this->handlers[$type] ) ) {
+   return $this->handlers[$type];
}
-   $class = $this->registry[$type];
-   if ( !isset( $this->handlers[$class] ) ) {
-   $this->handlers[$class] = new $class;
-   if ( !$this->handlers[$class]->isEnabled() ) {
+
+   $class = $this->getHandlerClass( $type );
+   if ( $class !== false ) {
+   /** @var MediaHandler $handler */
+   $handler = new $class;
+   if ( !$handler->isEnabled() ) {
wfDebug( __METHOD__ . ": $class is not 
enabled\n" );
-   $this->handlers[$class] = false;
+   $handler = false;
}
+   } else {
+   wfDebug( __METHOD__ . ": no handler found for $type.\n" 
);
+   $handler = false;
}
 
-   return $this->handlers[$class];
+   $this->handlers[$type] = $handler;
+   return $handler;
}
 }
diff --git a/tests/TestsAutoLoader.php b/tests/TestsAutoLoader.php
index 2bb1d2e..ef540a8 100644
--- a/tests/TestsAutoLoader.php
+++ b/tests/TestsAutoLoader.php
@@ -134,6 +134,7 @@
'MockSvgHandler' => "$testDir/phpunit/mocks/media/MockSvgHandler.php",
'MockDjVuHandler' => "$testDir/phpunit/mocks/media/MockDjVuHandler.php",
'MockOggHandler' => "$testDir/phpunit/mocks/media/MockOggHandler.php",
+   'MockMediaHandlerFactory' => 
"$testDir/phpunit/mocks/media/MockMediaHandlerFactory.php",
'MockWebRequest' => "$testDir/phpunit/mocks/MockWebRequest.php",
'MediaWiki\\Session\\DummySessionBackend'
=> "$testDir/phpunit/mocks/session/DummySessionBackend.php",
diff --git a/tests/phpunit/includes/GlobalFunctions/wfThumbIsStandardTest.php 
b/tests/phpunit/includes/GlobalFunctions/wfThumbIsStandardTest.php
index a61b328..9d9815b 100644
--- a/tests/phpunit/includes/GlobalFunctions/wfThumbIsStandardTest.php
+++ b/tests/phpunit/includes/GlobalFunctions/wfThumbIsStandardTest.php
@@ -18,9 +18,6 @@
[ 300, 225 ],
[ 800, 600 ],
],
-   'wgMediaHandlers' => [
-   'unknown/unknown' => 'MockBitmapHandler',
-   ],
] );
}
 
@@ -95,6 +92,7 @@
 * @dataProvider provideThumbParams
 */
public function testIsStandard( $message, $expected, $params ) {
+   $this->setService( 'MediaHandlerFactory', new 
MockMediaHandlerFactory() );
$this->assertSame(
$expected,
wfThumbIsStandard( new FakeDimensionFile( [ 2000, 1800 
] ), $params ),
diff --git a/tests/phpunit/includes/parser/NewParserTest.php 
b/tests/phpunit/includes/parser/NewParserTest.php
index c56626f..4fd8252 100644
--- a/tests/phpunit/includes/parser/NewParserTest.php
+++ b/tests/phpunit/includes/parser/NewParserTest.php
@@ -1,4 +1,7 @@
  $handler ) {
-   $tmpGlobals['wgMediaHandlers'][$type] = 
'MockBitmapHandler';
-   }
-   // Vector images have to be handled slightly differently

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Introduce MediaHandlerFactory to create MediaHandler objects

2016-07-25 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Introduce MediaHandlerFactory to create MediaHandler objects
..

Introduce MediaHandlerFactory to create MediaHandler objects

This will allow further refactoring of override logic in parser tests.

Change-Id: I34a63ee7089ff26f86f3dd6f3cd1a37928bc4005
---
M autoload.php
M includes/MediaWikiServices.php
M includes/ServiceWiring.php
M includes/media/MediaHandler.php
A includes/media/MediaHandlerFactory.php
M tests/phpunit/MediaWikiTestCase.php
M tests/phpunit/includes/MediaWikiServicesTest.php
7 files changed, 89 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/54/301054/1

diff --git a/autoload.php b/autoload.php
index 8c16adf..f9b0f64 100644
--- a/autoload.php
+++ b/autoload.php
@@ -790,6 +790,7 @@
'MarkpatrolledAction' => __DIR__ . 
'/includes/actions/MarkpatrolledAction.php',
'McTest' => __DIR__ . '/maintenance/mctest.php',
'MediaHandler' => __DIR__ . '/includes/media/MediaHandler.php',
+   'MediaHandlerFactory' => __DIR__ . 
'/includes/media/MediaHandlerFactory.php',
'MediaStatisticsPage' => __DIR__ . 
'/includes/specials/SpecialMediaStatistics.php',
'MediaTransformError' => __DIR__ . 
'/includes/media/MediaTransformOutput.php',
'MediaTransformInvalidParametersException' => __DIR__ . 
'/includes/media/MediaTransformInvalidParametersException.php',
diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php
index ff292cf..ac5fbe0 100644
--- a/includes/MediaWikiServices.php
+++ b/includes/MediaWikiServices.php
@@ -11,6 +11,7 @@
 use LinkCache;
 use Liuggio\StatsdClient\Factory\StatsdDataFactory;
 use LoadBalancer;
+use MediaHandlerFactory;
 use MediaWiki\Linker\LinkRenderer;
 use MediaWiki\Linker\LinkRendererFactory;
 use MediaWiki\Services\SalvageableService;
@@ -513,6 +514,14 @@
 
/**
 * @since 1.28
+* @return MediaHandlerFactory
+*/
+   public function getMediaHandlerFactory() {
+   return $this->getService( 'MediaHandlerFactory' );
+   }
+
+   /**
+* @since 1.28
 * @return GenderCache
 */
public function getGenderCache() {
diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php
index d4f16ee1..21c6377 100644
--- a/includes/ServiceWiring.php
+++ b/includes/ServiceWiring.php
@@ -158,6 +158,12 @@
return new WatchedItemQueryService( 
$services->getDBLoadBalancer() );
},
 
+   'MediaHandlerFactory' => function( MediaWikiServices $services ) {
+   return new MediaHandlerFactory(
+   $services->getMainConfig()->get( 'MediaHandlers' )
+   );
+   },
+
'LinkCache' => function( MediaWikiServices $services ) {
return new LinkCache(
$services->getTitleFormatter()
diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php
index 0ebfab7..b0b4bb7 100644
--- a/includes/media/MediaHandler.php
+++ b/includes/media/MediaHandler.php
@@ -20,6 +20,7 @@
  * @file
  * @ingroup Media
  */
+use MediaWiki\MediaWikiServices;
 
 /**
  * Base media handler class
@@ -46,29 +47,8 @@
 * @return MediaHandler|bool
 */
static function getHandler( $type ) {
-   global $wgMediaHandlers;
-   if ( !isset( $wgMediaHandlers[$type] ) ) {
-   wfDebug( __METHOD__ . ": no handler found for $type.\n" 
);
-
-   return false;
-   }
-   $class = $wgMediaHandlers[$type];
-   if ( !isset( self::$handlers[$class] ) ) {
-   self::$handlers[$class] = new $class;
-   if ( !self::$handlers[$class]->isEnabled() ) {
-   wfDebug( __METHOD__ . ": $class is not 
enabled\n" );
-   self::$handlers[$class] = false;
-   }
-   }
-
-   return self::$handlers[$class];
-   }
-
-   /**
-* Resets all static caches
-*/
-   public static function resetCache() {
-   self::$handlers = [];
+   return MediaWikiServices::getInstance()
+   ->getMediaHandlerFactory()->getHandler( $type );
}
 
/**
diff --git a/includes/media/MediaHandlerFactory.php 
b/includes/media/MediaHandlerFactory.php
new file mode 100644
index 000..4c2b4a7
--- /dev/null
+++ b/includes/media/MediaHandlerFactory.php
@@ -0,0 +1,69 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Media
+ */
+
+/**
+ * Class to construct MediaHandler objects
+ *
+ * @since 1.28
+ */
+class MediaHandlerFactory {
+
+   /**
+* @var array
+*/
+   private $registry;
+
+   /**
+* @var MediaHandler[]
+ 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: ldap: Fixup for ldapvi.conf

2016-07-25 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: ldap: Fixup for ldapvi.conf
..


ldap: Fixup for ldapvi.conf

- Add newline at end
- Add basedn as well

Change-Id: Ia90482e6bb3788ef5fe75b37572580e4d5ae2879
---
M modules/ldap/templates/ldapvi.conf.erb
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/modules/ldap/templates/ldapvi.conf.erb 
b/modules/ldap/templates/ldapvi.conf.erb
index aa63890..0c6e9ca 100644
--- a/modules/ldap/templates/ldapvi.conf.erb
+++ b/modules/ldap/templates/ldapvi.conf.erb
@@ -2,4 +2,5 @@
 unpaged-help: yes
 host: <%= @server %>
 user: <%= @user %>
-password: <%= @password %>
\ No newline at end of file
+base: <%= @basedn %>
+password: <%= @password %>

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia90482e6bb3788ef5fe75b37572580e4d5ae2879
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda 
Gerrit-Reviewer: Yuvipanda 
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]: ldap: Remove conflicting ldapvi package

2016-07-25 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: ldap: Remove conflicting ldapvi package
..


ldap: Remove conflicting ldapvi package

Change-Id: I8a551282040366c144b4f1fc2ae17e502998038a
---
M modules/ldap/manifests/client/utils.pp
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/modules/ldap/manifests/client/utils.pp 
b/modules/ldap/manifests/client/utils.pp
index e0fe0d1..54da89d 100644
--- a/modules/ldap/manifests/client/utils.pp
+++ b/modules/ldap/manifests/client/utils.pp
@@ -7,7 +7,6 @@
 package { [
 'python-ldap',
 'python-pycurl',
-'ldapvi',
 ]:
 ensure => latest,
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8a551282040366c144b4f1fc2ae17e502998038a
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda 
Gerrit-Reviewer: Yuvipanda 
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]: ldap: Remove conflicting ldapvi package

2016-07-25 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: ldap: Remove conflicting ldapvi package
..

ldap: Remove conflicting ldapvi package

Change-Id: I8a551282040366c144b4f1fc2ae17e502998038a
---
M modules/ldap/manifests/client/utils.pp
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/49/301049/1

diff --git a/modules/ldap/manifests/client/utils.pp 
b/modules/ldap/manifests/client/utils.pp
index 8ef3e1c..c05e42e 100644
--- a/modules/ldap/manifests/client/utils.pp
+++ b/modules/ldap/manifests/client/utils.pp
@@ -7,7 +7,6 @@
 package { [
 'python-ldap',
 'python-pycurl',
-'ldapvi',
 ]:
 ensure => latest,
 }

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ldap: Setup ldapvi + make a new role!

2016-07-25 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: ldap: Setup ldapvi + make a new role!
..


ldap: Setup ldapvi + make a new role!

- Make a new role for setting up ldapvi, eventaully
  all things wrt to management of users on ldap will move here
- Setup ldapvi properly on terbium

Change-Id: I47464663406f3fc78b294177e48fabb443ddf563
---
M manifests/site.pp
A modules/ldap/manifests/management.pp
A modules/ldap/templates/ldapvi.conf.erb
A modules/role/manifests/openldap/management.pp
4 files changed, 40 insertions(+), 1 deletion(-)

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



diff --git a/manifests/site.pp b/manifests/site.pp
index f6a1b9a..8187445 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2831,7 +2831,7 @@
 
 # https://wikitech.wikimedia.org/wiki/Terbium
 node 'terbium.eqiad.wmnet' {
-role mariadb::maintenance, mediawiki::maintenance
+role mariadb::maintenance, mediawiki::maintenance, openldap::management
 
 include ldap::role::client::labs
 include base::firewall
diff --git a/modules/ldap/manifests/management.pp 
b/modules/ldap/manifests/management.pp
new file mode 100644
index 000..a83d770
--- /dev/null
+++ b/modules/ldap/manifests/management.pp
@@ -0,0 +1,18 @@
+# Bunch of utilities for managing LDAP users
+class ldap::management(
+$server,
+$basedn,
+$user,
+$password,
+) {
+require_package([
+'ldapvi',
+])
+  
+file { '/etc/ldapvi.conf':
+content => template('ldap/ldapvi.conf.erb'),
+mode=> '0440',
+owner   => 'root',
+group   => 'ldap-admins',
+}
+}
\ No newline at end of file
diff --git a/modules/ldap/templates/ldapvi.conf.erb 
b/modules/ldap/templates/ldapvi.conf.erb
new file mode 100644
index 000..aa63890
--- /dev/null
+++ b/modules/ldap/templates/ldapvi.conf.erb
@@ -0,0 +1,5 @@
+profile default
+unpaged-help: yes
+host: <%= @server %>
+user: <%= @user %>
+password: <%= @password %>
\ No newline at end of file
diff --git a/modules/role/manifests/openldap/management.pp 
b/modules/role/manifests/openldap/management.pp
new file mode 100644
index 000..a064205
--- /dev/null
+++ b/modules/role/manifests/openldap/management.pp
@@ -0,0 +1,16 @@
+# Tools / scripts for helping manage the users in LDAP installation
+# Note: This is for the so-called 'labs LDAP', which is used to manage
+# both users on labs as well as access control for many things in prod
+class role::openldap::management {
+
+require ::ldap::role::config::labs
+
+$ldapconfig = $ldap::role::config::labs::ldapconfig
+
+class { '::ldap::management':
+server   => $ldapconfig['servernames'][0],
+basedn   => $ldapconfig['basedn'],
+user => $ldapconfig['script_user_dn'],
+password => $ldapconfig['script_user_pass'],
+}
+}
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I47464663406f3fc78b294177e48fabb443ddf563
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda 
Gerrit-Reviewer: Yuvipanda 
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]: ldap: Replace change-ldap-password with reset-ldap-password

2016-07-25 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: ldap: Replace change-ldap-password with reset-ldap-password
..

ldap: Replace change-ldap-password with reset-ldap-password

Change-Id: If32be1f4dbf4e5c235f7e82004a835135f2c6583
---
A modules/ldap/files/reset-ldap-password
D modules/ldap/files/scripts/change-ldap-passwd
M modules/ldap/manifests/client/utils.pp
M modules/ldap/manifests/management.pp
4 files changed, 86 insertions(+), 99 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/48/301048/1

diff --git a/modules/ldap/files/reset-ldap-password 
b/modules/ldap/files/reset-ldap-password
new file mode 100755
index 000..5300263
--- /dev/null
+++ b/modules/ldap/files/reset-ldap-password
@@ -0,0 +1,64 @@
+#!/usr/bin/python3
+"""
+Reset password of a given LDAP user to a random string.
+
+Useful for rescuing svn users apparently.
+"""
+import ldap3
+import yaml
+import random
+import string
+import argparse
+
+
+def change_password(conn, user, basedn, new_pass):
+"""
+Change password of given user to new password
+"""
+op = {
+'userPassword': [(ldap3.MODIFY_REPLACE, [new_pass])]
+}
+user_dn = 'uid={user},ou=people,{base}'.format(
+user=user,
+base=basedn
+)
+return conn.modify(user_dn, op).result
+
+
+def generate_pass(length):
+"""
+Generate a secure password of given length
+"""
+password_chars = string.ascii_letters + string.digits + 
'!@#$%^&*()-=+_[]{};:.<>`~ '
+sysrandom = random.SystemRandom()  # Uses /dev/urandom
+return ''.join([sysrandom.choice(password_chars) for _ in range(length)])
+
+
+if __name__ == '__main__':
+parser = argparse.ArgumentParser()
+parser.add_argument(
+'username',
+help='Name of user to change password for'
+)
+parser.add_argument(
+'--ldapconfig',
+help='Path to LDAP connection config in YAML format',
+default='/etc/ldap.scriptuser.yaml',
+)
+
+args = parser.parse_args()
+
+with open(args.ldapconfig, encoding='utf-8') as f:
+ldapconfig = yaml.safe_load(f)
+
+new_pass = generate_pass(32)
+with ldap3.Connection([
+ldap3.Server(s) for s in ldapconfig['servers']],
+read_only=True,
+user=ldapconfig['user'],
+auto_bind=True,
+password=ldapconfig['password']
+) as conn:
+res = change_password(conn, args.user, ldapconfig['basedn'], new_pass)
+print("Result of LDAP call: ", res)
+print("New password is: ", new_pass)
\ No newline at end of file
diff --git a/modules/ldap/files/scripts/change-ldap-passwd 
b/modules/ldap/files/scripts/change-ldap-passwd
deleted file mode 100755
index 20876f5..000
--- a/modules/ldap/files/scripts/change-ldap-passwd
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/python
-
-#
-### THIS FILE IS MANAGED BY PUPPET
-### puppet:///modules/ldap/scripts/change-ldap-passwd
-#
-
-import sys
-import traceback
-import getpass
-import ldapsupportlib
-import string
-import random
-from optparse import OptionParser
-
-try:
-import ldap
-import ldap.modlist
-except ImportError:
-sys.stderr.write("Unable to import LDAP library.\n")
-sys.exit(1)
-
-
-def main():
-parser = OptionParser(conflict_handler="resolve")
-parser.set_usage('change-ldap-passwd [options] ')
-
-ldapSupportLib = ldapsupportlib.LDAPSupportLib()
-ldapSupportLib.addParserOptions(parser, "scriptuser")
-
-parser.add_option("-m", "--directorymanager", action="store_true", 
dest="directorymanager", help="Use the Directory Manager's credentials, rather 
than your own")
-parser.add_option("--random", action="store_true", dest="random", 
help="Choose a random password, and return it.")
-(options, args) = parser.parse_args()
-
-if len(args) != 1:
-parser.error("add-ldap-user expects exactly one argument.")
-
-ldapSupportLib.setBindInfoByOptions(options, parser)
-
-base = ldapSupportLib.getBase()
-
-ds = ldapSupportLib.connect()
-
-# w00t We're in!
-try:
-username = args[0]
-dn = 'uid=' + username + ',ou=people,' + base
-if options.random:
-chars = string.letters + string.digits + 
'!@#$%^&*()-=+_[]{};:.<>`~ '
-newpass = ''
-for i in range(15):
-newpass = newpass + random.choice(chars)
-else:
-while True:
-newpass = getpass.getpass('New password: ')
-repeat = getpass.getpass('Repeat new password: ')
-if newpass != repeat:
-print "Passwords do no match, please try again"
-else:
-break
-mod_attrs = 

[MediaWiki-commits] [Gerrit] mediawiki...GeoCrumbs[master]: Remove & from GeoCrumbs::completeImplicitIsIn()

2016-07-25 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Remove & from GeoCrumbs::completeImplicitIsIn()
..

Remove & from GeoCrumbs::completeImplicitIsIn()

It's entirely unnecessary.

Change-Id: I0fd303dba16ffbe3c2ce7a577387d3c714e5eeae
---
M GeoCrumbs.class.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GeoCrumbs 
refs/changes/47/301047/1

diff --git a/GeoCrumbs.class.php b/GeoCrumbs.class.php
index 3efbf83..7b11056 100644
--- a/GeoCrumbs.class.php
+++ b/GeoCrumbs.class.php
@@ -54,7 +54,7 @@
 * @param ParserOutput $parserOutput
 * @param Title $title
 */
-   public static function completeImplicitIsIn( &$parserOutput, Title 
$title ) {
+   public static function completeImplicitIsIn( $parserOutput, Title 
$title ) {
// only do implicitly if none is defined through parser hook
$existing = $parserOutput->getExtensionData( 'GeoCrumbIsIn' );
if ( $existing !== null ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0fd303dba16ffbe3c2ce7a577387d3c714e5eeae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GeoCrumbs
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/puppet[production]: ldap: Setup ldapvi + make a new role!

2016-07-25 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: ldap: Setup ldapvi + make a new role!
..

ldap: Setup ldapvi + make a new role!

- Make a new role for setting up ldapvi, eventaully
  all things wrt to management of users on ldap will move here
- Setup ldapvi properly on terbium

Change-Id: I47464663406f3fc78b294177e48fabb443ddf563
---
M manifests/site.pp
A modules/ldap/manifests/management.pp
A modules/ldap/templates/ldapvi.conf.erb
A modules/role/manifests/openldap/management.pp
4 files changed, 40 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/46/301046/1

diff --git a/manifests/site.pp b/manifests/site.pp
index f6a1b9a..8187445 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2831,7 +2831,7 @@
 
 # https://wikitech.wikimedia.org/wiki/Terbium
 node 'terbium.eqiad.wmnet' {
-role mariadb::maintenance, mediawiki::maintenance
+role mariadb::maintenance, mediawiki::maintenance, openldap::management
 
 include ldap::role::client::labs
 include base::firewall
diff --git a/modules/ldap/manifests/management.pp 
b/modules/ldap/manifests/management.pp
new file mode 100644
index 000..a83d770
--- /dev/null
+++ b/modules/ldap/manifests/management.pp
@@ -0,0 +1,18 @@
+# Bunch of utilities for managing LDAP users
+class ldap::management(
+$server,
+$basedn,
+$user,
+$password,
+) {
+require_package([
+'ldapvi',
+])
+  
+file { '/etc/ldapvi.conf':
+content => template('ldap/ldapvi.conf.erb'),
+mode=> '0440',
+owner   => 'root',
+group   => 'ldap-admins',
+}
+}
\ No newline at end of file
diff --git a/modules/ldap/templates/ldapvi.conf.erb 
b/modules/ldap/templates/ldapvi.conf.erb
new file mode 100644
index 000..aa63890
--- /dev/null
+++ b/modules/ldap/templates/ldapvi.conf.erb
@@ -0,0 +1,5 @@
+profile default
+unpaged-help: yes
+host: <%= @server %>
+user: <%= @user %>
+password: <%= @password %>
\ No newline at end of file
diff --git a/modules/role/manifests/openldap/management.pp 
b/modules/role/manifests/openldap/management.pp
new file mode 100644
index 000..a064205
--- /dev/null
+++ b/modules/role/manifests/openldap/management.pp
@@ -0,0 +1,16 @@
+# Tools / scripts for helping manage the users in LDAP installation
+# Note: This is for the so-called 'labs LDAP', which is used to manage
+# both users on labs as well as access control for many things in prod
+class role::openldap::management {
+
+require ::ldap::role::config::labs
+
+$ldapconfig = $ldap::role::config::labs::ldapconfig
+
+class { '::ldap::management':
+server   => $ldapconfig['servernames'][0],
+basedn   => $ldapconfig['basedn'],
+user => $ldapconfig['script_user_dn'],
+password => $ldapconfig['script_user_pass'],
+}
+}
\ No newline at end of file

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: admin: add bcohn to analytics-privatedata, researchers

2016-07-25 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: admin: add bcohn to analytics-privatedata, researchers
..


admin: add bcohn to analytics-privatedata, researchers

Adding Brent Joseph (bcohn) to analytics-privatedata-users,
researchers, bastiononly. Like the other 2 users for this same
request, mpany and jsamra for fundraising analytics.

Details and approval on ticket (and parent ticket)

Bug: T140449
Change-Id: I9a3bd9947666292118281ea4d1bf64db49a5dd1f
---
M modules/admin/data/data.yaml
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index 6068b18..c7c1542 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -82,7 +82,7 @@
   gpaumier, moushira, aklapper, qchris, tjones, srijan, addshore,
   jminor, pt1979, asherman, etonkovidova, sbisson, zhousquared,
   atgomez, jgirault, jdrewniak, matmarex, elukey, jdcc, ppchelko,
-  nschaaf, dstrine, ladsgroup, joewalsh, mpany, hjiang, jsamra]
+  nschaaf, dstrine, ladsgroup, joewalsh, mpany, hjiang, jsamra, 
bcohn]
   cassandra-test-roots:
 gid: 708
 description: users with root on cassandra hosts
@@ -123,7 +123,7 @@
   daisy, tomasz, mholloway-shell, madhuvishy, ebernhardson, 
niedzielski,
   neilpquinn-wmf, tbayer, moushira, dbrant, maxsem, srijan, 
krenair,
   jminor, asherman, etonkovidova, sbisson, addshore, matmarex, 
elukey,
-  nikerabbit, nschaaf, dstrine, joewalsh, mpany, hjiang, jsamra]
+  nikerabbit, nschaaf, dstrine, joewalsh, mpany, hjiang, jsamra, 
bcohn]
   ldap-admins:
 gid: 715
 description: ldap admins
@@ -242,7 +242,7 @@
   andyrussg, niedzielski, maxsem, hoo, daniel, tbayer, krinkle, 
tgr,
   csteipp, smalyshev, ebernhardson, addshore, jminor, chedasaurus, 
neilpquinn-wmf,
   dcausse, bd808, tjones, mobrovac, jgirault, jdrewniak, ejegg, 
jdcc, ori,
-  bmansurov, atgomez, amire80, kartik, pcoombe, foks, mpany, 
hjiang, jsamra]
+  bmansurov, atgomez, amire80, kartik, pcoombe, foks, mpany, 
hjiang, jsamra, bcohn]
   analytics-admins:
 gid: 732
 description: Admin access to analytics cluster.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9a3bd9947666292118281ea4d1bf64db49a5dd1f
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
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]: Get rid of the LDAP+YAML ENC

2016-07-25 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: Get rid of the LDAP+YAML ENC
..


Get rid of the LDAP+YAML ENC

It was a terrible idea

Bug: T114063
Change-Id: I99642edfe438d1d49e151fc3915d5a27a8085b88
---
M manifests/role/puppet.pp
M modules/puppet/manifests/self/config.pp
M modules/puppet/manifests/self/master.pp
D modules/puppetmaster/files/ldap-yaml-enc.py
D nodes/labs/integration.yaml
D nodes/labs/staging.yaml
6 files changed, 9 insertions(+), 180 deletions(-)

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



diff --git a/manifests/role/puppet.pp b/manifests/role/puppet.pp
index 24ae016..6a4be1d 100644
--- a/manifests/role/puppet.pp
+++ b/manifests/role/puppet.pp
@@ -13,7 +13,6 @@
 class role::puppet::self(
 $master = $::puppetmaster,
 $autoupdate_master = true,
-$enc = 'ldap', # 'ldap' or 'yaml+ldap'
 ) {
 if $master != undef {
 if $master =~ /\./ {
@@ -35,18 +34,8 @@
 # If localhost or if $server matches this node's
 # $fqdn, then this is a puppetmaster.
 if ($server == 'localhost' or $server == $::fqdn) {
-if $enc == 'yaml+ldap' {
-$enc_script_path = '/usr/local/bin/ldap-yaml-enc.py'
-file { $enc_script_path:
-source => 'puppet:///modules/puppetmaster/ldap-yaml-enc.py',
-owner  => 'root',
-group  => 'root',
-mode   => '0555',
-}
-}
 class { 'puppet::self::master':
 server  => $server,
-enc_script_path => $enc_script_path,
 }
 # If this parameter / variable variable is set, then
 # run a cron job that automatically tries to update the local
diff --git a/modules/puppet/manifests/self/config.pp 
b/modules/puppet/manifests/self/config.pp
index 40158e3..d29c30c 100644
--- a/modules/puppet/manifests/self/config.pp
+++ b/modules/puppet/manifests/self/config.pp
@@ -17,7 +17,6 @@
 $bindaddress  = undef,
 $puppet_client_subnet = undef,
 $certname = $::fqdn,
-$enc_script_path  = undef,
 $autosign = hiera('puppetmaster::autosigner', false),
 ) {
 include ldap::role::config::labs
@@ -25,21 +24,15 @@
 $ldapconfig = $ldap::role::config::labs::ldapconfig
 $basedn = $ldapconfig['basedn']
 
-if $enc_script_path {
-$config = {
-'node_terminus'  => 'exec',
-'external_nodes' => $enc_script_path,
-}
-} else {
-$config = {
-'node_terminus' => 'ldap',
-'ldapserver'=> $ldapconfig['servernames'][0],
-'ldapbase'  => "ou=hosts,${basedn}",
-'ldapstring'=> 
'(&(objectclass=puppetClient)(associatedDomain=%s))',
-'ldapuser'  => $ldapconfig['proxyagent'],
-'ldappassword'  => $ldapconfig['proxypass'],
-'ldaptls'   => true,
-}
+
+$config = {
+'node_terminus' => 'ldap',
+'ldapserver'=> $ldapconfig['servernames'][0],
+'ldapbase'  => "ou=hosts,${basedn}",
+'ldapstring'=> 
'(&(objectclass=puppetClient)(associatedDomain=%s))',
+'ldapuser'  => $ldapconfig['proxyagent'],
+'ldappassword'  => $ldapconfig['proxypass'],
+'ldaptls'   => true,
 }
 
 $config['dbadapter'] = 'sqlite3'
diff --git a/modules/puppet/manifests/self/master.pp 
b/modules/puppet/manifests/self/master.pp
index dc95a5f..a2e02f3 100644
--- a/modules/puppet/manifests/self/master.pp
+++ b/modules/puppet/manifests/self/master.pp
@@ -14,7 +14,6 @@
 #
 class puppet::self::master(
 $server,
-$enc_script_path = undef,
 ) {
 
 $server_desc = $server ? {
@@ -63,7 +62,6 @@
 bindaddress  => $bindaddress,
 puppet_client_subnet => $puppet_client_subnet,
 certname => $certname,
-enc_script_path  => $enc_script_path,
 require  => File['/etc/ldap/ldap.conf', '/etc/ldap.conf', 
'/etc/nslcd.conf'],
 }
 class { 'puppet::self::gitclone':
diff --git a/modules/puppetmaster/files/ldap-yaml-enc.py 
b/modules/puppetmaster/files/ldap-yaml-enc.py
deleted file mode 100644
index bf07b3a..000
--- a/modules/puppetmaster/files/ldap-yaml-enc.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/python
-import re
-import yaml
-import sys
-import ldapsupportlib
-import ldap
-import os
-
-
-class EmptyRolesRules(object):
-def __init__(self):
-pass
-
-def roles_for(self, fqdn):
-return []
-
-
-class YAMLRolesRules(object):
-"""
-A set of rules that help map a hostname to a set of roles.
-"""
-def __init__(self, rules):
-self.rules = {
-re.compile(key): value
-for key, value in rules.items()
-}
-
-def roles_for(self, fqdn):
-"""
-Return list of roles for given instancename
- 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: admin: add bcohn to analytics-privatedata, researchers

2016-07-25 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review.

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

Change subject: admin: add bcohn to analytics-privatedata, researchers
..

admin: add bcohn to analytics-privatedata, researchers

Change-Id: I9a3bd9947666292118281ea4d1bf64db49a5dd1f
---
M modules/admin/data/data.yaml
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/45/301045/1

diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index 6068b18..c7c1542 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -82,7 +82,7 @@
   gpaumier, moushira, aklapper, qchris, tjones, srijan, addshore,
   jminor, pt1979, asherman, etonkovidova, sbisson, zhousquared,
   atgomez, jgirault, jdrewniak, matmarex, elukey, jdcc, ppchelko,
-  nschaaf, dstrine, ladsgroup, joewalsh, mpany, hjiang, jsamra]
+  nschaaf, dstrine, ladsgroup, joewalsh, mpany, hjiang, jsamra, 
bcohn]
   cassandra-test-roots:
 gid: 708
 description: users with root on cassandra hosts
@@ -123,7 +123,7 @@
   daisy, tomasz, mholloway-shell, madhuvishy, ebernhardson, 
niedzielski,
   neilpquinn-wmf, tbayer, moushira, dbrant, maxsem, srijan, 
krenair,
   jminor, asherman, etonkovidova, sbisson, addshore, matmarex, 
elukey,
-  nikerabbit, nschaaf, dstrine, joewalsh, mpany, hjiang, jsamra]
+  nikerabbit, nschaaf, dstrine, joewalsh, mpany, hjiang, jsamra, 
bcohn]
   ldap-admins:
 gid: 715
 description: ldap admins
@@ -242,7 +242,7 @@
   andyrussg, niedzielski, maxsem, hoo, daniel, tbayer, krinkle, 
tgr,
   csteipp, smalyshev, ebernhardson, addshore, jminor, chedasaurus, 
neilpquinn-wmf,
   dcausse, bd808, tjones, mobrovac, jgirault, jdrewniak, ejegg, 
jdcc, ori,
-  bmansurov, atgomez, amire80, kartik, pcoombe, foks, mpany, 
hjiang, jsamra]
+  bmansurov, atgomez, amire80, kartik, pcoombe, foks, mpany, 
hjiang, jsamra, bcohn]
   analytics-admins:
 gid: 732
 description: Admin access to analytics cluster.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a3bd9947666292118281ea4d1bf64db49a5dd1f
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...CentralAuth[master]: Fix FormatJson capitalization

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix FormatJson capitalization
..


Fix FormatJson capitalization

Change-Id: Iab93c527cacc562ca8bc79cb21f6cddc63045e57
---
M includes/specials/SpecialCentralAutoLogin.php
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/includes/specials/SpecialCentralAutoLogin.php 
b/includes/specials/SpecialCentralAutoLogin.php
index 1e9e86f..e39e6f1 100644
--- a/includes/specials/SpecialCentralAutoLogin.php
+++ b/includes/specials/SpecialCentralAutoLogin.php
@@ -134,13 +134,13 @@
if ( !$user->isAnon() ) {
if ( !CentralAuthHooks::isUIReloadRecommended( 
$user ) ) {
$html = 
$this->getSkin()->getPersonalToolsList();
-   $json = FormatJSON::encode( array( 
'toolslist' => $html ) );
+   $json = FormatJson::encode( array( 
'toolslist' => $html ) );
} else {
$gender = $this->getUser()->getOption( 
'gender' );
if ( strval( $gender ) === '' ) {
$gender = 'unknown';
}
-   $json = FormatJSON::encode( array(
+   $json = FormatJson::encode( array(
'notify' => array(
'username' => 
$user->getName(),
'gender' => $gender

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iab93c527cacc562ca8bc79cb21f6cddc63045e57
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Anomie 
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...CentralAuth[master]: Fix FormatJson capitalization

2016-07-25 Thread Code Review
Gergő Tisza has uploaded a new change for review.

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

Change subject: Fix FormatJson capitalization
..

Fix FormatJson capitalization

Change-Id: Iab93c527cacc562ca8bc79cb21f6cddc63045e57
---
M includes/specials/SpecialCentralAutoLogin.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/44/301044/1

diff --git a/includes/specials/SpecialCentralAutoLogin.php 
b/includes/specials/SpecialCentralAutoLogin.php
index 1e9e86f..e39e6f1 100644
--- a/includes/specials/SpecialCentralAutoLogin.php
+++ b/includes/specials/SpecialCentralAutoLogin.php
@@ -134,13 +134,13 @@
if ( !$user->isAnon() ) {
if ( !CentralAuthHooks::isUIReloadRecommended( 
$user ) ) {
$html = 
$this->getSkin()->getPersonalToolsList();
-   $json = FormatJSON::encode( array( 
'toolslist' => $html ) );
+   $json = FormatJson::encode( array( 
'toolslist' => $html ) );
} else {
$gender = $this->getUser()->getOption( 
'gender' );
if ( strval( $gender ) === '' ) {
$gender = 'unknown';
}
-   $json = FormatJSON::encode( array(
+   $json = FormatJson::encode( array(
'notify' => array(
'username' => 
$user->getName(),
'gender' => $gender

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab93c527cacc562ca8bc79cb21f6cddc63045e57
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 

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


[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: Revert "CRM-18744 - Remember quicksearch field selection"

2016-07-25 Thread Eileen (Code Review)
Eileen has uploaded a new change for review.

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

Change subject: Revert "CRM-18744 - Remember quicksearch field selection"
..

Revert "CRM-18744 - Remember quicksearch field selection"

This reverts commit 62bed82d93fdca70532ebe12c0dd4909f7c7c8df.

This is probably a temporary fix & we might need to do a better fix upstream 
later -
but for now I have re-opened the issue that caused our problem upstream.

Bug: T140293
Change-Id: I95959582adf73c6d1283cb05f6b3d7ff9c857b97
---
M templates/CRM/common/navigation.js.tpl
1 file changed, 4 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm 
refs/changes/43/301043/1

diff --git a/templates/CRM/common/navigation.js.tpl 
b/templates/CRM/common/navigation.js.tpl
index 87a0a23..0a737c1 100644
--- a/templates/CRM/common/navigation.js.tpl
+++ b/templates/CRM/common/navigation.js.tpl
@@ -135,7 +135,6 @@
   $.Menu.closeAll();
 })
 .on('focus', function() {
-  setQuickSearchValue();
   if ($(this).attr('style').indexOf('14em') < 0) {
 $(this).animate({width: '14em'});
   }
@@ -162,29 +161,15 @@
 }
 e.preventDefault();
   });
-  function setQuickSearchValue() {
-var $selection = $('.crm-quickSearchField input:checked'),
-  label = $selection.parent().text(),
-  value = $selection.val();
+  $('.crm-quickSearchField').click(function() {
+var label = $(this).text();
+var value = $('input', this).val();
 // These fields are not supported by advanced search
 if (!value || value === 'first_name' || value === 'last_name') {
   value = 'sort_name';
 }
-$('#sort_name_navigation').attr({name: value, placeholder: label});
-  }
-  $('.crm-quickSearchField').click(function() {
-setQuickSearchValue();
-$('#sort_name_navigation').focus();
+$('#sort_name_navigation').attr({name: value, placeholder: label}).focus();
   });
-  // Set & retrieve default value
-  if (window.localStorage) {
-$('.crm-quickSearchField').click(function() {
-  localStorage.quickSearchField = $('input', this).val();
-});
-if (localStorage.quickSearchField) {
-  $('.crm-quickSearchField input[value=' + localStorage.quickSearchField + 
']').prop('checked', true);
-}
-  }
   // redirect to view page if there is only one contact
   $('#id_search_block').on('submit', function() {
 var $menu = $('#sort_name_navigation').autocomplete('widget');

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I95959582adf73c6d1283cb05f6b3d7ff9c857b97
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Eileen 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move MediaHandler defaults out of global scope

2016-07-25 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Move MediaHandler defaults out of global scope
..

Move MediaHandler defaults out of global scope

The defaults that were in $wgMediaHandlers are now in
MediaHandler::$registry. The main advantage of doing this is we get O(1)
replacement when extensions set a media handler in their extension.json.

Bug: T141305
Change-Id: I05771a673837ab8d6331eedc24eb707be7f3a250
---
M includes/DefaultSettings.php
M includes/media/MediaHandler.php
2 files changed, 50 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/42/301042/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 1e60302..8ccee20 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -941,22 +941,12 @@
 /**
  * Plugins for media file type handling.
  * Each entry in the array maps a MIME type to a class name
+ *
+ * Core handlers are at MediaHandler::$registry
+ *
+ * Extensions should use extension.json instead
  */
-$wgMediaHandlers = [
-   'image/jpeg' => 'JpegHandler',
-   'image/png' => 'PNGHandler',
-   'image/gif' => 'GIFHandler',
-   'image/tiff' => 'TiffHandler',
-   'image/webp' => 'WebPHandler',
-   'image/x-ms-bmp' => 'BmpHandler',
-   'image/x-bmp' => 'BmpHandler',
-   'image/x-xcf' => 'XCFHandler',
-   'image/svg+xml' => 'SvgHandler', // official
-   'image/svg' => 'SvgHandler', // compat
-   'image/vnd.djvu' => 'DjVuHandler', // official
-   'image/x.djvu' => 'DjVuHandler', // compat
-   'image/x-djvu' => 'DjVuHandler', // compat
-];
+$wgMediaHandlers = [];
 
 /**
  * Plugins for page content model handling.
diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php
index 0ebfab7..9c963e0 100644
--- a/includes/media/MediaHandler.php
+++ b/includes/media/MediaHandler.php
@@ -40,28 +40,62 @@
protected static $handlers = [];
 
/**
+* @var array Mapping of mimetype to MediaHandler class
+*/
+   protected static $registry = [
+   'image/jpeg' => 'JpegHandler',
+   'image/png' => 'PNGHandler',
+   'image/gif' => 'GIFHandler',
+   'image/tiff' => 'TiffHandler',
+   'image/webp' => 'WebPHandler',
+   'image/x-ms-bmp' => 'BmpHandler',
+   'image/x-bmp' => 'BmpHandler',
+   'image/x-xcf' => 'XCFHandler',
+   'image/svg+xml' => 'SvgHandler', // official
+   'image/svg' => 'SvgHandler', // compat
+   'image/vnd.djvu' => 'DjVuHandler', // official
+   'image/x.djvu' => 'DjVuHandler', // compat
+   'image/x-djvu' => 'DjVuHandler', // compat
+   ];
+
+   /**
+* @param string $type mimetype
+* @return string|bool false if no class found
+*/
+   private function getHandlerClass( $type ) {
+   global $wgMediaHandlers;
+
+   $classes = $wgMediaHandlers + self::$registry;
+
+   return isset( $classes[$type] ) ? $classes[$type] : false;
+   }
+
+   /**
 * Get a MediaHandler for a given MIME type from the instance cache
 *
 * @param string $type
 * @return MediaHandler|bool
 */
static function getHandler( $type ) {
-   global $wgMediaHandlers;
-   if ( !isset( $wgMediaHandlers[$type] ) ) {
-   wfDebug( __METHOD__ . ": no handler found for $type.\n" 
);
-
-   return false;
+   if ( isset( self::$handlers[$type] ) ) {
+   return self::$handlers[$type];
}
-   $class = $wgMediaHandlers[$type];
-   if ( !isset( self::$handlers[$class] ) ) {
-   self::$handlers[$class] = new $class;
-   if ( !self::$handlers[$class]->isEnabled() ) {
+
+   $class = self::getHandlerClass( $type );
+   if ( $class !== false ) {
+   /** @var MediaHandler $handler */
+   $handler = new $class;
+   if ( !$handler->isEnabled() ) {
wfDebug( __METHOD__ . ": $class is not 
enabled\n" );
-   self::$handlers[$class] = false;
+   $handler = false;
}
+   } else {
+   wfDebug( __METHOD__ . ": no handler found for $type.\n" 
);
+   $handler = false;
}
 
-   return self::$handlers[$class];
+   self::$handlers[$type] = $handler;
+   return $handler;
}
 
/**

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

[MediaWiki-commits] [Gerrit] mediawiki...OAuth[master]: Fix FormatJson capitalization

2016-07-25 Thread Code Review
Gergő Tisza has uploaded a new change for review.

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

Change subject: Fix FormatJson capitalization
..

Fix FormatJson capitalization

Change-Id: If1a19a4c3693520c5657937a52c1168b8c042d6c
---
M backend/MWOAuthConsumer.php
M backend/MWOAuthConsumerAcceptance.php
M control/MWOAuthConsumerAcceptanceSubmitControl.php
M control/MWOAuthConsumerSubmitControl.php
M frontend/specialpages/SpecialMWOAuth.php
M frontend/specialpages/SpecialMWOAuthConsumerRegistration.php
M frontend/specialpages/SpecialMWOAuthManageMyGrants.php
7 files changed, 12 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth 
refs/changes/41/301041/1

diff --git a/backend/MWOAuthConsumer.php b/backend/MWOAuthConsumer.php
index ad017f1..69b3d93 100644
--- a/backend/MWOAuthConsumer.php
+++ b/backend/MWOAuthConsumer.php
@@ -260,7 +260,7 @@
$row['oarc_registration'] = $db->timestamp( 
$row['oarc_registration'] );
$row['oarc_stage_timestamp'] = $db->timestamp( 
$row['oarc_stage_timestamp'] );
$row['oarc_restrictions'] = $row['oarc_restrictions']->toJson();
-   $row['oarc_grants'] = \FormatJSON::encode( $row['oarc_grants'] 
);
+   $row['oarc_grants'] = \FormatJson::encode( $row['oarc_grants'] 
);
$row['oarc_email_authenticated'] =
$db->timestampOrNull( $row['oarc_email_authenticated'] 
);
return $row;
@@ -270,7 +270,7 @@
$row['oarc_registration'] = wfTimestamp( TS_MW, 
$row['oarc_registration'] );
$row['oarc_stage_timestamp'] = wfTimestamp( TS_MW, 
$row['oarc_stage_timestamp'] );
$row['oarc_restrictions'] = \MWRestrictions::newFromJson( 
$row['oarc_restrictions'] );
-   $row['oarc_grants'] = \FormatJSON::decode( $row['oarc_grants'], 
true );
+   $row['oarc_grants'] = \FormatJson::decode( $row['oarc_grants'], 
true );
$row['oarc_email_authenticated'] =
wfTimestampOrNull( TS_MW, 
$row['oarc_email_authenticated'] );
 
diff --git a/backend/MWOAuthConsumerAcceptance.php 
b/backend/MWOAuthConsumerAcceptance.php
index 6e8d27f..1851278 100644
--- a/backend/MWOAuthConsumerAcceptance.php
+++ b/backend/MWOAuthConsumerAcceptance.php
@@ -140,13 +140,13 @@
}
}
 
-   $row['oaac_grants'] = \FormatJSON::encode( $row['oaac_grants'] 
);
+   $row['oaac_grants'] = \FormatJson::encode( $row['oaac_grants'] 
);
$row['oaac_accepted'] = $db->timestamp( $row['oaac_accepted'] );
return $row;
}
 
protected function decodeRow( \DBConnRef $db, $row ) {;
-   $row['oaac_grants'] = \FormatJSON::decode( $row['oaac_grants'], 
true );
+   $row['oaac_grants'] = \FormatJson::decode( $row['oaac_grants'], 
true );
$row['oaac_accepted'] = wfTimestamp( TS_MW, 
$row['oaac_accepted'] );
 
// For backwards compatibility, remap some grants
diff --git a/control/MWOAuthConsumerAcceptanceSubmitControl.php 
b/control/MWOAuthConsumerAcceptanceSubmitControl.php
index 67d2627..584b480 100644
--- a/control/MWOAuthConsumerAcceptanceSubmitControl.php
+++ b/control/MWOAuthConsumerAcceptanceSubmitControl.php
@@ -53,7 +53,7 @@
'update'   => array(
'acceptanceId' => '/^\d+$/',
'grants'  => function( $s ) {
-   $grants = \FormatJSON::decode( $s, true 
);
+   $grants = \FormatJson::decode( $s, true 
);
return is_array( $grants ) && 
MWOAuthUtils::grantsAreValid( $grants );
}
),
@@ -118,7 +118,7 @@
}
$cmr = MWOAuthConsumer::newFromId( $dbw, $cmra->get( 
'consumerId' ) );
 
-   $grants = \FormatJSON::decode( $this->vals['grants'], 
true ); // requested grants
+   $grants = \FormatJson::decode( $this->vals['grants'], 
true ); // requested grants
$grants = array_unique( array_intersect(
array_merge(
\MWGrants::getHiddenGrants(), // 
implied grants
diff --git a/control/MWOAuthConsumerSubmitControl.php 
b/control/MWOAuthConsumerSubmitControl.php
index 59a8439..7b49fc4 100644
--- a/control/MWOAuthConsumerSubmitControl.php
+++ b/control/MWOAuthConsumerSubmitControl.php
@@ -78,7 +78,7 @@
); },
'granttype'=> 
'/^(authonly|authonlyprivate|normal)$/',
'grants'   => function( $s ) {
-   

[MediaWiki-commits] [Gerrit] mediawiki...OAuth[master]: Convert deferred update to using AutoCommitUpdate

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Convert deferred update to using AutoCommitUpdate
..


Convert deferred update to using AutoCommitUpdate

Change-Id: I8f50a584174c9481a6dbae7b55b77df6bb713528
---
M backend/MWOAuthUtils.php
1 file changed, 22 insertions(+), 10 deletions(-)

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



diff --git a/backend/MWOAuthUtils.php b/backend/MWOAuthUtils.php
index 6efa979..e94d043 100644
--- a/backend/MWOAuthUtils.php
+++ b/backend/MWOAuthUtils.php
@@ -117,16 +117,28 @@
return;
}
 
-   $cutoff = $dbw->timestamp( time() - 
$wgMWOAuthRequestExpirationAge );
-   $dbw->onTransactionIdle( function() use ( $dbw, $cutoff ) {
-   $dbw->update( 'oauth_registered_consumer',
-   array( 'oarc_stage' => 
MWOAuthConsumer::STAGE_EXPIRED,
-   'oarc_stage_timestamp' => 
$dbw->timestamp() ),
-   array( 'oarc_stage' => 
MWOAuthConsumer::STAGE_PROPOSED,
-   'oarc_stage_timestamp < ' . 
$dbw->addQuotes( $cutoff ) ),
-   __METHOD__
-   );
-   } );
+   $cutoff = time() - $wgMWOAuthRequestExpirationAge;
+   \DeferredUpdates::addUpdate(
+   new \AutoCommitUpdate(
+   $dbw,
+   __METHOD__,
+   function ( \IDatabase $dbw ) use ( $cutoff ) {
+   $dbw->update(
+   'oauth_registered_consumer',
+   [
+   'oarc_stage' => 
MWOAuthConsumer::STAGE_EXPIRED,
+   'oarc_stage_timestamp' 
=> $dbw->timestamp()
+   ],
+   [
+   'oarc_stage' => 
MWOAuthConsumer::STAGE_PROPOSED,
+   'oarc_stage_timestamp < 
' .
+   
$dbw->addQuotes( $dbw->timestamp( $cutoff ) )
+   ],
+   __METHOD__
+   );
+   }
+   )
+   );
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8f50a584174c9481a6dbae7b55b77df6bb713528
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Krinkle 
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...deploy[master]: Add back content-type pkg + bump src to 1c1a9c7ba

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add back content-type pkg + bump src to 1c1a9c7ba
..


Add back content-type pkg + bump src to 1c1a9c7ba

Change-Id: I13017993c6a2c8542aa8a87757157f12e6645193
---
A node_modules/content-type/HISTORY.md
A node_modules/content-type/LICENSE
A node_modules/content-type/README.md
A node_modules/content-type/index.js
A node_modules/content-type/package.json
M src
6 files changed, 390 insertions(+), 1 deletion(-)

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



diff --git a/node_modules/content-type/HISTORY.md 
b/node_modules/content-type/HISTORY.md
new file mode 100644
index 000..8a623a2
--- /dev/null
+++ b/node_modules/content-type/HISTORY.md
@@ -0,0 +1,9 @@
+1.0.1 / 2015-02-13
+==
+
+  * Improve missing `Content-Type` header error message
+
+1.0.0 / 2015-02-01
+==
+
+  * Initial implementation, derived from `media-typer@0.3.0`
diff --git a/node_modules/content-type/LICENSE 
b/node_modules/content-type/LICENSE
new file mode 100644
index 000..34b1a2d
--- /dev/null
+++ b/node_modules/content-type/LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2015 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/content-type/README.md 
b/node_modules/content-type/README.md
new file mode 100644
index 000..3ed6741
--- /dev/null
+++ b/node_modules/content-type/README.md
@@ -0,0 +1,92 @@
+# content-type
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Create and parse HTTP Content-Type header according to RFC 7231
+
+## Installation
+
+```sh
+$ npm install content-type
+```
+
+## API
+
+```js
+var contentType = require('content-type')
+```
+
+### contentType.parse(string)
+
+```js
+var obj = contentType.parse('image/svg+xml; charset=utf-8')
+```
+
+Parse a content type string. This will return an object with the following
+properties (examples are shown for the string `'image/svg+xml; 
charset=utf-8'`):
+
+ - `type`: The media type (the type and subtype, always lower case).
+   Example: `'image/svg+xml'`
+
+ - `parameters`: An object of the parameters in the media type (name of 
parameter
+   always lower case). Example: `{charset: 'utf-8'}`
+
+Throws a `TypeError` if the string is missing or invalid.
+
+### contentType.parse(req)
+
+```js
+var obj = contentType.parse(req)
+```
+
+Parse the `content-type` header from the given `req`. Short-cut for
+`contentType.parse(req.headers['content-type'])`.
+
+Throws a `TypeError` if the `Content-Type` header is missing or invalid.
+
+### contentType.parse(res)
+
+```js
+var obj = contentType.parse(res)
+```
+
+Parse the `content-type` header set on the given `res`. Short-cut for
+`contentType.parse(res.getHeader('content-type'))`.
+
+Throws a `TypeError` if the `Content-Type` header is missing or invalid.
+
+### contentType.format(obj)
+
+```js
+var str = contentType.format({type: 'image/svg+xml'})
+```
+
+Format an object into a content type string. This will return a string of the
+content type for the given object with the following properties (examples are
+shown that produce the string `'image/svg+xml; charset=utf-8'`):
+
+ - `type`: The media type (will be lower-cased). Example: `'image/svg+xml'`
+
+ - `parameters`: An object of the parameters in the media type (name of the
+   parameter will be lower-cased). Example: `{charset: 'utf-8'}`
+
+Throws a `TypeError` if the object contains an invalid type or parameter names.
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/content-type.svg
+[npm-url]: https://npmjs.org/package/content-type
+[node-version-image]: 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Convert onTransactionIdle() callers to DeferredUpdate subcla...

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Convert onTransactionIdle() callers to DeferredUpdate subclasses
..


Convert onTransactionIdle() callers to DeferredUpdate subclasses

* This puts the complex logic here after the commit step for
  all DBs, making the main multi-DB transaction more likely
  to be atomic. Previously, the idle callbacks could be hit
  bewteen DB commits.
* Enforce transactionality via AtomicSectionUpdate.
* Use $this instead of $that hacks for old PHP versions.

Change-Id: Idf7d54fdac6487f86907099680f5c1c4f5530b4e
---
M includes/MovePage.php
M includes/filerepo/file/LocalFile.php
M includes/page/WikiPage.php
M includes/revisiondelete/RevDelList.php
4 files changed, 156 insertions(+), 141 deletions(-)

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



diff --git a/includes/MovePage.php b/includes/MovePage.php
index 708dea1..70b6738 100644
--- a/includes/MovePage.php
+++ b/includes/MovePage.php
@@ -392,11 +392,16 @@
$reason,
$nullRevision
];
-   $dbw->onTransactionIdle( function () use ( $params, $dbw ) {
-   // Keep each single hook handler atomic
-   $dbw->setFlag( DBO_TRX ); // flag is automatically 
reset by DB layer
-   Hooks::run( 'TitleMoveComplete', $params );
-   } );
+   // Keep each single hook handler atomic
+   DeferredUpdates::addUpdate(
+   new AtomicSectionUpdate(
+   $dbw,
+   __METHOD__,
+   function () use ( $params ) {
+   Hooks::run( 'TitleMoveComplete', 
$params );
+   }
+   )
+   );
 
return Status::newGood();
}
diff --git a/includes/filerepo/file/LocalFile.php 
b/includes/filerepo/file/LocalFile.php
index f91026f..c4d421c 100644
--- a/includes/filerepo/file/LocalFile.php
+++ b/includes/filerepo/file/LocalFile.php
@@ -1422,97 +1422,103 @@
# Do some cache purges after final commit so that:
# a) Changes are more likely to be seen post-purge
# b) They won't cause rollback of the log publish/update above
-   $that = $this;
-   $dbw->onTransactionIdle( function () use (
-   $that, $reupload, $wikiPage, $newPageContent, $comment, 
$user, $logEntry, $logId, $descId, $tags
-   ) {
-   # Update memcache after the commit
-   $that->invalidateCache();
+   DeferredUpdates::addUpdate(
+   new AutoCommitUpdate(
+   $dbw,
+   __METHOD__,
+   function () use (
+   $reupload, $wikiPage, $newPageContent, 
$comment, $user,
+   $logEntry, $logId, $descId, $tags
+   ) {
+   # Update memcache after the commit
+   $this->invalidateCache();
 
-   $updateLogPage = false;
-   if ( $newPageContent ) {
-   # New file page; create the description page.
-   # There's already a log entry, so don't make a 
second RC entry
-   # CDN and file cache for the description page 
are purged by doEditContent.
-   $status = $wikiPage->doEditContent(
-   $newPageContent,
-   $comment,
-   EDIT_NEW | EDIT_SUPPRESS_RC,
-   false,
-   $user
-   );
+   $updateLogPage = false;
+   if ( $newPageContent ) {
+   # New file page; create the 
description page.
+   # There's already a log entry, 
so don't make a second RC entry
+   # CDN and file cache for the 
description page are purged by doEditContent.
+   $status = 
$wikiPage->doEditContent(
+   $newPageContent,
+   $comment,
+   EDIT_NEW | 
EDIT_SUPPRESS_RC,
+   false,
+  

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: confirmedit: require MediaWiki::Extension before custom config

2016-07-25 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

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

Change subject: confirmedit: require MediaWiki::Extension before custom config
..

confirmedit: require MediaWiki::Extension before custom config

Bug: T141301
Change-Id: I556acd4be8c8c6aa09e18410e29b5fb991b002f1
---
M puppet/modules/role/manifests/confirmedit.pp
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/38/301038/1

diff --git a/puppet/modules/role/manifests/confirmedit.pp 
b/puppet/modules/role/manifests/confirmedit.pp
index 91b0984..97339da 100644
--- a/puppet/modules/role/manifests/confirmedit.pp
+++ b/puppet/modules/role/manifests/confirmedit.pp
@@ -28,6 +28,7 @@
 wgCaptchaSecret  => $key,
 },
 priority => 11,
+require  => MediaWiki::Extension['ConfirmEdit'],
 }
 
 file { [ "${::mediawiki::dir}/images/temp", $output ]:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I556acd4be8c8c6aa09e18410e29b5fb991b002f1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: MediaHandler: Fix @return for getHandler()

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: MediaHandler: Fix @return for getHandler()
..


MediaHandler: Fix @return for getHandler()

Change-Id: I9373501e0055d0cddcb6c5bf72f5496ed22133c3
---
M includes/media/MediaHandler.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php
index 6b0f887..0ebfab7 100644
--- a/includes/media/MediaHandler.php
+++ b/includes/media/MediaHandler.php
@@ -43,7 +43,7 @@
 * Get a MediaHandler for a given MIME type from the instance cache
 *
 * @param string $type
-* @return MediaHandler
+* @return MediaHandler|bool
 */
static function getHandler( $type ) {
global $wgMediaHandlers;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9373501e0055d0cddcb6c5bf72f5496ed22133c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Jforrester 
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...deploy[master]: Update ORES to the head

2016-07-25 Thread Ladsgroup (Code Review)
Ladsgroup has submitted this change and it was merged.

Change subject: Update ORES to the head
..


Update ORES to the head

Change-Id: Id8cd14b09447a94f97676d7aa11fda10e7fe3afe
---
M submodules/ores
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/submodules/ores b/submodules/ores
index cfb674d..4a5798e 16
--- a/submodules/ores
+++ b/submodules/ores
@@ -1 +1 @@
-Subproject commit cfb674d7cb75e0af5b5b70b511aa833f7d56b3df
+Subproject commit 4a5798ecb3bf0ec019343fede36538df5c6ee556

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id8cd14b09447a94f97676d7aa11fda10e7fe3afe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/ores/deploy
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup 
Gerrit-Reviewer: Ladsgroup 

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


[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Add footer

2016-07-25 Thread Ladsgroup (Code Review)
Ladsgroup has submitted this change and it was merged.

Change subject: Add footer
..


Add footer

Change-Id: I51ffed453e419b8877a5a2fce5ea6b760e6fffb8
---
M config/00-main.yaml
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/config/00-main.yaml b/config/00-main.yaml
index 2c3cd45..e43f038 100644
--- a/config/00-main.yaml
+++ b/config/00-main.yaml
@@ -6,7 +6,10 @@
 url_prefix: ""
   data_paths:
 nltk: /srv/ores/config/submodules/wheels/nltk/
-
+  home:
+footer: >
+  Hosted by the Wikimedia 
Foundation
+   written in https://python.org;>Python 3
 # Score cache options
 score_caches:
   ores_redis:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I51ffed453e419b8877a5a2fce5ea6b760e6fffb8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/ores/deploy
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup 
Gerrit-Reviewer: Ladsgroup 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Enable Cassandra instance restbase2008-c.codfw.wmnet

2016-07-25 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: Enable Cassandra instance restbase2008-c.codfw.wmnet
..


Enable Cassandra instance restbase2008-c.codfw.wmnet

Bug: T134016
Change-Id: I392a8b7b3eed73d213ec3b2e959cc51f5cc3de90
---
M hieradata/hosts/restbase2008.yaml
1 file changed, 5 insertions(+), 5 deletions(-)

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



diff --git a/hieradata/hosts/restbase2008.yaml 
b/hieradata/hosts/restbase2008.yaml
index b3ecfb2..a2f3279 100644
--- a/hieradata/hosts/restbase2008.yaml
+++ b/hieradata/hosts/restbase2008.yaml
@@ -10,8 +10,8 @@
 listen_address: 10.192.32.144
 rpc_address: 10.192.32.144
 rpc_interface: eth0
-#  c:
-#jmx_port: 7191
-#listen_address: 10.192.32.145
-#rpc_address: 10.192.32.145
-#rpc_interface: eth0
+  c:
+jmx_port: 7191
+listen_address: 10.192.32.145
+rpc_address: 10.192.32.145
+rpc_interface: eth0

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I392a8b7b3eed73d213ec3b2e959cc51f5cc3de90
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Eevans 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Ottomata 
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...deploy[master]: Add footer

2016-07-25 Thread Ladsgroup (Code Review)
Ladsgroup has uploaded a new change for review.

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

Change subject: Add footer
..

Add footer

Change-Id: I51ffed453e419b8877a5a2fce5ea6b760e6fffb8
---
M config/00-main.yaml
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/ores/deploy 
refs/changes/37/301037/1

diff --git a/config/00-main.yaml b/config/00-main.yaml
index 2c3cd45..e43f038 100644
--- a/config/00-main.yaml
+++ b/config/00-main.yaml
@@ -6,7 +6,10 @@
 url_prefix: ""
   data_paths:
 nltk: /srv/ores/config/submodules/wheels/nltk/
-
+  home:
+footer: >
+  Hosted by the Wikimedia 
Foundation
+   written in https://python.org;>Python 3
 # Score cache options
 score_caches:
   ores_redis:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I51ffed453e419b8877a5a2fce5ea6b760e6fffb8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/ores/deploy
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup 

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


[MediaWiki-commits] [Gerrit] integration/zuul[master]: Testing

2016-07-25 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Testing
..

Testing

Change-Id: I2203c9cf5d5bc7f5fce9758117a1417c35ac840e
---
M tests/fixtures/layout-cloner.yaml
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/zuul 
refs/changes/33/301033/2

diff --git a/tests/fixtures/layout-cloner.yaml 
b/tests/fixtures/layout-cloner.yaml
index e840ed9..b02aedb 100644
--- a/tests/fixtures/layout-cloner.yaml
+++ b/tests/fixtures/layout-cloner.yaml
@@ -3,6 +3,10 @@
 manager: DependentPipelineManager
 failure-message: Build failed.  For information on how to proceed, see 
http://wiki.example.org/Test_Failures
 trigger:
+   } elseif ( $action['type'] == 'unknown-signed-addition' 
) {
+   self::generateMultipleSectionMentionFailure( 
$action['content'], $revision, $user );
+   }
+   }
   gerrit:
 - event: comment-added
   approval:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2203c9cf5d5bc7f5fce9758117a1417c35ac840e
Gerrit-PatchSet: 2
Gerrit-Project: integration/zuul
Gerrit-Branch: master
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Dzahn 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Get rid of the LDAP+YAML ENC

2016-07-25 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: Get rid of the LDAP+YAML ENC
..

Get rid of the LDAP+YAML ENC

It was a terrible idea

Change-Id: I99642edfe438d1d49e151fc3915d5a27a8085b88
---
M manifests/role/puppet.pp
D modules/puppetmaster/files/ldap-yaml-enc.py
D nodes/labs/integration.yaml
D nodes/labs/staging.yaml
4 files changed, 0 insertions(+), 161 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/36/301036/1

diff --git a/manifests/role/puppet.pp b/manifests/role/puppet.pp
index 24ae016..8e67a54 100644
--- a/manifests/role/puppet.pp
+++ b/manifests/role/puppet.pp
@@ -13,7 +13,6 @@
 class role::puppet::self(
 $master = $::puppetmaster,
 $autoupdate_master = true,
-$enc = 'ldap', # 'ldap' or 'yaml+ldap'
 ) {
 if $master != undef {
 if $master =~ /\./ {
@@ -35,15 +34,6 @@
 # If localhost or if $server matches this node's
 # $fqdn, then this is a puppetmaster.
 if ($server == 'localhost' or $server == $::fqdn) {
-if $enc == 'yaml+ldap' {
-$enc_script_path = '/usr/local/bin/ldap-yaml-enc.py'
-file { $enc_script_path:
-source => 'puppet:///modules/puppetmaster/ldap-yaml-enc.py',
-owner  => 'root',
-group  => 'root',
-mode   => '0555',
-}
-}
 class { 'puppet::self::master':
 server  => $server,
 enc_script_path => $enc_script_path,
diff --git a/modules/puppetmaster/files/ldap-yaml-enc.py 
b/modules/puppetmaster/files/ldap-yaml-enc.py
deleted file mode 100644
index bf07b3a..000
--- a/modules/puppetmaster/files/ldap-yaml-enc.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/python
-import re
-import yaml
-import sys
-import ldapsupportlib
-import ldap
-import os
-
-
-class EmptyRolesRules(object):
-def __init__(self):
-pass
-
-def roles_for(self, fqdn):
-return []
-
-
-class YAMLRolesRules(object):
-"""
-A set of rules that help map a hostname to a set of roles.
-"""
-def __init__(self, rules):
-self.rules = {
-re.compile(key): value
-for key, value in rules.items()
-}
-
-def roles_for(self, fqdn):
-"""
-Return list of roles for given instancename
-"""
-matched_roles = []
-for check, roles in self.rules.items():
-if check.match(fqdn):
-matched_roles += roles
-
-return matched_roles
-
-
-def _guess_and_convert_type(value):
-"""
-Guess at the type of value passed in and convert appropriately
-
-This does a subset of the thing that LDAP's node terminator does,
-in that it does not support floats, only integers.
-See https://phabricator.wikimedia.org/T95240#1187339 for rationale
-
-:param value: string value to convert
-:return: string value converted to number or boolean as appropriate
-"""
-if value == 'true':
-return True
-if value == 'false':
-return False
-if value.isdigit():
-return int(value)
-return value
-
-
-def _is_valid_hostname(name):
-"""
-Check that hostname is of the form .(eqiad|codfw).wmflabs or
-..(eqiad|codfw).wmflabs
-
-where host and project are alphanumeric with '-' and '_' allowed
-"""
-host_parts = name.split('.')[::-1]
-
-if len(host_parts) > 4 or len(host_parts) < 3:
-return False
-
-domain = host_parts.pop(0)
-realm = host_parts.pop(0)
-
-if domain != 'wmflabs':
-return False
-
-if realm != 'codfw' and realm != 'eqiad':
-return False
-
-hostname = [x.replace('-', '').replace('_', '') for x in host_parts]
-
-# list of fqdn parts that are not alphanumeric should be empty
-if len([s for s in hostname if not s.isalnum()]) > 0:
-return False
-
-return True
-
-if __name__ == '__main__':
-with open('/etc/wmflabs-project') as f:
-path = os.path.join('/var/lib/git/operations/puppet/nodes/labs/',
-f.read().strip() + '.yaml')
-
-if os.path.exists(path):
-with open(path) as f:
-rolesrules = YAMLRolesRules(yaml.load(f))
-else:
-rolesrules = EmptyRolesRules()
-
-ldapConn = ldapsupportlib.LDAPSupportLib().connect()
-
-ec2id_name = sys.argv[1]
-
-# check to make sure ec2id_name is an actual ec2id based hostname, to
-# prevent ldap injection attacks
-if not _is_valid_hostname(ec2id_name):
-print 'Invalid hostname', ec2id_name
-sys.exit(-1)
-query = '(&(objectclass=puppetClient)(associatedDomain=%s))' % (ec2id_name)
-base = 'ou=hosts,dc=wikimedia,dc=org'
-result = ldapConn.search_s(base, ldap.SCOPE_SUBTREE, query)
-if result:
-host_info = result[0][1]
-# Default classes are no more in 

[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update ORES to the head

2016-07-25 Thread Ladsgroup (Code Review)
Ladsgroup has uploaded a new change for review.

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

Change subject: Update ORES to the head
..

Update ORES to the head

Change-Id: Id8cd14b09447a94f97676d7aa11fda10e7fe3afe
---
M submodules/ores
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/ores/deploy 
refs/changes/35/301035/1

diff --git a/submodules/ores b/submodules/ores
index cfb674d..4a5798e 16
--- a/submodules/ores
+++ b/submodules/ores
@@ -1 +1 @@
-Subproject commit cfb674d7cb75e0af5b5b70b511aa833f7d56b3df
+Subproject commit 4a5798ecb3bf0ec019343fede36538df5c6ee556

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8cd14b09447a94f97676d7aa11fda10e7fe3afe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/ores/deploy
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup 

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


[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Depend on SmashPig; use looser caret versioning

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Depend on SmashPig; use looser caret versioning
..


Depend on SmashPig; use looser caret versioning

Change-Id: Ie5d0edbe2f1e0ab535f47b8d1033ade221e31a8b
---
M composer.json
M composer.lock
2 files changed, 465 insertions(+), 14 deletions(-)

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



diff --git a/composer.json b/composer.json
index 0165634..686223b 100644
--- a/composer.json
+++ b/composer.json
@@ -21,15 +21,16 @@
"require": {
"coderkungfu/php-queue": "dev-master",
"composer/installers": ">=1.0.1",
-   "fusesource/stomp-php": "2.1.*",
+   "fusesource/stomp-php": "^2.1",
"minfraud/http": "^1.70",
"monolog/monolog": "~1.18.2",
"neitanod/forceutf8": "^2.0",
-   "predis/predis": "1.*",
-   "psr/log": "1.0.0",
+   "predis/predis": "^1.1",
+   "psr/log": "^1.0",
"zordius/lightncandy": "0.23",
"amzn/login-and-pay-with-amazon-sdk-php": "dev-master",
-   "symfony/yaml": "2.8.3"
+   "symfony/yaml": "^2.8",
+   "wikimedia/smash-pig": "dev-master"
},
"repositories": [
{
diff --git a/composer.lock b/composer.lock
index 409ede7..75591b6 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,8 @@
 "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file;,
 "This file is @generated automatically"
 ],
-"hash": "38659aab8a7bc18a5b1ef3384231b5bb",
-"content-hash": "35daa19c41225ff406fa80f22db01c7e",
+"hash": "bff35619bf730a68d81ff127dacb56b5",
+"content-hash": "5c2e46cb588e5e61da358cda05958b13",
 "packages": [
 {
 "name": "amzn/login-and-pay-with-amazon-sdk-php",
@@ -303,6 +303,48 @@
 "time": "2013-02-23 17:34:44"
 },
 {
+"name": "ircmaxell/password-compat",
+"version": "v1.0.4",
+"source": {
+"type": "git",
+"url": "https://github.com/ircmaxell/password_compat.git;,
+"reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c"
+},
+"dist": {
+"type": "zip",
+"url": 
"https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c;,
+"reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c",
+"shasum": ""
+},
+"require-dev": {
+"phpunit/phpunit": "4.*"
+},
+"type": "library",
+"autoload": {
+"files": [
+"lib/password.php"
+]
+},
+"notification-url": "https://packagist.org/downloads/;,
+"license": [
+"MIT"
+],
+"authors": [
+{
+"name": "Anthony Ferrara",
+"email": "ircmax...@php.net",
+"homepage": "http://blog.ircmaxell.com;
+}
+],
+"description": "A compatibility library for the proposed 
simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash;,
+"homepage": "https://github.com/ircmaxell/password_compat;,
+"keywords": [
+"hashing",
+"password"
+],
+"time": "2014-11-20 16:49:30"
+},
+{
 "name": "minfraud/http",
 "version": "v1.70",
 "source": {
@@ -456,6 +498,66 @@
 "time": "2015-05-07 16:37:23"
 },
 {
+"name": "phpmailer/phpmailer",
+"version": "v5.2.16",
+"source": {
+"type": "git",
+"url": "https://github.com/PHPMailer/PHPMailer.git;,
+"reference": "1d85f9ef3ecfc42bbc4f3c70d5e37ca9a65f629a"
+},
+"dist": {
+"type": "zip",
+"url": 
"https://api.github.com/repos/PHPMailer/PHPMailer/zipball/1d85f9ef3ecfc42bbc4f3c70d5e37ca9a65f629a;,
+"reference": "1d85f9ef3ecfc42bbc4f3c70d5e37ca9a65f629a",
+"shasum": ""
+},
+"require": {
+"php": ">=5.0.0"
+},
+"require-dev": {
+"phpdocumentor/phpdocumentor": "*",
+"phpunit/phpunit": "4.7.*"
+},
+"suggest": {
+"league/oauth2-google": "Needed for Google XOAUTH2 
authentication"
+},
+"type": "library",
+"autoload": {
+"classmap": [
+"class.phpmailer.php",
+  

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: MediaHandler: Fix @return for getHandler()

2016-07-25 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: MediaHandler: Fix @return for getHandler()
..

MediaHandler: Fix @return for getHandler()

Change-Id: I9373501e0055d0cddcb6c5bf72f5496ed22133c3
---
M includes/media/MediaHandler.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/34/301034/1

diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php
index 6b0f887..0ebfab7 100644
--- a/includes/media/MediaHandler.php
+++ b/includes/media/MediaHandler.php
@@ -43,7 +43,7 @@
 * Get a MediaHandler for a given MIME type from the instance cache
 *
 * @param string $type
-* @return MediaHandler
+* @return MediaHandler|bool
 */
static function getHandler( $type ) {
global $wgMediaHandlers;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9373501e0055d0cddcb6c5bf72f5496ed22133c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
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/puppet[production]: gerrit: Fix the css for inline diff

2016-07-25 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: gerrit: Fix the css for inline diff
..


gerrit: Fix the css for inline diff

This fixes it so it wraps the diff instead of taking chunks off the diff.

Reported by RoanKattouw.

Partial fix for https://bugs.chromium.org/p/gerrit/issues/detail?id=4292

Change-Id: I32535e49143c07f292d37b14f394194ed3dfef6b
---
M modules/gerrit/files/etc/GerritSite.css
1 file changed, 8 insertions(+), 0 deletions(-)

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



diff --git a/modules/gerrit/files/etc/GerritSite.css 
b/modules/gerrit/files/etc/GerritSite.css
index 0d9bb21..e9e0fc2 100644
--- a/modules/gerrit/files/etc/GerritSite.css
+++ b/modules/gerrit/files/etc/GerritSite.css
@@ -4,6 +4,14 @@
  * Add word wrapping for commit messages, so horizontal scrolling isn't needed,
  *   and for inline review messages, so we can write code there.
  */
+.com-google-gerrit-client-diff-DiffTable_BinderImpl_GenCss_style-difftable 
.CodeMirror pre span {
+   white-space: pre-wrap !important;
+}
+
+/*
+ * pre-gerrit-2.8 not sure if this is needed
+ * but keeping it just in case.
+ */
 .commentPanelMessage {
white-space: pre-wrap !important;
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I32535e49143c07f292d37b14f394194ed3dfef6b
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Dzahn 
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...parsoid[master]: Revert "Revert "Only apply data-* attributes in /pagebundle/...

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Revert "Revert "Only apply data-* attributes in /pagebundle/ 
paths""
..


Revert "Revert "Only apply data-* attributes in /pagebundle/ paths""

 * Now that service-runner has deployed w/o incident, we can get back to
   figuring out what went wrong here.

This reverts commit fa6e40b3082e161869a888f8a6c495283f137cad.

Change-Id: I7bb4143d629e1abcd2e115e3b09c5223be0b9eb9
---
M bin/roundtrip-test.js
M lib/api/apiUtils.js
M lib/api/routes.js
M lib/config/MWParserEnvironment.js
M npm-shrinkwrap.json
M package.json
M tests/mocha/api.js
M tests/mocha/templatedata.js
8 files changed, 290 insertions(+), 119 deletions(-)

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



diff --git a/bin/roundtrip-test.js b/bin/roundtrip-test.js
index 2dd60b9..57d9685 100755
--- a/bin/roundtrip-test.js
+++ b/bin/roundtrip-test.js
@@ -478,7 +478,7 @@
 
var uri = options.uri + 'transform/';
if (options.html2wt) {
-   uri += 'html/to/wikitext/' + options.title;
+   uri += 'pagebundle/to/wikitext/' + options.title;
if (options.oldid) {
uri += '/' + options.oldid;
}
@@ -623,11 +623,11 @@
html2wt: true,
recordSizes: true,
data: {
-   html: data.oldHTML,
+   html: data.oldHTML.body,
original: {
'data-parsoid': data.oldDp,
'data-mw': data.oldMw,
-   wikitext: { body: data.oldWt, },
+   wikitext: { body: data.oldWt },
},
},
}, parsoidOptions);
diff --git a/lib/api/apiUtils.js b/lib/api/apiUtils.js
index c8e8fa8..e982a1e 100644
--- a/lib/api/apiUtils.js
+++ b/lib/api/apiUtils.js
@@ -3,7 +3,9 @@
 
 var domino = require('domino');
 var util = require('util');
+var semver = require('semver');
 var qs = require('querystring');
+var contentType = require('content-type');
 
 var Diff = require('../utils/Diff.js').Diff;
 var DU = require('../utils/DOMUtils.js').DOMUtils;
@@ -241,17 +243,37 @@
 };
 
 /**
+ * Extracts a pagebundle from a revision.
+ *
+ * @method
+ * @param revision
+ * @return {Object}
+ */
+apiUtils.extractPageBundle = function(revision) {
+   return {
+   parsoid: revision['data-parsoid'] && 
revision['data-parsoid'].body,
+   mw: revision['data-mw'] && revision['data-mw'].body,
+   };
+};
+
+/**
  * Validates the pagebundle was provided in the expected format.
  *
  * @method
- * @param {Object} obj
+ * @param {Object} pb
+ * @param {String} originalVersion
  */
-apiUtils.validatePageBundle = function(obj) {
-   // FIXME(arlolra): This should also accept the content-type of the
-   // supplied html to determine which attributes are expected.
-   var dp = obj['data-parsoid'];
-   if (!dp || !dp.body || dp.body.constructor !== Object || !dp.body.ids) {
-   var err = new Error('Invalid data-parsoid was provided.');
+apiUtils.validatePageBundle = function(pb, originalVersion) {
+   var err;
+   if (!pb.parsoid || pb.parsoid.constructor !== Object || 
!pb.parsoid.ids) {
+   err = new Error('Invalid data-parsoid was provided.');
+   err.httpStatus = 400;
+   err.suppressLoggingStack = true;
+   throw err;
+   }
+   if (semver.satisfies(originalVersion, '^2.0.0') &&
+   (!pb.mw || pb.mw.constructor !== Object || !pb.mw.ids)) 
{
+   err = new Error('Invalid data-mw was provided.');
err.httpStatus = 400;
err.suppressLoggingStack = true;
throw err;
@@ -273,7 +295,57 @@
env.log('fatal/request', err);
 };
 
-var profileRE = 
/^https:\/\/www.mediawiki.org\/wiki\/Specs\/(HTML|pagebundle)\/(\d+\.\d+\.\d+)$/;
+/**
+ * Determine the content version from the html's content type.
+ *
+ * @param {Object} html
+ * @return {String|null}
+ */
+apiUtils.versionFromType = function(html) {
+   var ct = html.headers && html.headers['content-type'];
+   if (ct) {
+   try {
+   var t = contentType.parse(ct);
+   var profile = t.parameters && t.parameters.profile;
+   if (profile) {
+   var p = apiUtils.parseProfile(profile, 'html');
+   return p && p.version;
+   } else {
+   return null;
+   }
+   } catch (e) {
+   return null;
+   }
+   } else {
+ 

[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Revert "Revert "Only apply data-* attributes in /pagebundle/...

2016-07-25 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review.

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

Change subject: Revert "Revert "Only apply data-* attributes in /pagebundle/ 
paths""
..

Revert "Revert "Only apply data-* attributes in /pagebundle/ paths""

 * Now that service-runner has deployed w/o incident, we can get back to
   figuring out what went wrong here.

This reverts commit fa6e40b3082e161869a888f8a6c495283f137cad.

Change-Id: I7bb4143d629e1abcd2e115e3b09c5223be0b9eb9
---
M bin/roundtrip-test.js
M lib/api/apiUtils.js
M lib/api/routes.js
M lib/config/MWParserEnvironment.js
M npm-shrinkwrap.json
M package.json
M tests/mocha/api.js
M tests/mocha/templatedata.js
8 files changed, 290 insertions(+), 119 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/31/301031/1

diff --git a/bin/roundtrip-test.js b/bin/roundtrip-test.js
index 2dd60b9..57d9685 100755
--- a/bin/roundtrip-test.js
+++ b/bin/roundtrip-test.js
@@ -478,7 +478,7 @@
 
var uri = options.uri + 'transform/';
if (options.html2wt) {
-   uri += 'html/to/wikitext/' + options.title;
+   uri += 'pagebundle/to/wikitext/' + options.title;
if (options.oldid) {
uri += '/' + options.oldid;
}
@@ -623,11 +623,11 @@
html2wt: true,
recordSizes: true,
data: {
-   html: data.oldHTML,
+   html: data.oldHTML.body,
original: {
'data-parsoid': data.oldDp,
'data-mw': data.oldMw,
-   wikitext: { body: data.oldWt, },
+   wikitext: { body: data.oldWt },
},
},
}, parsoidOptions);
diff --git a/lib/api/apiUtils.js b/lib/api/apiUtils.js
index c8e8fa8..e982a1e 100644
--- a/lib/api/apiUtils.js
+++ b/lib/api/apiUtils.js
@@ -3,7 +3,9 @@
 
 var domino = require('domino');
 var util = require('util');
+var semver = require('semver');
 var qs = require('querystring');
+var contentType = require('content-type');
 
 var Diff = require('../utils/Diff.js').Diff;
 var DU = require('../utils/DOMUtils.js').DOMUtils;
@@ -241,17 +243,37 @@
 };
 
 /**
+ * Extracts a pagebundle from a revision.
+ *
+ * @method
+ * @param revision
+ * @return {Object}
+ */
+apiUtils.extractPageBundle = function(revision) {
+   return {
+   parsoid: revision['data-parsoid'] && 
revision['data-parsoid'].body,
+   mw: revision['data-mw'] && revision['data-mw'].body,
+   };
+};
+
+/**
  * Validates the pagebundle was provided in the expected format.
  *
  * @method
- * @param {Object} obj
+ * @param {Object} pb
+ * @param {String} originalVersion
  */
-apiUtils.validatePageBundle = function(obj) {
-   // FIXME(arlolra): This should also accept the content-type of the
-   // supplied html to determine which attributes are expected.
-   var dp = obj['data-parsoid'];
-   if (!dp || !dp.body || dp.body.constructor !== Object || !dp.body.ids) {
-   var err = new Error('Invalid data-parsoid was provided.');
+apiUtils.validatePageBundle = function(pb, originalVersion) {
+   var err;
+   if (!pb.parsoid || pb.parsoid.constructor !== Object || 
!pb.parsoid.ids) {
+   err = new Error('Invalid data-parsoid was provided.');
+   err.httpStatus = 400;
+   err.suppressLoggingStack = true;
+   throw err;
+   }
+   if (semver.satisfies(originalVersion, '^2.0.0') &&
+   (!pb.mw || pb.mw.constructor !== Object || !pb.mw.ids)) 
{
+   err = new Error('Invalid data-mw was provided.');
err.httpStatus = 400;
err.suppressLoggingStack = true;
throw err;
@@ -273,7 +295,57 @@
env.log('fatal/request', err);
 };
 
-var profileRE = 
/^https:\/\/www.mediawiki.org\/wiki\/Specs\/(HTML|pagebundle)\/(\d+\.\d+\.\d+)$/;
+/**
+ * Determine the content version from the html's content type.
+ *
+ * @param {Object} html
+ * @return {String|null}
+ */
+apiUtils.versionFromType = function(html) {
+   var ct = html.headers && html.headers['content-type'];
+   if (ct) {
+   try {
+   var t = contentType.parse(ct);
+   var profile = t.parameters && t.parameters.profile;
+   if (profile) {
+   var p = apiUtils.parseProfile(profile, 'html');
+   return p && p.version;
+   } else {
+   return null;
+   }
+   } catch (e) {
+   return null;
+  

[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update restbase to ae5fbac

2016-07-25 Thread Ppchelko (Code Review)
Ppchelko has submitted this change and it was merged.

Change subject: Update restbase to ae5fbac
..


Update restbase to ae5fbac

List of changes:
de801b5 Updated restbase-mod-table-cassandra version
xxx Update node module dependencies

Change-Id: Ic6f540ab718bedf4605802f91a5168247297da77
---
M node_modules/content-type/package.json
M node_modules/hyperswitch/node_modules/json-stable-stringify/package.json
M node_modules/hyperswitch/node_modules/swagger-ui/package.json
M node_modules/json-stable-stringify/package.json
M 
node_modules/restbase-mod-table-cassandra/maintenance/thin_out_key_rev_value_data.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/.npmignore
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/.travis.yml
A 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/appveyor.ps1
A 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/appveyor.yml
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/build.yaml
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/index.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/client-options.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/client.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/connection.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/control-connection.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/encoder.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/errors.js
A 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/execution-profile.js
A 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/host-connection-pool.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/host.js
A 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/metadata/event-debouncer.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/metadata/index.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/metadata/schema-parser.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/policies/address-resolution.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/policies/index.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/policies/load-balancing.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/policies/reconnection.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/policies/retry.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/readers.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/request-handler.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/requests.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/streams.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/tokenizer.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/types/index.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/types/inet-address.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/types/result-set.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/types/time-uuid.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/utils.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/writers.js
D 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/neo-async/LICENSE
D 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/neo-async/dist/async.js
D 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/neo-async/dist/async.min.js
D 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/neo-async/index.js
D 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/neo-async/lib/async.js
D 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/neo-async/lib/async.min.js
D 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/neo-async/package.json
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/package.json
M 
node_modules/restbase-mod-table-cassandra/node_modules/json-stable-stringify/package.json
M 

[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update restbase to ae5fbac

2016-07-25 Thread Ppchelko (Code Review)
Ppchelko has uploaded a new change for review.

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

Change subject: Update restbase to ae5fbac
..

Update restbase to ae5fbac

List of changes:
de801b5 Updated restbase-mod-table-cassandra version
xxx Update node module dependencies

Change-Id: Ic6f540ab718bedf4605802f91a5168247297da77
---
M node_modules/content-type/package.json
M node_modules/hyperswitch/node_modules/json-stable-stringify/package.json
M node_modules/hyperswitch/node_modules/swagger-ui/package.json
M node_modules/json-stable-stringify/package.json
M 
node_modules/restbase-mod-table-cassandra/maintenance/thin_out_key_rev_value_data.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/.npmignore
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/.travis.yml
A 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/appveyor.ps1
A 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/appveyor.yml
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/build.yaml
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/index.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/client-options.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/client.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/connection.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/control-connection.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/encoder.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/errors.js
A 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/execution-profile.js
A 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/host-connection-pool.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/host.js
A 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/metadata/event-debouncer.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/metadata/index.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/metadata/schema-parser.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/policies/address-resolution.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/policies/index.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/policies/load-balancing.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/policies/reconnection.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/policies/retry.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/readers.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/request-handler.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/requests.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/streams.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/tokenizer.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/types/index.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/types/inet-address.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/types/result-set.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/types/time-uuid.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/utils.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/writers.js
D 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/neo-async/LICENSE
D 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/neo-async/dist/async.js
D 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/neo-async/dist/async.min.js
D 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/neo-async/index.js
D 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/neo-async/lib/async.js
D 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/neo-async/lib/async.min.js
D 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/neo-async/package.json
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/package.json
M 
node_modules/restbase-mod-table-cassandra/node_modules/json-stable-stringify/package.json
M 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: OutputPage: Add addHeadItems() method

2016-07-25 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: OutputPage: Add addHeadItems() method
..

OutputPage: Add addHeadItems() method

Right now OutputPage requires head items to have a name when using
the addHeadItem() method.

This in contrary to most of the helper methods, which don't require
a name. ParserOutput::addHeadItem() also doesn't require a name.

Since the existing signature isn't easily changed without adding
confusion, add a separate method that allow numerical indexes
to be pushed.

This ability was already exposed via addParserOutputMetadata()
and its array_merge. This method exposes it directly.

Change-Id: I433afd124b57526caa13a540cda48ba2b99a9bde
---
M includes/OutputPage.php
1 file changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/28/301028/1

diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index ecc719a..2ae5f78 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -653,7 +653,7 @@
}
 
/**
-* Add or replace an header item to the output
+* Add or replace a head item to the output
 *
 * Whenever possible, use more specific options like ResourceLoader 
modules,
 * OutputPage::addLink(), OutputPage::addMetaLink() and 
OutputPage::addFeedLink()
@@ -669,6 +669,16 @@
}
 
/**
+* Add one or more head items to the output
+*
+* @since 1.28
+* @param string|string[] $value Raw HTML
+*/
+   public function addHeadItems( $values ) {
+   $this->mHeadItems = array_merge( $this->mHeadItems, 
(array)$values );
+   }
+
+   /**
 * Check if the header item $name is already set
 *
 * @param string $name Item name

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I433afd124b57526caa13a540cda48ba2b99a9bde
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] operations/puppet[production]: gerrit: Fix the css for inline diff

2016-07-25 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: gerrit: Fix the css for inline diff
..

gerrit: Fix the css for inline diff

This fixes it so it wraps the diff instead of taking chunks off the diff.

Reported by RoanKattouw.

Change-Id: I32535e49143c07f292d37b14f394194ed3dfef6b
---
M modules/gerrit/files/etc/GerritSite.css
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/27/301027/1

diff --git a/modules/gerrit/files/etc/GerritSite.css 
b/modules/gerrit/files/etc/GerritSite.css
index 0d9bb21..e9e0fc2 100644
--- a/modules/gerrit/files/etc/GerritSite.css
+++ b/modules/gerrit/files/etc/GerritSite.css
@@ -4,6 +4,14 @@
  * Add word wrapping for commit messages, so horizontal scrolling isn't needed,
  *   and for inline review messages, so we can write code there.
  */
+.com-google-gerrit-client-diff-DiffTable_BinderImpl_GenCss_style-difftable 
.CodeMirror pre span {
+   white-space: pre-wrap !important;
+}
+
+/*
+ * pre-gerrit-2.8 not sure if this is needed
+ * but keeping it just in case.
+ */
 .commentPanelMessage {
white-space: pre-wrap !important;
 }

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Compare pending db and queue in Adyen capture job

2016-07-25 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: Compare pending db and queue in Adyen capture job
..

Compare pending db and queue in Adyen capture job

When Adyen reads a message from the pending queue, it should also
read from the pending database and make sure it's getting the same
data.

Bug: T140959
Change-Id: I1d306caa9aabc1e85be485775ba536c8b9bf8528
---
M PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php
1 file changed, 32 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/26/301026/1

diff --git a/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php 
b/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php
index 0d4f74c..71bb4b1 100644
--- a/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php
+++ b/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php
@@ -1,6 +1,8 @@
 fetchMessageByGatewayOrderId( 'adyen', 
$this->merchantReference );
if ( $queueMessage && ( $queueMessage instanceof 
DonationInterfaceMessage ) ) {
$this->logger->debug( 'A valid message was obtained 
from the pending queue.' );
} else {
+   $errMessage =  "Could not find a processable message 
for " .
+   "PSP Reference '{$this->pspReference}' and ".
+   "correlation ID '{$this->correlationId}'.";
+   if ( $dbMessage ) {
+   $errMessage .= 'There is a pending database 
entry, though: ' .
+   json_encode( $dbMessage );
+   }
$this->logger->warning(
-   "Could not find a processable message for PSP 
Reference '{$this->pspReference}' and correlation ".
-   "ID '{$this->correlationId}'.",
+   $errMessage,
$queueMessage
);
return self::ACTION_MISSING;
}
+   $this->comparePending( $queueMessage, $dbMessage );
if ( $queueMessage->captured ) {
$this->logger->info(
"Duplicate PSP Reference 
'{$this->pspReference}' for correlation ID '{$this->correlationId}'.",
@@ -222,4 +233,23 @@
$this->logger->warning( "Failed to cancel 
authorization, it will remain in the payment console" );
}
}
+
+   protected function comparePending( KeyedOpaqueStorableObject 
$queueMessage, $dbMessage ) {
+   if ( $dbMessage ) {
+   $queueData = json_decode( $queueMessage->toJson(), true 
);
+   $differences = array_diff_assoc( $queueData, $dbMessage 
);
+   if ( !empty( $differences ) ) {
+   $this->logger->notice(
+   "Pending message for 
adyen-{$this->merchantReference} " .
+   'differs between ActiveMQ and pending 
database: ' .
+   json_encode( $differences, true )
+   );
+   }
+   } else {
+   $this->logger->notice(
+   "Found pending message for 
adyen-{$this->merchantReference} " .
+   'in ActiveMQ but not in pending database.'
+);
+   }
+   }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d306caa9aabc1e85be485775ba536c8b9bf8528
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
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/core[master]: Update justinrainbow/json-schema in require-dev to ~1.6

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update justinrainbow/json-schema in require-dev to ~1.6
..


Update justinrainbow/json-schema in require-dev to ~1.6

This matches the version that Kartographer is tracking, and hence
the committed vendor repo

Change-Id: I92bc1d03e62482bf9de4903ac14f79a4340ed1f2
---
M composer.json
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/composer.json b/composer.json
index 54eb3c0..1bd3d4c 100644
--- a/composer.json
+++ b/composer.json
@@ -45,7 +45,7 @@
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "justinrainbow/json-schema": "~1.3",
+   "justinrainbow/json-schema": "~1.6",
"mediawiki/mediawiki-codesniffer": "0.7.2",
"monolog/monolog": "~1.18.2",
"nikic/php-parser": "1.4.1",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I92bc1d03e62482bf9de4903ac14f79a4340ed1f2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Reedy 
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] integration/config[master]: Use composer in DonationInterface hhvm tests

2016-07-25 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: Use composer in DonationInterface hhvm tests
..

Use composer in DonationInterface hhvm tests

Bug: T141309
Change-Id: Ib87efcfa7df3f353f19d77f82091ff69bafc76aa
---
M zuul/layout.yaml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/25/301025/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index be5b348..0897585 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -2948,7 +2948,7 @@
 
   - name: mediawiki/extensions/DonationInterface
 template:
-  - name: extension-unittests-non-voting
+  - name: extension-unittests-composer-non-voting
   - name: npm
 check:
   - jsonlint

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib87efcfa7df3f353f19d77f82091ff69bafc76aa
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Awight 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseMediaInfo[master]: Add null check for $title in MediaInfoView

2016-07-25 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Add null check for $title in MediaInfoView
..

Add null check for $title in MediaInfoView

Bug: T141322
Change-Id: I8e0151f0d9dd598e184cfec67d2d6cac6c1628be
---
M src/View/MediaInfoView.php
1 file changed, 8 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseMediaInfo 
refs/changes/24/301024/1

diff --git a/src/View/MediaInfoView.php b/src/View/MediaInfoView.php
index 2aa6034..9be74c9 100644
--- a/src/View/MediaInfoView.php
+++ b/src/View/MediaInfoView.php
@@ -105,12 +105,16 @@
 * @return string HTML
 */
private function getFileLinkHtml( MediaInfoId $id = null ) {
-   if ( !$id ) {
-   return '';
+   $html = '';
+
+   if ( $id ) {
+   $title = $this->filePageLookup->getFilePage( $id );
+
+   if ( $title ) {
+   $html = $this->linkRenderer->makeKnownLink( 
$title );
+   }
}
 
-   $title = $this->filePageLookup->getFilePage( $id );
-   $html = $this->linkRenderer->makeKnownLink( $title );
return $html;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e0151f0d9dd598e184cfec67d2d6cac6c1628be
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseMediaInfo
Gerrit-Branch: master
Gerrit-Owner: Aude 

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


[MediaWiki-commits] [Gerrit] mediawiki...MolHandler[master]: Move MediaHandlers out of config up a level

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Move MediaHandlers out of config up a level
..


Move MediaHandlers out of config up a level

Change-Id: Ifec1cfdb63166222ffacaebeffe7089ff90ec49c
---
M extension.json
1 file changed, 5 insertions(+), 5 deletions(-)

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



diff --git a/extension.json b/extension.json
index 8c0672d..4f7d582 100644
--- a/extension.json
+++ b/extension.json
@@ -37,6 +37,10 @@
"MolHandlerHooks::onUnitTestsList"
]
},
+   "MediaHandlers": {
+   "chemical/x-mdl-molfile": "MolMediaHandler",
+   "chemical/x-mdl-rxnfile": "RxnMediaHandler"
+   },
"config": {
"MolConverterPath": "/usr/bin",
"MolConvertCommands": {
@@ -51,11 +55,7 @@
"memory": 204800
}
},
-   "MolConverter": "indigo",
-   "MediaHandlers": {
-   "chemical/x-mdl-molfile": "MolMediaHandler",
-   "chemical/x-mdl-rxnfile": "RxnMediaHandler"
-   }
+   "MolConverter": "indigo"
},
"manifest_version": 1
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifec1cfdb63166222ffacaebeffe7089ff90ec49c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MolHandler
Gerrit-Branch: master
Gerrit-Owner: Reedy 
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...Wikibase[wmf/1.28.0-wmf.9]: Prevent undeleting entities from ending with an exception

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Prevent undeleting entities from ending with an exception
..


Prevent undeleting entities from ending with an exception

Bug: T140533
Change-Id: I4b256879e212dce01efd1def662cab8dcb97b4e7
(cherry picked from commit a5b635a9603b4649a2e4e8f66d3f6e54c8a6c189)
---
M repo/Wikibase.hooks.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index 576be14..a9a9690 100644
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -458,7 +458,7 @@
: 
$skinTemplate->getRevisionId();
 
$rev = Revision::newFromId( $revid );
-   if ( $rev->isDeleted( 
Revision::DELETED_TEXT ) ) {
+   if ( !$rev || $rev->isDeleted( 
Revision::DELETED_TEXT ) ) {
return;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4b256879e212dce01efd1def662cab8dcb97b4e7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: wmf/1.28.0-wmf.9
Gerrit-Owner: Aude 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Matěj Suchánek 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] integration/config[master]: Quit testing DonationInterface against REL1_25

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Quit testing DonationInterface against REL1_25
..


Quit testing DonationInterface against REL1_25

We updated payments to 1_27. Huzzah!

Change-Id: I73f01f87b06b995bdd855628006225879a17fee5
---
M jjb/wm-fundraising.yaml
M zuul/layout.yaml
2 files changed, 2 insertions(+), 30 deletions(-)

Approvals:
  Awight: Looks good to me, but someone else must approve
  20after4: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/jjb/wm-fundraising.yaml b/jjb/wm-fundraising.yaml
index 9819a51..715eaf8 100644
--- a/jjb/wm-fundraising.yaml
+++ b/jjb/wm-fundraising.yaml
@@ -59,34 +59,6 @@
   - phpunit-junit
   - archive-log-dir
 
-
-- project:
-name: donationinterface-fundraising-branches
-branch:
- - REL1_25
-jobs:
- - mwext-donationinterfacecore-{branch}-testextension-zend53:
-
-- job-template:
-name: 'mwext-donationinterfacecore-{branch}-testextension-zend53'
-node: 'contintLabsSlave && phpflavor-php53'
-concurrent: true
-properties:
- - throttle-one-per-node
-triggers:
- - zuul
-builders:
- - assert-phpflavor:
- phpflavor: 'php53'
- - prepare-mediawiki-branch:
- branch: '{branch}'
- - mw-run-phpunit-allexts
-publishers:
- - junit:
-results: 'log/junit*.xml'
- - mw-teardown-mysql
- - archive-log-dir
-
 - project:
 name: donationinterface-fundraising-branches-php55
 branch:
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index cd2d3b6..be5b348 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -2954,11 +2954,11 @@
   - jsonlint
   - jshint
 test:
-  - mwext-donationinterfacecore-REL1_25-testextension-zend53
   - mwext-donationinterfacecore-REL1_27-testextension-zend55
+  - php53lint
 gate-and-submit:
-  - mwext-donationinterfacecore-REL1_25-testextension-zend53
   - mwext-donationinterfacecore-REL1_27-testextension-zend55
+  - php53lint
 
   - name: mediawiki/extensions/DoubleWiki
 template:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I73f01f87b06b995bdd855628006225879a17fee5
Gerrit-PatchSet: 4
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Ejegg 
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...civicrm[master]: Hack out version & extension checks.

2016-07-25 Thread Eileen (Code Review)
Eileen has uploaded a new change for review.

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

Change subject: Hack out version & extension checks.
..

Hack out version & extension checks.

The firewall is blocking these & I am struggling to find a more 'co-operative' 
solution.

This probably will also block (unfortunately) the reminders if debugging is 
left on & cron isn't running

Bug: T138334
Change-Id: Iec6f73029f2913fe7d3cba135a81b24d1b9bdb1f
---
M CRM/Core/Page.php
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm 
refs/changes/23/301023/1

diff --git a/CRM/Core/Page.php b/CRM/Core/Page.php
index a60d276..807f31d 100644
--- a/CRM/Core/Page.php
+++ b/CRM/Core/Page.php
@@ -215,7 +215,12 @@
 $config = CRM_Core_Config::singleton();
 
 // Intermittent alert to admins
-CRM_Utils_Check::singleton()->showPeriodicAlerts();
+// T138334 / CRM-19101
+// These checks are extra slow as a result of us being behind a firewall
+// Turning off the versionCheck scheduled job disabled some from running
+// during a user session but the extension check persisted.
+// Am falling back on hackery.
+// CRM_Utils_Check::singleton()->showPeriodicAlerts();
 
 if ($this->useLivePageJS && Civi::settings()->get('ajaxPopupsEnabled')) {
   CRM_Core_Resources::singleton()->addScriptFile('civicrm', 
'js/crm.livePage.js', 1, 'html-header');

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec6f73029f2913fe7d3cba135a81b24d1b9bdb1f
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Eileen 

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


[MediaWiki-commits] [Gerrit] mediawiki...testreduce[master]: Bump express-handlebars for nsp failure

2016-07-25 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review.

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

Change subject: Bump express-handlebars for nsp failure
..

Bump express-handlebars for nsp failure

Change-Id: Ib9bab8f16a3a3587102b66caa3663b4d00d2922b
---
M package.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid/testreduce 
refs/changes/22/301022/1

diff --git a/package.json b/package.json
index dab4335..c04beed 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,7 @@
 "core-js": "^1.2.6",
 "events": "^0.5.0",
 "express": "^4.13.3",
-"express-handlebars": "^2.0.1",
+"express-handlebars": "^3.0.0",
 "mysql": "^2.10.0",
 "mysql-queues": "^1.0.0",
 "path": "^0.12.7",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9bab8f16a3a3587102b66caa3663b4d00d2922b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid/testreduce
Gerrit-Branch: master
Gerrit-Owner: Arlolra 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Add dewiki_diffstats to wmgMonologChannels

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add dewiki_diffstats to wmgMonologChannels
..


Add dewiki_diffstats to wmgMonologChannels

Jan Dittrich requested we track diff page usage
on de.wikipedia for the revision slider.

Relates to:
I267421c9af6f79b10f8c657a74e7ce89e08560d7

Bug: T134861
Change-Id: I4b7f30eebf254a288baaa9d3f755b139a255
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 4ad73cb..abb87ef 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -4510,6 +4510,7 @@
'cite' => 'debug',
'collection' => 'debug', // -cscott for T73675
'DBPerformance' => [ 'logstash' => 'debug', 'udp2log' => 
'warning' ],
+   'dewiki_diffstats' => [ 'logstash' => false ], // addshore for 
T134861
'diff' => 'debug',
'Echo' => 'debug',
'es-hit' => 'debug',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4b7f30eebf254a288baaa9d3f755b139a255
Gerrit-PatchSet: 8
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Addshore 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Daniel Kinzler 
Gerrit-Reviewer: Dereckson 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Ori.livneh 
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[master]: [wip] Update and fetch seenTime per source

2016-07-25 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review.

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

Change subject: [wip] Update and fetch seenTime per source
..

[wip] Update and fetch seenTime per source

Change-Id: I10510fc612f7d5349f8b579ede70be647a119470
---
M modules/api/mw.echo.api.APIHandler.js
M modules/controller/mw.echo.Controller.js
M modules/ui/mw.echo.ui.NotificationsInboxWidget.js
3 files changed, 22 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/21/301021/1

diff --git a/modules/api/mw.echo.api.APIHandler.js 
b/modules/api/mw.echo.api.APIHandler.js
index 2af0dfa..b032876 100644
--- a/modules/api/mw.echo.api.APIHandler.js
+++ b/modules/api/mw.echo.api.APIHandler.js
@@ -120,7 +120,7 @@
notsections: this.normalizedType[ type ],
notformat: 'model',
notlimit: this.limit,
-   notprop: 'list|count',
+   notprop: 'list|count|seenTime',
uselang: this.userLang
}, this.getTypeParams( type ) );
 
diff --git a/modules/controller/mw.echo.Controller.js 
b/modules/controller/mw.echo.Controller.js
index 7641475..3f70f28 100644
--- a/modules/controller/mw.echo.Controller.js
+++ b/modules/controller/mw.echo.Controller.js
@@ -137,6 +137,7 @@
)
.then( function ( data ) {
var i, notifData, newNotifData, localizedDate, 
date, itemModel, symbolicName,
+   maxSeenTime,
dateItemIds = {},
dateItems = {},
models = {};
@@ -190,6 +191,20 @@
// Update the manager
controller.manager.setNotificationModels( 
models );
 
+   // Update the seenTime
+   // TODO: This query brings up mixed alert and 
message notifications.
+   // Regularly, each of those will have a 
different seenTime that is
+   // calculated for each badge, but for this 
page, both are fetched.
+   // For the moment, we are picking the max 
seenTime from
+   // either alert or notice and updating both, 
since the page gives
+   // us a mixed view which will update both 
seenTime to be the same
+   // anyways.
+   maxSeenTime = data.seenTime.alert < 
data.seenTime.notice ?
+   data.seenTime.notice : 
data.seenTime.alert;
+   
controller.manager.getSeenTimeModel().setSeenTimeForSource(
+   currentSource,
+   maxSeenTime
+   );
// Update the pagination
pagination.setNextPageContinue( data.continue );
 
@@ -319,6 +334,7 @@
 */
mw.echo.Controller.prototype.createNotificationData = function ( 
apiData ) {
var utcTimestamp, utcIsoMoment,
+   source = 
this.manager.getFiltersModel().getSourcePagesModel().getCurrentSource(),
content = apiData[ '*' ] || {};
 
if ( apiData.timestamp.utciso8601 ) {
@@ -336,7 +352,10 @@
source: 'local',
count: apiData.count,
read: !!apiData.read,
-   seen: !!apiData.read || utcTimestamp <= 
this.manager.getSeenTime(), //XXX
+   seen: (
+   !!apiData.read ||
+   utcTimestamp <= this.manager.getSeenTime( 
source )
+   ),
timestamp: utcTimestamp,
category: apiData.category,
content: {
diff --git a/modules/ui/mw.echo.ui.NotificationsInboxWidget.js 
b/modules/ui/mw.echo.ui.NotificationsInboxWidget.js
index f3d8089..1f5f300 100644
--- a/modules/ui/mw.echo.ui.NotificationsInboxWidget.js
+++ b/modules/ui/mw.echo.ui.NotificationsInboxWidget.js
@@ -240,6 +240,7 @@
// Success
function () {
widget.popPending();
+debugger;
// Update seen time

widget.controller.updateSeenTimeForCurrentSource();
},

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

[MediaWiki-commits] [Gerrit] mediawiki...TrustedXFF[master]: IPv6 addresses are in TrustedXFF.body.php

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: IPv6 addresses are in TrustedXFF.body.php
..


IPv6 addresses are in TrustedXFF.body.php

Change-Id: I39c10f793ee12719455f32814846f9823cba4f34
---
M trusted-hosts.txt
1 file changed, 1 insertion(+), 2 deletions(-)

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



diff --git a/trusted-hosts.txt b/trusted-hosts.txt
index f91440e..3e704e2 100644
--- a/trusted-hosts.txt
+++ b/trusted-hosts.txt
@@ -4,8 +4,7 @@
 # http://meta.wikimedia.org/wiki/XFF_project
 #
 # Note: IPv6 ranges cannot currently be listed in this file. They are 
-# listed in TrustedXFF.php instead.
-
+# listed in TrustedXFF.body.php instead.
 
 # AOL
 # Source: http://webmaster.info.aol.com/proxyinfo.html

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I39c10f793ee12719455f32814846f9823cba4f34
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TrustedXFF
Gerrit-Branch: master
Gerrit-Owner: Reedy 
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...RevisionSlider[master]: Add GENDER support to Revision Slider

2016-07-25 Thread Purodha (Code Review)
Purodha has uploaded a new change for review.

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

Change subject: Add GENDER support to Revision Slider
..

Add GENDER support to Revision Slider

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


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

diff --git a/i18n/en.json b/i18n/en.json
index 48fdf34..ca8ccc5 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -12,7 +12,7 @@
 "revisionslider-label-page-size": "Page size: $1 
{{PLURAL:$2|byte|bytes}}",
 "revisionslider-label-change-size": "Change size: $1 
{{PLURAL:$2|byte|bytes}}",
 "revisionslider-label-comment": "Comment: ",
-"revisionslider-label-username": "Username: [[$2|$1]]",
+"revisionslider-label-username": "{{GENDER:$1|Usernme}}: 
[[$2|$1]]",
 "revisionslider-minoredit": "This is a minor edit",
 "revisionslider-loading-placeholder": "The RevisionSlider is loading...",
 "revisionslider-loading-failed": "The RevisionSlider failed to load.",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I89180872e1bad4203755078c173d98f1939c7ae7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RevisionSlider
Gerrit-Branch: master
Gerrit-Owner: Purodha 

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


[MediaWiki-commits] [Gerrit] analytics...scripts[production]: Track global user enables & disables of beta features

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Track global user enables & disables of beta features
..


Track global user enables & disables of beta features

This tracks how many global users have enabled / disabled
a betafeature.

If a user has a feature enabled on a single wiki they are
counted as using the feature.
If they then enabled it on a second wiki, this will not count
as another enable.
Only if a user removes the feature from all wikis will it count
as a disable.

Bug: T140226
Change-Id: Ib3df65f4e28bf2ffa06e21f1d4f89f13f79c6582
---
M src/betafeatures/counts.php
1 file changed, 65 insertions(+), 8 deletions(-)

Approvals:
  Addshore: Checked; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/betafeatures/counts.php b/src/betafeatures/counts.php
index 5543c5b..ededba9 100755
--- a/src/betafeatures/counts.php
+++ b/src/betafeatures/counts.php
@@ -36,15 +36,25 @@
 $pdo = WikimediaDb::getPdo();
 
 $metrics = array();
+$tempTableName = 'staging.wmde_analytics_betafeature_users_temp';
+$yesterdayTableName = 'staging.wmde_analytics_betafeature_users_yesterday';
 
-// Create temporary tables
-$sql = "CREATE TEMPORARY TABLE IF NOT EXISTS 
staging.wmde_analytics_betafeature_users";
+// Create temporary table
+$sql = "CREATE TEMPORARY TABLE IF NOT EXISTS $tempTableName";
 $sql .= "( user_name VARCHAR(255) NOT NULL, feature VARBINARY(255) NOT NULL, 
PRIMARY KEY (user_name, feature) )";
 $queryResult = $pdo->query( $sql );
 if ( $queryResult === false ) {
-   die( "Failed to create staging.wmde_analytics_betafeature_users" );
+   die( "Failed to create temp table $tempTableName" );
+}
+// Create yesterday table
+$sql = "CREATE TABLE IF NOT EXISTS $yesterdayTableName";
+$sql .= "( user_name VARCHAR(255) NOT NULL, feature VARBINARY(255) NOT NULL, 
PRIMARY KEY (user_name, feature) )";
+$queryResult = $pdo->query( $sql );
+if ( $queryResult === false ) {
+   die( "Failed to create table $yesterdayTableName" );
 }
 
+// Loop through all wiki databases
 foreach( $dbs as $dbname ) {
if( $dbname === 'labswiki' || $dbname === 'labtestwiki' ) {
continue;
@@ -62,9 +72,9 @@
}
}
 
-   // Record individuals
+   // Record individuals into the temp table
foreach( $currentFeatures as $feature ) {
-   $sql = "INSERT IGNORE INTO 
staging.wmde_analytics_betafeature_users ( user_name, feature )";
+   $sql = "INSERT IGNORE INTO $tempTableName ( user_name, feature 
)";
$sql .= " SELECT user_name, up_property FROM 
$dbname.user_properties";
$sql .= " JOIN $dbname.user ON up_user = user_id";
$sql .= " WHERE up_property = '$feature' AND up_value = '1'";
@@ -75,18 +85,20 @@
}
 }
 
+// Send total user_counts (1 global user can be counted more than once)
 foreach( $metrics as $featureName => $value ) {
if ( in_array( $featureName, $currentFeatures ) && $value > 0 ) {
WikimediaGraphite::sendNow( 
'daily.betafeatures.user_counts.totals.' . $featureName, $value );
}
 }
 
+// Select and send the global user counts (each global user is only counted 
once)
 $sql = "SELECT COUNT(*) AS count, feature";
-$sql .= " FROM staging.wmde_analytics_betafeature_users";
+$sql .= " FROM $tempTableName";
 $sql .= " GROUP BY feature";
 $queryResult = $pdo->query( $sql );
 if( $queryResult === false ) {
-   Output::timestampedMessage( "SELECT FROM 
staging.wmde_analytics_betafeature_users FAILED!!" );
+   Output::timestampedMessage( "SELECT FROM temp table $tempTableName 
FAILED!!" );
 } else {
foreach( $queryResult as $row ) {
if ( in_array( $row['feature'], $currentFeatures ) && 
$row['count'] > 0 ) {
@@ -96,4 +108,49 @@
);
}
}
-}
\ No newline at end of file
+}
+
+// Compare todays data with yesterdays data (if present)
+$queryResult = $pdo->query( "SELECT * FROM $yesterdayTableName LIMIT 1" );
+if ( $queryResult === false ) {
+   Output::timestampedMessage( "FAILED: $sql" );
+} else if( count( $queryResult->fetchAll() ) > 0 ) {
+   // Work out what has changed between days
+   // Emulated INTERSECT: http://stackoverflow.com/a/950505/4746236
+   $sql = "SELECT 'enables' AS state, today.* FROM $tempTableName AS 
today";
+   $sql .= " WHERE ROW(today.user_name, today.feature) NOT IN";
+   $sql .= " ( SELECT * FROM $yesterdayTableName )";
+   $sql .= " UNION ALL";
+   $sql .= " SELECT 'disables' AS state, yesterday.* FROM 
$yesterdayTableName AS yesterday";
+   $sql .= " WHERE ROW(yesterday.user_name, yesterday.feature) NOT IN";
+   $sql .= " ( SELECT * FROM $tempTableName )";
+   $sql = "SELECT state, COUNT(*) AS count, feature FROM ( $sql ) AS a 
GROUP BY state, feature";
+   $queryResult = $pdo->query( $sql );
+   if ( $queryResult 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid use of DB rollback() in LocalFileMoveBatch

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Avoid use of DB rollback() in LocalFileMoveBatch
..


Avoid use of DB rollback() in LocalFileMoveBatch

* Verify the DB updates and bail before doing anything instead
  of relying on rollback() if something does not match up.
* Do the file copying before updating the DB so that there is
  nothing to rollback if they fail.
* Improved failCount in case the current version is missing.
  It should also reflect all the missing old versions.

Change-Id: Ie2d316548d8e5584cc69bb9f1425db108b05be5c
---
M includes/filerepo/file/LocalFile.php
1 file changed, 63 insertions(+), 54 deletions(-)

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



diff --git a/includes/filerepo/file/LocalFile.php 
b/includes/filerepo/file/LocalFile.php
index e35af75..f91026f 100644
--- a/includes/filerepo/file/LocalFile.php
+++ b/includes/filerepo/file/LocalFile.php
@@ -1974,16 +1974,6 @@
}
 
/**
-* Roll back the DB transaction and mark the image unlocked
-*/
-   function unlockAndRollback() {
-   $this->locked = false;
-   $dbw = $this->repo->getMasterDB();
-   $dbw->rollback( __METHOD__ );
-   $this->lockedOwnTrx = false;
-   }
-
-   /**
 * @return Status
 */
protected function readOnlyFatalStatus() {
@@ -2858,33 +2848,30 @@
public function execute() {
$repo = $this->file->repo;
$status = $repo->newGood();
-
-   $triplets = $this->getMoveTriplets();
-   $checkStatus = $this->removeNonexistentFiles( $triplets );
-   if ( !$checkStatus->isGood() ) {
-   $status->merge( $checkStatus );
-   return $status;
-   }
-   $triplets = $checkStatus->value;
$destFile = wfLocalFile( $this->target );
 
$this->file->lock(); // begin
$destFile->lock(); // quickly fail if destination is not 
available
-   // Rename the file versions metadata in the DB.
-   // This implicitly locks the destination file, which avoids 
race conditions.
-   // If we moved the files from A -> C before DB updates, another 
process could
-   // move files from B -> C at this point, causing storeBatch() 
to fail and thus
-   // cleanupTarget() to trigger. It would delete the C files and 
cause data loss.
-   $statusDb = $this->doDBUpdates();
+
+   $triplets = $this->getMoveTriplets();
+   $checkStatus = $this->removeNonexistentFiles( $triplets );
+   if ( !$checkStatus->isGood() ) {
+   $destFile->unlock();
+   $this->file->unlock();
+   $status->merge( $checkStatus ); // couldn't talk to 
file backend
+   return $status;
+   }
+   $triplets = $checkStatus->value;
+
+   // Verify the file versions metadata in the DB.
+   $statusDb = $this->verifyDBUpdates();
if ( !$statusDb->isGood() ) {
$destFile->unlock();
-   $this->file->unlockAndRollback();
+   $this->file->unlock();
$statusDb->ok = false;
 
return $statusDb;
}
-   wfDebugLog( 'imagemove', "Renamed {$this->file->getName()} in 
database: " .
-   "{$statusDb->successCount} successes, 
{$statusDb->failCount} failures" );
 
if ( !$repo->hasSha1Storage() ) {
// Copy the files into their new location.
@@ -2897,7 +2884,7 @@
// Delete any files copied over (while the 
destination is still locked)
$this->cleanupTarget( $triplets );
$destFile->unlock();
-   $this->file->unlockAndRollback(); // unlocks 
the destination
+   $this->file->unlock();
wfDebugLog( 'imagemove', "Error in moving 
files: "
. $statusMove->getWikiText( false, 
false, 'en' ) );
$statusMove->ok = false;
@@ -2906,6 +2893,12 @@
}
$status->merge( $statusMove );
}
+
+   // Rename the file versions metadata in the DB.
+   $this->doDBUpdates();
+
+   wfDebugLog( 'imagemove', "Renamed {$this->file->getName()} in 
database: " .
+   "{$statusDb->successCount} successes, 
{$statusDb->failCount} failures" );
 
$destFile->unlock();

[MediaWiki-commits] [Gerrit] analytics...scripts[master]: Track global user enables & disables of beta features

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Track global user enables & disables of beta features
..


Track global user enables & disables of beta features

This tracks how many global users have enabled / disabled
a betafeature.

If a user has a feature enabled on a single wiki they are
counted as using the feature.
If they then enabled it on a second wiki, this will not count
as another enable.
Only if a user removes the feature from all wikis will it count
as a disable.

Bug: T140226
Change-Id: Ib3df65f4e28bf2ffa06e21f1d4f89f13f79c6582
---
M src/betafeatures/counts.php
1 file changed, 65 insertions(+), 8 deletions(-)

Approvals:
  Addshore: Checked; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/betafeatures/counts.php b/src/betafeatures/counts.php
index 5543c5b..ededba9 100755
--- a/src/betafeatures/counts.php
+++ b/src/betafeatures/counts.php
@@ -36,15 +36,25 @@
 $pdo = WikimediaDb::getPdo();
 
 $metrics = array();
+$tempTableName = 'staging.wmde_analytics_betafeature_users_temp';
+$yesterdayTableName = 'staging.wmde_analytics_betafeature_users_yesterday';
 
-// Create temporary tables
-$sql = "CREATE TEMPORARY TABLE IF NOT EXISTS 
staging.wmde_analytics_betafeature_users";
+// Create temporary table
+$sql = "CREATE TEMPORARY TABLE IF NOT EXISTS $tempTableName";
 $sql .= "( user_name VARCHAR(255) NOT NULL, feature VARBINARY(255) NOT NULL, 
PRIMARY KEY (user_name, feature) )";
 $queryResult = $pdo->query( $sql );
 if ( $queryResult === false ) {
-   die( "Failed to create staging.wmde_analytics_betafeature_users" );
+   die( "Failed to create temp table $tempTableName" );
+}
+// Create yesterday table
+$sql = "CREATE TABLE IF NOT EXISTS $yesterdayTableName";
+$sql .= "( user_name VARCHAR(255) NOT NULL, feature VARBINARY(255) NOT NULL, 
PRIMARY KEY (user_name, feature) )";
+$queryResult = $pdo->query( $sql );
+if ( $queryResult === false ) {
+   die( "Failed to create table $yesterdayTableName" );
 }
 
+// Loop through all wiki databases
 foreach( $dbs as $dbname ) {
if( $dbname === 'labswiki' || $dbname === 'labtestwiki' ) {
continue;
@@ -62,9 +72,9 @@
}
}
 
-   // Record individuals
+   // Record individuals into the temp table
foreach( $currentFeatures as $feature ) {
-   $sql = "INSERT IGNORE INTO 
staging.wmde_analytics_betafeature_users ( user_name, feature )";
+   $sql = "INSERT IGNORE INTO $tempTableName ( user_name, feature 
)";
$sql .= " SELECT user_name, up_property FROM 
$dbname.user_properties";
$sql .= " JOIN $dbname.user ON up_user = user_id";
$sql .= " WHERE up_property = '$feature' AND up_value = '1'";
@@ -75,18 +85,20 @@
}
 }
 
+// Send total user_counts (1 global user can be counted more than once)
 foreach( $metrics as $featureName => $value ) {
if ( in_array( $featureName, $currentFeatures ) && $value > 0 ) {
WikimediaGraphite::sendNow( 
'daily.betafeatures.user_counts.totals.' . $featureName, $value );
}
 }
 
+// Select and send the global user counts (each global user is only counted 
once)
 $sql = "SELECT COUNT(*) AS count, feature";
-$sql .= " FROM staging.wmde_analytics_betafeature_users";
+$sql .= " FROM $tempTableName";
 $sql .= " GROUP BY feature";
 $queryResult = $pdo->query( $sql );
 if( $queryResult === false ) {
-   Output::timestampedMessage( "SELECT FROM 
staging.wmde_analytics_betafeature_users FAILED!!" );
+   Output::timestampedMessage( "SELECT FROM temp table $tempTableName 
FAILED!!" );
 } else {
foreach( $queryResult as $row ) {
if ( in_array( $row['feature'], $currentFeatures ) && 
$row['count'] > 0 ) {
@@ -96,4 +108,49 @@
);
}
}
-}
\ No newline at end of file
+}
+
+// Compare todays data with yesterdays data (if present)
+$queryResult = $pdo->query( "SELECT * FROM $yesterdayTableName LIMIT 1" );
+if ( $queryResult === false ) {
+   Output::timestampedMessage( "FAILED: $sql" );
+} else if( count( $queryResult->fetchAll() ) > 0 ) {
+   // Work out what has changed between days
+   // Emulated INTERSECT: http://stackoverflow.com/a/950505/4746236
+   $sql = "SELECT 'enables' AS state, today.* FROM $tempTableName AS 
today";
+   $sql .= " WHERE ROW(today.user_name, today.feature) NOT IN";
+   $sql .= " ( SELECT * FROM $yesterdayTableName )";
+   $sql .= " UNION ALL";
+   $sql .= " SELECT 'disables' AS state, yesterday.* FROM 
$yesterdayTableName AS yesterday";
+   $sql .= " WHERE ROW(yesterday.user_name, yesterday.feature) NOT IN";
+   $sql .= " ( SELECT * FROM $tempTableName )";
+   $sql = "SELECT state, COUNT(*) AS count, feature FROM ( $sql ) AS a 
GROUP BY state, feature";
+   $queryResult = $pdo->query( $sql );
+   if ( $queryResult 

[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Follow-up 782bbdf: unbind beforeunload handler on save

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Follow-up 782bbdf: unbind beforeunload handler on save
..


Follow-up 782bbdf: unbind beforeunload handler on save

If we don't do this, the warning appears even after you've
saved your changes / posted your reply.

Bug: T96531
Change-Id: Ia27460877cb6a8481dee2d673f898640b37cfd2f
---
M modules/flow/ui/widgets/editor/mw.flow.ui.EditorWidget.js
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/modules/flow/ui/widgets/editor/mw.flow.ui.EditorWidget.js 
b/modules/flow/ui/widgets/editor/mw.flow.ui.EditorWidget.js
index f185f3e..112f3af 100644
--- a/modules/flow/ui/widgets/editor/mw.flow.ui.EditorWidget.js
+++ b/modules/flow/ui/widgets/editor/mw.flow.ui.EditorWidget.js
@@ -245,6 +245,7 @@
 * @fires saveContent
 */
mw.flow.ui.EditorWidget.prototype.onEditorControlsWidgetSave = function 
() {
+   this.unbindBeforeUnloadHandler();
this.emit(
'saveContent',

this.editorSwitcherWidget.getActiveEditor().getContent(),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia27460877cb6a8481dee2d673f898640b37cfd2f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Mooeypoo 
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[master]: Browser tests: update local url

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Browser tests: update local url
..


Browser tests: update local url

Change-Id: I9284acd37bfba51a53ddc1385eaad626e5592fa0
---
M tests/browser/environments.yml
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/tests/browser/environments.yml b/tests/browser/environments.yml
index 93bc02e..819341f 100644
--- a/tests/browser/environments.yml
+++ b/tests/browser/environments.yml
@@ -26,7 +26,7 @@
   mediawiki_user: Admin
   mediawiki_password: vagrant
   mediawiki_user_b: Selenium Echo user 2
-  mediawiki_url: http://127.0.0.1:8080/wiki/
+  mediawiki_url: http://dev.wiki.local.wmftest.net:8080/wiki/
 
 beta:
   mediawiki_url: http://en.wikipedia.beta.wmflabs.org/wiki/

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9284acd37bfba51a53ddc1385eaad626e5592fa0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Sbisson 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Mooeypoo 
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...TrustedXFF[master]: Support reading/writing data to/from a static PHP array

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Support reading/writing data to/from a static PHP array
..


Support reading/writing data to/from a static PHP array

If $wgTrustedXffFile ends with '.php', assume it is a PHP file that returns a
static associative array. This is to provide a nominal performance improvement
on HHVM, which caches the bytecode of PHP files, making relying on them more
efficient than hitting the disk for the cdb file each time.

Bug: T141120
Change-Id: Ia1976b91a897f7fd80f3ddf5a142d441ac0e88aa
---
M TrustedXFF.body.php
M generate.php
2 files changed, 46 insertions(+), 10 deletions(-)

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



diff --git a/TrustedXFF.body.php b/TrustedXFF.body.php
index 02031d8..245c3ff 100644
--- a/TrustedXFF.body.php
+++ b/TrustedXFF.body.php
@@ -34,10 +34,16 @@
}
 
function getCdbHandle() {
+   global $wgTrustedXffFile;
+
if ( !$this->cdb ) {
-   global $wgTrustedXffFile;
-   $this->cdb = CdbReader::open( $wgTrustedXffFile );
+   if ( pathinfo( $wgTrustedXffFile, PATHINFO_EXTENSION ) 
=== 'php' ) {
+   $this->cdb = new CdbReader\Hash( include( 
$wgTrustedXffFile ) );
+   } else {
+   $this->cdb = CdbReader::open( $wgTrustedXffFile 
);
+   }
}
+
return $this->cdb;
}
 
diff --git a/generate.php b/generate.php
index 778d691..dea93a3 100644
--- a/generate.php
+++ b/generate.php
@@ -10,6 +10,34 @@
 use Cdb\Exception as CdbException;
 use Cdb\Writer as CdbWriter;
 
+/**
+ * Emulates Cdb\Writer, but generates a PHP file that returns
+ * an associative array, instead.
+ */
+class StaticArrayWriter {
+   public function __construct( $filename ) {
+   $this->filename = $filename;
+   $this->data = [];
+   }
+
+   public static function open( $filename ) {
+   return new self( $filename );
+   }
+
+   public function set( $key, $value ) {
+   $this->data[ $key ] = $value;
+   }
+
+   public function close() {
+   $header = sprintf( "data, true ) 
. ";\n";
+   $code = preg_replace( '/(\d+ \=\>| (?=\())/i', '', $code );
+   $code = preg_replace( "/^ +/m", "\t", $code );
+   file_put_contents( $this->filename, $code );
+   }
+}
+
 $inFileName = 'trusted-hosts.txt';
 
 $inFile = fopen( $inFileName, 'r' );
@@ -19,7 +47,7 @@
 }
 
 if( isset( $args[0] ) ) {
-   $target = realpath( $args[0] );
+   $target = $args[0];
 } elseif( isset( $wgTrustedXffFile ) ) {
$target = $wgTrustedXffFile;
 } else {
@@ -27,7 +55,9 @@
exit( 1 );
 }
 try {
-   $outFile = CdbWriter::open( $target );
+   $outFile = pathinfo( $target, PATHINFO_EXTENSION ) === 'php'
+   ? StaticArrayWriter::open( $target )
+   : CdbWriter::open( $target );
 } catch ( CdbException $e ) {
echo "Unable to open output file \"$target\"\n";
exit( 1 );
@@ -51,12 +81,12 @@
}
// Strip spaces
$line = trim( $line );
-   
+
if ( $line == '' ) {
// Comment or blank line
continue;
}
-   
+
list( $start, $end ) = IP::parseRange( $line );
if ( $start === false ) {
// Try DNS
@@ -90,7 +120,7 @@
 
if ( $start === $end ) {
// Single host
-   $outFile->set( $start, '1' );
+   $outFile->set( $start, true );
$numHosts++;
showProgress( $i, count( $ranges ) );
continue;
@@ -123,7 +153,7 @@
for ( $j = $startNum; $j <= $endNum; $j++ ) {
$hex = strtoupper( base_convert( $j, 10, 16 ) );
$hex = str_pad( $hex, $suffixLength, '0', STR_PAD_LEFT );
-   $outFile->set( $prefix . $hex, '1' );
+   $outFile->set( $prefix . $hex, true );
$numHosts++;
}
showProgress( $i, count( $ranges ) );
@@ -138,8 +168,8 @@
 function showProgress( $current, $total ) {
$length = 50;
$dots = intval( ( $current + 1) / $total * $length );
-   printf( "%6.2f%%  [" . 
-   str_repeat( '=', $dots ) . str_repeat( '.', $length - $dots ) . 
"]\r", 
+   printf( "%6.2f%%  [" .
+   str_repeat( '=', $dots ) . str_repeat( '.', $length - $dots ) . 
"]\r",
( $current + 1) / $total * 100 );
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia1976b91a897f7fd80f3ddf5a142d441ac0e88aa
Gerrit-PatchSet: 4
Gerrit-Project: 

[MediaWiki-commits] [Gerrit] mediawiki...HSTS[master]: Remove use of AutoLoader::loadClass()

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove use of AutoLoader::loadClass()
..


Remove use of AutoLoader::loadClass()

That function is to be removed in Ia6482cce. Regardless, the intent
likely was to check if the BetaFeatures class exists rather than to
simply load the class.

Though in general the current, preferred way to detect an extension
is to use ExtensionRegistry::isLoaded(), class_exists() seems to be
the established way to detect BetaFeatures.

Change-Id: If9ff5b8a2a98285ef9d445483cb0d82f31f2dbf3
---
M HSTS.hooks.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/HSTS.hooks.php b/HSTS.hooks.php
index 3fbb268..96e2093 100644
--- a/HSTS.hooks.php
+++ b/HSTS.hooks.php
@@ -13,7 +13,7 @@
global $wgHSTSBetaFeature, $wgHSTSForUsers;
 
// If HSTS is activated as a Beta Feature, do not add it here
-   if( AutoLoader::loadClass( 'BetaFeatures' ) && 
$wgHSTSBetaFeature ) {
+   if( $wgHSTSBetaFeature && class_exists( 'BetaFeatures' ) ) {
return true;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If9ff5b8a2a98285ef9d445483cb0d82f31f2dbf3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/HSTS
Gerrit-Branch: master
Gerrit-Owner: PleaseStand 
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]: registration: Fix "config" schema validation

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: registration: Fix "config" schema validation
..


registration: Fix "config" schema validation

The "properties" field is only interpreted if the value is an object,
which was not being required. Add that missing type in, so
manifest_version 1 type config entries should fail.

Bug: T141289
Change-Id: Iffb084eb7a81a398a74370a1f9561198a88f5779
---
M docs/extension.schema.json
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/docs/extension.schema.json b/docs/extension.schema.json
index 9c8160d..f2406c8 100644
--- a/docs/extension.schema.json
+++ b/docs/extension.schema.json
@@ -867,6 +867,7 @@
"description": "Configuration options for this 
extension",
"patternProperties": {

"^[a-zA-Z_\u007f-\u00ff][a-zA-Z0-9_\u007f-\u00ff]*$": {
+   "type": "object",
"properties": {
"value": {
"required": true

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iffb084eb7a81a398a74370a1f9561198a88f5779
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
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] analytics...scripts[production]: Track global user enables & disables of beta features

2016-07-25 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Track global user enables & disables of beta features
..

Track global user enables & disables of beta features

This tracks how many global users have enabled / disabled
a betafeature.

If a user has a feature enabled on a single wiki they are
counted as using the feature.
If they then enabled it on a second wiki, this will not count
as another enable.
Only if a user removes the feature from all wikis will it count
as a disable.

Bug: T140226
Change-Id: Ib3df65f4e28bf2ffa06e21f1d4f89f13f79c6582
---
M src/betafeatures/counts.php
1 file changed, 65 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wmde/scripts 
refs/changes/18/301018/1

diff --git a/src/betafeatures/counts.php b/src/betafeatures/counts.php
index 5543c5b..ededba9 100755
--- a/src/betafeatures/counts.php
+++ b/src/betafeatures/counts.php
@@ -36,15 +36,25 @@
 $pdo = WikimediaDb::getPdo();
 
 $metrics = array();
+$tempTableName = 'staging.wmde_analytics_betafeature_users_temp';
+$yesterdayTableName = 'staging.wmde_analytics_betafeature_users_yesterday';
 
-// Create temporary tables
-$sql = "CREATE TEMPORARY TABLE IF NOT EXISTS 
staging.wmde_analytics_betafeature_users";
+// Create temporary table
+$sql = "CREATE TEMPORARY TABLE IF NOT EXISTS $tempTableName";
 $sql .= "( user_name VARCHAR(255) NOT NULL, feature VARBINARY(255) NOT NULL, 
PRIMARY KEY (user_name, feature) )";
 $queryResult = $pdo->query( $sql );
 if ( $queryResult === false ) {
-   die( "Failed to create staging.wmde_analytics_betafeature_users" );
+   die( "Failed to create temp table $tempTableName" );
+}
+// Create yesterday table
+$sql = "CREATE TABLE IF NOT EXISTS $yesterdayTableName";
+$sql .= "( user_name VARCHAR(255) NOT NULL, feature VARBINARY(255) NOT NULL, 
PRIMARY KEY (user_name, feature) )";
+$queryResult = $pdo->query( $sql );
+if ( $queryResult === false ) {
+   die( "Failed to create table $yesterdayTableName" );
 }
 
+// Loop through all wiki databases
 foreach( $dbs as $dbname ) {
if( $dbname === 'labswiki' || $dbname === 'labtestwiki' ) {
continue;
@@ -62,9 +72,9 @@
}
}
 
-   // Record individuals
+   // Record individuals into the temp table
foreach( $currentFeatures as $feature ) {
-   $sql = "INSERT IGNORE INTO 
staging.wmde_analytics_betafeature_users ( user_name, feature )";
+   $sql = "INSERT IGNORE INTO $tempTableName ( user_name, feature 
)";
$sql .= " SELECT user_name, up_property FROM 
$dbname.user_properties";
$sql .= " JOIN $dbname.user ON up_user = user_id";
$sql .= " WHERE up_property = '$feature' AND up_value = '1'";
@@ -75,18 +85,20 @@
}
 }
 
+// Send total user_counts (1 global user can be counted more than once)
 foreach( $metrics as $featureName => $value ) {
if ( in_array( $featureName, $currentFeatures ) && $value > 0 ) {
WikimediaGraphite::sendNow( 
'daily.betafeatures.user_counts.totals.' . $featureName, $value );
}
 }
 
+// Select and send the global user counts (each global user is only counted 
once)
 $sql = "SELECT COUNT(*) AS count, feature";
-$sql .= " FROM staging.wmde_analytics_betafeature_users";
+$sql .= " FROM $tempTableName";
 $sql .= " GROUP BY feature";
 $queryResult = $pdo->query( $sql );
 if( $queryResult === false ) {
-   Output::timestampedMessage( "SELECT FROM 
staging.wmde_analytics_betafeature_users FAILED!!" );
+   Output::timestampedMessage( "SELECT FROM temp table $tempTableName 
FAILED!!" );
 } else {
foreach( $queryResult as $row ) {
if ( in_array( $row['feature'], $currentFeatures ) && 
$row['count'] > 0 ) {
@@ -96,4 +108,49 @@
);
}
}
-}
\ No newline at end of file
+}
+
+// Compare todays data with yesterdays data (if present)
+$queryResult = $pdo->query( "SELECT * FROM $yesterdayTableName LIMIT 1" );
+if ( $queryResult === false ) {
+   Output::timestampedMessage( "FAILED: $sql" );
+} else if( count( $queryResult->fetchAll() ) > 0 ) {
+   // Work out what has changed between days
+   // Emulated INTERSECT: http://stackoverflow.com/a/950505/4746236
+   $sql = "SELECT 'enables' AS state, today.* FROM $tempTableName AS 
today";
+   $sql .= " WHERE ROW(today.user_name, today.feature) NOT IN";
+   $sql .= " ( SELECT * FROM $yesterdayTableName )";
+   $sql .= " UNION ALL";
+   $sql .= " SELECT 'disables' AS state, yesterday.* FROM 
$yesterdayTableName AS yesterday";
+   $sql .= " WHERE ROW(yesterday.user_name, yesterday.feature) NOT IN";
+   $sql .= " ( SELECT * FROM $tempTableName )";
+   $sql = "SELECT state, COUNT(*) AS count, feature FROM ( $sql ) AS a 
GROUP BY state, feature";
+   $queryResult = 

[MediaWiki-commits] [Gerrit] mediawiki...TrustedXFF[master]: IPv6 addresses are in TrustedXFF.body.php

2016-07-25 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

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

Change subject: IPv6 addresses are in TrustedXFF.body.php
..

IPv6 addresses are in TrustedXFF.body.php

Change-Id: I39c10f793ee12719455f32814846f9823cba4f34
---
M trusted-hosts.txt
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TrustedXFF 
refs/changes/19/301019/1

diff --git a/trusted-hosts.txt b/trusted-hosts.txt
index f91440e..3e704e2 100644
--- a/trusted-hosts.txt
+++ b/trusted-hosts.txt
@@ -4,8 +4,7 @@
 # http://meta.wikimedia.org/wiki/XFF_project
 #
 # Note: IPv6 ranges cannot currently be listed in this file. They are 
-# listed in TrustedXFF.php instead.
-
+# listed in TrustedXFF.body.php instead.
 
 # AOL
 # Source: http://webmaster.info.aol.com/proxyinfo.html

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I39c10f793ee12719455f32814846f9823cba4f34
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TrustedXFF
Gerrit-Branch: master
Gerrit-Owner: Reedy 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Run createTxtFileSymlinks.sh update tracked dblists

2016-07-25 Thread Reedy (Code Review)
Reedy has submitted this change and it was merged.

Change subject: Run createTxtFileSymlinks.sh update tracked dblists
..


Run createTxtFileSymlinks.sh update tracked dblists

Change-Id: Ib449f2569b643098f03bb90fcab234cc31c386ce
---
D docroot/noc/conf/arbitraryaccess.dblist
A docroot/noc/conf/clldefault.dblist
A docroot/noc/conf/echo.dblist
A docroot/noc/conf/group2.dblist
A docroot/noc/conf/mobilemainpagelegacy.dblist
A docroot/noc/conf/nonecho.dblist
D docroot/noc/conf/visualeditor-default.dblist
A docroot/noc/conf/visualeditor-nondefault.dblist
A docroot/noc/conf/wikidatadescriptions.dblist
9 files changed, 7 insertions(+), 2 deletions(-)

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



diff --git a/docroot/noc/conf/arbitraryaccess.dblist 
b/docroot/noc/conf/arbitraryaccess.dblist
deleted file mode 12
index 5f4d687..000
--- a/docroot/noc/conf/arbitraryaccess.dblist
+++ /dev/null
@@ -1 +0,0 @@
-../../../dblists/arbitraryaccess.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/clldefault.dblist 
b/docroot/noc/conf/clldefault.dblist
new file mode 12
index 000..f9fbe3f
--- /dev/null
+++ b/docroot/noc/conf/clldefault.dblist
@@ -0,0 +1 @@
+../../../dblists/clldefault.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/echo.dblist b/docroot/noc/conf/echo.dblist
new file mode 12
index 000..f977c93
--- /dev/null
+++ b/docroot/noc/conf/echo.dblist
@@ -0,0 +1 @@
+../../../dblists/echo.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/group2.dblist b/docroot/noc/conf/group2.dblist
new file mode 12
index 000..d5ff2c0
--- /dev/null
+++ b/docroot/noc/conf/group2.dblist
@@ -0,0 +1 @@
+../../../dblists/group2.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/mobilemainpagelegacy.dblist 
b/docroot/noc/conf/mobilemainpagelegacy.dblist
new file mode 12
index 000..1ba9ea0
--- /dev/null
+++ b/docroot/noc/conf/mobilemainpagelegacy.dblist
@@ -0,0 +1 @@
+../../../dblists/mobilemainpagelegacy.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/nonecho.dblist b/docroot/noc/conf/nonecho.dblist
new file mode 12
index 000..2e533d9
--- /dev/null
+++ b/docroot/noc/conf/nonecho.dblist
@@ -0,0 +1 @@
+../../../dblists/nonecho.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/visualeditor-default.dblist 
b/docroot/noc/conf/visualeditor-default.dblist
deleted file mode 12
index 336efbb..000
--- a/docroot/noc/conf/visualeditor-default.dblist
+++ /dev/null
@@ -1 +0,0 @@
-../../../dblists/visualeditor-default.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/visualeditor-nondefault.dblist 
b/docroot/noc/conf/visualeditor-nondefault.dblist
new file mode 12
index 000..27e74f0
--- /dev/null
+++ b/docroot/noc/conf/visualeditor-nondefault.dblist
@@ -0,0 +1 @@
+../../../dblists/visualeditor-nondefault.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/wikidatadescriptions.dblist 
b/docroot/noc/conf/wikidatadescriptions.dblist
new file mode 12
index 000..5d1b806
--- /dev/null
+++ b/docroot/noc/conf/wikidatadescriptions.dblist
@@ -0,0 +1 @@
+../../../dblists/wikidatadescriptions.dblist
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib449f2569b643098f03bb90fcab234cc31c386ce
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Reedy 
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]: registration: Fix "config" schema validation

2016-07-25 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: registration: Fix "config" schema validation
..

registration: Fix "config" schema validation

The "properties" field is only interpreted if the value is an object,
which was not being required. Add that missing type in, so
manifest_version 1 type config entries should fail.

Bug: T141289
Change-Id: Iffb084eb7a81a398a74370a1f9561198a88f5779
---
M docs/extension.schema.json
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/17/301017/1

diff --git a/docs/extension.schema.json b/docs/extension.schema.json
index 9c8160d..f2406c8 100644
--- a/docs/extension.schema.json
+++ b/docs/extension.schema.json
@@ -867,6 +867,7 @@
"description": "Configuration options for this 
extension",
"patternProperties": {

"^[a-zA-Z_\u007f-\u00ff][a-zA-Z0-9_\u007f-\u00ff]*$": {
+   "type": "object",
"properties": {
"value": {
"required": true

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iffb084eb7a81a398a74370a1f9561198a88f5779
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
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]: Swap to using static php array for TrustedXFF usage

2016-07-25 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

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

Change subject: Swap to using static php array for TrustedXFF usage
..

Swap to using static php array for TrustedXFF usage

Bug: T141120
Change-Id: Ic929fab4f50919c9d37aebd58f84e88942247909
---
M docroot/noc/createTxtFileSymlinks.sh
M wmf-config/CommonSettings.php
D wmf-config/trusted-xff.cdb
A wmf-config/trusted-xff.php
4 files changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/docroot/noc/createTxtFileSymlinks.sh 
b/docroot/noc/createTxtFileSymlinks.sh
index 30891a0..d5effc0 100755
--- a/docroot/noc/createTxtFileSymlinks.sh
+++ b/docroot/noc/createTxtFileSymlinks.sh
@@ -38,6 +38,7 @@
proofreadpage.php
redis.php
throttle.php
+   trusted-xff.php
wgConf.php
squid.php
squid-labs.php
@@ -60,7 +61,6 @@
wmf-config/extension-list
wmf-config/extension-list-labs
wmf-config/extension-list-wikitech
-   wmf-config/trusted-xff.cdb
 )
 
 for i in ./*
diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index ad7a38f..8204bb9 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -963,7 +963,7 @@
 }
 
 include( $IP . '/extensions/TrustedXFF/TrustedXFF.php' );
-$wgTrustedXffFile = "$wmfConfigDir/trusted-xff.cdb";
+$wgTrustedXffFile = "$wmfConfigDir/trusted-xff.php";
 
 if ( $wmgUseContactPage ) {
include( $IP . '/extensions/ContactPage/ContactPage.php' );
diff --git a/wmf-config/trusted-xff.cdb b/wmf-config/trusted-xff.cdb
deleted file mode 100644
index d34f93d..000
--- a/wmf-config/trusted-xff.cdb
+++ /dev/null
Binary files differ
diff --git a/wmf-config/trusted-xff.php b/wmf-config/trusted-xff.php
new file mode 100644
index 000..4523584
--- /dev/null
+++ b/wmf-config/trusted-xff.php
Binary files differ

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Run createTxtFileSymlinks.sh update tracked dblists

2016-07-25 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

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

Change subject: Run createTxtFileSymlinks.sh update tracked dblists
..

Run createTxtFileSymlinks.sh update tracked dblists

Change-Id: Ib449f2569b643098f03bb90fcab234cc31c386ce
---
D docroot/noc/conf/arbitraryaccess.dblist
A docroot/noc/conf/clldefault.dblist
A docroot/noc/conf/echo.dblist
A docroot/noc/conf/group2.dblist
A docroot/noc/conf/mobilemainpagelegacy.dblist
A docroot/noc/conf/nonecho.dblist
D docroot/noc/conf/visualeditor-default.dblist
A docroot/noc/conf/visualeditor-nondefault.dblist
A docroot/noc/conf/wikidatadescriptions.dblist
9 files changed, 7 insertions(+), 2 deletions(-)


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

diff --git a/docroot/noc/conf/arbitraryaccess.dblist 
b/docroot/noc/conf/arbitraryaccess.dblist
deleted file mode 12
index 5f4d687..000
--- a/docroot/noc/conf/arbitraryaccess.dblist
+++ /dev/null
@@ -1 +0,0 @@
-../../../dblists/arbitraryaccess.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/clldefault.dblist 
b/docroot/noc/conf/clldefault.dblist
new file mode 12
index 000..f9fbe3f
--- /dev/null
+++ b/docroot/noc/conf/clldefault.dblist
@@ -0,0 +1 @@
+../../../dblists/clldefault.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/echo.dblist b/docroot/noc/conf/echo.dblist
new file mode 12
index 000..f977c93
--- /dev/null
+++ b/docroot/noc/conf/echo.dblist
@@ -0,0 +1 @@
+../../../dblists/echo.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/group2.dblist b/docroot/noc/conf/group2.dblist
new file mode 12
index 000..d5ff2c0
--- /dev/null
+++ b/docroot/noc/conf/group2.dblist
@@ -0,0 +1 @@
+../../../dblists/group2.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/mobilemainpagelegacy.dblist 
b/docroot/noc/conf/mobilemainpagelegacy.dblist
new file mode 12
index 000..1ba9ea0
--- /dev/null
+++ b/docroot/noc/conf/mobilemainpagelegacy.dblist
@@ -0,0 +1 @@
+../../../dblists/mobilemainpagelegacy.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/nonecho.dblist b/docroot/noc/conf/nonecho.dblist
new file mode 12
index 000..2e533d9
--- /dev/null
+++ b/docroot/noc/conf/nonecho.dblist
@@ -0,0 +1 @@
+../../../dblists/nonecho.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/visualeditor-default.dblist 
b/docroot/noc/conf/visualeditor-default.dblist
deleted file mode 12
index 336efbb..000
--- a/docroot/noc/conf/visualeditor-default.dblist
+++ /dev/null
@@ -1 +0,0 @@
-../../../dblists/visualeditor-default.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/visualeditor-nondefault.dblist 
b/docroot/noc/conf/visualeditor-nondefault.dblist
new file mode 12
index 000..27e74f0
--- /dev/null
+++ b/docroot/noc/conf/visualeditor-nondefault.dblist
@@ -0,0 +1 @@
+../../../dblists/visualeditor-nondefault.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/wikidatadescriptions.dblist 
b/docroot/noc/conf/wikidatadescriptions.dblist
new file mode 12
index 000..5d1b806
--- /dev/null
+++ b/docroot/noc/conf/wikidatadescriptions.dblist
@@ -0,0 +1 @@
+../../../dblists/wikidatadescriptions.dblist
\ No newline at end of file

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

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

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


[MediaWiki-commits] [Gerrit] operations...tools-webservice[master]: python: Load python and python3 plugins

2016-07-25 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: python: Load python and python3 plugins
..

python: Load python and python3 plugins

Otherwise in python3 mode it tries to load the python plugin,
fails and gives up.

Change-Id: I22e514af877f818be9b0eb7327520c7817e6cec5
---
M toollabs/webservice/services/pythonwebservice.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/operations/software/tools-webservice 
refs/changes/14/301014/1

diff --git a/toollabs/webservice/services/pythonwebservice.py 
b/toollabs/webservice/services/pythonwebservice.py
index b0ac08e..eadaf9e 100644
--- a/toollabs/webservice/services/pythonwebservice.py
+++ b/toollabs/webservice/services/pythonwebservice.py
@@ -18,7 +18,7 @@
 super(PythonWebService, self).run(port)
 args = [
 '/usr/bin/uwsgi',
-'--plugin', 'python',
+'--plugin', 'python,python3', # Will ignore ones that don't load
 '--http-socket', ':' + str(port),
 '--chdir', self.tool.get_homedir_subpath('www/python/src'),
 '--logto', self.tool.get_homedir_subpath('uwsgi.log'),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I22e514af877f818be9b0eb7327520c7817e6cec5
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/tools-webservice
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda 

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


[MediaWiki-commits] [Gerrit] mediawiki...vendor[master]: Dependencies += SmashPig

2016-07-25 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: Dependencies += SmashPig
..

Dependencies += SmashPig

Change-Id: I43809a0bbcf266832e32bab72c73b7e7015925fb
---
M coderkungfu/php-queue/src/PHPQueue/Interfaces/AtomicReadBuffer.php
M coderkungfu/php-queue/test/PHPQueue/Backend/PDOBaseTest.php
D coderkungfu/php-queue/test/PHPQueue/Backend/PDOTest.php
M composer/autoload_classmap.php
M composer/autoload_files.php
M composer/autoload_psr4.php
M composer/autoload_static.php
M composer/installed.json
A composer/installers/.editorconfig
A composer/installers/.gitignore
A composer/installers/.travis.yml
A composer/installers/LICENSE
A composer/installers/README.md
A composer/installers/composer.json
A composer/installers/phpunit.xml.dist
A composer/installers/src/Composer/Installers/AglInstaller.php
A composer/installers/src/Composer/Installers/AimeosInstaller.php
A composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php
A composer/installers/src/Composer/Installers/AsgardInstaller.php
A composer/installers/src/Composer/Installers/BaseInstaller.php
A composer/installers/src/Composer/Installers/BitrixInstaller.php
A composer/installers/src/Composer/Installers/BonefishInstaller.php
A composer/installers/src/Composer/Installers/CakePHPInstaller.php
A composer/installers/src/Composer/Installers/ChefInstaller.php
A composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php
A composer/installers/src/Composer/Installers/CodeIgniterInstaller.php
A composer/installers/src/Composer/Installers/Concrete5Installer.php
A composer/installers/src/Composer/Installers/CraftInstaller.php
A composer/installers/src/Composer/Installers/CroogoInstaller.php
A composer/installers/src/Composer/Installers/DecibelInstaller.php
A composer/installers/src/Composer/Installers/DokuWikiInstaller.php
A composer/installers/src/Composer/Installers/DolibarrInstaller.php
A composer/installers/src/Composer/Installers/DrupalInstaller.php
A composer/installers/src/Composer/Installers/ElggInstaller.php
A composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php
A composer/installers/src/Composer/Installers/FuelInstaller.php
A composer/installers/src/Composer/Installers/FuelphpInstaller.php
A composer/installers/src/Composer/Installers/GravInstaller.php
A composer/installers/src/Composer/Installers/HuradInstaller.php
A composer/installers/src/Composer/Installers/ImageCMSInstaller.php
A composer/installers/src/Composer/Installers/Installer.php
A composer/installers/src/Composer/Installers/JoomlaInstaller.php
A composer/installers/src/Composer/Installers/KirbyInstaller.php
A composer/installers/src/Composer/Installers/KodiCMSInstaller.php
A composer/installers/src/Composer/Installers/KohanaInstaller.php
A composer/installers/src/Composer/Installers/LaravelInstaller.php
A composer/installers/src/Composer/Installers/LithiumInstaller.php
A composer/installers/src/Composer/Installers/MODULEWorkInstaller.php
A composer/installers/src/Composer/Installers/MODXEvoInstaller.php
A composer/installers/src/Composer/Installers/MagentoInstaller.php
A composer/installers/src/Composer/Installers/MakoInstaller.php
A composer/installers/src/Composer/Installers/MauticInstaller.php
A composer/installers/src/Composer/Installers/MediaWikiInstaller.php
A composer/installers/src/Composer/Installers/MicroweberInstaller.php
A composer/installers/src/Composer/Installers/MoodleInstaller.php
A composer/installers/src/Composer/Installers/OctoberInstaller.php
A composer/installers/src/Composer/Installers/OxidInstaller.php
A composer/installers/src/Composer/Installers/PPIInstaller.php
A composer/installers/src/Composer/Installers/PhiftyInstaller.php
A composer/installers/src/Composer/Installers/PhpBBInstaller.php
A composer/installers/src/Composer/Installers/PimcoreInstaller.php
A composer/installers/src/Composer/Installers/PiwikInstaller.php
A composer/installers/src/Composer/Installers/Plugin.php
A composer/installers/src/Composer/Installers/PrestashopInstaller.php
A composer/installers/src/Composer/Installers/PuppetInstaller.php
A composer/installers/src/Composer/Installers/RadPHPInstaller.php
A composer/installers/src/Composer/Installers/RedaxoInstaller.php
A composer/installers/src/Composer/Installers/RoundcubeInstaller.php
A composer/installers/src/Composer/Installers/SMFInstaller.php
A composer/installers/src/Composer/Installers/ShopwareInstaller.php
A composer/installers/src/Composer/Installers/SilverStripeInstaller.php
A composer/installers/src/Composer/Installers/Symfony1Installer.php
A composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php
A composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php
A composer/installers/src/Composer/Installers/TheliaInstaller.php
A composer/installers/src/Composer/Installers/TuskInstaller.php
A composer/installers/src/Composer/Installers/WHMCSInstaller.php
A 

[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Install service-runner with --no-optional

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Install service-runner with --no-optional
..


Install service-runner with --no-optional

 * Let's not checkin dtrace-provider in the deploy repo

Change-Id: I9c34f9b148a2bbe51da12a00203e1c6a3c332465
---
M npm-shrinkwrap.json
1 file changed, 1 insertion(+), 101 deletions(-)

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



diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index f72fe55..d7c4eee 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -4084,107 +4084,7 @@
 },
 "bunyan": {
   "version": "1.8.1",
-  "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.1.tgz;,
-  "dependencies": {
-"dtrace-provider": {
-  "version": "0.6.0",
-  "resolved": 
"https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.6.0.tgz;,
-  "dependencies": {
-"nan": {
-  "version": "2.4.0",
-  "resolved": "https://registry.npmjs.org/nan/-/nan-2.4.0.tgz;
-}
-  }
-},
-"moment": {
-  "version": "2.14.1",
-  "resolved": 
"https://registry.npmjs.org/moment/-/moment-2.14.1.tgz;
-},
-"mv": {
-  "version": "2.1.1",
-  "resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz;,
-  "dependencies": {
-"mkdirp": {
-  "version": "0.5.1",
-  "resolved": 
"https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz;,
-  "dependencies": {
-"minimist": {
-  "version": "0.0.8",
-  "resolved": 
"https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz;
-}
-  }
-},
-"ncp": {
-  "version": "2.0.0",
-  "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz;
-},
-"rimraf": {
-  "version": "2.4.5",
-  "resolved": 
"https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz;,
-  "dependencies": {
-"glob": {
-  "version": "6.0.4",
-  "resolved": 
"https://registry.npmjs.org/glob/-/glob-6.0.4.tgz;,
-  "dependencies": {
-"inflight": {
-  "version": "1.0.5",
-  "resolved": 
"https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz;,
-  "dependencies": {
-"wrappy": {
-  "version": "1.0.2",
-  "resolved": 
"https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz;
-}
-  }
-},
-"inherits": {
-  "version": "2.0.1",
-  "resolved": 
"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz;
-},
-"minimatch": {
-  "version": "3.0.2",
-  "resolved": 
"https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz;,
-  "dependencies": {
-"brace-expansion": {
-  "version": "1.1.6",
-  "resolved": 
"https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz;,
-  "dependencies": {
-"balanced-match": {
-  "version": "0.4.2",
-  "resolved": 
"https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz;
-},
-"concat-map": {
-  "version": "0.0.1",
-  "resolved": 
"https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz;
-}
-  }
-}
-  }
-},
-"once": {
-  "version": "1.3.3",
-  "resolved": 
"https://registry.npmjs.org/once/-/once-1.3.3.tgz;,
-  "dependencies": {
-"wrappy": {
-  "version": "1.0.2",
-  "resolved": 
"https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz;
-}
-  }
-},
-"path-is-absolute": {
-  "version": "1.0.0",
-

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Bump versionCode

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Bump versionCode
..


Bump versionCode

Change-Id: I1436215c12816235fa8407db0c0b13f2357fdd63
---
M app/build.gradle
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/app/build.gradle b/app/build.gradle
index f11ed2f..5d8ad5b 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -55,7 +55,7 @@
 applicationId 'org.wikipedia'
 minSdkVersion 15
 targetSdkVersion 23
-versionCode 149
+versionCode 150
 testApplicationId 'org.wikipedia.test'
 testInstrumentationRunner 
'android.support.test.runner.AndroidJUnitRunner'
 vectorDrawables.useSupportLibrary = true

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1436215c12816235fa8407db0c0b13f2357fdd63
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: Niedzielski 
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]: Bump versionCode

2016-07-25 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

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

Change subject: Bump versionCode
..

Bump versionCode

Change-Id: I1436215c12816235fa8407db0c0b13f2357fdd63
---
M app/build.gradle
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/app/build.gradle b/app/build.gradle
index f11ed2f..5d8ad5b 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -55,7 +55,7 @@
 applicationId 'org.wikipedia'
 minSdkVersion 15
 targetSdkVersion 23
-versionCode 149
+versionCode 150
 testApplicationId 'org.wikipedia.test'
 testInstrumentationRunner 
'android.support.test.runner.AndroidJUnitRunner'
 vectorDrawables.useSupportLibrary = true

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1436215c12816235fa8407db0c0b13f2357fdd63
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Revert stylized wordmark at top of feed.

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Revert stylized wordmark at top of feed.
..


Revert stylized wordmark at top of feed.

Change-Id: Idbf08ada63f46d8dccbbcab91ffa646f7e223ec2
---
M app/src/main/java/org/wikipedia/feed/FeedFragment.java
A app/src/main/res/drawable/feed_header_wordmark.xml
M app/src/main/res/layout/fragment_feed.xml
3 files changed, 238 insertions(+), 27 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/feed/FeedFragment.java 
b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
index e09d6e4..b56c350 100644
--- a/app/src/main/java/org/wikipedia/feed/FeedFragment.java
+++ b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
@@ -10,14 +10,12 @@
 import android.support.v4.app.Fragment;
 import android.support.v4.widget.SwipeRefreshLayout;
 import android.support.v7.widget.Toolbar;
-import android.text.Html;
 import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
-import android.widget.TextView;
 
 import org.wikipedia.BackPressedHandler;
 import org.wikipedia.MainActivityToolbarProvider;
@@ -50,7 +48,6 @@
 @BindView(R.id.feed_swipe_refresh_layout) SwipeRefreshLayout 
swipeRefreshLayout;
 @BindView(R.id.fragment_feed_feed) FeedView feedView;
 @BindView(R.id.feed_toolbar) Toolbar toolbar;
-@BindView(R.id.feed_header_text) TextView headerText;
 private Unbinder unbinder;
 private WikipediaApp app;
 private FeedCoordinator coordinator;
@@ -92,7 +89,6 @@
 View view = inflater.inflate(R.layout.fragment_feed, container, false);
 
 unbinder = ButterKnife.bind(this, view);
-headerText.setText(Html.fromHtml(getString(R.string.wp_stylized)));
 feedView.set(coordinator, feedCallback);
 appBarLayout.addOnOffsetChangedListener(headerOffsetChangedListener);
 searchIconShowThresholdPx = (int) 
getResources().getDimension(R.dimen.view_feed_header_height) - 
DimenUtil.getContentTopOffsetPx(getContext());
diff --git a/app/src/main/res/drawable/feed_header_wordmark.xml 
b/app/src/main/res/drawable/feed_header_wordmark.xml
new file mode 100644
index 000..5bd52a2
--- /dev/null
+++ b/app/src/main/res/drawable/feed_header_wordmark.xml
@@ -0,0 +1,232 @@
+
+http://schemas.android.com/apk/res/android;
+android:width="200dp"
+android:height="48dp"
+android:viewportWidth="200"
+android:viewportHeight="48">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_feed.xml 
b/app/src/main/res/layout/fragment_feed.xml
index 5823dba..64db77a 100644
--- a/app/src/main/res/layout/fragment_feed.xml
+++ b/app/src/main/res/layout/fragment_feed.xml
@@ -30,33 +30,16 @@
 app:statusBarScrim="@color/status_bar_background"
 app:titleEnabled="false">
 
-
-
-
-
-
-
-
+android:contentDescription="@null"
+app:srcCompat="@drawable/feed_header_wordmark"
+app:layout_collapseMode="parallax"
+/>
 
 https://gerrit.wikimedia.org/r/300999
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idbf08ada63f46d8dccbbcab91ffa646f7e223ec2
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Niedzielski 
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]: Update gerrit css to use the new defined css in gerrit 2.12

2016-07-25 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Update gerrit css to use the new defined css in gerrit 2.12
..

Update gerrit css to use the new defined css in gerrit 2.12

A lot of changes have happen since gerrit 2.8, which means that the css has 
changed and due an update.

Bug: T141286
Change-Id: I053ba9898c38b15de216b81e124fe5c8cfa2f31f
---
M modules/gerrit/files/etc/GerritSite.css
1 file changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/01/301001/2

diff --git a/modules/gerrit/files/etc/GerritSite.css 
b/modules/gerrit/files/etc/GerritSite.css
index 0d9bb21..58b2aaa 100644
--- a/modules/gerrit/files/etc/GerritSite.css
+++ b/modules/gerrit/files/etc/GerritSite.css
@@ -125,8 +125,7 @@
  * https://phabricator.wikimedia.org/T46895
  * Gerrit commit message font is too small
  */
-.changeScreenDescription,
-.changeScreenDescription textarea {
+.com-google-gerrit-client-change-CommitBox_BinderImpl_GenCss_style-text {
font-size: 9pt !important;
 }
 
@@ -134,7 +133,7 @@
  * https://phabricator.wikimedia.org/T42941
  * Gerrit diff font isn't big enough, either
  */
-.patchContentTable td {
+.com-google-gerrit-client-diff-DiffTable_BinderImpl_GenCss_style-table {
font-size: 9pt !important;
 }
 
@@ -212,4 +211,4 @@
 .ci_result_LOST {
color: #e39f00;
 }
-li.ci_comment_test {list-style-type: none; }
+li.ci_comment_test { list-style-type: none; }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I053ba9898c38b15de216b81e124fe5c8cfa2f31f
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Dzahn 
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]: Update libvirt driver (with our hack) for Liberty

2016-07-25 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Update libvirt driver (with our hack) for Liberty
..


Update libvirt driver (with our hack) for Liberty

Bug: T131548
Change-Id: I00ef2a32d3891770b3601b01b2eea7d94da73101
---
M modules/openstack/files/liberty/nova/virt-libvirt-driver
1 file changed, 147 insertions(+), 33 deletions(-)

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



diff --git a/modules/openstack/files/liberty/nova/virt-libvirt-driver 
b/modules/openstack/files/liberty/nova/virt-libvirt-driver
index f2f7201..aea35a9 100644
--- a/modules/openstack/files/liberty/nova/virt-libvirt-driver
+++ b/modules/openstack/files/liberty/nova/virt-libvirt-driver
@@ -1030,6 +1030,17 @@
 utils.execute('rm', '-rf', target, delay_on_retry=True,
   attempts=5)
 
+backend = self.image_backend.image(instance, 'disk')
+# TODO(nic): Set ignore_errors=False in a future release.
+# It is set to True here to avoid any upgrade issues surrounding
+# instances being in pending resize state when the software is updated;
+# in that case there will be no snapshot to remove.  Once it can be
+# reasonably assumed that no such instances exist in the wild
+# anymore, it should be set back to False (the default) so it will
+# throw errors, like it should.
+backend.remove_snap(libvirt_utils.RESIZE_SNAPSHOT_NAME,
+ignore_errors=True)
+
 if instance.host != CONF.host:
 self._undefine_domain(instance)
 self.unplug_vifs(instance, network_info)
@@ -1212,13 +1223,14 @@
 disk_dev = mountpoint.rpartition("/")[2]
 try:
 guest = self._host.get_guest(instance)
-conf = guest.get_disk(disk_dev)
-if not conf:
-raise exception.DiskNotFound(location=disk_dev)
 
 state = guest.get_power_state(self._host)
 live = state in (power_state.RUNNING, power_state.PAUSED)
-guest.detach_device(conf, persistent=True, live=live)
+
+wait_for_detach = guest.detach_device_with_retry(guest.get_disk,
+ disk_dev,
+ persistent=True,
+ live=live)
 
 if encryption:
 # The volume must be detached from the VM before
@@ -1227,12 +1239,16 @@
 encryptor = self._get_volume_encryptor(connection_info,
encryption)
 encryptor.detach_volume(**encryption)
+
+wait_for_detach()
 except exception.InstanceNotFound:
 # NOTE(zhaoqin): If the instance does not exist, _lookup_by_name()
 #will throw InstanceNotFound exception. Need to
 #disconnect volume under this circumstance.
 LOG.warn(_LW("During detach_volume, instance disappeared."),
  instance=instance)
+except exception.DeviceNotFound:
+raise exception.DiskNotFound(location=disk_dev)
 except libvirt.libvirtError as ex:
 # NOTE(vish): This is called to cleanup volumes after live
 # migration, so we should still disconnect even if
@@ -2923,6 +2939,8 @@
 size = None
 
 backend = image('disk')
+if instance.task_state == task_states.RESIZE_FINISH:
+backend.create_snap(libvirt_utils.RESIZE_SNAPSHOT_NAME)
 if backend.SUPPORTS_CLONE:
 def clone_fallback_to_fetch(*args, **kwargs):
 try:
@@ -3103,7 +3121,7 @@
 for hdev in [d for d in guest_config.devices
 if isinstance(d, vconfig.LibvirtConfigGuestHostdevPCI)]:
 hdbsf = [hdev.domain, hdev.bus, hdev.slot, hdev.function]
-dbsf = pci_utils.parse_address(dev['address'])
+dbsf = pci_utils.parse_address(dev.address)
 if [int(x, 16) for x in hdbsf] ==\
 [int(x, 16) for x in dbsf]:
 raise exception.PciDeviceDetachFailed(reason=
@@ -6266,6 +6284,24 @@
   instance=instance)
 os.mkdir(instance_dir)
 
+# Recreate the disk.info file and in doing so stop the
+# imagebackend from recreating it incorrectly by inspecting the
+# contents of each file when using the Raw backend.
+if disk_info:
+image_disk_info = {}
+for info in disk_info:
+image_file = os.path.basename(info['path'])
+image_path = 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Update libvirt driver (with our hack) for Liberty

2016-07-25 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

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

Change subject: Update libvirt driver (with our hack) for Liberty
..

Update libvirt driver (with our hack) for Liberty

Bug: T131548
Change-Id: I00ef2a32d3891770b3601b01b2eea7d94da73101
---
M modules/openstack/files/liberty/nova/virt-libvirt-driver
1 file changed, 147 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/03/301003/1

diff --git a/modules/openstack/files/liberty/nova/virt-libvirt-driver 
b/modules/openstack/files/liberty/nova/virt-libvirt-driver
index f2f7201..aea35a9 100644
--- a/modules/openstack/files/liberty/nova/virt-libvirt-driver
+++ b/modules/openstack/files/liberty/nova/virt-libvirt-driver
@@ -1030,6 +1030,17 @@
 utils.execute('rm', '-rf', target, delay_on_retry=True,
   attempts=5)
 
+backend = self.image_backend.image(instance, 'disk')
+# TODO(nic): Set ignore_errors=False in a future release.
+# It is set to True here to avoid any upgrade issues surrounding
+# instances being in pending resize state when the software is updated;
+# in that case there will be no snapshot to remove.  Once it can be
+# reasonably assumed that no such instances exist in the wild
+# anymore, it should be set back to False (the default) so it will
+# throw errors, like it should.
+backend.remove_snap(libvirt_utils.RESIZE_SNAPSHOT_NAME,
+ignore_errors=True)
+
 if instance.host != CONF.host:
 self._undefine_domain(instance)
 self.unplug_vifs(instance, network_info)
@@ -1212,13 +1223,14 @@
 disk_dev = mountpoint.rpartition("/")[2]
 try:
 guest = self._host.get_guest(instance)
-conf = guest.get_disk(disk_dev)
-if not conf:
-raise exception.DiskNotFound(location=disk_dev)
 
 state = guest.get_power_state(self._host)
 live = state in (power_state.RUNNING, power_state.PAUSED)
-guest.detach_device(conf, persistent=True, live=live)
+
+wait_for_detach = guest.detach_device_with_retry(guest.get_disk,
+ disk_dev,
+ persistent=True,
+ live=live)
 
 if encryption:
 # The volume must be detached from the VM before
@@ -1227,12 +1239,16 @@
 encryptor = self._get_volume_encryptor(connection_info,
encryption)
 encryptor.detach_volume(**encryption)
+
+wait_for_detach()
 except exception.InstanceNotFound:
 # NOTE(zhaoqin): If the instance does not exist, _lookup_by_name()
 #will throw InstanceNotFound exception. Need to
 #disconnect volume under this circumstance.
 LOG.warn(_LW("During detach_volume, instance disappeared."),
  instance=instance)
+except exception.DeviceNotFound:
+raise exception.DiskNotFound(location=disk_dev)
 except libvirt.libvirtError as ex:
 # NOTE(vish): This is called to cleanup volumes after live
 # migration, so we should still disconnect even if
@@ -2923,6 +2939,8 @@
 size = None
 
 backend = image('disk')
+if instance.task_state == task_states.RESIZE_FINISH:
+backend.create_snap(libvirt_utils.RESIZE_SNAPSHOT_NAME)
 if backend.SUPPORTS_CLONE:
 def clone_fallback_to_fetch(*args, **kwargs):
 try:
@@ -3103,7 +3121,7 @@
 for hdev in [d for d in guest_config.devices
 if isinstance(d, vconfig.LibvirtConfigGuestHostdevPCI)]:
 hdbsf = [hdev.domain, hdev.bus, hdev.slot, hdev.function]
-dbsf = pci_utils.parse_address(dev['address'])
+dbsf = pci_utils.parse_address(dev.address)
 if [int(x, 16) for x in hdbsf] ==\
 [int(x, 16) for x in dbsf]:
 raise exception.PciDeviceDetachFailed(reason=
@@ -6266,6 +6284,24 @@
   instance=instance)
 os.mkdir(instance_dir)
 
+# Recreate the disk.info file and in doing so stop the
+# imagebackend from recreating it incorrectly by inspecting the
+# contents of each file when using the Raw backend.
+if disk_info:
+image_disk_info = {}
+for info in disk_info:
+image_file = os.path.basename(info['path'])
+  

[MediaWiki-commits] [Gerrit] mediawiki...Refreshed[master]: Fix font loading under Internet Explorers (and maybe also Edge)

2016-07-25 Thread Jack Phoenix (Code Review)
Jack Phoenix has submitted this change and it was merged.

Change subject: Fix font loading under Internet Explorers (and maybe also Edge)
..


Fix font loading under Internet Explorers (and maybe also Edge)

IE10 and newer don't support conditional comments anymore, hence why the
previous approach was flawed.

Bug: T134653
Change-Id: Ic60cbe59a5f13dc31b8f5b24d5e1c449d15979b8
---
M Refreshed.skin.php
M refreshed/iefontfix.css
M refreshed/main.css
M skin.json
4 files changed, 18 insertions(+), 45 deletions(-)

Approvals:
  Jack Phoenix: Verified; Looks good to me, approved



diff --git a/Refreshed.skin.php b/Refreshed.skin.php
index f488728..3462f02 100644
--- a/Refreshed.skin.php
+++ b/Refreshed.skin.php
@@ -38,6 +38,21 @@
) )
);
 
+   // Inject webfont loader CSS file inline here so that it'll 
work even for IE11
+   // Conditional comments aren't supported in IE10+ so we have no 
way of loading
+   // this just for IE, so better to have all font declarations 
here (and
+   // maybe one day we'll rename the file to just "fontloader.css" 
or something)
+   // Based on some quick-ish testing on 25 July 2016, it appears 
that font
+   // declarations need to be loaded before they're used so that 
they work
+   // under IE(11).
+   // See https://phabricator.wikimedia.org/T134653 for more info.
+   $out->addHeadItem( 'webfontfix',
+Html::element( 'link', array(
+   'href' => $wgLocalStylePath . 
'/Refreshed/refreshed/iefontfix.css',
+   'rel' => 'stylesheet'
+   ) )
+   );
+
// Add JavaScript via ResourceLoader
$out->addModules( 'skins.refreshed.js' );
}
@@ -53,10 +68,6 @@
'mediawiki.skinning.content.externallinks',
'skins.refreshed'
) );
-
-   // Internet Explorer fixes
-   $out->addStyle( $wgStylePath . 
'/Refreshed/refreshed/iefontfix.css', 'screen', 'IE' );
-   //$out->addStyle( $wgStylePath . 
'/Refreshed/refreshed/wikifont/WikiFontLoader.css', 'screen' ); /* IE 10+ */
}
 }
 
@@ -532,7 +543,7 @@
makeFooterIcon( $icon ); ?>

 https://fonts.gstatic.com/s/lato/v11/zLhfkPOm_5ykmdm-wXaiuw.eot);
-   src: local('Lato Light'),
-   local('Lato-Light'),
-   
url(https://fonts.gstatic.com/s/lato/v11/zLhfkPOm_5ykmdm-wXaiuw.eot?#iefix) 
format('embedded-opentype'),
-   
url(https://fonts.gstatic.com/s/lato/v11/kcf5uOXucLcbFOydGU24WALUuEpTyoUstqEm5AMlJo4.woff)
 format('woff'),
-   
url(https://fonts.gstatic.com/s/lato/v11/nj47mAZe0mYUIySgfn0wpQ.ttf) 
format('truetype'),
-   
url(https://fonts.gstatic.com/l/font?kit=7yKIrlBXX_AXuUv3Ts9_8g#Lato) 
format('svg');
-}
-
-@font-face {
-   font-family: 'Lato';
-   font-style: normal;
-   font-weight: 700;
-   src: 
url(https://fonts.gstatic.com/s/lato/v11/sBtfDPlEIwvKKU53nAG7AQ.eot);
-   src: local('Lato Bold'),
-   local('Lato-Bold'),
-   
url(https://fonts.gstatic.com/s/lato/v11/sBtfDPlEIwvKKU53nAG7AQ.eot?#iefix) 
format('embedded-opentype'),
-   
url(https://fonts.gstatic.com/s/lato/v11/qdgUG4U09HnJwhYI-uK18wLUuEpTyoUstqEm5AMlJo4.woff)
 format('woff'),
-   
url(https://fonts.gstatic.com/s/lato/v11/DvlFBScY1r-FMtZSYIYoYw.ttf) 
format('truetype'),
-   
url(https://fonts.gstatic.com/l/font?kit=hLECvlEj3pKlnS4NFs8NQw#Lato) 
format('svg');
-}
-
-@font-face {
-   font-family: 'Lato body';
-   font-style: normal;
-   font-weight: 400;
-   src: 
url(https://fonts.gstatic.com/s/lato/v11/nQhiC-wSiJx0pvEuJl8d8A.eot);
-   src: local('Lato Regular'),
-   local('Lato-Regular'),
-   
url(https://fonts.gstatic.com/s/lato/v11/nQhiC-wSiJx0pvEuJl8d8A.eot?#iefix) 
format('embedded-opentype'),
-   
url(https://fonts.gstatic.com/s/lato/v11/qIIYRU-oROkIk8vfvxw6QvesZW2xOQ-xsNqO47m55DA.woff)
 format('woff'),
-   
url(https://fonts.gstatic.com/s/lato/v11/v0SdcGFAl2aezM9Vq_aFTQ.ttf) 
format('truetype'),
-   
url(https://fonts.gstatic.com/l/font?kit=H4oiIt_Ug9TU5ast0nUT-w#Lato) 
format('svg');
-}
-
 .fadable {
-ms-transition: opacity 0.2s ease;
transition: opacity 0.2s ease;
diff --git a/skin.json b/skin.json
index 798a1ad..f9a2932 100644
--- a/skin.json
+++ b/skin.json
@@ -1,6 +1,6 @@
 {
"name": "Refreshed",
-   "version": "3.1.1",
+   "version": "3.1.2",
"author": [
"Adam Carter",
"George Barnick",

[MediaWiki-commits] [Gerrit] analytics...scripts[master]: Track global user enables * disables of beta features

2016-07-25 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Track global user enables * disables of beta features
..

Track global user enables * disables of beta features

This tracks how many global users have enabled / disabled
a betafeature.

If a user has a feature enabled on a single wiki they are
counted as using the feature.
If they then enabled it on a second wiki, this will not count
as another enable.
Only if a user removes the feature from all wikis will it count
as a disable.

Bug: T140226
Change-Id: Ib3df65f4e28bf2ffa06e21f1d4f89f13f79c6582
---
M src/betafeatures/counts.php
1 file changed, 66 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wmde/scripts 
refs/changes/02/301002/1

diff --git a/src/betafeatures/counts.php b/src/betafeatures/counts.php
index 5543c5b..d4331b4 100755
--- a/src/betafeatures/counts.php
+++ b/src/betafeatures/counts.php
@@ -36,15 +36,25 @@
 $pdo = WikimediaDb::getPdo();
 
 $metrics = array();
+$tempTableName = 'staging.wmde_analytics_betafeature_users_temp';
+$yesterdayTableName = 'staging.wmde_analytics_betafeature_users_yesterday';
 
-// Create temporary tables
-$sql = "CREATE TEMPORARY TABLE IF NOT EXISTS 
staging.wmde_analytics_betafeature_users";
+// Create temporary table
+$sql = "CREATE TEMPORARY TABLE IF NOT EXISTS $tempTableName";
 $sql .= "( user_name VARCHAR(255) NOT NULL, feature VARBINARY(255) NOT NULL, 
PRIMARY KEY (user_name, feature) )";
 $queryResult = $pdo->query( $sql );
 if ( $queryResult === false ) {
-   die( "Failed to create staging.wmde_analytics_betafeature_users" );
+   die( "Failed to create temp table $tempTableName" );
+}
+// Create yesterday table
+$sql = "CREATE TABLE IF NOT EXISTS $yesterdayTableName";
+$sql .= "( user_name VARCHAR(255) NOT NULL, feature VARBINARY(255) NOT NULL, 
PRIMARY KEY (user_name, feature) )";
+$queryResult = $pdo->query( $sql );
+if ( $queryResult === false ) {
+   die( "Failed to create table $tempTableName" );
 }
 
+// Loop through all databases
 foreach( $dbs as $dbname ) {
if( $dbname === 'labswiki' || $dbname === 'labtestwiki' ) {
continue;
@@ -62,9 +72,9 @@
}
}
 
-   // Record individuals
+   // Record individuals into the temp table
foreach( $currentFeatures as $feature ) {
-   $sql = "INSERT IGNORE INTO 
staging.wmde_analytics_betafeature_users ( user_name, feature )";
+   $sql = "INSERT IGNORE INTO $tempTableName ( user_name, feature 
)";
$sql .= " SELECT user_name, up_property FROM 
$dbname.user_properties";
$sql .= " JOIN $dbname.user ON up_user = user_id";
$sql .= " WHERE up_property = '$feature' AND up_value = '1'";
@@ -75,18 +85,20 @@
}
 }
 
+// Send total user_counts (1 global user can be counted more than once)
 foreach( $metrics as $featureName => $value ) {
if ( in_array( $featureName, $currentFeatures ) && $value > 0 ) {
WikimediaGraphite::sendNow( 
'daily.betafeatures.user_counts.totals.' . $featureName, $value );
}
 }
 
+// Select and send the global user counts (each global user is only counted 
once)
 $sql = "SELECT COUNT(*) AS count, feature";
-$sql .= " FROM staging.wmde_analytics_betafeature_users";
+$sql .= " FROM $tempTableName";
 $sql .= " GROUP BY feature";
 $queryResult = $pdo->query( $sql );
 if( $queryResult === false ) {
-   Output::timestampedMessage( "SELECT FROM 
staging.wmde_analytics_betafeature_users FAILED!!" );
+   Output::timestampedMessage( "SELECT FROM temp table $tempTableName 
FAILED!!" );
 } else {
foreach( $queryResult as $row ) {
if ( in_array( $row['feature'], $currentFeatures ) && 
$row['count'] > 0 ) {
@@ -96,4 +108,50 @@
);
}
}
-}
\ No newline at end of file
+}
+
+// Compare todays data with yesterdays data (if present)
+$queryResult = $pdo->query( "SELECT * FROM $yesterdayTableName LIMIT 1" );
+if ( $queryResult === false ) {
+   Output::timestampedMessage( "FAILED: $sql" );
+}
+if( count( $queryResult->fetchAll() ) > 0 ) {
+   // Work out what has changed between days
+   // Emulated INTERSECT: http://stackoverflow.com/a/950505/4746236
+   $sql = "SELECT 'enables' AS state, today.* FROM $tempTableName AS 
today";
+   $sql .= " WHERE ROW(today.user_name, today.feature) NOT IN";
+   $sql .= " ( SELECT * FROM $yesterdayTableName )";
+   $sql .= " UNION ALL";
+   $sql .= " SELECT 'disables' AS state, yesterday.* FROM 
$yesterdayTableName AS yesterday";
+   $sql .= " WHERE ROW(yesterday.user_name, yesterday.feature) NOT IN";
+   $sql .= " ( SELECT * FROM $tempTableName )";
+   $sql = "SELECT state, COUNT(*) AS count, feature FROM ( $sql ) AS a 
GROUP BY state, feature";
+   $queryResult = $pdo->query( $sql );
+ 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: tools: Add a role to help build tools images

2016-07-25 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: tools: Add a role to help build tools images
..


tools: Add a role to help build tools images

Change-Id: I4ca11e3922604554fbc3dad334f0a087a0df0dbd
---
M modules/role/manifests/toollabs/docker/builder.pp
A modules/toollabs/manifests/images.pp
2 files changed, 10 insertions(+), 1 deletion(-)

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



diff --git a/modules/role/manifests/toollabs/docker/builder.pp 
b/modules/role/manifests/toollabs/docker/builder.pp
index dbd4764..03547f1 100644
--- a/modules/role/manifests/toollabs/docker/builder.pp
+++ b/modules/role/manifests/toollabs/docker/builder.pp
@@ -4,7 +4,7 @@
 require role::labs::lvm::srv
 class { '::docker::engine': }
 
-class { '::docker::baseimages': }
+class { '::toollabs::images': }
 
 # This requires push privilages
 $docker_username = hiera('docker::username')
diff --git a/modules/toollabs/manifests/images.pp 
b/modules/toollabs/manifests/images.pp
new file mode 100644
index 000..b93228c
--- /dev/null
+++ b/modules/toollabs/manifests/images.pp
@@ -0,0 +1,9 @@
+# Helper class to setup building toollabs related images
+class toollabs::images {
+require ::docker::baseimages
+
+git::clone { 'operations/docker-images/toollabs-images':
+ensure=> present,
+directory => '/srv/images/toollabs',
+}
+}
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4ca11e3922604554fbc3dad334f0a087a0df0dbd
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda 
Gerrit-Reviewer: Yuvipanda 
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]: Count edit conflicts for each namespace separately

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Count edit conflicts for each namespace separately
..


Count edit conflicts for each namespace separately

Bug: T140368
Change-Id: I5591f53063db32b2c74a2f74751d4af0ef5424d7
---
M includes/EditPage.php
1 file changed, 6 insertions(+), 7 deletions(-)

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



diff --git a/includes/EditPage.php b/includes/EditPage.php
index 362f905..fa5c53d 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -3536,13 +3536,12 @@
if ( Hooks::run( 'EditPageBeforeConflictDiff', [ &$this, 
&$wgOut ] ) ) {
$stats = $wgOut->getContext()->getStats();
$stats->increment( 'edit.failures.conflict' );
-   if ( $this->mTitle->isTalkPage() ) {
-   $stats->increment( 
'edit.failures.conflict.byType.talk' );
-   } else {
-   $stats->increment( 
'edit.failures.conflict.byType.subject' );
-   }
-   if ( $this->mTitle->getNamespace() === NS_PROJECT ) {
-   $stats->increment( 
'edit.failures.conflict.byNamespace.project' );
+   // Only include 'standard' namespaces to avoid creating 
unknown numbers of statsd metrics
+   if (
+   $this->mTitle->getNamespace() >= NS_MAIN &&
+   $this->mTitle->getNamespace() <= 
NS_CATEGORY_TALK
+   ) {
+   $stats->increment( 
'edit.failures.conflict.byNamespaceId.' . $this->mTitle->getNamespace() );
}
 
$wgOut->wrapWikiMsg( '$1', "yourdiff" );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5591f53063db32b2c74a2f74751d4af0ef5424d7
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore 
Gerrit-Reviewer: Daniel Kinzler 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: Tpt 
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]: tools: Add a role to help build tools images

2016-07-25 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: tools: Add a role to help build tools images
..

tools: Add a role to help build tools images

Change-Id: I4ca11e3922604554fbc3dad334f0a087a0df0dbd
---
M modules/role/manifests/toollabs/docker/builder.pp
A modules/toollabs/manifests/images.pp
2 files changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/00/301000/1

diff --git a/modules/role/manifests/toollabs/docker/builder.pp 
b/modules/role/manifests/toollabs/docker/builder.pp
index dbd4764..03547f1 100644
--- a/modules/role/manifests/toollabs/docker/builder.pp
+++ b/modules/role/manifests/toollabs/docker/builder.pp
@@ -4,7 +4,7 @@
 require role::labs::lvm::srv
 class { '::docker::engine': }
 
-class { '::docker::baseimages': }
+class { '::toollabs::images': }
 
 # This requires push privilages
 $docker_username = hiera('docker::username')
diff --git a/modules/toollabs/manifests/images.pp 
b/modules/toollabs/manifests/images.pp
new file mode 100644
index 000..b93228c
--- /dev/null
+++ b/modules/toollabs/manifests/images.pp
@@ -0,0 +1,9 @@
+# Helper class to setup building toollabs related images
+class toollabs::images {
+require ::docker::baseimages
+
+git::clone { 'operations/docker-images/toollabs-images':
+ensure=> present,
+directory => '/srv/images/toollabs',
+}
+}
\ No newline at end of file

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

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

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Revert stylized wordmark at top of feed.

2016-07-25 Thread Dbrant (Code Review)
Dbrant has uploaded a new change for review.

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

Change subject: Revert stylized wordmark at top of feed.
..

Revert stylized wordmark at top of feed.

Change-Id: Idbf08ada63f46d8dccbbcab91ffa646f7e223ec2
---
M app/src/main/java/org/wikipedia/feed/FeedFragment.java
A app/src/main/res/drawable/feed_header_wordmark.xml
M app/src/main/res/layout/fragment_feed.xml
3 files changed, 238 insertions(+), 27 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/feed/FeedFragment.java 
b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
index e09d6e4..b56c350 100644
--- a/app/src/main/java/org/wikipedia/feed/FeedFragment.java
+++ b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
@@ -10,14 +10,12 @@
 import android.support.v4.app.Fragment;
 import android.support.v4.widget.SwipeRefreshLayout;
 import android.support.v7.widget.Toolbar;
-import android.text.Html;
 import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
-import android.widget.TextView;
 
 import org.wikipedia.BackPressedHandler;
 import org.wikipedia.MainActivityToolbarProvider;
@@ -50,7 +48,6 @@
 @BindView(R.id.feed_swipe_refresh_layout) SwipeRefreshLayout 
swipeRefreshLayout;
 @BindView(R.id.fragment_feed_feed) FeedView feedView;
 @BindView(R.id.feed_toolbar) Toolbar toolbar;
-@BindView(R.id.feed_header_text) TextView headerText;
 private Unbinder unbinder;
 private WikipediaApp app;
 private FeedCoordinator coordinator;
@@ -92,7 +89,6 @@
 View view = inflater.inflate(R.layout.fragment_feed, container, false);
 
 unbinder = ButterKnife.bind(this, view);
-headerText.setText(Html.fromHtml(getString(R.string.wp_stylized)));
 feedView.set(coordinator, feedCallback);
 appBarLayout.addOnOffsetChangedListener(headerOffsetChangedListener);
 searchIconShowThresholdPx = (int) 
getResources().getDimension(R.dimen.view_feed_header_height) - 
DimenUtil.getContentTopOffsetPx(getContext());
diff --git a/app/src/main/res/drawable/feed_header_wordmark.xml 
b/app/src/main/res/drawable/feed_header_wordmark.xml
new file mode 100644
index 000..5bd52a2
--- /dev/null
+++ b/app/src/main/res/drawable/feed_header_wordmark.xml
@@ -0,0 +1,232 @@
+
+http://schemas.android.com/apk/res/android;
+android:width="200dp"
+android:height="48dp"
+android:viewportWidth="200"
+android:viewportHeight="48">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_feed.xml 
b/app/src/main/res/layout/fragment_feed.xml
index 5823dba..64db77a 100644
--- a/app/src/main/res/layout/fragment_feed.xml
+++ b/app/src/main/res/layout/fragment_feed.xml
@@ -30,33 +30,16 @@
 app:statusBarScrim="@color/status_bar_background"
 app:titleEnabled="false">
 
-
-
-
-
-
-
-
+android:contentDescription="@null"
+app:srcCompat="@drawable/feed_header_wordmark"
+app:layout_collapseMode="parallax"
+/>
 
 https://gerrit.wikimedia.org/r/300999
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idbf08ada63f46d8dccbbcab91ffa646f7e223ec2
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant 

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


[MediaWiki-commits] [Gerrit] mediawiki...text_renderer[master]: Add option to emit `blessed`-style markup.

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add option to emit `blessed`-style markup.
..


Add option to emit `blessed`-style markup.

Change-Id: I75eb7fbc0cec5119855a996670792a56d710cee5
---
M bin/mw-ocg-texter
M lib/index.js
2 files changed, 57 insertions(+), 11 deletions(-)

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



diff --git a/bin/mw-ocg-texter b/bin/mw-ocg-texter
index 346005e..82c9b08 100755
--- a/bin/mw-ocg-texter
+++ b/bin/mw-ocg-texter
@@ -13,6 +13,8 @@
'Save text to the given ', null)
.option('-w, --no-wrap',
'Don\'t wrap; use newlines only to separate paragraphs')
+   .option('-b, --blessed',
+   'Add `blessed` markup to output')
.option('-r, --no-refs',
'Suppress references (and other metadata sections)')
.option('-v, --verbose',
@@ -73,6 +75,7 @@
 var options = {
bundle: bundlefile,
noWrap: !program.wrap,
+   blessed: program.blessed,
noRefs: !program.refs,
debug: !!program.debug,
output: program.output,
diff --git a/lib/index.js b/lib/index.js
index 630e096..fa6875d 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -31,7 +31,7 @@
 
 // Convert plain text (with HTML whitespace semantics) to an appropriately
 // simplified string
-var textEscape = function(str) {
+var textEscape = function(str, options) {
// Compress multiple newlines (and use unix-style newlines exclusively).
str = str.replace(/\r\n?/g, '\n').replace(/\n\n+/g, '\n');
// Trim leading and trailing newlines for consistent output.
@@ -40,6 +40,11 @@
// XXX Only in en locales?
str = str.replace(/[\u201C\u201D]/g, '"');
str = str.replace(/[\u2018\u2019]/g, "'");
+   if (options.blessed) {
+   str = str.replace(/[{}]/g, function(c) {
+   return (c === '{') ? '{open}' : '{close}';
+   });
+   }
return str;
 };
 
@@ -155,7 +160,13 @@
 };
 Formatter.prototype.writeHeading = function(level, heading) {
this.paragraphBreak();
+   if (this.options.blessed) {
+   this.write('{left}{bold}');
+   }
this.write(heading.trim());
+   if (this.options.blessed) {
+   this.write('{/bold}{/left}');
+   }
this.paragraphBreak();
 };
 Formatter.prototype.indent = function(tag) {
@@ -236,7 +247,10 @@
this.usedLanguages = new Set();
this.listInfo = { depth: 0 };
 };
-
+// Helper function to pass along options.
+Visitor.prototype.textEscape = function(str) {
+   return textEscape(str, this.options);
+};
 // Helper function -- collect all text from the children of `node` as
 // HTML non-block/TeX non-paragraph content.  Invoke `f` with the result,
 // suitable for inclusion in a TeX non-paragraph context.
@@ -321,7 +335,7 @@
case node.TEXT_NODE:
case node.CDATA_SECTION_NODE:
var text = this.format.state.pre ? node.data :
-   textEscape(node.data);
+   this.textEscape(node.data);
if (text) {
this.format.write(text);
}
@@ -357,8 +371,34 @@
 };
 
 Visitor.prototype.visitA = function(node) {
-   // Ignore the href.
+   var wikiLink = node.getAttribute('rel') === 'mw:WikiLink';
+   if (this.options.blessed) {
+   this.format.write('{blue-fg}');
+   if (wikiLink) {
+   var href = node.getAttribute('href')
+   .replace(/^.+\//, '').replace('}', '%7D');
+   this.format.write('{link ' + href + '}');
+   }
+   }
this.visitChildren(node);
+   if (this.options.blessed) {
+   if (wikiLink) {
+   this.format.write('{/link}');
+   }
+   this.format.write('{/blue-fg}');
+   }
+};
+
+Visitor.prototype.visitB = function(node) {
+   if (this.options.blessed) { this.format.write('{bold}'); }
+   this.visitChildren(node);
+   if (this.options.blessed) { this.format.write('{/bold}'); }
+};
+
+Visitor.prototype.visitU = function(node) {
+   if (this.options.blessed) { this.format.write('{underline}'); }
+   this.visitChildren(node);
+   if (this.options.blessed) { this.format.write('{/underline}'); }
 };
 
 Visitor.prototype.visitP = function(node) {
@@ -438,7 +478,7 @@
}));
} else {
// Oh, well, just print it w/o subscripting.
-   this.format.write(textEscape(contents));
+   this.format.write(this.textEscape(contents));
}
});
 };
@@ -455,14 +495,16 @@
}));
} else {
// Oh, 

[MediaWiki-commits] [Gerrit] mediawiki...ImageMetrics[master]: Convert ImageMetrics to extension registration

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Convert ImageMetrics to extension registration
..


Convert ImageMetrics to extension registration

Bug: T87930
Change-Id: Ib574a29f365064e3899b72013a698aec0ed0fa34
---
A ImageMetrics.hooks.php
M ImageMetrics.php
A extension.json
3 files changed, 142 insertions(+), 99 deletions(-)

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



diff --git a/ImageMetrics.hooks.php b/ImageMetrics.hooks.php
new file mode 100644
index 000..56fb943
--- /dev/null
+++ b/ImageMetrics.hooks.php
@@ -0,0 +1,65 @@
+
+ *
+ * @license GPL v2 or later
+ * @version 0.1.0
+ */
+
+class ImageMetricHooks {
+   public static function onEventLoggingRegisterSchemas( array &$schemas ) 
{
+   $schemas['ImageMetricsLoadingTime'] = 10078363;
+   }
+
+   /**
+* @param OutputPage $out
+* @param Skin $skin
+* @return bool
+*/
+   public static function onBeforePageDisplay( &$out, &$skin ) {
+   if ( $out->getTitle()->inNamespace( NS_FILE ) && 
Action::getActionName( $out->getContext() ) === 'view' ) {
+   $out->addModules( array( 'ext.imageMetrics.head', 
'ext.imageMetrics.loader' ) );
+   }
+   return true;
+   }
+
+   /**
+* @param array $vars
+* @return bool
+*/
+   public static function onResourceLoaderGetConfigVars( &$vars ) {
+   global $wgImageMetricsSamplingFactor, 
$wgImageMetricsLoggedinSamplingFactor;
+   $vars[ 'wgImageMetrics' ] = array(
+   'samplingFactor' => array(
+   'image' => $wgImageMetricsSamplingFactor,
+   'imageLoggedin' => 
$wgImageMetricsLoggedinSamplingFactor,
+   ),
+   );
+   return true;
+   }
+
+   /**
+* @param array $testModules
+* @param ResourceLoader resourceLoader
+* @return bool
+*/
+   public static function onResourceLoaderTestModules( array 
&$testModules, ResourceLoader &$resourceLoader ) {
+   $testModules['qunit']['ext.imageMetrics.tests'] = array(
+   'scripts' => array(
+   'tests/qunit/logger/LoadingTimeLogger.test.js',
+   ),
+   'dependencies' => array(
+   'ext.imageMetrics',
+   ),
+   'localBasePath' => __DIR__,
+   'remoteExtPath' => 'ImageMetrics',
+   );
+   return true;
+   }
+}
+
diff --git a/ImageMetrics.php b/ImageMetrics.php
index a494eab..f528913 100644
--- a/ImageMetrics.php
+++ b/ImageMetrics.php
@@ -11,102 +11,15 @@
  * @version 0.1.0
  */
 
-$wgExtensionCredits['other'][] = array(
-   'path' => __FILE__,
-   'name' => 'ImageMetrics',
-   'version' => '0.1.0',
-   'url' => 'https://www.mediawiki.org/wiki/Extension:ImageMetrics',
-   'author' => array(
-   'Tisza Gergő',
-   ),
-   'descriptionmsg' => 'imagemetrics-desc',
-'license-name' => 'GPL-2.0+',
-);
-
-/** @var int|bool: If set, logs once per this many requests. False if unset. 
**/
-$wgImageMetricsSamplingFactor = false;
-
-/** @var int|bool: If set, logs once per this many requests for logged-in 
users. False if unset. **/
-$wgImageMetricsLoggedinSamplingFactor = false;
-
-$wgMessagesDirs['ImageMetrics'] = __DIR__ . '/i18n';
-
-$wgHooks['EventLoggingRegisterSchemas'][] = function( array &$schemas ) {
-   $schemas['ImageMetricsLoadingTime'] = 10078363;
-};
-
-
-$wgResourceModules += array(
-   'ext.imageMetrics' => array(
-   'scripts'   => array(
-   'logger/Logger.js',
-   'logger/LoadingTimeLogger.js',
-   ),
-   'localBasePath' => __DIR__ . '/resources',
-   'remoteExtPath' => 'ImageMetrics/resources',
-   'dependencies'  => array(
-   'oojs',
-   'schema.ImageMetricsLoadingTime',
-   ),
-   'targets'   => array( 'desktop', 'mobile' ),
-   ),
-   'ext.imageMetrics.head' => array(
-   'scripts'   => 'head.js',
-   'localBasePath' => __DIR__ . '/resources',
-   'remoteExtPath' => 'ImageMetrics/resources',
-   'targets'   => array( 'desktop', 'mobile' ),
-   'position'  => 'top',
-   ),
-   'ext.imageMetrics.loader' => array(
-   'scripts'   => 'loader.js',
-   'localBasePath' => __DIR__ . '/resources',
-   'remoteExtPath' => 'ImageMetrics/resources',
-   'targets'   => array( 'desktop', 'mobile' ),
-   ),
-);
-
-/**
- * @param OutputPage 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add addition of 'maxarticlesize' in ApiQuerySiteinfo to RELE...

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add addition of 'maxarticlesize' in ApiQuerySiteinfo to 
RELEASE-NOTES
..


Add addition of 'maxarticlesize' in ApiQuerySiteinfo to RELEASE-NOTES

Follows-up I25a4c1b9013f98e5b0a263a637c8b006dccfd5ad.

Change-Id: If3ffa6635e18e53a642ebaa0b93c4c265612299f
---
M RELEASE-NOTES-1.28
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28
index a20bec0..c8bf207 100644
--- a/RELEASE-NOTES-1.28
+++ b/RELEASE-NOTES-1.28
@@ -49,6 +49,8 @@
 === Bug fixes in 1.28 ===
 
 === Action API changes in 1.28 ===
+* Added 'maxarticlesize' property to action=query=siteinfo which contains
+  the value of $wgMaxArticleSize.
 
 === Action API internal changes in 1.28 ===
 * Added a new hook, 'ApiMakeParserOptions', to allow extensions to better

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If3ffa6635e18e53a642ebaa0b93c4c265612299f
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow 
Gerrit-Reviewer: Krinkle 
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/TransparencyReport-private[master]: new pie chart user page

2016-07-25 Thread Siddparmar (Code Review)
Siddparmar has submitted this change and it was merged.

Change subject: new pie chart user page
..


new pie chart user page

Change-Id: I1c88fa3a48949f8a8e4c7b3ee85a758aaf95896e
---
A build/data/number_of_disclosures.csv
M build/fr/privacy.html
M build/javascripts/privacy.js
M build/privacy.html
M build/stylesheets/graph.css
M build/stylesheets/master.css
A source/data/number_of_disclosures.csv
M source/javascripts/privacy.js
M source/localizable/privacy.html.erb
M source/stylesheets/graph.css.scss
M source/stylesheets/master.css.scss
M source/stylesheets/variables.css.scss
12 files changed, 472 insertions(+), 22 deletions(-)

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



diff --git a/build/data/number_of_disclosures.csv 
b/build/data/number_of_disclosures.csv
new file mode 100644
index 000..c34a9ab
--- /dev/null
+++ b/build/data/number_of_disclosures.csv
@@ -0,0 +1,5 @@
+key,value
+Individual threats,7
+Terrorist threats,2
+Other,2
+Suicide,1
\ No newline at end of file
diff --git a/build/fr/privacy.html b/build/fr/privacy.html
index 178b984..19d9469 100644
--- a/build/fr/privacy.html
+++ b/build/fr/privacy.html
@@ -99,7 +99,7 @@

 
 
-
+



@@ -351,15 +351,12 @@
 
Voluntary disclosures by type

-   Juillet - 
Décembre 2015
+   Janvier - Juin 
2016

-   
-   
-   
+   
+   


-   
-   
 
 
 
diff --git a/build/javascripts/privacy.js b/build/javascripts/privacy.js
index 857d75c..996b765 100644
--- a/build/javascripts/privacy.js
+++ b/build/javascripts/privacy.js
@@ -670,6 +670,173 @@
makeCircles ( data );
}
 
+   /*---Pie Chart-*/
+   pieChart = function (data) {
+   var wrapper = $('.pieChart'),
+   width = wrapper.width(),
+   height = wrapper.height(),
+   radius = Math.min(width, height) / 2;
+
+   var labelFactor, polylineFactor, arc, outerArc;
+
+   // this is to appropriately scale chart slices
+   if (width < 371) {
+
+   labelFactor = radius * 0.42;
+   polylineFactor = radius * 0.4;
+
+   arc = d3.svg.arc()
+   .outerRadius(radius * 0.35)
+   .innerRadius(radius * 0.01);
+
+   outerArc = d3.svg.arc()
+   .innerRadius(radius * 0.4)
+   .outerRadius(radius * 0.4);
+
+   }
+   else if (width < 431) {
+
+   labelFactor = radius * 0.5;
+   polylineFactor = radius * 0.48;
+
+   arc = d3.svg.arc()
+   .outerRadius(radius * 0.35)
+   .innerRadius(radius * 0.01);
+
+   outerArc = d3.svg.arc()
+   .innerRadius(radius * 0.45)
+   .outerRadius(radius * 0.45);
+
+   }
+   else if (width < 631) {
+
+   labelFactor = radius * 0.6;
+   polylineFactor = radius * 0.58;
+
+   arc = d3.svg.arc()
+   .outerRadius(radius * 0.5)
+   .innerRadius(radius * 0.35);
+
+   outerArc = d3.svg.arc()
+   .innerRadius(radius * 0.6)
+   .outerRadius(radius * 0.6);
+
+   } else {
+
+   labelFactor = radius;
+   polylineFactor = radius * 0.95;
+
+   arc = d3.svg.arc()
+   .outerRadius(radius * 0.6)
+   .innerRadius(radius * 0.4);
+
+   outerArc = d3.svg.arc()
+   .innerRadius(radius * 0.95)
+   .outerRadius(radius * 0.95);
+
+   }
+
+   var svg = d3.select('.pieChart').append('svg')
+   .attr({
+   'width': width,
+   'height': height
+   })
+   .append('g');
+
+   svg.attr('transform', 'translate(' + width/2 + ', ' + height/2 + 
')');
+
+   svg.append('g')
+   .attr('class', 'lines')
+   svg.append('g')
+   .attr('class', 'slices')
+   svg.append('g')
+   .attr('class', 'labels')
+
+   var colors = ['#375baf', '#ff6060', '#ffbe3c', '#259d9e'];
+
+   var pie = d3.layout.pie()
+   .value(function(d) {
+   return d[1];
+   })
+   .sort(null);
+
+   var slice = svg.select('.slices')
+   .datum(data)
+   .selectAll('path')
+   .data(pie);
+
+   slice
+   .enter().append('path')
+   .attr({
+   'fill': function(d, i) {
+   return colors[i];
+   },
+   'd': arc,

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Fix privacy policy URL

2016-07-25 Thread Deskana (Code Review)
Deskana has uploaded a new change for review.

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

Change subject: Fix privacy policy URL
..

Fix privacy policy URL

The current privacy policy URL is actually pointing to a redirect to the
privacy policy, instead of hte privacy policy itself. This patch fixes that,
by making the URL point directly to the page.

Change-Id: If5acdbff1347999d0580cc53c5014b14474fb565
---
M app/src/main/res/values/strings.xml
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/app/src/main/res/values/strings.xml 
b/app/src/main/res/values/strings.xml
index 77ed5ec..51562af 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -158,7 +158,7 @@
 About the Wikipedia app
 Privacy policy
 Terms of use
-https://m.wikimediafoundation.org/wiki/Privacy_Policy
+https://m.wikimediafoundation.org/wiki/Privacy_policy
 https://m.wikimediafoundation.org/wiki/Terms_of_Use
 Libraries used
 Contributors

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5acdbff1347999d0580cc53c5014b14474fb565
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Deskana 

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


[MediaWiki-commits] [Gerrit] mediawiki...ORES[master]: Better way to handle errors in Cache.php

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Better way to handle errors in Cache.php
..


Better way to handle errors in Cache.php

Bug: T137880
Change-Id: Ia1c0dee86fe32074c079d8c14253154d68c5045a
---
M includes/Cache.php
M maintenance/PopulateDatabase.php
2 files changed, 21 insertions(+), 6 deletions(-)

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



diff --git a/includes/Cache.php b/includes/Cache.php
index d3f4019..0871792 100644
--- a/includes/Cache.php
+++ b/includes/Cache.php
@@ -7,12 +7,26 @@
 class Cache {
static protected $modelIds;
protected $classMap;
+   protected $errorCallback;
 
public function __construct() {
$this->classMap = [ 'true' => 1, 'false' => 0,
'B' => 0, 'C' => 1, 'FA' => 2, 'GA' => 3,
'Start' => 4, 'Stub' => 5 ];
+   $this->setErrorCallback( function ( $mssg ) {
+   throw new RuntimeException( 'Model contains an error: ' 
. $mssg );
+   } );
}
+
+   /**
+* Setter for $errorCallback
+*
+* @param callable $errorCallback the callback function
+*/
+   public function setErrorCallback( $errorCallback ) {
+   $this->errorCallback = $errorCallback;
+   }
+
/**
 * Save scores to the database
 *
@@ -21,16 +35,14 @@
 *
 * @throws RuntimeException
 */
-   public function storeScores( $scores, $batch = false ) {
+   public function storeScores( $scores ) {
// Map to database fields.
$dbData = [];
foreach ( $scores as $revision => $revisionData ) {
foreach ( $revisionData as $model => $modelOutputs ) {
if ( isset( $modelOutputs['error'] ) ) {
-   if ( $batch ) {
-   continue;
-   }
-   throw new RuntimeException( 'Model 
contains an error: ' . $modelOutputs['error']['message'] );
+   call_user_func( $this->errorCallback, 
$modelOutputs['error']['message'] );
+   continue;
}
 
$prediction = $modelOutputs['prediction'];
diff --git a/maintenance/PopulateDatabase.php b/maintenance/PopulateDatabase.php
index 608f869..b30b66e 100644
--- a/maintenance/PopulateDatabase.php
+++ b/maintenance/PopulateDatabase.php
@@ -38,6 +38,9 @@
 
$scoring = Scoring::instance();
$cache = Cache::instance();
+   $cache->setErrorCallback( function ( $mssg ) {
+   $this->output( "Scoring errored: $mssg\n" );
+   } );
$this->batchSize = $this->getOption( 'batch', 5000 );
$this->revisionLimit = $this->getOption( 'number', 1000 );
 
@@ -102,7 +105,7 @@
$this->output( "Processing $size revisions\n" );
 
$scores = $scoring->getScores( $revs );
-   $cache->storeScores( $scores, true );
+   $cache->storeScores( $scores );
}
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia1c0dee86fe32074c079d8c14253154d68c5045a
Gerrit-PatchSet: 9
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup 
Gerrit-Reviewer: Daniel Kinzler 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
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...parsoid[master]: Bump some minor / patch level versions of deps

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Bump some minor / patch level versions of deps
..


Bump some minor / patch level versions of deps

 * This is mainly to remove the nsp exception we added in,
   5bbaabcd9b71f857a799badfca1a4d2e95047868

Change-Id: I363fef38e0af8052ee329130525c763176911ab5
---
D .nsprc
M npm-shrinkwrap.json
M package.json
3 files changed, 194 insertions(+), 738 deletions(-)

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



diff --git a/.nsprc b/.nsprc
deleted file mode 100644
index f8ce643..000
--- a/.nsprc
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-   "exceptions": [
-   // Ignore this until a new request.js is released.
-   "https://nodesecurity.io/advisories/130;
-   ]
-}
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 9d6b614..f72fe55 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -27,12 +27,12 @@
   }
 },
 "body-parser": {
-  "version": "1.15.1",
-  "resolved": 
"https://registry.npmjs.org/body-parser/-/body-parser-1.15.1.tgz;,
+  "version": "1.15.2",
+  "resolved": 
"https://registry.npmjs.org/body-parser/-/body-parser-1.15.2.tgz;,
   "dependencies": {
 "bytes": {
-  "version": "2.3.0",
-  "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.3.0.tgz;
+  "version": "2.4.0",
+  "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.4.0.tgz;
 },
 "content-type": {
   "version": "1.0.2",
@@ -53,12 +53,16 @@
   "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.0.tgz;
 },
 "http-errors": {
-  "version": "1.4.0",
-  "resolved": 
"https://registry.npmjs.org/http-errors/-/http-errors-1.4.0.tgz;,
+  "version": "1.5.0",
+  "resolved": 
"https://registry.npmjs.org/http-errors/-/http-errors-1.5.0.tgz;,
   "dependencies": {
 "inherits": {
   "version": "2.0.1",
   "resolved": 
"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz;
+},
+"setprototypeof": {
+  "version": "1.0.1",
+  "resolved": 
"https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.1.tgz;
 },
 "statuses": {
   "version": "1.3.0",
@@ -81,12 +85,12 @@
   }
 },
 "qs": {
-  "version": "6.1.0",
-  "resolved": "https://registry.npmjs.org/qs/-/qs-6.1.0.tgz;
+  "version": "6.2.0",
+  "resolved": "https://registry.npmjs.org/qs/-/qs-6.2.0.tgz;
 },
 "raw-body": {
-  "version": "2.1.6",
-  "resolved": 
"https://registry.npmjs.org/raw-body/-/raw-body-2.1.6.tgz;,
+  "version": "2.1.7",
+  "resolved": 
"https://registry.npmjs.org/raw-body/-/raw-body-2.1.7.tgz;,
   "dependencies": {
 "unpipe": {
   "version": "1.0.0",
@@ -273,12 +277,12 @@
   }
 },
 "core-js": {
-  "version": "2.4.0",
-  "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.4.0.tgz;
+  "version": "2.4.1",
+  "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz;
 },
 "coveralls": {
-  "version": "2.11.9",
-  "resolved": 
"https://registry.npmjs.org/coveralls/-/coveralls-2.11.9.tgz;,
+  "version": "2.11.11",
+  "resolved": 
"https://registry.npmjs.org/coveralls/-/coveralls-2.11.11.tgz;,
   "dependencies": {
 "js-yaml": {
   "version": "3.0.1",
@@ -317,12 +321,16 @@
   "resolved": 
"https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz;
 },
 "request": {
-  "version": "2.67.0",
-  "resolved": 
"https://registry.npmjs.org/request/-/request-2.67.0.tgz;,
+  "version": "2.69.0",
+  "resolved": 
"https://registry.npmjs.org/request/-/request-2.69.0.tgz;,
   "dependencies": {
 "aws-sign2": {
   "version": "0.6.0",
   "resolved": 
"https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz;
+},
+"aws4": {
+  "version": "1.4.1",
+  "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.4.1.tgz;
 },
 "bl": {
   "version": "1.0.3",
@@ -515,8 +523,8 @@
   "resolved": 
"https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz;
 },
 "jsprim": {
-  "version": "1.2.2",
-  "resolved": 
"https://registry.npmjs.org/jsprim/-/jsprim-1.2.2.tgz;,
+  "version": "1.3.0",
+  "resolved": 
"https://registry.npmjs.org/jsprim/-/jsprim-1.3.0.tgz;,
   "dependencies": {
 "extsprintf": {
   "version": "1.0.2",
@@ -599,8 +607,8 @@
   

[MediaWiki-commits] [Gerrit] wikimedia/TransparencyReport-private[master]: new pie chart user page

2016-07-25 Thread Siddparmar (Code Review)
Siddparmar has uploaded a new change for review.

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

Change subject: new pie chart user page
..

new pie chart user page

Change-Id: I1c88fa3a48949f8a8e4c7b3ee85a758aaf95896e
---
A build/data/number_of_disclosures.csv
M build/fr/privacy.html
M build/javascripts/privacy.js
M build/privacy.html
M build/stylesheets/graph.css
M build/stylesheets/master.css
A source/data/number_of_disclosures.csv
M source/javascripts/privacy.js
M source/localizable/privacy.html.erb
M source/stylesheets/graph.css.scss
M source/stylesheets/master.css.scss
M source/stylesheets/variables.css.scss
12 files changed, 472 insertions(+), 22 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/wikimedia/TransparencyReport-private 
refs/changes/96/300996/1

diff --git a/build/data/number_of_disclosures.csv 
b/build/data/number_of_disclosures.csv
new file mode 100644
index 000..c34a9ab
--- /dev/null
+++ b/build/data/number_of_disclosures.csv
@@ -0,0 +1,5 @@
+key,value
+Individual threats,7
+Terrorist threats,2
+Other,2
+Suicide,1
\ No newline at end of file
diff --git a/build/fr/privacy.html b/build/fr/privacy.html
index 178b984..19d9469 100644
--- a/build/fr/privacy.html
+++ b/build/fr/privacy.html
@@ -99,7 +99,7 @@

 
 
-
+



@@ -351,15 +351,12 @@
 
Voluntary disclosures by type

-   Juillet - 
Décembre 2015
+   Janvier - Juin 
2016

-   
-   
-   
+   
+   


-   
-   
 
 
 
diff --git a/build/javascripts/privacy.js b/build/javascripts/privacy.js
index 857d75c..996b765 100644
--- a/build/javascripts/privacy.js
+++ b/build/javascripts/privacy.js
@@ -670,6 +670,173 @@
makeCircles ( data );
}
 
+   /*---Pie Chart-*/
+   pieChart = function (data) {
+   var wrapper = $('.pieChart'),
+   width = wrapper.width(),
+   height = wrapper.height(),
+   radius = Math.min(width, height) / 2;
+
+   var labelFactor, polylineFactor, arc, outerArc;
+
+   // this is to appropriately scale chart slices
+   if (width < 371) {
+
+   labelFactor = radius * 0.42;
+   polylineFactor = radius * 0.4;
+
+   arc = d3.svg.arc()
+   .outerRadius(radius * 0.35)
+   .innerRadius(radius * 0.01);
+
+   outerArc = d3.svg.arc()
+   .innerRadius(radius * 0.4)
+   .outerRadius(radius * 0.4);
+
+   }
+   else if (width < 431) {
+
+   labelFactor = radius * 0.5;
+   polylineFactor = radius * 0.48;
+
+   arc = d3.svg.arc()
+   .outerRadius(radius * 0.35)
+   .innerRadius(radius * 0.01);
+
+   outerArc = d3.svg.arc()
+   .innerRadius(radius * 0.45)
+   .outerRadius(radius * 0.45);
+
+   }
+   else if (width < 631) {
+
+   labelFactor = radius * 0.6;
+   polylineFactor = radius * 0.58;
+
+   arc = d3.svg.arc()
+   .outerRadius(radius * 0.5)
+   .innerRadius(radius * 0.35);
+
+   outerArc = d3.svg.arc()
+   .innerRadius(radius * 0.6)
+   .outerRadius(radius * 0.6);
+
+   } else {
+
+   labelFactor = radius;
+   polylineFactor = radius * 0.95;
+
+   arc = d3.svg.arc()
+   .outerRadius(radius * 0.6)
+   .innerRadius(radius * 0.4);
+
+   outerArc = d3.svg.arc()
+   .innerRadius(radius * 0.95)
+   .outerRadius(radius * 0.95);
+
+   }
+
+   var svg = d3.select('.pieChart').append('svg')
+   .attr({
+   'width': width,
+   'height': height
+   })
+   .append('g');
+
+   svg.attr('transform', 'translate(' + width/2 + ', ' + height/2 + 
')');
+
+   svg.append('g')
+   .attr('class', 'lines')
+   svg.append('g')
+   .attr('class', 'slices')
+   svg.append('g')
+   .attr('class', 'labels')
+
+   var colors = ['#375baf', '#ff6060', '#ffbe3c', '#259d9e'];
+
+   var pie = d3.layout.pie()
+   .value(function(d) {
+   return d[1];
+   })
+   .sort(null);
+
+   var slice = svg.select('.slices')
+   .datum(data)
+   .selectAll('path')
+   .data(pie);
+
+   slice
+   .enter().append('path')
+   .attr({
+   'fill': function(d, i) {
+   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove modulemessages from ApiParse and Output (deprecated i...

2016-07-25 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: Remove modulemessages from ApiParse and Output (deprecated in 
1.26)
..

Remove modulemessages from ApiParse and Output (deprecated in 1.26)

No uses of 'modulemessages', getModuleMessages() or addModuleMessages()
anywhere in Wikimedia Git.

Change-Id: I59420880f3545d1aabf9bcbea1e34b1475697d26
---
M RELEASE-NOTES-1.28
M includes/OutputPage.php
M includes/api/ApiParse.php
M includes/parser/ParserOutput.php
4 files changed, 2 insertions(+), 44 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/95/300995/1

diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28
index a20bec0..d311431 100644
--- a/RELEASE-NOTES-1.28
+++ b/RELEASE-NOTES-1.28
@@ -49,6 +49,8 @@
 === Bug fixes in 1.28 ===
 
 === Action API changes in 1.28 ===
+* Property 'modulemessages' from action=parse=modules was removed
+  (deprecated since 1.26).
 
 === Action API internal changes in 1.28 ===
 * Added a new hook, 'ApiMakeParserOptions', to allow extensions to better
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index ecc719a..f611980 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -605,29 +605,6 @@
}
 
/**
-* Get the list of module messages to include on this page
-*
-* @deprecated since 1.26 Obsolete
-* @param bool $filter
-* @param string|null $position
-* @return array Array of module names
-*/
-   public function getModuleMessages( $filter = false, $position = null ) {
-   wfDeprecated( __METHOD__, '1.26' );
-   return [];
-   }
-
-   /**
-* Load messages of one or more ResourceLoader modules.
-*
-* @deprecated since 1.26 Use addModules() instead
-* @param string|array $modules Module name (string) or array of module 
names
-*/
-   public function addModuleMessages( $modules ) {
-   wfDeprecated( __METHOD__, '1.26' );
-   }
-
-   /**
 * @return null|string ResourceLoader target
 */
public function getTarget() {
diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php
index 3e66cad..d53dbb4 100644
--- a/includes/api/ApiParse.php
+++ b/includes/api/ApiParse.php
@@ -375,9 +375,6 @@
$result_array['modules'] = array_values( array_unique( 
$p_result->getModules() ) );
$result_array['modulescripts'] = array_values( 
array_unique( $p_result->getModuleScripts() ) );
$result_array['modulestyles'] = array_values( 
array_unique( $p_result->getModuleStyles() ) );
-   // To be removed in 1.27
-   $result_array['modulemessages'] = [];
-   $this->setWarning( 'modulemessages is deprecated since 
MediaWiki 1.26' );
}
 
if ( isset( $prop['jsconfigvars'] ) ) {
@@ -461,7 +458,6 @@
'indicators' => 'ind',
'modulescripts' => 'm',
'modulestyles' => 'm',
-   'modulemessages' => 'm',
'properties' => 'pp',
'limitreportdata' => 'lr',
];
diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php
index 3462d10..73d4e69 100644
--- a/includes/parser/ParserOutput.php
+++ b/includes/parser/ParserOutput.php
@@ -367,15 +367,6 @@
return $this->mModuleStyles;
}
 
-   /**
-* @deprecated since 1.26 Obsolete
-* @return array
-*/
-   public function getModuleMessages() {
-   wfDeprecated( __METHOD__, '1.26' );
-   return [];
-   }
-
/** @since 1.23 */
public function getJsConfigVars() {
return $this->mJsConfigVars;
@@ -642,14 +633,6 @@
 
public function addModuleStyles( $modules ) {
$this->mModuleStyles = array_merge( $this->mModuleStyles, 
(array)$modules );
-   }
-
-   /**
-* @deprecated since 1.26 Use addModules() instead
-* @param string|array $modules
-*/
-   public function addModuleMessages( $modules ) {
-   wfDeprecated( __METHOD__, '1.26' );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I59420880f3545d1aabf9bcbea1e34b1475697d26
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/vagrant[master]: Thumbor config changes for plugins 0.1.4

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Thumbor config changes for plugins 0.1.4
..


Thumbor config changes for plugins 0.1.4

Bug: T132758
Change-Id: Ie4ac8da0b9c416c9caa179edfed3891ae64e02d8
---
M puppet/modules/role/manifests/thumbor.pp
M puppet/modules/role/settings/thumbor.yaml
M puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
M puppet/modules/thumbor/manifests/init.pp
M puppet/modules/thumbor/templates/thumbor.conf.erb
5 files changed, 46 insertions(+), 33 deletions(-)

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



diff --git a/puppet/modules/role/manifests/thumbor.pp 
b/puppet/modules/role/manifests/thumbor.pp
index d3712ad..e25a59b 100644
--- a/puppet/modules/role/manifests/thumbor.pp
+++ b/puppet/modules/role/manifests/thumbor.pp
@@ -36,12 +36,15 @@
 
 mediawiki::settings { 'thumbor':
 values => {
-'wgIgnoreImageErrors' => true,
-'wgDjvuRenderer'  => '/usr/bin/ddjvu',
-'wgDjvuDump'  => '/usr/bin/djvudump',
-'wgDjvuToXML' => '/usr/bin/djvutoxml',
-'wgDjvuTxt'   => '/usr/bin/djvutxt',
-'wgFileExtensions'=> [
+'wgTiffUseTiffinfo' => false,
+'wgIgnoreImageErrors'   => true,
+'wgDjvuRenderer'=> '/usr/bin/ddjvu',
+'wgDjvuDump'=> '/usr/bin/djvudump',
+'wgDjvuToXML'   => '/usr/bin/djvutoxml',
+'wgDjvuTxt' => '/usr/bin/djvutxt',
+'wgDjvuPostProcessor'   => '/usr/bin/ppmtojpeg',
+'wgDjvuOutputExtension' => 'jpg',
+'wgFileExtensions'  => [
 'apng',
 'png',
 'gif',
diff --git a/puppet/modules/role/settings/thumbor.yaml 
b/puppet/modules/role/settings/thumbor.yaml
index 75e8809..0ab1c48 100644
--- a/puppet/modules/role/settings/thumbor.yaml
+++ b/puppet/modules/role/settings/thumbor.yaml
@@ -1,4 +1,4 @@
-vagrant_ram: 512
+vagrant_ram: 768
 forward_ports:
   :  # thumbor
   6081: 6081 # varnish
diff --git a/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py 
b/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
index 35339d4..2e81747 100644
--- a/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
+++ b/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
@@ -130,14 +130,16 @@
 else:
 self.logger.warn("no sitelang match on encodedurl: %s" % 
encodedurl)
 
-# ok, call the encoded url
-upcopy = opener.open(encodedurl)
-self.logger.debug("Mediawiki: %d %s" % (upcopy.getcode(), 
encodedurl))
-
+# call thumbor first, otherwise if Mediawiki image scalers return 
an error,
+# thumbor doesn't get a change to try to generate that thumbnail
 if self.thumborhost:
 if not self.thumbor_wiki_list or '-'.join((proj, lang)) in 
self.thumbor_wiki_list:
 # call Thumbor blindly, don't look at the result
 eventlet.spawn_n(thumbor_opener.open, thumbor_encodedurl)
+
+# ok, call the encoded url
+upcopy = opener.open(encodedurl)
+self.logger.debug("Mediawiki: %d %s" % (upcopy.getcode(), 
encodedurl))
 except urllib2.HTTPError, error:
 # copy the urllib2 HTTPError into a webob HTTPError class as-is
 
diff --git a/puppet/modules/thumbor/manifests/init.pp 
b/puppet/modules/thumbor/manifests/init.pp
index 0ea79ce..0a9e475 100644
--- a/puppet/modules/thumbor/manifests/init.pp
+++ b/puppet/modules/thumbor/manifests/init.pp
@@ -41,9 +41,6 @@
 # For GIF engine
 require_package('gifsicle')
 
-# For SVG engine
-require_package('librsvg2-bin')
-
 # For Video engine
 require_package('ffmpeg')
 
@@ -51,13 +48,27 @@
 require_package('xcftools')
 
 # For DjVu engine
-require_package('djvulibre-bin')
+require_package('libdjvulibre-dev')
+require_package('cython')
 
 # For Ghostscript engine (PDF)
 require_package('ghostscript')
 
 # For pycurl, a dependency of thumbor
 require_package('libcurl4-gnutls-dev')
+
+# For VIPS engine
+apt::ppa { 'mwhiteley/vips': }
+package { 'gir1.2-vips-8.0':
+require => Apt::Ppa['mwhiteley/vips'],
+}
+
+# For Mediawiki's IM/RSVG SVG support
+require_package('librsvg2-bin')
+
+# For Mediawiki's DJVU support
+require_package('djvulibre-bin')
+require_package('netpbm')
 
 # For lxml, a dependency of thumbor-plugins
 require_package('libxml2-dev', 'libxslt1-dev')
@@ -79,7 +90,7 @@
 virtualenv::environment { $deploy_dir:
 ensure   => present,
 packages => [
-'numpy',
+'pgi',
 'raven',
 'python-swiftclient',
 'git+git://github.com/gi11es/thumbor.git',
@@ -87,13 

[MediaWiki-commits] [Gerrit] research...wheels[master]: Updates revscoring to 1.2.8 and deltas to 0.3.10

2016-07-25 Thread Ladsgroup (Code Review)
Ladsgroup has submitted this change and it was merged.

Change subject: Updates revscoring to 1.2.8 and deltas to 0.3.10
..


Updates revscoring to 1.2.8 and deltas to 0.3.10

Change-Id: I8750cd12782faf6379895737015de096d9ae51bd
---
A deltas-0.3.10-py2.py3-none-any.whl
D deltas-0.3.9-py2.py3-none-any.whl
D revscoring-1.2.6-py2.py3-none-any.whl
A revscoring-1.2.8-py2.py3-none-any.whl
4 files changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/deltas-0.3.10-py2.py3-none-any.whl 
b/deltas-0.3.10-py2.py3-none-any.whl
new file mode 100644
index 000..6167695
--- /dev/null
+++ b/deltas-0.3.10-py2.py3-none-any.whl
Binary files differ
diff --git a/deltas-0.3.9-py2.py3-none-any.whl 
b/deltas-0.3.9-py2.py3-none-any.whl
deleted file mode 100644
index ae881d2..000
--- a/deltas-0.3.9-py2.py3-none-any.whl
+++ /dev/null
Binary files differ
diff --git a/revscoring-1.2.6-py2.py3-none-any.whl 
b/revscoring-1.2.6-py2.py3-none-any.whl
deleted file mode 100644
index 240dec5..000
--- a/revscoring-1.2.6-py2.py3-none-any.whl
+++ /dev/null
Binary files differ
diff --git a/revscoring-1.2.8-py2.py3-none-any.whl 
b/revscoring-1.2.8-py2.py3-none-any.whl
new file mode 100644
index 000..6ef196b
--- /dev/null
+++ b/revscoring-1.2.8-py2.py3-none-any.whl
Binary files differ

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8750cd12782faf6379895737015de096d9ae51bd
Gerrit-PatchSet: 2
Gerrit-Project: research/ores/wheels
Gerrit-Branch: master
Gerrit-Owner: Halfak 
Gerrit-Reviewer: Ladsgroup 

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


[MediaWiki-commits] [Gerrit] wikimedia...php-queue[master]: Reword docs; stop doing popAtomic(function () {})

2016-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Reword docs; stop doing popAtomic(function () {})
..


Reword docs; stop doing popAtomic(function () {})

Change-Id: I9d9275c6106871835c735777828279f98e106fb4
---
M src/PHPQueue/Interfaces/AtomicReadBuffer.php
M test/PHPQueue/Backend/PDOBaseTest.php
2 files changed, 12 insertions(+), 10 deletions(-)

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



diff --git a/src/PHPQueue/Interfaces/AtomicReadBuffer.php 
b/src/PHPQueue/Interfaces/AtomicReadBuffer.php
index c644fa6..901e193 100644
--- a/src/PHPQueue/Interfaces/AtomicReadBuffer.php
+++ b/src/PHPQueue/Interfaces/AtomicReadBuffer.php
@@ -12,17 +12,19 @@
  *
  * @param callable $callback A processing function with the signature,
  * void function( $message ) throws Exception
- * This function accepts an array $message, the next message to be
- * popped from your buffer.  In normal operation, the message is popped
- * after the function returns successfully, which gives us the
- * guarantee that each message is consumed successfully "at least
- * once".  The processor callback can handle a message by diverting to
- * a reject sink, of course, a clean return only means that the
- * callback has completed some action locally considered correct, not
- * that there were no errors in processing.
+ * This function accepts an array $message, the next message popped
+ * from your buffer.  In normal operation, the message is popped after
+ * the function returns successfully, which gives us the guarantee that
+ * each message is consumed successfully "at least once".  The
+ * processor callback might either handle a message and consume it,
+ * reject and divert to a dead-letter queue, or raise an exception. The
+ * contract is that a clean function return means that the callback has
+ * completed its purpose and the message can be dropped without further
+ * processing.
  * Throwing an exception from callback means that we were unable or
  * chose not to handle the message at all, and it should be considered
- * unconsumed.  In this case it is not popped when popAtomic returns.
+ * unconsumed.  In this case it is not popped from the queue when
+ * popAtomic returns.
  * If there are no messages in the queue, the callback is not run.
  *
  * @return array|null popAtomic returns the currently popped record as a
diff --git a/test/PHPQueue/Backend/PDOBaseTest.php 
b/test/PHPQueue/Backend/PDOBaseTest.php
index 5a420a1..267e952 100644
--- a/test/PHPQueue/Backend/PDOBaseTest.php
+++ b/test/PHPQueue/Backend/PDOBaseTest.php
@@ -139,7 +139,7 @@
 }
 
 // Punchline: data should still be available for the retry pop.
-$this->assertEquals($data, $this->object->popAtomic(function 
($message) {}));
+$this->assertEquals($data, $this->object->pop());
 }
 
 /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9d9275c6106871835c735777828279f98e106fb4
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/fundraising/php-queue
Gerrit-Branch: master
Gerrit-Owner: Awight 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: jenkins-bot <>

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


  1   2   3   4   >