[MediaWiki-commits] [Gerrit] extensionModuleMessages is deprecated - change (mediawiki...parsoid)

2015-05-22 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review.

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

Change subject: extensionModuleMessages is deprecated
..

extensionModuleMessages is deprecated

 * Removed in Ia6c87d687c6670b3ebf24251572191732651e8f5

 * We only seem to using extensionModuleStyles anyways.

 * This might get awfully noisy until mediawiki 1.27 :(

Change-Id: I8dac6925b6e5dfbcb35b43ea754d71194ad925e9
---
M lib/mediawiki.ApiRequest.js
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/lib/mediawiki.ApiRequest.js b/lib/mediawiki.ApiRequest.js
index b542a90..264c564 100644
--- a/lib/mediawiki.ApiRequest.js
+++ b/lib/mediawiki.ApiRequest.js
@@ -620,7 +620,6 @@
setPageProperty(data.parse.modules, "extensionModules");
setPageProperty(data.parse.modulescripts, "extensionModuleScripts");
setPageProperty(data.parse.modulestyles, "extensionModuleStyles");
-   setPageProperty(data.parse.modulemessages, "extensionModuleMessages");
 
// Add the categories which were added by extensions directly into the
// page and not as in-text links

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

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

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


[MediaWiki-commits] [Gerrit] Use the proxy passed to ConfigRequest - change (mediawiki...parsoid)

2015-05-22 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review.

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

Change subject: Use the proxy passed to ConfigRequest
..

Use the proxy passed to ConfigRequest

 * The default constructed wikiConfig *didn't* have the proxy set!

 * Broken in 923b64a5b7cef6c5a9efd4c36d23176da6992d55

Change-Id: Ibf571bc1531fb3ad77db7b3c78b8d5a18ebd25ae
---
M lib/mediawiki.ApiRequest.js
M lib/mediawiki.parser.environment.js
2 files changed, 17 insertions(+), 5 deletions(-)


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

diff --git a/lib/mediawiki.ApiRequest.js b/lib/mediawiki.ApiRequest.js
index aa39129..b542a90 100644
--- a/lib/mediawiki.ApiRequest.js
+++ b/lib/mediawiki.ApiRequest.js
@@ -107,6 +107,10 @@
this.title = title;
this.queueKey = title;
this.reqType = "Page Fetch";
+
+   // Proxy to the MW API. Set to null for subclasses going somewhere else.
+   // ie. ParsoidCacheRequest
+   this.proxy = env.conf.wiki.apiProxy;
 }
 
 // Inherit from EventEmitter
@@ -114,7 +118,7 @@
 
 ApiRequest.prototype.request = function( options, callback ) {
var env = this.env;
-   var proxy = env.conf.wiki.apiProxy;
+   var proxy = this.proxy;
// this is a good place to put debugging statements
// if you want to watch network requests.
//  console.log('ApiRequest', options);
@@ -666,6 +670,9 @@
this.queueKey = title + '?oldid=' + oldid;
this.reqType = "Parsoid cache request";
 
+   // Don't use MW API proxy.
+   this.proxy = null;
+
var apiargs = {
oldid: oldid
};
@@ -683,9 +690,6 @@
headers: {
'x-parsoid-request': 'cache'
},
-   // Don't use MW API proxy.
-   // XXX add option for parsoid cache proxy?
-   proxy: null,
};
 
var timeouts = env.conf.parsoid.timeouts;
@@ -734,6 +738,10 @@
this.queueKey = uri;
this.reqType = "Config Request";
 
+   // Use the passed in proxy to the mw api. The default proxy set in
+   // the ApiRequest constructor might not be the right one.
+   this.proxy = proxy;
+
if (!uri) {
this.retries = env.conf.parsoid.retries.mwApi.configInfo;
this._requestCB(new Error('There was no base URI for the API we 
tried to use.'));
diff --git a/lib/mediawiki.parser.environment.js 
b/lib/mediawiki.parser.environment.js
index 7932c33..9f7d177 100644
--- a/lib/mediawiki.parser.environment.js
+++ b/lib/mediawiki.parser.environment.js
@@ -75,7 +75,11 @@
 
if ( !wikiConfig ) {
// Local things, per-wiki
-   wikiConfig = new WikiConfig( this, null, options.prefix );
+   wikiConfig = new WikiConfig(
+   this, null, options.prefix,
+   parsoidConfig.mwApiMap.get(options.prefix).uri,
+   this.getAPIProxy(options.prefix)
+   );
}
 
this.conf.wiki = wikiConfig;

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

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

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


[MediaWiki-commits] [Gerrit] Fix tabbing - change (mediawiki...Interwiki)

2015-05-22 Thread Spage (Code Review)
Spage has uploaded a new change for review.

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

Change subject: Fix tabbing
..

Fix tabbing

Remove tabindex on input fields, add autofocus to first one.

Test Plan: With this, tabbing through the fields of Special:Interwiki/add on my 
labs
instance does the right thing.

Bug: T100052
Change-Id: I3fa0c1ea3d805ce0ad423d503ef3f012eb0e4bca
---
M Interwiki_body.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/Interwiki_body.php b/Interwiki_body.php
index bd1fe79..47504cd 100755
--- a/Interwiki_body.php
+++ b/Interwiki_body.php
@@ -135,7 +135,7 @@
} elseif ( $action === 'add' ) {
$prefix = $request->getVal( 'wpInterwikiPrefix', 
$request->getVal( 'prefix' ) );
$prefixElement = Xml::input( 'wpInterwikiPrefix', 20, 
$prefix,
-   array( 'tabindex' => 1, 'id' => 
'mw-interwiki-prefix', 'maxlength' => 20 ) );
+   array( 'autofocus' => true, 'id' => 
'mw-interwiki-prefix', 'maxlength' => 20 ) );
$local = $request->getCheck( 'wpInterwikiLocal' );
$trans = $request->getCheck( 'wpInterwikiTrans' );
$defaulturl = $request->getVal( 'wpInterwikiURL', 
$this->msg( 'interwiki-defaulturl' )->text() );
@@ -177,7 +177,7 @@
Xml::label( $this->msg( 
'interwiki-url-label' )->text(), 'mw-interwiki-url' )
) .
Html::rawElement( 'td', $input, Xml::input( 
'wpInterwikiURL', 60, $defaulturl,
-   array( 'tabindex' => 1, 'maxlength' => 
200, 'id' => 'mw-interwiki-url' ) ) )
+   array( 'maxlength' => 200, 'id' => 
'mw-interwiki-url' ) ) )
);
}
 
@@ -197,7 +197,7 @@
Html::rawElement( 'td', $label, 
Xml::label( $this->msg( 'interwiki_reasonfield' )->text(),
"mw-interwiki-{$action}reason" 
) ) .
Html::rawElement( 'td', $input, 
Xml::input( 'wpInterwikiReason', 60, '',
-   array( 'tabindex' => 1, 'id' => 
"mw-interwiki-{$action}reason", 'maxlength' => 200 ) ) )
+   array( 'id' => 
"mw-interwiki-{$action}reason", 'maxlength' => 200 ) ) )
) . Html::rawElement( 'tr', null,
Html::rawElement( 'td', null, '' ) .
Html::rawElement( 'td', array( 'class' 
=> 'mw-submit' ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3fa0c1ea3d805ce0ad423d503ef3f012eb0e4bca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Interwiki
Gerrit-Branch: master
Gerrit-Owner: Spage 

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


[MediaWiki-commits] [Gerrit] Clean cruft in CNBannerChoiceDataResourceLoaderModule::getCh... - change (mediawiki...CentralNotice)

2015-05-22 Thread AndyRussG (Code Review)
AndyRussG has uploaded a new change for review.

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

Change subject: Clean cruft in 
CNBannerChoiceDataResourceLoaderModule::getChoices()
..

Clean cruft in CNBannerChoiceDataResourceLoaderModule::getChoices()

Change-Id: Ib1cf7109aeef279b9649349e8d19be61d776fe9e
---
M includes/CNBannerChoiceDataResourceLoaderModule.php
1 file changed, 3 insertions(+), 6 deletions(-)


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

diff --git a/includes/CNBannerChoiceDataResourceLoaderModule.php 
b/includes/CNBannerChoiceDataResourceLoaderModule.php
index a86df39..6cb8a70 100644
--- a/includes/CNBannerChoiceDataResourceLoaderModule.php
+++ b/includes/CNBannerChoiceDataResourceLoaderModule.php
@@ -17,16 +17,13 @@
const API_REQUEST_TIMEOUT = 20;
 
protected function getChoices( ResourceLoaderContext $context ) {
-   global $wgNoticeProject,
-   $wgUser,
-   $wgCentralNoticeApiUrl,
-   $wgCentralDBname;
+   global $wgNoticeProject, $wgCentralNoticeApiUrl;
 
$project = $wgNoticeProject;
$language = $context->getLanguage();
 
-   // Fetch the data via the DB or the API. Decide which to use 
based
-   // on whether the appropriate global variables are set.
+   // Only fetch the data via the API if $wgCentralNoticeApiUrl is 
set.
+   // Otherwise, use the DB.
if ( $wgCentralNoticeApiUrl ) {
$choices = $this->getFromApi( $project, $language );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib1cf7109aeef279b9649349e8d19be61d776fe9e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: AndyRussG 

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


[MediaWiki-commits] [Gerrit] contint: disable unattended upgrade - change (operations/puppet)

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

Change subject: contint: disable unattended upgrade
..


contint: disable unattended upgrade

HHVM package is broken and we don't want to magically upgrade at
midnight UTC.

Also find out the hourly run does not work.

Bug: T98876
Bug: T98885
Change-Id: I4f67a3b1312a2b57df9613e5ddbc6d33cfda647b
---
M modules/contint/manifests/packages/labs.pp
1 file changed, 7 insertions(+), 5 deletions(-)

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



diff --git a/modules/contint/manifests/packages/labs.pp 
b/modules/contint/manifests/packages/labs.pp
index f5e2e7a..72c94d0 100644
--- a/modules/contint/manifests/packages/labs.pp
+++ b/modules/contint/manifests/packages/labs.pp
@@ -9,10 +9,12 @@
 # Fonts needed for browser tests screenshots (T71535)
 include mediawiki::packages::fonts
 
-# Self update the wikimedia packages (such as hhvm) on an hourly basis
-include apt::unattendedupgrades
+class { 'apt::unattendedupgrades':
+ensure => absent,
+}
 
 apt::conf { 'unattended-upgrades-wikimedia':
+ensure   => absent,
 priority => '51',
 key  => 'Unattended-Upgrade::Allowed-Origins',
 # lint:ignore:single_quote_string_with_variables
@@ -20,15 +22,15 @@
 # lint:endignore
 }
 apt::conf { 'lower-periodic-randomsleep':
+ensure   => absent,
 priority => '51',
 key  => 'APT::Periodic::RandomSleep',
 value=> '300',
 }
 
+# Not meant to run hourly :/
 file { '/etc/cron.hourly/apt':
-ensure  => link,
-target  => '/etc/cron.daily/apt',
-require => Package['unattended-upgrades'],
+ensure  => absent,
 }
 
 # Shell script wrappers to ease package building

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4f67a3b1312a2b57df9613e5ddbc6d33cfda647b
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Made RecentChange defer the save() method via DeferredUpdates - change (mediawiki/core)

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

Change subject: Made RecentChange defer the save() method via DeferredUpdates
..


Made RecentChange defer the save() method via DeferredUpdates

* Also made it handle calling PatrolLog::record() itself

Bug: T100042
Change-Id: I58ef060e02b89a5f9dadc0dbc4edba667932beda
---
M includes/changes/RecentChange.php
M includes/page/WikiPage.php
2 files changed, 29 insertions(+), 20 deletions(-)

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



diff --git a/includes/changes/RecentChange.php 
b/includes/changes/RecentChange.php
index aa210e3..7ea6777 100644
--- a/includes/changes/RecentChange.php
+++ b/includes/changes/RecentChange.php
@@ -517,8 +517,10 @@
 * @param int $patrol
 * @return RecentChange
 */
-   public static function notifyEdit( $timestamp, &$title, $minor, &$user, 
$comment, $oldId,
-   $lastTimestamp, $bot, $ip = '', $oldSize = 0, $newSize = 0, 
$newId = 0, $patrol = 0 ) {
+   public static function notifyEdit(
+   $timestamp, &$title, $minor, &$user, $comment, $oldId, 
$lastTimestamp,
+   $bot, $ip = '', $oldSize = 0, $newSize = 0, $newId = 0, $patrol 
= 0
+   ) {
$rc = new RecentChange;
$rc->mTitle = $title;
$rc->mPerformer = $user;
@@ -555,7 +557,13 @@
'newSize' => $newSize,
'pageStatus' => 'changed'
);
-   $rc->save();
+
+   DeferredUpdates::addCallableUpdate( function() use ( $rc ) {
+   $rc->save();
+   if ( $rc->mAttribs['rc_patrolled'] ) {
+   PatrolLog::record( $rc, true, 
$rc->getPerformer() );
+   }
+   } );
 
return $rc;
}
@@ -576,8 +584,10 @@
 * @param int $patrol
 * @return RecentChange
 */
-   public static function notifyNew( $timestamp, &$title, $minor, &$user, 
$comment, $bot,
-   $ip = '', $size = 0, $newId = 0, $patrol = 0 ) {
+   public static function notifyNew(
+   $timestamp, &$title, $minor, &$user, $comment, $bot,
+   $ip = '', $size = 0, $newId = 0, $patrol = 0
+   ) {
$rc = new RecentChange;
$rc->mTitle = $title;
$rc->mPerformer = $user;
@@ -614,7 +624,13 @@
'newSize' => $size,
'pageStatus' => 'created'
);
-   $rc->save();
+
+   DeferredUpdates::addCallableUpdate( function() use ( $rc ) {
+   $rc->save();
+   if ( $rc->mAttribs['rc_patrolled'] ) {
+   PatrolLog::record( $rc, true, 
$rc->getPerformer() );
+   }
+   } );
 
return $rc;
}
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index 022882a..83f6cfe 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -1835,17 +1835,13 @@
if ( !( $flags & EDIT_SUPPRESS_RC ) ) {
// Mark as patrolled if the user can do 
so
$patrolled = $wgUseRCPatrol && !count(
-   
$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
+   
$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
// Add RC row to the DB
-   $rc = RecentChange::notifyEdit( $now, 
$this->mTitle, $isminor, $user, $summary,
+   RecentChange::notifyEdit(
+   $now, $this->mTitle, $isminor, 
$user, $summary,
$oldid, $this->getTimestamp(), 
$bot, '', $oldsize, $newsize,
$revisionId, $patrolled
);
-
-   // Log auto-patrolled edits
-   if ( $patrolled ) {
-   PatrolLog::record( $rc, true, 
$user );
-   }
}
 
$user->incEditCount();
@@ -1936,13 +1932,10 @@
$patrolled = ( $wgUseRCPatrol || $wgUseNPPatrol 
) && !count(

$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
// Add RC row to the DB
-   $rc = RecentChange::notifyNew( $now, 
$this->mTitle, $isminor, $user, $summary, $bot,
- 

[MediaWiki-commits] [Gerrit] contint: packages for Android SDK - change (operations/puppet)

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

Change subject: contint: packages for Android SDK
..


contint: packages for Android SDK

Add packages for Android SDK. Only on Trusty since Precise is missing
lib32stdc+66.

Bug: T88494
Change-Id: I3b425039ae6880ecd740fb25da40d92fc1abf433
---
M modules/contint/manifests/packages/labs.pp
1 file changed, 5 insertions(+), 0 deletions(-)

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



diff --git a/modules/contint/manifests/packages/labs.pp 
b/modules/contint/manifests/packages/labs.pp
index 7129018..f5e2e7a 100644
--- a/modules/contint/manifests/packages/labs.pp
+++ b/modules/contint/manifests/packages/labs.pp
@@ -125,6 +125,11 @@
 
 'hhvm-dev',
 
+# Android SDK
+'gcc-multilib',
+'lib32z1',
+'lib32stdc++6',
+
 ]: ensure => present,
 }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3b425039ae6880ecd740fb25da40d92fc1abf433
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Simplified doEditContent exception handling - change (mediawiki/core)

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

Change subject: Simplified doEditContent exception handling
..


Simplified doEditContent exception handling

* Callers should not catch errors and fail to rollback
  changes as much here as anywhere else

Change-Id: I65cbeb8d0895223b7ad60c9081d703d14197cb4a
---
M includes/page/WikiPage.php
1 file changed, 107 insertions(+), 114 deletions(-)

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



diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index 18abe39..022882a 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -1692,6 +1692,7 @@
 * revision: The revision object for the inserted revision, or null.
 *
 * @since 1.21
+* @throws MWException
 */
public function doEditContent( Content $content, $summary, $flags = 0, 
$baseRevId = false,
User $user = null, $serialFormat = null
@@ -1803,56 +1804,52 @@
 
if ( $changed ) {
$dbw->begin( __METHOD__ );
-   try {
 
-   $prepStatus = $content->prepareSave( 
$this, $flags, $oldid, $user );
-   $status->merge( $prepStatus );
+   $prepStatus = $content->prepareSave( $this, 
$flags, $oldid, $user );
+   $status->merge( $prepStatus );
 
-   if ( !$status->isOK() ) {
-   $dbw->rollback( __METHOD__ );
-
-   return $status;
-   }
-   $revisionId = $revision->insertOn( $dbw 
);
-
-   // Update page
-   //
-   // We check for conflicts by comparing 
$oldid with the current latest revision ID.
-   $ok = $this->updateRevisionOn( $dbw, 
$revision, $oldid, $oldIsRedirect );
-
-   if ( !$ok ) {
-   // Belated edit conflict! Run 
away!!
-   $status->fatal( 'edit-conflict' 
);
-
-   $dbw->rollback( __METHOD__ );
-
-   return $status;
-   }
-
-   Hooks::run( 
'NewRevisionFromEditComplete', array( $this, $revision, $baseRevId, $user ) );
-   // Update recentchanges
-   if ( !( $flags & EDIT_SUPPRESS_RC ) ) {
-   // Mark as patrolled if the 
user can do so
-   $patrolled = $wgUseRCPatrol && 
!count(
-   
$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
-   // Add RC row to the DB
-   $rc = RecentChange::notifyEdit( 
$now, $this->mTitle, $isminor, $user, $summary,
-   $oldid, 
$this->getTimestamp(), $bot, '', $oldsize, $newsize,
-   $revisionId, $patrolled
-   );
-
-   // Log auto-patrolled edits
-   if ( $patrolled ) {
-   PatrolLog::record( $rc, 
true, $user );
-   }
-   }
-   $user->incEditCount();
-   } catch ( Exception $e ) {
+   if ( !$status->isOK() ) {
$dbw->rollback( __METHOD__ );
-   // Question: Would it perhaps be better 
if this method turned all
-   // exceptions into $status's?
-   throw $e;
+
+   return $status;
}
+   $revisionId = $revision->insertOn( $dbw );
+
+   // Update page
+   //
+   // We check for conflicts by comparing $oldid 
with the current latest revision ID.
+   $ok = $this->updateRevisionOn( $dbw, $revision, 
$oldid, $oldIsRedirect );
+
+   if

[MediaWiki-commits] [Gerrit] Cleaned up CAS check in RevDelLogItem::setBits for recentcha... - change (mediawiki/core)

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

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

Change subject: Cleaned up CAS check in RevDelLogItem::setBits for recentchanges
..

Cleaned up CAS check in RevDelLogItem::setBits for recentchanges

Change-Id: I6c29653361a0937489c27891739a9dc626c20167
---
M includes/revisiondelete/RevDelLogItem.php
M includes/revisiondelete/RevDelRevisionItem.php
2 files changed, 17 insertions(+), 10 deletions(-)


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

diff --git a/includes/revisiondelete/RevDelLogItem.php 
b/includes/revisiondelete/RevDelLogItem.php
index 49adf20..5c83107 100644
--- a/includes/revisiondelete/RevDelLogItem.php
+++ b/includes/revisiondelete/RevDelLogItem.php
@@ -53,6 +53,21 @@
 
public function setBits( $bits ) {
$dbw = wfGetDB( DB_MASTER );
+
+   $dbw->update( 'logging',
+   array( 'log_deleted' => $bits ),
+   array(
+   'log_id' => $this->row->log_id,
+   'log_deleted' => $this->getBits() // cas
+   ),
+   __METHOD__
+   );
+
+   if ( !$dbw->affectedRows() ) {
+   // Concurrent fail!
+   return false;
+   }
+
$dbw->update( 'recentchanges',
array(
'rc_deleted' => $bits,
@@ -64,16 +79,8 @@
),
__METHOD__
);
-   $dbw->update( 'logging',
-   array( 'log_deleted' => $bits ),
-   array(
-   'log_id' => $this->row->log_id,
-   'log_deleted' => $this->getBits()
-   ),
-   __METHOD__
-   );
 
-   return (bool)$dbw->affectedRows();
+   return true;
}
 
public function getHTML() {
diff --git a/includes/revisiondelete/RevDelRevisionItem.php 
b/includes/revisiondelete/RevDelRevisionItem.php
index 300ce6a..17e1fd1 100644
--- a/includes/revisiondelete/RevDelRevisionItem.php
+++ b/includes/revisiondelete/RevDelRevisionItem.php
@@ -67,7 +67,7 @@
array(
'rev_id' => $this->revision->getId(),
'rev_page' => $this->revision->getPage(),
-   'rev_deleted' => $this->getBits()
+   'rev_deleted' => $this->getBits() // cas
),
__METHOD__
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c29653361a0937489c27891739a9dc626c20167
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] Actually set the $res field via doQuery() in setVisibility - change (mediawiki/core)

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

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

Change subject: Actually set the $res field via doQuery() in setVisibility
..

Actually set the $res field via doQuery() in setVisibility

* Otherwise, it is thrown away and redone on a slave

Change-Id: I1252fa5bc98d908cf289f4d93cbdd8d6d33828ea
---
M includes/revisiondelete/RevDelList.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/includes/revisiondelete/RevDelList.php 
b/includes/revisiondelete/RevDelList.php
index f16fd15..1b3b76c 100644
--- a/includes/revisiondelete/RevDelList.php
+++ b/includes/revisiondelete/RevDelList.php
@@ -89,9 +89,9 @@
$comment = $params['comment'];
$perItemStatus = isset( $params['perItemStatus'] ) ? 
$params['perItemStatus'] : false;
 
-   $this->res = false;
$dbw = wfGetDB( DB_MASTER );
-   $this->doQuery( $dbw );
+   $this->res = $this->doQuery( $dbw );
+
$dbw->startAtomic( __METHOD__ );
$status = Status::newGood();
$missing = array_flip( $this->ids );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1252fa5bc98d908cf289f4d93cbdd8d6d33828ea
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] Add mira to mediawiki-installation dsh - change (operations/puppet)

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

Change subject: Add mira to mediawiki-installation dsh
..


Add mira to mediawiki-installation dsh

mira is supposed to become a new deployment host in codfw,
like tin in eqiad

Bug: T95436
Change-Id: I91a501c048b26e4d1bd0c86d8a201bba4f74dde2
---
M modules/dsh/files/group/mediawiki-installation
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/modules/dsh/files/group/mediawiki-installation 
b/modules/dsh/files/group/mediawiki-installation
index a021155..d7cec49 100644
--- a/modules/dsh/files/group/mediawiki-installation
+++ b/modules/dsh/files/group/mediawiki-installation
@@ -1,5 +1,6 @@
 # !all names added here must be FQDN's now (T93983) !
 
+mira.codfw.wmnet
 silver.wikimedia.org
 tin.eqiad.wmnet
 terbium.eqiad.wmnet

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I91a501c048b26e4d1bd0c86d8a201bba4f74dde2
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: John F. Lewis 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Dzahn 
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] phabricator: Add priority keywords/labels for !priority emai... - change (operations/puppet)

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

Change subject: phabricator: Add priority keywords/labels for !priority email 
command
..


phabricator: Add priority keywords/labels for !priority email command

Based on the example config in PhabricatorManiphestConfigOptions.php

Bug: T98356
Change-Id: I7f056fc6c2363049fe0a07df6434728524343cd7
---
M modules/phabricator/data/fixed_settings.yaml
1 file changed, 6 insertions(+), 0 deletions(-)

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



diff --git a/modules/phabricator/data/fixed_settings.yaml 
b/modules/phabricator/data/fixed_settings.yaml
index e61172d..eb78838 100644
--- a/modules/phabricator/data/fixed_settings.yaml
+++ b/modules/phabricator/data/fixed_settings.yaml
@@ -40,26 +40,32 @@
 name: 'Unbreak Now!'
 short: 'Unbreak!'
 color: indigo
+keywords: ['unbreak']
   '90':
 name: 'Needs Triage'
 short: Triage
 color: violet
+keywords: ['triage']
   '80':
 name: High
 short: High
 color: red
+keywords: ['high']
   '50':
 name: Normal
 short: Normal
 color: orange
+keywords: ['normal']
   '25':
 name: Low
 short: Low
 color: yellow
+keywords: ['low']
   '10':
 name: Lowest
 short: Lowest
 color: sky
+keywords: ['lowest']
 
 # DO NOT CHANGE THESE VALUES.  Must be updated to match in security extensions.
 maniphest.custom-field-definitions:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7f056fc6c2363049fe0a07df6434728524343cd7
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Merlijn van Deen 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: Aklapper 
Gerrit-Reviewer: Chasemp 
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] mira: add to salt_peer_run - change (operations/puppet)

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

Change subject: mira: add to salt_peer_run
..


mira: add to salt_peer_run

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

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



diff --git a/manifests/role/salt.pp b/manifests/role/salt.pp
index 50e06cc..9300cf9 100644
--- a/manifests/role/salt.pp
+++ b/manifests/role/salt.pp
@@ -9,7 +9,8 @@
 class { 'salt::master':
 salt_runner_dirs=> ['/srv/runners'],
 salt_peer_run   => {
-'tin.eqiad.wmnet' => ['deploy.*'],
+'tin.eqiad.wmnet'  => ['deploy.*'],
+'mira.codfw.wmnet' => ['deploy.*'],
 },
 salt_file_roots => $salt_file_roots,
 salt_pillar_roots   => $salt_pillar_roots,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1cedc5c395a3bab1ec41b2fbe47e4456b6a2e8b5
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: John F. Lewis 
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] bump version to 0.5.6-1, build for trusty - change (operations...trebuchet-trigger)

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

Change subject: bump version to 0.5.6-1, build for trusty
..


bump version to 0.5.6-1, build for trusty

build for trusty (mira), adjust python-git dependency to just >= 0.3.1

was error: (python-git (>= 0.3.2.RC1) but 0.3.2~RC1-3 is to be installed)

Bug:T99919
Change-Id: I116df7f4711fa8aef2ee441477cab163afbfe76a
---
M debian/changelog
M debian/control
M requires.txt
M setup.py
4 files changed, 10 insertions(+), 4 deletions(-)

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



diff --git a/debian/changelog b/debian/changelog
index 236281e..219301e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+trebuchet-trigger (0.5.6-1) trusty; urgency=low
+
+  * Rebuild for trusty, fixed python-git dependency (T95436)
+
+ -- Daniel Zahn   Thu, 21 May 2015 20:53:10 +
+
 trebuchet-trigger (0.5.5-1) precise; urgency=low
 
   * Update for yaml format args to publish.runner
diff --git a/debian/control b/debian/control
index 6fee4b3..745a039 100644
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,7 @@
 
 Package: trebuchet-trigger
 Architecture: all
-Depends: ${misc:Depends}, ${python:Depends}, python-git (>=0.3.2.RC1)
+Depends: ${misc:Depends}, ${python:Depends}, python-git (>=0.3.1)
 XB-Python-Version: ${python:Versions}
 Provides: ${python:Provides}
 Description: An extendable git interface to trebuchet.
diff --git a/requires.txt b/requires.txt
index a3a557e..022a615 100644
--- a/requires.txt
+++ b/requires.txt
@@ -1,3 +1,3 @@
-GitPython>=0.3.2.RC1
+GitPython>=0.3.1
 PyYAML>=3.10
 redis>=2.4.9
diff --git a/setup.py b/setup.py
index d19b16f..db3fe6e 100644
--- a/setup.py
+++ b/setup.py
@@ -15,9 +15,9 @@
 
 setup(
 name="TrebuchetTrigger",
-version="0.5.5",
+version="0.5.6",
 packages=find_packages(),
-install_requires=['GitPython>=0.3.2.RC1', 'PyYAML>=3.10', 'redis>=2.4.9', 
'salt'],
+install_requires=['GitPython>=0.3.1', 'PyYAML>=3.10', 'redis>=2.4.9', 
'salt'],
 
 author="Ryan Lane",
 author_email="r...@ryandlane.com",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I116df7f4711fa8aef2ee441477cab163afbfe76a
Gerrit-PatchSet: 9
Gerrit-Project: operations/software/deployment/trebuchet-trigger
Gerrit-Branch: master
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] mira: add to salt_peer_run - change (operations/puppet)

2015-05-22 Thread John F. Lewis (Code Review)
John F. Lewis has uploaded a new change for review.

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

Change subject: mira: add to salt_peer_run
..

mira: add to salt_peer_run

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


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/22/212822/1

diff --git a/manifests/role/salt.pp b/manifests/role/salt.pp
index 50e06cc..9300cf9 100644
--- a/manifests/role/salt.pp
+++ b/manifests/role/salt.pp
@@ -9,7 +9,8 @@
 class { 'salt::master':
 salt_runner_dirs=> ['/srv/runners'],
 salt_peer_run   => {
-'tin.eqiad.wmnet' => ['deploy.*'],
+'tin.eqiad.wmnet'  => ['deploy.*'],
+'mira.codfw.wmnet' => ['deploy.*'],
 },
 salt_file_roots => $salt_file_roots,
 salt_pillar_roots   => $salt_pillar_roots,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1cedc5c395a3bab1ec41b2fbe47e4456b6a2e8b5
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: John F. Lewis 

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


[MediaWiki-commits] [Gerrit] Refactor Wikimetrics layout to use TimeseriesData - change (analytics/dashiki)

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

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

Change subject: Refactor Wikimetrics layout to use TimeseriesData
..

Refactor Wikimetrics layout to use TimeseriesData

Change-Id: I8ff13b6150d7e317644407eee1fc16719a15f941
---
M .gitignore
M src/app/data-converters/separated-values.js
M src/app/data-converters/timeseries-data.js
M src/app/data-converters/wikimetrics-timeseries.js
M src/components/visualizers/dygraphs-timeseries/bindings.js
M src/components/wikimetrics-visualizer/wikimetrics-visualizer.js
M test/app/data-converters.js
M test/components/wikimetrics-visualizer.js
8 files changed, 178 insertions(+), 157 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/dashiki 
refs/changes/21/212821/1

diff --git a/.gitignore b/.gitignore
index f60fbd7..d90390f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
 .DS_Store
 node_modules/
 bower_modules/
+npm-debug.log
 
 # personal dev stuff
 .jslintrc
diff --git a/src/app/data-converters/separated-values.js 
b/src/app/data-converters/separated-values.js
index 75e362d..b80d063 100644
--- a/src/app/data-converters/separated-values.js
+++ b/src/app/data-converters/separated-values.js
@@ -2,7 +2,11 @@
  * This module returns a method that knows how to parse a file with values
  *   separated by arbitrary characters on lines separated by arbitrary 
characters
  */
-define(['moment'], function (moment) {
+define(function (require) {
+'use strict';
+
+var _ = require('lodash'),
+TimeseriesData = require('converters.timeseries');
 
 /**
  * Parses a CSV, TSV, or similar using some assumptions:
@@ -26,44 +30,36 @@
 return row.split(opt.valueSeparator);
 });
 
-var header = rows.splice(0, 1)[0],
-mainColumn = opt.columnToUse || header[1],
-mainColumnIndex = header.indexOf(mainColumn),
-allColumns = [mainColumn];
+var header = rows
+// grab the first row and treat it as the header 
(required)
+.splice(0, 1)[0]
+// always skip the first column because that's the 
date
+.splice(1, opt.showBreakdown ? rows[0].length : 1),
 
-if (opt.showBreakdown) {
-allColumns = allColumns.concat(opt.breakdownColumns);
-}
+// all columns should be colored the same
+colorLabels = _.fill(Array(header.length), opt.label),
 
-var data = rows.map(function (row) {
+// but all columns should be patterned differently
+patternLabels = _.range(header.length),
+rowsByDate = {};
 
-// some records are bad, filter them
-var date = moment(row[0]).toDate().getTime();
-var value = parseInt(row[mainColumnIndex], 10);
-
-if (date && value && !isNaN(date) && !isNaN(value)) {
-// NOTE: for demos until we add a time-selector, uncomment 
this line:
-if (date < 138853440) return [];
-return allColumns.map(function (column) {
-return {
-date: date,
-color: opt.label,
-label: opt.showBreakdown ? opt.label + ': ' + 
column : opt.label,
-value: parseInt(row[header.indexOf(column)], 10),
-type: column,
-main: column === mainColumn,
-};
-});
-}
+_.forEach(rows, function (row) {
+var value = row.splice(1);
+rowsByDate[row[0]] = _(value).take(header.length).map(function 
(v) {
+// force numbers to numbers, strings to strings, and the 
rest to null
+var number = parseFloat(v);
+return isNaN(number)
+? v ? v : null
+: number;
+}).value();
 });
-data = [].concat.apply([], data);
 
-return data.sort(function (a, b) {
-return a.date - b.date;
-}).filter(function (item) {
-// make sure not to return 'undefined' items
-return item;
-});
+return new TimeseriesData(
+header,
+rowsByDate,
+colorLabels,
+patternLabels
+);
 };
 };
 });
diff --git a/src/app/data-converters/timeseries-data.js 
b/src/app/data-converters/timeseries-data.js
index 65f6aa8..977d4f3 100644
--- a/src/app/data-converters/timeseries-data.js
+++ b/src/app/data-converters/timeseries-data.js
@@ -59,6 +59,10 @@
  * be merge

[MediaWiki-commits] [Gerrit] Clean up hard tab - change (mediawiki/vagrant)

2015-05-22 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: Clean up hard tab
..

Clean up hard tab

Change-Id: I8195f7a4d5b50d93da3256765f975e8135190d09
---
M puppet/modules/role/settings/fundraising.yaml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/20/212820/1

diff --git a/puppet/modules/role/settings/fundraising.yaml 
b/puppet/modules/role/settings/fundraising.yaml
index 70a9263..07f4ac1 100644
--- a/puppet/modules/role/settings/fundraising.yaml
+++ b/puppet/modules/role/settings/fundraising.yaml
@@ -2,4 +2,4 @@
 
 # ActiveMQ admin UI
 forward_ports:
-   8161: 8161
+8161: 8161

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

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

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


[MediaWiki-commits] [Gerrit] Fix notification email - change (mediawiki...Flow)

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

Change subject: Fix notification email
..


Fix notification email

* Add topic URL as 3rd parameter for new topics bundled email message

* Split message for web vs email new topics

* Remove quotes around page name in emails

Bug: T99095
Change-Id: Icb4880b7d771a751973b61f67d96a15152e84065
---
M i18n/en.json
M i18n/qqq.json
M includes/Notifications/Notifications.php
3 files changed, 12 insertions(+), 10 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index a64e826..4bf6882 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -271,17 +271,18 @@
"flow-notification-link-text-view-post": "View post",
"flow-notification-link-text-view-topic": "View topic",
"flow-notification-reply-email-subject": "$2 on $3",
-   "flow-notification-reply-email-batch-body": "$1 {{GENDER:$1|responded}} 
to \"$2\" on \"$3\"",
-   "flow-notification-reply-email-batch-bundle-body": "$1 and $4 
{{PLURAL:$5|other|others}} {{GENDER:$1|responded}} to \"$2\" on \"$3\"",
-   "flow-notification-mention-email-subject": "$1 {{GENDER:$1|mentioned}} 
{{GENDER:$3|you}} on \"$2\"",
-   "flow-notification-mention-email-batch-body": "$1 
{{GENDER:$1|mentioned}} {{GENDER:$4|you}} in {{GENDER:$1|his|her|their}} post 
in \"$2\" on \"$3\"",
+   "flow-notification-reply-email-batch-body": "$1 {{GENDER:$1|responded}} 
to \"$2\" on $3",
+   "flow-notification-reply-email-batch-bundle-body": "$1 and $4 
{{PLURAL:$5|other|others}} {{GENDER:$1|responded}} to \"$2\" on $3",
+   "flow-notification-mention-email-subject": "$1 {{GENDER:$1|mentioned}} 
{{GENDER:$3|you}} on $2",
+   "flow-notification-mention-email-batch-body": "$1 
{{GENDER:$1|mentioned}} {{GENDER:$4|you}} in {{GENDER:$1|his|her|their}} post 
in \"$2\" on $3",
"flow-notification-edit-email-subject": "$1 {{GENDER:$1|edited}} a 
post",
-   "flow-notification-edit-email-batch-body": "$1 {{GENDER:$1|edited}} a 
post in \"$2\" on \"$3\"",
-   "flow-notification-edit-email-batch-bundle-body": "$1 and $4 
{{PLURAL:$5|other|others}} {{GENDER:$1|edited}} a post in \"$2\" on \"$3\"",
+   "flow-notification-edit-email-batch-body": "$1 {{GENDER:$1|edited}} a 
post in \"$2\" on $3",
+   "flow-notification-edit-email-batch-bundle-body": "$1 and $4 
{{PLURAL:$5|other|others}} {{GENDER:$1|edited}} a post in \"$2\" on $3",
"flow-notification-rename-email-subject": "$1 {{GENDER:$1|renamed}} 
your topic",
-   "flow-notification-rename-email-batch-body": "$1 {{GENDER:$1|renamed}} 
your topic \"$2\" to \"$3\" on \"$4\"",
-   "flow-notification-newtopic-email-subject": "$1 {{GENDER:$1|created}} a 
new topic on \"$2\"",
+   "flow-notification-rename-email-batch-body": "$1 {{GENDER:$1|renamed}} 
your topic \"$2\" to \"$3\" on $4",
+   "flow-notification-newtopic-email-subject": "$1 {{GENDER:$1|created}} a 
new topic on $2",
"flow-notification-newtopic-email-batch-body": "$1 
{{GENDER:$1|created}} a new topic with the title \"$2\" on $3",
+   "flow-notification-newtopic-email-batch-bundle-body": 
"{{PLURAL:$1|$1|250=250+}} new {{PLURAL:$1|topic|topics}} on $2",
"echo-category-title-flow-discussion": "Flow",
"echo-pref-tooltip-flow-discussion": "Notify me when actions related to 
me occur in Flow.",
"flow-link-post": "post",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index c867ba8..9778dfe 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -287,6 +287,7 @@
"flow-notification-rename-email-batch-body": "Email notification for 
topic being renamed. Parameters:\n* $1 - name of the user that renamed the 
topic\n* $2 - the original topic title\n* $3 - the new topic title\n* $4 - 
title of the page the topic belongs to\n{{Related|Flow-notification-email}}",
"flow-notification-newtopic-email-subject": "Subject line of 
notification email for new topic creation. Parameters:\n* $1 - name of the user 
that created a new topic\n* $2 - title\n{{Related|Flow-notification-email}}",
"flow-notification-newtopic-email-batch-body": "Email notification for 
new topic creation. Parameters:\n* $1 - name of the user that created a new 
topic\n* $2 - the title of the new topic\n* $3 - title of the page the topic 
belongs to\n{{Related|Flow-notification-email}}",
+   "flow-notification-newtopic-email-batch-bundle-body": "Email 
notification for when multiple new topics are created on the same page. 
Parameters:\n* $1 - The number of topics that were created. This value is 
capped to 250. When this value is 250 it means 250 or more topics have been 
created.\n* $2 - The title of the page the topics were created on\n* $3 - Fully 
qualified url to view the related board sorted by newest 
topics.\n{{Related|Flow-notifi

[MediaWiki-commits] [Gerrit] Introduce ProofreadPage(Page) - change (pywikibot/core)

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

Change subject: Introduce ProofreadPage(Page)
..


Introduce ProofreadPage(Page)

Class ProofreadPage(Page) is introduced in dedicated module
proofreadpage.py.

Page is divided in header, body and footer according to the Proofread
Extension format.

Main application is for wikisource bots.

Purpose of this commit is to introduce the class to start applying it
and collect feedbacks.

The class can be further extended and improved in subsequent patches,
once its usage will give first feedbacks.

Tests have been started as well.

Change-Id: I34c0170133c7896daa2f1f998758c29c1e7748cd
---
A pywikibot/proofreadpage.py
A tests/proofreadpage_tests.py
2 files changed, 426 insertions(+), 0 deletions(-)

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



diff --git a/pywikibot/proofreadpage.py b/pywikibot/proofreadpage.py
new file mode 100644
index 000..d67e083
--- /dev/null
+++ b/pywikibot/proofreadpage.py
@@ -0,0 +1,288 @@
+# -*- coding: utf-8  -*-
+"""
+Objects representing objects used with ProofreadPage Extensions.
+
+This module includes objects:
+* ProofreadPage(Page)
+* FullHeader
+
+"""
+#
+# (C) Pywikibot team, 2015
+#
+# Distributed under the terms of the MIT license.
+#
+from __future__ import unicode_literals
+
+__version__ = '$Id$'
+#
+
+import re
+
+import pywikibot
+
+
+class FullHeader(object):
+
+"""Header of a ProofreadPage object."""
+
+p_header = re.compile(
+r''
+r'(?P.*)',
+re.DOTALL)
+
+_template = (''
+ '{0.header}\n\n\n')
+
+def __init__(self, text=None):
+"""Constructor."""
+self.text = text or ''
+
+m = self.p_header.search(self.text)
+if m:
+self.ql = int(m.group('ql'))
+self.user = m.group('user')
+self.header = m.group('header')
+else:
+self.ql = ProofreadPage.NOT_PROOFREAD
+self.user = ''
+self.header = ''
+
+def __str__(self):
+"""Return a string representation."""
+return self._template.format(self)
+
+
+class ProofreadPage(pywikibot.Page):
+
+"""ProofreadPage page used in Mediawiki ProofreadPage extension."""
+
+WITHOUT_TEXT = 0
+NOT_PROOFREAD = 1
+PROBLEMATIC = 2
+PROOFREAD = 3
+VALIDATED = 4
+
+open_tag = ''
+close_tag = ''
+p_open = re.compile(r'')
+p_close = re.compile(r'(|\n\n\n)?')
+
+def __init__(self, source, title=u''):
+"""Instantiate a ProofreadPage object.
+
+Raises UnknownExtension if source Site has no ProofreadPage Extension.
+"""
+if not isinstance(source, pywikibot.site.BaseSite):
+site = source.site
+else:
+site = source
+ns = site.proofread_page_ns
+super(ProofreadPage, self).__init__(source, title, ns=ns)
+if self.namespace() != site.proofread_page_ns:
+raise ValueError('Page %s must belong to %s namespace'
+  % (self.title(), ns))
+
+def decompose(fn):
+"""Decorator.
+
+Decompose text if needed and recompose text.
+"""
+def wrapper(obj, *args, **kwargs):
+if not hasattr(obj, '_full_header'):
+obj._decompose_page()
+_res = fn(obj, *args, **kwargs)
+obj._compose_page()
+return _res
+return wrapper
+
+@property
+@decompose
+def ql(self):
+"""Return page quality level."""
+return self._full_header.ql
+
+@ql.setter
+@decompose
+def ql(self, value):
+"""Set page quality level."""
+if value not in self.site.proofread_levels:
+raise ValueError('Not valid QL value: %s (legal values: %s)'
+ % (value, self.site.proofread_levels))
+# TODO: add logic to validate ql value change, considering
+# site.proofread_levels.
+self._full_header.ql = value
+
+@property
+@decompose
+def user(self):
+"""Return user in page header."""
+return self._full_header.user
+
+@user.setter
+@decompose
+def user(self, value):
+"""Set user in page header."""
+self._full_header.user = value
+
+@property
+@decompose
+def status(self):
+"""Return Proofread Page status."""
+try:
+return self.site.proofread_levels[self.ql]
+except KeyError:
+pywikibot.warning('Not valid status set for %s: quality level = %s'
+   % (self.title(asLink=True), self.ql))
+return None
+
+def without_text(self):
+"""Set Page QL to "Without text"."""
+self.ql = self.WITHOUT_TEXT
+
+def problematic(self):
+"""Set Page QL to "Problematic"."""
+self.ql = self.PROBLEMATIC
+
+def not_proofread(self):
+

[MediaWiki-commits] [Gerrit] Made RecentChange defer the save() method via DeferredUpdates - change (mediawiki/core)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Made RecentChange defer the save() method via DeferredUpdates
..

Made RecentChange defer the save() method via DeferredUpdates

* Also made it handle calling PatrolLog::record() itself

Bug: T100042
Change-Id: I58ef060e02b89a5f9dadc0dbc4edba667932beda
---
M includes/changes/RecentChange.php
M includes/page/WikiPage.php
2 files changed, 29 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/18/212818/1

diff --git a/includes/changes/RecentChange.php 
b/includes/changes/RecentChange.php
index aa210e3..7ea6777 100644
--- a/includes/changes/RecentChange.php
+++ b/includes/changes/RecentChange.php
@@ -517,8 +517,10 @@
 * @param int $patrol
 * @return RecentChange
 */
-   public static function notifyEdit( $timestamp, &$title, $minor, &$user, 
$comment, $oldId,
-   $lastTimestamp, $bot, $ip = '', $oldSize = 0, $newSize = 0, 
$newId = 0, $patrol = 0 ) {
+   public static function notifyEdit(
+   $timestamp, &$title, $minor, &$user, $comment, $oldId, 
$lastTimestamp,
+   $bot, $ip = '', $oldSize = 0, $newSize = 0, $newId = 0, $patrol 
= 0
+   ) {
$rc = new RecentChange;
$rc->mTitle = $title;
$rc->mPerformer = $user;
@@ -555,7 +557,13 @@
'newSize' => $newSize,
'pageStatus' => 'changed'
);
-   $rc->save();
+
+   DeferredUpdates::addCallableUpdate( function() use ( $rc ) {
+   $rc->save();
+   if ( $rc->mAttribs['rc_patrolled'] ) {
+   PatrolLog::record( $rc, true, 
$rc->getPerformer() );
+   }
+   } );
 
return $rc;
}
@@ -576,8 +584,10 @@
 * @param int $patrol
 * @return RecentChange
 */
-   public static function notifyNew( $timestamp, &$title, $minor, &$user, 
$comment, $bot,
-   $ip = '', $size = 0, $newId = 0, $patrol = 0 ) {
+   public static function notifyNew(
+   $timestamp, &$title, $minor, &$user, $comment, $bot,
+   $ip = '', $size = 0, $newId = 0, $patrol = 0
+   ) {
$rc = new RecentChange;
$rc->mTitle = $title;
$rc->mPerformer = $user;
@@ -614,7 +624,13 @@
'newSize' => $size,
'pageStatus' => 'created'
);
-   $rc->save();
+
+   DeferredUpdates::addCallableUpdate( function() use ( $rc ) {
+   $rc->save();
+   if ( $rc->mAttribs['rc_patrolled'] ) {
+   PatrolLog::record( $rc, true, 
$rc->getPerformer() );
+   }
+   } );
 
return $rc;
}
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index 022882a..83f6cfe 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -1835,17 +1835,13 @@
if ( !( $flags & EDIT_SUPPRESS_RC ) ) {
// Mark as patrolled if the user can do 
so
$patrolled = $wgUseRCPatrol && !count(
-   
$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
+   
$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
// Add RC row to the DB
-   $rc = RecentChange::notifyEdit( $now, 
$this->mTitle, $isminor, $user, $summary,
+   RecentChange::notifyEdit(
+   $now, $this->mTitle, $isminor, 
$user, $summary,
$oldid, $this->getTimestamp(), 
$bot, '', $oldsize, $newsize,
$revisionId, $patrolled
);
-
-   // Log auto-patrolled edits
-   if ( $patrolled ) {
-   PatrolLog::record( $rc, true, 
$user );
-   }
}
 
$user->incEditCount();
@@ -1936,13 +1932,10 @@
$patrolled = ( $wgUseRCPatrol || $wgUseNPPatrol 
) && !count(

$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
// Add RC row to the DB
-   $rc = RecentChange::notifyNew( $now, 
$this->mTi

[MediaWiki-commits] [Gerrit] Simplified doEditContent exception handling - change (mediawiki/core)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Simplified doEditContent exception handling
..

Simplified doEditContent exception handling

* Callers should not catch errors and fail to rollback
  changes as much here as anywhere else

Change-Id: I65cbeb8d0895223b7ad60c9081d703d14197cb4a
---
M includes/page/WikiPage.php
1 file changed, 107 insertions(+), 114 deletions(-)


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

diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index 18abe39..022882a 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -1692,6 +1692,7 @@
 * revision: The revision object for the inserted revision, or null.
 *
 * @since 1.21
+* @throws MWException
 */
public function doEditContent( Content $content, $summary, $flags = 0, 
$baseRevId = false,
User $user = null, $serialFormat = null
@@ -1803,56 +1804,52 @@
 
if ( $changed ) {
$dbw->begin( __METHOD__ );
-   try {
 
-   $prepStatus = $content->prepareSave( 
$this, $flags, $oldid, $user );
-   $status->merge( $prepStatus );
+   $prepStatus = $content->prepareSave( $this, 
$flags, $oldid, $user );
+   $status->merge( $prepStatus );
 
-   if ( !$status->isOK() ) {
-   $dbw->rollback( __METHOD__ );
-
-   return $status;
-   }
-   $revisionId = $revision->insertOn( $dbw 
);
-
-   // Update page
-   //
-   // We check for conflicts by comparing 
$oldid with the current latest revision ID.
-   $ok = $this->updateRevisionOn( $dbw, 
$revision, $oldid, $oldIsRedirect );
-
-   if ( !$ok ) {
-   // Belated edit conflict! Run 
away!!
-   $status->fatal( 'edit-conflict' 
);
-
-   $dbw->rollback( __METHOD__ );
-
-   return $status;
-   }
-
-   Hooks::run( 
'NewRevisionFromEditComplete', array( $this, $revision, $baseRevId, $user ) );
-   // Update recentchanges
-   if ( !( $flags & EDIT_SUPPRESS_RC ) ) {
-   // Mark as patrolled if the 
user can do so
-   $patrolled = $wgUseRCPatrol && 
!count(
-   
$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
-   // Add RC row to the DB
-   $rc = RecentChange::notifyEdit( 
$now, $this->mTitle, $isminor, $user, $summary,
-   $oldid, 
$this->getTimestamp(), $bot, '', $oldsize, $newsize,
-   $revisionId, $patrolled
-   );
-
-   // Log auto-patrolled edits
-   if ( $patrolled ) {
-   PatrolLog::record( $rc, 
true, $user );
-   }
-   }
-   $user->incEditCount();
-   } catch ( Exception $e ) {
+   if ( !$status->isOK() ) {
$dbw->rollback( __METHOD__ );
-   // Question: Would it perhaps be better 
if this method turned all
-   // exceptions into $status's?
-   throw $e;
+
+   return $status;
}
+   $revisionId = $revision->insertOn( $dbw );
+
+   // Update page
+   //
+   // We check for conflicts by comparing $oldid 
with the current latest revision ID.
+   $ok = $this->updateRevisionOn( $dbw, $revision, 
$oldid, $oldIsRedirect

[MediaWiki-commits] [Gerrit] Made RecentChange defer the save() method via DeferredUpdates - change (mediawiki/core)

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

Change subject: Made RecentChange defer the save() method via DeferredUpdates
..


Made RecentChange defer the save() method via DeferredUpdates

* Also made it handle calling PatrolLog::record() itself

Bug: T100042
Change-Id: I58ef060e02b89a5f9dadc0dbc4edba667932beda
(cherry picked from commit 97b2a1dfdafb20c428513c0dafdb5b96da2226d3)
---
M includes/changes/RecentChange.php
M includes/page/WikiPage.php
2 files changed, 29 insertions(+), 21 deletions(-)

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



diff --git a/includes/changes/RecentChange.php 
b/includes/changes/RecentChange.php
index aa210e3..7ea6777 100644
--- a/includes/changes/RecentChange.php
+++ b/includes/changes/RecentChange.php
@@ -517,8 +517,10 @@
 * @param int $patrol
 * @return RecentChange
 */
-   public static function notifyEdit( $timestamp, &$title, $minor, &$user, 
$comment, $oldId,
-   $lastTimestamp, $bot, $ip = '', $oldSize = 0, $newSize = 0, 
$newId = 0, $patrol = 0 ) {
+   public static function notifyEdit(
+   $timestamp, &$title, $minor, &$user, $comment, $oldId, 
$lastTimestamp,
+   $bot, $ip = '', $oldSize = 0, $newSize = 0, $newId = 0, $patrol 
= 0
+   ) {
$rc = new RecentChange;
$rc->mTitle = $title;
$rc->mPerformer = $user;
@@ -555,7 +557,13 @@
'newSize' => $newSize,
'pageStatus' => 'changed'
);
-   $rc->save();
+
+   DeferredUpdates::addCallableUpdate( function() use ( $rc ) {
+   $rc->save();
+   if ( $rc->mAttribs['rc_patrolled'] ) {
+   PatrolLog::record( $rc, true, 
$rc->getPerformer() );
+   }
+   } );
 
return $rc;
}
@@ -576,8 +584,10 @@
 * @param int $patrol
 * @return RecentChange
 */
-   public static function notifyNew( $timestamp, &$title, $minor, &$user, 
$comment, $bot,
-   $ip = '', $size = 0, $newId = 0, $patrol = 0 ) {
+   public static function notifyNew(
+   $timestamp, &$title, $minor, &$user, $comment, $bot,
+   $ip = '', $size = 0, $newId = 0, $patrol = 0
+   ) {
$rc = new RecentChange;
$rc->mTitle = $title;
$rc->mPerformer = $user;
@@ -614,7 +624,13 @@
'newSize' => $size,
'pageStatus' => 'created'
);
-   $rc->save();
+
+   DeferredUpdates::addCallableUpdate( function() use ( $rc ) {
+   $rc->save();
+   if ( $rc->mAttribs['rc_patrolled'] ) {
+   PatrolLog::record( $rc, true, 
$rc->getPerformer() );
+   }
+   } );
 
return $rc;
}
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index 71b3b79..5e4438a 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -1835,18 +1835,13 @@
if ( !( $flags & EDIT_SUPPRESS_RC ) ) {
// Mark as patrolled if the user can do 
so
$patrolled = $wgUseRCPatrol && !count(
-   
$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
-
+   
$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
// Add RC row to the DB
-   $rc = RecentChange::notifyEdit( $now, 
$this->mTitle, $isminor, $user, $summary,
+   RecentChange::notifyEdit(
+   $now, $this->mTitle, $isminor, 
$user, $summary,
$oldid, $this->getTimestamp(), 
$bot, '', $oldsize, $newsize,
$revisionId, $patrolled
);
-
-   // Log auto-patrolled edits
-   if ( $patrolled ) {
-   PatrolLog::record( $rc, true, 
$user );
-   }
}
 
$user->incEditCount();
@@ -1937,13 +1932,10 @@
$patrolled = ( $wgUseRCPatrol || $wgUseNPPatrol 
) && !count(

$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
// Add RC row to the DB
-   $rc = RecentChang

[MediaWiki-commits] [Gerrit] Move functions out of main php file and into hooks php file - change (mediawiki...LiquidThreads)

2015-05-22 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Move functions out of main php file and into hooks php file
..

Move functions out of main php file and into hooks php file

* In preperation for extension.json

Change-Id: I0383f845af006d13dc97d07738b1913a298df8e2
---
M LiquidThreads.php
D LqtFunctions.php
M classes/Hooks.php
M i18n/bs.json
M i18n/es.json
M i18n/pt-br.json
6 files changed, 80 insertions(+), 64 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/16/212816/1

diff --git a/LiquidThreads.php b/LiquidThreads.php
index d61abd6..e5abc58 100644
--- a/LiquidThreads.php
+++ b/LiquidThreads.php
@@ -11,12 +11,10 @@
'descriptionmsg' => 'lqt-desc',
 );
 
-require( 'LqtFunctions.php' );
-
-define( 'NS_LQT_THREAD', efArrayDefault( 'egLqtNamespaceNumbers', 'Thread', 90 
) );
-define( 'NS_LQT_THREAD_TALK', efArrayDefault( 'egLqtNamespaceNumbers', 
'Thread_talk', 91 ) );
-define( 'NS_LQT_SUMMARY', efArrayDefault( 'egLqtNamespaceNumbers', 'Summary', 
92 ) );
-define( 'NS_LQT_SUMMARY_TALK', efArrayDefault( 'egLqtNamespaceNumbers', 
'Summary_talk', 93 ) );
+define( 'NS_LQT_THREAD', LqtHooks::onEfArrayDefault( 'egLqtNamespaceNumbers', 
'Thread', 90 ) );
+define( 'NS_LQT_THREAD_TALK', LqtHooks::onEfArrayDefault( 
'egLqtNamespaceNumbers', 'Thread_talk', 91 ) );
+define( 'NS_LQT_SUMMARY', LqtHooks::onEfArrayDefault( 'egLqtNamespaceNumbers', 
'Summary', 92 ) );
+define( 'NS_LQT_SUMMARY_TALK', LqtHooks::onEfArrayDefault( 
'egLqtNamespaceNumbers', 'Summary_talk', 93 ) );
 define( 'LQT_NEWEST_CHANGES', 'nc' );
 define( 'LQT_NEWEST_THREADS', 'nt' );
 define( 'LQT_OLDEST_THREADS', 'ot' );
@@ -268,45 +266,7 @@
 $wgLiquidThreadsNotificationTypes = array( 'standard' );
 
 // Echo
-$wgExtensionFunctions[] = 'wfLiquidThreadsSetupEcho';
-
-function wfLiquidThreadsSetupEcho() {
-   // LiquidThreads echo notifications have not been fully tested,
-   // turn it off temporarily till expected behaviors are verified
-   /*
-   global $wgLiquidThreadsNotificationTypes;
-   global $wgEchoNotificationFormatters;
-   global $wgEchoEnabledEvents;
-
-   if ( isset( $wgEchoNotificationFormatters ) ) {
-   $wgLiquidThreadsNotificationTypes = array( 'echo' );
-
-   $wgEchoNotificationFormatters += array(
-   'lqt-new-topic' => array(
-   'class' => 'EchoLiquidThreadsFormatter',
-   'title-message' => 
'notification-add-talkpage-topic',
-   'title-params' => array( 'agent', 'subject', 
'title', 'content-page' ),
-   'content-message' => 
'notification-talkpage-content',
-   'content-params' => array( 'commentText' ),
-   'icon' => 'chat',
-   ),
-   'lqt-reply' => array(
-   'class' => 'EchoLiquidThreadsFormatter',
-   'title-message' => 'notification-add-comment',
-   'title-params' => array( 'agent', 'subject', 
'title', 'content-page' ),
-   'content-message' => 
'notification-talkpage-content',
-   'content-params' => array( 'commentText' ),
-   'icon' => 'chat',
-   ),
-   );
-
-   $wgEchoEnabledEvents = array_merge( $wgEchoEnabledEvents, array(
-   'lqt-new-topic',
-   'lqt-reply',
-   ) );
-   }
-   */
-}
+$wgExtensionFunctions[] = 'LqtHooks::onWfLiquidThreadsSetupEcho';
 
 // Path to the LQT directory
 $wgLiquidThreadsExtensionPath = "{$wgScriptPath}/extensions/LiquidThreads";
diff --git a/LqtFunctions.php b/LqtFunctions.php
deleted file mode 100644
index 65b5378..000
--- a/LqtFunctions.php
+++ /dev/null
@@ -1,16 +0,0 @@
- 'deleted'
);
 
+   public static function onWfLiquidThreadsSetupEcho() {
+   // LiquidThreads echo notifications have not been fully tested,
+   // turn it off temporarily till expected behaviors are verified
+   /*
+   global $wgLiquidThreadsNotificationTypes;
+   global $wgEchoNotificationFormatters;
+   global $wgEchoEnabledEvents;
+
+   if ( isset( $wgEchoNotificationFormatters ) ) {
+   $wgLiquidThreadsNotificationTypes = array( 'echo' );
+
+   $wgEchoNotificationFormatters += array(
+   'lqt-new-topic' => array(
+   'class' => 'EchoLiquidThreadsFormatter',
+   'title-message' => 
'notification-add-talkpage-topic',
+

[MediaWiki-commits] [Gerrit] Made RecentChange defer the save() method via DeferredUpdates - change (mediawiki/core)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Made RecentChange defer the save() method via DeferredUpdates
..

Made RecentChange defer the save() method via DeferredUpdates

* Also made it handle calling PatrolLog::record() itself

Bug: T100042
Change-Id: I58ef060e02b89a5f9dadc0dbc4edba667932beda
(cherry picked from commit 97b2a1dfdafb20c428513c0dafdb5b96da2226d3)
---
M includes/changes/RecentChange.php
M includes/page/WikiPage.php
2 files changed, 29 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/14/212814/1

diff --git a/includes/changes/RecentChange.php 
b/includes/changes/RecentChange.php
index aa210e3..7ea6777 100644
--- a/includes/changes/RecentChange.php
+++ b/includes/changes/RecentChange.php
@@ -517,8 +517,10 @@
 * @param int $patrol
 * @return RecentChange
 */
-   public static function notifyEdit( $timestamp, &$title, $minor, &$user, 
$comment, $oldId,
-   $lastTimestamp, $bot, $ip = '', $oldSize = 0, $newSize = 0, 
$newId = 0, $patrol = 0 ) {
+   public static function notifyEdit(
+   $timestamp, &$title, $minor, &$user, $comment, $oldId, 
$lastTimestamp,
+   $bot, $ip = '', $oldSize = 0, $newSize = 0, $newId = 0, $patrol 
= 0
+   ) {
$rc = new RecentChange;
$rc->mTitle = $title;
$rc->mPerformer = $user;
@@ -555,7 +557,13 @@
'newSize' => $newSize,
'pageStatus' => 'changed'
);
-   $rc->save();
+
+   DeferredUpdates::addCallableUpdate( function() use ( $rc ) {
+   $rc->save();
+   if ( $rc->mAttribs['rc_patrolled'] ) {
+   PatrolLog::record( $rc, true, 
$rc->getPerformer() );
+   }
+   } );
 
return $rc;
}
@@ -576,8 +584,10 @@
 * @param int $patrol
 * @return RecentChange
 */
-   public static function notifyNew( $timestamp, &$title, $minor, &$user, 
$comment, $bot,
-   $ip = '', $size = 0, $newId = 0, $patrol = 0 ) {
+   public static function notifyNew(
+   $timestamp, &$title, $minor, &$user, $comment, $bot,
+   $ip = '', $size = 0, $newId = 0, $patrol = 0
+   ) {
$rc = new RecentChange;
$rc->mTitle = $title;
$rc->mPerformer = $user;
@@ -614,7 +624,13 @@
'newSize' => $size,
'pageStatus' => 'created'
);
-   $rc->save();
+
+   DeferredUpdates::addCallableUpdate( function() use ( $rc ) {
+   $rc->save();
+   if ( $rc->mAttribs['rc_patrolled'] ) {
+   PatrolLog::record( $rc, true, 
$rc->getPerformer() );
+   }
+   } );
 
return $rc;
}
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index 71b3b79..5e4438a 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -1835,18 +1835,13 @@
if ( !( $flags & EDIT_SUPPRESS_RC ) ) {
// Mark as patrolled if the user can do 
so
$patrolled = $wgUseRCPatrol && !count(
-   
$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
-
+   
$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
// Add RC row to the DB
-   $rc = RecentChange::notifyEdit( $now, 
$this->mTitle, $isminor, $user, $summary,
+   RecentChange::notifyEdit(
+   $now, $this->mTitle, $isminor, 
$user, $summary,
$oldid, $this->getTimestamp(), 
$bot, '', $oldsize, $newsize,
$revisionId, $patrolled
);
-
-   // Log auto-patrolled edits
-   if ( $patrolled ) {
-   PatrolLog::record( $rc, true, 
$user );
-   }
}
 
$user->incEditCount();
@@ -1937,13 +1932,10 @@
$patrolled = ( $wgUseRCPatrol || $wgUseNPPatrol 
) && !count(

$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
// Add RC row to the DB
-

[MediaWiki-commits] [Gerrit] Added $res var docs for RevisionListBase - change (mediawiki/core)

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

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

Change subject: Added $res var docs for RevisionListBase
..

Added $res var docs for RevisionListBase

Change-Id: Ib71b9c662e68b64f1c6ad07c1902ed8ed432f175
---
M includes/RevisionList.php
M includes/revisiondelete/RevDelList.php
2 files changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/15/212815/1

diff --git a/includes/RevisionList.php b/includes/RevisionList.php
index 1cb43f7..e417473 100644
--- a/includes/RevisionList.php
+++ b/includes/RevisionList.php
@@ -30,6 +30,7 @@
/** @var array */
protected $ids;
 
+   /** @var ResultWrapper|bool */
protected $res;
 
/** @var bool|object */
diff --git a/includes/revisiondelete/RevDelList.php 
b/includes/revisiondelete/RevDelList.php
index f16fd15..7a3ddfe 100644
--- a/includes/revisiondelete/RevDelList.php
+++ b/includes/revisiondelete/RevDelList.php
@@ -92,7 +92,9 @@
$this->res = false;
$dbw = wfGetDB( DB_MASTER );
$this->doQuery( $dbw );
+
$dbw->startAtomic( __METHOD__ );
+
$status = Status::newGood();
$missing = array_flip( $this->ids );
$this->clearFileOps();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib71b9c662e68b64f1c6ad07c1902ed8ed432f175
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] Use __DIR__ - change (mediawiki...LiquidThreads)

2015-05-22 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Use __DIR__
..

Use __DIR__

Change-Id: I70f0ca4fc395e659064ae6270f34d00e5b048ac8
---
M LiquidThreads.php
M i18n/bs.json
M i18n/es.json
M i18n/pt-br.json
4 files changed, 79 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/13/212813/1

diff --git a/LiquidThreads.php b/LiquidThreads.php
index d61abd6..8442f71 100644
--- a/LiquidThreads.php
+++ b/LiquidThreads.php
@@ -22,12 +22,11 @@
 define( 'LQT_OLDEST_THREADS', 'ot' );
 
 // Localisation
-$dir = __DIR__;
 $wgMessagesDirs['LiquidThreads'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['LiquidThreads'] = $dir . '/i18n/Lqt.i18n.php';
-$wgExtensionMessagesFiles['LiquidThreadsMagic'] = $dir . 
'/i18n/LiquidThreads.magic.php';
-$wgExtensionMessagesFiles['LiquidThreadsNamespaces'] = $dir . 
'/i18n/Lqt.namespaces.php';
-$wgExtensionMessagesFiles['LiquidThreadsAlias'] = $dir . '/i18n/Lqt.alias.php';
+$wgExtensionMessagesFiles['LiquidThreads'] = __DIR__ . '/i18n/Lqt.i18n.php';
+$wgExtensionMessagesFiles['LiquidThreadsMagic'] = __DIR__ . 
'/i18n/LiquidThreads.magic.php';
+$wgExtensionMessagesFiles['LiquidThreadsNamespaces'] = __DIR__ . 
'/i18n/Lqt.namespaces.php';
+$wgExtensionMessagesFiles['LiquidThreadsAlias'] = __DIR__ . 
'/i18n/Lqt.alias.php';
 
 $lqtMessages = array(
'lqt-ajax-updated',
@@ -65,7 +64,7 @@
 
 // ResourceLoader
 $lqtResourceTemplate = array(
-   'localBasePath' => $dir,
+   'localBasePath' => __DIR__,
'remoteExtPath' => 'LiquidThreads'
 );
 
@@ -197,46 +196,46 @@
 $wgHooks['userCan'][] = 'LqtHooks::onGetUserPermissionsErrors';
 
 // Classes
-$wgAutoloadClasses['LqtDispatch'] = $dir . '/classes/Dispatch.php';
-$wgAutoloadClasses['LqtView'] = $dir . '/classes/View.php';
-$wgAutoloadClasses['HistoricalThread'] = $dir . 
'/classes/HistoricalThread.php';
-$wgAutoloadClasses['Thread'] = $dir . '/classes/Thread.php';
-$wgAutoloadClasses['Threads'] = $dir . '/classes/Threads.php';
-$wgAutoloadClasses['NewMessages'] = $dir . 
'/classes/NewMessagesController.php';
-$wgAutoloadClasses['EchoLiquidThreadsFormatter'] = 
"$dir/classes/EchoLiquidThreadsFormatter.php";
-$wgAutoloadClasses['LqtParserFunctions'] = $dir . 
'/classes/ParserFunctions.php';
-$wgAutoloadClasses['LqtDeletionController'] = $dir . 
'/classes/DeletionController.php';
-$wgAutoloadClasses['LqtHooks'] = $dir . '/classes/Hooks.php';
-$wgAutoloadClasses['ThreadRevision'] = $dir . '/classes/ThreadRevision.php';
-$wgAutoloadClasses['SynchroniseThreadArticleDataJob'] = $dir . 
'/classes/SynchroniseThreadArticleDataJob.php';
-$wgAutoloadClasses['ThreadHistoryPager'] = $dir . 
'/classes/ThreadHistoryPager.php';
-$wgAutoloadClasses['TalkpageHistoryView'] = $dir . 
'/pages/TalkpageHistoryView.php';
-$wgAutoloadClasses['LqtLogFormatter'] = $dir . '/classes/LogFormatter.php';
+$wgAutoloadClasses['LqtDispatch'] = __DIR__ . '/classes/Dispatch.php';
+$wgAutoloadClasses['LqtView'] = __DIR__ . '/classes/View.php';
+$wgAutoloadClasses['HistoricalThread'] = __DIR__ . 
'/classes/HistoricalThread.php';
+$wgAutoloadClasses['Thread'] = __DIR__ . '/classes/Thread.php';
+$wgAutoloadClasses['Threads'] = __DIR__ . '/classes/Threads.php';
+$wgAutoloadClasses['NewMessages'] = __DIR__ . 
'/classes/NewMessagesController.php';
+$wgAutoloadClasses['EchoLiquidThreadsFormatter'] = 
"__DIR__/classes/EchoLiquidThreadsFormatter.php";
+$wgAutoloadClasses['LqtParserFunctions'] = __DIR__ . 
'/classes/ParserFunctions.php';
+$wgAutoloadClasses['LqtDeletionController'] = __DIR__ . 
'/classes/DeletionController.php';
+$wgAutoloadClasses['LqtHooks'] = __DIR__ . '/classes/Hooks.php';
+$wgAutoloadClasses['ThreadRevision'] = __DIR__ . '/classes/ThreadRevision.php';
+$wgAutoloadClasses['SynchroniseThreadArticleDataJob'] = __DIR__ . 
'/classes/SynchroniseThreadArticleDataJob.php';
+$wgAutoloadClasses['ThreadHistoryPager'] = __DIR__ . 
'/classes/ThreadHistoryPager.php';
+$wgAutoloadClasses['TalkpageHistoryView'] = __DIR__ . 
'/pages/TalkpageHistoryView.php';
+$wgAutoloadClasses['LqtLogFormatter'] = __DIR__ . '/classes/LogFormatter.php';
 
 // View classes
-$wgAutoloadClasses['TalkpageView'] = $dir . '/pages/TalkpageView.php';
-$wgAutoloadClasses['ThreadPermalinkView'] = $dir . 
'/pages/ThreadPermalinkView.php';
-$wgAutoloadClasses['TalkpageHeaderView'] = $dir . 
'/pages/TalkpageHeaderView.php';
-$wgAutoloadClasses['IndividualThreadHistoryView'] = $dir . 
'/pages/IndividualThreadHistoryView.php';
-$wgAutoloadClasses['ThreadDiffView'] = $dir . '/pages/ThreadDiffView.php';
-$wgAutoloadClasses['ThreadWatchView'] = $dir . '/pages/ThreadWatchView.php';
-$wgAutoloadClasses['ThreadProtectionFormView'] = $dir . 
'/pages/ThreadProtectionFormView.php';
-$wgAutoloadClasses['ThreadHistoryListingView'] = $dir . 
'/pages/ThreadHistoryListingView.php';
-$wgAutoloadClasses['ThreadHistoricalRe

[MediaWiki-commits] [Gerrit] Move the LiquidThreads.x.php i18n files - change (mediawiki...LiquidThreads)

2015-05-22 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Move the LiquidThreads.x.php i18n files
..

Move the LiquidThreads.x.php i18n files

Change-Id: If37f30108154c7f0e5adb46ad5de8cdfd4dd650c
---
R LiquidThreads.magic.php
R Lqt.alias.php
R Lqt.namespaces.php
M i18n/bs.json
M i18n/es.json
M i18n/pt-br.json
6 files changed, 37 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/12/212812/1

diff --git a/i18n/LiquidThreads.magic.php b/LiquidThreads.magic.php
similarity index 100%
rename from i18n/LiquidThreads.magic.php
rename to LiquidThreads.magic.php
diff --git a/i18n/Lqt.alias.php b/Lqt.alias.php
similarity index 100%
rename from i18n/Lqt.alias.php
rename to Lqt.alias.php
diff --git a/i18n/Lqt.namespaces.php b/Lqt.namespaces.php
similarity index 100%
rename from i18n/Lqt.namespaces.php
rename to Lqt.namespaces.php
diff --git a/i18n/bs.json b/i18n/bs.json
index bc2e02a..fd1d77a 100644
--- a/i18n/bs.json
+++ b/i18n/bs.json
@@ -1,7 +1,8 @@
 {
"@metadata": {
"authors": [
-   "CERminator"
+   "CERminator",
+   "KWiki"
]
},
"lqt-desc": "Dodaj nizane diskusije stranicama za razgovor",
@@ -53,7 +54,7 @@
"lqt_change_edited_summary": "Sažetak niza je uređivan",
"lqt_change_deleted": "[$1 Ovaj niz] ili odgovor na njega je obrisan",
"lqt_change_undeleted": "[$1 Označeni post] je vraćen",
-   "lqt_change_moved": "[$1 Ovaj niz] je premješten na drugu stranicu za 
razgovor",
+   "lqt_change_moved": "[$1 Ovaj niz] premješten je na drugu stranicu za 
razgovor.",
"lqt_change_split": "[$1 Ovaj niz] je podijeljeni dio iz drugog niza",
"lqt_change_edited_subject": "Tema ovog niza je promijenjena sa \"$2\" 
na \"$3\"",
"lqt_change_merged_from": "[$1 Odgovor] na ovaj niz je premješten u 
drugi niz",
diff --git a/i18n/es.json b/i18n/es.json
index 5f39f5f..2b90a4d 100644
--- a/i18n/es.json
+++ b/i18n/es.json
@@ -254,6 +254,7 @@
"lqt-edit-bump-tooltip": "Trasladar este hilo a la parte superior de su 
página de discusión",
"lqt-historicalrevision-error": "La revisión seleccionada está dañada, 
y no puede visualizarse.",
"lqt-reply-subpage": "responder",
+   "lqt-pagechange-editformopen": "Tienes abierto texto sin guardar en 
esta página. Si te vas, puedes perderlo.",
"nstab-thread": "Hilo",
"nstab-summary": "Resumen",
"echo-pref-email-lqt-new-topic": "Crea un nuevo hilo de discusión",
@@ -261,8 +262,20 @@
"pageinfo-usinglqt": "Hilos de discusión activados",
"pageinfo-usinglqt-yes": "Sí",
"apihelp-feedthreads-param-feedformat": "El formato del canal.",
+   "apihelp-feedthreads-param-type": "Tipos de publicaciones que mostrar.",
+   "apihelp-feedthreads-param-talkpage": "Limitar los resultados a hilos 
en estas páginas de discusión.",
+   "apihelp-feedthreads-param-thread": "Limitar los resultados a estos 
hilos y sus descendientes.",
+   "apihelp-query+threads-description": "Mostrar detalles de hilos 
LiquidThreads.",
+   "apihelp-query+threads-param-limit": "El número máximo de hilos que 
listar.",
"apihelp-query+threads-param-prop": "Qué propiedades obtener.",
+   "apihelp-query+threads-param-page": "Limitar los resultados a hilos en 
estas páginas.",
+   "apihelp-query+threads-param-author": "Limitar los resultados a hilos 
de determinados autores.",
+   "apihelp-query+threads-param-summary": "Limitar los resultados a hilos 
correspondientes a las páginas de resumen especificadas.",
+   "apihelp-query+threads-param-id": "Obtener hilos con los 
identificadores especificados.",
"apihelp-query+threads-example-1": "Listar hilos en [[Talk:Main Page]]",
"apihelp-query+threads-example-2": "Listar hilos con las ID 1, 2, 3 y 
4",
+   "apihelp-threadaction-param-thread": "Identificadores o títulos de 
hilos sobre los cuales actuar.",
+   "apihelp-threadaction-param-threadaction": "La acción que tomar.",
+   "apihelp-threadaction-param-text": "El texto de la publicación que 
crear.",
"apihelp-threadaction-param-captchaword": "Respuesta al CAPTCHA."
 }
diff --git a/i18n/pt-br.json b/i18n/pt-br.json
index 3222eff..c9fe2e8 100644
--- a/i18n/pt-br.json
+++ b/i18n/pt-br.json
@@ -247,5 +247,25 @@
"echo-pref-email-lqt-reply": "Responde a uma discussão em tópicos",
"pageinfo-usinglqt": "Discussão em tópicos ativada",
"pageinfo-usinglqt-yes": "Sim",
-   "apihelp-feedthreads-param-feedformat": "O formato do feed."
+   "apihelp-feedthreads-param-feedformat": "O formato do feed.",
+   "apihelp-feedthreads-param-days": "Número de dias de tópicos para 
mostrar.",
+   "apihelp-feedthreads-param-type": "Tipo

[MediaWiki-commits] [Gerrit] Made RecentChange defer the save() method via DeferredUpdates - change (mediawiki/core)

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

Change subject: Made RecentChange defer the save() method via DeferredUpdates
..


Made RecentChange defer the save() method via DeferredUpdates

* Also made it handle calling PatrolLog::record() itself

Bug: T100042
Change-Id: I58ef060e02b89a5f9dadc0dbc4edba667932beda
---
M includes/changes/RecentChange.php
M includes/page/WikiPage.php
2 files changed, 29 insertions(+), 21 deletions(-)

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



diff --git a/includes/changes/RecentChange.php 
b/includes/changes/RecentChange.php
index aa210e3..7ea6777 100644
--- a/includes/changes/RecentChange.php
+++ b/includes/changes/RecentChange.php
@@ -517,8 +517,10 @@
 * @param int $patrol
 * @return RecentChange
 */
-   public static function notifyEdit( $timestamp, &$title, $minor, &$user, 
$comment, $oldId,
-   $lastTimestamp, $bot, $ip = '', $oldSize = 0, $newSize = 0, 
$newId = 0, $patrol = 0 ) {
+   public static function notifyEdit(
+   $timestamp, &$title, $minor, &$user, $comment, $oldId, 
$lastTimestamp,
+   $bot, $ip = '', $oldSize = 0, $newSize = 0, $newId = 0, $patrol 
= 0
+   ) {
$rc = new RecentChange;
$rc->mTitle = $title;
$rc->mPerformer = $user;
@@ -555,7 +557,13 @@
'newSize' => $newSize,
'pageStatus' => 'changed'
);
-   $rc->save();
+
+   DeferredUpdates::addCallableUpdate( function() use ( $rc ) {
+   $rc->save();
+   if ( $rc->mAttribs['rc_patrolled'] ) {
+   PatrolLog::record( $rc, true, 
$rc->getPerformer() );
+   }
+   } );
 
return $rc;
}
@@ -576,8 +584,10 @@
 * @param int $patrol
 * @return RecentChange
 */
-   public static function notifyNew( $timestamp, &$title, $minor, &$user, 
$comment, $bot,
-   $ip = '', $size = 0, $newId = 0, $patrol = 0 ) {
+   public static function notifyNew(
+   $timestamp, &$title, $minor, &$user, $comment, $bot,
+   $ip = '', $size = 0, $newId = 0, $patrol = 0
+   ) {
$rc = new RecentChange;
$rc->mTitle = $title;
$rc->mPerformer = $user;
@@ -614,7 +624,13 @@
'newSize' => $size,
'pageStatus' => 'created'
);
-   $rc->save();
+
+   DeferredUpdates::addCallableUpdate( function() use ( $rc ) {
+   $rc->save();
+   if ( $rc->mAttribs['rc_patrolled'] ) {
+   PatrolLog::record( $rc, true, 
$rc->getPerformer() );
+   }
+   } );
 
return $rc;
}
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index 71b3b79..5e4438a 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -1835,18 +1835,13 @@
if ( !( $flags & EDIT_SUPPRESS_RC ) ) {
// Mark as patrolled if the user can do 
so
$patrolled = $wgUseRCPatrol && !count(
-   
$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
-
+   
$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
// Add RC row to the DB
-   $rc = RecentChange::notifyEdit( $now, 
$this->mTitle, $isminor, $user, $summary,
+   RecentChange::notifyEdit(
+   $now, $this->mTitle, $isminor, 
$user, $summary,
$oldid, $this->getTimestamp(), 
$bot, '', $oldsize, $newsize,
$revisionId, $patrolled
);
-
-   // Log auto-patrolled edits
-   if ( $patrolled ) {
-   PatrolLog::record( $rc, true, 
$user );
-   }
}
 
$user->incEditCount();
@@ -1937,13 +1932,10 @@
$patrolled = ( $wgUseRCPatrol || $wgUseNPPatrol 
) && !count(

$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
// Add RC row to the DB
-   $rc = RecentChange::notifyNew( $now, 
$this->mTitle, $isminor, $user, $summary, $bot,

[MediaWiki-commits] [Gerrit] Remove i18n shim - change (mediawiki...LiquidThreads)

2015-05-22 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Remove i18n shim
..

Remove i18n shim

Change-Id: I167639689ba6dd4db069ef64fb151e5d362cd8d5
---
D i18n/Lqt.i18n.php
M i18n/bs.json
M i18n/es.json
M i18n/pt-br.json
4 files changed, 37 insertions(+), 38 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/11/212811/1

diff --git a/i18n/Lqt.i18n.php b/i18n/Lqt.i18n.php
deleted file mode 100644
index 77039c4..000
--- a/i18n/Lqt.i18n.php
+++ /dev/null
@@ -1,35 +0,0 @@
-https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
- *
- * Beginning with MediaWiki 1.23, translation strings are stored in json files,
- * and the EXTENSION.i18n.php file only exists to provide compatibility with
- * older releases of MediaWiki. For more information about this migration, see:
- * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
- *
- * This shim maintains compatibility back to MediaWiki 1.17.
- */
-$messages = array();
-if ( !function_exists( 'wfJsonI18nShim81e52cd9a5766eb0' ) ) {
-   function wfJsonI18nShim81e52cd9a5766eb0( $cache, $code, &$cachedData ) {
-   $codeSequence = array_merge( array( $code ), 
$cachedData['fallbackSequence'] );
-   foreach ( $codeSequence as $csCode ) {
-   $fileName = dirname( __FILE__ ) . "/$csCode.json";
-   if ( is_readable( $fileName ) ) {
-   $data = FormatJson::decode( file_get_contents( 
$fileName ), true );
-   foreach ( array_keys( $data ) as $key ) {
-   if ( $key === '' || $key[0] === '@' ) {
-   unset( $data[$key] );
-   }
-   }
-   $cachedData['messages'] = array_merge( $data, 
$cachedData['messages'] );
-   }
-
-   $cachedData['deps'][] = new FileDependency( $fileName );
-   }
-   return true;
-   }
-
-   $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 
'wfJsonI18nShim81e52cd9a5766eb0';
-}
diff --git a/i18n/bs.json b/i18n/bs.json
index bc2e02a..fd1d77a 100644
--- a/i18n/bs.json
+++ b/i18n/bs.json
@@ -1,7 +1,8 @@
 {
"@metadata": {
"authors": [
-   "CERminator"
+   "CERminator",
+   "KWiki"
]
},
"lqt-desc": "Dodaj nizane diskusije stranicama za razgovor",
@@ -53,7 +54,7 @@
"lqt_change_edited_summary": "Sažetak niza je uređivan",
"lqt_change_deleted": "[$1 Ovaj niz] ili odgovor na njega je obrisan",
"lqt_change_undeleted": "[$1 Označeni post] je vraćen",
-   "lqt_change_moved": "[$1 Ovaj niz] je premješten na drugu stranicu za 
razgovor",
+   "lqt_change_moved": "[$1 Ovaj niz] premješten je na drugu stranicu za 
razgovor.",
"lqt_change_split": "[$1 Ovaj niz] je podijeljeni dio iz drugog niza",
"lqt_change_edited_subject": "Tema ovog niza je promijenjena sa \"$2\" 
na \"$3\"",
"lqt_change_merged_from": "[$1 Odgovor] na ovaj niz je premješten u 
drugi niz",
diff --git a/i18n/es.json b/i18n/es.json
index 5f39f5f..2b90a4d 100644
--- a/i18n/es.json
+++ b/i18n/es.json
@@ -254,6 +254,7 @@
"lqt-edit-bump-tooltip": "Trasladar este hilo a la parte superior de su 
página de discusión",
"lqt-historicalrevision-error": "La revisión seleccionada está dañada, 
y no puede visualizarse.",
"lqt-reply-subpage": "responder",
+   "lqt-pagechange-editformopen": "Tienes abierto texto sin guardar en 
esta página. Si te vas, puedes perderlo.",
"nstab-thread": "Hilo",
"nstab-summary": "Resumen",
"echo-pref-email-lqt-new-topic": "Crea un nuevo hilo de discusión",
@@ -261,8 +262,20 @@
"pageinfo-usinglqt": "Hilos de discusión activados",
"pageinfo-usinglqt-yes": "Sí",
"apihelp-feedthreads-param-feedformat": "El formato del canal.",
+   "apihelp-feedthreads-param-type": "Tipos de publicaciones que mostrar.",
+   "apihelp-feedthreads-param-talkpage": "Limitar los resultados a hilos 
en estas páginas de discusión.",
+   "apihelp-feedthreads-param-thread": "Limitar los resultados a estos 
hilos y sus descendientes.",
+   "apihelp-query+threads-description": "Mostrar detalles de hilos 
LiquidThreads.",
+   "apihelp-query+threads-param-limit": "El número máximo de hilos que 
listar.",
"apihelp-query+threads-param-prop": "Qué propiedades obtener.",
+   "apihelp-query+threads-param-page": "Limitar los resultados a hilos en 
estas páginas.",
+   "apihelp-query+threads-param-author": "Limitar los resultados a hilos 
de determinados autores.",

[MediaWiki-commits] [Gerrit] Update the version, create release notes - change (mediawiki...MobileFrontend)

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

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

Change subject: Update the version, create release notes
..

Update the version, create release notes

* The new version is 1.1.0
* Update the documentation to correct the IRC channel name

Change-Id: Ib46a0efc2859c46f8d14e1c3a09db982413527a7
---
M README.mediawiki
A RELEASE-NOTES-1.1.0.mediawiki
2 files changed, 210 insertions(+), 1 deletion(-)


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

diff --git a/README.mediawiki b/README.mediawiki
index b37eba2..cd0e975 100644
--- a/README.mediawiki
+++ b/README.mediawiki
@@ -73,7 +73,7 @@
 is the software version. Once a new release is due, the contents of the above 
file is moved to
 HISTORY.mediawiki and the file itself is deleted.
 Ideally, we need to create a bot similar to 
https://wikitech.wikimedia.org/wiki/Jouncebot that
-reads a calendar and pings a developer on #wikimedia-mobile to remind them 
about a release.
+reads a calendar and pings a developer on #wikimedia-dev to remind them about 
a release.
 
 Generating release notes
 You can generate release notes by running (replace `{ branch name / commit 
SHA}`):
diff --git a/RELEASE-NOTES-1.1.0.mediawiki b/RELEASE-NOTES-1.1.0.mediawiki
new file mode 100644
index 000..3698392
--- /dev/null
+++ b/RELEASE-NOTES-1.1.0.mediawiki
@@ -0,0 +1,209 @@
+== MobileFrontend 1.1.0 / 2015-05-22 ==
+
+* (T98925) Alpha, Beta: Center-align the last-modified bar on tablets
+* Enable experiments for anons
+* Hygiene: quick lookup -> resources
+* (T96404) Make the banner image clickable
+* Hygiene: Change module name so it's easier to locate to things outside 
MobileFrontend
+* Hygiene: Merge all stable initialisation scripts into one single file
+* Hygiene: Move mobile.issues files to resources
+* Hygiene: Move toggle code to resources folder
+* Hygiene: error report modules -> resources
+* Hygiene: mobile.contentOverlays => resources
+* Hygiene: Move external files to resources folder
+* Hygiene: Move reference code to resources folder
+* (T98385) Alpha, Beta: Make banners center-aligned
+* (T96327) Alpha, Beta: Make overlays center-aligned
+* (T96332) Alpha, Beta: Make Special:Watchlist and Special:Nearby contents 
center-aligned
+* (T96317) Alpha, Beta: Make the header center-aligned on tablet
+* Remove an unneeded use of SITENAME
+* Deal with undefined wgMFMenuData
+* (T97067) Add support for future toasts
+* (T99669) Prevent navigating back on QUnit tests
+* (T98964, T98759) Support for cached menu data in HTML
+* Hygiene: Move notifications code to resources/
+* (T88949, T94194) Use mediawiki.confirmCloseWindow
+* Fix "Create account password mismatch message" test
+* Replace deprecated $wgSpecialPageGroups
+* (T99154) Add login and signup urls to the editor overlay for anons
+* Hygiene: Remove classes that are no longer cached
+* (T99104) Browse: output articles in designated order
+* (T98867) Remove deprecated RL modules
+* (T98874, T98402) Remove uploads
+* Hygiene: Reorganise mobile.head modules
+* Hygiene: More reorganisation of folders
+* (T98838) Hygiene: Move editor to resources
+* Clarify scope of action-mf-uploadbutton
+* Hygiene: Address all cache related FIXMEs
+* Hygiene: Remove dead code in editor init.js.
+* (T98871) Load icons only needed in JS via JS
+* (T98815) Don't show beta panel in special page
+* (T98840) TWN: Fix mobile-frontend-editor-previewing-page truncated text
+* (T96866) Update WatchListApi API query continuation
+* (T98870) Load MobileDiff icons on the special page
+* (T98833) Request "small" images in PhotoListApi#getQuery
+* (T96866) Update PhotoListApi API query continuation
+* (T98859) Load main menu styles via JS
+* (T98869) Hygiene: Move main menu icons to the main menu module
+* Hygiene: Remove unused stub class
+* (T98759) Show the logout link
+* (T98399) Only load inputs-box styles on login page
+* Hygiene: Move site-specific configs to Site.php and improve documentation
+* Hygiene: Beta scripts/styles -> resources
+* (T98473) Only load the icons needed for the main chrome in head
+* (T98530) Make Skin work correctly when run from the head of the document
+* (T98482) Add missing image
+* Hygiene: Introduce hooks on user dashboard page
+* Update CSS to accomodate latest collections
+* Hygiene: Stop logging in watchstar tests
+* (T98377) Hygiene: Make WatchListApi tests synchronous
+* Hygiene: Generate user dashboard via server side template
+* (T98377) Disable router tests until proper fix
+* (T98007) Use formatversion=2 where it fixes errors we manually work around
+* (T98594) Adding mobile.settings as dependency for mobile.startup
+* Remove unused less/images/close-button-beta.png
+* (T66565) Style mw.notify in the same way as toasts
+* (T97495) Correctly extract sections from headings
+* Fix Notice: Undefined index: title error
+* (T97460) Fixing br

[MediaWiki-commits] [Gerrit] Test a GlobalCollect API response - change (mediawiki...DonationInterface)

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

Change subject: Test a GlobalCollect API response
..


Test a GlobalCollect API response

And make it possible to get test init data without an instance of
DonationInterfaceTestCase.

Change-Id: I029b9d1a0118b8c39c8e4b6808511eca4f787a2e
---
A tests/Adapter/GlobalCollect/GlobalCollectApiTest.php
M tests/Adapter/GlobalCollect/GlobalCollectTest.php
M tests/Adapter/WorldPay/WorldPayTest.php
M tests/DonationDataTest.php
M tests/DonationInterfaceTestCase.php
5 files changed, 50 insertions(+), 20 deletions(-)

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



diff --git a/tests/Adapter/GlobalCollect/GlobalCollectApiTest.php 
b/tests/Adapter/GlobalCollect/GlobalCollectApiTest.php
new file mode 100644
index 000..31ede5a
--- /dev/null
+++ b/tests/Adapter/GlobalCollect/GlobalCollectApiTest.php
@@ -0,0 +1,30 @@
+doApiRequest( $init );
+   $result = $apiResult[0]['result'];
+   $orderId = $result['orderid'];
+
+   $this->assertEquals( 'url_placeholder', $result['formaction'], 
'GC API not setting formaction' );
+   $this->assertTrue( is_numeric( $orderId ), 'GC API not setting 
numeric order ID' );
+   $this->assertTrue( $result['status'], 'GC API result status 
should be true' );
+   preg_match( 
"/Special:GlobalCollectGatewayResult\?order_id={$orderId}\$/", 
$result['returnurl'], $match );
+   $this->assertNotEmpty( $match, 'GC API not setting proper 
return url' );
+   }
+}
diff --git a/tests/Adapter/GlobalCollect/GlobalCollectTest.php 
b/tests/Adapter/GlobalCollect/GlobalCollectTest.php
index 127fb0a..7c71263 100644
--- a/tests/Adapter/GlobalCollect/GlobalCollectTest.php
+++ b/tests/Adapter/GlobalCollect/GlobalCollectTest.php
@@ -48,7 +48,7 @@
 * @covers GatewayAdapter::normalizeOrderID
 */
public function testNormalizeOrderID() {
-   $init = $this->initial_vars;
+   $init = self::$initial_vars;
unset( $init['order_id'] );
 
//no order_id from anywhere, explicit no generate
@@ -104,7 +104,7 @@
 * @covers GatewayAdapter::regenerateOrderID
 */
function testStickyGeneratedOrderID() {
-   $init = $this->initial_vars;
+   $init = self::$initial_vars;
unset( $init['order_id'] );
 
//no order_id from anywhere, explicit generate
@@ -274,7 +274,7 @@
 */
public function testDefineVarMap() {
 
-   $gateway = $this->getFreshGatewayObject( $this->initial_vars );
+   $gateway = $this->getFreshGatewayObject( self::$initial_vars );
 
$var_map = array(
'ORDERID' => 'order_id',
diff --git a/tests/Adapter/WorldPay/WorldPayTest.php 
b/tests/Adapter/WorldPay/WorldPayTest.php
index 9c4dde8..08754ec 100644
--- a/tests/Adapter/WorldPay/WorldPayTest.php
+++ b/tests/Adapter/WorldPay/WorldPayTest.php
@@ -349,7 +349,7 @@
 * Check that whacky #.# format orderid is unmolested by order_id_meta 
validation.
 */
function testWackyOrderIdPassedValidation() {
-   $init = $this->initial_vars;
+   $init = self::$initial_vars;
 
 $init['order_id'] = '2143.0';
 unset( $_POST['order_id'] );
@@ -363,7 +363,7 @@
 * Check that order_id is built from contribution_tracking id.
 */
function testWackyOrderIdBasedOnContributionTracking() {
-   $init = $this->initial_vars;
+   $init = self::$initial_vars;
 
 $init['contribution_tracking_id'] = mt_rand();
 $_SESSION['numAttempt'] = 2;
diff --git a/tests/DonationDataTest.php b/tests/DonationDataTest.php
index b6e8d94..2a0dbd4 100644
--- a/tests/DonationDataTest.php
+++ b/tests/DonationDataTest.php
@@ -84,7 +84,7 @@
public function testConstruct(){
global $wgLanguageCode, $wgRequest;
 
-   $ddObj = new DonationData( $this->getFreshGatewayObject( 
$this->initial_vars ) ); //as if we were posted.
+   $ddObj = new DonationData( $this->getFreshGatewayObject( 
self::$initial_vars ) ); //as if we were posted.
$returned = $ddObj->getDataEscaped();
$expected = array(  'posted' => '',
'amount' => '0.00',
@@ -147,7 +147,7 @@
'recurring' => '',
);
 
-   $ddObj = new DonationData( $this->getFreshGatewayObject( 
$this->initial_vars ), $expected ); //external data
+   $ddObj = new DonationData( $this->getFreshGatewayObject( 
self::$initial_vars ), $expected ); //external data
$returned = $ddObj->getDataEscaped();
 
 
@@ -199,7 +199,7 @@
 
$this->setMwGlobals( 'wgRequest', new FauxRequest( $expected, 
false ) );
 
-   $ddOb

[MediaWiki-commits] [Gerrit] Minor cleanup - change (mediawiki...DonationInterface)

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

Change subject: Minor cleanup
..


Minor cleanup

Change-Id: If01a7427b588552061234520df379ec1f56fb5c3
---
M gateway_common/PaymentResult.php
M gateway_common/donation.api.php
M globalcollect_gateway/globalcollect.adapter.php
3 files changed, 6 insertions(+), 5 deletions(-)

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



diff --git a/gateway_common/PaymentResult.php b/gateway_common/PaymentResult.php
index 739b36d..cc52e6f 100644
--- a/gateway_common/PaymentResult.php
+++ b/gateway_common/PaymentResult.php
@@ -109,11 +109,11 @@
 * @param PaymentTransactionResponse $response processed response object
 * @param string $finalStatus final transaction status.
 */
-   static public function fromResults( $response, $finalStatus ) {
+   static public function fromResults( PaymentTransactionResponse 
$response, $finalStatus ) {
if ( $finalStatus === FinalStatus::FAILED ) {
return PaymentResult::newFailure();
}
-   if ( !( $response ) ) {
+   if ( !$response ) {
return PaymentResult::newEmpty();
}
if ( $response->getErrors() ) {
diff --git a/gateway_common/donation.api.php b/gateway_common/donation.api.php
index dac3ea1..e7f21cd 100644
--- a/gateway_common/donation.api.php
+++ b/gateway_common/donation.api.php
@@ -55,8 +55,8 @@
$data = $result->getData();
if ( !empty( $data ) ) {
if ( array_key_exists( 'PAYMENT', $data )
-   && array_key_exists( 'RETURNURL', 
$data['PAYMENT'] ) )
-   {
+   && array_key_exists( 'RETURNURL', 
$data['PAYMENT'] )
+   ) {
$outputResult['returnurl'] = 
$data['PAYMENT']['RETURNURL'];
}
if ( array_key_exists( 'FORMACTION', $data ) ) {
@@ -80,6 +80,7 @@
$simplify = function( $error ) {
return $error['message'];
};
+   // TODO:objectify errors, decide here whether to 
include debug info
$outputResult['errors'] = array_map( $simplify, $errors 
);
$this->getResult()->setIndexedTagName( 
$outputResult['errors'], 'error' );
}
diff --git a/globalcollect_gateway/globalcollect.adapter.php 
b/globalcollect_gateway/globalcollect.adapter.php
index a45b1c6..0520a97 100644
--- a/globalcollect_gateway/globalcollect.adapter.php
+++ b/globalcollect_gateway/globalcollect.adapter.php
@@ -1155,7 +1155,7 @@
 
/**
 * Either confirm or reject the payment
-* @global WebRequst $wgRequest
+* @global WebRequest $wgRequest
 * @return PaymentTransactionResponse
 */
private function transactionConfirm_CreditCard(){

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If01a7427b588552061234520df379ec1f56fb5c3
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Ssmith 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Fix a few values in Engage import test - change (wikimedia...crm)

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

Change subject: Fix a few values in Engage import test
..


Fix a few values in Engage import test

Razing Arizona

Change-Id: I1e3030f1cddca4c31cd38170a577783df7013656
---
M sites/all/modules/offline2civicrm/tests/EngageChecksFileTest.php
1 file changed, 7 insertions(+), 7 deletions(-)

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



diff --git a/sites/all/modules/offline2civicrm/tests/EngageChecksFileTest.php 
b/sites/all/modules/offline2civicrm/tests/EngageChecksFileTest.php
index 078ac6d..3942bd1 100644
--- a/sites/all/modules/offline2civicrm/tests/EngageChecksFileTest.php
+++ b/sites/all/modules/offline2civicrm/tests/EngageChecksFileTest.php
@@ -10,7 +10,7 @@
 function testParseRow_Individual() {
 $data = array(
 'Batch' => '1234',
-'Contribution Type' => 'Arizona Lockbox',
+'Contribution Type' => 'Engage',
 'Total Amount' => '50',
 'Source' => 'USD 50.00',
 'Postmark Date' => '',
@@ -48,15 +48,15 @@
 'direct_mail_appeal' => 'White Mail',
 'email' => 'nob...@wikimedia.org',
 'first_name' => 'Sub',
-'gateway' => 'arizonalockbox',
+'gateway' => 'engage',
 'gateway_txn_id' => 'e59ed825ea04516fb2abf1c130d47525',
 'gift_source' => 'Community Gift',
-'gross' => '50.00',
+'gross' => 50.00,
 'import_batch_number' => '1234',
 'last_name' => 'Tell',
 'payment_method' => 'Check',
 'postal_code' => '02468',
-'raw_contribution_type' => 'Arizona Lockbox',
+'raw_contribution_type' => 'Engage',
 'restrictions' => 'Unrestricted - General',
 'state_province' => 'MA',
 'street_address' => '1000 Markdown Markov',
@@ -73,7 +73,7 @@
 function testParseRow_Organization() {
 $data = array(
 'Batch' => '1235',
-'Contribution Type' => 'Arizona Lockbox',
+'Contribution Type' => 'Engage',
 'Total Amount' => '51',
 'Source' => 'USD 51.00',
 'Postmark Date' => '',
@@ -107,7 +107,7 @@
 'date' => 1396335600,
 'direct_mail_appeal' => 'White Mail',
 'email' => 'nob...@wikimedia.org',
-'gateway' => 'arizonalockbox',
+'gateway' => 'engage',
 'gateway_txn_id' => '6dbb8d844c7509076e2a275fb76d0130',
 'gift_source' => 'Foundation Gift',
 'gross' => 51.00,
@@ -115,7 +115,7 @@
 'organization_name' => 'One Pacific Entitlement',
 'payment_method' => 'Check',
 'postal_code' => '123-LAX',
-'raw_contribution_type' => 'Arizona Lockbox',
+'raw_contribution_type' => 'Engage',
 'restrictions' => 'Restricted-Foundation',
 'state_province' => 'MA',
 'street_address' => '1000 Markdown Markov',

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

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

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


[MediaWiki-commits] [Gerrit] [DO NOT MERGE] Acralyzer demo - change (apps...wikipedia)

2015-05-22 Thread Mholloway (Code Review)
Mholloway has uploaded a new change for review.

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

Change subject: [DO NOT MERGE] Acralyzer demo
..

[DO NOT MERGE] Acralyzer demo

This patch is to demo moving to an Acralyzer back-end to collect and analyze 
crash reports.

Trigger an intentional with this patch crash by starting a GalleryActivity.  
Feel free to
play around with other crashes.

To view the Acralyzer dashboard, visit:
https://wmf-android.cloudant.com/acralyzer/_design/acralyzer/index.html#/dashboard/wmf-android

Change-Id: I0e113755a2d00715f380c64736b96448e5dd80ce
---
M wikipedia/AndroidManifest.xml
M wikipedia/res/values/strings.xml
M wikipedia/src/main/java/org/wikipedia/WikipediaApp.java
M wikipedia/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java
4 files changed, 17 insertions(+), 14 deletions(-)


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

diff --git a/wikipedia/AndroidManifest.xml b/wikipedia/AndroidManifest.xml
index 21597ad..5c33e95 100644
--- a/wikipedia/AndroidManifest.xml
+++ b/wikipedia/AndroidManifest.xml
@@ -58,12 +58,6 @@
 
 
 
-
 
 http://schemas.android.com/tools";>
-Wikipedia
-Wikipedia Beta
-Wikipedia Alpha
+Acralyzer Demo
+Acralyzer Demo
+Acralyzer Demo
 
 Yes
 No
 
+Crash report sent!
 Wikipedia crashed :(
 Send us a crash report
 What were you doing when the 
crash happened?
diff --git a/wikipedia/src/main/java/org/wikipedia/WikipediaApp.java 
b/wikipedia/src/main/java/org/wikipedia/WikipediaApp.java
index c168467..c06ecfc 100644
--- a/wikipedia/src/main/java/org/wikipedia/WikipediaApp.java
+++ b/wikipedia/src/main/java/org/wikipedia/WikipediaApp.java
@@ -52,11 +52,13 @@
 
 @ReportsCrashes(
 formKey = "",
-mode = ReportingInteractionMode.DIALOG,
-resDialogTitle = R.string.acra_report_dialog_title,
-resDialogText = R.string.acra_report_dialog_text,
-resDialogCommentPrompt = R.string.acra_report_dialog_comment,
-mailTo = "mobile-android-wikipedia-cras...@wikimedia.org")
+formUri = 
"https://wmf-android.cloudant.com/acra-wmf-android/_design/acra-storage/_update/report";,
+reportType = org.acra.sender.HttpSender.Type.JSON,
+httpMethod = org.acra.sender.HttpSender.Method.PUT,
+formUriBasicAuthLogin = "tireneanctondlestsheasta",
+formUriBasicAuthPassword = "dNNYY85ThxOooWO2TSHxPWgg",
+mode = ReportingInteractionMode.TOAST,
+resToastText = R.string.acra_crash_toast_text)
 public class WikipediaApp extends Application {
 private static final String HTTPS_PROTOCOL = "https";
 private static final String FALLBACK_LANGUAGE = "en"; // Must exist in 
preference_language_keys.
diff --git 
a/wikipedia/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java 
b/wikipedia/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java
index 8c1fdcc..3d26ea0 100644
--- a/wikipedia/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java
+++ b/wikipedia/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java
@@ -96,6 +96,12 @@
 setTheme(WikipediaApp.THEME_DARK);
 app = (WikipediaApp)getApplicationContext();
 
+
+// FIXME: Take out when done testing
+if (true) {
+throw new IllegalStateException();
+}
+
 // hide system bar
 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
 WindowManager.LayoutParams.FLAG_FULLSCREEN);

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

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

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


[MediaWiki-commits] [Gerrit] Re-enable xhprof profiling - change (operations/mediawiki-config)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Re-enable xhprof profiling
..

Re-enable xhprof profiling

* Exclude for now all named section profiling metrics. This includes all the
  SQL query metrics, among other things. Do this to avoid flooding Graphite
  with new metrics.
* Qualify xhprof metrics with 'xhprof' prefix.

Bug: T66301
Bug: T99829
Change-Id: Ia7549d4542bf74acda58a16c18e5f3f7fe688ea8
---
M wmf-config/StartProfiler.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/wmf-config/StartProfiler.php b/wmf-config/StartProfiler.php
index 8ae9555..5dd7180 100644
--- a/wmf-config/StartProfiler.php
+++ b/wmf-config/StartProfiler.php
@@ -53,14 +53,14 @@
} );
} else {
// 1:1000 request profiling
-   /* Disabled 15-May-2015 because it creates too many metrics
$wgProfiler = array(
'class'=> 'ProfilerXhprof',
-   'flags'=> XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY | 
XHPROF_FLAGS_NO_BUILTINS,
+   'exclude'  => array( 'section.*' ),
+   'flags'=> ( XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY 
| XHPROF_FLAGS_NO_BUILTINS ),
'output'   => 'stats',
+   'prefix'   => 'xhprof',
'sampling' => 1000,
);
-*/
}
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7549d4542bf74acda58a16c18e5f3f7fe688ea8
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] ProfilerOutputStats: replace single ':' with '.', too - change (mediawiki/core)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: ProfilerOutputStats: replace single ':' with '.', too
..

ProfilerOutputStats: replace single ':' with '.', too

This maps 'hook: ' and 'query: ' to a metric name segment, instead of just a
metric name prefix.

Change-Id: I41fb71becbc862597b998c73ccfcaca5a3510ffc
(cherry picked from commit e0ef4f556c4e2f836275e097e0c59a0a09bc7042)
---
M includes/profiler/output/ProfilerOutputStats.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/07/212807/1

diff --git a/includes/profiler/output/ProfilerOutputStats.php 
b/includes/profiler/output/ProfilerOutputStats.php
index 0d75191..d816a01 100644
--- a/includes/profiler/output/ProfilerOutputStats.php
+++ b/includes/profiler/output/ProfilerOutputStats.php
@@ -42,7 +42,7 @@
 * @since 1.26
 */
private static function normalizeMetricKey( $key ) {
-   $key = str_replace( '::', '.', $key );
+   $key = preg_replace( '/[:.]+/', '.', $key );
$key = preg_replace( '/[^a-z.]+/i', '_', $key );
$key = trim( $key, '_.' );
return str_replace( array( '._', '_.' ), '.', $key );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41fb71becbc862597b998c73ccfcaca5a3510ffc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf6
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] ProfilerOutputStats: replace single ':' with '.', too - change (mediawiki/core)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: ProfilerOutputStats: replace single ':' with '.', too
..


ProfilerOutputStats: replace single ':' with '.', too

This maps 'hook: ' and 'query: ' to a metric name segment, instead of just a
metric name prefix.

Change-Id: I41fb71becbc862597b998c73ccfcaca5a3510ffc
(cherry picked from commit e0ef4f556c4e2f836275e097e0c59a0a09bc7042)
---
M includes/profiler/output/ProfilerOutputStats.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/includes/profiler/output/ProfilerOutputStats.php 
b/includes/profiler/output/ProfilerOutputStats.php
index 0d75191..d816a01 100644
--- a/includes/profiler/output/ProfilerOutputStats.php
+++ b/includes/profiler/output/ProfilerOutputStats.php
@@ -42,7 +42,7 @@
 * @since 1.26
 */
private static function normalizeMetricKey( $key ) {
-   $key = str_replace( '::', '.', $key );
+   $key = preg_replace( '/[:.]+/', '.', $key );
$key = preg_replace( '/[^a-z.]+/i', '_', $key );
$key = trim( $key, '_.' );
return str_replace( array( '._', '_.' ), '.', $key );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I41fb71becbc862597b998c73ccfcaca5a3510ffc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf6
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] ProfilerOutputStats: replace single ':' with '.', too - change (mediawiki/core)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: ProfilerOutputStats: replace single ':' with '.', too
..


ProfilerOutputStats: replace single ':' with '.', too

This maps 'hook: ' and 'query: ' to a metric name segment, instead of just a
metric name prefix.

Change-Id: I41fb71becbc862597b998c73ccfcaca5a3510ffc
(cherry picked from commit e0ef4f556c4e2f836275e097e0c59a0a09bc7042)
---
M includes/profiler/output/ProfilerOutputStats.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/includes/profiler/output/ProfilerOutputStats.php 
b/includes/profiler/output/ProfilerOutputStats.php
index 0d75191..d816a01 100644
--- a/includes/profiler/output/ProfilerOutputStats.php
+++ b/includes/profiler/output/ProfilerOutputStats.php
@@ -42,7 +42,7 @@
 * @since 1.26
 */
private static function normalizeMetricKey( $key ) {
-   $key = str_replace( '::', '.', $key );
+   $key = preg_replace( '/[:.]+/', '.', $key );
$key = preg_replace( '/[^a-z.]+/i', '_', $key );
$key = trim( $key, '_.' );
return str_replace( array( '._', '_.' ), '.', $key );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I41fb71becbc862597b998c73ccfcaca5a3510ffc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] ProfilerOutputStats: replace single ':' with '.', too - change (mediawiki/core)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: ProfilerOutputStats: replace single ':' with '.', too
..

ProfilerOutputStats: replace single ':' with '.', too

This maps 'hook: ' and 'query: ' to a metric name segment, instead of just a
metric name prefix.

Change-Id: I41fb71becbc862597b998c73ccfcaca5a3510ffc
(cherry picked from commit e0ef4f556c4e2f836275e097e0c59a0a09bc7042)
---
M includes/profiler/output/ProfilerOutputStats.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/profiler/output/ProfilerOutputStats.php 
b/includes/profiler/output/ProfilerOutputStats.php
index 0d75191..d816a01 100644
--- a/includes/profiler/output/ProfilerOutputStats.php
+++ b/includes/profiler/output/ProfilerOutputStats.php
@@ -42,7 +42,7 @@
 * @since 1.26
 */
private static function normalizeMetricKey( $key ) {
-   $key = str_replace( '::', '.', $key );
+   $key = preg_replace( '/[:.]+/', '.', $key );
$key = preg_replace( '/[^a-z.]+/i', '_', $key );
$key = trim( $key, '_.' );
return str_replace( array( '._', '_.' ), '.', $key );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41fb71becbc862597b998c73ccfcaca5a3510ffc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Improve ProfilerXhprof's blacklist/whitelist capabilities - change (mediawiki/core)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Improve ProfilerXhprof's blacklist/whitelist capabilities
..


Improve ProfilerXhprof's blacklist/whitelist capabilities

* Apply the blacklist / whitelist to profiled sections, not just function names.
* Allow shell-style wildcard patterns in blacklist / whitelist.
* Prefix all profiled section names with 'section.', to distinguish them from
  functions.

Note that shell-style wildcard patterns are not supported by xhprof natively,
but it won't barf on them either, nor will they match against actual function
names (since shell wildcard characters are not valid for PHP function names),
and the filtering will still be enforced in ProfilerXhprof.

This has the side-effect of working around 
https://github.com/facebook/hhvm/issues/4385

Bug: T99829
Change-Id: I8354ed922fa7b42857eda03be8f62b89ac78d0d6
(cherry picked from commit 661830710244313bb5022e37723c43589b007533)
---
M includes/profiler/ProfilerXhprof.php
1 file changed, 36 insertions(+), 9 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/includes/profiler/ProfilerXhprof.php 
b/includes/profiler/ProfilerXhprof.php
index f36cdc1..5f7fc00 100644
--- a/includes/profiler/ProfilerXhprof.php
+++ b/includes/profiler/ProfilerXhprof.php
@@ -40,12 +40,8 @@
  *
  * To restrict the functions for which profiling data is collected, you can
  * use either a whitelist ($wgProfiler['include']) or a blacklist
- * ($wgProfiler['exclude']) containing an array of function names. The
- * blacklist functionality is built into HHVM and will completely exclude the
- * named functions from profiling collection. The whitelist is implemented by
- * Xhprof class which will filter the data collected by XHProf before 
reporting.
- * See documentation for the Xhprof class and the XHProf extension for
- * additional information.
+ * ($wgProfiler['exclude']) containing an array of function names.
+ * Shell-style patterns are also accepted.
  *
  * @author Bryan Davis 
  * @copyright © 2014 Bryan Davis and Wikimedia Foundation.
@@ -77,7 +73,8 @@
}
 
public function scopedProfileIn( $section ) {
-   return $this->sprofiler->scopedProfileIn( $section );
+   $key = 'section.' . ltrim( $section, '.' );
+   return $this->sprofiler->scopedProfileIn( $key );
}
 
/**
@@ -86,12 +83,43 @@
public function close() {
}
 
+   /**
+* Check if a function or section should be excluded from the output.
+*
+* @param string $name Function or section name.
+* @return bool
+*/
+   private function shouldExclude( $name ) {
+   if ( $name === '-total' ) {
+   return true;
+   }
+   if ( !empty( $this->params['include'] ) ) {
+   foreach ( $this->params['include'] as $pattern ) {
+   if ( fnmatch( $pattern, $name, FNM_NOESCAPE ) ) 
{
+   return false;
+   }
+   }
+   return true;
+   }
+   if ( !empty( $this->params['exclude'] ) ) {
+   foreach ( $this->params['exclude'] as $pattern ) {
+   if ( fnmatch( $pattern, $name, FNM_NOESCAPE ) ) 
{
+   return true;
+   }
+   }
+   }
+   return false;
+   }
+
public function getFunctionStats() {
$metrics = $this->xhprof->getCompleteMetrics();
$profile = array();
 
$main = null; // units in ms
foreach ( $metrics as $fname => $stats ) {
+   if ( $this->shouldExclude( $fname ) ) {
+   continue;
+   }
// Convert elapsed times from μs to ms to match 
interface
$entry = array(
'name' => $fname,
@@ -113,8 +141,7 @@
 
// Merge in all of the custom profile sections
foreach ( $this->sprofiler->getFunctionStats() as $stats ) {
-   if ( $stats['name'] === '-total' ) {
-   // Discard section profiler running totals
+   if ( $this->shouldExclude( $stats['name'] ) ) {
continue;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8354ed922fa7b42857eda03be8f62b89ac78d0d6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-

[MediaWiki-commits] [Gerrit] Improve ProfilerXhprof's blacklist/whitelist capabilities - change (mediawiki/core)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Improve ProfilerXhprof's blacklist/whitelist capabilities
..


Improve ProfilerXhprof's blacklist/whitelist capabilities

* Apply the blacklist / whitelist to profiled sections, not just function names.
* Allow shell-style wildcard patterns in blacklist / whitelist.
* Prefix all profiled section names with 'section.', to distinguish them from
  functions.

Note that shell-style wildcard patterns are not supported by xhprof natively,
but it won't barf on them either, nor will they match against actual function
names (since shell wildcard characters are not valid for PHP function names),
and the filtering will still be enforced in ProfilerXhprof.

This has the side-effect of working around 
https://github.com/facebook/hhvm/issues/4385

Bug: T99829
Change-Id: I8354ed922fa7b42857eda03be8f62b89ac78d0d6
(cherry picked from commit 661830710244313bb5022e37723c43589b007533)
---
M includes/profiler/ProfilerXhprof.php
1 file changed, 36 insertions(+), 9 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/includes/profiler/ProfilerXhprof.php 
b/includes/profiler/ProfilerXhprof.php
index f36cdc1..5f7fc00 100644
--- a/includes/profiler/ProfilerXhprof.php
+++ b/includes/profiler/ProfilerXhprof.php
@@ -40,12 +40,8 @@
  *
  * To restrict the functions for which profiling data is collected, you can
  * use either a whitelist ($wgProfiler['include']) or a blacklist
- * ($wgProfiler['exclude']) containing an array of function names. The
- * blacklist functionality is built into HHVM and will completely exclude the
- * named functions from profiling collection. The whitelist is implemented by
- * Xhprof class which will filter the data collected by XHProf before 
reporting.
- * See documentation for the Xhprof class and the XHProf extension for
- * additional information.
+ * ($wgProfiler['exclude']) containing an array of function names.
+ * Shell-style patterns are also accepted.
  *
  * @author Bryan Davis 
  * @copyright © 2014 Bryan Davis and Wikimedia Foundation.
@@ -77,7 +73,8 @@
}
 
public function scopedProfileIn( $section ) {
-   return $this->sprofiler->scopedProfileIn( $section );
+   $key = 'section.' . ltrim( $section, '.' );
+   return $this->sprofiler->scopedProfileIn( $key );
}
 
/**
@@ -86,12 +83,43 @@
public function close() {
}
 
+   /**
+* Check if a function or section should be excluded from the output.
+*
+* @param string $name Function or section name.
+* @return bool
+*/
+   private function shouldExclude( $name ) {
+   if ( $name === '-total' ) {
+   return true;
+   }
+   if ( !empty( $this->params['include'] ) ) {
+   foreach ( $this->params['include'] as $pattern ) {
+   if ( fnmatch( $pattern, $name, FNM_NOESCAPE ) ) 
{
+   return false;
+   }
+   }
+   return true;
+   }
+   if ( !empty( $this->params['exclude'] ) ) {
+   foreach ( $this->params['exclude'] as $pattern ) {
+   if ( fnmatch( $pattern, $name, FNM_NOESCAPE ) ) 
{
+   return true;
+   }
+   }
+   }
+   return false;
+   }
+
public function getFunctionStats() {
$metrics = $this->xhprof->getCompleteMetrics();
$profile = array();
 
$main = null; // units in ms
foreach ( $metrics as $fname => $stats ) {
+   if ( $this->shouldExclude( $fname ) ) {
+   continue;
+   }
// Convert elapsed times from μs to ms to match 
interface
$entry = array(
'name' => $fname,
@@ -113,8 +141,7 @@
 
// Merge in all of the custom profile sections
foreach ( $this->sprofiler->getFunctionStats() as $stats ) {
-   if ( $stats['name'] === '-total' ) {
-   // Discard section profiler running totals
+   if ( $this->shouldExclude( $stats['name'] ) ) {
continue;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8354ed922fa7b42857eda03be8f62b89ac78d0d6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf6
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-

[MediaWiki-commits] [Gerrit] ProfilerOutputStats: allow a key prefix to be specified - change (mediawiki/core)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: ProfilerOutputStats: allow a key prefix to be specified
..


ProfilerOutputStats: allow a key prefix to be specified

If one wants to nest all metrics emitted by the profiler under a metric
namespace, one can now set the 'prefix' param.

Task: T66301
Change-Id: I6c52f20e39017f4c818ca6623bb7f48683fc8abc
(cherry picked from commit a70b4c85a8892a62b839581dc96cb9df34ef05b8)
---
M includes/profiler/output/ProfilerOutputStats.php
1 file changed, 24 insertions(+), 5 deletions(-)

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



diff --git a/includes/profiler/output/ProfilerOutputStats.php 
b/includes/profiler/output/ProfilerOutputStats.php
index a635793..0d75191 100644
--- a/includes/profiler/output/ProfilerOutputStats.php
+++ b/includes/profiler/output/ProfilerOutputStats.php
@@ -32,19 +32,38 @@
 class ProfilerOutputStats extends ProfilerOutput {
 
/**
+* Normalize a metric key for StatsD
+*
+* Replace occurences of '::' with dots and any other non-alphabetic
+* characters with underscores. Combine runs of dots or underscores.
+* Then trim leading or trailing dots or underscores.
+*
+* @param string $key
+* @since 1.26
+*/
+   private static function normalizeMetricKey( $key ) {
+   $key = str_replace( '::', '.', $key );
+   $key = preg_replace( '/[^a-z.]+/i', '_', $key );
+   $key = trim( $key, '_.' );
+   return str_replace( array( '._', '_.' ), '.', $key );
+   }
+
+   /**
 * Flush profiling data to the current profiling context's stats buffer.
 *
 * @param array $stats
 */
public function log( array $stats ) {
+   if ( isset( $this->params['prefix'] ) ) {
+   $prefix = self::normalizeMetricKey( 
$this->params['prefix'] );
+   } else {
+   $prefix = '';
+   }
+
$contextStats = $this->collector->getContext()->getStats();
 
foreach ( $stats as $stat ) {
-   // Sanitize the key
-   $key = str_replace( '::', '.', $stat['name'] );
-   $key = preg_replace( '/[^a-z.]+/i', '_', $key );
-   $key = trim( $key, '_.' );
-   $key = str_replace( array( '._', '_.' ), '.', $key );
+   $key = self::normalizeMetricKey( 
"{$prefix}.{$stat['name']}" );
 
// Convert fractional seconds to whole milliseconds
$cpu = round( $stat['cpu'] * 1000 );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6c52f20e39017f4c818ca6623bb7f48683fc8abc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] ProfilerOutputStats: allow a key prefix to be specified - change (mediawiki/core)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: ProfilerOutputStats: allow a key prefix to be specified
..


ProfilerOutputStats: allow a key prefix to be specified

If one wants to nest all metrics emitted by the profiler under a metric
namespace, one can now set the 'prefix' param.

Task: T66301
Change-Id: I6c52f20e39017f4c818ca6623bb7f48683fc8abc
(cherry picked from commit a70b4c85a8892a62b839581dc96cb9df34ef05b8)
---
M includes/profiler/output/ProfilerOutputStats.php
1 file changed, 24 insertions(+), 5 deletions(-)

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



diff --git a/includes/profiler/output/ProfilerOutputStats.php 
b/includes/profiler/output/ProfilerOutputStats.php
index a635793..0d75191 100644
--- a/includes/profiler/output/ProfilerOutputStats.php
+++ b/includes/profiler/output/ProfilerOutputStats.php
@@ -32,19 +32,38 @@
 class ProfilerOutputStats extends ProfilerOutput {
 
/**
+* Normalize a metric key for StatsD
+*
+* Replace occurences of '::' with dots and any other non-alphabetic
+* characters with underscores. Combine runs of dots or underscores.
+* Then trim leading or trailing dots or underscores.
+*
+* @param string $key
+* @since 1.26
+*/
+   private static function normalizeMetricKey( $key ) {
+   $key = str_replace( '::', '.', $key );
+   $key = preg_replace( '/[^a-z.]+/i', '_', $key );
+   $key = trim( $key, '_.' );
+   return str_replace( array( '._', '_.' ), '.', $key );
+   }
+
+   /**
 * Flush profiling data to the current profiling context's stats buffer.
 *
 * @param array $stats
 */
public function log( array $stats ) {
+   if ( isset( $this->params['prefix'] ) ) {
+   $prefix = self::normalizeMetricKey( 
$this->params['prefix'] );
+   } else {
+   $prefix = '';
+   }
+
$contextStats = $this->collector->getContext()->getStats();
 
foreach ( $stats as $stat ) {
-   // Sanitize the key
-   $key = str_replace( '::', '.', $stat['name'] );
-   $key = preg_replace( '/[^a-z.]+/i', '_', $key );
-   $key = trim( $key, '_.' );
-   $key = str_replace( array( '._', '_.' ), '.', $key );
+   $key = self::normalizeMetricKey( 
"{$prefix}.{$stat['name']}" );
 
// Convert fractional seconds to whole milliseconds
$cpu = round( $stat['cpu'] * 1000 );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6c52f20e39017f4c818ca6623bb7f48683fc8abc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf6
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Improve ProfilerXhprof's blacklist/whitelist capabilities - change (mediawiki/core)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Improve ProfilerXhprof's blacklist/whitelist capabilities
..

Improve ProfilerXhprof's blacklist/whitelist capabilities

* Apply the blacklist / whitelist to profiled sections, not just function names.
* Allow shell-style wildcard patterns in blacklist / whitelist.
* Prefix all profiled section names with 'section.', to distinguish them from
  functions.

Note that shell-style wildcard patterns are not supported by xhprof natively,
but it won't barf on them either, nor will they match against actual function
names (since shell wildcard characters are not valid for PHP function names),
and the filtering will still be enforced in ProfilerXhprof.

This has the side-effect of working around 
https://github.com/facebook/hhvm/issues/4385

Bug: T99829
Change-Id: I8354ed922fa7b42857eda03be8f62b89ac78d0d6
(cherry picked from commit 661830710244313bb5022e37723c43589b007533)
---
M includes/profiler/ProfilerXhprof.php
1 file changed, 36 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/212805/1

diff --git a/includes/profiler/ProfilerXhprof.php 
b/includes/profiler/ProfilerXhprof.php
index f36cdc1..5f7fc00 100644
--- a/includes/profiler/ProfilerXhprof.php
+++ b/includes/profiler/ProfilerXhprof.php
@@ -40,12 +40,8 @@
  *
  * To restrict the functions for which profiling data is collected, you can
  * use either a whitelist ($wgProfiler['include']) or a blacklist
- * ($wgProfiler['exclude']) containing an array of function names. The
- * blacklist functionality is built into HHVM and will completely exclude the
- * named functions from profiling collection. The whitelist is implemented by
- * Xhprof class which will filter the data collected by XHProf before 
reporting.
- * See documentation for the Xhprof class and the XHProf extension for
- * additional information.
+ * ($wgProfiler['exclude']) containing an array of function names.
+ * Shell-style patterns are also accepted.
  *
  * @author Bryan Davis 
  * @copyright © 2014 Bryan Davis and Wikimedia Foundation.
@@ -77,7 +73,8 @@
}
 
public function scopedProfileIn( $section ) {
-   return $this->sprofiler->scopedProfileIn( $section );
+   $key = 'section.' . ltrim( $section, '.' );
+   return $this->sprofiler->scopedProfileIn( $key );
}
 
/**
@@ -86,12 +83,43 @@
public function close() {
}
 
+   /**
+* Check if a function or section should be excluded from the output.
+*
+* @param string $name Function or section name.
+* @return bool
+*/
+   private function shouldExclude( $name ) {
+   if ( $name === '-total' ) {
+   return true;
+   }
+   if ( !empty( $this->params['include'] ) ) {
+   foreach ( $this->params['include'] as $pattern ) {
+   if ( fnmatch( $pattern, $name, FNM_NOESCAPE ) ) 
{
+   return false;
+   }
+   }
+   return true;
+   }
+   if ( !empty( $this->params['exclude'] ) ) {
+   foreach ( $this->params['exclude'] as $pattern ) {
+   if ( fnmatch( $pattern, $name, FNM_NOESCAPE ) ) 
{
+   return true;
+   }
+   }
+   }
+   return false;
+   }
+
public function getFunctionStats() {
$metrics = $this->xhprof->getCompleteMetrics();
$profile = array();
 
$main = null; // units in ms
foreach ( $metrics as $fname => $stats ) {
+   if ( $this->shouldExclude( $fname ) ) {
+   continue;
+   }
// Convert elapsed times from μs to ms to match 
interface
$entry = array(
'name' => $fname,
@@ -113,8 +141,7 @@
 
// Merge in all of the custom profile sections
foreach ( $this->sprofiler->getFunctionStats() as $stats ) {
-   if ( $stats['name'] === '-total' ) {
-   // Discard section profiler running totals
+   if ( $this->shouldExclude( $stats['name'] ) ) {
continue;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8354ed922fa7b42857eda03be8f62b89ac78d0d6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf6
Gerr

[MediaWiki-commits] [Gerrit] Improve ProfilerXhprof's blacklist/whitelist capabilities - change (mediawiki/core)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Improve ProfilerXhprof's blacklist/whitelist capabilities
..

Improve ProfilerXhprof's blacklist/whitelist capabilities

* Apply the blacklist / whitelist to profiled sections, not just function names.
* Allow shell-style wildcard patterns in blacklist / whitelist.
* Prefix all profiled section names with 'section.', to distinguish them from
  functions.

Note that shell-style wildcard patterns are not supported by xhprof natively,
but it won't barf on them either, nor will they match against actual function
names (since shell wildcard characters are not valid for PHP function names),
and the filtering will still be enforced in ProfilerXhprof.

This has the side-effect of working around 
https://github.com/facebook/hhvm/issues/4385

Bug: T99829
Change-Id: I8354ed922fa7b42857eda03be8f62b89ac78d0d6
(cherry picked from commit 661830710244313bb5022e37723c43589b007533)
---
M includes/profiler/ProfilerXhprof.php
1 file changed, 36 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/04/212804/1

diff --git a/includes/profiler/ProfilerXhprof.php 
b/includes/profiler/ProfilerXhprof.php
index f36cdc1..5f7fc00 100644
--- a/includes/profiler/ProfilerXhprof.php
+++ b/includes/profiler/ProfilerXhprof.php
@@ -40,12 +40,8 @@
  *
  * To restrict the functions for which profiling data is collected, you can
  * use either a whitelist ($wgProfiler['include']) or a blacklist
- * ($wgProfiler['exclude']) containing an array of function names. The
- * blacklist functionality is built into HHVM and will completely exclude the
- * named functions from profiling collection. The whitelist is implemented by
- * Xhprof class which will filter the data collected by XHProf before 
reporting.
- * See documentation for the Xhprof class and the XHProf extension for
- * additional information.
+ * ($wgProfiler['exclude']) containing an array of function names.
+ * Shell-style patterns are also accepted.
  *
  * @author Bryan Davis 
  * @copyright © 2014 Bryan Davis and Wikimedia Foundation.
@@ -77,7 +73,8 @@
}
 
public function scopedProfileIn( $section ) {
-   return $this->sprofiler->scopedProfileIn( $section );
+   $key = 'section.' . ltrim( $section, '.' );
+   return $this->sprofiler->scopedProfileIn( $key );
}
 
/**
@@ -86,12 +83,43 @@
public function close() {
}
 
+   /**
+* Check if a function or section should be excluded from the output.
+*
+* @param string $name Function or section name.
+* @return bool
+*/
+   private function shouldExclude( $name ) {
+   if ( $name === '-total' ) {
+   return true;
+   }
+   if ( !empty( $this->params['include'] ) ) {
+   foreach ( $this->params['include'] as $pattern ) {
+   if ( fnmatch( $pattern, $name, FNM_NOESCAPE ) ) 
{
+   return false;
+   }
+   }
+   return true;
+   }
+   if ( !empty( $this->params['exclude'] ) ) {
+   foreach ( $this->params['exclude'] as $pattern ) {
+   if ( fnmatch( $pattern, $name, FNM_NOESCAPE ) ) 
{
+   return true;
+   }
+   }
+   }
+   return false;
+   }
+
public function getFunctionStats() {
$metrics = $this->xhprof->getCompleteMetrics();
$profile = array();
 
$main = null; // units in ms
foreach ( $metrics as $fname => $stats ) {
+   if ( $this->shouldExclude( $fname ) ) {
+   continue;
+   }
// Convert elapsed times from μs to ms to match 
interface
$entry = array(
'name' => $fname,
@@ -113,8 +141,7 @@
 
// Merge in all of the custom profile sections
foreach ( $this->sprofiler->getFunctionStats() as $stats ) {
-   if ( $stats['name'] === '-total' ) {
-   // Discard section profiler running totals
+   if ( $this->shouldExclude( $stats['name'] ) ) {
continue;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8354ed922fa7b42857eda03be8f62b89ac78d0d6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerr

[MediaWiki-commits] [Gerrit] ProfilerOutputStats: allow a key prefix to be specified - change (mediawiki/core)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: ProfilerOutputStats: allow a key prefix to be specified
..

ProfilerOutputStats: allow a key prefix to be specified

If one wants to nest all metrics emitted by the profiler under a metric
namespace, one can now set the 'prefix' param.

Task: T66301
Change-Id: I6c52f20e39017f4c818ca6623bb7f48683fc8abc
(cherry picked from commit a70b4c85a8892a62b839581dc96cb9df34ef05b8)
---
M includes/profiler/output/ProfilerOutputStats.php
1 file changed, 24 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/02/212802/1

diff --git a/includes/profiler/output/ProfilerOutputStats.php 
b/includes/profiler/output/ProfilerOutputStats.php
index a635793..0d75191 100644
--- a/includes/profiler/output/ProfilerOutputStats.php
+++ b/includes/profiler/output/ProfilerOutputStats.php
@@ -32,19 +32,38 @@
 class ProfilerOutputStats extends ProfilerOutput {
 
/**
+* Normalize a metric key for StatsD
+*
+* Replace occurences of '::' with dots and any other non-alphabetic
+* characters with underscores. Combine runs of dots or underscores.
+* Then trim leading or trailing dots or underscores.
+*
+* @param string $key
+* @since 1.26
+*/
+   private static function normalizeMetricKey( $key ) {
+   $key = str_replace( '::', '.', $key );
+   $key = preg_replace( '/[^a-z.]+/i', '_', $key );
+   $key = trim( $key, '_.' );
+   return str_replace( array( '._', '_.' ), '.', $key );
+   }
+
+   /**
 * Flush profiling data to the current profiling context's stats buffer.
 *
 * @param array $stats
 */
public function log( array $stats ) {
+   if ( isset( $this->params['prefix'] ) ) {
+   $prefix = self::normalizeMetricKey( 
$this->params['prefix'] );
+   } else {
+   $prefix = '';
+   }
+
$contextStats = $this->collector->getContext()->getStats();
 
foreach ( $stats as $stat ) {
-   // Sanitize the key
-   $key = str_replace( '::', '.', $stat['name'] );
-   $key = preg_replace( '/[^a-z.]+/i', '_', $key );
-   $key = trim( $key, '_.' );
-   $key = str_replace( array( '._', '_.' ), '.', $key );
+   $key = self::normalizeMetricKey( 
"{$prefix}.{$stat['name']}" );
 
// Convert fractional seconds to whole milliseconds
$cpu = round( $stat['cpu'] * 1000 );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c52f20e39017f4c818ca6623bb7f48683fc8abc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] ProfilerOutputStats: allow a key prefix to be specified - change (mediawiki/core)

2015-05-22 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: ProfilerOutputStats: allow a key prefix to be specified
..

ProfilerOutputStats: allow a key prefix to be specified

If one wants to nest all metrics emitted by the profiler under a metric
namespace, one can now set the 'prefix' param.

Task: T66301
Change-Id: I6c52f20e39017f4c818ca6623bb7f48683fc8abc
(cherry picked from commit a70b4c85a8892a62b839581dc96cb9df34ef05b8)
---
M includes/profiler/output/ProfilerOutputStats.php
1 file changed, 24 insertions(+), 5 deletions(-)


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

diff --git a/includes/profiler/output/ProfilerOutputStats.php 
b/includes/profiler/output/ProfilerOutputStats.php
index a635793..0d75191 100644
--- a/includes/profiler/output/ProfilerOutputStats.php
+++ b/includes/profiler/output/ProfilerOutputStats.php
@@ -32,19 +32,38 @@
 class ProfilerOutputStats extends ProfilerOutput {
 
/**
+* Normalize a metric key for StatsD
+*
+* Replace occurences of '::' with dots and any other non-alphabetic
+* characters with underscores. Combine runs of dots or underscores.
+* Then trim leading or trailing dots or underscores.
+*
+* @param string $key
+* @since 1.26
+*/
+   private static function normalizeMetricKey( $key ) {
+   $key = str_replace( '::', '.', $key );
+   $key = preg_replace( '/[^a-z.]+/i', '_', $key );
+   $key = trim( $key, '_.' );
+   return str_replace( array( '._', '_.' ), '.', $key );
+   }
+
+   /**
 * Flush profiling data to the current profiling context's stats buffer.
 *
 * @param array $stats
 */
public function log( array $stats ) {
+   if ( isset( $this->params['prefix'] ) ) {
+   $prefix = self::normalizeMetricKey( 
$this->params['prefix'] );
+   } else {
+   $prefix = '';
+   }
+
$contextStats = $this->collector->getContext()->getStats();
 
foreach ( $stats as $stat ) {
-   // Sanitize the key
-   $key = str_replace( '::', '.', $stat['name'] );
-   $key = preg_replace( '/[^a-z.]+/i', '_', $key );
-   $key = trim( $key, '_.' );
-   $key = str_replace( array( '._', '_.' ), '.', $key );
+   $key = self::normalizeMetricKey( 
"{$prefix}.{$stat['name']}" );
 
// Convert fractional seconds to whole milliseconds
$cpu = round( $stat['cpu'] * 1000 );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c52f20e39017f4c818ca6623bb7f48683fc8abc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf6
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Copy GlobalCollect form and make it mustache-y - change (mediawiki...DonationInterface)

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

Change subject: Copy GlobalCollect form and make it mustache-y
..


Copy GlobalCollect form and make it mustache-y

And add noscript, seal, and script path to data context.
Following commits will add appeal text, resources, and logic
to display the right fields and payment options.

Bug: T97056
Change-Id: I1ce409102a22067f5cb3640d53d9abc4e1fa4212
---
M gateway_forms/Mustache.php
M gateway_forms/mustache/index.html.mustache
A gateway_forms/mustache/payment_method.html.mustache
3 files changed, 114 insertions(+), 6 deletions(-)

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



diff --git a/gateway_forms/Mustache.php b/gateway_forms/Mustache.php
index 14a85ad..b4d73d7 100644
--- a/gateway_forms/Mustache.php
+++ b/gateway_forms/Mustache.php
@@ -35,6 +35,12 @@
$data = $this->gateway->getData_Unstaged_Escaped();
self::$country = $data['country'];
 
+   $config = RequestContext::getMain()->getConfig();
+
+   $data['script_path'] = $config->get( 'ScriptPath' );
+   $data['verisign_logo'] = $this->getSmallSecureLogo();
+   $data['no_script'] = $this->getNoScript();
+
$template = file_get_contents( $this->topLevelForm );
if ( $template === false ) {
throw new RuntimeException( "Template file unavailable: 
[{$this->topLevelForm}]" );
@@ -46,6 +52,8 @@
array(
'flags' => LightnCandy::FLAG_ERROR_EXCEPTION,
'helpers' => array( 'l10n' => 
'Gateway_Form_Mustache::l10n' ),
+   'basedir' => array( __DIR__ . '/mustache' ),
+   'fileext' => '.html.mustache',
)
);
if ( !$code ) {
diff --git a/gateway_forms/mustache/index.html.mustache 
b/gateway_forms/mustache/index.html.mustache
index a33e017..38e7bd8 100644
--- a/gateway_forms/mustache/index.html.mustache
+++ b/gateway_forms/mustache/index.html.mustache
@@ -1,6 +1,96 @@
-You said you wanted to donate in "{{ currency_code }}",
-
-FOO
-
-{{ l10n 
"donate_interface-donor-fiscal_number" }}
-
\ No newline at end of file
+
+   
+   
+   
+   {{{ appeal_text }}}
+   
+   
+   
+   {{{ no_script }}}
+   
+
+   
+   
+   
+   
+   
+   
+   
+   {{ l10n "donate_interface-amount-legend" }}:  {{ amount }} {{ currency_code }}
+   
+   
+   
+   
+   
+   {{ l10n "donate_interface-cc-form-header-personal" }}
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+
+
+   {{> 
payment_method }}
+
+
+
+
+   
+
+
+   
+
+
+ {{ l10n 
"donate_interface-donate-click" }}
+
+

[MediaWiki-commits] [Gerrit] Add "Search Wikipedia" to system share options - change (apps...wikipedia)

2015-05-22 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

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

Change subject: Add "Search Wikipedia" to system share options
..

Add "Search Wikipedia" to system share options

- Add Wikipedia as an available share option for all other apps. The
  share menu entry will appear as "Search Wikipedia".
- Display main page when pressing back after app entry from search
  widget.
- (Unrelated cleanup) Remove a couple unused functions and fix a
  Javadoc link in Utils.

Bug: T73234
Change-Id: I2d46ad08e14533fae3e35d3bdf636ef3e9b249b9
---
M wikipedia/AndroidManifest.xml
M wikipedia/res/values-qq/strings.xml
M wikipedia/res/values/strings.xml
M wikipedia/src/main/java/org/wikipedia/Utils.java
M wikipedia/src/main/java/org/wikipedia/page/PageActivity.java
M wikipedia/src/main/java/org/wikipedia/search/SearchArticlesFragment.java
M wikipedia/src/main/java/org/wikipedia/util/ShareUtils.java
7 files changed, 140 insertions(+), 112 deletions(-)


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

diff --git a/wikipedia/AndroidManifest.xml b/wikipedia/AndroidManifest.xml
index 21597ad..e5b2651 100644
--- a/wikipedia/AndroidManifest.xml
+++ b/wikipedia/AndroidManifest.xml
@@ -56,6 +56,11 @@
 
 
 
+
+
+
+
+
 
 
 
+  System share menu entry title for 
searching text with Wikipedia from any other app. For example, a user may 
highlight text in their browser, press share, and be given the option to 
compose a message with Gmail, post the text to Facebook, or search with 
Wikipedia.
   Title for dialog box asking if 
you want to clear all of your saved pages
   Small toast (popup) message saying that a 
page is being saved for offline reading
   Small toast (popup) message saying that a 
page has been saved for offline reading.
diff --git a/wikipedia/res/values/strings.xml b/wikipedia/res/values/strings.xml
index fa1ec40..2d8918c 100644
--- a/wikipedia/res/values/strings.xml
+++ b/wikipedia/res/values/strings.xml
@@ -31,6 +31,7 @@
 Save page
 Share
 Share via
+@string/search_hint
 Clear all saved 
pages?
 Saving page…
 Page saved successfully
diff --git a/wikipedia/src/main/java/org/wikipedia/Utils.java 
b/wikipedia/src/main/java/org/wikipedia/Utils.java
index 381db42..1fe8bf1 100644
--- a/wikipedia/src/main/java/org/wikipedia/Utils.java
+++ b/wikipedia/src/main/java/org/wikipedia/Utils.java
@@ -12,12 +12,10 @@
 import android.content.res.TypedArray;
 import android.net.Uri;
 import android.os.Looper;
-import android.os.Parcelable;
 import android.preference.PreferenceManager;
 import android.text.Html;
 import android.text.InputType;
 import android.text.format.DateUtils;
-import android.util.Base64;
 import android.util.DisplayMetrics;
 import android.util.Log;
 import android.util.TypedValue;
@@ -28,13 +26,13 @@
 import android.widget.CompoundButton;
 import android.widget.EditText;
 import android.widget.TextView;
-import android.widget.Toast;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 import org.wikipedia.bridge.CommunicationBridge;
 import org.wikipedia.settings.PrefKeys;
 import org.wikipedia.util.ApiUtil;
+import org.wikipedia.util.ShareUtils;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -111,28 +109,6 @@
 return str.subSequence(start, end + 1);
 }
 return "";
-}
-
-/**
- * Creates an MD5 hash of the provided string & returns its base64 
representation
- * @param s String to hash
- * @return Base64'd MD5 representation of the string passed in
- */
-public static String md5base64(final String s) {
-try {
-// Create MD5 Hash
-MessageDigest digest = 
java.security.MessageDigest.getInstance("MD5");
-digest.update(s.getBytes("utf-8"));
-byte[] messageDigest = digest.digest();
-
-return Base64.encodeToString(messageDigest, Base64.URL_SAFE | 
Base64.NO_WRAP);
-} catch (NoSuchAlgorithmException e) {
-// This will never happen, yes.
-throw new RuntimeException(e);
-} catch (UnsupportedEncodingException e) {
-// This will never happen, yes.
-throw new RuntimeException(e);
-}
 }
 
 /**
@@ -239,21 +215,6 @@
 keyboard.showSoftInput(view, InputMethodManager.SHOW_FORCED);
 }
 
-/**
- * Same as showSoftKeyboard(), but posted to the message queue of the 
current thread, so that it's executed
- * after the current block of code is finished.
- * @param activity The current activity
- * @param view The currently focused view that will receive the keyboard 
input
- */
-public static void showSoftKeyboardAsync(final Activity activity, final 
View

[MediaWiki-commits] [Gerrit] Add generic timeseries data representation - change (analytics/dashiki)

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

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

Change subject: Add generic timeseries data representation
..

Add generic timeseries data representation

Change-Id: I42cf620d66e7a8216949a14eea56fcf27944cc55
---
M bower.json
A src/app/data-converters/timeseries-data.js
M src/app/require.config.js
A test/app/timeseries-data.js
4 files changed, 244 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/dashiki 
refs/changes/00/212800/1

diff --git a/bower.json b/bower.json
index fec51ad..0c086fd 100644
--- a/bower.json
+++ b/bower.json
@@ -18,6 +18,7 @@
 "twix": "~0.5.1",
 "rickshaw": "~1.5.1",
 "nvd3": "~1.7.1",
-"dygraphs": "~1.1.0"
+"dygraphs": "~1.1.0",
+"lodash": "3.9.0-amd"
   }
 }
diff --git a/src/app/data-converters/timeseries-data.js 
b/src/app/data-converters/timeseries-data.js
new file mode 100644
index 000..65f6aa8
--- /dev/null
+++ b/src/app/data-converters/timeseries-data.js
@@ -0,0 +1,124 @@
+/**
+ * Defines TimeseriesData, which structures its constructor parameters
+ * into a standard object that is understood by the rest of dashiki and
+ * provides an API that the data pipeline can depend on.
+ *
+ * Parameters
+ *  header  : [string] with column labels, excluding the first column, 
"date"
+ *  rowsByDate  : dictionary of date strings to rows, each row is aligned 
with header
+ *  colorLabels : [string] color keys for each column, aligned with header
+ *  default: a copy of header
+ *  patternLabels   : [string] pattern keys for each column, aligned with 
header
+ *  default: a copy of header
+ *
+ * Example Input:
+ *  ['col1', 'col2'],   // header
+ *  {
+ * '2015-01-01': [10, 20],
+ * '2015-01-02': [11, 21],
+ * '2015-01-03': [12, 22],
+ *  },  // rowsByDate
+ *  ['col1', 'col2'],   // colorLabels
+ *  ['dataset1', 'dataset1'],   // patternLabels
+ */
+define(function (require) {
+'use strict';
+
+var _ = require('lodash');
+
+function TimeseriesData () {
+this.init.apply(this, arguments);
+}
+
+TimeseriesData.prototype.init = function (
+header, rowsByDate, colorLabels, patternLabels
+) {
+// default to the header if nothing passed in
+colorLabels = colorLabels || header;
+patternLabels = patternLabels || header;
+
+// default to no rowsByDate if nothing passed in
+rowsByDate = rowsByDate || {};
+
+// make sure header and labels are all aligned (same size)
+if (header.length !== colorLabels.length) {
+throw 'ArgError: colorLabels must be aligned in size with the 
header';
+}
+if (header.length !== patternLabels.length) {
+throw 'ArgError: patternLabels must be aligned in size with the 
header';
+}
+
+this.header = header;
+this.colorLabels = colorLabels;
+this.patternLabels = patternLabels;
+this.rowsByDate = rowsByDate;
+};
+
+/**
+ * This important function allows multiple TimeseriesData objects to
+ * be merged together efficiently.  It not only merges headers and labels,
+ * but also zips up rowsByDate by date, filling date gaps in source or 
destination
+ * with null values
+ */
+TimeseriesData.prototype.merge = function (from) {
+if (_.isUndefined(from)) {
+return this;
+}
+if (!_.isArray(from)) {
+from = [from];
+}
+
+var merged = {
+header: _.clone(this.header),
+rowsByDate: _.cloneDeep(this.rowsByDate),
+colorLabels: _.clone(this.colorLabels),
+patternLabels: _.clone(this.patternLabels)
+};
+
+_.reduce(from, function (dest, src) {
+console.log('processing: ', src);
+_.map(src.rowsByDate, function (value, key) {
+if (!_.has(dest.rowsByDate, key)) {
+// fill arrays that are nonexistent up to this point
+dest.rowsByDate[key] = _.fill(Array(dest.header.length), 
null);
+}
+console.log(dest.rowsByDate);
+dest.rowsByDate[key] = dest.rowsByDate[key].concat(value);
+});
+
+_.map(['header', 'colorLabels', 'patternLabels'], function (key) {
+dest[key] = dest[key].concat(src[key]);
+});
+
+// make sure each row lines up with the new concatenated header
+_.each(dest.rowsByDate, function (value) {
+var oldLength = value.length;
+value.length = dest.header.length;
+_.fill(value, null, oldLength);
+});
+
+return dest;
+}, merged);
+
+return new TimeseriesData(
+merged.header,
+merg

[MediaWiki-commits] [Gerrit] Add generic timeseries data representation - change (analytics/dashiki)

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

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

Change subject: Add generic timeseries data representation
..

Add generic timeseries data representation

Change-Id: I9a5caed02277bb66a26139c4f5057fb4b9880f78
---
M .gitignore
M bower.json
M src/app/data-converters/separated-values.js
A src/app/data-converters/timeseries-data.js
M src/app/data-converters/wikimetrics-timeseries.js
M src/app/require.config.js
M src/components/visualizers/dygraphs-timeseries/bindings.js
M test/app/data-converters.js
A test/app/timeseries-data.js
9 files changed, 287 insertions(+), 64 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/dashiki 
refs/changes/99/212799/1

diff --git a/.gitignore b/.gitignore
index f60fbd7..d90390f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
 .DS_Store
 node_modules/
 bower_modules/
+npm-debug.log
 
 # personal dev stuff
 .jslintrc
diff --git a/bower.json b/bower.json
index fec51ad..0c086fd 100644
--- a/bower.json
+++ b/bower.json
@@ -18,6 +18,7 @@
 "twix": "~0.5.1",
 "rickshaw": "~1.5.1",
 "nvd3": "~1.7.1",
-"dygraphs": "~1.1.0"
+"dygraphs": "~1.1.0",
+"lodash": "3.9.0-amd"
   }
 }
diff --git a/src/app/data-converters/separated-values.js 
b/src/app/data-converters/separated-values.js
index 75e362d..b7275e1 100644
--- a/src/app/data-converters/separated-values.js
+++ b/src/app/data-converters/separated-values.js
@@ -2,7 +2,10 @@
  * This module returns a method that knows how to parse a file with values
  *   separated by arbitrary characters on lines separated by arbitrary 
characters
  */
-define(['moment'], function (moment) {
+define(function (require) {
+
+var moment = require('moment'),
+_ = require('lodash');
 
 /**
  * Parses a CSV, TSV, or similar using some assumptions:
@@ -43,7 +46,7 @@
 
 if (date && value && !isNaN(date) && !isNaN(value)) {
 // NOTE: for demos until we add a time-selector, uncomment 
this line:
-if (date < 138853440) return [];
+if (date < 138853440){ return []; }
 return allColumns.map(function (column) {
 return {
 date: date,
diff --git a/src/app/data-converters/timeseries-data.js 
b/src/app/data-converters/timeseries-data.js
new file mode 100644
index 000..65f6aa8
--- /dev/null
+++ b/src/app/data-converters/timeseries-data.js
@@ -0,0 +1,124 @@
+/**
+ * Defines TimeseriesData, which structures its constructor parameters
+ * into a standard object that is understood by the rest of dashiki and
+ * provides an API that the data pipeline can depend on.
+ *
+ * Parameters
+ *  header  : [string] with column labels, excluding the first column, 
"date"
+ *  rowsByDate  : dictionary of date strings to rows, each row is aligned 
with header
+ *  colorLabels : [string] color keys for each column, aligned with header
+ *  default: a copy of header
+ *  patternLabels   : [string] pattern keys for each column, aligned with 
header
+ *  default: a copy of header
+ *
+ * Example Input:
+ *  ['col1', 'col2'],   // header
+ *  {
+ * '2015-01-01': [10, 20],
+ * '2015-01-02': [11, 21],
+ * '2015-01-03': [12, 22],
+ *  },  // rowsByDate
+ *  ['col1', 'col2'],   // colorLabels
+ *  ['dataset1', 'dataset1'],   // patternLabels
+ */
+define(function (require) {
+'use strict';
+
+var _ = require('lodash');
+
+function TimeseriesData () {
+this.init.apply(this, arguments);
+}
+
+TimeseriesData.prototype.init = function (
+header, rowsByDate, colorLabels, patternLabels
+) {
+// default to the header if nothing passed in
+colorLabels = colorLabels || header;
+patternLabels = patternLabels || header;
+
+// default to no rowsByDate if nothing passed in
+rowsByDate = rowsByDate || {};
+
+// make sure header and labels are all aligned (same size)
+if (header.length !== colorLabels.length) {
+throw 'ArgError: colorLabels must be aligned in size with the 
header';
+}
+if (header.length !== patternLabels.length) {
+throw 'ArgError: patternLabels must be aligned in size with the 
header';
+}
+
+this.header = header;
+this.colorLabels = colorLabels;
+this.patternLabels = patternLabels;
+this.rowsByDate = rowsByDate;
+};
+
+/**
+ * This important function allows multiple TimeseriesData objects to
+ * be merged together efficiently.  It not only merges headers and labels,
+ * but also zips up rowsByDate by date, filling date gaps in source or 
destination
+ * with null values
+ */
+TimeseriesData.prototype.merge = function (from) {
+if (_.isUndefi

[MediaWiki-commits] [Gerrit] Cleaned up various revisiondelete IDE warnings - change (mediawiki/core)

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

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

Change subject: Cleaned up various revisiondelete IDE warnings
..

Cleaned up various revisiondelete IDE warnings

Change-Id: I4750eabf9985785520aaac8eca12d488ca746966
---
M includes/revisiondelete/RevDelItem.php
M includes/revisiondelete/RevDelList.php
M includes/revisiondelete/RevDelLogItem.php
M includes/revisiondelete/RevisionDeleter.php
M includes/specials/SpecialRevisiondelete.php
5 files changed, 12 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/98/212798/1

diff --git a/includes/revisiondelete/RevDelItem.php 
b/includes/revisiondelete/RevDelItem.php
index ebdbf3a..dba368d 100644
--- a/includes/revisiondelete/RevDelItem.php
+++ b/includes/revisiondelete/RevDelItem.php
@@ -36,6 +36,8 @@
 
/**
 * Get the current deletion bitfield value
+*
+* @return integer
 */
abstract public function getBits();
 
diff --git a/includes/revisiondelete/RevDelList.php 
b/includes/revisiondelete/RevDelList.php
index f16fd15..cdebdd3 100644
--- a/includes/revisiondelete/RevDelList.php
+++ b/includes/revisiondelete/RevDelList.php
@@ -78,7 +78,7 @@
 * transactions are done here.
 *
 * @param array $params Associative array of parameters. Members are:
-* value: The integer value to set the visibility to
+* value: ExtractBitParams() bitfield array
 * comment:   The log comment.
 * perItemStatus: Set if you want per-item status reports
 * @return Status
@@ -106,6 +106,7 @@
// @codingStandardsIgnoreStart 
Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
for ( $this->reset(); $this->current(); $this->next() ) {
// @codingStandardsIgnoreEnd
+   /** @var $item RevDelItem */
$item = $this->current();
unset( $missing[$item->getId()] );
 
@@ -197,6 +198,7 @@
}
 
// Log it
+   // @FIXME: $newBits/$oldBits set in for loop, makes IDE 
warnings too
$this->updateLog( array(
'title' => $this->title,
'count' => $successCount,
diff --git a/includes/revisiondelete/RevDelLogItem.php 
b/includes/revisiondelete/RevDelLogItem.php
index 49adf20..4525a34 100644
--- a/includes/revisiondelete/RevDelLogItem.php
+++ b/includes/revisiondelete/RevDelLogItem.php
@@ -48,7 +48,7 @@
}
 
public function getBits() {
-   return $this->row->log_deleted;
+   return (int)$this->row->log_deleted;
}
 
public function setBits( $bits ) {
diff --git a/includes/revisiondelete/RevisionDeleter.php 
b/includes/revisiondelete/RevisionDeleter.php
index ba1f0f6..db2bc6a 100644
--- a/includes/revisiondelete/RevisionDeleter.php
+++ b/includes/revisiondelete/RevisionDeleter.php
@@ -233,9 +233,9 @@
 * @since 1.22
 * @param array $bitPars ExtractBitParams() params
 * @param int $oldfield Current bitfield
-* @return array
+* @return integer
 */
-   public static function extractBitfield( $bitPars, $oldfield ) {
+   public static function extractBitfield( array $bitPars, $oldfield ) {
// Build the actual new rev_deleted bitfield
$newBits = 0;
foreach ( $bitPars as $const => $val ) {
diff --git a/includes/specials/SpecialRevisiondelete.php 
b/includes/specials/SpecialRevisiondelete.php
index c044146..1aaf3cd 100644
--- a/includes/specials/SpecialRevisiondelete.php
+++ b/includes/specials/SpecialRevisiondelete.php
@@ -586,7 +586,7 @@
throw new PermissionsError( 'suppressrevision' );
}
# If the save went through, go to success message...
-   $status = $this->save( $bitParams, $comment, $this->targetObj );
+   $status = $this->save( $bitParams, $comment );
if ( $status->isGood() ) {
$this->success();
 
@@ -652,14 +652,13 @@
 
/**
 * Do the write operations. Simple wrapper for 
RevDel*List::setVisibility().
-* @param int $bitfield
+* @param array $bitPars ExtractBitParams() bitfield array
 * @param string $reason
-* @param Title $title
 * @return Status
 */
-   protected function save( $bitfield, $reason, $title ) {
+   protected function save( array $bitPars, $reason ) {
return $this->getList()->setVisibility(
-   array( 'value' => $bitfield, 'comment' => $reason )
+   array( 'value' => $bitPars, 'comment' => $reason )
);
}
 

-- 
To view, visit https://gerrit.wiki

[MediaWiki-commits] [Gerrit] Shell script to wrap drush - change (mediawiki/vagrant)

2015-05-22 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: Shell script to wrap drush
..

Shell script to wrap drush

This allows us to be insensitive to current user and working directory.

Change-Id: Idec88eec13134538bf64a496f55a075cf18e850a
---
M puppet/modules/crm/manifests/drush.pp
A puppet/modules/crm/templates/drush-wrapper.sh.erb
2 files changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/97/212797/1

diff --git a/puppet/modules/crm/manifests/drush.pp 
b/puppet/modules/crm/manifests/drush.pp
index 9950e0d..a1d5c89 100644
--- a/puppet/modules/crm/manifests/drush.pp
+++ b/puppet/modules/crm/manifests/drush.pp
@@ -7,6 +7,13 @@
 
 require_package('drush')
 
-$bare_cmd = "drush -y --root=${root}"
+$drush_bin = '/usr/bin/drush'
+$bare_cmd = "${drush_bin} -y --root=${root}"
 $cmd = "sudo -u www-data ${bare_cmd}"
+
+file { '/usr/local/bin/drush':
+ensure  => present,
+mode=> '0755',
+content => template('crm/drush-wrapper.sh.erb'),
+}
 }
diff --git a/puppet/modules/crm/templates/drush-wrapper.sh.erb 
b/puppet/modules/crm/templates/drush-wrapper.sh.erb
new file mode 100644
index 000..7431459
--- /dev/null
+++ b/puppet/modules/crm/templates/drush-wrapper.sh.erb
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+<%= @cmd %> "$@"

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

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

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


[MediaWiki-commits] [Gerrit] Merge REL1_23 into fundraising/REL1_23 - change (mediawiki/core)

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

Change subject: Merge REL1_23 into fundraising/REL1_23
..


Merge REL1_23 into fundraising/REL1_23

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

Approvals:
  Ejegg: Looks good to me, approved




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I66cfe03d54e20ab20c8ca7ec16ab9f12ca86c118
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_23
Gerrit-Owner: Awight 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: Katie Horn 
Gerrit-Reviewer: Ssmith 
Gerrit-Reviewer: Waldir 
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] Fix js problem in ResourceLoaderStartUpModule - change (mediawiki/core)

2015-05-22 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Fix js problem in ResourceLoaderStartUpModule
..

Fix js problem in ResourceLoaderStartUpModule

* This fixes a javascript problem in ResourceLoaderStartUpModule when it would 
add &*

Change-Id: Icca4af0492b6fd265f3ed6c05f858688ec99c599
---
M includes/api/i18n/es.json
M includes/api/i18n/gl.json
M includes/api/i18n/ru.json
M includes/installer/i18n/ba.json
M includes/installer/i18n/ku-latn.json
M includes/installer/i18n/tr.json
M includes/installer/i18n/uk.json
M includes/resourceloader/ResourceLoaderStartUpModule.php
M languages/i18n/arq.json
M languages/i18n/ba.json
M languages/i18n/bcl.json
M languages/i18n/be-tarask.json
M languages/i18n/bho.json
M languages/i18n/bn.json
M languages/i18n/bs.json
M languages/i18n/ca.json
M languages/i18n/eo.json
M languages/i18n/es.json
M languages/i18n/eu.json
M languages/i18n/fa.json
M languages/i18n/fy.json
M languages/i18n/gl.json
M languages/i18n/ht.json
M languages/i18n/hu.json
M languages/i18n/ja.json
M languages/i18n/kk-cyrl.json
M languages/i18n/ku-latn.json
M languages/i18n/ml.json
M languages/i18n/mt.json
M languages/i18n/ne.json
M languages/i18n/or.json
M languages/i18n/os.json
M languages/i18n/pl.json
M languages/i18n/ps.json
M languages/i18n/qqq.json
M languages/i18n/roa-tara.json
M languages/i18n/sa.json
M languages/i18n/sl.json
M languages/i18n/tr.json
M languages/i18n/uk.json
M languages/i18n/xmf.json
M languages/i18n/zh-hans.json
42 files changed, 999 insertions(+), 263 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/96/212796/1


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

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

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


[MediaWiki-commits] [Gerrit] Allow wrapped singleline inputs - change (oojs/ui)

2015-05-22 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: Allow wrapped singleline inputs
..

Allow wrapped singleline inputs

Passing { autosize: true, multiline: false } used to not do anything.
Now it will cause the input field to resize vertically and the text to
be wrapped. This is very magical.

Bug: T54133
Change-Id: I4f90ee0f34e3a5a6d83b51e0ba05bf37a05ce873
---
M demos/pages/widgets.js
M src/widgets/TextInputWidget.js
2 files changed, 69 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/95/212795/1

diff --git a/demos/pages/widgets.js b/demos/pages/widgets.js
index 52c6ee8..c61bf88 100644
--- a/demos/pages/widgets.js
+++ b/demos/pages/widgets.js
@@ -787,6 +787,16 @@
value: 
'Autosize\nAutosize\nAutosize\nAutosize'
} ),
{
+   label: 'TextInputWidget 
(multiline, autosize)\u200E',
+   align: 'top'
+   }
+   ),
+   new OO.ui.FieldLayout(
+   new OO.ui.TextInputWidget( {
+   autosize: true,
+   value: 'What happens when the 
content doesn\'t fit?'
+   } ),
+   {
label: 'TextInputWidget 
(autosize)\u200E',
align: 'top'
}
diff --git a/src/widgets/TextInputWidget.js b/src/widgets/TextInputWidget.js
index 1ba2664..af4fa4a 100644
--- a/src/widgets/TextInputWidget.js
+++ b/src/widgets/TextInputWidget.js
@@ -53,6 +53,9 @@
maxRows: 10
}, config );
 
+   // Properties (must be set before parent constructor, which calls 
setValue())
+   this.multiline = !!config.multiline;
+
// Parent constructor
OO.ui.TextInputWidget.super.call( this, config );
 
@@ -64,16 +67,15 @@
 
// Properties
this.readOnly = false;
-   this.multiline = !!config.multiline;
this.autosize = !!config.autosize;
this.maxRows = config.maxRows;
this.validate = null;
 
-   // Clone for resizing
+   // Clone for resizing, using a  even if 'multiline' was false
if ( this.autosize ) {
-   this.$clone = this.$input
+   this.$clone = this.$input.filter( 'textarea' )
.clone()
-   .insertAfter( this.$input )
+   .insertAfter( this.$input.get( -1 ) )
.attr( 'aria-hidden', 'true' )
.addClass( 'oo-ui-element-hidden' );
}
@@ -111,6 +113,14 @@
if ( config.required ) {
this.$input.attr( 'required', 'required' );
this.$input.attr( 'aria-required', 'true' );
+   }
+   this.$inputs = this.$input;
+   if ( this.multiline ) {
+   this.$input.filter( 'input' ).detach();
+   this.$input = this.$input.filter( 'textarea' );
+   } else {
+   this.$input.filter( 'textarea' ).detach();
+   this.$input = this.$input.filter( 'input' );
}
if ( this.label || config.autosize ) {
this.installParentChangeDetector();
@@ -182,6 +192,9 @@
 OO.ui.TextInputWidget.prototype.onKeyPress = function ( e ) {
if ( e.which === OO.ui.Keys.ENTER && !this.multiline ) {
this.emit( 'enter', e );
+   if ( this.$input.is( 'textarea' ) ) {
+   e.preventDefault();
+   }
}
 };
 
@@ -317,9 +330,11 @@
  * @chainable
  */
 OO.ui.TextInputWidget.prototype.adjustSize = function () {
-   var scrollHeight, innerHeight, outerHeight, maxInnerHeight, 
measurementError, idealHeight;
+   var
+   scrollHeight, innerHeight, outerHeight, maxInnerHeight, 
measurementError, idealHeight,
+   $newInput;
 
-   if ( this.multiline && this.autosize && this.$input.val() !== 
this.valCache ) {
+   if ( this.autosize && this.$input.val() !== this.valCache ) {
this.$clone
.val( this.$input.val() )
.attr( 'rows', '' )
@@ -334,6 +349,10 @@
 
// Remove inline height property to measure natural heights
this.$clone.css( 'height', '' );
+   if ( !this.multiline ) {
+   // When in single line mode, the natural height is for 
one row
+   this.$clone.attr( 'rows', 1 );
+   }
 

[MediaWiki-commits] [Gerrit] ssh: Make hba enable-able via hiera - change (operations/puppet)

2015-05-22 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: ssh: Make hba enable-able via hiera
..

ssh: Make hba enable-able via hiera

Change-Id: I56194d93ec371ec0963ae26d58e5b3697ab06c98
---
M modules/ssh/manifests/server.pp
M modules/ssh/templates/sshd_config.erb
2 files changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/94/212794/1

diff --git a/modules/ssh/manifests/server.pp b/modules/ssh/manifests/server.pp
index 304558b..5dc599f 100644
--- a/modules/ssh/manifests/server.pp
+++ b/modules/ssh/manifests/server.pp
@@ -3,6 +3,7 @@
 $listen_address = undef,
 $permit_root = true,
 $authorized_keys_file = undef,
+$enable_hba = false,
 ) {
 package { 'openssh-server':
 ensure => latest;
@@ -32,6 +33,8 @@
 purge   => true,
 }
 
+$hba = $enable_hba or $::ssh_hba == 'yes'
+
 file { '/etc/ssh/sshd_config':
 ensure  => present,
 owner   => 'root',
diff --git a/modules/ssh/templates/sshd_config.erb 
b/modules/ssh/templates/sshd_config.erb
index 1927b01..c43a22a 100644
--- a/modules/ssh/templates/sshd_config.erb
+++ b/modules/ssh/templates/sshd_config.erb
@@ -70,8 +70,8 @@
 # For this to work you will also need host keys in /etc/ssh_known_hosts
 RhostsRSAAuthentication no
 
-<% if has_variable?("ssh_hba") then %>
-HostbasedAuthentication <%= ssh_hba %>
+<% if @hba %>
+HostbasedAuthentication yes
 HostbasedUsesNameFromPacketOnly no
 <% else %>
 HostbasedAuthentication no

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

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

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


[MediaWiki-commits] [Gerrit] merge zookeeper submodule update I1fa0312aedf57c05dfd326b253... - change (operations/puppet)

2015-05-22 Thread Gage (Code Review)
Gage has submitted this change and it was merged.

Change subject: merge zookeeper submodule update 
I1fa0312aedf57c05dfd326b253b9f732abd4c20b
..


merge zookeeper submodule update I1fa0312aedf57c05dfd326b253b9f732abd4c20b

https://gerrit.wikimedia.org/r/#/c/212746/
zookeeper-cleanup: don't generate cron email for normal operation

Change-Id: I3e0344d8ecd8c65972459ccafcdd9029f8cea4ee
---
M modules/zookeeper
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/modules/zookeeper b/modules/zookeeper
index 9514ace..3272c7c 16
--- a/modules/zookeeper
+++ b/modules/zookeeper
-Subproject commit 9514acee04bd50bfa7845babd354a2a0e001e25c
+Subproject commit 3272c7cc8dbe5ca5746c20ab8598229c69ad6d2d

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3e0344d8ecd8c65972459ccafcdd9029f8cea4ee
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Gage 
Gerrit-Reviewer: Gage 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] merge zookeeper submodule update I1fa0312aedf57c05dfd326b253... - change (operations/puppet)

2015-05-22 Thread Gage (Code Review)
Gage has uploaded a new change for review.

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

Change subject: merge zookeeper submodule update 
I1fa0312aedf57c05dfd326b253b9f732abd4c20b
..

merge zookeeper submodule update I1fa0312aedf57c05dfd326b253b9f732abd4c20b

https://gerrit.wikimedia.org/r/#/c/212746/
zookeeper-cleanup: don't generate cron email for normal operation

Change-Id: I3e0344d8ecd8c65972459ccafcdd9029f8cea4ee
---
M modules/zookeeper
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/93/212793/1

diff --git a/modules/zookeeper b/modules/zookeeper
index 9514ace..3272c7c 16
--- a/modules/zookeeper
+++ b/modules/zookeeper
-Subproject commit 9514acee04bd50bfa7845babd354a2a0e001e25c
+Subproject commit 3272c7cc8dbe5ca5746c20ab8598229c69ad6d2d

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

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

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


[MediaWiki-commits] [Gerrit] tools: Make redis failover-able - change (operations/puppet)

2015-05-22 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: tools: Make redis failover-able
..

tools: Make redis failover-able

Gets rid of the separate redis master / slave roles. Instead,
just apply the redis role to a bunch of hosts and set the master
by setting toollabs::active_redis. This also sets up a host
entry on all toollabs hosts with the IP of the active host.

For failover,
  - Switch toollabs::active_host via hiera
  - Force run puppet on all redis hosts
  - Force run puppet on all other toollabs hosts

Bug: T99737
Change-Id: I00a6d4a6d6e5dd8bc9b6cd39e8ae53651ded46d4
---
M manifests/role/labstools.pp
M modules/toollabs/manifests/init.pp
M modules/toollabs/manifests/redis.pp
3 files changed, 12 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/92/212792/1

diff --git a/manifests/role/labstools.pp b/manifests/role/labstools.pp
index ef3e6d7..5009581 100644
--- a/manifests/role/labstools.pp
+++ b/manifests/role/labstools.pp
@@ -94,19 +94,6 @@
 include toollabs::redis
 }
 
-class redis::slave(
-$master = 'tools-redis',
-) inherits role::labs::tools::common {
-
-system::role { 'role::labs::tools::redis::slave':
-description => 'Server that hosts shared Redis instance'
-}
-class { 'toollabs::redis':
-replicate_from => $master,
-}
-
-}
-
 class toolwatcher inherits role::labs::tools::common {
 system::role { 'role::labs::tools::toolwatcher':
 description => 'Tool Labs directory structure creator for new 
tools',
diff --git a/modules/toollabs/manifests/init.pp 
b/modules/toollabs/manifests/init.pp
index a078ba6..e6e357a 100644
--- a/modules/toollabs/manifests/init.pp
+++ b/modules/toollabs/manifests/init.pp
@@ -14,6 +14,7 @@
 class toollabs (
 $proxies = ['tools-webproxy-01', 'tools-webproxy-02'],
 $active_proxy = 'tools-webproxy-01',
+$active_redis = 'tools-redis-01',
 ) {
 
 include labs_lvm
@@ -214,5 +215,11 @@
 ip   => '10.64.37.9',
 }
 
+host { 'tools-redis':
+ensure   => present,
+host_aliases => 'tools-redis.eqiad.wmflabs',
+ip   => ipresolve($active_redis, $::nameservers[0]),
+}
+
 diamond::collector::localcrontab { 'localcrontabcollector': }
 }
diff --git a/modules/toollabs/manifests/redis.pp 
b/modules/toollabs/manifests/redis.pp
index fe77251..4f45725 100644
--- a/modules/toollabs/manifests/redis.pp
+++ b/modules/toollabs/manifests/redis.pp
@@ -20,12 +20,8 @@
 include toollabs::infrastructure
 include ::redis::client::python
 
-if $replicate_from {
-$redis_replication = {
-"${::hostname}" => $replicate_from,
-}
-} else {
-$redis_replication = undef
+$redis_replication = {
+"${::hostname}" => $replicate_from,
 }
 
 include labs_lvm
@@ -56,7 +52,9 @@
 'MONITOR'   => ''
 },
 monitor   => false,
-redis_replication => $redis_replication,
+redis_replication => {
+"${::hostname}" => $active_redis, # Defined in toollabs/init
+},
 maxmemory_policy  => 'allkeys-lru',
 require   => Labs_lvm::Volume['redis-disk'],
 }

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

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

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


[MediaWiki-commits] [Gerrit] shinken: Remove myself from some contactgroups - change (operations/puppet)

2015-05-22 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: shinken: Remove myself from some contactgroups
..


shinken: Remove myself from some contactgroups

Change-Id: Ia06618c1b16ccc159f09e0058d8e2239d90b
---
M modules/shinken/files/contactgroups.cfg
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/modules/shinken/files/contactgroups.cfg 
b/modules/shinken/files/contactgroups.cfg
index b1015f6..8943b1a 100644
--- a/modules/shinken/files/contactgroups.cfg
+++ b/modules/shinken/files/contactgroups.cfg
@@ -16,7 +16,7 @@
 define contactgroup {
 contactgroup_name   deployment-prep
 alias   Beta Cluster Administrators
-members 
guest,yuvipanda,greg_g,cmcmahon,amusso,twentyafterfour,betacluster-alerts-list,irc-releng,kart_
+members 
guest,greg_g,cmcmahon,amusso,twentyafterfour,betacluster-alerts-list,irc-releng,kart_
 }
 
 define contactgroup {
@@ -34,13 +34,13 @@
 define contactgroup {
 contactgroup_name   cvn
 alias   Countervandalism Network Administrators
-members guest,krinkle,yuvipanda,irc-cvn
+members guest,krinkle,irc-cvn
 }
 
 define contactgroup {
 contactgroup_name   extdist
 alias   ExtDist Administrators
-members guest,yuvipanda,legoktm
+members guest,legoktm
 }
 
 define contactgroup {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia06618c1b16ccc159f09e0058d8e2239d90b
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda 
Gerrit-Reviewer: Yuvipanda 

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


[MediaWiki-commits] [Gerrit] shinken: Remove myself from some contactgroups - change (operations/puppet)

2015-05-22 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: shinken: Remove myself from some contactgroups
..

shinken: Remove myself from some contactgroups

Change-Id: Ia06618c1b16ccc159f09e0058d8e2239d90b
---
M modules/shinken/files/contactgroups.cfg
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/91/212791/1

diff --git a/modules/shinken/files/contactgroups.cfg 
b/modules/shinken/files/contactgroups.cfg
index b1015f6..8943b1a 100644
--- a/modules/shinken/files/contactgroups.cfg
+++ b/modules/shinken/files/contactgroups.cfg
@@ -16,7 +16,7 @@
 define contactgroup {
 contactgroup_name   deployment-prep
 alias   Beta Cluster Administrators
-members 
guest,yuvipanda,greg_g,cmcmahon,amusso,twentyafterfour,betacluster-alerts-list,irc-releng,kart_
+members 
guest,greg_g,cmcmahon,amusso,twentyafterfour,betacluster-alerts-list,irc-releng,kart_
 }
 
 define contactgroup {
@@ -34,13 +34,13 @@
 define contactgroup {
 contactgroup_name   cvn
 alias   Countervandalism Network Administrators
-members guest,krinkle,yuvipanda,irc-cvn
+members guest,krinkle,irc-cvn
 }
 
 define contactgroup {
 contactgroup_name   extdist
 alias   ExtDist Administrators
-members guest,yuvipanda,legoktm
+members guest,legoktm
 }
 
 define contactgroup {

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

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

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


[MediaWiki-commits] [Gerrit] Revert "resourceloader: Replace timestamp system with versio... - change (mediawiki/core)

2015-05-22 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Revert "resourceloader: Replace timestamp system with version 
hashing"
..

Revert "resourceloader: Replace timestamp system with version hashing"

This reverts commit f37cee996ee9459ae8cd6b23e604517d941daf18.

Bug: T99988
Change-Id: If2276175f147a395233e9af899cff958325717ac
---
M includes/OutputPage.php
M includes/cache/ResourceFileCache.php
M includes/resourceloader/ResourceLoader.php
M includes/resourceloader/ResourceLoaderContext.php
M includes/resourceloader/ResourceLoaderEditToolbarModule.php
M includes/resourceloader/ResourceLoaderFileModule.php
M includes/resourceloader/ResourceLoaderModule.php
M includes/resourceloader/ResourceLoaderStartUpModule.php
M includes/resourceloader/ResourceLoaderWikiModule.php
M resources/Resources.php
D resources/lib/phpjs-sha1/LICENSE.txt
D resources/lib/phpjs-sha1/sha1.js
M resources/src/mediawiki/mediawiki.js
M tests/phpunit/ResourceLoaderTestCase.php
M tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php
M tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php
M tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php
M tests/phpunit/structure/ResourcesTest.php
18 files changed, 435 insertions(+), 562 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/90/212790/1

diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 770cf47..db22166 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2867,7 +2867,13 @@
// and we shouldn't be putting timestamps in 
Squid-cached HTML
$version = null;
if ( $group === 'user' ) {
-   $query['version'] = 
$resourceLoader->getCombinedVersion( $context, array_keys( $grpModules ) );
+   // Get the maximum timestamp
+   $timestamp = 1;
+   foreach ( $grpModules as $module ) {
+   $timestamp = max( $timestamp, 
$module->getModifiedTime( $context ) );
+   }
+   // Add a version parameter so cache 
will break when things change
+   $query['version'] = wfTimestamp( 
TS_ISO_8601_BASIC, $timestamp );
}
 
$query['modules'] = 
ResourceLoader::makePackedModulesString( array_keys( $grpModules ) );
diff --git a/includes/cache/ResourceFileCache.php 
b/includes/cache/ResourceFileCache.php
index e1186ef..6d26a2d 100644
--- a/includes/cache/ResourceFileCache.php
+++ b/includes/cache/ResourceFileCache.php
@@ -1,6 +1,6 @@
 http://php.net/functions.anonymous
-   $rl = $this;
-   $hashes = array_map( function ( $module ) use ( $rl, $context ) 
{
-   return $rl->getModule( $module )->getVersionHash( 
$context );
-   }, $modules );
-   return self::makeHash( implode( $hashes ) );
-   }
-
-   /**
 * Output a response to a load request, including the content-type 
header.
 *
 * @param ResourceLoaderContext $context Context in which a response 
should be formed
 */
public function respond( ResourceLoaderContext $context ) {
+   // Use file cache if enabled and available...
+   if ( $this->config->get( 'UseFileCache' ) ) {
+   $fileCache = ResourceFileCache::newFromContext( 
$context );
+   if ( $this->tryRespondFromFileCache( $fileCache, 
$context ) ) {
+   return; // output handled
+   }
+   }
+
// Buffer output to catch warnings. Normally we'd use 
ob_clean() on the
// top-level output buffer to clear warnings, but that breaks 
when ob_gzhandler
// is used: ob_clean() will clear the GZIP header in that case 
and it won't come
@@ -632,8 +607,8 @@
}
}
 
+   // Preload information needed to the mtime calculation below
try {
-   // Preload for getCombinedVersion()
$this->preloadModuleInfo( array_keys( $modules ), 
$context );
} catch ( Exception $e ) {
MWExceptionHandler::logException( $e );
@@ -641,31 +616,26 @@
$this->errors[] = self::formatExceptionNoComment( $e );
}
 
-   // Combine versions to propagate cache invalidation
-   $versionHash = '';
-   try {
-   $versionHash = $this->getCombinedVersion( 

[MediaWiki-commits] [Gerrit] luasandbox: depend on the HHVM runtime. - change (mediawiki...luasandbox)

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

Change subject: luasandbox: depend on the HHVM runtime.
..


luasandbox: depend on the HHVM runtime.

Since we use hhvm to get the api version for HHVM extensions, we should
add it as a build dependency.

Change-Id: I85e9825e70c7f9c5b5e52a01b07fab71c6e48683
---
M debian/changelog
M debian/control
2 files changed, 12 insertions(+), 5 deletions(-)

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



diff --git a/debian/changelog b/debian/changelog
index 0b50825..9a30638 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+php-luasandbox (2.0.10) trusty-wikimedia; urgency=medium
+
+  * Added hhvm as a dependency for HHVM enabled system
+
+ -- Giuseppe Lavagetto   Fri, 22 May 2015 17:43:05 
+0200
+
 php-luasandbox (2.0.9) trusty-wikimedia; urgency=low
 
   * Rebuilt with HHVM autodetection. Will now build correctly both on HHVM
@@ -8,20 +14,20 @@
 php-luasandbox (2.0.8) trusty-wikimedia; urgency=medium
 
   * Debian native package versioning
-  * Version bump for HHVM 3.6 
+  * Version bump for HHVM 3.6
 
  -- Giuseppe Lavagetto   Fri, 17 Apr 2015 11:14:14 
+0200
 
 php-luasandbox (2.0-7) trusty-wikimedia; urgency=medium
 
   * Small improvement to error handling
-  * Correct links to the ini file 
+  * Correct links to the ini file
 
  -- Giuseppe Lavagetto   Mon, 16 Feb 2015 12:05:05 
+0100
 
 php-luasandbox (2.0-6) trusty-wikimedia; urgency=medium
 
-  * Fix timer handling under HHVM 
+  * Fix timer handling under HHVM
 
  -- Giuseppe Lavagetto   Thu, 11 Sep 2014 10:29:34 
+0200
 
@@ -33,7 +39,7 @@
 
 php-luasandbox (2.0-4) trusty-wikimeda; urgency=medium
 
-  * Make the package depend on hhvm version, new build for hhvm 
+  * Make the package depend on hhvm version, new build for hhvm
 
  -- Giuseppe Lavagetto   Mon, 28 Jul 2014 18:09:48 
+0200
 
@@ -115,7 +121,7 @@
   * Add wrapPhpFunction
   * Fix Mac OS X compilation
   * Fix compilation against LuaJIT
-  * Support metatable override of pairs() and ipairs(), like Lua 5.2 
+  * Support metatable override of pairs() and ipairs(), like Lua 5.2
 
  -- Tim Starling   Wed, 20 Feb 2013 14:54:44 +1100
 
diff --git a/debian/control b/debian/control
index 7c3b82a..dbea8bb 100644
--- a/debian/control
+++ b/debian/control
@@ -6,6 +6,7 @@
liblua5.1-0-dev,
pkg-config,
php5-dev (<< 5.5) | php5-dev (>= 5.5),
+   php5-dev (<< 5.5) | hhvm,
php5-dev (<< 5.5) | hhvm-dev,
php5-dev (<< 5.5) | cmake,
php5-dev (<< 5.5) | libboost-dev,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I85e9825e70c7f9c5b5e52a01b07fab71c6e48683
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/php/luasandbox
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Lavagetto 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Giuseppe Lavagetto 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Improve robustness of DOMDiff data-mw diff testing - change (mediawiki...parsoid)

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

Change subject: Improve robustness of DOMDiff data-mw diff testing
..


Improve robustness of DOMDiff data-mw diff testing

* When diffing 'id' and 'html' property values, treat them as
  DOM references only when they are found in data-mw.body since
  they are acceptable DOM formats for body there (according to
  the mediawiki DOM spec). In other places, they are treated
  just like any other attribute.

* Removed the -specific check I added in 9c14faf7 since the
  new check covers that scenario as well

* Fixes crasher for nlwiki:Sjien and enwiki:John_Carnell (fixed
  as part of 9c14faf7 doesn't crash either)

Change-Id: I50304a442655d326c35bff13f9877c534816df19
---
M lib/mediawiki.DOMDiff.js
1 file changed, 17 insertions(+), 6 deletions(-)

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



diff --git a/lib/mediawiki.DOMDiff.js b/lib/mediawiki.DOMDiff.js
index 6297720..64f93da 100644
--- a/lib/mediawiki.DOMDiff.js
+++ b/lib/mediawiki.DOMDiff.js
@@ -67,7 +67,17 @@
  * - for id attributes, the DOM fragments are fetched and compared
  */
 DDP.dataMWEquals = function(nodeA, dmwA, nodeB, dmwB) {
-   var isRef = /\bmw:Extension\/ref\b/.test(nodeA.getAttribute("typeof"));
+   return this._dataMWEquals(nodeA, dmwA, nodeB, dmwB, {
+   isTopLevel: true, inDmwBody: false
+   });
+};
+
+/**
+ * According to MediaWiki_DOM_spec, id and html attributes are acceptable
+ * formats in data-mw.body and in those contexts, they reference DOMs and
+ * we are going to treat them as such.
+ */
+DDP._dataMWEquals = function(nodeA, dmwA, nodeB, dmwB, options) {
var keysA = Object.keys(dmwA);
var keysB = Object.keys(dmwB);
 
@@ -100,7 +110,7 @@
}
} else if (vA.constructor !== vB.constructor) {
return false;
-   } else if (kA === 'id' && isRef) {
+   } else if (kA === 'id' && options.inDmwBody) {
// For  in  the element id can refer 
to the
// global DOM, not the owner document DOM.
var htmlA = nodeA.ownerDocument.getElementById(vA)
@@ -119,7 +129,7 @@
}
if (!htmlB) {
this.env.log("error",
-   " node with nonexistent 
body id in edied DOM: ",
+   " node with nonexistent 
body id in edited DOM: ",
nodeB.outerHTML, "; id: ", 
JSON.stringify(vB));
}
 
@@ -128,14 +138,15 @@
return false;
}
}
-   } else if (kA === 'html') {
+   } else if (kA === 'html' && options.inDmwBody) {
// For 'html' attributes, parse string and recursively 
compare DOM
if (!this.treeEquals(DU.parseHTML(vA).body, 
DU.parseHTML(vB).body, true)) {
return false;
}
} else if (vA.constructor === Object || Array.isArray(vA)) {
-   // For 'array' and 'object' attributes, recursively 
apply dataMWEquals
-   if (!this.dataMWEquals(nodeA, vA, nodeB, vB)) {
+   // For 'array' and 'object' attributes, recursively 
apply _dataMWEquals
+   var inDmwBody = options.isTopLevel && kA === 'body';
+   if (!this._dataMWEquals(nodeA, vA, nodeB, vB, { 
inDmwBody: inDmwBody })) {
return false;
}
} else if (vA !== vB) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I50304a442655d326c35bff13f9877c534816df19
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry 
Gerrit-Reviewer: Arlolra 
Gerrit-Reviewer: Cscott 
Gerrit-Reviewer: Marcoil 
Gerrit-Reviewer: Subramanya Sastry 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] luasandbox: depend on the HHVM runtime. - change (mediawiki...luasandbox)

2015-05-22 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has uploaded a new change for review.

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

Change subject: luasandbox: depend on the HHVM runtime.
..

luasandbox: depend on the HHVM runtime.

Since we use hhvm to get the api version for HHVM extensions, we should
add it as a build dependency.

Change-Id: I85e9825e70c7f9c5b5e52a01b07fab71c6e48683
---
M debian/control
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/php/luasandbox 
refs/changes/89/212789/1

diff --git a/debian/control b/debian/control
index 7c3b82a..d284bb4 100644
--- a/debian/control
+++ b/debian/control
@@ -6,6 +6,7 @@
liblua5.1-0-dev,
pkg-config,
php5-dev (<< 5.5) | php5-dev (>= 5.5),
+php5-dev (<< 5.5) | hhvm,
php5-dev (<< 5.5) | hhvm-dev,
php5-dev (<< 5.5) | cmake,
php5-dev (<< 5.5) | libboost-dev,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I85e9825e70c7f9c5b5e52a01b07fab71c6e48683
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/php/luasandbox
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Lavagetto 

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


[MediaWiki-commits] [Gerrit] Use $.on in place of deprecated $.live - change (mediawiki...DonationInterface)

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

Change subject: Use $.on in place of deprecated $.live
..


Use $.on in place of deprecated $.live

This was removed in jQuery 1.9 and breaks under MediaWiki core 1.25.

Bug: T94528
Change-Id: If1c613973311add1317976323abefb1200434c1a
---
M adyen_gateway/forms/js/adyen.js
M globalcollect_gateway/forms/js/gc.boletos.js
M globalcollect_gateway/forms/js/gc.cc.js
M globalcollect_gateway/forms/js/gc.dd.js
M globalcollect_gateway/forms/js/gc.ew.js
M globalcollect_gateway/forms/js/webitects.bt.js
M globalcollect_gateway/forms/js/webitects2nd-US.js
M globalcollect_gateway/forms/js/webitects2nd.js
M globalcollect_gateway/forms/js/webitects_2_3step.js
M paypal_gateway/forms/js/paypal.js
10 files changed, 16 insertions(+), 16 deletions(-)

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



diff --git a/adyen_gateway/forms/js/adyen.js b/adyen_gateway/forms/js/adyen.js
index d8b9aa7..8e1afca 100644
--- a/adyen_gateway/forms/js/adyen.js
+++ b/adyen_gateway/forms/js/adyen.js
@@ -164,7 +164,7 @@
$( '#topError' ).html( paymentErrorString );
}
 
-   $( '#paymentContinueBtn' ).live( 'click', function () {
+   $( '#paymentContinueBtn' ).on( 'click', function () {
if ( validate_personal( document.payment ) && validateAmount() 
) {
$( '#payment' ).animate( { height: '250px' }, 1000 );
displayCreditCardForm();
diff --git a/globalcollect_gateway/forms/js/gc.boletos.js 
b/globalcollect_gateway/forms/js/gc.boletos.js
index 3c0dd10..4aedae4 100644
--- a/globalcollect_gateway/forms/js/gc.boletos.js
+++ b/globalcollect_gateway/forms/js/gc.boletos.js
@@ -2,7 +2,7 @@
 $( document ).ready( function () {
displayErrors();
 
-   $( '#continueBtn' ).live( 'click', function () {
+   $( '#continueBtn' ).on( 'click', function () {
if ( validateAmount() && validate_form( document.payment ) ) {
document.payment.action = actionURL;
document.payment.submit();
diff --git a/globalcollect_gateway/forms/js/gc.cc.js 
b/globalcollect_gateway/forms/js/gc.cc.js
index 636bb2d..795e16e 100644
--- a/globalcollect_gateway/forms/js/gc.cc.js
+++ b/globalcollect_gateway/forms/js/gc.cc.js
@@ -45,7 +45,7 @@
$( '#topError' ).html( paymentErrorString );
}
 
-   $( '#paymentContinueBtn' ).live( 'click', function () {
+   $( '#paymentContinueBtn' ).on( 'click', function () {
if ( validate_personal( document.payment ) && validateAmount() 
) {
$( '#payment' ).animate( { height: '314px' }, 1000 );
displayCreditCardForm();
@@ -55,7 +55,7 @@
} );
 
// Set the cards to progress to step 3
-   $( '.cardradio' ).live( 'change', function (event) {
+   $( '.cardradio' ).on( 'change', function (event) {
 
if ( validate_personal( document.payment ) && validateAmount() 
) {
$( '#payment' ).animate( { height: '314px' }, 1000 );
diff --git a/globalcollect_gateway/forms/js/gc.dd.js 
b/globalcollect_gateway/forms/js/gc.dd.js
index 4c06515..cd0500b 100644
--- a/globalcollect_gateway/forms/js/gc.dd.js
+++ b/globalcollect_gateway/forms/js/gc.dd.js
@@ -2,7 +2,7 @@
 $( document ).ready( function () {
displayErrors();
 
-   $( '#bt-continueBtn' ).live( 'click', function () {
+   $( '#bt-continueBtn' ).on( 'click', function () {
if ( validateAmount() && validate_form( document.payment ) ) {
document.payment.action = actionURL;
document.payment.submit();
diff --git a/globalcollect_gateway/forms/js/gc.ew.js 
b/globalcollect_gateway/forms/js/gc.ew.js
index 05e4ebf..45f906e 100644
--- a/globalcollect_gateway/forms/js/gc.ew.js
+++ b/globalcollect_gateway/forms/js/gc.ew.js
@@ -41,7 +41,7 @@
$( '#topError' ).html( paymentErrorString );
}
 
-   $( '#bt-continueBtn' ).live( 'click', function () {
+   $( '#bt-continueBtn' ).on( 'click', function () {
if ( validateAmount() ) { //&& validate_personal( 
document.paypalcontribution ) ) {
document.paypalcontribution.action = actionURL;
document.paypalcontribution.submit();
diff --git a/globalcollect_gateway/forms/js/webitects.bt.js 
b/globalcollect_gateway/forms/js/webitects.bt.js
index 31f9a9f..866ff0c 100644
--- a/globalcollect_gateway/forms/js/webitects.bt.js
+++ b/globalcollect_gateway/forms/js/webitects.bt.js
@@ -53,7 +53,7 @@
$( '#paymentErrorMessages' ).html( paymentErrorString );
showAmount( $( 'input[name="amount"]' ) ); // lets go ahead and 
assume there is something to show
}
-   $( '#bt-continueBtn' ).live( 'click', function () {
+   $( '#bt-continueB

[MediaWiki-commits] [Gerrit] Fix s - change (analytics...web)

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

Change subject: Fix s
..


Fix s

A duplicate tag was added with
commit a7c0b476761955fd87b732dc8192e43433c7115a

Change-Id: Iff9861bdf4b4cf0215f9b1c06342b5a6e5b91426
---
M quarry/web/templates/base.html
M quarry/web/templates/query/view.html
2 files changed, 2 insertions(+), 3 deletions(-)

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



diff --git a/quarry/web/templates/base.html b/quarry/web/templates/base.html
index dc252de..7f7ec25 100644
--- a/quarry/web/templates/base.html
+++ b/quarry/web/templates/base.html
@@ -9,9 +9,8 @@
 
 
 
-Quarry
 
-{% block title %} {% endblock %} - Quarry
+{% block title %}Quarry{% endblock %}
 {% if jsvars %}
 
 var vars = {{jsvars|tojson}};
diff --git a/quarry/web/templates/query/view.html 
b/quarry/web/templates/query/view.html
index 7fcfe01..3ebd172 100644
--- a/quarry/web/templates/query/view.html
+++ b/quarry/web/templates/query/view.html
@@ -15,7 +15,7 @@