[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make newExternalLB() public to match newMainLB()

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Make newExternalLB() public to match newMainLB()
..

Make newExternalLB() public to match newMainLB()

Change-Id: I7e46c947882c5de6e4d25a7110c2a2558df7ad76
---
M includes/libs/rdbms/lbfactory/LBFactory.php
1 file changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/66/312466/1

diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php 
b/includes/libs/rdbms/lbfactory/LBFactory.php
index aa932aa..fd89f33 100644
--- a/includes/libs/rdbms/lbfactory/LBFactory.php
+++ b/includes/libs/rdbms/lbfactory/LBFactory.php
@@ -157,6 +157,11 @@
 * Create a new load balancer object. The resulting object will be 
untracked,
 * not chronology-protected, and the caller is responsible for cleaning 
it up.
 *
+* This method is for only advanced usage and callers should almost 
always use
+* getMainLB() instead. This method can be useful when a table is used 
as a key/value
+* store. In that cases, one might want to query it in autocommit mode 
(DBO_TRX off)
+* but still use DBO_TRX transaction rounds on other tables.
+*
 * @param bool|string $domain Domain ID, or false for the current domain
 * @return ILoadBalancer
 */
@@ -175,11 +180,16 @@
 * untracked, not chronology-protected, and the caller is responsible 
for
 * cleaning it up.
 *
+* This method is for only advanced usage and callers should almost 
always use
+* getExternalLB() instead. This method can be useful when a table is 
used as a
+* key/value store. In that cases, one might want to query it in 
autocommit mode
+* (DBO_TRX off) but still use DBO_TRX transaction rounds on other 
tables.
+*
 * @param string $cluster External storage cluster, or false for core
 * @param bool|string $domain Domain ID, or false for the current domain
 * @return ILoadBalancer
 */
-   abstract protected function newExternalLB( $cluster, $domain = false );
+   abstract public function newExternalLB( $cluster, $domain = false );
 
/**
 * Get a cached (tracked) load balancer for external storage

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e46c947882c5de6e4d25a7110c2a2558df7ad76
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Inject "srvCache" and local DB connections into LockManagerDB

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

Change subject: Inject "srvCache" and local DB connections into LockManagerDB
..


Inject "srvCache" and local DB connections into LockManagerDB

* Also simplified the srvCache variable usage to be unconditional.
* The wfRandomString() call has also been replaced.

Change-Id: I17e83b17ec549906ee200bbe9eb2f0b151423e26
---
M includes/DefaultSettings.php
M includes/filebackend/lockmanager/DBLockManager.php
M includes/filebackend/lockmanager/LockManagerGroup.php
M includes/filebackend/lockmanager/MySqlLockManager.php
4 files changed, 49 insertions(+), 52 deletions(-)

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



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 135c3e5..be858c2 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -644,6 +644,10 @@
  * See LockManager::__construct() for more details.
  * Additional parameters are specific to the lock manager class used.
  * These settings should be global to all wikis.
+ *
+ * When using DBLockManager, the 'dbsByBucket' map can reference 
'localDBMaster' as
+ * a peer database in each bucket. This will result in an extra connection to 
the domain
+ * that the LockManager services, which must also be a valid wiki ID.
  */
 $wgLockManagers = [];
 
diff --git a/includes/filebackend/lockmanager/DBLockManager.php 
b/includes/filebackend/lockmanager/DBLockManager.php
index 4667dde..c36ff48 100644
--- a/includes/filebackend/lockmanager/DBLockManager.php
+++ b/includes/filebackend/lockmanager/DBLockManager.php
@@ -36,7 +36,7 @@
  * @since 1.19
  */
 abstract class DBLockManager extends QuorumLockManager {
-   /** @var array[] Map of DB names to server config */
+   /** @var array[]|IDatabase[] Map of (DB names => server config or 
IDatabase) */
protected $dbServers; // (DB name => server config array)
/** @var BagOStuff */
protected $statusCache;
@@ -63,19 +63,15 @@
 * - flags   : DB flags (see DatabaseBase)
 *   - dbsByBucket : Array of 1-16 consecutive integer keys, starting 
from 0,
 *   each having an odd-numbered list of DB names 
(peers) as values.
-*   Any DB named 'localDBMaster' will automatically 
use the DB master
-*   settings for this wiki (without the need for a 
dbServers entry).
-*   Only use 'localDBMaster' if the domain is a valid 
wiki ID.
 *   - lockExpiry  : Lock timeout (seconds) for dropped connections. 
[optional]
 *   This tells the DB server how long to wait before 
assuming
 *   connection failure and releasing all the locks for 
a session.
+*   - srvCache: A BagOStuff instance using APC or the like.
 */
public function __construct( array $config ) {
parent::__construct( $config );
 
-   $this->dbServers = isset( $config['dbServers'] )
-   ? $config['dbServers']
-   : []; // likely just using 'localDBMaster'
+   $this->dbServers = $config['dbServers'];
// Sanitize srvsByBucket config to prevent PHP errors
$this->srvsByBucket = array_filter( $config['dbsByBucket'], 
'is_array' );
$this->srvsByBucket = array_values( $this->srvsByBucket ); // 
consecutive
@@ -90,19 +86,25 @@
? 60 // pick a safe-ish number to match DB timeout 
default
: $this->lockExpiry; // cover worst case
 
-   foreach ( $this->srvsByBucket as $bucket ) {
-   if ( count( $bucket ) > 1 ) { // multiple peers
-   // Tracks peers that couldn't be queried 
recently to avoid lengthy
-   // connection timeouts. This is useless if each 
bucket has one peer.
-   $this->statusCache = 
ObjectCache::getLocalServerInstance();
-   break;
-   }
-   }
+   // Tracks peers that couldn't be queried recently to avoid 
lengthy
+   // connection timeouts. This is useless if each bucket has one 
peer.
+   $this->statusCache = isset( $config['srvCache'] )
+   ? $config['srvCache']
+   : new HashBagOStuff();
 
-   $this->session = wfRandomString( 31 );
+   $random = [];
+   for ( $i = 1; $i <= 5; ++$i ) {
+   $random[] = mt_rand( 0, 0xFFF );
+   }
+   $this->session = substr( md5( implode( '-', $random ) ), 0, 31 
);
}
 
-   // @todo change this code to work in one batch
+   /**
+* @TODO change this code to work in one 

[MediaWiki-commits] [Gerrit] mediawiki...OpenID[master]: Use openConnection() instead of making a new LoadBalancer

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Use openConnection() instead of making a new LoadBalancer
..

Use openConnection() instead of making a new LoadBalancer

Change-Id: I18422f7283a9737fee903f0c25cba24b7abaad9e
---
M SpecialOpenID.body.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenID 
refs/changes/65/312465/1

diff --git a/SpecialOpenID.body.php b/SpecialOpenID.body.php
index fb4d40c..5e81d59 100644
--- a/SpecialOpenID.body.php
+++ b/SpecialOpenID.body.php
@@ -58,8 +58,8 @@
require_once( 'Auth/OpenID/SQLiteStore.php' );
return new Auth_OpenID_SQLiteStore( $db );
} else {
-   $lb = wfGetLBFactory()->newMainLB();
-   $db = new MediaWikiOpenIDDatabaseConnection( 
$lb->getConnection( DB_MASTER ) );
+   $lb = wfGetLBFactory()->getMainLB();
+   $db = new MediaWikiOpenIDDatabaseConnection( 
$lb->openConnection( DB_MASTER ) );
 
switch( $wgDBtype ) {
case 'mysql':

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I18422f7283a9737fee903f0c25cba24b7abaad9e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenID
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move FileBackendMultiWrite to /libs

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Move FileBackendMultiWrite to /libs
..

Move FileBackendMultiWrite to /libs

Change-Id: I8079693a62db390028cd9f72b2bd7a81ae1164c3
---
M autoload.php
M includes/DefaultSettings.php
M includes/filebackend/FileBackendGroup.php
R includes/libs/filebackend/FileBackendMultiWrite.php
4 files changed, 15 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/64/312464/1

diff --git a/autoload.php b/autoload.php
index a352884..292f12e 100644
--- a/autoload.php
+++ b/autoload.php
@@ -458,7 +458,7 @@
'FileBackendDBRepoWrapper' => __DIR__ . 
'/includes/filerepo/FileBackendDBRepoWrapper.php',
'FileBackendError' => __DIR__ . 
'/includes/libs/filebackend/FileBackendError.php',
'FileBackendGroup' => __DIR__ . 
'/includes/filebackend/FileBackendGroup.php',
-   'FileBackendMultiWrite' => __DIR__ . 
'/includes/filebackend/FileBackendMultiWrite.php',
+   'FileBackendMultiWrite' => __DIR__ . 
'/includes/libs/filebackend/FileBackendMultiWrite.php',
'FileBackendStore' => __DIR__ . 
'/includes/filebackend/FileBackendStore.php',
'FileBackendStoreOpHandle' => __DIR__ . 
'/includes/filebackend/FileBackendStore.php',
'FileBackendStoreShardDirIterator' => __DIR__ . 
'/includes/filebackend/FileBackendStore.php',
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index aa54629..1cb2f7d 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -616,6 +616,11 @@
  * Additional parameters are specific to the file backend class used.
  * These settings should be global to all wikis when possible.
  *
+ * FileBackendMultiWrite::__construct() is augmented with a 'template' option 
that
+ * can be used in any of the values of the 'backends' array. Its value is the 
name of
+ * another backend in $wgFileBackends. When set, it pre-fills the array with 
all of the
+ * configuration of the named backend. Explicitly set values in the array take 
precedence.
+ *
  * There are two particularly important aspects about each backend:
  *   - a) Whether it is fully qualified or wiki-relative.
  *By default, the paths of files are relative to the current wiki,
diff --git a/includes/filebackend/FileBackendGroup.php 
b/includes/filebackend/FileBackendGroup.php
index d0a99d4..2099e6f 100644
--- a/includes/filebackend/FileBackendGroup.php
+++ b/includes/filebackend/FileBackendGroup.php
@@ -169,6 +169,15 @@
$config['mimeCallback'] = [ $this, 'guessMimeInternal' 
];
$config['statusWrapper'] = [ 'Status', 'wrap' ];
$config['tmpDirectory'] = wfTempDir();
+   if ( $class === 'FileBackendMultiWrite' ) {
+   foreach ( $config['backends'] as $index => 
$beConfig ) {
+   if ( isset( $beConfig['template'] ) ) {
+   // Config is just a modified 
version of a registered backend's.
+   // This should only be used 
when that config is used only by this backend.
+   $config['backends'][$index] += 
$this->config( $beConfig['template'] );
+   }
+   }
+   }
 
$this->backends[$name]['instance'] = new $class( 
$config );
}
diff --git a/includes/filebackend/FileBackendMultiWrite.php 
b/includes/libs/filebackend/FileBackendMultiWrite.php
similarity index 97%
rename from includes/filebackend/FileBackendMultiWrite.php
rename to includes/libs/filebackend/FileBackendMultiWrite.php
index 52b84d4..3234b72 100644
--- a/includes/filebackend/FileBackendMultiWrite.php
+++ b/includes/libs/filebackend/FileBackendMultiWrite.php
@@ -74,9 +74,6 @@
 *- class : The name of the backend 
class
 *- isMultiMaster : This must be set for one 
backend.
 *- readAffinity  : Use this for reads without 
'latest' set.
-*- template: : If given a backend name, 
this will use
-*  the config of that backend 
as a template.
-*  Values specified here take 
precedence.
 *   - syncChecks : Integer bitfield of internal backend sync 
checks to perform.
 *  Possible bits include the 
FileBackendMultiWrite::CHECK_* constants.
 *  There are constants for SIZE, TIME, and SHA1.
@@ -107,11 +104,6 @@
// to keep these backends hidden from outside the proxy.

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [WIP] Create ShellExec service

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

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

Change subject: [WIP] Create ShellExec service
..

[WIP] Create ShellExec service

To replace most of the wfShell* global functions.

Change-Id: I7dccb2b67a4173a8a89b035e444fbda9102e4d0f
---
M includes/GlobalFunctions.php
M includes/MediaWikiServices.php
M includes/ServiceWiring.php
A includes/ShellExec.php
M tests/phpunit/includes/MediaWikiServicesTest.php
5 files changed, 484 insertions(+), 282 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/63/312463/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 6e8ce8f..fb5e34c 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -26,6 +26,7 @@
 
 use Liuggio\StatsdClient\Sender\SocketSender;
 use MediaWiki\Logger\LoggerFactory;
+use MediaWiki\MediaWikiServices;
 use MediaWiki\Session\SessionManager;
 
 // Hide compatibility functions from Doxygen
@@ -2194,6 +2195,8 @@
 }
 
 /**
+ * @deprecated since 1.28, use ShellExec::escapeShellArg()
+ *
  * Windows-compatible version of escapeshellarg()
  * Windows doesn't recognise single-quotes in the shell, but the 
escapeshellarg()
  * function puts single quotes in regardless of OS.
@@ -2205,83 +2208,21 @@
  * @return string
  */
 function wfEscapeShellArg( /*...*/ ) {
-   wfInitShellLocale();
-
-   $args = func_get_args();
-   if ( count( $args ) === 1 && is_array( reset( $args ) ) ) {
-   // If only one argument has been passed, and that argument is 
an array,
-   // treat it as a list of arguments
-   $args = reset( $args );
-   }
-
-   $first = true;
-   $retVal = '';
-   foreach ( $args as $arg ) {
-   if ( !$first ) {
-   $retVal .= ' ';
-   } else {
-   $first = false;
-   }
-
-   if ( wfIsWindows() ) {
-   // Escaping for an MSVC-style command line parser and 
CMD.EXE
-   // @codingStandardsIgnoreStart For long URLs
-   // Refs:
-   //  * 
http://web.archive.org/web/20020708081031/http://mailman.lyra.org/pipermail/scite-interest/2002-March/000436.html
-   //  * 
http://technet.microsoft.com/en-us/library/cc723564.aspx
-   //  * T15518
-   //  * CR r63214
-   // Double the backslashes before any double quotes. 
Escape the double quotes.
-   // @codingStandardsIgnoreEnd
-   $tokens = preg_split( '/(*")/', $arg, -1, 
PREG_SPLIT_DELIM_CAPTURE );
-   $arg = '';
-   $iteration = 0;
-   foreach ( $tokens as $token ) {
-   if ( $iteration % 2 == 1 ) {
-   // Delimiter, a double quote preceded 
by zero or more slashes
-   $arg .= str_replace( '\\', '', 
substr( $token, 0, -1 ) ) . '\\"';
-   } elseif ( $iteration % 4 == 2 ) {
-   // ^ in $token will be outside quotes, 
need to be escaped
-   $arg .= str_replace( '^', '^^', $token 
);
-   } else { // $iteration % 4 == 0
-   // ^ in $token will appear inside 
double quotes, so leave as is
-   $arg .= $token;
-   }
-   $iteration++;
-   }
-   // Double the backslashes before the end of the string, 
because
-   // we will soon add a quote
-   $m = [];
-   if ( preg_match( '/^(.*?)(+)$/', $arg, $m ) ) {
-   $arg = $m[1] . str_replace( '\\', '', $m[2] 
);
-   }
-
-   // Add surrounding quotes
-   $retVal .= '"' . $arg . '"';
-   } else {
-   $retVal .= escapeshellarg( $arg );
-   }
-   }
-   return $retVal;
+   $shellExec = MediaWikiServices::getInstance()->getShellExec();
+   return call_user_func_array( [ $shellExec, 'escapeShellArg' ], 
func_get_args() );
 }
 
 /**
+ * @deprecated since 1.28, use ShellExec::isDisabled()
+ *
  * Check if wfShellExec() is effectively disabled via php.ini config
  *
  * @return bool|string False or 'disabled'
  * @since 1.22
  */
 function wfShellExecDisabled() {
-   static $disabled = null;
-   if ( is_null( $disabled ) ) {
-   if ( !function_exists( 'proc_open' ) ) {
-   wfDebug( "proc_open() is disabled\n" );
-   

[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.20]: Call setTransactionTicket() on DeferredUpdates sub-queue ite...

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

Change subject: Call setTransactionTicket() on DeferredUpdates sub-queue items 
too
..


Call setTransactionTicket() on DeferredUpdates sub-queue items too

This should lower the rate of "does not have outer scope" log
warnings in DBPerformance.

Also add traces to such logs.

Change-Id: I7d21ea745cae07e0fbbe4cd8de82e93f1d10e0a5
---
M includes/deferred/DeferredUpdates.php
M includes/libs/rdbms/lbfactory/LBFactory.php
2 files changed, 10 insertions(+), 2 deletions(-)

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



diff --git a/includes/deferred/DeferredUpdates.php 
b/includes/deferred/DeferredUpdates.php
index d24ebde..8a761f5 100644
--- a/includes/deferred/DeferredUpdates.php
+++ b/includes/deferred/DeferredUpdates.php
@@ -214,6 +214,10 @@
$firstKey = key( 
self::$executeContext['subqueue'] );
unset( 
self::$executeContext['subqueue'][$firstKey] );
 
+   if ( $subUpdate instanceof 
DataUpdate ) {
+   
$subUpdate->setTransactionTicket( $ticket );
+   }
+
$guiError = self::runUpdate( 
$subUpdate, $lbFactory, $stage );
$reportableError = 
$reportableError ?: $guiError;
}
diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php 
b/includes/libs/rdbms/lbfactory/LBFactory.php
index cf9a298..f584865 100644
--- a/includes/libs/rdbms/lbfactory/LBFactory.php
+++ b/includes/libs/rdbms/lbfactory/LBFactory.php
@@ -515,7 +515,9 @@
 */
public function getEmptyTransactionTicket( $fname ) {
if ( $this->hasMasterChanges() ) {
-   $this->queryLogger->error( __METHOD__ . ": $fname does 
not have outer scope." );
+   $this->queryLogger->error( __METHOD__ . ": $fname does 
not have outer scope.\n" .
+   ( new RuntimeException() )->getTraceAsString() 
);
+
return null;
}
 
@@ -535,7 +537,9 @@
 */
public function commitAndWaitForReplication( $fname, $ticket, array 
$opts = [] ) {
if ( $ticket !== $this->ticket ) {
-   $this->perfLogger->error( __METHOD__ . ": $fname does 
not have outer scope." );
+   $this->perfLogger->error( __METHOD__ . ": $fname does 
not have outer scope.\n" .
+   ( new RuntimeException() )->getTraceAsString() 
);
+
return;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7d21ea745cae07e0fbbe4cd8de82e93f1d10e0a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Aaron Schulz 
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]: Reduce queries in CategoryViewer via addGoodLinkObjFromRow()

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

Change subject: Reduce queries in CategoryViewer via addGoodLinkObjFromRow()
..


Reduce queries in CategoryViewer via addGoodLinkObjFromRow()

Change-Id: Id782b50f166efbee6c9f8b9b263f09fc5fb5e3f2
---
M includes/CategoryViewer.php
1 file changed, 17 insertions(+), 4 deletions(-)

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



diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php
index a8e988f..53e855b 100644
--- a/includes/CategoryViewer.php
+++ b/includes/CategoryViewer.php
@@ -19,6 +19,7 @@
  *
  * @file
  */
+use MediaWiki\MediaWikiServices;
 
 class CategoryViewer extends ContextSource {
/** @var int */
@@ -317,10 +318,19 @@
 
$res = $dbr->select(
[ 'page', 'categorylinks', 'category' ],
-   [ 'page_id', 'page_title', 'page_namespace', 
'page_len',
-   'page_is_redirect', 'cl_sortkey', 
'cat_id', 'cat_title',
-   'cat_subcats', 'cat_pages', 'cat_files',
-   'cl_sortkey_prefix', 'cl_collation' ],
+   array_merge(
+   LinkCache::getSelectFields(),
+   [
+   'cl_sortkey',
+   'cat_id',
+   'cat_title',
+   'cat_subcats',
+   'cat_pages',
+   'cat_files',
+   'cl_sortkey_prefix',
+   'cl_collation'
+   ]
+   ),
array_merge( [ 'cl_to' => 
$this->title->getDBkey() ], $extraConds ),
__METHOD__,
[
@@ -338,10 +348,13 @@
);
 
Hooks::run( 'CategoryViewer::doCategoryQuery', [ $type, 
$res ] );
+   $linkCache = 
MediaWikiServices::getInstance()->getLinkCache();
 
$count = 0;
foreach ( $res as $row ) {
$title = Title::newFromRow( $row );
+   $linkCache->addGoodLinkObjFromRow( $title, $row 
);
+
if ( $row->cl_collation === '' ) {
// Hack to make sure that while 
updating from 1.16 schema
// and db is inconsistent, that the sky 
doesn't fall.

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Call setTransactionTicket() on DeferredUpdates sub-queue ite...

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

Change subject: Call setTransactionTicket() on DeferredUpdates sub-queue items 
too
..


Call setTransactionTicket() on DeferredUpdates sub-queue items too

This should lower the rate of "does not have outer scope" log
warnings in DBPerformance.

Also add traces to such logs.

Change-Id: I7d21ea745cae07e0fbbe4cd8de82e93f1d10e0a5
---
M includes/deferred/DeferredUpdates.php
M includes/libs/rdbms/lbfactory/LBFactory.php
2 files changed, 10 insertions(+), 2 deletions(-)

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



diff --git a/includes/deferred/DeferredUpdates.php 
b/includes/deferred/DeferredUpdates.php
index d24ebde..8a761f5 100644
--- a/includes/deferred/DeferredUpdates.php
+++ b/includes/deferred/DeferredUpdates.php
@@ -214,6 +214,10 @@
$firstKey = key( 
self::$executeContext['subqueue'] );
unset( 
self::$executeContext['subqueue'][$firstKey] );
 
+   if ( $subUpdate instanceof 
DataUpdate ) {
+   
$subUpdate->setTransactionTicket( $ticket );
+   }
+
$guiError = self::runUpdate( 
$subUpdate, $lbFactory, $stage );
$reportableError = 
$reportableError ?: $guiError;
}
diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php 
b/includes/libs/rdbms/lbfactory/LBFactory.php
index d75ba93..aa932aa 100644
--- a/includes/libs/rdbms/lbfactory/LBFactory.php
+++ b/includes/libs/rdbms/lbfactory/LBFactory.php
@@ -519,7 +519,9 @@
 */
public function getEmptyTransactionTicket( $fname ) {
if ( $this->hasMasterChanges() ) {
-   $this->queryLogger->error( __METHOD__ . ": $fname does 
not have outer scope." );
+   $this->queryLogger->error( __METHOD__ . ": $fname does 
not have outer scope.\n" .
+   ( new RuntimeException() )->getTraceAsString() 
);
+
return null;
}
 
@@ -539,7 +541,9 @@
 */
public function commitAndWaitForReplication( $fname, $ticket, array 
$opts = [] ) {
if ( $ticket !== $this->ticket ) {
-   $this->perfLogger->error( __METHOD__ . ": $fname does 
not have outer scope." );
+   $this->perfLogger->error( __METHOD__ . ": $fname does 
not have outer scope.\n" .
+   ( new RuntimeException() )->getTraceAsString() 
);
+
return;
}
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add IMaintainableDatabase for non-OLTP type methods

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Add IMaintainableDatabase for non-OLTP type methods
..

Add IMaintainableDatabase for non-OLTP type methods

Change-Id: I4cbdfd7a40af17269c527df6e1c3c5644672b8a7
---
M autoload.php
M includes/libs/rdbms/database/Database.php
M includes/libs/rdbms/database/IDatabase.php
A includes/libs/rdbms/database/IMaintainableDatabase.php
4 files changed, 200 insertions(+), 116 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/62/312462/1

diff --git a/autoload.php b/autoload.php
index a352884..db29f3d 100644
--- a/autoload.php
+++ b/autoload.php
@@ -585,6 +585,7 @@
'IJobSpecification' => __DIR__ . 
'/includes/jobqueue/JobSpecification.php',
'ILoadBalancer' => __DIR__ . 
'/includes/libs/rdbms/loadbalancer/ILoadBalancer.php',
'ILoadMonitor' => __DIR__ . 
'/includes/libs/rdbms/loadmonitor/ILoadMonitor.php',
+   'IMaintainableDatabase' => __DIR__ . 
'/includes/libs/rdbms/database/IMaintainableDatabase.php',
'IP' => __DIR__ . '/includes/libs/IP.php',
'IPSet' => __DIR__ . '/includes/compat/IPSetCompat.php',
'IPTC' => __DIR__ . '/includes/media/IPTC.php',
diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index f56f380..ae13124 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -27,10 +27,12 @@
 use Psr\Log\LoggerInterface;
 
 /**
- * Database abstraction object
+ * Relational database abstraction object
+ *
  * @ingroup Database
+ * @since 1.28
  */
-abstract class Database implements IDatabase, LoggerAwareInterface {
+abstract class Database implements IDatabase, IMaintainableDatabase, 
LoggerAwareInterface {
/** Number of times to re-try an operation in case of deadlock */
const DEADLOCK_TRIES = 4;
/** Minimum time to wait before retry, in microseconds */
@@ -1673,25 +1675,6 @@
return $this->mServer;
}
 
-   /**
-* Format a table name ready for use in constructing an SQL query
-*
-* This does two important things: it quotes the table names to clean 
them up,
-* and it adds a table prefix if only given a table name with no quotes.
-*
-* All functions of this object which require a table name call this 
function
-* themselves. Pass the canonical name to such functions. This is only 
needed
-* when calling query() directly.
-*
-* @note This function does not sanitize user input. It is not safe to 
use
-*   this function to escape user input.
-* @param string $name Database table name
-* @param string $format One of:
-*   quoted - Automatically pass the table name through 
addIdentifierQuotes()
-*so that it can be used in a query.
-*   raw - Do not add identifier quotes to the table name
-* @return string Full database name
-*/
public function tableName( $name, $format = 'quoted' ) {
# Skip the entire process when we have a string quoted on both 
ends.
# Note that we check the end so that we will still quote any 
use of
@@ -1772,17 +1755,6 @@
return $tableName;
}
 
-   /**
-* Fetch a number of table names into an array
-* This is handy when you need to construct SQL for joins
-*
-* Example:
-* extract( $dbr->tableNames( 'user', 'watchlist' ) );
-* $sql = "SELECT wl_namespace,wl_title FROM $watchlist,$user
-* WHERE wl_user=user_id AND wl_user=$nameWithQuotes";
-*
-* @return array
-*/
public function tableNames() {
$inArray = func_get_args();
$retVal = [];
@@ -1794,17 +1766,6 @@
return $retVal;
}
 
-   /**
-* Fetch a number of table names into an zero-indexed numerical array
-* This is handy when you need to construct SQL for joins
-*
-* Example:
-* list( $user, $watchlist ) = $dbr->tableNamesN( 'user', 'watchlist' );
-* $sql = "SELECT wl_namespace,wl_title FROM $watchlist,$user
-* WHERE wl_user=user_id AND wl_user=$nameWithQuotes";
-*
-* @return array
-*/
public function tableNamesN() {
$inArray = func_get_args();
$retVal = [];
@@ -2238,13 +2199,6 @@
$this->query( $sql, $fname );
}
 
-   /**
-* Returns the size of a text field, or -1 for "unlimited"
-*
-* @param string $table
-* @param string $field
-* @return int
-*/
public function textFieldSize( $table, $field ) {
$table = $this->tableName( $table );
 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: upload storage: finish esams (cp3048+cp3049)

2016-09-22 Thread BBlack (Code Review)
BBlack has submitted this change and it was merged.

Change subject: upload storage: finish esams (cp3048+cp3049)
..


upload storage: finish esams (cp3048+cp3049)

Bug: T145661
Change-Id: I7269c9b1630410de1a78ad440b3583c94cf359a4
---
D hieradata/hosts/cp3034.yaml
D hieradata/hosts/cp3035.yaml
D hieradata/hosts/cp3036.yaml
D hieradata/hosts/cp3037.yaml
D hieradata/hosts/cp3038.yaml
D hieradata/hosts/cp3039.yaml
D hieradata/hosts/cp3044.yaml
D hieradata/hosts/cp3045.yaml
D hieradata/hosts/cp3046.yaml
D hieradata/hosts/cp3047.yaml
M hieradata/role/esams/cache/upload.yaml
11 files changed, 1 insertion(+), 10 deletions(-)

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



diff --git a/hieradata/hosts/cp3034.yaml b/hieradata/hosts/cp3034.yaml
deleted file mode 100644
index c02abf9..000
--- a/hieradata/hosts/cp3034.yaml
+++ /dev/null
@@ -1 +0,0 @@
-upload_storage_experiment: true
diff --git a/hieradata/hosts/cp3035.yaml b/hieradata/hosts/cp3035.yaml
deleted file mode 100644
index c02abf9..000
--- a/hieradata/hosts/cp3035.yaml
+++ /dev/null
@@ -1 +0,0 @@
-upload_storage_experiment: true
diff --git a/hieradata/hosts/cp3036.yaml b/hieradata/hosts/cp3036.yaml
deleted file mode 100644
index c02abf9..000
--- a/hieradata/hosts/cp3036.yaml
+++ /dev/null
@@ -1 +0,0 @@
-upload_storage_experiment: true
diff --git a/hieradata/hosts/cp3037.yaml b/hieradata/hosts/cp3037.yaml
deleted file mode 100644
index c02abf9..000
--- a/hieradata/hosts/cp3037.yaml
+++ /dev/null
@@ -1 +0,0 @@
-upload_storage_experiment: true
diff --git a/hieradata/hosts/cp3038.yaml b/hieradata/hosts/cp3038.yaml
deleted file mode 100644
index c02abf9..000
--- a/hieradata/hosts/cp3038.yaml
+++ /dev/null
@@ -1 +0,0 @@
-upload_storage_experiment: true
diff --git a/hieradata/hosts/cp3039.yaml b/hieradata/hosts/cp3039.yaml
deleted file mode 100644
index c02abf9..000
--- a/hieradata/hosts/cp3039.yaml
+++ /dev/null
@@ -1 +0,0 @@
-upload_storage_experiment: true
diff --git a/hieradata/hosts/cp3044.yaml b/hieradata/hosts/cp3044.yaml
deleted file mode 100644
index c02abf9..000
--- a/hieradata/hosts/cp3044.yaml
+++ /dev/null
@@ -1 +0,0 @@
-upload_storage_experiment: true
diff --git a/hieradata/hosts/cp3045.yaml b/hieradata/hosts/cp3045.yaml
deleted file mode 100644
index c02abf9..000
--- a/hieradata/hosts/cp3045.yaml
+++ /dev/null
@@ -1 +0,0 @@
-upload_storage_experiment: true
diff --git a/hieradata/hosts/cp3046.yaml b/hieradata/hosts/cp3046.yaml
deleted file mode 100644
index c02abf9..000
--- a/hieradata/hosts/cp3046.yaml
+++ /dev/null
@@ -1 +0,0 @@
-upload_storage_experiment: true
diff --git a/hieradata/hosts/cp3047.yaml b/hieradata/hosts/cp3047.yaml
deleted file mode 100644
index c02abf9..000
--- a/hieradata/hosts/cp3047.yaml
+++ /dev/null
@@ -1 +0,0 @@
-upload_storage_experiment: true
diff --git a/hieradata/role/esams/cache/upload.yaml 
b/hieradata/role/esams/cache/upload.yaml
index 6cf08a4..6be2d95 100644
--- a/hieradata/role/esams/cache/upload.yaml
+++ b/hieradata/role/esams/cache/upload.yaml
@@ -1,3 +1,4 @@
 debdeploy::grains:
   debdeploy-cp-esams-upload:
 value: standard
+upload_storage_experiment: true

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7269c9b1630410de1a78ad440b3583c94cf359a4
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack 
Gerrit-Reviewer: BBlack 
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]: Minor installer/upgrader cleanups

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Minor installer/upgrader cleanups
..

Minor installer/upgrader cleanups

Change-Id: I6352d16dce242c94203bdf7d020f1c0279fec6e5
---
M includes/installer/DatabaseInstaller.php
M includes/installer/DatabaseUpdater.php
M includes/libs/rdbms/database/Database.php
3 files changed, 7 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/61/312461/1

diff --git a/includes/installer/DatabaseInstaller.php 
b/includes/installer/DatabaseInstaller.php
index 4f10367..161740b 100644
--- a/includes/installer/DatabaseInstaller.php
+++ b/includes/installer/DatabaseInstaller.php
@@ -167,7 +167,7 @@
 *
 * @param string $sourceFileMethod
 * @param string $stepName
-* @param string $archiveTableMustNotExist
+* @param bool $archiveTableMustNotExist
 * @return Status
 */
private function stepApplySourceFile(
@@ -355,7 +355,7 @@
$up->doUpdates();
} catch ( Exception $e ) {
echo "\nAn error occurred:\n";
-   echo $e->getText();
+   echo $e->getMessage();
$ret = false;
}
$up->purgeCache();
diff --git a/includes/installer/DatabaseUpdater.php 
b/includes/installer/DatabaseUpdater.php
index 0d0da08..2425005 100644
--- a/includes/installer/DatabaseUpdater.php
+++ b/includes/installer/DatabaseUpdater.php
@@ -20,6 +20,7 @@
  * @file
  * @ingroup Deployment
  */
+use MediaWiki\MediaWikiServices;
 
 require_once __DIR__ . '/../../maintenance/Maintenance.php';
 
@@ -456,6 +457,8 @@
 * @param bool $passSelf Whether to pass this object we calling 
external functions
 */
private function runUpdates( array $updates, $passSelf ) {
+   $lbFactory = 
MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+
$updatesDone = [];
$updatesSkipped = [];
foreach ( $updates as $params ) {
@@ -470,7 +473,7 @@
flush();
if ( $ret !== false ) {
$updatesDone[] = $origParams;
-   wfGetLBFactory()->waitForReplication();
+   $lbFactory->waitForReplication();
} else {
$updatesSkipped[] = [ $func, $params, 
$origParams ];
}
diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index f56f380..bea24a9 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -30,7 +30,7 @@
  * Database abstraction object
  * @ingroup Database
  */
-abstract class Database implements IDatabase, LoggerAwareInterface {
+abstract class Database implements IDatabase, IMaintainableDatabase, 
LoggerAwareInterface {
/** Number of times to re-try an operation in case of deadlock */
const DEADLOCK_TRIES = 4;
/** Minimum time to wait before retry, in microseconds */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6352d16dce242c94203bdf7d020f1c0279fec6e5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Add placeholder class for NotificationOfFraud messages

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

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

Change subject: Add placeholder class for NotificationOfFraud messages
..

Add placeholder class for NotificationOfFraud messages

Not doing anything yet, but we throw exceptions when an unknown
message type comes in.

Change-Id: If693793bcae7d62c27ee0e7a67449a89e69612b4
---
A PaymentProviders/Adyen/ExpatriatedMessages/NotificationOfFraud.php
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/60/312460/1

diff --git a/PaymentProviders/Adyen/ExpatriatedMessages/NotificationOfFraud.php 
b/PaymentProviders/Adyen/ExpatriatedMessages/NotificationOfFraud.php
new file mode 100644
index 000..dd3c4c0
--- /dev/null
+++ b/PaymentProviders/Adyen/ExpatriatedMessages/NotificationOfFraud.php
@@ -0,0 +1,6 @@
+https://gerrit.wikimedia.org/r/312460
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If693793bcae7d62c27ee0e7a67449a89e69612b4
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]: Remove unused Database::isView()/clearViewsCache() methods

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Remove unused Database::isView()/clearViewsCache() methods
..

Remove unused Database::isView()/clearViewsCache() methods

Also make getLazyMasterHandle() protected.

Change-Id: Id6b48ff976a800052c22e90b572695ab3b8beb7e
---
M includes/libs/rdbms/database/Database.php
M includes/libs/rdbms/database/DatabaseMysqlBase.php
M tests/phpunit/includes/db/DatabaseMysqlBaseTest.php
3 files changed, 10 insertions(+), 64 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/59/312459/1

diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index f56f380..e3afb0e 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -209,12 +209,6 @@
/** @var IDatabase|null Lazy handle to the master DB this server 
replicates from */
private $lazyMasterHandle;
 
-   /**
-* @since 1.22
-* @var string[] Process cache of VIEWs names in the database
-*/
-   protected $allViews = null;
-
/** @var float UNIX timestamp */
protected $lastPing = 0.0;
 
@@ -494,7 +488,7 @@
 * @see setLazyMasterHandle()
 * @since 1.27
 */
-   public function getLazyMasterHandle() {
+   protected function getLazyMasterHandle() {
return $this->lazyMasterHandle;
}
 
@@ -2934,18 +2928,7 @@
}
 
/**
-* Reset the views process cache set by listViews()
-* @since 1.22
-*/
-   final public function clearViewsCache() {
-   $this->allViews = null;
-   }
-
-   /**
 * Lists all the VIEWs in the database
-*
-* For caching purposes the list of all views should be stored in
-* $this->allViews. The process cache can be cleared with 
clearViewsCache()
 *
 * @param string $prefix Only show VIEWs with this prefix, eg. 
unit_test_
 * @param string $fname Name of calling function
@@ -2954,18 +2937,6 @@
 * @since 1.22
 */
public function listViews( $prefix = null, $fname = __METHOD__ ) {
-   throw new RuntimeException( __METHOD__ . ' is not implemented 
in descendant class' );
-   }
-
-   /**
-* Differentiates between a TABLE and a VIEW
-*
-* @param string $name Name of the database-structure to test.
-* @throws RuntimeException
-* @return bool
-* @since 1.22
-*/
-   public function isView( $name ) {
throw new RuntimeException( __METHOD__ . ' is not implemented 
in descendant class' );
}
 
diff --git a/includes/libs/rdbms/database/DatabaseMysqlBase.php 
b/includes/libs/rdbms/database/DatabaseMysqlBase.php
index 675bc87..c6a00d4 100644
--- a/includes/libs/rdbms/database/DatabaseMysqlBase.php
+++ b/includes/libs/rdbms/database/DatabaseMysqlBase.php
@@ -1296,26 +1296,22 @@
 * @since 1.22
 */
public function listViews( $prefix = null, $fname = __METHOD__ ) {
+   // The name of the column containing the name of the VIEW
+   $propertyName = 'Tables_in_' . $this->mDBname;
 
-   if ( !isset( $this->allViews ) ) {
-
-   // The name of the column containing the name of the 
VIEW
-   $propertyName = 'Tables_in_' . $this->mDBname;
-
-   // Query for the VIEWS
-   $result = $this->query( 'SHOW FULL TABLES WHERE 
TABLE_TYPE = "VIEW"' );
-   $this->allViews = [];
-   while ( ( $row = $this->fetchRow( $result ) ) !== false 
) {
-   array_push( $this->allViews, 
$row[$propertyName] );
-   }
+   // Query for the VIEWS
+   $result = $this->query( 'SHOW FULL TABLES WHERE TABLE_TYPE = 
"VIEW"' );
+   $allViews = [];
+   while ( ( $row = $this->fetchRow( $result ) ) !== false ) {
+   array_push( $allViews, $row[$propertyName] );
}
 
if ( is_null( $prefix ) || $prefix === '' ) {
-   return $this->allViews;
+   return $allViews;
}
 
$filteredViews = [];
-   foreach ( $this->allViews as $viewName ) {
+   foreach ( $allViews as $viewName ) {
// Does the name of this VIEW start with the 
table-prefix?
if ( strpos( $viewName, $prefix ) === 0 ) {
array_push( $filteredViews, $viewName );
diff --git a/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php 
b/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php
index 9480c2d..63c1846 100644
--- 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Reduce queries in CategoryViewer via addGoodLinkObjFromRow()

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Reduce queries in CategoryViewer via addGoodLinkObjFromRow()
..

Reduce queries in CategoryViewer via addGoodLinkObjFromRow()

Change-Id: Id782b50f166efbee6c9f8b9b263f09fc5fb5e3f2
---
M includes/CategoryViewer.php
1 file changed, 17 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/58/312458/1

diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php
index a8e988f..53e855b 100644
--- a/includes/CategoryViewer.php
+++ b/includes/CategoryViewer.php
@@ -19,6 +19,7 @@
  *
  * @file
  */
+use MediaWiki\MediaWikiServices;
 
 class CategoryViewer extends ContextSource {
/** @var int */
@@ -317,10 +318,19 @@
 
$res = $dbr->select(
[ 'page', 'categorylinks', 'category' ],
-   [ 'page_id', 'page_title', 'page_namespace', 
'page_len',
-   'page_is_redirect', 'cl_sortkey', 
'cat_id', 'cat_title',
-   'cat_subcats', 'cat_pages', 'cat_files',
-   'cl_sortkey_prefix', 'cl_collation' ],
+   array_merge(
+   LinkCache::getSelectFields(),
+   [
+   'cl_sortkey',
+   'cat_id',
+   'cat_title',
+   'cat_subcats',
+   'cat_pages',
+   'cat_files',
+   'cl_sortkey_prefix',
+   'cl_collation'
+   ]
+   ),
array_merge( [ 'cl_to' => 
$this->title->getDBkey() ], $extraConds ),
__METHOD__,
[
@@ -338,10 +348,13 @@
);
 
Hooks::run( 'CategoryViewer::doCategoryQuery', [ $type, 
$res ] );
+   $linkCache = 
MediaWikiServices::getInstance()->getLinkCache();
 
$count = 0;
foreach ( $res as $row ) {
$title = Title::newFromRow( $row );
+   $linkCache->addGoodLinkObjFromRow( $title, $row 
);
+
if ( $row->cl_collation === '' ) {
// Hack to make sure that while 
updating from 1.16 schema
// and db is inconsistent, that the sky 
doesn't fall.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id782b50f166efbee6c9f8b9b263f09fc5fb5e3f2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: tcpircbot: Follow-up Ide89c59f: Update ferm rules too

2016-09-22 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: tcpircbot: Follow-up Ide89c59f: Update ferm rules too
..

tcpircbot: Follow-up Ide89c59f: Update ferm rules too

Change-Id: I0642f44bbb2f502a6a19243f33f1dab15963e6b8
---
M manifests/role/tcpircbot.pp
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/55/312455/1

diff --git a/manifests/role/tcpircbot.pp b/manifests/role/tcpircbot.pp
index 2e697dd..9a2c593 100644
--- a/manifests/role/tcpircbot.pp
+++ b/manifests/role/tcpircbot.pp
@@ -34,8 +34,8 @@
 }
 
 ferm::rule { 'tcpircbot_allowed':
-# eventlog1001 (v4), tin (v4), mira (v4), palladium (v4), localhost 
(v4), tin (v6), mira (v6), palladium (v6, unnamed in DNS), terbium (v4), 
terbium (v6, unnamed in DNS), wasat (v4), wasat (v6, unnamed in DNS), rhodium 
(v4), rhodium (v6, unnamed in DNS)
+# eventlog1001 (v4), tin (v4), mira (v4), puppetmaster1001 (v4), 
localhost (v4), tin (v6), mira (v6), puppetmaster1001 (v6, unnamed in DNS), 
terbium (v4), terbium (v6, unnamed in DNS), wasat (v4), wasat (v6, unnamed in 
DNS), puppetmaster2001 (v4), puppetmaster2001 (v6, unnamed in DNS)
 # Please DO NOT change the IPs in the rule below without updating the 
comment above
-rule => 'proto tcp dport 9200 { saddr (10.64.32.167/32 10.64.0.196/32 
10.192.16.132/32 10.64.16.160/32 127.0.0.1 2620:0:861:101:10:64:0:196/128 
2620:0:860:102:10:192:16:132/128 2620:0:861:102:10:64:16:160/128 10.64.32.13/32 
2620:0:861:103:92b1:1cff:fe25:9d72/128 10.192.48.45/32 
2620:0:860:104:1602:ecff:fe3f:478c/128 10.64.16.184/32 
2620:0:861:102:10:64:16:184/128) ACCEPT; }',
+rule => 'proto tcp dport 9200 { saddr (10.64.32.167/32 10.64.0.196/32 
10.192.16.132/32 10.64.16.73/32 127.0.0.1 2620:0:861:101:10:64:0:196/128 
2620:0:860:102:10:192:16:132/128 2620:0:861:102:10:64:16:73/128 10.64.32.13/32 
2620:0:861:103:92b1:1cff:fe25:9d72/128 10.192.48.45/32 
2620:0:860:104:1602:ecff:fe3f:478c/128 10.192.0.27/32 
2620:0:860:101:10:192:0:27/128) ACCEPT; }',
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0642f44bbb2f502a6a19243f33f1dab15963e6b8
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alex Monk 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: tcpircbot: remove localhost from ferm rule

2016-09-22 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: tcpircbot: remove localhost from ferm rule
..

tcpircbot: remove localhost from ferm rule

It's not needed, ferm accepts all loopback traffic.

Change-Id: Ice812d7540c4ce828e1284d9051cafc7e5588b03
---
M manifests/role/tcpircbot.pp
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/56/312456/1

diff --git a/manifests/role/tcpircbot.pp b/manifests/role/tcpircbot.pp
index 9a2c593..aec319e 100644
--- a/manifests/role/tcpircbot.pp
+++ b/manifests/role/tcpircbot.pp
@@ -34,8 +34,8 @@
 }
 
 ferm::rule { 'tcpircbot_allowed':
-# eventlog1001 (v4), tin (v4), mira (v4), puppetmaster1001 (v4), 
localhost (v4), tin (v6), mira (v6), puppetmaster1001 (v6, unnamed in DNS), 
terbium (v4), terbium (v6, unnamed in DNS), wasat (v4), wasat (v6, unnamed in 
DNS), puppetmaster2001 (v4), puppetmaster2001 (v6, unnamed in DNS)
+# eventlog1001 (v4), tin (v4), mira (v4), puppetmaster1001 (v4), tin 
(v6), mira (v6), puppetmaster1001 (v6, unnamed in DNS), terbium (v4), terbium 
(v6, unnamed in DNS), wasat (v4), wasat (v6, unnamed in DNS), puppetmaster2001 
(v4), puppetmaster2001 (v6, unnamed in DNS)
 # Please DO NOT change the IPs in the rule below without updating the 
comment above
-rule => 'proto tcp dport 9200 { saddr (10.64.32.167/32 10.64.0.196/32 
10.192.16.132/32 10.64.16.73/32 127.0.0.1 2620:0:861:101:10:64:0:196/128 
2620:0:860:102:10:192:16:132/128 2620:0:861:102:10:64:16:73/128 10.64.32.13/32 
2620:0:861:103:92b1:1cff:fe25:9d72/128 10.192.48.45/32 
2620:0:860:104:1602:ecff:fe3f:478c/128 10.192.0.27/32 
2620:0:860:101:10:192:0:27/128) ACCEPT; }',
+rule => 'proto tcp dport 9200 { saddr (10.64.32.167/32 10.64.0.196/32 
10.192.16.132/32 10.64.16.73/32 2620:0:861:101:10:64:0:196/128 
2620:0:860:102:10:192:16:132/128 2620:0:861:102:10:64:16:73/128 10.64.32.13/32 
2620:0:861:103:92b1:1cff:fe25:9d72/128 10.192.48.45/32 
2620:0:860:104:1602:ecff:fe3f:478c/128 10.192.0.27/32 
2620:0:860:101:10:192:0:27/128) ACCEPT; }',
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice812d7540c4ce828e1284d9051cafc7e5588b03
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alex Monk 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: tcpircbot: Follow-up Ide89c59f: Fix missing CIDR prefix on p...

2016-09-22 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: tcpircbot: Follow-up Ide89c59f: Fix missing CIDR prefix on 
puppetmaster2001
..

tcpircbot: Follow-up Ide89c59f: Fix missing CIDR prefix on puppetmaster2001

Change-Id: I087cd5c736dc1de666159684c63116758ee025c7
---
M manifests/role/tcpircbot.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/57/312457/1

diff --git a/manifests/role/tcpircbot.pp b/manifests/role/tcpircbot.pp
index aec319e..83ea50b 100644
--- a/manifests/role/tcpircbot.pp
+++ b/manifests/role/tcpircbot.pp
@@ -28,7 +28,7 @@
 ':::10.64.16.73/128',   # puppetmaster1001.eqiad.wmnet
 '2620:0:861:102:10:64:16:73/128',   # puppetmaster1001.eqiad.wmnet
 ':::10.192.0.27/128',   # puppetmaster2001.codfw.wmnet
-'2620:0:860:101:10:192:0:27',   # puppetmaster2001.codfw.wmnet
+'2620:0:860:101:10:192:0:27/128',   # puppetmaster2001.codfw.wmnet
 
 ],
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I087cd5c736dc1de666159684c63116758ee025c7
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alex Monk 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: tcpircbot: update comment detailing each IP in the ferm rule

2016-09-22 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: tcpircbot: update comment detailing each IP in the ferm rule
..

tcpircbot: update comment detailing each IP in the ferm rule

Change-Id: I76d861b539d6aa26d4b4589ab0c04c6bce0f8efe
---
M manifests/role/tcpircbot.pp
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/54/312454/1

diff --git a/manifests/role/tcpircbot.pp b/manifests/role/tcpircbot.pp
index 52742d4..2e697dd 100644
--- a/manifests/role/tcpircbot.pp
+++ b/manifests/role/tcpircbot.pp
@@ -34,7 +34,8 @@
 }
 
 ferm::rule { 'tcpircbot_allowed':
-# eventlog1001, tin (v4), mira (v4), localhost, tin (v6), mira (v6), 
terbium (v4), wasat (v4)
+# eventlog1001 (v4), tin (v4), mira (v4), palladium (v4), localhost 
(v4), tin (v6), mira (v6), palladium (v6, unnamed in DNS), terbium (v4), 
terbium (v6, unnamed in DNS), wasat (v4), wasat (v6, unnamed in DNS), rhodium 
(v4), rhodium (v6, unnamed in DNS)
+# Please DO NOT change the IPs in the rule below without updating the 
comment above
 rule => 'proto tcp dport 9200 { saddr (10.64.32.167/32 10.64.0.196/32 
10.192.16.132/32 10.64.16.160/32 127.0.0.1 2620:0:861:101:10:64:0:196/128 
2620:0:860:102:10:192:16:132/128 2620:0:861:102:10:64:16:160/128 10.64.32.13/32 
2620:0:861:103:92b1:1cff:fe25:9d72/128 10.192.48.45/32 
2620:0:860:104:1602:ecff:fe3f:478c/128 10.64.16.184/32 
2620:0:861:102:10:64:16:184/128) ACCEPT; }',
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76d861b539d6aa26d4b4589ab0c04c6bce0f8efe
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alex Monk 

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


[MediaWiki-commits] [Gerrit] mediawiki...GlobalUsage[master]: Use provided transaction ticket in onLinksUpdateComplete()

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Use provided transaction ticket in onLinksUpdateComplete()
..

Use provided transaction ticket in onLinksUpdateComplete()

Change-Id: I878fcb4a263e3e6291c7632a0ccd89d42179001d
---
M GlobalUsageHooks.php
M GlobalUsage_body.php
2 files changed, 12 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GlobalUsage 
refs/changes/53/312453/1

diff --git a/GlobalUsageHooks.php b/GlobalUsageHooks.php
index 778a0ff..b1363de 100644
--- a/GlobalUsageHooks.php
+++ b/GlobalUsageHooks.php
@@ -12,9 +12,10 @@
 * Hook to LinksUpdateComplete
 * Deletes old links from usage table and insert new ones.
 * @param $linksUpdater LinksUpdate
+* @param int|null $ticket
 * @return bool
 */
-   public static function onLinksUpdateComplete( LinksUpdate $linksUpdater 
) {
+   public static function onLinksUpdateComplete( LinksUpdate 
$linksUpdater, $ticket = null ) {
$title = $linksUpdater->getTitle();
 
// Create a list of locally existing images (DB keys)
@@ -42,9 +43,9 @@
$removed = array_diff( $existing, $missingFiles );
 
// Add new usages and delete removed
-   $gu->insertLinks( $title, $added );
+   $gu->insertLinks( $title, $added, Title::GAID_FOR_UPDATE, 
$ticket );
if ( $removed ) {
-   $gu->deleteLinksFromPage( $articleId, $removed );
+   $gu->deleteLinksFromPage( $articleId, $removed, $ticket 
);
}
 
return true;
diff --git a/GlobalUsage_body.php b/GlobalUsage_body.php
index f9cd85e..49f6229 100644
--- a/GlobalUsage_body.php
+++ b/GlobalUsage_body.php
@@ -27,8 +27,11 @@
 * @param $title Title Title of the page
 * @param $images array Array of db keys of images used
 * @param $pageIdFlags int
+* @param $ticket int|null
 */
-   public function insertLinks( $title, $images, $pageIdFlags = 
Title::GAID_FOR_UPDATE ) {
+   public function insertLinks(
+   Title $title, array $images, $pageIdFlags = 
Title::GAID_FOR_UPDATE, $ticket = null
+   ) {
global $wgUpdateRowsPerQuery;
 
$insert = array();
@@ -44,7 +47,7 @@
}
 
$lbFactory = 
MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
-   $ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
+   $ticket = $ticket ?: $lbFactory->getEmptyTransactionTicket( 
__METHOD__ );
foreach ( array_chunk( $insert, $wgUpdateRowsPerQuery ) as 
$insertBatch ) {
$this->db->insert( 'globalimagelinks', $insertBatch, 
__METHOD__, array( 'IGNORE' ) );
$lbFactory->commitAndWaitForReplication( __METHOD__, 
$ticket );
@@ -80,8 +83,9 @@
 *
 * @param $id int Page id of the page
 * @param $to mixed File name(s)
+* @param $ticket int|null
 */
-   public function deleteLinksFromPage( $id, array $to = null ) {
+   public function deleteLinksFromPage( $id, array $to = null, $ticket = 
null ) {
global $wgUpdateRowsPerQuery;
 
$where = array(
@@ -90,7 +94,7 @@
);
if ( $to ) {
$lbFactory = 
MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
-   $ticket = $lbFactory->getEmptyTransactionTicket( 
__METHOD__ );
+   $ticket = $ticket ?: 
$lbFactory->getEmptyTransactionTicket( __METHOD__ );
foreach ( array_chunk( $to, $wgUpdateRowsPerQuery ) as 
$toBatch ) {
$where['gil_to'] = $toBatch;
$this->db->delete( 'globalimagelinks', $where, 
__METHOD__ );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I878fcb4a263e3e6291c7632a0ccd89d42179001d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GlobalUsage
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki...GeoData[master]: Use provided transaction ticket in onLinksUpdateComplete()

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Use provided transaction ticket in onLinksUpdateComplete()
..

Use provided transaction ticket in onLinksUpdateComplete()

Change-Id: I7255729c298f317bd944117b9fe5e8eafcc8938b
---
M includes/Hooks.php
1 file changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GeoData 
refs/changes/52/312452/1

diff --git a/includes/Hooks.php b/includes/Hooks.php
index df271e4..133a73c 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -104,8 +104,9 @@
 * @see https://www.mediawiki.org/wiki/Manual:Hooks/LinksUpdateComplete
 *
 * @param LinksUpdate $linksUpdate
+* @param int|null $ticket
 */
-   public static function onLinksUpdateComplete( LinksUpdate $linksUpdate 
) {
+   public static function onLinksUpdateComplete( LinksUpdate $linksUpdate, 
$ticket = null ) {
$out = $linksUpdate->getParserOutput();
$data = [];
$coordFromMetadata = self::getCoordinatesIfFile( 
$linksUpdate->getTitle() );
@@ -121,7 +122,7 @@
$data[] = $coordFromMetadata;
}
 
-   self::doLinksUpdate( $data, $linksUpdate->mId );
+   self::doLinksUpdate( $data, $linksUpdate->mId, $ticket );
}
 
private static function getCoordinatesIfFile( Title $title ) {
@@ -154,9 +155,10 @@
/**
 * @param Coord[] $coords
 * @param int $pageId
+* @param int|null $ticket
 * @throws \DBUnexpectedError
 */
-   private static function doLinksUpdate( array $coords, $pageId ) {
+   private static function doLinksUpdate( array $coords, $pageId, $ticket 
) {
$services = MediaWikiServices::getInstance();
 
$add = [];
@@ -185,7 +187,7 @@
 
$dbw = wfGetDB( DB_MASTER );
$lbFactory = $services->getDBLoadBalancerFactory();
-   $ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
+   $ticket = $ticket ?: $lbFactory->getEmptyTransactionTicket( 
__METHOD__ );
$batchSize = $services->getMainConfig()->get( 
'UpdateRowsPerQuery' );
 
$deleteIds = array_keys( $delete );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7255729c298f317bd944117b9fe5e8eafcc8938b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GeoData
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add transaction ticket to LinksUpdateComplete hook

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Add transaction ticket to LinksUpdateComplete hook
..

Add transaction ticket to LinksUpdateComplete hook

This lets callers use commitAndWaitForReplication() more easily.

Change-Id: I743bd1f989b8fb3b7ba3e5cc8ce1bb44c00f99af
---
M docs/hooks.txt
M includes/deferred/LinksUpdate.php
2 files changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/312451/1

diff --git a/docs/hooks.txt b/docs/hooks.txt
index ae0770b..2bfeb66 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -1974,6 +1974,7 @@
 'LinksUpdateComplete': At the end of LinksUpdate::doUpdate() when updating,
 including delete and insert, has completed for all link tables
 &$linksUpdate: the LinksUpdate object
+$ticket: prior result of LBFactory::getEmptyTransactionTicket()
 
 'LinksUpdateConstructed': At the end of LinksUpdate() is construction.
 &$linksUpdate: the LinksUpdate object
diff --git a/includes/deferred/LinksUpdate.php 
b/includes/deferred/LinksUpdate.php
index d18349b..8954304 100644
--- a/includes/deferred/LinksUpdate.php
+++ b/includes/deferred/LinksUpdate.php
@@ -176,7 +176,7 @@
// Run post-commit hooks without DBO_TRX
$this->getDB()->onTransactionIdle(
function () {
-   Hooks::run( 'LinksUpdateComplete', [ &$this ] );
+   Hooks::run( 'LinksUpdateComplete', [ &$this, 
$this->ticket ] );
},
__METHOD__
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I743bd1f989b8fb3b7ba3e5cc8ce1bb44c00f99af
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki...SecurePoll[wmf/1.28.0-wmf.20]: Fix fatal

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

Change subject: Fix fatal
..


Fix fatal

The base class has no constructor since c64c3ef9a8f33d89df9a801efa6c1d498f8722b1

Bug: T146440
Change-Id: Ia503a2760978364098ff950827e7f9063dee78e6
---
M includes/ballots/Ballot.php
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/includes/ballots/Ballot.php b/includes/ballots/Ballot.php
index 63af83e..07887db 100644
--- a/includes/ballots/Ballot.php
+++ b/includes/ballots/Ballot.php
@@ -267,7 +267,6 @@
public $sp_ids = array();
 
function __construct( $context ) {
-   parent::__construct();
$this->sp_context = $context;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia503a2760978364098ff950827e7f9063dee78e6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: MaxSem 
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...SecurePoll[master]: Fix fatal

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

Change subject: Fix fatal
..


Fix fatal

The base class has no constructor since c64c3ef9a8f33d89df9a801efa6c1d498f8722b1

Bug: T146440
Change-Id: Ia503a2760978364098ff950827e7f9063dee78e6
---
M includes/ballots/Ballot.php
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/includes/ballots/Ballot.php b/includes/ballots/Ballot.php
index 63af83e..07887db 100644
--- a/includes/ballots/Ballot.php
+++ b/includes/ballots/Ballot.php
@@ -267,7 +267,6 @@
public $sp_ids = array();
 
function __construct( $context ) {
-   parent::__construct();
$this->sp_context = $context;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia503a2760978364098ff950827e7f9063dee78e6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
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...SecurePoll[wmf/1.28.0-wmf.20]: Fix fatal

2016-09-22 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review.

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

Change subject: Fix fatal
..

Fix fatal

The base class has no constructor since c64c3ef9a8f33d89df9a801efa6c1d498f8722b1

Bug: T146440
Change-Id: Ia503a2760978364098ff950827e7f9063dee78e6
---
M includes/ballots/Ballot.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll 
refs/changes/50/312450/1

diff --git a/includes/ballots/Ballot.php b/includes/ballots/Ballot.php
index 63af83e..07887db 100644
--- a/includes/ballots/Ballot.php
+++ b/includes/ballots/Ballot.php
@@ -267,7 +267,6 @@
public $sp_ids = array();
 
function __construct( $context ) {
-   parent::__construct();
$this->sp_context = $context;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia503a2760978364098ff950827e7f9063dee78e6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove see comment

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

Change subject: Remove see comment
..


Remove see comment

Change-Id: I58fcd682dba6c778c0975baf67a6b87f36b1aff2
---
M includes/libs/rdbms/database/Database.php
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index 66f7046..f56f380 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -1230,7 +1230,6 @@
return '';
}
 
-   // See IDatabase::select for the docs for this function
public function select( $table, $vars, $conds = '', $fname = __METHOD__,
$options = [], $join_conds = [] ) {
$sql = $this->selectSQLText( $table, $vars, $conds, $fname, 
$options, $join_conds );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I58fcd682dba6c778c0975baf67a6b87f36b1aff2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Aaron Schulz 
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...SecurePoll[master]: Fix fatal

2016-09-22 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review.

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

Change subject: Fix fatal
..

Fix fatal

The base class has no constructor since c64c3ef9a8f33d89df9a801efa6c1d498f8722b1

Bug: T146440
Change-Id: Ia503a2760978364098ff950827e7f9063dee78e6
---
M includes/ballots/Ballot.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll 
refs/changes/49/312449/1

diff --git a/includes/ballots/Ballot.php b/includes/ballots/Ballot.php
index 63af83e..07887db 100644
--- a/includes/ballots/Ballot.php
+++ b/includes/ballots/Ballot.php
@@ -267,7 +267,6 @@
public $sp_ids = array();
 
function __construct( $context ) {
-   parent::__construct();
$this->sp_context = $context;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia503a2760978364098ff950827e7f9063dee78e6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...TextExtracts[master]: Remove use of a removed function

2016-09-22 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review.

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

Change subject: Remove use of a removed function
..

Remove use of a removed function

Change-Id: Iac8bec0a0a2625e40c5c70a715ffb4784224f164
---
M includes/ApiQueryExtracts.php
1 file changed, 1 insertion(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TextExtracts 
refs/changes/48/312448/1

diff --git a/includes/ApiQueryExtracts.php b/includes/ApiQueryExtracts.php
index 0fe7a86..944b649 100644
--- a/includes/ApiQueryExtracts.php
+++ b/includes/ApiQueryExtracts.php
@@ -180,12 +180,7 @@
$this->parserOptions = new ParserOptions( new User( 
'127.0.0.1' ) );
}
// first try finding full page in parser cache
-   if ( method_exists( $page, 'isParserCachedUsed' ) ) {
-   $useCache = $page->isParserCacheUsed( 
$this->parserOptions, 0 );
-   } else {
-   $useCache = $page->shouldCheckParserCache( 
$this->parserOptions, 0 );
-   }
-   if ( $useCache ) {
+   if ( $page->shouldCheckParserCache( $this->parserOptions, 0 ) ) 
{
$pout = ParserCache::singleton()->get( $page, 
$this->parserOptions );
if ( $pout ) {
$pout->setTOCEnabled( false );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac8bec0a0a2625e40c5c70a715ffb4784224f164
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TextExtracts
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...TextExtracts[master]: CodeSniffer fixes

2016-09-22 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review.

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

Change subject: CodeSniffer fixes
..

CodeSniffer fixes

Change-Id: I8bdcd2250bd3163fe40ce4685eb04bffe53afdca
---
M includes/ApiQueryExtracts.php
M includes/ExtractFormatter.php
M includes/Hooks.php
M tests/phpunit/ExtractFormatterTest.php
4 files changed, 83 insertions(+), 84 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TextExtracts 
refs/changes/46/312446/1

diff --git a/includes/ApiQueryExtracts.php b/includes/ApiQueryExtracts.php
index ce7f70a..e704cef 100644
--- a/includes/ApiQueryExtracts.php
+++ b/includes/ApiQueryExtracts.php
@@ -48,7 +48,7 @@
/**
 * @var array
 */
-   private $supportedContentModels  = array( 'wikitext' );
+   private $supportedContentModels = [ 'wikitext' ];
 
public function __construct( $query, $moduleName, Config $conf ) {
parent::__construct( $query, $moduleName, 'ex' );
@@ -91,9 +91,9 @@
}
 
if ( $isXml ) {
-   $fit = $result->addValue( array( 'query', 
'pages', $id ), 'extract', array( '*' => $text ) );
+   $fit = $result->addValue( [ 'query', 'pages', 
$id ], 'extract', [ '*' => $text ] );
} else {
-   $fit = $result->addValue( array( 'query', 
'pages', $id ), 'extract', $text );
+   $fit = $result->addValue( [ 'query', 'pages', 
$id ], 'extract', $text );
}
if ( !$fit ) {
$this->setContinueEnumParameter( 'continue', 
$continue + $count - 1 );
@@ -196,33 +196,33 @@
return $text;
}
}
-   $request = array(
+   $request = [
'action' => 'parse',
'page' => $page->getTitle()->getPrefixedText(),
'prop' => 'text'
-   );
+   ];
if ( $this->params['intro'] ) {
$request['section'] = 0;
}
// in case of cache miss, render just the needed section
-   $api = new ApiMain( new FauxRequest( $request ) );
+   $api = new ApiMain( new FauxRequest( $request ) );
try {
$api->execute();
-   $data = $api->getResult()->getResultData( null, array(
-   'BC' => array(),
-   'Types' => array(),
-   ) );
+   $data = $api->getResult()->getResultData( null, [
+   'BC' => [],
+   'Types' => [],
+   ] );
} catch ( UsageException $e ) {
if ( $e->getCodeString() === 'nosuchsection' ) {
// Looks like we tried to get the intro to a 
page without
// sections!  Lets just grab what we can get.
unset( $request['section'] );
-   $api = new ApiMain( new FauxRequest( $request ) 
);
+   $api = new ApiMain( new FauxRequest( $request ) 
);
$api->execute();
-   $data = $api->getResult()->getResultData( null, 
array(
-   'BC' => array(),
-   'Types' => array(),
-   ) );
+   $data = $api->getResult()->getResultData( null, 
[
+   'BC' => [],
+   'Types' => [],
+   ] );
} else {
// Some other unexpected error - lets just 
report it to the user
// on the off chance that is the right thing.
@@ -304,7 +304,7 @@
 */
private function tidy( $text ) {
if ( $this->getConfig()->get( 'UseTidy' ) && 
!$this->params['plaintext'] ) {
-   $text = trim ( MWTidy::tidy( $text ) );
+   $text = trim( MWTidy::tidy( $text ) );
}
return $text;
}
@@ -312,7 +312,7 @@
private function doSections( $text ) {
$text = preg_replace_callback(
"/" . ExtractFormatter::SECTION_MARKER_START . '(\d)'. 
ExtractFormatter::SECTION_MARKER_END . "(.*?)$/m",
-   array( $this, 'sectionCallback' ),
+   [ $this, 'sectionCallback' ],
$text
);
return 

[MediaWiki-commits] [Gerrit] mediawiki...TextExtracts[master]: Minor fixes

2016-09-22 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review.

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

Change subject: Minor fixes
..

Minor fixes

* Annotations
* Deprecated functions
* Namespace tests

Change-Id: I521f6af6074a454cec5322ab4cd46db08350c2c3
---
M includes/ApiQueryExtracts.php
M includes/ExtractFormatter.php
M includes/Hooks.php
M tests/phpunit/ExtractFormatterTest.php
4 files changed, 14 insertions(+), 7 deletions(-)


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

diff --git a/includes/ApiQueryExtracts.php b/includes/ApiQueryExtracts.php
index e704cef..0fe7a86 100644
--- a/includes/ApiQueryExtracts.php
+++ b/includes/ApiQueryExtracts.php
@@ -22,8 +22,8 @@
 use ApiMain;
 use ApiQueryBase;
 use Config;
-use ConfigFactory;
 use FauxRequest;
+use MediaWiki\MediaWikiServices;
 use MWTidy;
 use ParserCache;
 use ParserOptions;
@@ -131,7 +131,7 @@
}
if ( $text === false ) {
$text = $this->parse( $page );
-   $text = $this->convertText( $text, $title, 
$this->params['plaintext'] );
+   $text = $this->convertText( $text );
$this->setCache( $page, $text );
}
return $text;
@@ -238,7 +238,7 @@
 * @return ApiQueryExtracts
 */
public static function factory( $query, $action ) {
-   $config = ConfigFactory::getDefaultInstance()->makeConfig( 
'textextracts' );
+   $config = 
MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 
'textextracts' );
return new self( $query, $action, $config );
}
 
diff --git a/includes/ExtractFormatter.php b/includes/ExtractFormatter.php
index 30a88f0..3f1c4af 100644
--- a/includes/ExtractFormatter.php
+++ b/includes/ExtractFormatter.php
@@ -3,6 +3,7 @@
 namespace TextExtracts;
 
 use Config;
+use DOMElement;
 use HtmlFormatter\HtmlFormatter;
 use Exception;
 
@@ -136,6 +137,7 @@
$doc = $this->getDoc();
$spans = $doc->getElementsByTagName( 'span' );
 
+   /** @var DOMElement $span */
foreach ( $spans as $span ) {
$span->removeAttribute( 'class' );
$span->removeAttribute( 'style' );
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 7aabce2..36f8905 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -4,8 +4,8 @@
 
 use ApiMain;
 use ApiResult;
-use ConfigFactory;
 use FauxRequest;
+use MediaWiki\MediaWikiServices;
 
 class Hooks {
 
@@ -15,7 +15,7 @@
 * @return bool
 */
public static function onApiOpenSearchSuggest( &$results ) {
-   $config = ConfigFactory::getDefaultInstance()->makeConfig( 
'textextracts' );
+   $config = 
MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 
'textextracts' );
if ( !$config->get( 'ExtractsExtendOpenSearchXml' ) || !count( 
$results ) ) {
return true;
}
diff --git a/tests/phpunit/ExtractFormatterTest.php 
b/tests/phpunit/ExtractFormatterTest.php
index 07366e8..c633fb3 100644
--- a/tests/phpunit/ExtractFormatterTest.php
+++ b/tests/phpunit/ExtractFormatterTest.php
@@ -1,4 +1,10 @@
 setEditSection( true );
-   $config = ConfigFactory::getDefaultInstance()->makeConfig( 
'textextracts' );
+   $config = 
MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 
'textextracts' );
$fmt = new ExtractFormatter( $text, $plainText, $config );
$fmt->remove( '.metadata' ); // Will be added via 
$wgExtractsRemoveClasses on WMF
$text = trim( $fmt->getText() );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I521f6af6074a454cec5322ab4cd46db08350c2c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TextExtracts
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add a continuation button to ApiSandbox

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

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

Change subject: Add a continuation button to ApiSandbox
..

Add a continuation button to ApiSandbox

Change-Id: I4def43b2000b5639e3ced2643afea4b1288e28b0
---
M includes/api/ApiFormatBase.php
M languages/i18n/en.json
M languages/i18n/qqq.json
M resources/Resources.php
M resources/src/mediawiki.special/mediawiki.special.apisandbox.js
5 files changed, 37 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/45/312445/1

diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php
index c826bba..4df7f51 100644
--- a/includes/api/ApiFormatBase.php
+++ b/includes/api/ApiFormatBase.php
@@ -231,6 +231,7 @@

$out->getModuleScripts(),
$out->getModuleStyles()
) ) ),
+   'continue' => 
$this->getResult()->getResultData( 'continue' ),
'time' => round( $time * 1000 ),
],
false, FormatJson::ALL_OK
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 67e6491..6af0f1e 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1922,6 +1922,7 @@
"apisandbox-results-fixtoken-fail": "Failed to fetch \"$1\" token.",
"apisandbox-alert-page": "Fields on this page are not valid.",
"apisandbox-alert-field": "The value of this field is not valid.",
+   "apisandbox-continue": "Continue",
"booksources": "Book sources",
"booksources-summary": "",
"booksources-search-legend": "Search for book sources",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 163b613..0f7b60b 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -2106,6 +2106,7 @@
"apisandbox-results-fixtoken-fail": "Displayed as an error message from 
JavaScript when a CSRF token could not be fetched.\n\nParameters:\n* $1 - Token 
type",
"apisandbox-alert-page": "Tooltip for the alert icon on a module's page 
tab when the page contains fields with issues.",
"apisandbox-alert-field": "Tooltip for the alert icon on a field when 
the field has issues.",
+   "apisandbox-continue": "Button text for sending another request using 
query continuation.",
"booksources": "{{doc-special|BookSources}}\n\n'''This message 
shouldn't be changed unless it has serious mistakes.'''\n\nIt's used as the 
page name of the configuration page of [[Special:BookSources]]. Changing it 
breaks existing sites using the default version of this message.\n\nSee 
also:\n* {{msg-mw|Booksources|title}}\n* {{msg-mw|Booksources-text|text}}",
"booksources-summary": "{{doc-specialpagesummary|booksources}}",
"booksources-search-legend": "Box heading on [[Special:BookSources|book 
sources]] special page. The box is for searching for places where a particular 
book can be bought or viewed.",
diff --git a/resources/Resources.php b/resources/Resources.php
index 89168db..7678037 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1858,6 +1858,7 @@
'apisandbox-results-fixtoken-fail',
'apisandbox-alert-page',
'apisandbox-alert-field',
+   'apisandbox-continue',
'blanknamespace',
],
],
diff --git a/resources/src/mediawiki.special/mediawiki.special.apisandbox.js 
b/resources/src/mediawiki.special/mediawiki.special.apisandbox.js
index 5c3715d..8b61dcb 100644
--- a/resources/src/mediawiki.special/mediawiki.special.apisandbox.js
+++ b/resources/src/mediawiki.special/mediawiki.special.apisandbox.js
@@ -962,6 +962,39 @@
.text( data )
.appendTo( 
$result );
}
+   if ( data.continue ) {
+   $result.append(
+   $( '' 
).append(
+   new 
OO.ui.ButtonWidget( {
+   
label: mw.message( 'apisandbox-continue' ).text()
+   } ).on( 
'click', function () {
+   
$.each( pages, function ( _, page ) {
+   

[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Follow-up 3ca658ed, e3192e2d: avoid JS errors when checking ...

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

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

Change subject: Follow-up 3ca658ed, e3192e2d: avoid JS errors when checking for 
rAF
..

Follow-up 3ca658ed, e3192e2d: avoid JS errors when checking for rAF

Change-Id: I675e8c6d9bf9ef586d1669941aebfe5885135b19
---
M src/ce/ve.ce.FocusableNode.js
M src/init/ve.init.Target.js
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/44/312444/1

diff --git a/src/ce/ve.ce.FocusableNode.js b/src/ce/ve.ce.FocusableNode.js
index 451611f..792fae9 100644
--- a/src/ce/ve.ce.FocusableNode.js
+++ b/src/ce/ve.ce.FocusableNode.js
@@ -119,7 +119,7 @@
  * @method
  */
 ve.ce.FocusableNode.prototype.onFocusableSetup = function () {
-   var rAF = requestAnimationFrame || setTimeout;
+   var rAF = window.requestAnimationFrame || setTimeout;
 
// Exit if already setup or not attached
if ( this.isFocusableSetup || !this.root ) {
diff --git a/src/init/ve.init.Target.js b/src/init/ve.init.Target.js
index 99db2da..c3327c2 100644
--- a/src/init/ve.init.Target.js
+++ b/src/init/ve.init.Target.js
@@ -427,7 +427,7 @@
 ve.init.Target.prototype.setupToolbar = function ( surface ) {
var toolbar = this.getToolbar(),
actions = this.getActions(),
-   rAF = requestAnimationFrame || setTimeout;
+   rAF = window.requestAnimationFrame || setTimeout;
 
toolbar.connect( this, { resize: 'onToolbarResize' } );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I675e8c6d9bf9ef586d1669941aebfe5885135b19
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: upload storage: transition cp3046+cp3047

2016-09-22 Thread BBlack (Code Review)
BBlack has submitted this change and it was merged.

Change subject: upload storage: transition cp3046+cp3047
..


upload storage: transition cp3046+cp3047

Bug: T145661
Change-Id: Iaf7641d4725a6e0c9940859c79d0ff44a066a02f
---
A hieradata/hosts/cp3046.yaml
A hieradata/hosts/cp3047.yaml
2 files changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/hieradata/hosts/cp3046.yaml b/hieradata/hosts/cp3046.yaml
new file mode 100644
index 000..c02abf9
--- /dev/null
+++ b/hieradata/hosts/cp3046.yaml
@@ -0,0 +1 @@
+upload_storage_experiment: true
diff --git a/hieradata/hosts/cp3047.yaml b/hieradata/hosts/cp3047.yaml
new file mode 100644
index 000..c02abf9
--- /dev/null
+++ b/hieradata/hosts/cp3047.yaml
@@ -0,0 +1 @@
+upload_storage_experiment: true

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaf7641d4725a6e0c9940859c79d0ff44a066a02f
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack 
Gerrit-Reviewer: BBlack 
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...crm[master]: Eradicate Stomp from crm repo

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

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

Change subject: Eradicate Stomp from crm repo
..

Eradicate Stomp from crm repo

Well, except for composer.lock, since DI still has a dependency on it.
This will totally conflict with the new damaged UI patch, but I couldn't
resist.

Change-Id: I3b41e9579396ad76cae0066bdc373c9df0cd8749
---
M composer.json
D sites/all/modules/queue2civicrm/Stomp.php
D sites/all/modules/queue2civicrm/Stomp/Exception.php
D sites/all/modules/queue2civicrm/Stomp/Frame.php
D sites/all/modules/queue2civicrm/Stomp/Message.php
D sites/all/modules/queue2civicrm/Stomp/Message/Bytes.php
D sites/all/modules/queue2civicrm/Stomp/Message/Map.php
M sites/all/modules/queue2civicrm/queue2civicrm.info
M sites/all/modules/queue2civicrm/queue2civicrm.module
M sites/all/modules/queue2civicrm/queue_consume.drush.inc
M sites/all/modules/queue2civicrm/recurring/recurring_queue_consume.drush.inc
D sites/all/modules/queue2civicrm/tests/includes/MessageSource.php
M sites/all/modules/wmf_civicrm/WmfTransaction.php
D sites/all/modules/wmf_common/Queue.php
M sites/all/modules/wmf_common/failmail.php
M sites/all/modules/wmf_common/wmf_common.info
M sites/all/modules/wmf_common/wmf_common.module
17 files changed, 8 insertions(+), 1,644 deletions(-)


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

diff --git a/composer.json b/composer.json
index 7150415..e16b453 100644
--- a/composer.json
+++ b/composer.json
@@ -21,7 +21,6 @@
 "cogpowered/finediff": "0.*",
 "wikimedia/donation-interface": "dev-master",
 "wikimedia/smash-pig": "dev-master",
-"fusesource/stomp-php": "2.*",
 "phpmailer/phpmailer": "5.2.6",
 "phpseclib/phpseclib": "0.3.7",
 "predis/predis": "1.*",
diff --git a/sites/all/modules/queue2civicrm/Stomp.php 
b/sites/all/modules/queue2civicrm/Stomp.php
deleted file mode 100644
index 75134da..000
--- a/sites/all/modules/queue2civicrm/Stomp.php
+++ /dev/null
@@ -1,604 +0,0 @@
-http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* vim: set expandtab tabstop=3 shiftwidth=3: */
-
-require_once 'Stomp/Frame.php';
-
-/**
- * A Stomp Connection
- *
- *
- * @package Stomp
- * @author Hiram Chirino 
- * @author Dejan Bosanac  
- * @author Michael Caplan 
- * @version $Revision: 43 $
- */
-class Stomp
-{
-/**
- * Perform request synchronously
- *
- * @var boolean
- */
-public $sync = false;
-
-/**
- * Default prefetch size
- *
- * @var int
- */
-   public $prefetchSize = 1;
-
-   /**
- * Client id used for durable subscriptions
- *
- * @var string
- */
-   public $clientId = null;
-
-protected $_brokerUri = null;
-protected $_socket = null;
-protected $_hosts = array();
-protected $_params = array();
-protected $_subscriptions = array();
-protected $_defaultPort = 61613;
-protected $_currentHost = - 1;
-protected $_attempts = 10;
-protected $_username = '';
-protected $_password = '';
-protected $_sessionId;
-protected $_read_timeout_seconds = 5;
-protected $_read_timeout_milliseconds = 0;
-
-/**
- * Constructor
- *
- * @param string $brokerUri Broker URL
- * @throws Stomp_Exception
- */
-public function __construct ($brokerUri)
-{
-$this->_brokerUri = $brokerUri;
-$this->_init();
-}
-/**
- * Initialize connection
- *
- * @throws Stomp_Exception
- */
-protected function _init ()
-{
-$pattern = 
"|^(([a-zA-Z]+)://)+\(*([a-zA-Z0-9\.:/i,-]+)\)*\??([a-zA-Z0-9=]*)$|i";
-if (preg_match($pattern, $this->_brokerUri, $regs)) {
-$scheme = $regs[2];
-$hosts = $regs[3];
-$params = $regs[4];
-if ($scheme != "failover") {
-$this->_processUrl($this->_brokerUri);
-} else {
-$urls = explode(",", $hosts);
-foreach ($urls as $url) {
-$this->_processUrl($url);
-}
-}
-if ($params != null) {
-parse_str($params, $this->_params);
-}
-} else {
-require_once 'Stomp/Exception.php';
-throw new Stomp_Exception("Bad Broker URL {$this->_brokerUri}");
-}
-}
-/**
- * Process broker URL
- *
- * @param string $url Broker URL
- * @throws Stomp_Exception
- * 

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Stop mirroring to stomp from audit processors

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

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

Change subject: Stop mirroring to stomp from audit processors
..

Stop mirroring to stomp from audit processors

Not sure if those try/catch blocks are right in the GC processor

Change-Id: I9f15d622558edd87dc9d74b1dcebd576f66cea08
---
M sites/all/modules/globalcollect_audit/globalcollect_audit.module
M sites/all/modules/wmf_audit/wmf_audit.module
2 files changed, 51 insertions(+), 99 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/42/312442/1

diff --git a/sites/all/modules/globalcollect_audit/globalcollect_audit.module 
b/sites/all/modules/globalcollect_audit/globalcollect_audit.module
index 21bfea6..2cb3143 100644
--- a/sites/all/modules/globalcollect_audit/globalcollect_audit.module
+++ b/sites/all/modules/globalcollect_audit/globalcollect_audit.module
@@ -1,6 +1,7 @@
  'checkbox',
-'#title' => t( 'When this box is checked, no stomp messages will be sent.' 
),
+'#title' => t( 'When this box is checked, no queue messages will be sent.' 
),
 '#required' => FALSE,
 '#default_value' => variable_get( 'globalcollect_audit_test_mode', 
GC_AUDIT_TEST_MODE ),
   );
@@ -334,7 +335,7 @@
}
 
//This isn't going to work unless you're connecting to 
a database that has the row you're looking for. 
-   $missing_txn_message = 
globalcollect_audit_format_data_for_stomp( $data, $logdata['donor_data'], 
$logdata['contribution_id'] );
+   $missing_txn_message = 
globalcollect_audit_format_data_for_queue( $data, $logdata['donor_data'], 
$logdata['contribution_id'] );
if ( is_null( $missing_txn_message ) ){
//log this out in a list of troubled 
transactions. 
$info = array(
@@ -352,14 +353,14 @@
$local_found_ids[] = $order_id;
globalcollect_audit_echo('!');
} else {
-   if ( globalcollect_audit_send_queue_message( 
'donations', $missing_txn_message ) ){
-   watchdog('globalcollect_audit', 
__FUNCTION__ . ': Message sent to stomp successfully: ' . print_r( 
$missing_txn_message, true ), array(), WATCHDOG_INFO);
+   try {
+   globalcollect_audit_send_queue_message( 
'donations', $missing_txn_message );
+   watchdog('globalcollect_audit', 
__FUNCTION__ . ': Message sent to queue successfully: ' . print_r( 
$missing_txn_message, true ), array(), WATCHDOG_INFO);
$local_found_ids[] = $order_id;
globalcollect_audit_echo('!');
-   } else {
-   $wd_message = __FUNCTION__ . ': Sending 
message to stomp failed: ' . print_r( $missing_txn_message, true );
-   $drush_message = "Failed sending STOMP 
message to queue.";
-   globalcollect_audit_log_error( 
$wd_message, "STOMP_BAD_SEND", $drush_message );
+   } catch( SmashPigException $ex ) {
+   $wd_message = __FUNCTION__ . ': Sending 
message to queue failed: ' . print_r( $missing_txn_message, true );
+   globalcollect_audit_log_error( 
$wd_message, "QUEUE_BAD_SEND", $ex->getMessage() );
return;
}
}
@@ -388,21 +389,21 @@
if ( $make_missing && count( $missing ) ){
//make all the remaining missing transactions with data 
defaults. 
foreach ( $missing as $order_id => $data ) {
-   $missing_txn_message = 
globalcollect_audit_format_data_for_stomp( $data );
+   $missing_txn_message = 
globalcollect_audit_format_data_for_queue( $data );

//but then we have to send the transaction...
if ( $test_mode ){
$local_built_ids[] = $order_id;
globalcollect_audit_echo('!');
} else {
-   if ( globalcollect_audit_send_queue_message( 
'donations', $missing_txn_message ) ){
-   watchdog('globalcollect_audit', 
__FUNCTION__ . ': Message sent to stomp successfully: ' . print_r( 
$missing_txn_message, true ), array(), WATCHDOG_INFO);
+   try{
+   globalcollect_audit_send_queue_message( 
'donations', 

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Remove obsolete and broken wmf_unsubscribe module

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

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

Change subject: Remove obsolete and broken wmf_unsubscribe module
..

Remove obsolete and broken wmf_unsubscribe module

This is now handled by the FundraisingEmailUnsubscribe mediawiki
extension. And the manual unsubscribe page is silly - it's way
simpler to just go to the contact and set the opt out field.

Bug: T145419
Change-Id: Ic05ea768d2fb32457ce0f8c21e2a8b959edcaf04
---
D sites/all/modules/wmf_unsubscribe/import_unsubs.drush.inc
D sites/all/modules/wmf_unsubscribe/resources/unsubscribe.css
D sites/all/modules/wmf_unsubscribe/templates/i18n/unsubscribe-confirm.en.html
D sites/all/modules/wmf_unsubscribe/templates/i18n/unsubscribe-confirm.es.html
D sites/all/modules/wmf_unsubscribe/templates/i18n/unsubscribe-fail.en.html
D sites/all/modules/wmf_unsubscribe/templates/i18n/unsubscribe-fail.es.html
D sites/all/modules/wmf_unsubscribe/templates/i18n/unsubscribe-success.en.html
D sites/all/modules/wmf_unsubscribe/templates/i18n/unsubscribe-success.es.html
D sites/all/modules/wmf_unsubscribe/templates/unsubscribe-confirm.html
D sites/all/modules/wmf_unsubscribe/templates/unsubscribe-fail.html
D sites/all/modules/wmf_unsubscribe/templates/unsubscribe-success.html
D sites/all/modules/wmf_unsubscribe/unsub_make.drush.inc
D sites/all/modules/wmf_unsubscribe/wmf_unsubscribe.info
D sites/all/modules/wmf_unsubscribe/wmf_unsubscribe.module
M sites/default/enabled_modules
15 files changed, 0 insertions(+), 645 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/41/312441/1

diff --git a/sites/all/modules/wmf_unsubscribe/import_unsubs.drush.inc 
b/sites/all/modules/wmf_unsubscribe/import_unsubs.drush.inc
deleted file mode 100644
index c27b369..000
--- a/sites/all/modules/wmf_unsubscribe/import_unsubs.drush.inc
+++ /dev/null
@@ -1,69 +0,0 @@
-
- */
-
-/**
- * Implementation of hook_drush_command()
- */
-function import_unsubs_drush_command() {
-   $items = array();
-
-   $items['import-unsubs'] = array(
-   'description' =>
-   'Import unsubscribed email addresses into CiviCRM from a CSV 
via a queue',
-   'examples' => array( 'drush import-unsubs filename.csv' ),
-//'aliases' => array( 'ic' ),
-   'required-arguments' => true,
-   'arguments' => array(
-   'file' => 'Name of CSV file to process'
-   )
-   );
-
-   return $items;
-}
-
-/**
- * Implementation of hook_drush_help()
- */
-function import_unsubs_drush_help( $section ) {
-   switch ( $section ) {
-   case 'drush:import-unsubs':
-   return dt( "Import unsubscribed email addresses into 
CiviCRM from a CSV via a queue" );
-   }
-}
-
-/**
- *
- */
-function drush_import_unsubs() {
-   try{
-   $args = drush_get_arguments();
-   $filename = $args[1];
-
-   if( ( $file = fopen( $filename, 'r' )) === FALSE ){
-   watchdog('wmf_unsubscribe', 'Import unsubs: Could not 
open file for reading: ' . $filename, array(), WATCHDOG_ERROR);
-   return;
-   }
-
-   $headers = _load_headers( fgetcsv( $file, 0, ',', '"', '\\') );
-
-   while( ( $row = fgetcsv( $file, 0, ',', '"', '\\')) !== FALSE) {
-   $form_state = array(
-   'values' => array(
-   'email' => _get_value( "email", $row, 
$headers ),
-   ),
-   );
-
-   wmf_unsubscribe_manual_form_submit( null, $form_state );
-   }
-
-   }
-   catch ( Exception $e ){
-   watchdog('wmf_unsubscribe', 'Import unsubs: Exception thrown 
during csv processing: ' . print_r( $e, true ), array(), WATCHDOG_ERROR);
-   }
-}
diff --git a/sites/all/modules/wmf_unsubscribe/resources/unsubscribe.css 
b/sites/all/modules/wmf_unsubscribe/resources/unsubscribe.css
deleted file mode 100755
index f222533..000
--- a/sites/all/modules/wmf_unsubscribe/resources/unsubscribe.css
+++ /dev/null
@@ -1,47 +0,0 @@
-#header-region,
-#wrapper,
-#wrapper #container,
-#wrapper #container #center,
-#wrapper #container #center #squeeze,
-.left-corner,
-.right-corner{
-background: none !important;
-background-image: none !important;
-background-color: transparent !important;
-}
-
-#block-system-0,
-#header,
-#sidebar-left,
-#sidebar-right,
-.breadcrumb,
-.messages.error,
-.messages.status,
-h2{
-display: none !important;
-}
-
-body{
-background-color: #f3f3f3 !important;
-}
-
-#logo{
-position: absolute;
-top: 13px;
-left: 15px;
-width: 135px;
-height: 135px;
-background-image: 
url(//upload.wikimedia.org/wikipedia/foundation/9/9a/Wikimediafoundation-logo.png);
-}
-

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Remove phantom config variables

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

Change subject: Hygiene: Remove phantom config variables
..


Hygiene: Remove phantom config variables

These config option dates back to mobile uploads (remember that?!)
It's not needed anymore. Note I will be removed this from the cluster
as part of Icb2f18c532f8e237df2c4d7d625647c4ea7eb1e0 but that does
not block this.

Change-Id: I4a969905876c64b2b427aa03cb09ed6ae3980f0f
---
M README.md
M extension.json
M i18n/en.json
M i18n/qqq.json
4 files changed, 0 insertions(+), 27 deletions(-)

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



diff --git a/README.md b/README.md
index 6f6eea4..cc92b8a 100644
--- a/README.md
+++ b/README.md
@@ -657,14 +657,6 @@
 * Type: `String`
 * Default: Defaults to the current wiki
 
- $wgMFUploadMinEdits
-
-Set the minimum edits the user needs before they can upload images in mobile
-mode.
-
-* Type: `Integer`
-* Default: `0`
-
  $wgMFUseWikibaseDescription (deprecated)
 
 See `$wgMFUseWikibase`
diff --git a/extension.json b/extension.json
index ba9b3ea..65afa85 100644
--- a/extension.json
+++ b/extension.json
@@ -21,20 +21,6 @@
"MediaWiki": ">= 1.27.0"
},
"callback": "MobileFrontendHooks::onRegistration",
-   "GroupPermissions": {
-   "*": {
-   "mf-uploadbutton": false
-   },
-   "autoconfirmed": {
-   "mf-uploadbutton": true
-   },
-   "sysop": {
-   "mf-uploadbutton": true
-   }
-   },
-   "AvailableRights": [
-   "mf-uploadbutton"
-   ],
"ConfigRegistry": {
"mobilefrontend": "GlobalVarConfig::newInstance"
},
@@ -2053,7 +2039,6 @@
"MFCollapseSectionsByDefault": true,
"MFPhotoUploadWiki": null,
"MFPhotoUploadEndpoint": "",
-   "MFUploadMinEdits": 0,
"MFUseWikibaseDescription": false,
"MFUseWikibase": false,
"MFDisplayWikibaseDescription": false,
diff --git a/i18n/en.json b/i18n/en.json
index 10fdc7b..b08110b 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -38,7 +38,6 @@
]
},
"abusefilter-edit-builder-vars-user-mobile": "Whether or not a user is 
editing through the mobile interface",
-   "action-mf-uploadbutton": "use the simplified mobile upload system",
"beta-feature-minerva": "Enable mobile skin ({{int:skinname-minerva}}) 
on desktop",
"beta-feature-minerva-description": "Make the skin used on mobile 
devices a selectable desktop skin under the \"{{int:prefs-rendering}}\" 
preferences tab.",
"mobile-frontend-account-create-captcha-placeholder": "Enter 
confirmation code",
@@ -354,7 +353,6 @@
"mobile.css": "/* CSS placed here will affect users of the mobile site 
*/",
"mobile.js": "/* Any JavaScript here will be loaded for users using the 
mobile site */",
"nearby": "Pages on topics near you",
-   "right-mf-uploadbutton": "Use the upload button on mobile pages",
"tag-mobile_edit": "Mobile edit",
"tag-mobile_edit-description": "Edit made from mobile (web or app)",
"tag-mobile_web_edit": "Mobile web edit",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index c83007a..810a520 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -38,7 +38,6 @@
]
},
"abusefilter-edit-builder-vars-user-mobile": "AbuseFilter extension 
rule variable that allows distinguishing edits based on if they have been made 
using the editor of MobileFrontend or not.",
-   "action-mf-uploadbutton": "The error message, if the user don't have 
the right to see the upload button on mobile 
pages.\n\n{{Doc-action|mf-uploadbutton}}",
"beta-feature-minerva": "Name of the Minerva beta feature. Used as 
checkbox label.\n\nRefers to {{msg-mw|Skinname-minerva}}.\n\nSee also:\n* 
{{msg-mw|Beta-feature-minerva-description}}",
"beta-feature-minerva-description": "Describe the Minerva beta feature 
- it makes a new skin available.\n\nThis description is for the label 
{{msg-mw|Beta-feature-minerva}}.",
"mobile-frontend-account-create-captcha-placeholder": "Placeholder for 
captcha input field",
@@ -354,7 +353,6 @@
"mobile.css": "{{optional}}\nSee also:\n* {{msg-mw|Mobile.js}} 
(Optional message)",
"mobile.js": "{{optional}}\nSee also:\n* {{msg-mw|Mobile.css}} 
(Optional message)",
"nearby": "{{doc-special|Nearby}}",
-   "right-mf-uploadbutton": "Description of right to see the upload button 
on mobile pages.\n\n{{Doc-right|mf-uploadbutton}}",
"tag-mobile_edit": "Short change tag name for edits coming  from mobile 
(web or apps).\n\nSee also:\n* {{msg-mw|Tag-mobile edit-description}}",
"tag-mobile_edit-description": "Short change tag 

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove pre-1.25 API compatibility code

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

Change subject: Remove pre-1.25 API compatibility code
..


Remove pre-1.25 API compatibility code

Since this extension uses extension.json, it already requires 1.25+ so
no need to keep the old code around.

Change-Id: I58f66901e345dd58cb826277fe9fde0dd8a8180f
---
M includes/api/ApiMobileView.php
M includes/api/ApiParseExtender.php
M includes/specials/SpecialMobileLanguages.php
M tests/phpunit/api/ApiMobileViewTest.php
M tests/phpunit/api/ApiParseExtenderTest.php
5 files changed, 14 insertions(+), 122 deletions(-)

Approvals:
  Jforrester: Looks good to me, but someone else must approve
  Jdlrobson: Looks good to me, approved
  Bmansurov: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php
index 49687ed..5237cc3 100644
--- a/includes/api/ApiMobileView.php
+++ b/includes/api/ApiMobileView.php
@@ -839,87 +839,6 @@
}
 
/**
-* Get the description for Api parameters.
-* @deprecated since MediaWiki core 1.25
-* @return array
-*/
-   public function getParamDescription() {
-   $res = [
-   'id' => 'Id of the page',
-   'page' => 'Title of page to process',
-   'redirect' => 'Whether redirects should be followed',
-   'sections' => [
-   'Pipe-separated list of section numbers for 
which to return text.',
-   " `all' can be used to return for all. Ranges 
in format '1-4' mean get sections 1,2,3,4.",
-   " Ranges without second number, e.g. '1-' means 
get all until the end.",
-   " `references' can be used to specify that all 
sections containing references",
-   " should be returned."
-   ],
-   'prop' => [
-   'Which information to get',
-   ' text- HTML of selected 
section(s)',
-   ' sections- information about all 
sections on page',
-   ' normalizedtitle - normalized page title',
-   ' lastmodified- ISO 8601 timestamp for when 
the page was last modified, '
-   . 'e.g. "2014-04-13T22:42:14Z"',
-   ' lastmodifiedby  - information about the user 
who modified the page last',
-   ' revision- return the current revision 
id of the page',
-   ' protection  - information about 
protection level',
-   ' editable- whether current user can 
edit this page. This includes '
-   . 'all factors for logged-in users but 
not blocked status for anons.',
-   ' languagecount   - number of languages that 
the page is available in',
-   ' hasvariants - whether or not the page is 
available in other language variants',
-   ' displaytitle- HTML of the page title for 
display, with {{DISPLAYTITLE}} and such applied',
-   ' pageprops   - page properties',
-   ' description - page description from 
Wikidata',
-   ' contentmodel- page contentmodel',
-   ' namespace   - the namespace of the page',
-   ],
-   'sectionprop' => 'What information about sections to 
get',
-   'pageprops' => 'What page properties to return, a pipe 
(|) separated list or * for'
-   . ' all properties',
-   'variant' => "Convert content into this language 
variant",
-   'noimages' => 'Return HTML without images',
-   'noheadings' => "Don't include headings in output",
-   'notransform' => "Don't transform HTML into 
mobile-specific version",
-   'onlyrequestedsections' => 'Return only requested 
sections even with prop=sections',
-   'offset' =>
-   'Pretend all text result is one string, and 
return the substring starting at this point',
-   'maxlen' => 'Pretend all text result is one string, and 
limit result to this length',
-   ];
-   if ( $this->usePageImages ) {
-   $res['prop'][] = ' image   - information about 
an image associated with this page';
-   $res['prop'][] = ' thumb   - thumbnail of an 
image 

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Remove BogusMobileContext

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

Change subject: Hygiene: Remove BogusMobileContext
..


Hygiene: Remove BogusMobileContext

The BogusMobileContext and MobileContext::setInstanceForTesting method
were used to create an implicit test that MobileContext::singleton
wasn't called throughout the MobileContextTest test suite.

It's not clear why this assertion needs to be made at all.

Changes:
* Remove BogusMobileContext
* Remove MobileContext::setInstanceForTesting as it no longer used

Bug: T143875
Change-Id: I682f70d904a96ccfbf392e15eaa577891472cd52
---
M includes/MobileContext.php
M tests/phpunit/MobileContextTest.php
2 files changed, 0 insertions(+), 20 deletions(-)

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



diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index bd54b1f..2cb8e63 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -121,18 +121,6 @@
}
 
/**
-* Overrides the singleton instance.
-*
-* @warning This method should only accept instances of 
`MobileContext`. The `BogusMobileContext`
-*  class is used in the `MobileContextTest` test suite and will be 
removed.
-*
-* @param MobileContext|BogusContext $instance
-*/
-   public static function setInstanceForTesting( $instance ) {
-   self::$instance = $instance;
-   }
-
-   /**
 * Resets the singleton instance.
 */
public static function resetInstanceForTesting() {
diff --git a/tests/phpunit/MobileContextTest.php 
b/tests/phpunit/MobileContextTest.php
index dfb7287..15a87e2 100644
--- a/tests/phpunit/MobileContextTest.php
+++ b/tests/phpunit/MobileContextTest.php
@@ -21,8 +21,6 @@
 
protected function setUp() {
parent::setUp();
-   // Permit no access to the singleton
-   MobileContext::setInstanceForTesting( new BogusMobileContext() 
);
}
 
protected function tearDown() {
@@ -658,11 +656,5 @@
$this->setMwGlobals( 'wgTitle', null );
SpecialPage::getTitleFor( 'Search' );
$this->assertTrue( true, 'In case of failure this test just 
crashes' );
-   }
-}
-
-class BogusMobileContext {
-   public function __call( $who, $cares ) {
-   throw new Exception( "Don't touch me!" );
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I682f70d904a96ccfbf392e15eaa577891472cd52
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx 
Gerrit-Reviewer: Jdlrobson 
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...MobileFrontend[master]: Name singleton overriding methods more clearly

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

Change subject: Name singleton overriding methods more clearly
..


Name singleton overriding methods more clearly

MobileContext::setInstance is only used in PHPUnit test suites.
Typically it's used to destroy the singleton instance in order to reset
its state.

Changes:
* Rename MobileContext::setInstance to ::setInstanceForTesting to make
  it clear when the method should be used
* Add MobileContext::resetInstanceForTesting, which handles the common
  use case above

Bug: T143875
Change-Id: If959a53c57235de1bc74a406b1b42c3ea463897e
---
M includes/MobileContext.php
M tests/phpunit/MobileContextTest.php
M tests/phpunit/MobileFrontend.hooksTest.php
M tests/phpunit/specials/SpecialMobileDiffTest.php
4 files changed, 23 insertions(+), 15 deletions(-)

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



diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index d88da4b..bd54b1f 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -121,15 +121,25 @@
}
 
/**
-* Set $this->instance to the given instance of MobileContext or null
-* @param MobileContext|null $instance MobileContext instance or null 
to set
-* @return MobileContext|null
+* Overrides the singleton instance.
+*
+* @warning This method should only accept instances of 
`MobileContext`. The `BogusMobileContext`
+*  class is used in the `MobileContextTest` test suite and will be 
removed.
+*
+* @param MobileContext|BogusContext $instance
 */
-   public static function setInstance( /* MobileContext|null */ $instance 
) {
+   public static function setInstanceForTesting( $instance ) {
self::$instance = $instance;
}
 
/**
+* Resets the singleton instance.
+*/
+   public static function resetInstanceForTesting() {
+   self::$instance = null;
+   }
+
+   /**
 * Set the IontextSource Object
 * @param IContextSource $context The IContextSource Object has to set
 */
diff --git a/tests/phpunit/MobileContextTest.php 
b/tests/phpunit/MobileContextTest.php
index 5f6a657..dfb7287 100644
--- a/tests/phpunit/MobileContextTest.php
+++ b/tests/phpunit/MobileContextTest.php
@@ -22,12 +22,13 @@
protected function setUp() {
parent::setUp();
// Permit no access to the singleton
-   MobileContext::setInstance( new BogusMobileContext() );
+   MobileContext::setInstanceForTesting( new BogusMobileContext() 
);
}
 
protected function tearDown() {
-   MobileContext::setInstance( null ); // refresh it
parent::tearDown();
+
+   MobileContext::resetInstanceForTesting();
}
 
/**
@@ -653,7 +654,7 @@
);
$req->setRequestURL( 
'/w/index.php?title=Special:Search=toggle_view_mobile' );
RequestContext::getMain()->setRequest( $req );
-   MobileContext::setInstance( null );
+   MobileContext::resetInstanceForTesting();
$this->setMwGlobals( 'wgTitle', null );
SpecialPage::getTitleFor( 'Search' );
$this->assertTrue( true, 'In case of failure this test just 
crashes' );
diff --git a/tests/phpunit/MobileFrontend.hooksTest.php 
b/tests/phpunit/MobileFrontend.hooksTest.php
index b5b5d8a..4525f62 100644
--- a/tests/phpunit/MobileFrontend.hooksTest.php
+++ b/tests/phpunit/MobileFrontend.hooksTest.php
@@ -108,8 +108,7 @@
 * SkinTemplate (sk) and OutputPage (out)
 */
protected function getContextSetup( $mode, $mfXAnalyticsItems, $title = 
null ) {
-   // Create a new MobileContext object for this test
-   MobileContext::setInstance( null );
+   MobileContext::resetInstanceForTesting();
// create a new instance of MobileContext
$context = MobileContext::singleton();
// create a DerivativeContext to use in MobileContext later
@@ -141,8 +140,6 @@
foreach ( $mfXAnalyticsItems as $key => $val ) {
$context->addAnalyticsLogItem( $key, $val );
}
-   // set the newly created MobileContext object as the current 
instance to use
-   MobileContext::setInstance( $context );
 
// return the stuff
return [
@@ -183,7 +180,7 @@
'wgScriptPath' => '/w',
'wgScript' => '/w/index.php',
] );
-   MobileContext::setInstance( null );
+   MobileContext::resetInstanceForTesting();
 
$title = Title::newFromText( 'PurgeTest' );
 
diff --git 

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove MFPageActions/MFEnableSiteNotice vars

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

Change subject: Remove MFPageActions/MFEnableSiteNotice vars
..


Remove MFPageActions/MFEnableSiteNotice vars

The MFPageActions and MFEnableSiteNotice config variables were
deprecated in Ib64b9400 (19/02/2016) and can now be removed.

Now that MobileContext::singleton isn't invoked in the extension
registration callback, add a strong warning that it shouldn't be in
future (see I8d57f485 for context).

Bug: T143875
Depends-On: Icb2f18c532f8e237df2c4d7d625647c4ea7eb1e0
Change-Id: Icb5f9e927304f04cccb045c83190fc46f2076dc7
---
M README.md
M includes/MobileFrontend.hooks.php
2 files changed, 9 insertions(+), 30 deletions(-)

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



diff --git a/README.md b/README.md
index 62ab591..6f6eea4 100644
--- a/README.md
+++ b/README.md
@@ -147,15 +147,6 @@
   ]
 ```
 
- $wgMFEnableSiteNotice
-
-Whether site notice's can be shown in the mobile skin.
-
-See: 
-
-* Type: `Boolean`
-* Default: `false`
-
  $wgMFIgnoreEventLoggingBucketing
 
 Disable EventLogging bucketing for purposes of development.  When enabled all
@@ -235,6 +226,7 @@
  $wgMinervaEnableSiteNotice
 
 Controls whether site notices should be shown.
+See .
 
 * Type: `Boolean`
 * Default: `false`
@@ -363,12 +355,7 @@
 ```
 
 
- $wgMFPageActions (deprecated)
-
-See `$wgMinervaPageActions`.
-
  $wgMinervaPageActions
-
 
 Controls which page actions, if any, are displayed. Allowed: `edit`, `watch`, 
`talk`, and
 `switch-language`.
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index dd7a7ea..7518f70 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -1434,11 +1434,16 @@
}
 
/**
-* Handler for Extension registration callback
+* Extension registration callback.
+*
+* `extension.json` has parsed and the configuration merged with the 
current state of the
+* application. `MediaWikiServices` isn't bootstrapped so no services 
defined by extensions are
+* available.
+*
+* @warning DO NOT try to access services defined by MobileFrontend 
here.
 */
public static function onRegistration() {
-   global $wgResourceLoaderLESSImportPaths, $wgMinervaPageActions, 
$wgMinervaEnableSiteNotice,
-   $wgDisableAuthManager, $wgAuthManagerAutoConfig;
+   global $wgResourceLoaderLESSImportPaths, $wgDisableAuthManager;
 
// modify login/registration form
if ( class_exists( AuthManager::class ) && 
!$wgDisableAuthManager ) {
@@ -1450,19 +1455,6 @@
 
// Set LESS importpath
$wgResourceLoaderLESSImportPaths[] = dirname( __DIR__ ) . 
"/minerva.less/";
-
-   $config = MobileContext::singleton()->getConfig();
-
-   // For backwards compatiblity update new Minerva prefixed 
global with old MF value
-   if ( $config->has( 'MFPageActions' ) ) {
-   // FIXME: Use wfDeprecated to officially deprecate in 
later patchset
-   $wgMinervaPageActions = $config->get( 'MFPageActions' );
-   }
-   // For backwards compatiblity.
-   if ( $config->has( 'MFEnableSiteNotice' ) ) {
-   // FIXME: Use wfDeprecated to officially deprecate in 
later patchset
-   $wgMinervaEnableSiteNotice = $config->get( 
'MFEnableSiteNotice' );
-   }
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icb5f9e927304f04cccb045c83190fc46f2076dc7
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Phuedx 
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]: Rename includes/Services to includes/services for consistency

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

Change subject: Rename includes/Services to includes/services for consistency
..


Rename includes/Services to includes/services for consistency

Change-Id: I900fab26a7cf5a339233f55c31168f8c2963bc8c
---
M autoload.php
R includes/services/CannotReplaceActiveServiceException.php
R includes/services/ContainerDisabledException.php
R includes/services/DestructibleService.php
R includes/services/NoSuchServiceException.php
R includes/services/SalvageableService.php
R includes/services/ServiceAlreadyDefinedException.php
R includes/services/ServiceContainer.php
R includes/services/ServiceDisabledException.php
9 files changed, 8 insertions(+), 8 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  Bartosz Dziewoński: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/autoload.php b/autoload.php
index d985ee0..a352884 100644
--- a/autoload.php
+++ b/autoload.php
@@ -869,14 +869,14 @@
'MediaWiki\\Logger\\Spi' => __DIR__ . '/includes/debug/logger/Spi.php',
'MediaWiki\\MediaWikiServices' => __DIR__ . 
'/includes/MediaWikiServices.php',
'MediaWiki\\Search\\ParserOutputSearchDataExtractor' => __DIR__ . 
'/includes/search/ParserOutputSearchDataExtractor.php',
-   'MediaWiki\\Services\\CannotReplaceActiveServiceException' => __DIR__ . 
'/includes/Services/CannotReplaceActiveServiceException.php',
-   'MediaWiki\\Services\\ContainerDisabledException' => __DIR__ . 
'/includes/Services/ContainerDisabledException.php',
-   'MediaWiki\\Services\\DestructibleService' => __DIR__ . 
'/includes/Services/DestructibleService.php',
-   'MediaWiki\\Services\\NoSuchServiceException' => __DIR__ . 
'/includes/Services/NoSuchServiceException.php',
-   'MediaWiki\\Services\\SalvageableService' => __DIR__ . 
'/includes/Services/SalvageableService.php',
-   'MediaWiki\\Services\\ServiceAlreadyDefinedException' => __DIR__ . 
'/includes/Services/ServiceAlreadyDefinedException.php',
-   'MediaWiki\\Services\\ServiceContainer' => __DIR__ . 
'/includes/Services/ServiceContainer.php',
-   'MediaWiki\\Services\\ServiceDisabledException' => __DIR__ . 
'/includes/Services/ServiceDisabledException.php',
+   'MediaWiki\\Services\\CannotReplaceActiveServiceException' => __DIR__ . 
'/includes/services/CannotReplaceActiveServiceException.php',
+   'MediaWiki\\Services\\ContainerDisabledException' => __DIR__ . 
'/includes/services/ContainerDisabledException.php',
+   'MediaWiki\\Services\\DestructibleService' => __DIR__ . 
'/includes/services/DestructibleService.php',
+   'MediaWiki\\Services\\NoSuchServiceException' => __DIR__ . 
'/includes/services/NoSuchServiceException.php',
+   'MediaWiki\\Services\\SalvageableService' => __DIR__ . 
'/includes/services/SalvageableService.php',
+   'MediaWiki\\Services\\ServiceAlreadyDefinedException' => __DIR__ . 
'/includes/services/ServiceAlreadyDefinedException.php',
+   'MediaWiki\\Services\\ServiceContainer' => __DIR__ . 
'/includes/services/ServiceContainer.php',
+   'MediaWiki\\Services\\ServiceDisabledException' => __DIR__ . 
'/includes/services/ServiceDisabledException.php',
'MediaWiki\\Session\\BotPasswordSessionProvider' => __DIR__ . 
'/includes/session/BotPasswordSessionProvider.php',
'MediaWiki\\Session\\CookieSessionProvider' => __DIR__ . 
'/includes/session/CookieSessionProvider.php',
'MediaWiki\\Session\\ImmutableSessionProviderWithCookie' => __DIR__ . 
'/includes/session/ImmutableSessionProviderWithCookie.php',
diff --git a/includes/Services/CannotReplaceActiveServiceException.php 
b/includes/services/CannotReplaceActiveServiceException.php
similarity index 100%
rename from includes/Services/CannotReplaceActiveServiceException.php
rename to includes/services/CannotReplaceActiveServiceException.php
diff --git a/includes/Services/ContainerDisabledException.php 
b/includes/services/ContainerDisabledException.php
similarity index 100%
rename from includes/Services/ContainerDisabledException.php
rename to includes/services/ContainerDisabledException.php
diff --git a/includes/Services/DestructibleService.php 
b/includes/services/DestructibleService.php
similarity index 100%
rename from includes/Services/DestructibleService.php
rename to includes/services/DestructibleService.php
diff --git a/includes/Services/NoSuchServiceException.php 
b/includes/services/NoSuchServiceException.php
similarity index 100%
rename from includes/Services/NoSuchServiceException.php
rename to includes/services/NoSuchServiceException.php
diff --git a/includes/Services/SalvageableService.php 
b/includes/services/SalvageableService.php
similarity index 100%
rename from includes/Services/SalvageableService.php
rename to includes/services/SalvageableService.php
diff --git a/includes/Services/ServiceAlreadyDefinedException.php 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Revert "Move wfEscapeWikiText() to Parser::escapeWikitext()"

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

Change subject: Revert "Move wfEscapeWikiText() to Parser::escapeWikitext()"
..


Revert "Move wfEscapeWikiText() to Parser::escapeWikitext()"

Apparently it is possible for Parser::mParserOptions 
to not be set in some cases. I'll try again later.

This reverts commit bda74bff6e180b5a6bb2cc68e12ae391d53789a3.

Bug: T146433
Change-Id: Idb6d1b20995d5f86b712abb386ab987356c4f560
---
M includes/GlobalFunctions.php
M includes/parser/CoreParserFunctions.php
M includes/parser/Parser.php
3 files changed, 68 insertions(+), 89 deletions(-)

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



diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index ee5ebd0..0e59653 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -1656,8 +1656,6 @@
 }
 
 /**
- * @deprecated since 1.28, use Parser::escapeWikitext() directly
- *
  * Escapes the given text so that it may be output using addWikiText()
  * without any linking, formatting, etc. making its way through. This
  * is achieved by substituting certain characters with HTML entities.
@@ -1667,8 +1665,47 @@
  * @return string
  */
 function wfEscapeWikiText( $text ) {
-   global $wgParser;
-   return $wgParser->escapeWikitext( $text );
+   global $wgEnableMagicLinks;
+   static $repl = null, $repl2 = null;
+   if ( $repl === null ) {
+   $repl = [
+   '"' => '', '&' => '', "'" => '', '<' => 
'',
+   '=' => '', '>' => '', '[' => '', ']' => 
'',
+   '{' => '', '|' => '', '}' => '', ';' 
=> '',
+   "\n#" => "\n", "\r#" => "\r",
+   "\n*" => "\n", "\r*" => "\r",
+   "\n:" => "\n", "\r:" => "\r",
+   "\n " => "\n", "\r " => "\r",
+   "\n\n" => "\n", "\r\n" => "\n",
+   "\n\r" => "\n", "\r\r" => "\r",
+   "\n\t" => "\n", "\r\t" => "\r", // "\n\t\n" is 
treated like "\n\n"
+   "\n" => "\n---", "\r" => "\r---",
+   '__' => '_', '://' => '//',
+   ];
+
+   $magicLinks = array_keys( array_filter( $wgEnableMagicLinks ) );
+   // We have to catch everything "\s" matches in PCRE
+   foreach ( $magicLinks as $magic ) {
+   $repl["$magic "] = "$magic";
+   $repl["$magic\t"] = "$magic";
+   $repl["$magic\r"] = "$magic";
+   $repl["$magic\n"] = "$magic";
+   $repl["$magic\f"] = "$magic";
+   }
+
+   // And handle protocols that don't use "://"
+   global $wgUrlProtocols;
+   $repl2 = [];
+   foreach ( $wgUrlProtocols as $prot ) {
+   if ( substr( $prot, -1 ) === ':' ) {
+   $repl2[] = preg_quote( substr( $prot, 0, -1 ), 
'/' );
+   }
+   }
+   $repl2 = $repl2 ? '/\b(' . implode( '|', $repl2 ) . '):/i' : 
'/^(?!)/';
+   }
+   $text = substr( strtr( "\n$text", $repl ), 1 );
+   $text = preg_replace( $repl2, '$1', $text );
+   return $text;
 }
 
 /**
diff --git a/includes/parser/CoreParserFunctions.php 
b/includes/parser/CoreParserFunctions.php
index b3dc17c..01cce02 100644
--- a/includes/parser/CoreParserFunctions.php
+++ b/includes/parser/CoreParserFunctions.php
@@ -594,98 +594,98 @@
if ( is_null( $t ) ) {
return '';
}
-   return $parser->escapeWikitext( $t->getText() );
+   return wfEscapeWikiText( $t->getText() );
}
-   public static function pagenamee( Parser $parser, $title = null ) {
+   public static function pagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
-   return $parser->escapeWikitext( $t->getPartialURL() );
+   return wfEscapeWikiText( $t->getPartialURL() );
}
-   public static function fullpagename( Parser $parser, $title = null ) {
+   public static function fullpagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canTalk() ) {
return '';
}
-   return $parser->escapeWikitext( $t->getPrefixedText() );
+   return wfEscapeWikiText( $t->getPrefixedText() );
}
-   public static function fullpagenamee( Parser $parser, $title = null ) {
+   public static function fullpagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) 

[MediaWiki-commits] [Gerrit] wikimedia...golden[master]: Ungroup last_action_country and first_visits_country

2016-09-22 Thread Chelsyx (Code Review)
Chelsyx has submitted this change and it was merged.

Change subject: Ungroup last_action_country and first_visits_country
..


Ungroup last_action_country and first_visits_country

I checked the function wmf::rewrite_conditional and sink file run.Rout at 
/a/discovery/golden, but couldn't find anything suspicious... Since 
most_common_country got no problem when updated, and "ungroup()" seems to be 
the main difference between it and the other two, I made this change to test if 
it can fix the bug. But I'm not sure why...

Bug: T146422
Change-Id: I914bb0a42afd5de0ec52fa1bfb6beb8067aa500b
---
M portal/portal.R
1 file changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/portal/portal.R b/portal/portal.R
index f5ae958..ec73cbf 100644
--- a/portal/portal.R
+++ b/portal/portal.R
@@ -153,7 +153,8 @@
 dplyr::filter(!duplicated(session, fromLast = TRUE)) %>%
 dplyr::group_by(date, section_used, country) %>%
 dplyr::summarize(events = n()) %>%
-dplyr::mutate(proportion = round(events/sum(events), 4))
+dplyr::mutate(proportion = round(events/sum(events), 4)) %>%
+dplyr::ungroup()
 
   # Most common section clicked by country
   most_common_country <- data_w_countryname %>%
@@ -178,7 +179,8 @@
 dplyr::filter(visit == 1) %>%
 dplyr::group_by(date, section_used, country) %>%
 dplyr::summarize(sessions = n()) %>%
-dplyr::mutate(proportion = round(sessions/sum(sessions), 4))
+dplyr::mutate(proportion = round(sessions/sum(sessions), 4)) %>%
+dplyr::ungroup()
 
   # Get user agent data
   wmf::set_proxies() # To allow for the latest YAML to be retrieved.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I914bb0a42afd5de0ec52fa1bfb6beb8067aa500b
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/discovery/golden
Gerrit-Branch: master
Gerrit-Owner: Chelsyx 
Gerrit-Reviewer: Chelsyx 

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


[MediaWiki-commits] [Gerrit] wikimedia...golden[master]: Ungroup last_action_country and first_visits_country

2016-09-22 Thread Chelsyx (Code Review)
Chelsyx has uploaded a new change for review.

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

Change subject: Ungroup last_action_country and first_visits_country
..

Ungroup last_action_country and first_visits_country

I checked the function wmf::rewrite_conditional and sink file run.Rout at 
/a/discovery/golden, but couldn't find anything suspicious... Since 
most_common_country got no problem when updated, and "ungroup()" seems to be 
the main difference between it and the other two, I made this change to test if 
it can fix the bug. But I'm not sure why...

Bug: T146422
Change-Id: I914bb0a42afd5de0ec52fa1bfb6beb8067aa500b
---
M portal/portal.R
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/golden 
refs/changes/40/312440/1

diff --git a/portal/portal.R b/portal/portal.R
index f5ae958..ec73cbf 100644
--- a/portal/portal.R
+++ b/portal/portal.R
@@ -153,7 +153,8 @@
 dplyr::filter(!duplicated(session, fromLast = TRUE)) %>%
 dplyr::group_by(date, section_used, country) %>%
 dplyr::summarize(events = n()) %>%
-dplyr::mutate(proportion = round(events/sum(events), 4))
+dplyr::mutate(proportion = round(events/sum(events), 4)) %>%
+dplyr::ungroup()
 
   # Most common section clicked by country
   most_common_country <- data_w_countryname %>%
@@ -178,7 +179,8 @@
 dplyr::filter(visit == 1) %>%
 dplyr::group_by(date, section_used, country) %>%
 dplyr::summarize(sessions = n()) %>%
-dplyr::mutate(proportion = round(sessions/sum(sessions), 4))
+dplyr::mutate(proportion = round(sessions/sum(sessions), 4)) %>%
+dplyr::ungroup()
 
   # Get user agent data
   wmf::set_proxies() # To allow for the latest YAML to be retrieved.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I914bb0a42afd5de0ec52fa1bfb6beb8067aa500b
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/discovery/golden
Gerrit-Branch: master
Gerrit-Owner: Chelsyx 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Revert "Move wfEscapeWikiText() to Parser::escapeWikitext()"

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

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

Change subject: Revert "Move wfEscapeWikiText() to Parser::escapeWikitext()"
..

Revert "Move wfEscapeWikiText() to Parser::escapeWikitext()"

Apparently it is possible for Parser::mParserOptions 
to not be set in some cases. I'll try again later.

This reverts commit bda74bff6e180b5a6bb2cc68e12ae391d53789a3.

Bug: T146433
Change-Id: Idb6d1b20995d5f86b712abb386ab987356c4f560
---
M includes/GlobalFunctions.php
M includes/parser/CoreParserFunctions.php
M includes/parser/Parser.php
3 files changed, 68 insertions(+), 89 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/39/312439/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index ee5ebd0..0e59653 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -1656,8 +1656,6 @@
 }
 
 /**
- * @deprecated since 1.28, use Parser::escapeWikitext() directly
- *
  * Escapes the given text so that it may be output using addWikiText()
  * without any linking, formatting, etc. making its way through. This
  * is achieved by substituting certain characters with HTML entities.
@@ -1667,8 +1665,47 @@
  * @return string
  */
 function wfEscapeWikiText( $text ) {
-   global $wgParser;
-   return $wgParser->escapeWikitext( $text );
+   global $wgEnableMagicLinks;
+   static $repl = null, $repl2 = null;
+   if ( $repl === null ) {
+   $repl = [
+   '"' => '', '&' => '', "'" => '', '<' => 
'',
+   '=' => '', '>' => '', '[' => '', ']' => 
'',
+   '{' => '', '|' => '', '}' => '', ';' 
=> '',
+   "\n#" => "\n", "\r#" => "\r",
+   "\n*" => "\n", "\r*" => "\r",
+   "\n:" => "\n", "\r:" => "\r",
+   "\n " => "\n", "\r " => "\r",
+   "\n\n" => "\n", "\r\n" => "\n",
+   "\n\r" => "\n", "\r\r" => "\r",
+   "\n\t" => "\n", "\r\t" => "\r", // "\n\t\n" is 
treated like "\n\n"
+   "\n" => "\n---", "\r" => "\r---",
+   '__' => '_', '://' => '//',
+   ];
+
+   $magicLinks = array_keys( array_filter( $wgEnableMagicLinks ) );
+   // We have to catch everything "\s" matches in PCRE
+   foreach ( $magicLinks as $magic ) {
+   $repl["$magic "] = "$magic";
+   $repl["$magic\t"] = "$magic";
+   $repl["$magic\r"] = "$magic";
+   $repl["$magic\n"] = "$magic";
+   $repl["$magic\f"] = "$magic";
+   }
+
+   // And handle protocols that don't use "://"
+   global $wgUrlProtocols;
+   $repl2 = [];
+   foreach ( $wgUrlProtocols as $prot ) {
+   if ( substr( $prot, -1 ) === ':' ) {
+   $repl2[] = preg_quote( substr( $prot, 0, -1 ), 
'/' );
+   }
+   }
+   $repl2 = $repl2 ? '/\b(' . implode( '|', $repl2 ) . '):/i' : 
'/^(?!)/';
+   }
+   $text = substr( strtr( "\n$text", $repl ), 1 );
+   $text = preg_replace( $repl2, '$1', $text );
+   return $text;
 }
 
 /**
diff --git a/includes/parser/CoreParserFunctions.php 
b/includes/parser/CoreParserFunctions.php
index b3dc17c..01cce02 100644
--- a/includes/parser/CoreParserFunctions.php
+++ b/includes/parser/CoreParserFunctions.php
@@ -594,98 +594,98 @@
if ( is_null( $t ) ) {
return '';
}
-   return $parser->escapeWikitext( $t->getText() );
+   return wfEscapeWikiText( $t->getText() );
}
-   public static function pagenamee( Parser $parser, $title = null ) {
+   public static function pagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
-   return $parser->escapeWikitext( $t->getPartialURL() );
+   return wfEscapeWikiText( $t->getPartialURL() );
}
-   public static function fullpagename( Parser $parser, $title = null ) {
+   public static function fullpagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canTalk() ) {
return '';
}
-   return $parser->escapeWikitext( $t->getPrefixedText() );
+   return wfEscapeWikiText( $t->getPrefixedText() );
}
-   public static function fullpagenamee( Parser $parser, $title = null ) {
+   public static function fullpagenamee( $parser, $title = null ) {
$t = Title::newFromText( 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove see comment

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

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

Change subject: Remove see comment
..

Remove see comment

Change-Id: I58fcd682dba6c778c0975baf67a6b87f36b1aff2
---
M includes/libs/rdbms/database/Database.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/38/312438/1

diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index 66f7046..f56f380 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -1230,7 +1230,6 @@
return '';
}
 
-   // See IDatabase::select for the docs for this function
public function select( $table, $vars, $conds = '', $fname = __METHOD__,
$options = [], $join_conds = [] ) {
$sql = $this->selectSQLText( $table, $vars, $conds, $fname, 
$options, $join_conds );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I58fcd682dba6c778c0975baf67a6b87f36b1aff2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
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]: Cleanup deprecated MobileFrontend variables

2016-09-22 Thread Alex Monk (Code Review)
Alex Monk has submitted this change and it was merged.

Change subject: Cleanup deprecated MobileFrontend variables
..


Cleanup deprecated MobileFrontend variables

* Remove no longer used central notice and upload config variables
* Rename MF prefix to Minerva

Change-Id: Icb2f18c532f8e237df2c4d7d625647c4ea7eb1e0
---
M wmf-config/InitialiseSettings.php
M wmf-config/mobile.php
2 files changed, 1 insertion(+), 21 deletions(-)

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



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 53238ab..7b8fc72 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -14438,9 +14438,6 @@
'default' => NS_MAIN,
'commonswiki' => NS_FILE,
 ],
-'wmgMFUseCentralAuthToken' => [
-   'default' => true,
-],
 'wmgMFNearby' => [
'default' => true, // Does not gets enabled on wikis w/o GeoData anyway
 ],
@@ -14448,13 +14445,10 @@
'default' => 'commonswiki',
'test2wiki' => '',
 ],
-'wmgMFPhotoUploadAppendToDesc' => [
-   'default' => "{{Uploaded from 
Mobile|platform=Web|version=}}\n{{subst:unc}}",
-],
 'wmgMFEnableXAnalyticsLogging' => [
'default' => true,
 ],
-'wmgMFEnableSiteNotice' => [
+'wgMinervaEnableSiteNotice' => [
'default' => false,
 ],
 'wmgMFAppPackageId' => [
@@ -14480,10 +14474,6 @@
'default' => true,
'wiktionary' => false,
'wikidata' => false,
-],
-'wmgMFUploadMinEdits' => [
-   'default' => 10,
-   'commonswiki' => 75, // T64598
 ],
 'wgMFUseWikibase' => [
'default' => true,
diff --git a/wmf-config/mobile.php b/wmf-config/mobile.php
index 0bfffc4..aac7c30 100644
--- a/wmf-config/mobile.php
+++ b/wmf-config/mobile.php
@@ -9,10 +9,8 @@
$wgMFNoindexPages = false;
$wgMFNearby = $wmgMFNearby && $wmgEnableGeoData;
$wgMFPhotoUploadEndpoint = $wmgMFPhotoUploadEndpoint;
-   $wgMFUseCentralAuthToken = $wmgMFUseCentralAuthToken;
$wgMFPhotoUploadWiki = $wmgMFPhotoUploadWiki;
$wgMFContentNamespace = $wmgMFContentNamespace;
-   $wgMFPhotoUploadAppendToDesc = $wmgMFPhotoUploadAppendToDesc;
$wgMFMobileFormatterHeadings = $wmgMFMobileFormatterHeadings;
 
if ( $wmgMobileFrontendLogo ) {
@@ -91,7 +89,6 @@
return true;
};
 
-   $wgMFEnableSiteNotice = $wmgMFEnableSiteNotice;
$wgMFCollapseSectionsByDefault = $wmgMFCollapseSectionsByDefault;
$wgMFTidyMobileViewSections = false; // experimental
 
@@ -99,13 +96,6 @@
// They originally special-cased us but would like it done the normal 
way now. :)
$wgMFAppPackageId = $wmgMFAppPackageId;
$wgMFNearbyRange = $wmgMaxGeoSearchRadius;
-
-   // restrict access to mobile Uploads to users with minimum editcount 
T64598
-   $wgMFUploadMinEdits = $wmgMFUploadMinEdits;
-
-   // Disable mobile uploads per T64598
-   $wgGroupPermissions['autoconfirmed']['mf-uploadbutton'] = false;
-   $wgGroupPermissions['sysop']['mf-uploadbutton'] = false;
 
$wgMFEnableBeta = true;
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icb2f18c532f8e237df2c4d7d625647c4ea7eb1e0
Gerrit-PatchSet: 3
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: MaxSem 
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]: Scap: Bump installed version to 3.3.0-1

2016-09-22 Thread Thcipriani (Code Review)
Thcipriani has uploaded a new change for review.

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

Change subject: Scap: Bump installed version to 3.3.0-1
..

Scap: Bump installed version to 3.3.0-1

Change-Id: I4d228959f48b90115ed040a935dd6f227f659454
---
M modules/scap/manifests/init.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/37/312437/1

diff --git a/modules/scap/manifests/init.pp b/modules/scap/manifests/init.pp
index 646273e..95eb713 100644
--- a/modules/scap/manifests/init.pp
+++ b/modules/scap/manifests/init.pp
@@ -14,7 +14,7 @@
 $wmflabs_master = 'deployment-mira.eqiad.wmflabs',
 ) {
 package { 'scap':
-ensure => '3.2.5-1',
+ensure => '3.3.0-1',
 }
 
 file { '/etc/scap.cfg':

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: UsersLinkedToSpecificGroup

2016-09-22 Thread Kmuthu (Code Review)
Kmuthu has uploaded a new change for review.

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

Change subject: UsersLinkedToSpecificGroup
..

UsersLinkedToSpecificGroup

Users routed to the group they are added/removed.
Bug: T55860

Change-Id: Iff5f4d38ca2cc479c269ef736a7fd957959a03dc
---
M includes/formatters/UserRightsPresentationModel.php
1 file changed, 21 insertions(+), 5 deletions(-)


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

diff --git a/includes/formatters/UserRightsPresentationModel.php 
b/includes/formatters/UserRightsPresentationModel.php
index 106b829..c877da1 100644
--- a/includes/formatters/UserRightsPresentationModel.php
+++ b/includes/formatters/UserRightsPresentationModel.php
@@ -58,11 +58,27 @@
}
 
public function getPrimaryLink() {
-   return array(
-   'url' => SpecialPage::getTitleFor( 'Listgrouprights' 
)->getLocalURL(),
-   'label' => $this->msg( 'echo-learn-more' )->text()
-   );
-   }
+   $addedGroup = array_values( $this->event->getExtraParam( 'add', 
array() ) );
+   $removedGroup =  array_values( $this->event->getExtraParam( 
'remove', array() ) );
+   if( count( $addedGroup ) >= 1 && empty( $removedGroup ) ){
+   $addedGroup_firstValue = array_values( 
$this->event->getExtraParam( 'add', array() ) )[0];
+   return array(
+   'url' => SpecialPage::getTitleFor( 
'Listgrouprights', false,$addedGroup_firstValue )->getFullURL(),
+   'label' => $this->msg( 'echo-learn-more' 
)->text()
+   );
+   } elseif ( empty( $addedGroup ) && count( $removedGroup ) >= 1) 
{
+   $removedGroup_firstValue = array_values( 
$this->event->getExtraParam( 'remove', array() ) )[0];
+   return array(
+   'url' => SpecialPage::getTitleFor( 
'Listgrouprights', false, $removedGroup_firstValue )->getFullURL(),
+   'label' => $this->msg( 'echo-learn-more' 
)->text()
+   );
+   } else {
+   return array(
+   'url' => SpecialPage::getTitleFor( 
'Listgrouprights' )->getFullURL(),
+   'label' => $this->msg( 'echo-learn-more' 
)->text()
+   );
+   }
+   }
 
public function getSecondaryLinks() {
return array( $this->getAgentLink(), $this->getLogLink() );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff5f4d38ca2cc479c269ef736a7fd957959a03dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Kmuthu 

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


[MediaWiki-commits] [Gerrit] mediawiki...FlaggedRevs[wmf/1.28.0-wmf.20]: Fix I9839283c: new_text is actually a Content object

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

Change subject: Fix I9839283c: new_text is actually a Content object
..


Fix I9839283c: new_text is actually a Content object

Bug: T146423
Change-Id: I518eb5528d0354207deb418a4afaf49ce2607f32
---
M business/RevisionReviewForm.php
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/business/RevisionReviewForm.php b/business/RevisionReviewForm.php
index 69e7a49..55d01bf 100644
--- a/business/RevisionReviewForm.php
+++ b/business/RevisionReviewForm.php
@@ -324,15 +324,15 @@
}
$article = new WikiPage( $this->page );
# Get text with changes after $oldRev up to and 
including $newRev removed
-   $new_text = $article->getUndoContent( $newRev, $oldRev 
);
-   if ( $new_text === false ) {
+   $new_content = $article->getUndoContent( $newRev, 
$oldRev );
+   if ( $new_content === false ) {
return 'review_cannot_undo';
}
$baseRevId = $newRev->isCurrent() ? $oldRev->getId() : 
0;
 
# Actually make the edit...
$editStatus = $article->doEditContent(
-   ContentHandler::makeContent( $new_text, 
$article->getTitle() ),
+   $new_content,
$this->getComment(),
0,
$baseRevId,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I518eb5528d0354207deb418a4afaf49ce2607f32
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: Alex Monk 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.20]: Call setTransactionTicket() on DeferredUpdates sub-queue ite...

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Call setTransactionTicket() on DeferredUpdates sub-queue items 
too
..

Call setTransactionTicket() on DeferredUpdates sub-queue items too

This should lower the rate of "does not have outer scope" log
warnings in DBPerformance.

Also add traces to such logs.

Change-Id: I7d21ea745cae07e0fbbe4cd8de82e93f1d10e0a5
---
M includes/deferred/DeferredUpdates.php
M includes/libs/rdbms/lbfactory/LBFactory.php
2 files changed, 10 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/35/312435/1

diff --git a/includes/deferred/DeferredUpdates.php 
b/includes/deferred/DeferredUpdates.php
index d24ebde..8a761f5 100644
--- a/includes/deferred/DeferredUpdates.php
+++ b/includes/deferred/DeferredUpdates.php
@@ -214,6 +214,10 @@
$firstKey = key( 
self::$executeContext['subqueue'] );
unset( 
self::$executeContext['subqueue'][$firstKey] );
 
+   if ( $subUpdate instanceof 
DataUpdate ) {
+   
$subUpdate->setTransactionTicket( $ticket );
+   }
+
$guiError = self::runUpdate( 
$subUpdate, $lbFactory, $stage );
$reportableError = 
$reportableError ?: $guiError;
}
diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php 
b/includes/libs/rdbms/lbfactory/LBFactory.php
index cf9a298..f584865 100644
--- a/includes/libs/rdbms/lbfactory/LBFactory.php
+++ b/includes/libs/rdbms/lbfactory/LBFactory.php
@@ -515,7 +515,9 @@
 */
public function getEmptyTransactionTicket( $fname ) {
if ( $this->hasMasterChanges() ) {
-   $this->queryLogger->error( __METHOD__ . ": $fname does 
not have outer scope." );
+   $this->queryLogger->error( __METHOD__ . ": $fname does 
not have outer scope.\n" .
+   ( new RuntimeException() )->getTraceAsString() 
);
+
return null;
}
 
@@ -535,7 +537,9 @@
 */
public function commitAndWaitForReplication( $fname, $ticket, array 
$opts = [] ) {
if ( $ticket !== $this->ticket ) {
-   $this->perfLogger->error( __METHOD__ . ": $fname does 
not have outer scope." );
+   $this->perfLogger->error( __METHOD__ . ": $fname does 
not have outer scope.\n" .
+   ( new RuntimeException() )->getTraceAsString() 
);
+
return;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d21ea745cae07e0fbbe4cd8de82e93f1d10e0a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Call setTransactionTicket() on DeferredUpdates sub-queue ite...

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Call setTransactionTicket() on DeferredUpdates sub-queue items 
too
..

Call setTransactionTicket() on DeferredUpdates sub-queue items too

This should lower the rate of "does not have outer scope" log
warnings in DBPerformance.

Also add traces to such logs.

Change-Id: I7d21ea745cae07e0fbbe4cd8de82e93f1d10e0a5
---
M includes/deferred/DeferredUpdates.php
M includes/libs/rdbms/lbfactory/LBFactory.php
2 files changed, 10 insertions(+), 2 deletions(-)


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

diff --git a/includes/deferred/DeferredUpdates.php 
b/includes/deferred/DeferredUpdates.php
index d24ebde..8a761f5 100644
--- a/includes/deferred/DeferredUpdates.php
+++ b/includes/deferred/DeferredUpdates.php
@@ -214,6 +214,10 @@
$firstKey = key( 
self::$executeContext['subqueue'] );
unset( 
self::$executeContext['subqueue'][$firstKey] );
 
+   if ( $subUpdate instanceof 
DataUpdate ) {
+   
$subUpdate->setTransactionTicket( $ticket );
+   }
+
$guiError = self::runUpdate( 
$subUpdate, $lbFactory, $stage );
$reportableError = 
$reportableError ?: $guiError;
}
diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php 
b/includes/libs/rdbms/lbfactory/LBFactory.php
index d75ba93..aa932aa 100644
--- a/includes/libs/rdbms/lbfactory/LBFactory.php
+++ b/includes/libs/rdbms/lbfactory/LBFactory.php
@@ -519,7 +519,9 @@
 */
public function getEmptyTransactionTicket( $fname ) {
if ( $this->hasMasterChanges() ) {
-   $this->queryLogger->error( __METHOD__ . ": $fname does 
not have outer scope." );
+   $this->queryLogger->error( __METHOD__ . ": $fname does 
not have outer scope.\n" .
+   ( new RuntimeException() )->getTraceAsString() 
);
+
return null;
}
 
@@ -539,7 +541,9 @@
 */
public function commitAndWaitForReplication( $fname, $ticket, array 
$opts = [] ) {
if ( $ticket !== $this->ticket ) {
-   $this->perfLogger->error( __METHOD__ . ": $fname does 
not have outer scope." );
+   $this->perfLogger->error( __METHOD__ . ": $fname does 
not have outer scope.\n" .
+   ( new RuntimeException() )->getTraceAsString() 
);
+
return;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d21ea745cae07e0fbbe4cd8de82e93f1d10e0a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki...ArticleRatings[master]: I18n capitalization tweaks for consistency

2016-09-22 Thread SamanthaNguyen (Code Review)
SamanthaNguyen has submitted this change and it was merged.

Change subject: I18n capitalization tweaks for consistency
..


I18n capitalization tweaks for consistency

Bug: T146246
Change-Id: I5e967066b8cb80b3f5a7f6ead959c97384ce356c
---
M i18n/en.json
1 file changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 8f392c3..9948495 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -4,7 +4,7 @@
"Adam Carter"
]
},
-   "changerating": "ChangeRating",
+   "changerating": "Change rating",
"changerating-back": "< Back to [[$1]].",
"changerating-intro-text": "What would you like to change ''$1'''s 
rating to?",
"changerating-missing-parameter": "No page name was given. The page 
should be specified in the URL.",
@@ -12,16 +12,16 @@
"changerating-reason": "Reason:",
"changerating-success": "Rating changed successfully.",
"changerating-submit": "Submit",
-   "massratings": "MassRatings",
+   "massratings": "Mass ratings",
"massratings-legend": "List pages by rating",
-   "log-name-ratings": "Rating Change Log",
+   "log-name-ratings": "Rating change log",
"log-description-ratings": "This log shows all the recent changes to 
pages' ratings.",
"logentry-ratings-change": "$1 changed the rating of $3 from $5 to $4",
"ratings-desc": "A complex interface for rating pages",
"are-disallowed": "Ratings have been disallowed for this namespace",
"are-no-such-page": "The page \"$1\" does not exist.",
"are-rating-for-page": "Rating for 
\"$1\":",
-   "are-change-rating": "Change Rating",
+   "are-change-rating": "Change rating",
"are-ratings": "",
"group-reviewer": "Reviewer",
"group-reviewer-member": "Reviewers",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5e967066b8cb80b3f5a7f6ead959c97384ce356c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticleRatings
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 
Gerrit-Reviewer: SamanthaNguyen 
Gerrit-Reviewer: Siebrand 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mw.loader: Use native Set where possible instead of string keys

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

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

Change subject: mw.loader: Use native Set where possible instead of string keys
..

mw.loader: Use native Set where possible instead of string keys

Total time spent in sortDependencies
(Chrome Canary, unthrottled, MacBook Pro, MediaWiki-Vagrant)
* Before: 0.53ms
* After: 0.3ms

Bug: T146432
Change-Id: I65e2b0efbd080adab003b5c9605405ea0ae5380d
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 31 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/33/312433/1

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 89bb83b..2d3202c 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -11,7 +11,7 @@
 ( function ( $ ) {
'use strict';
 
-   var mw,
+   var mw, StringSet,
hasOwn = Object.prototype.hasOwnProperty,
slice = Array.prototype.slice,
trackCallbacks = $.Callbacks( 'memory' ),
@@ -47,6 +47,24 @@
 
return hash;
}
+
+   StringSet = window.Set || ( function () {
+   /**
+* @private
+* @class
+*/
+   function StringSet() {
+   this.set = {};
+   }
+
+   StringSet.prototype.add = function ( value ) {
+   this.set[ value ] = true;
+   };
+
+   StringSet.prototype.has = function ( value ) {
+   return this.set.hasOwnProperty( value );
+   };
+   }() );
 
/**
 * Create an object that can be read from or written to from methods 
that allow
@@ -660,32 +678,16 @@
log.deprecate = !Object.defineProperty ? function ( 
obj, key, val ) {
obj[ key ] = val;
} : function ( obj, key, val, msg ) {
-   /*globals Set */
msg = 'Use of "' + key + '" is deprecated.' + ( 
msg ? ( ' ' + msg ) : '' );
-   var logged, loggedIsSet, uniqueTrace;
-   if ( window.Set ) {
-   logged = new Set();
-   loggedIsSet = true;
-   } else {
-   logged = {};
-   loggedIsSet = false;
-   }
-   uniqueTrace = function () {
+   var logged = new StringSet();
+   function uniqueTrace() {
var trace = new Error().stack;
-   if ( loggedIsSet ) {
-   if ( logged.has( trace ) ) {
-   return false;
-   }
-   logged.add( trace );
-   return true;
-   } else {
-   if ( logged.hasOwnProperty( 
trace ) ) {
-   return false;
-   }
-   logged[ trace ] = 1;
-   return true;
+   if ( logged.has( trace ) ) {
+   return false;
}
-   };
+   logged.add( trace );
+   return true;
+   }
Object.defineProperty( obj, key, {
configurable: true,
enumerable: true,
@@ -1106,8 +1108,8 @@
 *  dependencies, such that later modules depend on 
earlier modules. The array
 *  contains the module names. If the array contains 
already some module names,
 *  this function appends its result to the 
pre-existing array.
-* @param {Object} [unresolved] Hash used to track the 
current dependency
-*  chain; used to report loops in the dependency graph.
+* @param {StringSet} [unresolved] Used to track the 
current dependency
+*  chain, and to report loops in the dependency graph.
 * @throws {Error} If any unregistered module or a 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Initiate Hovercards A/B test on ruwiki and itwiki

2016-09-22 Thread Alex Monk (Code Review)
Alex Monk has submitted this change and it was merged.

Change subject: Initiate Hovercards A/B test on ruwiki and itwiki
..


Initiate Hovercards A/B test on ruwiki and itwiki

ON rate of 10% and 20%, respectively.
EL sampling rate of 1% and 2%, respectively.
Also move default EL sampling of 10% from extension to config.

Bug: T136746
Change-Id: I37bd630393e0ff347f7592263514627cbac4d876
---
M wmf-config/InitialiseSettings.php
1 file changed, 32 insertions(+), 0 deletions(-)

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



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index b27a152..53238ab 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12742,9 +12742,12 @@
 ],
 
 // T134778
+// T136746
 'wmgUsePopups' => [
'default' => false,
'huwiki' => true,
+   'ruwiki' => true,
+   'itwiki' => true,
 ],
 
 'wmgPopupsBetaFeature' => [
@@ -12753,12 +12756,16 @@
 ],
 
 // T134778
+// T136746
 'wmgPopupsExperiment' => [
'default' => false,
'huwiki' => true,
+   'ruwiki' => true,
+   'itwiki' => true,
 ],
 
 // T134778
+// T136746
 'wmgPopupsExperimentConfig' => [
'default' => false,
'huwiki' => [
@@ -12770,6 +12777,31 @@
'A' => 0.5,
],
],
+   'ruwiki' => [
+   'name' => 'T136746',
+   'enabled' => true,
+   'buckets' => [
+   // T136746
+   'control' => 0.9,
+   'A' => 0.1,
+   ],
+   ],
+   'itwiki' => [
+   'name' => 'T136746',
+   'enabled' => true,
+   'buckets' => [
+   // T136746
+   'control' => 0.8,
+   'A' => 0.2,
+   ],
+   ],
+],
+
+// T136746
+'wgSchemaPopupsSamplingRate' => [
+   'default' => 0.1,
+   'ruwiki' => 0.01,
+   'itwiki' => 0.02,
 ],
 
 'wmgULSCompactLanguageLinksBetaFeature' => [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I37bd630393e0ff347f7592263514627cbac4d876
Gerrit-PatchSet: 4
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Jhobs 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Jhobs 
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]: Rename includes/Services to include/services for consistency

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

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

Change subject: Rename includes/Services to include/services for consistency
..

Rename includes/Services to include/services for consistency

Change-Id: I900fab26a7cf5a339233f55c31168f8c2963bc8c
---
M autoload.php
R includes/services/CannotReplaceActiveServiceException.php
R includes/services/ContainerDisabledException.php
R includes/services/DestructibleService.php
R includes/services/NoSuchServiceException.php
R includes/services/SalvageableService.php
R includes/services/ServiceAlreadyDefinedException.php
R includes/services/ServiceContainer.php
R includes/services/ServiceDisabledException.php
9 files changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/32/312432/1

diff --git a/autoload.php b/autoload.php
index d985ee0..a352884 100644
--- a/autoload.php
+++ b/autoload.php
@@ -869,14 +869,14 @@
'MediaWiki\\Logger\\Spi' => __DIR__ . '/includes/debug/logger/Spi.php',
'MediaWiki\\MediaWikiServices' => __DIR__ . 
'/includes/MediaWikiServices.php',
'MediaWiki\\Search\\ParserOutputSearchDataExtractor' => __DIR__ . 
'/includes/search/ParserOutputSearchDataExtractor.php',
-   'MediaWiki\\Services\\CannotReplaceActiveServiceException' => __DIR__ . 
'/includes/Services/CannotReplaceActiveServiceException.php',
-   'MediaWiki\\Services\\ContainerDisabledException' => __DIR__ . 
'/includes/Services/ContainerDisabledException.php',
-   'MediaWiki\\Services\\DestructibleService' => __DIR__ . 
'/includes/Services/DestructibleService.php',
-   'MediaWiki\\Services\\NoSuchServiceException' => __DIR__ . 
'/includes/Services/NoSuchServiceException.php',
-   'MediaWiki\\Services\\SalvageableService' => __DIR__ . 
'/includes/Services/SalvageableService.php',
-   'MediaWiki\\Services\\ServiceAlreadyDefinedException' => __DIR__ . 
'/includes/Services/ServiceAlreadyDefinedException.php',
-   'MediaWiki\\Services\\ServiceContainer' => __DIR__ . 
'/includes/Services/ServiceContainer.php',
-   'MediaWiki\\Services\\ServiceDisabledException' => __DIR__ . 
'/includes/Services/ServiceDisabledException.php',
+   'MediaWiki\\Services\\CannotReplaceActiveServiceException' => __DIR__ . 
'/includes/services/CannotReplaceActiveServiceException.php',
+   'MediaWiki\\Services\\ContainerDisabledException' => __DIR__ . 
'/includes/services/ContainerDisabledException.php',
+   'MediaWiki\\Services\\DestructibleService' => __DIR__ . 
'/includes/services/DestructibleService.php',
+   'MediaWiki\\Services\\NoSuchServiceException' => __DIR__ . 
'/includes/services/NoSuchServiceException.php',
+   'MediaWiki\\Services\\SalvageableService' => __DIR__ . 
'/includes/services/SalvageableService.php',
+   'MediaWiki\\Services\\ServiceAlreadyDefinedException' => __DIR__ . 
'/includes/services/ServiceAlreadyDefinedException.php',
+   'MediaWiki\\Services\\ServiceContainer' => __DIR__ . 
'/includes/services/ServiceContainer.php',
+   'MediaWiki\\Services\\ServiceDisabledException' => __DIR__ . 
'/includes/services/ServiceDisabledException.php',
'MediaWiki\\Session\\BotPasswordSessionProvider' => __DIR__ . 
'/includes/session/BotPasswordSessionProvider.php',
'MediaWiki\\Session\\CookieSessionProvider' => __DIR__ . 
'/includes/session/CookieSessionProvider.php',
'MediaWiki\\Session\\ImmutableSessionProviderWithCookie' => __DIR__ . 
'/includes/session/ImmutableSessionProviderWithCookie.php',
diff --git a/includes/Services/CannotReplaceActiveServiceException.php 
b/includes/services/CannotReplaceActiveServiceException.php
similarity index 100%
rename from includes/Services/CannotReplaceActiveServiceException.php
rename to includes/services/CannotReplaceActiveServiceException.php
diff --git a/includes/Services/ContainerDisabledException.php 
b/includes/services/ContainerDisabledException.php
similarity index 100%
rename from includes/Services/ContainerDisabledException.php
rename to includes/services/ContainerDisabledException.php
diff --git a/includes/Services/DestructibleService.php 
b/includes/services/DestructibleService.php
similarity index 100%
rename from includes/Services/DestructibleService.php
rename to includes/services/DestructibleService.php
diff --git a/includes/Services/NoSuchServiceException.php 
b/includes/services/NoSuchServiceException.php
similarity index 100%
rename from includes/Services/NoSuchServiceException.php
rename to includes/services/NoSuchServiceException.php
diff --git a/includes/Services/SalvageableService.php 
b/includes/services/SalvageableService.php
similarity index 100%
rename from includes/Services/SalvageableService.php
rename to includes/services/SalvageableService.php
diff --git a/includes/Services/ServiceAlreadyDefinedException.php 
b/includes/services/ServiceAlreadyDefinedException.php

[MediaWiki-commits] [Gerrit] mediawiki...ArticleRatings[master]: Delete the old PHP i18n file for good

2016-09-22 Thread SamanthaNguyen (Code Review)
SamanthaNguyen has submitted this change and it was merged.

Change subject: Delete the old PHP i18n file for good
..


Delete the old PHP i18n file for good

Bug: T145313
Change-Id: I9bd3062132c71e9865c9aad8bded54f8918b3a40
---
D ArticleRatings.i18n.php
1 file changed, 0 insertions(+), 49 deletions(-)

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



diff --git a/ArticleRatings.i18n.php b/ArticleRatings.i18n.php
deleted file mode 100644
index 04a40fd..000
--- a/ArticleRatings.i18n.php
+++ /dev/null
@@ -1,49 +0,0 @@
- 'ChangeRating',
-   'changerating-back' => '< Back to [[$1]].',
-   'changerating-intro-text' => "What would you like to change ''$1'''s 
rating to?",
-   'changerating-missing-parameter' => 'No page name was given. The page 
should be specified in the URL.',
-   'changerating-no-such-page' => 'Sorry, the page "$1" does not exist.',
-   'changerating-reason' => 'Reason:',
-   'changerating-success' => 'Rating changed successfully.',
-   'changerating-submit' => 'Submit',
-   'massratings' => 'MassRatings',
-   'massratings-legend' => 'List pages by rating',
-   'log-name-ratings' => 'Rating Change Log',
-   'log-description-ratings' => 'This log shows all the recent changes to 
pages\' ratings.',
-   'logentry-ratings-change' => '$1 changed the rating of $3 from $5 to 
$4',
-   'ratings-desc' => 'A complex interface for rating pages',
-   'are-disallowed' => 'Ratings have been disallowed for this namespace',
-   'are-no-such-page' => 'The page "$1" does not exist.',
-   'are-rating-for-page' => 'Rating for 
"$1":',
-   'are-change-rating' => 'Change Rating',
-   'are-ratings' => '',
-   'group-reviewer' => 'Reviewer',
-   'group-reviewer-member' => 'Reviewers',
-   'action-change-rating' => 'change article ratings',
-   'changerating-log-text' => 'Past rating changes on this article:',
-   'changerating-nolog-text' => 'There are no past rating changes on this 
article.'
-);
-
-/** Vietnamese (Tiếng Việt)
- * @author Codyn329
- */
-$message['vi'] = array(
-   'changerating' => 'Đánh giá sự thay đổi',
-   'massratings' => 'số đông đánh giá',
-   'log-name-ratings' => 'sự thay đổi Đánh giá ghi',
-   'log-descripiton-ratings' => 'Nhật ký này cho thấy tất cả các thay đổi 
gần đây để các trang\'s Dánh giá.',
-   'logentry-ratings-change' => '$1 thay đổi đánh giá của $3 đến $4',
-   'rating-desc' =>'Một giao diện phức tạp để đánh giá các trang'
-);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9bd3062132c71e9865c9aad8bded54f8918b3a40
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticleRatings
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 
Gerrit-Reviewer: SamanthaNguyen 
Gerrit-Reviewer: Siebrand 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Support multiple limits and arbitrary periods in account cre...

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

Change subject: Support multiple limits and arbitrary periods in account 
creation throttle
..


Support multiple limits and arbitrary periods in account creation throttle

This adds support for multiple count-per-period limits and arbitrary
period durations in the AuthManager account creation throttle in the
wiki settings. The $wgAccountCreationThrottle config variable becomes
an array like $wgPasswordAttemptThrottle.

Bug: T146290
Change-Id: Iea182a92a1199b0ce7103ab9ae24f1c87b01985c
---
M includes/DefaultSettings.php
M includes/auth/ThrottlePreAuthenticationProvider.php
M languages/i18n/en.json
M languages/i18n/qqq.json
M tests/phpunit/includes/auth/ThrottlePreAuthenticationProviderTest.php
5 files changed, 50 insertions(+), 17 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index f0e9e83..aa54629 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -5427,11 +5427,30 @@
 $wgHideUserContribLimit = 1000;
 
 /**
- * Number of accounts each IP address may create, 0 to disable.
+ * Number of accounts each IP address may create per specified period(s).
+ *
+ * @par Example:
+ * @code
+ * $wgAccountCreationThrottle = [
+ *  // no more than 100 per month
+ *  [
+ *   'count' => 100,
+ *   'seconds' => 30*86400,
+ *  ],
+ *  // no more than 10 per day
+ *  [
+ *   'count' => 10,
+ *   'seconds' => 86400,
+ *  ],
+ * ];
+ * @endcode
  *
  * @warning Requires $wgMainCacheType to be enabled
  */
-$wgAccountCreationThrottle = 0;
+$wgAccountCreationThrottle = [ [
+   'count' => 0,
+   'seconds' => 86400,
+] ];
 
 /**
  * Edits matching these regular expressions in body text
diff --git a/includes/auth/ThrottlePreAuthenticationProvider.php 
b/includes/auth/ThrottlePreAuthenticationProvider.php
index e2123ef..3f6a47d 100644
--- a/includes/auth/ThrottlePreAuthenticationProvider.php
+++ b/includes/auth/ThrottlePreAuthenticationProvider.php
@@ -65,13 +65,19 @@
public function setConfig( Config $config ) {
parent::setConfig( $config );
 
+   $accountCreationThrottle = $this->config->get( 
'AccountCreationThrottle' );
+   // Handle old $wgAccountCreationThrottle format (number of 
attempts per 24 hours)
+   if ( !is_array( $accountCreationThrottle ) ) {
+   $accountCreationThrottle = [ [
+   'count' => $accountCreationThrottle,
+   'seconds' => 86400,
+   ] ];
+   }
+
// @codeCoverageIgnoreStart
$this->throttleSettings += [
// @codeCoverageIgnoreEnd
-   'accountCreationThrottle' => [ [
-   'count' => $this->config->get( 
'AccountCreationThrottle' ),
-   'seconds' => 86400,
-   ] ],
+   'accountCreationThrottle' => $accountCreationThrottle,
'passwordAttemptThrottle' => $this->config->get( 
'PasswordAttemptThrottle' ),
];
 
@@ -107,7 +113,9 @@
 
$result = $this->accountCreationThrottle->increase( null, $ip, 
__METHOD__ );
if ( $result ) {
-   return \StatusValue::newFatal( 
'acct_creation_throttle_hit', $result['count'] );
+   $message = wfMessage( 'acct_creation_throttle_hit' 
)->params( $result['count'] )
+   ->durationParams( $result['wait'] );
+   return \StatusValue::newFatal( $message );
}
 
return \StatusValue::newGood();
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index b3781c2..614fa47 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -509,7 +509,7 @@
"signupend": "",
"signupend-https": "",
"mailerror": "Error sending mail: $1",
-   "acct_creation_throttle_hit": "Visitors to this wiki using your IP 
address have created {{PLURAL:$1|1 account|$1 accounts}} in the last day, which 
is the maximum allowed in this time period.\nAs a result, visitors using this 
IP address cannot create any more accounts at the moment.",
+   "acct_creation_throttle_hit": "Visitors to this wiki using your IP 
address have created {{PLURAL:$1|1 account|$1 accounts}} in the last $2, which 
is the maximum allowed in this time period.\nAs a result, visitors using this 
IP address cannot create any more accounts at the moment.",
"emailauthenticated": "Your email address was confirmed on $2 at $3.",
"emailnotauthenticated": "Your email address is not yet confirmed.\nNo 
email will be sent for any of the following features.",
"noemailprefs": "Specify an email address in 

[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.20]: Follow-up 764cd6a1: unbreak quiet buttons

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

Change subject: Follow-up 764cd6a1: unbreak quiet buttons
..


Follow-up 764cd6a1: unbreak quiet buttons

Quiet buttons are supposed to be initially gray,
not initially colored.

Bug: T146401
Change-Id: I8c3020591c82f7b2c1f7043892e73019886478af
(cherry picked from commit c84cd30e0905c5b0bb154187a98c304fabea8ae6)
---
M resources/src/mediawiki.less/mediawiki.ui/mixins.less
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/resources/src/mediawiki.less/mediawiki.ui/mixins.less 
b/resources/src/mediawiki.less/mediawiki.ui/mixins.less
index 3cc94b8..780b372 100644
--- a/resources/src/mediawiki.less/mediawiki.ui/mixins.less
+++ b/resources/src/mediawiki.less/mediawiki.ui/mixins.less
@@ -109,7 +109,7 @@
 .button-colors-quiet( @textColor, @highlightColor, @activeColor ) {
// Quiet buttons all start gray, and reveal
// constructive/progressive/destructive color on hover and active.
-   color: @textColor;
+   color: @colorButtonText;
 
&:hover {
background-color: transparent;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8c3020591c82f7b2c1f7043892e73019886478af
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Jack Phoenix 
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...Popups[master]: Improve documentation for render methods

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

Change subject: Improve documentation for render methods
..


Improve documentation for render methods

The parameter types are incorrect and this leads to confusion
Use $ prefix for $link parameter to make clear it is a jQuery.Object

Change-Id: I3f98f3729cd06aedd791e7503233082c1402dc95
---
M resources/ext.popups.renderer/desktopRenderer.js
M resources/ext.popups.renderer/mobileRenderer.js
2 files changed, 18 insertions(+), 18 deletions(-)

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



diff --git a/resources/ext.popups.renderer/desktopRenderer.js 
b/resources/ext.popups.renderer/desktopRenderer.js
index 0cb737e..45ab725 100644
--- a/resources/ext.popups.renderer/desktopRenderer.js
+++ b/resources/ext.popups.renderer/desktopRenderer.js
@@ -81,19 +81,19 @@
 * or by finding and calling the correct renderer
 *
 * @method render
-* @param {Object} link
-* @param {Object} event
+* @param {jQuery.Object} $link that a hovercard should be shown for
+* @param {jQuery.Event} event that triggered the render
 * @param {number} dwellStartTime the instant when the link is dwelled 
on
 * @param {string} linkInteractionToken random token representing the 
current interaction with the link
 */
-   mw.popups.render.render = function ( link, event, dwellStartTime, 
linkInteractionToken ) {
-   var linkHref = link.attr( 'href' );
+   mw.popups.render.render = function ( $link, event, dwellStartTime, 
linkInteractionToken ) {
+   var linkHref = $link.attr( 'href' );
 
// This will happen when the mouse goes from the popup box back 
to the
// anchor tag. In such a case, the timer to close the box is 
cleared.
if (
mw.popups.render.currentLink &&
-   mw.popups.render.currentLink[ 0 ] === link[ 0 ]
+   mw.popups.render.currentLink[ 0 ] === $link[ 0 ]
) {
if ( closeTimer ) {
closeTimer.abort();
@@ -113,7 +113,7 @@
return;
}
 
-   mw.popups.render.currentLink = link;
+   mw.popups.render.currentLink = $link;
// Set the log data only after the current link is set, 
otherwise, functions like
// closePopup will use the new log data when closing an old 
popup.
logData = {
@@ -122,13 +122,13 @@
linkInteractionToken: linkInteractionToken
};
 
-   link.on( 'mouseleave blur', mw.popups.render.leaveInactive );
-   link.off( 'click', logClickAction ).on( 'click', logClickAction 
);
+   $link.on( 'mouseleave blur', mw.popups.render.leaveInactive )
+   .off( 'click', logClickAction ).on( 'click', 
logClickAction );
 
-   if ( mw.popups.render.cache[ link.attr( 'href' ) ] ) {
+   if ( mw.popups.render.cache[ $link.attr( 'href' ) ] ) {
openTimer = mw.popups.render.wait( 
mw.popups.render.POPUP_DELAY )
.done( function () {
-   mw.popups.render.openPopup( link, event 
);
+   mw.popups.render.openPopup( $link, 
event );
} );
} else {
// Wait for timer before making API queries and showing 
hovercard
@@ -140,21 +140,21 @@
// Check run the matcher method of all 
renderers to find the right one
for ( key in renderers ) {
if ( renderers.hasOwnProperty( 
key ) && key !== 'article' ) {
-   if ( !!renderers[ key 
].matcher( link.attr( 'href' ) ) ) {
-   cachePopup = 
renderers[ key ].init( link, $.extend( {}, logData ) );
+   if ( !!renderers[ key 
].matcher( $link.attr( 'href' ) ) ) {
+   cachePopup = 
renderers[ key ].init( $link, $.extend( {}, logData ) );
}
}
}
 
// Use the article renderer if nothing 
else matches
if ( cachePopup === undefined ) {
-   cachePopup = 
mw.popups.render.renderers.article.init( link, $.extend( {}, logData ) );
+   

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Beta: Allow displaying Related Articles in the footer

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

Change subject: Beta: Allow displaying Related Articles in the footer
..


Beta: Allow displaying Related Articles in the footer

Even if 'minerva' is blacklisted, show Related Articles in the footer.

See I1663ab25083d9d907f288e60d506831bebb67945.

Bug: T144047
Change-Id: I366c8656a0f14a7069053b2e6199caac20471ea4
---
M includes/MobileFrontend.hooks.php
1 file changed, 19 insertions(+), 0 deletions(-)

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



diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 56700d0..dd7a7ea 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -176,17 +176,36 @@
 * @see https://www.mediawiki.org/wiki/Manual:Hooks/OutputPageBeforeHTML
 *
 * Applies MobileFormatter to mobile viewed content
+* Also enables Related Articles in the footer in the beta mode.
 *
 * @param OutputPage $out
 * @param string $text the HTML to be wrapped inside the 
#mw-content-text element
 * @return bool
 */
public static function onOutputPageBeforeHTML( &$out, &$text ) {
+   global $wgRelatedArticlesFooterBlacklistedSkins;
+
$context = MobileContext::singleton();
// Perform a few extra changes if we are in mobile mode
if ( $context->shouldDisplayMobileView() ) {
$text = ExtMobileFrontend::DOMParse( $out, $text, 
$context->isBetaGroupMember() );
}
+
+   // FIXME: remove the following when RelatedArticles are 
promoted from beta to stable
+   // Configure related articles to be shown in the footer for the 
beta mode
+   // The reason this code is here rather than inside the 
'BeforePageDisplay' hook is
+   // that we want to execute this code before RelatedArticles 
decides not to show
+   // related articles if the skin is blacklisted.
+   if (
+   ExtensionRegistry::getInstance()->isLoaded( 
'RelatedArticles' ) &&
+   MobileContext::singleton()->isBetaGroupMember()
+   ) {
+   $needle = array_search( 'minerva', 
$wgRelatedArticlesFooterBlacklistedSkins ?: [] );
+   if ( $needle !== false ) {
+   array_splice( 
$wgRelatedArticlesFooterBlacklistedSkins, $needle, 1 );
+   }
+   }
+
return true;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I366c8656a0f14a7069053b2e6199caac20471ea4
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bmansurov 
Gerrit-Reviewer: Bmansurov 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Phuedx 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix doc typo for wasConnectionError()

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

Change subject: Fix doc typo for wasConnectionError()
..


Fix doc typo for wasConnectionError()

Change-Id: I70eaeb630e2a4bb8f2940c2dcc938f7305014d48
---
M includes/libs/rdbms/database/Database.php
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index d58ffdf..66f7046 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -2435,7 +2435,7 @@
}
 
/**
-* Do no use the class outside of Database/DBError classes
+* Do not use this method outside of Database/DBError classes
 *
 * @param integer|string $errno
 * @return bool Whether the given query error was a connection drop
@@ -3263,8 +3263,8 @@
/**
 * Called by sourceStream() to check if we've reached a statement end
 *
-* @param string $sql SQL assembled so far
-* @param string $newLine New line about to be added to $sql
+* @param string &$sql SQL assembled so far
+* @param string &$newLine New line about to be added to $sql
 * @return bool Whether $newLine contains end of the statement
 */
public function streamStatementEnd( &$sql, &$newLine ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I70eaeb630e2a4bb8f2940c2dcc938f7305014d48
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: MaxSem 
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]: upload storage: transition cp3044+cp3045

2016-09-22 Thread BBlack (Code Review)
BBlack has submitted this change and it was merged.

Change subject: upload storage: transition cp3044+cp3045
..


upload storage: transition cp3044+cp3045

Bug: T145661
Change-Id: Idd813ab0ccb46957328513cfac316c39834db66a
---
A hieradata/hosts/cp3044.yaml
A hieradata/hosts/cp3045.yaml
2 files changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/hieradata/hosts/cp3044.yaml b/hieradata/hosts/cp3044.yaml
new file mode 100644
index 000..c02abf9
--- /dev/null
+++ b/hieradata/hosts/cp3044.yaml
@@ -0,0 +1 @@
+upload_storage_experiment: true
diff --git a/hieradata/hosts/cp3045.yaml b/hieradata/hosts/cp3045.yaml
new file mode 100644
index 000..c02abf9
--- /dev/null
+++ b/hieradata/hosts/cp3045.yaml
@@ -0,0 +1 @@
+upload_storage_experiment: true

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idd813ab0ccb46957328513cfac316c39834db66a
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack 
Gerrit-Reviewer: BBlack 
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]: Split out new ObjectCache::newWANCacheFromParams() method

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

Change subject: Split out new ObjectCache::newWANCacheFromParams() method
..


Split out new ObjectCache::newWANCacheFromParams() method

Change-Id: Ib2e409dd129bd1e2871fe239e71a4eb8fb42944c
---
M includes/objectcache/ObjectCache.php
1 file changed, 23 insertions(+), 5 deletions(-)

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



diff --git a/includes/objectcache/ObjectCache.php 
b/includes/objectcache/ObjectCache.php
index 14809a8..d81f9e1 100644
--- a/includes/objectcache/ObjectCache.php
+++ b/includes/objectcache/ObjectCache.php
@@ -321,23 +321,41 @@
 * @since 1.26
 * @param string $id A key in $wgWANObjectCaches.
 * @return WANObjectCache
-* @throws InvalidArgumentException
+* @throws UnexpectedValueException
 */
public static function newWANCacheFromId( $id ) {
-   global $wgWANObjectCaches;
+   global $wgWANObjectCaches, $wgObjectCaches;
 
if ( !isset( $wgWANObjectCaches[$id] ) ) {
-   throw new InvalidArgumentException( "Invalid object 
cache type \"$id\" requested. " .
-   "It is not present in \$wgWANObjectCaches." );
+   throw new UnexpectedValueException(
+   "Cache type \"$id\" requested is not present in 
\$wgWANObjectCaches." );
}
 
$params = $wgWANObjectCaches[$id];
+   if ( !isset( $wgObjectCaches[$params['cacheId']] ) ) {
+   throw new UnexpectedValueException(
+   "Cache type \"{$params['cacheId']}\" is not 
present in \$wgObjectCaches." );
+   }
+   $params['store'] = $wgObjectCaches[$params['cacheId']];
+
+   return self::newWANCacheFromParams( $params );
+   }
+
+   /**
+* Create a new cache object of the specified type.
+*
+* @since 1.28
+* @param array $params
+* @return WANObjectCache
+* @throws UnexpectedValueException
+*/
+   public static function newWANCacheFromParams( array $params ) {
foreach ( $params['channels'] as $action => $channel ) {
$params['relayers'][$action] = 
MediaWikiServices::getInstance()->getEventRelayerGroup()
->getRelayer( $channel );
$params['channels'][$action] = $channel;
}
-   $params['cache'] = self::newFromId( $params['cacheId'] );
+   $params['cache'] = self::newFromParams( $params['store'] );
if ( isset( $params['loggroup'] ) ) {
$params['logger'] = LoggerFactory::getInstance( 
$params['loggroup'] );
} else {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib2e409dd129bd1e2871fe239e71a4eb8fb42944c
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
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/core[wmf/1.28.0-wmf.20]: Add DBConnRef sanity check to LoadBalancer::reuseConnection()

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

Change subject: Add DBConnRef sanity check to LoadBalancer::reuseConnection()
..


Add DBConnRef sanity check to LoadBalancer::reuseConnection()

Change-Id: I6b079b994f29c5f7953efe73982ef9e6946a21f8
(cherry picked from commit c607b2e60fce8783655963b502bf03d098857165)
---
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
1 file changed, 7 insertions(+), 0 deletions(-)

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



diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php 
b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
index 791e5ad..eb72c29 100644
--- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php
+++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
@@ -596,6 +596,13 @@
 * should be ignored
 */
return;
+   } elseif ( $conn instanceof DBConnRef ) {
+   // DBConnRef already handles calling reuseConnection() 
and only passes the live
+   // Database instance to this method. Any caller passing 
in a DBConnRef is broken.
+   $this->connLogger->error( __METHOD__ . ": got DBConnRef 
instance.\n" .
+   ( new RuntimeException() )->getTraceAsString() 
);
+
+   return;
}
 
$dbName = $conn->getDBname();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6b079b994f29c5f7953efe73982ef9e6946a21f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Aaron Schulz 
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...Popups[master]: Improve documentation/parameter names of openPopup method

2016-09-22 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: Improve documentation/parameter names of openPopup method
..

Improve documentation/parameter names of openPopup method

Change-Id: Ia2db8a0de3466556c08e64ae01829d6d9d426e72
---
M resources/ext.popups.renderer/desktopRenderer.js
1 file changed, 8 insertions(+), 8 deletions(-)


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

diff --git a/resources/ext.popups.renderer/desktopRenderer.js 
b/resources/ext.popups.renderer/desktopRenderer.js
index 7e24c13..169de9c 100644
--- a/resources/ext.popups.renderer/desktopRenderer.js
+++ b/resources/ext.popups.renderer/desktopRenderer.js
@@ -191,15 +191,15 @@
 * Takes care of event logging and attaching other events.
 *
 * @method openPopup
-* @param {Object} link
-* @param {Object} event
+* @param {jQuery.Object} $link
+* @param {jQuery.Event} event
 */
-   mw.popups.render.openPopup = function ( link, event ) {
+   mw.popups.render.openPopup = function ( $link, event ) {
var
-   cache = mw.popups.render.cache [ link.attr( 'href' ) ],
+   cache = mw.popups.render.cache [ $link.attr( 'href' ) ],
popup = cache.popup,
-   offset = cache.getOffset( link, event ),
-   classes = cache.getClasses( link );
+   offset = cache.getOffset( $link, event ),
+   classes = cache.getClasses( $link );
 
mw.popups.$popup
.html( '' )
@@ -229,11 +229,11 @@
perceivedWait: Math.round( mw.now() - 
logData.dwellStartTime )
} );
 
-   cache.process( link, $.extend( {}, logData ) );
+   cache.process( $link, $.extend( {}, logData ) );
 
mw.popups.$popup.find( 'a.mwe-popups-extract, 
a.mwe-popups-discreet' ).click( mw.popups.render.clickHandler );
 
-   link
+   $link
.off( 'mouseleave blur', mw.popups.render.leaveInactive 
)
.on( 'mouseleave blur', mw.popups.render.leaveActive );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2db8a0de3466556c08e64ae01829d6d9d426e72
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 

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


[MediaWiki-commits] [Gerrit] analytics/dashiki[master]: Upgrade to semantic 2 everywhere

2016-09-22 Thread Milimetric (Code Review)
Milimetric has uploaded a new change for review.

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

Change subject: Upgrade to semantic 2 everywhere
..

Upgrade to semantic 2 everywhere

* upgrades all metrics-by-project to use semantic 2.0
* fixes the layout by using flexbox

TODO:
- test gulp build
- upgrade compare layout
- run karma tests

Bug: T118846
Change-Id: I3957afc043ab1e6ee5e5da7ffda6ecf72359278b
---
M src/components/annotation-list/annotation-list.html
M src/components/breakdown-toggle/breakdown-toggle.html
M src/components/metric-selector/metric-selector.html
M src/components/metric-selector/metric-selector.js
M src/components/metrics-by-project-layout/metrics-by-project-layout.html
M src/components/project-selector/project-selector.html
M src/components/visualizers/dygraphs-timeseries/bindings.js
M src/components/visualizers/dygraphs-timeseries/dygraphs-timeseries.html
M src/components/visualizers/wikimetrics/wikimetrics.html
A src/css/semantic2.popup.css
D src/layouts/metrics-by-project/01_styles.css
M src/layouts/metrics-by-project/index.html
A src/layouts/metrics-by-project/styles.css
13 files changed, 367 insertions(+), 399 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/dashiki 
refs/changes/30/312430/1

diff --git a/src/components/annotation-list/annotation-list.html 
b/src/components/annotation-list/annotation-list.html
index 3962c30..f430471 100644
--- a/src/components/annotation-list/annotation-list.html
+++ b/src/components/annotation-list/annotation-list.html
@@ -1,6 +1,18 @@
+
+.annotation.label {
+cursor: pointer;
+margin: 5px 3px 3px 3px;
+}
+.annotation-list-title {
+margin-left: 10px;
+vertical-align: -2px;
+font-size: 14px;
+}
+
+
 
-   Notes
-   
-   
-   
+Notes
+
+
+
 
diff --git a/src/components/breakdown-toggle/breakdown-toggle.html 
b/src/components/breakdown-toggle/breakdown-toggle.html
index e0de3f8..d71f36e 100644
--- a/src/components/breakdown-toggle/breakdown-toggle.html
+++ b/src/components/breakdown-toggle/breakdown-toggle.html
@@ -1,7 +1,7 @@
-
-
-
-
+
+
+
+
 Data Breakdowns
 
 
@@ -13,7 +13,7 @@
 
 
 
-
+
 
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
 
 
 
@@ -38,7 +16,7 @@
 
 
 
-|
+|
 
 
 
diff --git a/src/components/metric-selector/metric-selector.js 
b/src/components/metric-selector/metric-selector.js
index afe6e7e..84cf70d 100644
--- a/src/components/metric-selector/metric-selector.js
+++ b/src/components/metric-selector/metric-selector.js
@@ -32,7 +32,6 @@
 
 this.metricsByCategory = params.metrics;
 this.selectedMetric = params.selectedMetric;
-this.selectedCategory = ko.observable();
 this.addedMetrics = ko.observableArray([]);
 
 this.defaultSelection = ko.computed(function () {
@@ -73,9 +72,6 @@
 return c.metrics.length;
 });
 
-if (categories.length) {
-this.selectedCategory(categories[0]);
-}
 return categories;
 }, this);
 
@@ -83,10 +79,6 @@
 this.setDefault = function () {
 self.addedMetrics(self.defaultSelection() || []);
 self.reassignSelected();
-};
-
-this.selectCategory = function (category) {
-self.selectedCategory(category);
 };
 
 this.addMetric = function (metric) {
diff --git 
a/src/components/metrics-by-project-layout/metrics-by-project-layout.html 
b/src/components/metrics-by-project-layout/metrics-by-project-layout.html
index 64c9dbb..6a86f1b 100644
--- a/src/components/metrics-by-project-layout/metrics-by-project-layout.html
+++ b/src/components/metrics-by-project-layout/metrics-by-project-layout.html
@@ -1,40 +1,33 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/components/project-selector/project-selector.html 
b/src/components/project-selector/project-selector.html
index a838755..3b9bc8e 100644
--- a/src/components/project-selector/project-selector.html
+++ 

[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.20]: Add DBConnRef sanity check to LoadBalancer::reuseConnection()

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Add DBConnRef sanity check to LoadBalancer::reuseConnection()
..

Add DBConnRef sanity check to LoadBalancer::reuseConnection()

Change-Id: I6b079b994f29c5f7953efe73982ef9e6946a21f8
(cherry picked from commit c607b2e60fce8783655963b502bf03d098857165)
---
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/29/312429/1

diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php 
b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
index 791e5ad..eb72c29 100644
--- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php
+++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
@@ -596,6 +596,13 @@
 * should be ignored
 */
return;
+   } elseif ( $conn instanceof DBConnRef ) {
+   // DBConnRef already handles calling reuseConnection() 
and only passes the live
+   // Database instance to this method. Any caller passing 
in a DBConnRef is broken.
+   $this->connLogger->error( __METHOD__ . ": got DBConnRef 
instance.\n" .
+   ( new RuntimeException() )->getTraceAsString() 
);
+
+   return;
}
 
$dbName = $conn->getDBname();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6b079b994f29c5f7953efe73982ef9e6946a21f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Remove pre-1.25 API compatibility code

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

Change subject: Remove pre-1.25 API compatibility code
..


Remove pre-1.25 API compatibility code

Since this extension uses extension.json, it already requires 1.25+ so
no need to keep the old code around.

Change-Id: I3a81c6ca3501b8d3301f38383da0a9ab719b76df
---
M gateway_common/donation.api.php
1 file changed, 0 insertions(+), 53 deletions(-)

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



diff --git a/gateway_common/donation.api.php b/gateway_common/donation.api.php
index 216ce3f..4a77272 100644
--- a/gateway_common/donation.api.php
+++ b/gateway_common/donation.api.php
@@ -132,59 +132,6 @@
}
 
/**
-* @deprecated since MediaWiki core 1.25
-*/
-   public function getParamDescription() {
-   return array(
-   'gateway' => 'Which payment gateway to use - adyen, 
globalcollect, etc.',
-   'amount' => 'The amount donated',
-   'currency_code' => 'Currency code',
-   'fname' => 'First name',
-   'lname' => 'Last name',
-   'street' => 'First line of street address',
-   'street_supplemental' => 'Second line of street 
address',
-   'city' => 'City',
-   'state' => 'State abbreviation',
-   'zip' => 'Postal code',
-   'email' => 'Email address',
-   'country' => 'Country code',
-   'card_num' => 'Credit card number',
-   'card_type' => 'Credit card type',
-   'expiration' => 'Expiration date',
-   'cvv' => 'CVV security code',
-   'payment_method' => 'Payment method to use',
-   'payment_submethod' => 'Payment submethod to use',
-   'language' => 'Language code',
-   'order_id' => 'Order ID (if a donation has already been 
started)',
-   'wmf_token' => 'Mediawiki edit token',
-   'utm_source' => 'Tracking variable',
-   'utm_campaign' => 'Tracking variable',
-   'utm_medium' => 'Tracking variable',
-   'referrer' => 'Original referrer',
-   'recurring' => 'Optional - indicates that the 
transaction is meant to be recurring.',
-   );
-   }
-
-   /**
-* @deprecated since MediaWiki core 1.25
-*/
-   public function getDescription() {
-   return array(
-   'This API allow you to submit a donation to the 
Wikimedia Foundation using a',
-   'variety of payment processors.',
-   );
-   }
-
-   /**
-* @deprecated since MediaWiki core 1.25
-*/
-   public function getExamples() {
-   return array(
-   
'api.php?action=donate=globalcollect=2.00_code=USD',
-   );
-   }
-
-   /**
 * @see ApiBase::getExamplesMessages()
 */
protected function getExamplesMessages() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3a81c6ca3501b8d3301f38383da0a9ab719b76df
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Anomie 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Ssmith 
Gerrit-Reviewer: XenoRyet 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: remove redundant code from FeedView

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

Change subject: Hygiene: remove redundant code from FeedView
..


Hygiene: remove redundant code from FeedView

Remove programmatic configuration of minColumnWidth. This attribute is
set in XML.

Change-Id: I8d13a7cc27a4b1a103e5eff1796a357e13a7d900
---
M app/src/main/java/org/wikipedia/feed/view/FeedView.java
1 file changed, 1 insertion(+), 2 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedView.java 
b/app/src/main/java/org/wikipedia/feed/view/FeedView.java
index 50d20d2..69336d6 100644
--- a/app/src/main/java/org/wikipedia/feed/view/FeedView.java
+++ b/app/src/main/java/org/wikipedia/feed/view/FeedView.java
@@ -56,7 +56,6 @@
 
 private void init() {
 setVerticalScrollBarEnabled(true);
-minColumnWidth((int) 
getResources().getDimension(R.dimen.view_feed_min_column_width));
 recyclerLayoutManager = new StaggeredGridLayoutManager(getColumns(),
 StaggeredGridLayoutManager.VERTICAL);
 setLayoutManager(recyclerLayoutManager);
@@ -105,4 +104,4 @@
 recyclerLayoutManager.setSpanCount(columns);
 }
 }
-}
+}
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8d13a7cc27a4b1a103e5eff1796a357e13a7d900
Gerrit-PatchSet: 2
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Mholloway 
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]: Simplify and clean up FileBackend exceptions

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

Change subject: Simplify and clean up FileBackend exceptions
..


Simplify and clean up FileBackend exceptions

Use standard exceptions for unexpected errors and remove
FileBackendException class, leaving FileBackendError. The
later is actually intended to be caught in some cases.

Change-Id: I735a525e0b14e518b2da5f18762e0f293064dfc2
---
M autoload.php
M includes/filebackend/FileBackendGroup.php
M includes/filebackend/FileBackendMultiWrite.php
M includes/filebackend/FileBackendStore.php
M includes/filebackend/FileOp.php
M includes/libs/filebackend/FileBackend.php
A includes/libs/filebackend/FileBackendError.php
D includes/libs/filebackend/FileBackendException.php
8 files changed, 31 insertions(+), 40 deletions(-)

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



diff --git a/autoload.php b/autoload.php
index 018e85e..d985ee0 100644
--- a/autoload.php
+++ b/autoload.php
@@ -456,8 +456,7 @@
'FileAwareNodeVisitor' => __DIR__ . '/maintenance/findDeprecated.php',
'FileBackend' => __DIR__ . '/includes/libs/filebackend/FileBackend.php',
'FileBackendDBRepoWrapper' => __DIR__ . 
'/includes/filerepo/FileBackendDBRepoWrapper.php',
-   'FileBackendError' => __DIR__ . 
'/includes/libs/filebackend/FileBackendException.php',
-   'FileBackendException' => __DIR__ . 
'/includes/libs/filebackend/FileBackendException.php',
+   'FileBackendError' => __DIR__ . 
'/includes/libs/filebackend/FileBackendError.php',
'FileBackendGroup' => __DIR__ . 
'/includes/filebackend/FileBackendGroup.php',
'FileBackendMultiWrite' => __DIR__ . 
'/includes/filebackend/FileBackendMultiWrite.php',
'FileBackendStore' => __DIR__ . 
'/includes/filebackend/FileBackendStore.php',
diff --git a/includes/filebackend/FileBackendGroup.php 
b/includes/filebackend/FileBackendGroup.php
index b560e94..d0a99d4 100644
--- a/includes/filebackend/FileBackendGroup.php
+++ b/includes/filebackend/FileBackendGroup.php
@@ -114,18 +114,18 @@
 *
 * @param array $configs
 * @param string|null $readOnlyReason
-* @throws FileBackendException
+* @throws InvalidArgumentException
 */
protected function register( array $configs, $readOnlyReason = null ) {
foreach ( $configs as $config ) {
if ( !isset( $config['name'] ) ) {
-   throw new FileBackendException( "Cannot 
register a backend with no name." );
+   throw new InvalidArgumentException( "Cannot 
register a backend with no name." );
}
$name = $config['name'];
if ( isset( $this->backends[$name] ) ) {
-   throw new FileBackendException( "Backend with 
name `{$name}` already registered." );
+   throw new LogicException( "Backend with name 
`{$name}` already registered." );
} elseif ( !isset( $config['class'] ) ) {
-   throw new FileBackendException( "Backend with 
name `{$name}` has no class." );
+   throw new InvalidArgumentException( "Backend 
with name `{$name}` has no class." );
}
$class = $config['class'];
 
@@ -147,11 +147,11 @@
 *
 * @param string $name
 * @return FileBackend
-* @throws FileBackendException
+* @throws InvalidArgumentException
 */
public function get( $name ) {
if ( !isset( $this->backends[$name] ) ) {
-   throw new FileBackendException( "No backend defined 
with the name `$name`." );
+   throw new InvalidArgumentException( "No backend defined 
with the name `$name`." );
}
// Lazy-load the actual backend instance
if ( !isset( $this->backends[$name]['instance'] ) ) {
@@ -181,11 +181,11 @@
 *
 * @param string $name
 * @return array
-* @throws FileBackendException
+* @throws InvalidArgumentException
 */
public function config( $name ) {
if ( !isset( $this->backends[$name] ) ) {
-   throw new FileBackendException( "No backend defined 
with the name `$name`." );
+   throw new InvalidArgumentException( "No backend defined 
with the name `$name`." );
}
$class = $this->backends[$name]['class'];
 
diff --git a/includes/filebackend/FileBackendMultiWrite.php 
b/includes/filebackend/FileBackendMultiWrite.php
index c1cc7bb..52b84d4 100644
--- a/includes/filebackend/FileBackendMultiWrite.php
+++ b/includes/filebackend/FileBackendMultiWrite.php
@@ -114,7 +114,7 @@
}
  

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add DBConnRef sanity check to LoadBalancer::reuseConnection()

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

Change subject: Add DBConnRef sanity check to LoadBalancer::reuseConnection()
..


Add DBConnRef sanity check to LoadBalancer::reuseConnection()

Change-Id: I6b079b994f29c5f7953efe73982ef9e6946a21f8
---
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
1 file changed, 7 insertions(+), 0 deletions(-)

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



diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php 
b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
index c030cb2..bda185a 100644
--- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php
+++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
@@ -597,6 +597,13 @@
 * should be ignored
 */
return;
+   } elseif ( $conn instanceof DBConnRef ) {
+   // DBConnRef already handles calling reuseConnection() 
and only passes the live
+   // Database instance to this method. Any caller passing 
in a DBConnRef is broken.
+   $this->connLogger->error( __METHOD__ . ": got DBConnRef 
instance.\n" .
+   ( new RuntimeException() )->getTraceAsString() 
);
+
+   return;
}
 
$domain = $conn->getDomainID();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6b079b994f29c5f7953efe73982ef9e6946a21f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: MaxSem 
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]: icinga: add legal contactgroup to legal footer checks

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

Change subject: icinga: add legal contactgroup to legal footer checks
..


icinga: add legal contactgroup to legal footer checks

Let the new legal contact group get email notifications
when the special checks for legal text in the footer turn
critical or recover.

Bug:T146227
Change-Id: I325b1daa8d52a79f7ce1acec3b546ff21aef2455
---
M modules/icinga/manifests/monitor/legal.pp
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/modules/icinga/manifests/monitor/legal.pp 
b/modules/icinga/manifests/monitor/legal.pp
index 999fee3..fbf363e 100644
--- a/modules/icinga/manifests/monitor/legal.pp
+++ b/modules/icinga/manifests/monitor/legal.pp
@@ -20,7 +20,7 @@
 host  => 'en.wikipedia.org',
 normal_check_interval => 1440,
 retry_check_interval  => 30,
-contact_group => 'admins',
+contact_group => 'admins,legal',
 }
 
 monitoring::service { 'en.m.wp.o-legal-html':
@@ -29,7 +29,7 @@
 host  => 'en.m.wikipedia.org',
 normal_check_interval => 1440,
 retry_check_interval  => 30,
-contact_group => 'admins',
+contact_group => 'admins,legal',
 }
 
 monitoring::service { 'en.wb.o-legal-html':
@@ -38,6 +38,6 @@
 host  => 'en.wikibooks.org',
 normal_check_interval => 1440,
 retry_check_interval  => 30,
-contact_group => 'admins',
+contact_group => 'admins,legal',
 }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I325b1daa8d52a79f7ce1acec3b546ff21aef2455
Gerrit-PatchSet: 2
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] mediawiki...Popups[master]: Improve documentation for render methods

2016-09-22 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: Improve documentation for render methods
..

Improve documentation for render methods

The parameter types are incorrect and this leads to confusion
Use $ prefix for $link parameter to make clear it is a jQuery.Object

Change-Id: I3f98f3729cd06aedd791e7503233082c1402dc95
---
M resources/ext.popups.renderer/desktopRenderer.js
M resources/ext.popups.renderer/mobileRenderer.js
2 files changed, 18 insertions(+), 18 deletions(-)


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

diff --git a/resources/ext.popups.renderer/desktopRenderer.js 
b/resources/ext.popups.renderer/desktopRenderer.js
index 0cb737e..45ab725 100644
--- a/resources/ext.popups.renderer/desktopRenderer.js
+++ b/resources/ext.popups.renderer/desktopRenderer.js
@@ -81,19 +81,19 @@
 * or by finding and calling the correct renderer
 *
 * @method render
-* @param {Object} link
-* @param {Object} event
+* @param {jQuery.Object} $link that a hovercard should be shown for
+* @param {jQuery.Event} event that triggered the render
 * @param {number} dwellStartTime the instant when the link is dwelled 
on
 * @param {string} linkInteractionToken random token representing the 
current interaction with the link
 */
-   mw.popups.render.render = function ( link, event, dwellStartTime, 
linkInteractionToken ) {
-   var linkHref = link.attr( 'href' );
+   mw.popups.render.render = function ( $link, event, dwellStartTime, 
linkInteractionToken ) {
+   var linkHref = $link.attr( 'href' );
 
// This will happen when the mouse goes from the popup box back 
to the
// anchor tag. In such a case, the timer to close the box is 
cleared.
if (
mw.popups.render.currentLink &&
-   mw.popups.render.currentLink[ 0 ] === link[ 0 ]
+   mw.popups.render.currentLink[ 0 ] === $link[ 0 ]
) {
if ( closeTimer ) {
closeTimer.abort();
@@ -113,7 +113,7 @@
return;
}
 
-   mw.popups.render.currentLink = link;
+   mw.popups.render.currentLink = $link;
// Set the log data only after the current link is set, 
otherwise, functions like
// closePopup will use the new log data when closing an old 
popup.
logData = {
@@ -122,13 +122,13 @@
linkInteractionToken: linkInteractionToken
};
 
-   link.on( 'mouseleave blur', mw.popups.render.leaveInactive );
-   link.off( 'click', logClickAction ).on( 'click', logClickAction 
);
+   $link.on( 'mouseleave blur', mw.popups.render.leaveInactive )
+   .off( 'click', logClickAction ).on( 'click', 
logClickAction );
 
-   if ( mw.popups.render.cache[ link.attr( 'href' ) ] ) {
+   if ( mw.popups.render.cache[ $link.attr( 'href' ) ] ) {
openTimer = mw.popups.render.wait( 
mw.popups.render.POPUP_DELAY )
.done( function () {
-   mw.popups.render.openPopup( link, event 
);
+   mw.popups.render.openPopup( $link, 
event );
} );
} else {
// Wait for timer before making API queries and showing 
hovercard
@@ -140,21 +140,21 @@
// Check run the matcher method of all 
renderers to find the right one
for ( key in renderers ) {
if ( renderers.hasOwnProperty( 
key ) && key !== 'article' ) {
-   if ( !!renderers[ key 
].matcher( link.attr( 'href' ) ) ) {
-   cachePopup = 
renderers[ key ].init( link, $.extend( {}, logData ) );
+   if ( !!renderers[ key 
].matcher( $link.attr( 'href' ) ) ) {
+   cachePopup = 
renderers[ key ].init( $link, $.extend( {}, logData ) );
}
}
}
 
// Use the article renderer if nothing 
else matches
if ( cachePopup === undefined ) {
-   cachePopup = 
mw.popups.render.renderers.article.init( link, $.extend( 

[MediaWiki-commits] [Gerrit] mediawiki...Popups[master]: Hygiene: Not necessary for private methods to be globally av...

2016-09-22 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: Hygiene: Not necessary for private methods to be globally 
available
..

Hygiene: Not necessary for private methods to be globally available

These can be private methods.
They are not used by anything outside this method and should never be
allowed to.

Change-Id: I347d2ef4fd42c3bb139d5f1d30f64c9d1c45a47b
---
M resources/ext.popups.renderer/desktopRenderer.js
1 file changed, 32 insertions(+), 23 deletions(-)


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

diff --git a/resources/ext.popups.renderer/desktopRenderer.js 
b/resources/ext.popups.renderer/desktopRenderer.js
index 6def177..16a8ae1 100644
--- a/resources/ext.popups.renderer/desktopRenderer.js
+++ b/resources/ext.popups.renderer/desktopRenderer.js
@@ -141,13 +141,13 @@
.off( 'click', logClickAction ).on( 'click', 
logClickAction );
 
if ( mw.popups.render.cache[ $link.attr( 'href' ) ] ) {
-   openTimer = mw.popups.render.wait( 
mw.popups.render.POPUP_DELAY )
+   openTimer = wait( mw.popups.render.POPUP_DELAY )
.done( function () {
mw.popups.render.openPopup( $link, 
event );
} );
} else {
// Wait for timer before making API queries and showing 
hovercard
-   openTimer = mw.popups.render.wait( 
mw.popups.render.API_DELAY )
+   openTimer = wait( mw.popups.render.API_DELAY )
.done( function () {
var cachePopup, key,
renderers = 
mw.popups.render.renderers;
@@ -166,7 +166,7 @@
cachePopup = 
mw.popups.render.renderers.article.init( $link, $.extend( {}, logData ) );
}
 
-   openTimer = mw.popups.render.wait( 
mw.popups.render.POPUP_DELAY - mw.popups.render.API_DELAY );
+   openTimer = wait( 
mw.popups.render.POPUP_DELAY - mw.popups.render.API_DELAY );
 
$.when( openTimer, cachePopup ).done( 
function () {
mw.popups.render.openPopup( 
$link, event );
@@ -200,7 +200,7 @@
.append( popup.clone() )
.show()
.attr( 'aria-hidden', 'false' )
-   .on( 'mouseleave', mw.popups.render.leaveActive )
+   .on( 'mouseleave', leaveActive )
.on( 'mouseenter', function () {
if ( closeTimer ) {
closeTimer.abort();
@@ -221,24 +221,26 @@
 
cache.process( link, $.extend( {}, logData ) );
 
-   mw.popups.$popup.find( 'a.mwe-popups-extract, 
a.mwe-popups-discreet' ).click( mw.popups.render.clickHandler );
+   mw.popups.$popup.find( 'a.mwe-popups-extract, 
a.mwe-popups-discreet' ).click( clickHandler );
 
link
-   .off( 'mouseleave blur', mw.popups.render.leaveInactive 
)
-   .on( 'mouseleave blur', mw.popups.render.leaveActive );
+   .off( 'mouseleave blur', leaveInactive )
+   .on( 'mouseleave blur', leaveActive );
 
-   $( document ).on( 'keydown', mw.popups.render.closeOnEsc );
+   $( document ).on( 'keydown', closeOnEsc );
 
mw.popups.incrementPreviewCount();
};
 
/**
+* Event handler.
 * Click handler for the hovercard
 *
 * @method clickHandler
+* @ignore
 * @param {Object} event
 */
-   mw.popups.render.clickHandler = function ( event ) {
+   function clickHandler( event ) {
var action = mw.popups.getAction( event ),
$activeLink = getActiveLink();
 
@@ -247,7 +249,7 @@
if ( action === 'opened in same tab' ) {
window.location.href = $activeLink.attr( 'href' );
}
-   };
+   }
 
/**
 * Removes the hover class from the link and unbinds events
@@ -259,7 +261,7 @@
var fadeInClass, fadeOutClass,
$activeLink = getActiveLink();
 
-   $activeLink.off( 'mouseleave blur', 
mw.popups.render.leaveActive );
+   $activeLink.off( 'mouseleave blur', leaveActive );
 
fadeInClass = ( mw.popups.$popup.hasClass( 
'mwe-popups-fade-in-up' ) ) ?
'mwe-popups-fade-in-up' :
@@ 

[MediaWiki-commits] [Gerrit] mediawiki...Popups[master]: Hygiene: Only allow calls to closePopup on an active link

2016-09-22 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: Hygiene: Only allow calls to closePopup on an active link
..

Hygiene: Only allow calls to closePopup on an active link

Change-Id: I7c15870e1586aa8629af723accad67dee5483369
---
M resources/ext.popups.renderer/desktopRenderer.js
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups 
refs/changes/27/312427/1

diff --git a/resources/ext.popups.renderer/desktopRenderer.js 
b/resources/ext.popups.renderer/desktopRenderer.js
index b5ae9f6..6def177 100644
--- a/resources/ext.popups.renderer/desktopRenderer.js
+++ b/resources/ext.popups.renderer/desktopRenderer.js
@@ -259,10 +259,6 @@
var fadeInClass, fadeOutClass,
$activeLink = getActiveLink();
 
-   if ( !$activeLink ) {
-   return false;
-   }
-
$activeLink.off( 'mouseleave blur', 
mw.popups.render.leaveActive );
 
fadeInClass = ( mw.popups.$popup.hasClass( 
'mwe-popups-fade-in-up' ) ) ?
@@ -331,7 +327,8 @@
 * @method closeOnEsc
 */
mw.popups.render.closeOnEsc = function ( event ) {
-   if ( event.keyCode === 27 ) {
+   var $activeLink = getActiveLink();
+   if ( event.keyCode === 27 && $activeLink ) {
mw.popups.render.closePopup();
}
};
@@ -345,7 +342,10 @@
 */
mw.popups.render.leaveActive = function () {
closeTimer = mw.popups.render.wait( 
mw.popups.render.POPUP_CLOSE_DELAY ).done( function () {
-   mw.popups.render.closePopup();
+   var $activeLink = getActiveLink();
+   if ( $activeLink ) {
+   mw.popups.render.closePopup();
+   }
} );
};
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c15870e1586aa8629af723accad67dee5483369
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 

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


[MediaWiki-commits] [Gerrit] mediawiki...Popups[master]: Hygiene: Add set and get methods for active link

2016-09-22 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: Hygiene: Add set and get methods for active link
..

Hygiene: Add set and get methods for active link

Named functions help explain to a reader and reviewer what the code
is actually doing.

Change-Id: I1d059c9270fd2298285fa5e4e52e403a06f35503
---
M resources/ext.popups.renderer/desktopRenderer.js
1 file changed, 38 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups 
refs/changes/26/312426/1

diff --git a/resources/ext.popups.renderer/desktopRenderer.js 
b/resources/ext.popups.renderer/desktopRenderer.js
index 45ab725..b5ae9f6 100644
--- a/resources/ext.popups.renderer/desktopRenderer.js
+++ b/resources/ext.popups.renderer/desktopRenderer.js
@@ -1,8 +1,28 @@
 /*global popupDelay: true, popupHideDelay: true*/
 
 ( function ( $, mw ) {
-   var closeTimer, openTimer,
+   var closeTimer, openTimer, $activeLink,
logData = {};
+
+   /**
+* Sets the link that the currently shown popup relates to
+*
+* @ignore
+* @param {jQuery} [$link] if undefined there is no active link
+*/
+   function setActiveLink( $link ) {
+   $activeLink = $link;
+   }
+
+   /**
+* Gets the link that the currently shown popup relates to
+*
+* @ignore
+* @return {jQuery|undefined} if undefined there is no active link
+*/
+   function getActiveLink( $link ) {
+   return $activeLink;
+   }
 
/**
 * Logs the click on link or popup
@@ -65,12 +85,6 @@
mw.popups.render.cache = {};
 
/**
-* The link the currently has a popup
-* @property {jQuery} currentLink
-*/
-   mw.popups.render.currentLink = undefined;
-
-   /**
 * Object to store all renderers
 * @property {Object} renderers
 */
@@ -87,13 +101,14 @@
 * @param {string} linkInteractionToken random token representing the 
current interaction with the link
 */
mw.popups.render.render = function ( $link, event, dwellStartTime, 
linkInteractionToken ) {
-   var linkHref = $link.attr( 'href' );
+   var linkHref = $link.attr( 'href' ),
+   $activeLink = getActiveLink();
 
// This will happen when the mouse goes from the popup box back 
to the
// anchor tag. In such a case, the timer to close the box is 
cleared.
if (
-   mw.popups.render.currentLink &&
-   mw.popups.render.currentLink[ 0 ] === $link[ 0 ]
+   $activeLink &&
+   $activeLink[ 0 ] === $link[ 0 ]
) {
if ( closeTimer ) {
closeTimer.abort();
@@ -103,7 +118,7 @@
 
// If the mouse moves to another link (we already check if its 
the same
// link in the previous condition), then close the popup.
-   if ( mw.popups.render.currentLink ) {
+   if ( $activeLink ) {
mw.popups.render.closePopup();
}
 
@@ -113,7 +128,7 @@
return;
}
 
-   mw.popups.render.currentLink = $link;
+   setActiveLink( $link );
// Set the log data only after the current link is set, 
otherwise, functions like
// closePopup will use the new log data when closing an old 
popup.
logData = {
@@ -224,12 +239,13 @@
 * @param {Object} event
 */
mw.popups.render.clickHandler = function ( event ) {
-   var action = mw.popups.getAction( event );
+   var action = mw.popups.getAction( event ),
+   $activeLink = getActiveLink();
 
logClickAction( event );
 
if ( action === 'opened in same tab' ) {
-   window.location.href = 
mw.popups.render.currentLink.attr( 'href' );
+   window.location.href = $activeLink.attr( 'href' );
}
};
 
@@ -240,13 +256,14 @@
 * @method closePopup
 */
mw.popups.render.closePopup = function () {
-   var fadeInClass, fadeOutClass;
+   var fadeInClass, fadeOutClass,
+   $activeLink = getActiveLink();
 
-   if ( mw.popups.render.currentLink === undefined ) {
+   if ( !$activeLink ) {
return false;
}
 
-   $( mw.popups.render.currentLink ).off( 'mouseleave blur', 
mw.popups.render.leaveActive );
+   $activeLink.off( 'mouseleave blur', 
mw.popups.render.leaveActive );
 
fadeInClass = ( mw.popups.$popup.hasClass( 

[MediaWiki-commits] [Gerrit] mediawiki...FlaggedRevs[master]: Fix I9839283c: new_text is actually a Content object

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

Change subject: Fix I9839283c: new_text is actually a Content object
..


Fix I9839283c: new_text is actually a Content object

Bug: T146423
Change-Id: I518eb5528d0354207deb418a4afaf49ce2607f32
---
M business/RevisionReviewForm.php
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/business/RevisionReviewForm.php b/business/RevisionReviewForm.php
index 69e7a49..55d01bf 100644
--- a/business/RevisionReviewForm.php
+++ b/business/RevisionReviewForm.php
@@ -324,15 +324,15 @@
}
$article = new WikiPage( $this->page );
# Get text with changes after $oldRev up to and 
including $newRev removed
-   $new_text = $article->getUndoContent( $newRev, $oldRev 
);
-   if ( $new_text === false ) {
+   $new_content = $article->getUndoContent( $newRev, 
$oldRev );
+   if ( $new_content === false ) {
return 'review_cannot_undo';
}
$baseRevId = $newRev->isCurrent() ? $oldRev->getId() : 
0;
 
# Actually make the edit...
$editStatus = $article->doEditContent(
-   ContentHandler::makeContent( $new_text, 
$article->getTitle() ),
+   $new_content,
$this->getComment(),
0,
$baseRevId,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I518eb5528d0354207deb418a4afaf49ce2607f32
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: Alex Monk 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Daniel Kinzler 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Reedy 
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] operations/puppet[production]: icinga: add legal contactgroup to legal footer checks

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

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

Change subject: icinga: add legal contactgroup to legal footer checks
..

icinga: add legal contactgroup to legal footer checks

Let the new legal contact group get email notifications
when the special checks for legal text in the footer turn
critical or recover.

Bug:T146227
Change-Id: I325b1daa8d52a79f7ce1acec3b546ff21aef2455
---
M modules/icinga/manifests/monitor/legal.pp
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/modules/icinga/manifests/monitor/legal.pp 
b/modules/icinga/manifests/monitor/legal.pp
index 999fee3..fbf363e 100644
--- a/modules/icinga/manifests/monitor/legal.pp
+++ b/modules/icinga/manifests/monitor/legal.pp
@@ -20,7 +20,7 @@
 host  => 'en.wikipedia.org',
 normal_check_interval => 1440,
 retry_check_interval  => 30,
-contact_group => 'admins',
+contact_group => 'admins,legal',
 }
 
 monitoring::service { 'en.m.wp.o-legal-html':
@@ -29,7 +29,7 @@
 host  => 'en.m.wikipedia.org',
 normal_check_interval => 1440,
 retry_check_interval  => 30,
-contact_group => 'admins',
+contact_group => 'admins,legal',
 }
 
 monitoring::service { 'en.wb.o-legal-html':
@@ -38,6 +38,6 @@
 host  => 'en.wikibooks.org',
 normal_check_interval => 1440,
 retry_check_interval  => 30,
-contact_group => 'admins',
+contact_group => 'admins,legal',
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I325b1daa8d52a79f7ce1acec3b546ff21aef2455
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...FlaggedRevs[wmf/1.28.0-wmf.20]: Fix I9839283c: new_text is actually a Content object

2016-09-22 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: Fix I9839283c: new_text is actually a Content object
..

Fix I9839283c: new_text is actually a Content object

Bug: T146423
Change-Id: I518eb5528d0354207deb418a4afaf49ce2607f32
---
M business/RevisionReviewForm.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/business/RevisionReviewForm.php b/business/RevisionReviewForm.php
index 69e7a49..55d01bf 100644
--- a/business/RevisionReviewForm.php
+++ b/business/RevisionReviewForm.php
@@ -324,15 +324,15 @@
}
$article = new WikiPage( $this->page );
# Get text with changes after $oldRev up to and 
including $newRev removed
-   $new_text = $article->getUndoContent( $newRev, $oldRev 
);
-   if ( $new_text === false ) {
+   $new_content = $article->getUndoContent( $newRev, 
$oldRev );
+   if ( $new_content === false ) {
return 'review_cannot_undo';
}
$baseRevId = $newRev->isCurrent() ? $oldRev->getId() : 
0;
 
# Actually make the edit...
$editStatus = $article->doEditContent(
-   ContentHandler::makeContent( $new_text, 
$article->getTitle() ),
+   $new_content,
$this->getComment(),
0,
$baseRevId,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I518eb5528d0354207deb418a4afaf49ce2607f32
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: Alex Monk 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Output a better deprecated message

2016-09-22 Thread Bmansurov (Code Review)
Bmansurov has uploaded a new change for review.

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

Change subject: Output a better deprecated message
..

Output a better deprecated message

Make deprecated instructions clearer by telling how to use mw.config.get().

Bug: T98653
Change-Id: I2d85286431e44cd74c7722b75d8631fe58d0634e
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/22/312422/1

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 89bb83b..7692a82 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -131,7 +131,7 @@
key,
value,
// Deprecation notice for mw.config globals 
(T58550, T72470)
-   map === mw.config && 'Use mw.config instead.'
+   map === mw.config && 'Use mw.config.get( \'' + 
key + '\' ) instead.'
);
}
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add DBConnRef sanity check to LoadBalancer::reuseConnection()

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Add DBConnRef sanity check to LoadBalancer::reuseConnection()
..

Add DBConnRef sanity check to LoadBalancer::reuseConnection()

Change-Id: I6b079b994f29c5f7953efe73982ef9e6946a21f8
---
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/21/312421/1

diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php 
b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
index c030cb2..bda185a 100644
--- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php
+++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
@@ -597,6 +597,13 @@
 * should be ignored
 */
return;
+   } elseif ( $conn instanceof DBConnRef ) {
+   // DBConnRef already handles calling reuseConnection() 
and only passes the live
+   // Database instance to this method. Any caller passing 
in a DBConnRef is broken.
+   $this->connLogger->error( __METHOD__ . ": got DBConnRef 
instance.\n" .
+   ( new RuntimeException() )->getTraceAsString() 
);
+
+   return;
}
 
$domain = $conn->getDomainID();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6b079b994f29c5f7953efe73982ef9e6946a21f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: move FeedViewCallback to FeedAdapter

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

Change subject: Hygiene: move FeedViewCallback to FeedAdapter
..


Hygiene: move FeedViewCallback to FeedAdapter

Change-Id: Id9f302237469637405de51c4bd413cf311186bb0
---
M app/src/main/java/org/wikipedia/feed/FeedFragment.java
M 
app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java
M app/src/main/java/org/wikipedia/feed/mainpage/MainPageCardView.java
M app/src/main/java/org/wikipedia/feed/mostread/MostReadCardView.java
M app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java
M app/src/main/java/org/wikipedia/feed/progress/ProgressCardView.java
M app/src/main/java/org/wikipedia/feed/random/RandomCardView.java
M app/src/main/java/org/wikipedia/feed/view/DefaultFeedCardView.java
M app/src/main/java/org/wikipedia/feed/view/FeedAdapter.java
M app/src/main/java/org/wikipedia/feed/view/FeedCardView.java
D app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
M 
app/src/main/java/org/wikipedia/feed/view/HorizontalScrollingListCardItemView.java
12 files changed, 36 insertions(+), 40 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/feed/FeedFragment.java 
b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
index f233f3e..cc8ba76 100644
--- a/app/src/main/java/org/wikipedia/feed/FeedFragment.java
+++ b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
@@ -30,7 +30,6 @@
 import org.wikipedia.feed.news.NewsItemCard;
 import org.wikipedia.feed.view.FeedAdapter;
 import org.wikipedia.feed.view.FeedView;
-import org.wikipedia.feed.view.FeedViewCallback;
 import org.wikipedia.history.HistoryEntry;
 import org.wikipedia.login.LoginActivity;
 import org.wikipedia.settings.Prefs;
@@ -134,7 +133,7 @@
 coordinator.setFeedUpdateListener(null);
 swipeRefreshLayout.setOnRefreshListener(null);
 feedView.removeOnScrollListener(feedScrollListener);
-feedView.setCallback((FeedViewCallback) null);
+feedView.setCallback((FeedAdapter.Callback) null);
 unbinder.unbind();
 unbinder = null;
 super.onDestroyView();
diff --git 
a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java
 
b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java
index 7bb7fce..98319e5 100644
--- 
a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java
+++ 
b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java
@@ -9,7 +9,7 @@
 import org.wikipedia.R;
 import org.wikipedia.feed.view.CardHeaderView;
 import org.wikipedia.feed.view.CardLargeHeaderView;
-import org.wikipedia.feed.view.FeedViewCallback;
+import org.wikipedia.feed.view.FeedAdapter;
 import org.wikipedia.feed.view.ListCardView;
 import org.wikipedia.feed.view.PageTitleListCardItemView;
 import org.wikipedia.feed.view.PageTitleRecyclerAdapter;
@@ -66,9 +66,10 @@
 }
 
 private static class RecyclerAdapter extends 
PageTitleRecyclerAdapter {
-@Nullable private FeedViewCallback callback;
+@Nullable private FeedAdapter.Callback callback;
 
-RecyclerAdapter(@NonNull List items, @Nullable 
FeedViewCallback callback) {
+RecyclerAdapter(@NonNull List items,
+@Nullable FeedAdapter.Callback callback) {
 super(items);
 this.callback = callback;
 }
diff --git 
a/app/src/main/java/org/wikipedia/feed/mainpage/MainPageCardView.java 
b/app/src/main/java/org/wikipedia/feed/mainpage/MainPageCardView.java
index fb87390..1fe5bd1 100644
--- a/app/src/main/java/org/wikipedia/feed/mainpage/MainPageCardView.java
+++ b/app/src/main/java/org/wikipedia/feed/mainpage/MainPageCardView.java
@@ -7,7 +7,7 @@
 
 import org.wikipedia.R;
 import org.wikipedia.WikipediaApp;
-import org.wikipedia.feed.view.FeedViewCallback;
+import org.wikipedia.feed.view.FeedAdapter;
 import org.wikipedia.feed.view.StaticCardView;
 import org.wikipedia.history.HistoryEntry;
 import org.wikipedia.page.PageTitle;
@@ -29,16 +29,16 @@
 setIcon(R.drawable.icon_feed_today);
 }
 
-@Override public void setCallback(@Nullable FeedViewCallback callback) {
+@Override public void setCallback(@Nullable FeedAdapter.Callback callback) 
{
 super.setCallback(callback);
 setOnClickListener(new CallbackAdapter(callback));
 }
 
 private static class CallbackAdapter implements OnClickListener {
 @NonNull private WikipediaApp app = WikipediaApp.getInstance();
-@Nullable private final FeedViewCallback callback;
+@Nullable private final FeedAdapter.Callback callback;
 
-CallbackAdapter(@Nullable FeedViewCallback callback) {
+CallbackAdapter(@Nullable FeedAdapter.Callback callback) {
 this.callback = callback;
 }
 
diff --git 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: icinga: add contactgroup for legal

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

Change subject: icinga: add contactgroup for legal
..


icinga: add contactgroup for legal

Bug: T146227
Change-Id: I2ef1d30f98891c322c9b9a64fa0a7bbbdb1d0357
---
M modules/nagios_common/files/contactgroups.cfg
1 file changed, 6 insertions(+), 0 deletions(-)

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



diff --git a/modules/nagios_common/files/contactgroups.cfg 
b/modules/nagios_common/files/contactgroups.cfg
index 737d969..6b0ca15 100644
--- a/modules/nagios_common/files/contactgroups.cfg
+++ b/modules/nagios_common/files/contactgroups.cfg
@@ -84,3 +84,9 @@
 contactgroup_name   team-interactive
 members irc-interactive,yurik,MaxSem,gehel
 }
+
+# T146227
+define contactgroup {
+contactgroup_name   legal
+members slaporte,zhousquared
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2ef1d30f98891c322c9b9a64fa0a7bbbdb1d0357
Gerrit-PatchSet: 4
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]: icinga: add contactgroup for legal

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

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

Change subject: icinga: add contactgroup for legal
..

icinga: add contactgroup for legal

Bug: T146227
Change-Id: I2ef1d30f98891c322c9b9a64fa0a7bbbdb1d0357
---
M modules/nagios_common/files/contactgroups.cfg
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/20/312420/1

diff --git a/modules/nagios_common/files/contactgroups.cfg 
b/modules/nagios_common/files/contactgroups.cfg
index 737d969..2361fed 100644
--- a/modules/nagios_common/files/contactgroups.cfg
+++ b/modules/nagios_common/files/contactgroups.cfg
@@ -84,3 +84,8 @@
 contactgroup_name   team-interactive
 members irc-interactive,yurik,MaxSem,gehel
 }
+
+define contactgroup {
+contactgroup_name   legal
+members slaporte, zhousquared
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ef1d30f98891c322c9b9a64fa0a7bbbdb1d0357
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/core[master]: Fix doc typo for wasConnectionError()

2016-09-22 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Fix doc typo for wasConnectionError()
..

Fix doc typo for wasConnectionError()

Change-Id: I70eaeb630e2a4bb8f2940c2dcc938f7305014d48
---
M includes/libs/rdbms/database/Database.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index d58ffdf..66f7046 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -2435,7 +2435,7 @@
}
 
/**
-* Do no use the class outside of Database/DBError classes
+* Do not use this method outside of Database/DBError classes
 *
 * @param integer|string $errno
 * @return bool Whether the given query error was a connection drop
@@ -3263,8 +3263,8 @@
/**
 * Called by sourceStream() to check if we've reached a statement end
 *
-* @param string $sql SQL assembled so far
-* @param string $newLine New line about to be added to $sql
+* @param string &$sql SQL assembled so far
+* @param string &$newLine New line about to be added to $sql
 * @return bool Whether $newLine contains end of the statement
 */
public function streamStatementEnd( &$sql, &$newLine ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I70eaeb630e2a4bb8f2940c2dcc938f7305014d48
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: encapsulate NewsListCardView's callback

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

Change subject: Hygiene: encapsulate NewsListCardView's callback
..


Hygiene: encapsulate NewsListCardView's callback

Change-Id: I63539c2a7f2c351f8da0b1c0b46e1764fc224419
---
M app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java
M app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
2 files changed, 5 insertions(+), 5 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java 
b/app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java
index 6ae01e5..17affef 100644
--- a/app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java
+++ b/app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java
@@ -18,6 +18,9 @@
 
 public class NewsListCardView extends 
HorizontalScrollingListCardView
 implements ItemTouchHelperSwipeAdapter.SwipeableView {
+public interface Callback {
+void onNewsItemSelected(@NonNull NewsItemCard card);
+}
 
 public NewsListCardView(@NonNull Context context) {
 super(context);
diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java 
b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
index d1323f3..323eb86 100644
--- a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
+++ b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
@@ -1,14 +1,11 @@
 package org.wikipedia.feed.view;
 
-import android.support.annotation.NonNull;
-
 import org.wikipedia.feed.image.FeaturedImageCardView;
-import org.wikipedia.feed.news.NewsItemCard;
+import org.wikipedia.feed.news.NewsListCardView;
 import org.wikipedia.feed.searchbar.SearchCardView;
 import org.wikipedia.views.ItemTouchHelperSwipeAdapter;
 
 public interface FeedViewCallback extends ItemTouchHelperSwipeAdapter.Callback,
 PageTitleListCardItemView.Callback, CardHeaderView.Callback, 
FeaturedImageCardView.Callback,
-SearchCardView.Callback {
-void onNewsItemSelected(@NonNull NewsItemCard card);
+SearchCardView.Callback, NewsListCardView.Callback {
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I63539c2a7f2c351f8da0b1c0b46e1764fc224419
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Mholloway 
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...CiteThisPage[master]: Rewrite to avoid messing with global state

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

Change subject: Rewrite to avoid messing with global state
..


Rewrite to avoid messing with global state

The main goal of this rewrite is to not use or mess with any global
state.

The ParserGetVariableValueTs and ParserGetVariableValueVarCache hooks
were replaced with setting the timestamp via
ParserOptions::setTimestamp(). This also means that {{#time:...}} from
ParserFunctions extension will correctly use the page's timestamp
instead of the current one.

Disabling tidy is also done using ParserOptions instead of changing
global state.

Change-Id: Ib2810aa5891c57831380a1a4718656cc09932b96
---
M SpecialCiteThisPage.php
M extension.json
M i18n/en.json
M i18n/qqq.json
4 files changed, 94 insertions(+), 87 deletions(-)

Approvals:
  Subramanya Sastry: Looks good to me, approved
  Jforrester: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/SpecialCiteThisPage.php b/SpecialCiteThisPage.php
index 5e1cae9..03d5fce 100644
--- a/SpecialCiteThisPage.php
+++ b/SpecialCiteThisPage.php
@@ -1,18 +1,17 @@
  tags to
-   // be generated around the output of the CiteThisPageOutput
-   // class TODO FIXME.
-   $wgUseTidy = false;
-
$this->setHeaders();
$this->outputHeader();
 
@@ -23,8 +22,7 @@
 
if ( $title && $title->exists() ) {
$id = $this->getRequest()->getInt( 'id' );
-   $cout = new CiteThisPageOutput( $title, $id );
-   $cout->execute();
+   $this->showCitations( $title, $id );
}
}
 
@@ -84,54 +82,62 @@
protected function getGroupName() {
return 'pagetools';
}
-}
 
-class CiteThisPageOutput {
-   /**
-* @var Title
-*/
-   public $mTitle;
+   private function showCitations( Title $title, $revId ) {
+   if ( !$revId ) {
+   $revId = $title->getLatestRevID();
+   }
 
-   /**
-* @var Article
-*/
-   public $mArticle;
+   $out = $this->getOutput();
 
-   public $mId;
+   $revision = Revision::newFromTitle( $title, $revId );
+   if ( !$revision ) {
+   $out->wrapWikiMsg( '$1',
+   [ 'citethispage-badrevision', 
$title->getPrefixedText(), $revId ] );
+   return;
+   }
 
-   /**
-* @var Parser
-*/
-   public $mParser;
+   $parserOptions = $this->getParserOptions();
+   // Set the overall timestamp to the revision's timestamp
+   $parserOptions->setTimestamp( $revision->getTimestamp() );
 
-   /**
-* @var ParserOptions
-*/
-   public $mParserOptions;
+   $parser = $this->getParser();
+   // Register our  tag which just parses using a 
different
+   // context
+   $parser->setHook( 'citation', [ $this, 'citationTag' ] );
+   // Also hold on to a separate Parser instance for  
tag parsing
+   // since we can't parse in a parse using the same Parser
+   $this->citationParser = $this->getParser();
 
-   public $mSpTitle;
+   $ret = $parser->parse(
+   $this->getContentText(),
+   $title,
+   $parserOptions,
+   /* $linestart = */ false,
+   /* $clearstate = */ true,
+   $revId
+   );
 
-   function __construct( $title, $id ) {
-   global $wgHooks, $wgParser;
+   $this->getOutput()->addModuleStyles( 'ext.citeThisPage' );
+   $this->getOutput()->addParserOutputContent( $ret );
 
-   $this->mTitle = $title;
-   $this->mArticle = new Article( $title );
-   $this->mId = $id;
-
-   $wgHooks['ParserGetVariableValueVarCache'][] = [ $this, 
'varCache' ];
-
-   $this->genParserOptions();
-   $this->genParser();
-
-   $wgParser->setHook( 'citation', [ $this, 'citationTagParse' ] );
}
 
-   function execute() {
-   global $wgOut, $wgParser, $wgHooks;
+   /**
+* @return Parser
+*/
+   private function getParser() {
+   $parserConf = $this->getConfig()->get( 'ParserConf' );
+   return new $parserConf['class']( $parserConf );
+   }
 
-   $wgHooks['ParserGetVariableValueTs'][] = [ $this, 'timestamp' ];
-
-   $msg = wfMessage( 'citethispage-content' 
)->inContentLanguage()->plain();
+   /**
+* Get the content to parse
+*
+* @return string
+*/
+   private function 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make MigrateFileRepoLayout use getErrors()

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

Change subject: Make MigrateFileRepoLayout use getErrors()
..


Make MigrateFileRepoLayout use getErrors()

Change-Id: I5281c4ded9eba42eccaf5a67e809a0175fa057ce
---
M maintenance/migrateFileRepoLayout.php
1 file changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/maintenance/migrateFileRepoLayout.php 
b/maintenance/migrateFileRepoLayout.php
index bd73f8b..f771fff 100644
--- a/maintenance/migrateFileRepoLayout.php
+++ b/maintenance/migrateFileRepoLayout.php
@@ -104,7 +104,7 @@
$status = $be->prepare( [
'dir' => dirname( $dpath ), 
'bypassReadOnly' => 1 ] );
if ( !$status->isOK() ) {
-   $this->error( print_r( 
$status->getErrorsArray(), true ) );
+   $this->error( print_r( 
$status->getErrors(), true ) );
}
 
$batch[] = [ 'op' => 'copy', 
'overwrite' => true,
@@ -137,7 +137,7 @@
$status = $be->prepare( [
'dir' => dirname( $dpath ), 
'bypassReadOnly' => 1 ] );
if ( !$status->isOK() ) {
-   $this->error( print_r( 
$status->getErrorsArray(), true ) );
+   $this->error( print_r( 
$status->getErrors(), true ) );
}
$batch[] = [ 'op' => 'copy', 
'overwrite' => true,
'src' => $spath, 'dst' => 
$dpath, 'img' => $ofile->getArchiveName() ];
@@ -195,7 +195,7 @@
$status = $be->prepare( [
'dir' => dirname( $dpath ), 
'bypassReadOnly' => 1 ] );
if ( !$status->isOK() ) {
-   $this->error( print_r( 
$status->getErrorsArray(), true ) );
+   $this->error( print_r( 
$status->getErrors(), true ) );
}
 
$batch[] = [ 'op' => 'copy', 'src' => $spath, 
'dst' => $dpath,
@@ -227,7 +227,7 @@
 
$status = $be->doOperations( $ops, [ 'bypassReadOnly' => 1 ] );
if ( !$status->isOK() ) {
-   $this->output( print_r( $status->getErrorsArray(), true 
) );
+   $this->output( print_r( $status->getErrors(), true ) );
}
 
$this->output( "Batch done\n\n" );

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...FlaggedRevs[master]: Fix I9839283c: new_text is actually a Content object

2016-09-22 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: Fix I9839283c: new_text is actually a Content object
..

Fix I9839283c: new_text is actually a Content object

Bug: T146423
Change-Id: I518eb5528d0354207deb418a4afaf49ce2607f32
---
M business/RevisionReviewForm.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FlaggedRevs 
refs/changes/18/312418/1

diff --git a/business/RevisionReviewForm.php b/business/RevisionReviewForm.php
index 69e7a49..55d01bf 100644
--- a/business/RevisionReviewForm.php
+++ b/business/RevisionReviewForm.php
@@ -324,15 +324,15 @@
}
$article = new WikiPage( $this->page );
# Get text with changes after $oldRev up to and 
including $newRev removed
-   $new_text = $article->getUndoContent( $newRev, $oldRev 
);
-   if ( $new_text === false ) {
+   $new_content = $article->getUndoContent( $newRev, 
$oldRev );
+   if ( $new_content === false ) {
return 'review_cannot_undo';
}
$baseRevId = $newRev->isCurrent() ? $oldRev->getId() : 
0;
 
# Actually make the edit...
$editStatus = $article->doEditContent(
-   ContentHandler::makeContent( $new_text, 
$article->getTitle() ),
+   $new_content,
$this->getComment(),
0,
$baseRevId,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I518eb5528d0354207deb418a4afaf49ce2607f32
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: Alex Monk 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move wfEscapeWikiText() to Parser::escapeWikitext()

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

Change subject: Move wfEscapeWikiText() to Parser::escapeWikitext()
..


Move wfEscapeWikiText() to Parser::escapeWikitext()

wfEscapeWikiText() used $wgEnableMagicLinks, but that could result in an
inconsistency when something modifies the magic link related
ParserOptions.

In general, most uses of wfEscapeWikiText() are in parser functions or
when message parsing, so the Parser is a logical place for it.

A future patch will make it easy to use Parser::escapeWikitext() in
message parameters.

Change-Id: I0fd4d5c135541971b1384a20328f1302b03d715f
---
M includes/GlobalFunctions.php
M includes/parser/CoreParserFunctions.php
M includes/parser/Parser.php
3 files changed, 89 insertions(+), 68 deletions(-)

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



diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 0e59653..ee5ebd0 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -1656,6 +1656,8 @@
 }
 
 /**
+ * @deprecated since 1.28, use Parser::escapeWikitext() directly
+ *
  * Escapes the given text so that it may be output using addWikiText()
  * without any linking, formatting, etc. making its way through. This
  * is achieved by substituting certain characters with HTML entities.
@@ -1665,47 +1667,8 @@
  * @return string
  */
 function wfEscapeWikiText( $text ) {
-   global $wgEnableMagicLinks;
-   static $repl = null, $repl2 = null;
-   if ( $repl === null ) {
-   $repl = [
-   '"' => '', '&' => '', "'" => '', '<' => 
'',
-   '=' => '', '>' => '', '[' => '', ']' => 
'',
-   '{' => '', '|' => '', '}' => '', ';' 
=> '',
-   "\n#" => "\n", "\r#" => "\r",
-   "\n*" => "\n", "\r*" => "\r",
-   "\n:" => "\n", "\r:" => "\r",
-   "\n " => "\n", "\r " => "\r",
-   "\n\n" => "\n", "\r\n" => "\n",
-   "\n\r" => "\n", "\r\r" => "\r",
-   "\n\t" => "\n", "\r\t" => "\r", // "\n\t\n" is 
treated like "\n\n"
-   "\n" => "\n---", "\r" => "\r---",
-   '__' => '_', '://' => '//',
-   ];
-
-   $magicLinks = array_keys( array_filter( $wgEnableMagicLinks ) );
-   // We have to catch everything "\s" matches in PCRE
-   foreach ( $magicLinks as $magic ) {
-   $repl["$magic "] = "$magic";
-   $repl["$magic\t"] = "$magic";
-   $repl["$magic\r"] = "$magic";
-   $repl["$magic\n"] = "$magic";
-   $repl["$magic\f"] = "$magic";
-   }
-
-   // And handle protocols that don't use "://"
-   global $wgUrlProtocols;
-   $repl2 = [];
-   foreach ( $wgUrlProtocols as $prot ) {
-   if ( substr( $prot, -1 ) === ':' ) {
-   $repl2[] = preg_quote( substr( $prot, 0, -1 ), 
'/' );
-   }
-   }
-   $repl2 = $repl2 ? '/\b(' . implode( '|', $repl2 ) . '):/i' : 
'/^(?!)/';
-   }
-   $text = substr( strtr( "\n$text", $repl ), 1 );
-   $text = preg_replace( $repl2, '$1', $text );
-   return $text;
+   global $wgParser;
+   return $wgParser->escapeWikitext( $text );
 }
 
 /**
diff --git a/includes/parser/CoreParserFunctions.php 
b/includes/parser/CoreParserFunctions.php
index 01cce02..b3dc17c 100644
--- a/includes/parser/CoreParserFunctions.php
+++ b/includes/parser/CoreParserFunctions.php
@@ -594,98 +594,98 @@
if ( is_null( $t ) ) {
return '';
}
-   return wfEscapeWikiText( $t->getText() );
+   return $parser->escapeWikitext( $t->getText() );
}
-   public static function pagenamee( $parser, $title = null ) {
+   public static function pagenamee( Parser $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
-   return wfEscapeWikiText( $t->getPartialURL() );
+   return $parser->escapeWikitext( $t->getPartialURL() );
}
-   public static function fullpagename( $parser, $title = null ) {
+   public static function fullpagename( Parser $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canTalk() ) {
return '';
}
-   return wfEscapeWikiText( $t->getPrefixedText() );
+   return $parser->escapeWikitext( $t->getPrefixedText() );
}
-   public static function fullpagenamee( $parser, 

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: encapsulate SearchCardView's callback

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

Change subject: Hygiene: encapsulate SearchCardView's callback
..


Hygiene: encapsulate SearchCardView's callback

Change-Id: Icf476bca12b3b8901acd781e2e1283770a8c93d8
---
M app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java
M app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
2 files changed, 8 insertions(+), 3 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java 
b/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java
index 82348f5..184e871 100644
--- a/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java
+++ b/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java
@@ -10,6 +10,11 @@
 import butterknife.OnClick;
 
 public class SearchCardView extends DefaultFeedCardView {
+public interface Callback {
+void onSearchRequested();
+void onVoiceSearchRequested();
+}
+
 public SearchCardView(Context context) {
 super(context);
 inflate(getContext(), R.layout.view_search_bar, this);
diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java 
b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
index f29a75a..d1323f3 100644
--- a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
+++ b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
@@ -4,11 +4,11 @@
 
 import org.wikipedia.feed.image.FeaturedImageCardView;
 import org.wikipedia.feed.news.NewsItemCard;
+import org.wikipedia.feed.searchbar.SearchCardView;
 import org.wikipedia.views.ItemTouchHelperSwipeAdapter;
 
 public interface FeedViewCallback extends ItemTouchHelperSwipeAdapter.Callback,
-PageTitleListCardItemView.Callback, CardHeaderView.Callback, 
FeaturedImageCardView.Callback {
-void onSearchRequested();
-void onVoiceSearchRequested();
+PageTitleListCardItemView.Callback, CardHeaderView.Callback, 
FeaturedImageCardView.Callback,
+SearchCardView.Callback {
 void onNewsItemSelected(@NonNull NewsItemCard card);
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icf476bca12b3b8901acd781e2e1283770a8c93d8
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Mholloway 
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]: Limit performance jobs IRC notification channels

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

Change subject: Limit performance jobs IRC notification channels
..


Limit performance jobs IRC notification channels

The performance-webpagetest-wpt-org job is reporting to #wikimedia-dev,
limit notifications to #wikimedia-perf by mimicking the irc-android-ci
publisher which appears to function correctly.

The performance-webpagetest-wpt-org job sent notifications to four:

IRC notifier plugin: Sending notification to: #wikimedia-dev
IRC notifier plugin: Sending notification to: #wikimedia-releng
IRC notifier plugin: Sending notification to: #wikimedia-android-ci
IRC notifier plugin: Sending notification to: #wikimedia-perf

Change-Id: Ibbc3ea53f2d14cb7bad0480f7b84820a642a3cdb
---
M jjb/misc.yaml
1 file changed, 0 insertions(+), 1 deletion(-)

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

Objections:
  Hashar: There's a problem with this change, please improve



diff --git a/jjb/misc.yaml b/jjb/misc.yaml
index 6aabf28..622d539 100644
--- a/jjb/misc.yaml
+++ b/jjb/misc.yaml
@@ -362,7 +362,6 @@
   notify-upstream: false
   notify-fixers: false
   message-type: 'summary'
-  matrix-notifier: only-parent
   channels:
 - name: '#wikimedia-perf'
   notify-only: true

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibbc3ea53f2d14cb7bad0480f7b84820a642a3cdb
Gerrit-PatchSet: 3
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Niedzielski 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: Phedenskog 
Gerrit-Reviewer: Thcipriani 
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...CentralNotice[master]: jQuery usage tweaks

2016-09-22 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged.

Change subject: jQuery usage tweaks
..


jQuery usage tweaks

Use .text() instead of .html() where unneeded, break up node
creation and setting value instead of concatenating user input.

Change-Id: Ideeedbdb2eb17ee36d18f363496e46c818e48046
---
M resources/infrastructure/campaignManager.js
M resources/infrastructure/ext.centralNotice.adminUi.campaignPager.js
2 files changed, 11 insertions(+), 9 deletions(-)

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



diff --git a/resources/infrastructure/campaignManager.js 
b/resources/infrastructure/campaignManager.js
index 10d7ded..8372310 100644
--- a/resources/infrastructure/campaignManager.js
+++ b/resources/infrastructure/campaignManager.js
@@ -39,7 +39,7 @@
slide: function ( event, element ) {
var val = Number( element.value ),
rounded = Math.round( val * 10 ) / 10;
-   $( '#centralnotice-throttle-echo' ).html( String( 
rounded ) + '%' );
+   $( '#centralnotice-throttle-echo' ).text( String( 
rounded ) + '%' );
$( '#centralnotice-throttle-cur' ).val( val );
}
} );
diff --git 
a/resources/infrastructure/ext.centralNotice.adminUi.campaignPager.js 
b/resources/infrastructure/ext.centralNotice.adminUi.campaignPager.js
index 5a0c352..3e0afc9 100644
--- a/resources/infrastructure/ext.centralNotice.adminUi.campaignPager.js
+++ b/resources/infrastructure/ext.centralNotice.adminUi.campaignPager.js
@@ -80,21 +80,23 @@
var $form = $( '' ),
 
$authtokenField = $(
-   ''
+   ''
),
 
$summaryField = $(
-   ''
+   ''
),
 
-   $changesField =
-   $( '' );
+   $changesField = $(
+   ''
+   );
 
+   $authtokenField.val( mw.user.tokens.get( 'editToken' ) );
+   $summaryField.val(
+   $( '#cn-campaign-pager input.cn-change-summary-input' 
).val()
+   );
$changesField.val( JSON.stringify( changes ) );
+
$form.append( $authtokenField, $summaryField, $changesField );
$( document.body ).append( $form );
$form.submit();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ideeedbdb2eb17ee36d18f363496e46c818e48046
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Ssmith 
Gerrit-Reviewer: XenoRyet 
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]: Generalize core schema docs in DatabasePostgres

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

Change subject: Generalize core schema docs in DatabasePostgres
..


Generalize core schema docs in DatabasePostgres

Change-Id: I52e64867c1533c50406623d5bc121c1e4da2459a
---
M includes/libs/rdbms/database/DatabasePostgres.php
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/includes/libs/rdbms/database/DatabasePostgres.php 
b/includes/libs/rdbms/database/DatabasePostgres.php
index 8c73a15..84439f4 100644
--- a/includes/libs/rdbms/database/DatabasePostgres.php
+++ b/includes/libs/rdbms/database/DatabasePostgres.php
@@ -991,7 +991,7 @@
}
 
/**
-* Determine default schema for MediaWiki core
+* Determine default schema for the current application
 * Adjust this session schema search path if desired schema exists
 * and is not alread there.
 *
@@ -1036,7 +1036,7 @@
}
 
/**
-* Return schema name fore core MediaWiki tables
+* Return schema name for core application tables
 *
 * @since 1.19
 * @return string Core schema name

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I52e64867c1533c50406623d5bc121c1e4da2459a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[wmf/1.28.0-wmf.20]: Allow readable queries for externaldata in geojson

2016-09-22 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review.

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

Change subject: Allow readable queries for externaldata in geojson
..

Allow readable queries for externaldata in geojson

TBD: Should we do more validation in schema rather than Map.js?

Bug: T145047
Change-Id: I033a515e3561850fccaba8ab2be9457e040fcfe9
(cherry picked from commit 90c849d84645e8efdad32f06a53db41cfa06a502)
---
M modules/box/Map.js
M schemas/geojson.json
A tests/phpunit/data/bad-schemas/42-externaldata-7.json
A tests/phpunit/data/bad-schemas/43-externaldata-8.json
A tests/phpunit/data/bad-schemas/44-externaldata-9.json
A tests/phpunit/data/bad-schemas/45-externaldata-10.json
A tests/phpunit/data/bad-schemas/46-externaldata-11.json
A tests/phpunit/data/bad-schemas/47-externaldata-12.json
A tests/phpunit/data/bad-schemas/48-externaldata-13.json
A tests/phpunit/data/bad-schemas/49-externaldata-14.json
A tests/phpunit/data/bad-schemas/50-externaldata-15.json
M tests/phpunit/data/good-schemas/08-externaldata.json
12 files changed, 160 insertions(+), 13 deletions(-)


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

diff --git a/modules/box/Map.js b/modules/box/Map.js
index 587b5b6..eade691 100644
--- a/modules/box/Map.js
+++ b/modules/box/Map.js
@@ -216,15 +216,54 @@
 * For a given ExternalData object, gets it via XHR and expands it in 
place
 *
 * @param {Object} data
-* @param {string} data.href URL to external data
+* @param {string} [data.href] optional URL to external data
+* @param {string} [data.service] optional name of the service (same as 
protocol without the ':')
+* @param {string} [data.host] optional host of the service
+* @param {string|string[]} [data.query] optional geoshape query
+* @param {string} [data.ids] optional geoshape ids
 * @return {Promise} resolved when done with geojson expansion
 */
function loadExternalDataAsync( data ) {
-   var uri = new mw.Uri( data.href );
-   // If url begins with   protocol:///...  mark it as having 
relative host
-   if ( /^[a-z]+:\/\/\//.test( data.href ) ) {
-   uri.isRelativeHost = true;
+   var uri;
+   if ( data.href ) {
+   uri = new mw.Uri( data.href );
+   // If url begins with   protocol:///...  mark it as 
having relative host
+   if ( /^[a-z]+:\/\/\//.test( data.href ) ) {
+   uri.isRelativeHost = true;
+   }
+   } else if ( data.service ) {
+   // Construct URI out of the parameters in the 
externalData object
+   uri = new mw.Uri( {
+   protocol: data.service,
+   host: data.host,
+   path: '/'
+   } );
+   uri.isRelativeHost = !data.host;
+   uri.query = {};
+   switch ( data.service ) {
+   case 'geoshape':
+   if ( data.query ) {
+   if ( typeof data.query === 
'string' ) {
+   uri.query.query = 
data.query;
+   } else {
+   throw new Error( 
'Invalid "query" parameter in ExternalData' );
+   }
+   }
+   if ( data.ids ) {
+   if ( $.isArray( data.ids ) ) {
+   uri.query.ids = 
data.ids.join( ',' );
+   } else if ( typeof data.ids === 
'string' ) {
+   uri.query.ids = 
data.ids.replace( /\s*,\s*/, ',' );
+   } else {
+   throw new Error( 
'Invalid "ids" parameter in ExternalData' );
+   }
+   }
+   break;
+   default:
+   throw new Error( 'Unknown externalData 
protocol ' + data.service );
+   }
}
+
switch ( uri.protocol ) {
case 'geoshape':
// geoshape:///?ids=Q16,Q30
@@ -232,10 +271,10 @@
// Get geo shapes data from OSM database by 
supplying Wikidata IDs or query
  

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Add 'message-format' log channel

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

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

Change subject: Add 'message-format' log channel
..

Add 'message-format' log channel

Logging is added in Id51cf6a5a937bc41a914f317e980ef42e4d385fb.

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


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index b27a152..40b841b 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -4552,6 +4552,7 @@
'MassMessage' => 'debug', // for 59464 -legoktm 2013/12/15
'Math' => 'info',  // mobrovac for T121445
'memcached' => 'error', // -aaron 2012/10/24
+   'message-format' => [ 'logstash' => 'warning' ],
'mobile' => 'debug',
'NewUserMessage' => 'debug',
'oai' => 'debug',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4914814c9f9716289ecb5a7d205bf5ff95be64fe
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
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] mediawiki/core[master]: Log when Message::__toString has an unexpected format

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

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

Change subject: Log when Message::__toString has an unexpected format
..

Log when Message::__toString has an unexpected format

Message formatting methods have a side effect on how string conversion
will work, which is a security problem waiting to happen:

$msg = new Message( 'foo' );
echo $msg; // parsed
echo $msg->plain();
echo $msg; // not parsed

This change logs Message -> string transformations which are
affected by a prior call in this way. The behavior will be removed
in a later patch (possibly replaced by something more explicit
if it turns out that something depends on it).

Bug: T146416
Change-Id: Id51cf6a5a937bc41a914f317e980ef42e4d385fb
---
M includes/Message.php
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/01/312401/1

diff --git a/includes/Message.php b/includes/Message.php
index c2c954a..c1a12aa 100644
--- a/includes/Message.php
+++ b/includes/Message.php
@@ -852,6 +852,12 @@
 * @return string
 */
public function __toString() {
+   if ( $this->format !== 'parse' ) {
+   $ex = new LogicException( __METHOD__ . ' using implicit 
format: ' . $this->format );
+   \MediaWiki\Logger\LoggerFactory::getInstance( 
'message-format' )->warning(
+   $ex->getMessage(), [ 'exception' => $ex, 
'format' => $this->format, 'key' => $this->key ] );
+   }
+
// PHP doesn't allow __toString to throw exceptions and will
// trigger a fatal error if it does. So, catch any exceptions.
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id51cf6a5a937bc41a914f317e980ef42e4d385fb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
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] operations/puppet[production]: upload storage: transition cp3038+cp3039

2016-09-22 Thread BBlack (Code Review)
BBlack has submitted this change and it was merged.

Change subject: upload storage: transition cp3038+cp3039
..


upload storage: transition cp3038+cp3039

Bug: T145661
Change-Id: I232ad2ebb368be8fe44a5cab630f57c4ae37283e
---
A hieradata/hosts/cp3038.yaml
A hieradata/hosts/cp3039.yaml
2 files changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/hieradata/hosts/cp3038.yaml b/hieradata/hosts/cp3038.yaml
new file mode 100644
index 000..c02abf9
--- /dev/null
+++ b/hieradata/hosts/cp3038.yaml
@@ -0,0 +1 @@
+upload_storage_experiment: true
diff --git a/hieradata/hosts/cp3039.yaml b/hieradata/hosts/cp3039.yaml
new file mode 100644
index 000..c02abf9
--- /dev/null
+++ b/hieradata/hosts/cp3039.yaml
@@ -0,0 +1 @@
+upload_storage_experiment: true

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I232ad2ebb368be8fe44a5cab630f57c4ae37283e
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack 
Gerrit-Reviewer: BBlack 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: move FeaturedImageCardView callback

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

Change subject: Hygiene: move FeaturedImageCardView callback
..


Hygiene: move FeaturedImageCardView callback

Encapsulate FeaturedImageCardView's callback as
FeaturedImageCardView.Callback.

Change-Id: Ideeed05abecb0de2b662a02d9d65de32aad10558
---
M app/src/main/java/org/wikipedia/feed/image/FeaturedImageCardView.java
M app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
2 files changed, 8 insertions(+), 6 deletions(-)

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



diff --git 
a/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCardView.java 
b/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCardView.java
index e233f4d..567b87c 100644
--- a/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCardView.java
+++ b/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCardView.java
@@ -21,6 +21,12 @@
 
 public class FeaturedImageCardView extends 
DefaultFeedCardView
 implements ItemTouchHelperSwipeAdapter.SwipeableView {
+public interface Callback {
+void onShareImage(@NonNull FeaturedImageCard card);
+void onDownloadImage(@NonNull FeaturedImage image);
+void onFeaturedImageSelected(@NonNull FeaturedImageCard card);
+}
+
 @BindView(R.id.view_featured_image_card_header) View headerView;
 @BindView(R.id.view_featured_image_card_footer) View footerView;
 @BindView(R.id.view_featured_image_card_image) FaceAndColorDetectImageView 
imageView;
diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java 
b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
index fbb2fdb..f29a75a 100644
--- a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
+++ b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
@@ -2,17 +2,13 @@
 
 import android.support.annotation.NonNull;
 
-import org.wikipedia.feed.image.FeaturedImage;
-import org.wikipedia.feed.image.FeaturedImageCard;
+import org.wikipedia.feed.image.FeaturedImageCardView;
 import org.wikipedia.feed.news.NewsItemCard;
 import org.wikipedia.views.ItemTouchHelperSwipeAdapter;
 
 public interface FeedViewCallback extends ItemTouchHelperSwipeAdapter.Callback,
-PageTitleListCardItemView.Callback, CardHeaderView.Callback {
+PageTitleListCardItemView.Callback, CardHeaderView.Callback, 
FeaturedImageCardView.Callback {
 void onSearchRequested();
 void onVoiceSearchRequested();
 void onNewsItemSelected(@NonNull NewsItemCard card);
-void onShareImage(@NonNull FeaturedImageCard card);
-void onDownloadImage(@NonNull FeaturedImage image);
-void onFeaturedImageSelected(@NonNull FeaturedImageCard card);
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ideeed05abecb0de2b662a02d9d65de32aad10558
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Mholloway 
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   >