[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_30]: Improve populateIpChanges.php reporting

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/379351 )

Change subject: Improve populateIpChanges.php reporting
..


Improve populateIpChanges.php reporting

Instead of just the rows we attempted to insert, also count
actually inserted ones.

Change-Id: Ie747cb41873640776281794a90dbe3b6b8e3fa84
(cherry picked from commit 06913b853ddb971e400c2bf3829fa4b40c260afa)
---
M maintenance/populateIpChanges.php
1 file changed, 6 insertions(+), 3 deletions(-)

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



diff --git a/maintenance/populateIpChanges.php 
b/maintenance/populateIpChanges.php
index f7bcc12..2b2a2b4 100644
--- a/maintenance/populateIpChanges.php
+++ b/maintenance/populateIpChanges.php
@@ -72,7 +72,8 @@
? $maxRevId
: $dbw->selectField( 'revision', 'MAX(rev_id)', false, 
__METHOD__ );
$blockStart = $start;
-   $revCount = 0;
+   $attempted = 0;
+   $inserted = 0;
 
$this->output( "Copying IP revisions to ip_changes, from rev_id 
$start to rev_id $end\n" );
 
@@ -105,7 +106,7 @@
'ipc_hex' => IP::toHex( 
$row->rev_user_text ),
];
 
-   $revCount++;
+   $attempted++;
}
}
 
@@ -116,13 +117,15 @@
'IGNORE'
);
 
+   $inserted += $dbw->affectedRows();
+
$lbFactory->waitForReplication();
usleep( $throttle * 1000 );
 
$blockStart = $blockEnd + 1;
}
 
-   $this->output( "$revCount IP revisions copied.\n" );
+   $this->output( "Attempted to insert $attempted IP revisions, 
$inserted actually done.\n" );
 
return true;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie747cb41873640776281794a90dbe3b6b8e3fa84
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_30
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_30]: RCFilters: Don't grey out results area when initializing, un...

2017-09-28 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381389 )

Change subject: RCFilters: Don't grey out results area when initializing, 
unless there's a default saved query
..

RCFilters: Don't grey out results area when initializing, unless there's a 
default saved query

Check whether there is a default saved query on the server side, and if there 
is,
add the mw-rcfilters-ui-loading class.

Also centralize the code related to the saved query preferences.

Bug: T173533
Change-Id: I4138fde22bdd8cc55c65846b91184c3ad3057244
(cherry picked from commit 78703ae9f6eb888a78356124f43dc0c0005fc3d2)
---
M includes/specialpage/ChangesListSpecialPage.php
M includes/specials/SpecialRecentchanges.php
M includes/specials/SpecialWatchlist.php
M resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
M resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
5 files changed, 31 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/89/381389/1

diff --git a/includes/specialpage/ChangesListSpecialPage.php 
b/includes/specialpage/ChangesListSpecialPage.php
index 98b7aa1..dd0dd92 100644
--- a/includes/specialpage/ChangesListSpecialPage.php
+++ b/includes/specialpage/ChangesListSpecialPage.php
@@ -32,6 +32,12 @@
  * @ingroup SpecialPage
  */
 abstract class ChangesListSpecialPage extends SpecialPage {
+   /**
+* Preference name for saved queries. Subclasses that use saved queries 
should override this.
+* @var string
+*/
+   protected static $savedQueriesPreferenceName;
+
/** @var string */
protected $rcSubpage;
 
@@ -602,6 +608,7 @@

'wgStructuredChangeFiltersEnableExperimentalViews',
$experimentalStructuredChangeFilters
);
+
$out->addJsConfigVars(
'wgRCFiltersChangeTags',
$this->buildChangeTagList()
@@ -616,6 +623,21 @@
'daysDefault' => 
$this->getDefaultDays(),
]
);
+
+   if ( static::$savedQueriesPreferenceName ) {
+   $savedQueries = FormatJson::decode(
+   $this->getUser()->getOption( 
static::$savedQueriesPreferenceName )
+   );
+   if ( $savedQueries && isset( 
$savedQueries->default ) ) {
+   // If there is a default saved query, 
show a loading spinner,
+   // since the frontend is going to 
reload the results
+   $out->addBodyClasses( 
'mw-rcfilters-ui-loading' );
+   }
+   $out->addJsConfigVars(
+   
'wgStructuredChangeFiltersSavedQueriesPreferenceName',
+   static::$savedQueriesPreferenceName
+   );
+   }
} else {
$out->addBodyClasses( 'mw-rcfilters-disabled' );
}
diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index 15c05ee..40834cb 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -32,6 +32,8 @@
  */
 class SpecialRecentChanges extends ChangesListSpecialPage {
 
+   protected static $savedQueriesPreferenceName = 
'rcfilters-saved-queries';
+
private $watchlistFilterGroupDefinition;
 
// @codingStandardsIgnoreStart Needed "useless" override to change 
parameters.
@@ -165,10 +167,6 @@
 
if ( $this->isStructuredFilterUiEnabled() ) {
$out->addJsConfigVars( 
'wgStructuredChangeFiltersLiveUpdateSupported', true );
-   $out->addJsConfigVars(
-   
'wgStructuredChangeFiltersSavedQueriesPreferenceName',
-   'rcfilters-saved-queries'
-   );
}
}
 
diff --git a/includes/specials/SpecialWatchlist.php 
b/includes/specials/SpecialWatchlist.php
index 8418865..4f4570e 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -32,6 +32,8 @@
  * @ingroup SpecialPage
  */
 class SpecialWatchlist extends ChangesListSpecialPage {
+   protected static $savedQueriesPreferenceName = 
'rcfilters-wl-saved-queries';
+
private $maxDays;
 
public function __construct( $page = 'Watchlist', $restriction = 
'viewmywatchlist' ) {
@@ -100,10 +102,6 @@
$output->addModuleStyles( [ 
'mediawiki.rcfilters.highlightCircles.seenunseen.styles' ] );
 
   

[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_30]: Yet another attempt to fix the populateIpChanges script

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381387 )

Change subject: Yet another attempt to fix the populateIpChanges script
..


Yet another attempt to fix the populateIpChanges script

It would seem we'd need to update $blockStart if there are no results
for a given block, and more importantly, continue and not break!

Bug: T175962
Change-Id: Ice1bdae3d16cf365da14c6df0e8d91d2b954e064
(cherry picked from commit ffba23d177d5eee876bdc59cdf1b945281b18041)
---
M maintenance/populateIpChanges.php
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/maintenance/populateIpChanges.php 
b/maintenance/populateIpChanges.php
index 17f49ee..f7bcc12 100644
--- a/maintenance/populateIpChanges.php
+++ b/maintenance/populateIpChanges.php
@@ -88,7 +88,8 @@
$numRows = $rows->numRows();
 
if ( !$rows || $numRows === 0 ) {
-   break;
+   $blockStart = $blockEnd + 1;
+   continue;
}
 
$this->output( "...checking $numRows revisions for IP 
edits that need copying, " .

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ice1bdae3d16cf365da14c6df0e8d91d2b954e064
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_30
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: MusikAnimal 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_30]: Attempt to fix populateIpChanges maintenance script

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/379346 )

Change subject: Attempt to fix populateIpChanges maintenance script
..


Attempt to fix populateIpChanges maintenance script

With the previous edition, some IP revisions failed to copy,
e.g. rev_id 1507693 on enwikivoyage. This change first fixes to go
by mBatchSize, and removes other redundant clauses in the query.

Bug: T175962
Change-Id: Ia5f3e275d8bef120090b4c60e6aec4c204d55d53
(cherry picked from commit db7e32441d2ae823d8c73506f4f13fad55ba7164)
---
M maintenance/populateIpChanges.php
1 file changed, 9 insertions(+), 10 deletions(-)

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



diff --git a/maintenance/populateIpChanges.php 
b/maintenance/populateIpChanges.php
index c173270..17f49ee 100644
--- a/maintenance/populateIpChanges.php
+++ b/maintenance/populateIpChanges.php
@@ -77,25 +77,26 @@
$this->output( "Copying IP revisions to ip_changes, from rev_id 
$start to rev_id $end\n" );
 
while ( $blockStart <= $end ) {
-   $blockEnd = min( $blockStart + 200, $end );
+   $blockEnd = min( $blockStart + $this->mBatchSize, $end 
);
$rows = $dbr->select(
'revision',
[ 'rev_id', 'rev_timestamp', 'rev_user_text' ],
[ "rev_id BETWEEN $blockStart AND $blockEnd", 
'rev_user' => 0 ],
-   __METHOD__,
-   [ 'ORDER BY' => 'rev_id ASC', 'LIMIT' => 
$this->mBatchSize ]
+   __METHOD__
);
 
-   if ( !$rows || $rows->numRows() === 0 ) {
+   $numRows = $rows->numRows();
+
+   if ( !$rows || $numRows === 0 ) {
break;
}
 
-   $this->output( "...checking $this->mBatchSize revisions 
for IP edits that need copying, " .
+   $this->output( "...checking $numRows revisions for IP 
edits that need copying, " .
"between rev_ids $blockStart and $blockEnd\n" );
 
$insertRows = [];
foreach ( $rows as $row ) {
-   // Double-check to make sure this is an IP, 
e.g. not maintenance user or imported revision.
+   // Make sure this is really an IP, e.g. not 
maintenance user or imported revision.
if ( IP::isValid( $row->rev_user_text ) ) {
$insertRows[] = [
'ipc_rev_id' => $row->rev_id,
@@ -105,11 +106,7 @@
 
$revCount++;
}
-
-   $blockStart = (int)$row->rev_id;
}
-
-   $blockStart++;
 
$dbw->insert(
'ip_changes',
@@ -120,6 +117,8 @@
 
$lbFactory->waitForReplication();
usleep( $throttle * 1000 );
+
+   $blockStart = $blockEnd + 1;
}
 
$this->output( "$revCount IP revisions copied.\n" );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia5f3e275d8bef120090b4c60e6aec4c204d55d53
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_30
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: MusikAnimal 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Respect beta feature in new wikitext editor

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/374898 )

Change subject: Respect beta feature in new wikitext editor
..


Respect beta feature in new wikitext editor

Bug: T173480
Change-Id: I2ca5a33f09aefe0c3d31082270869a13cee14fc4
---
M CodeMirror.hooks.php
M resources/modules/ve-cm/ve.ui.CodeMirror.init.js
2 files changed, 28 insertions(+), 14 deletions(-)

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



diff --git a/CodeMirror.hooks.php b/CodeMirror.hooks.php
index ef61fbf..dd2725e 100644
--- a/CodeMirror.hooks.php
+++ b/CodeMirror.hooks.php
@@ -3,7 +3,7 @@
 class CodeMirrorHooks {
 
/**
-* Checks, if CodeMirror should be loaded on this page or not.
+* Checks if CodeMirror is enabled for this user
 *
 * @param IContextSource $context The current ContextSource object
 * @staticvar null|boolean $isEnabled Saves, if CodeMirror should be 
loaded on this page or not
@@ -16,10 +16,9 @@
// Check, if we already checked, if page action is editing, if 
not, do it now
if ( $isEnabled === null ) {
if ( !$wgCodeMirrorBetaFeature ) {
-   $isEnabled = in_array( Action::getActionName( 
$context ), [ 'edit', 'submit' ] );
+   $isEnabled = true;
} else {
-   $isEnabled = in_array( Action::getActionName( 
$context ), [ 'edit', 'submit' ] ) &&
-   $wgCodeMirrorBetaFeature &&
+   $isEnabled = $wgCodeMirrorBetaFeature &&

ExtensionRegistry::getInstance()->isLoaded( 'BetaFeatures' ) &&
BetaFeatures::isFeatureEnabled(
$context->getUser(), 
'codemirror-syntax-highlight' );
@@ -27,6 +26,18 @@
}
 
return $isEnabled;
+   }
+
+   /**
+* Checks if CodeMirror for textarea wikitext editor should be loaded 
on this page or not.
+*
+* @param IContextSource $context The current ContextSource object
+* @staticvar null|boolean $isEnabled Saves, if CodeMirror should be 
loaded on this page or not
+* @return bool
+*/
+   private static function isCodeMirrorOnPage( IContextSource $context ) {
+   return in_array( Action::getActionName( $context ), [ 'edit', 
'submit' ] ) &&
+   self::isCodeMirrorEnabled( $context );
}
 
/**
@@ -38,9 +49,10 @@
 * @param Skin $skin
 */
public static function onBeforePageDisplay( OutputPage &$out, Skin 
&$skin ) {
-   if ( self::isCodeMirrorEnabled( $out->getContext() ) ) {
+   if ( self::isCodeMirrorOnPage( $out->getContext() ) ) {
$out->addModules( 'ext.CodeMirror' );
}
+   $out->addJsConfigVars( 'wgCodeMirrorEnabled', 
self::isCodeMirrorEnabled( $out->getContext() ) );
}
 
/**
diff --git a/resources/modules/ve-cm/ve.ui.CodeMirror.init.js 
b/resources/modules/ve-cm/ve.ui.CodeMirror.init.js
index 4708879..11a85e4 100644
--- a/resources/modules/ve-cm/ve.ui.CodeMirror.init.js
+++ b/resources/modules/ve-cm/ve.ui.CodeMirror.init.js
@@ -1,12 +1,14 @@
 ( function ( ve, mw ) {
-   mw.libs.ve.targetLoader.addPlugin( function () {
-   var i, target, index;
-   for ( i in ve.init.mw ) {
-   target = ve.init.mw[ i ];
-   if ( target === ve.init.mw.DesktopArticleTarget ) {
-   index = target.static.actionGroups[ 1 
].include.indexOf( 'changeDirectionality' );
-   target.static.actionGroups[ 1 ].include.splice( 
index, 0, 'codeMirror' );
+   if ( mw.config.get( 'wgCodeMirrorEnabled' ) ) {
+   mw.libs.ve.targetLoader.addPlugin( function () {
+   var i, target, index;
+   for ( i in ve.init.mw ) {
+   target = ve.init.mw[ i ];
+   if ( target === ve.init.mw.DesktopArticleTarget 
) {
+   index = target.static.actionGroups[ 1 
].include.indexOf( 'changeDirectionality' );
+   target.static.actionGroups[ 1 
].include.splice( index, 0, 'codeMirror' );
+   }
}
-   }
-   } );
+   } );
+   }
 }( ve, mediaWiki ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Update cleanupSpam.php to hide its activity from RecentChanges

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/379003 )

Change subject: Update cleanupSpam.php to hide its activity from RecentChanges
..


Update cleanupSpam.php to hide its activity from RecentChanges

Spam cleanup activities, mostly when it comes from automated processes
(the so called 'spambots') can involve a fair ammount of edits and log
actions to accomplish.

As such, to avoid flooding Special:RecentChanges, this script will now
set a bot flag on the script run so its edits and actions won't show
up in that special page.

To prepare this patch I had the help of Bartosz Dziewoński which I'd
also like to thank and I'll credit as co-author as well.

Bug: T176206
Co-Authored-By: Bartosz Dziewoński 
Change-Id: Ifde08056a7481b877b4b82699cc0a5ea3f962dd9
---
M maintenance/cleanupSpam.php
1 file changed, 6 insertions(+), 6 deletions(-)

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



diff --git a/maintenance/cleanupSpam.php b/maintenance/cleanupSpam.php
index 4e47cfb..fc3cc5b 100644
--- a/maintenance/cleanupSpam.php
+++ b/maintenance/cleanupSpam.php
@@ -49,10 +49,9 @@
if ( !$wgUser ) {
$this->error( "Invalid username specified in 
'spambot_username' message: $username", true );
}
-   // Create the user if necessary
-   if ( !$wgUser->getId() ) {
-   $wgUser->addToDatabase();
-   }
+   // Hack: Grant bot rights so we don't flood RecentChanges
+   $wgUser->addGroup( 'bot' );
+
$spec = $this->getArg();
$like = LinkFilter::makeLikeArray( $spec );
if ( !$like ) {
@@ -131,7 +130,7 @@
$page->doEditContent(
$content,
wfMessage( 'spam_reverting', $domain 
)->inContentLanguage()->text(),
-   EDIT_UPDATE,
+   EDIT_UPDATE | EDIT_FORCE_BOT,
$rev->getId()
);
} elseif ( $this->hasOption( 'delete' ) ) {
@@ -148,7 +147,8 @@
$this->output( "blanking\n" );
$page->doEditContent(
$content,
-   wfMessage( 'spam_blanking', $domain 
)->inContentLanguage()->text()
+   wfMessage( 'spam_blanking', $domain 
)->inContentLanguage()->text(),
+   EDIT_UPDATE | EDIT_FORCE_BOT
);
}
$this->commitTransaction( $dbw, __METHOD__ );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifde08056a7481b877b4b82699cc0a5ea3f962dd9
Gerrit-PatchSet: 13
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: MacFan4000 
Gerrit-Reviewer: MarcoAurelio 
Gerrit-Reviewer: MusikAnimal 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_30]: Fix ip_changes insert counting

2017-09-28 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381388 )

Change subject: Fix ip_changes insert counting
..

Fix ip_changes insert counting

Change-Id: I02b457d9dcaadc97eead623e42a5a1ccf8335724
(cherry picked from commit 548e0da3278ae1cac8f5a5caed632e0f5eefb942)
---
M maintenance/populateIpChanges.php
1 file changed, 4 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/88/381388/1

diff --git a/maintenance/populateIpChanges.php 
b/maintenance/populateIpChanges.php
index 2b2a2b4..40a596c 100644
--- a/maintenance/populateIpChanges.php
+++ b/maintenance/populateIpChanges.php
@@ -110,14 +110,11 @@
}
}
 
-   $dbw->insert(
-   'ip_changes',
-   $insertRows,
-   __METHOD__,
-   'IGNORE'
-   );
+   if ( $insertRows ) {
+   $dbw->insert( 'ip_changes', $insertRows, 
__METHOD__, 'IGNORE' );
 
-   $inserted += $dbw->affectedRows();
+   $inserted += $dbw->affectedRows();
+   }
 
$lbFactory->waitForReplication();
usleep( $throttle * 1000 );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I02b457d9dcaadc97eead623e42a5a1ccf8335724
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_30
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_30]: Yet another attempt to fix the populateIpChanges script

2017-09-28 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381387 )

Change subject: Yet another attempt to fix the populateIpChanges script
..

Yet another attempt to fix the populateIpChanges script

It would seem we'd need to update $blockStart if there are no results
for a given block, and more importantly, continue and not break!

Bug: T175962
Change-Id: Ice1bdae3d16cf365da14c6df0e8d91d2b954e064
(cherry picked from commit ffba23d177d5eee876bdc59cdf1b945281b18041)
---
M maintenance/populateIpChanges.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/87/381387/1

diff --git a/maintenance/populateIpChanges.php 
b/maintenance/populateIpChanges.php
index 17f49ee..f7bcc12 100644
--- a/maintenance/populateIpChanges.php
+++ b/maintenance/populateIpChanges.php
@@ -88,7 +88,8 @@
$numRows = $rows->numRows();
 
if ( !$rows || $numRows === 0 ) {
-   break;
+   $blockStart = $blockEnd + 1;
+   continue;
}
 
$this->output( "...checking $numRows revisions for IP 
edits that need copying, " .

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice1bdae3d16cf365da14c6df0e8d91d2b954e064
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_30
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: MusikAnimal 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Improve namespace handling in tests

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/377496 )

Change subject: Improve namespace handling in tests
..


Improve namespace handling in tests

MWNamespace has three internal caches, only one of which can be cleared
(and that somewhat oddly by passing a boolean to
MWNamespace::getCanonicalNamespaces()).

This change introduces a MWNamespace::clearCaches() method to clear all
three caches. It also adds some resetting in tests that seemed to be
missing it.

Change-Id: I1dcfcd8713888b3ff8fc75e95329ba72bd95d0c9
---
M includes/MWNamespace.php
M tests/parser/ParserTestRunner.php
M tests/phpunit/includes/EditPageTest.php
M tests/phpunit/includes/PagePropsTest.php
M tests/phpunit/includes/PrefixSearchTest.php
M tests/phpunit/includes/RevisionStorageTest.php
M tests/phpunit/includes/RevisionTest.php
M tests/phpunit/includes/TitleMethodsTest.php
M tests/phpunit/includes/XmlTest.php
M tests/phpunit/includes/api/ApiEditPageTest.php
M tests/phpunit/includes/content/ContentHandlerTest.php
11 files changed, 82 insertions(+), 38 deletions(-)

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



diff --git a/includes/MWNamespace.php b/includes/MWNamespace.php
index 97dba26..f2f98ba 100644
--- a/includes/MWNamespace.php
+++ b/includes/MWNamespace.php
@@ -38,6 +38,15 @@
 */
private static $alwaysCapitalizedNamespaces = [ NS_SPECIAL, NS_USER, 
NS_MEDIAWIKI ];
 
+   /** @var string[]|null Canonical namespaces cache */
+   private static $canonicalNamespaces = null;
+
+   /** @var array|false Canonical namespaces index cache */
+   private static $namespaceIndexes = false;
+
+   /** @var int[]|null Valid namespaces cache */
+   private static $validNamespaces = null;
+
/**
 * Throw an exception when trying to get the subject or talk page
 * for a given namespace where it does not make sense.
@@ -55,6 +64,19 @@
throw new MWException( "$method does not make any sense 
for given namespace $index" );
}
return true;
+   }
+
+   /**
+* Clear internal caches
+*
+* For use in unit testing when namespace configuration is changed.
+*
+* @since 1.31
+*/
+   public static function clearCaches() {
+   self::$canonicalNamespaces = null;
+   self::$namespaceIndexes = false;
+   self::$validNamespaces = null;
}
 
/**
@@ -200,23 +222,28 @@
 * (English) names.
 *
 * @param bool $rebuild Rebuild namespace list (default = false). Used 
for testing.
+*  Deprecated since 1.31, use self::clearCaches() instead.
 *
 * @return array
 * @since 1.17
 */
public static function getCanonicalNamespaces( $rebuild = false ) {
-   static $namespaces = null;
-   if ( $namespaces === null || $rebuild ) {
-   global $wgExtraNamespaces, $wgCanonicalNamespaceNames;
-   $namespaces = [ NS_MAIN => '' ] + 
$wgCanonicalNamespaceNames;
-   // Add extension namespaces
-   $namespaces += 
ExtensionRegistry::getInstance()->getAttribute( 'ExtensionNamespaces' );
-   if ( is_array( $wgExtraNamespaces ) ) {
-   $namespaces += $wgExtraNamespaces;
-   }
-   Hooks::run( 'CanonicalNamespaces', [ &$namespaces ] );
+   if ( $rebuild ) {
+   self::clearCaches();
}
-   return $namespaces;
+
+   if ( self::$canonicalNamespaces === null ) {
+   global $wgExtraNamespaces, $wgCanonicalNamespaceNames;
+   self::$canonicalNamespaces = [ NS_MAIN => '' ] + 
$wgCanonicalNamespaceNames;
+   // Add extension namespaces
+   self::$canonicalNamespaces +=
+   ExtensionRegistry::getInstance()->getAttribute( 
'ExtensionNamespaces' );
+   if ( is_array( $wgExtraNamespaces ) ) {
+   self::$canonicalNamespaces += 
$wgExtraNamespaces;
+   }
+   Hooks::run( 'CanonicalNamespaces', [ 
::$canonicalNamespaces ] );
+   }
+   return self::$canonicalNamespaces;
}
 
/**
@@ -242,15 +269,14 @@
 * @return int
 */
public static function getCanonicalIndex( $name ) {
-   static $xNamespaces = false;
-   if ( $xNamespaces === false ) {
-   $xNamespaces = [];
+   if ( self::$namespaceIndexes === false ) {
+   self::$namespaceIndexes = [];
foreach ( 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix patchfile used to add newtalk table on mysql

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/376662 )

Change subject: Fix patchfile used to add newtalk table on mysql
..


Fix patchfile used to add newtalk table on mysql

Remove orghaned patch-drop-user_newtalk.sql

Change-Id: I27ad5a628deedbab2e659200f003cdeb18ea3620
---
M includes/installer/MysqlUpdater.php
D maintenance/archives/patch-drop-user_newtalk.sql
2 files changed, 1 insertion(+), 4 deletions(-)

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



diff --git a/includes/installer/MysqlUpdater.php 
b/includes/installer/MysqlUpdater.php
index 2abc6b6..c63c59c 100644
--- a/includes/installer/MysqlUpdater.php
+++ b/includes/installer/MysqlUpdater.php
@@ -83,7 +83,7 @@
[ 'doUserUniqueUpdate' ],
[ 'doUserGroupsUpdate' ],
[ 'addField', 'site_stats', 'ss_total_pages', 
'patch-ss_total_articles.sql' ],
-   [ 'addTable', 'user_newtalk', 'patch-usernewtalk2.sql' 
],
+   [ 'addTable', 'user_newtalk', 'patch-usernewtalk.sql' ],
[ 'addTable', 'transcache', 'patch-transcache.sql' ],
[ 'addField', 'interwiki', 'iw_trans', 
'patch-interwiki-trans.sql' ],
 
diff --git a/maintenance/archives/patch-drop-user_newtalk.sql 
b/maintenance/archives/patch-drop-user_newtalk.sql
deleted file mode 100644
index 6ec84fb..000
--- a/maintenance/archives/patch-drop-user_newtalk.sql
+++ /dev/null
@@ -1,3 +0,0 @@
--- Patch for email authentication T.Gries/M.Arndt 27.11.2004
--- Table user_newtalk is dropped, as the table watchlist is now also used for 
storing user_talk-page notifications
-DROP TABLE /*$wgDBprefix*/user_newtalk;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I27ad5a628deedbab2e659200f003cdeb18ea3620
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Jjanes 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Do not include RC_EXTERNAL in number active users on Special...

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/380887 )

Change subject: Do not include RC_EXTERNAL in number active users on 
Special:Statistics
..


Do not include RC_EXTERNAL in number active users on Special:Statistics

We already exclude external (mostly Wikidata) actions from counting on
Special:ActiveUsers as of 56524c05. Should be consistent.

Change-Id: Ib69a614a65246a0f4f47365751f9bef130f47475
---
M includes/deferred/SiteStatsUpdate.php
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/includes/deferred/SiteStatsUpdate.php 
b/includes/deferred/SiteStatsUpdate.php
index 2f074ba..44876a6 100644
--- a/includes/deferred/SiteStatsUpdate.php
+++ b/includes/deferred/SiteStatsUpdate.php
@@ -149,6 +149,7 @@
'recentchanges',
'COUNT( DISTINCT rc_user_text )',
[
+   'rc_type != ' . $dbr->addQuotes( RC_EXTERNAL ), 
// Exclude external (Wikidata)
'rc_user != 0',
'rc_bot' => 0,
'rc_log_type != ' . $dbr->addQuotes( 'newusers' 
) . ' OR rc_log_type IS NULL',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib69a614a65246a0f4f47365751f9bef130f47475
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff 
Gerrit-Reviewer: Brian Wolff 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Lydia Pintscher (WMDE) 
Gerrit-Reviewer: Lydia Pintscher 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Revert "DumpFilter is autoloaded. No need to require in main...

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381064 )

Change subject: Revert "DumpFilter is autoloaded. No need to require in 
maintenance script"
..


Revert "DumpFilter is autoloaded. No need to require in maintenance script"

Broke dumps, turns out autoloader isn't infallible

This reverts commit f127125ec6b76f843fc73a1faba31d973e33bfa5.

Change-Id: I7711094351cf3f186730857ae59975e183daed1d
---
M maintenance/backup.inc
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/maintenance/backup.inc b/maintenance/backup.inc
index f1cd2b9..60b8a7a 100644
--- a/maintenance/backup.inc
+++ b/maintenance/backup.inc
@@ -25,6 +25,7 @@
  */
 
 require_once __DIR__ . '/Maintenance.php';
+require_once __DIR__ . '/../includes/export/DumpFilter.php';
 
 use Wikimedia\Rdbms\LoadBalancer;
 use Wikimedia\Rdbms\IDatabase;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7711094351cf3f186730857ae59975e183daed1d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Chad 
Gerrit-Reviewer: ArielGlenn 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: Umherirrender 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...cxserver[master]: Avoid hardcoding wikipedia.org domain for APIs

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/374493 )

Change subject: Avoid hardcoding wikipedia.org domain for APIs
..


Avoid hardcoding wikipedia.org domain for APIs

Make the host configurable. Defaults to {lang}.wikipedia.org

Bug: T172075
Change-Id: I8196b70280a9d2b756c1a4b2e877288d79ce3fa7
---
M config.dev.yaml
M config.prod.yaml
M lib/mw/ApiRequest.js
M lib/pageloader/PageLoader.js
4 files changed, 12 insertions(+), 4 deletions(-)

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



diff --git a/config.dev.yaml b/config.dev.yaml
index 39ac036..38625ac 100644
--- a/config.dev.yaml
+++ b/config.dev.yaml
@@ -48,6 +48,10 @@
   #   - domain1.com
   #   - domain2.org
   user_agent: cxserver
+  # Mediawiki host name. Example {lang}.wikisource.org which get expanded 
internally to
+  # es.wikisource.org in a spanish language context.
+  # Do not prefix with http or https://
+  # mw_host: '{lang}.wikipedia.org'
   mwapi_req:
 body: "{{request.body}}"
 query: "{{ default(request.query, {}) }}"
diff --git a/config.prod.yaml b/config.prod.yaml
index 4c4582e..a382dc3 100644
--- a/config.prod.yaml
+++ b/config.prod.yaml
@@ -48,6 +48,10 @@
   #   - domain1.com
   #   - domain2.org
   user_agent: cxserver
+  # Mediawiki host name. Example {lang}.wikisource.org which get expanded 
internaly to
+  # es.wikisource.org in a spanish language context.
+  # Do not prefix with http or https://
+  # mw_host: '{lang}.wikipedia.org'
   mwapi_req:
 body: "{{request.body}}"
 query: "{{ default(request.query, {}) }}"
diff --git a/lib/mw/ApiRequest.js b/lib/mw/ApiRequest.js
index c799e50..3576338 100644
--- a/lib/mw/ApiRequest.js
+++ b/lib/mw/ApiRequest.js
@@ -93,7 +93,7 @@
}
 
getDomain( language ) {
-   return this.getSiteCode( language ) + '.wikipedia.org';
+   return ( this.context.conf.mw_host || '{lang}.wikipedia.org' 
).replace( '{lang}', language );
}
 
/**
diff --git a/lib/pageloader/PageLoader.js b/lib/pageloader/PageLoader.js
index 9c7ed10..b1c8256 100644
--- a/lib/pageloader/PageLoader.js
+++ b/lib/pageloader/PageLoader.js
@@ -1,6 +1,7 @@
 'use strict';
 
-var apiUtil = require( '../api-util' );
+const apiUtil = require( '../api-util' );
+const ApiRequest = require( '../mw/ApiRequest' );
 
 function PageLoader( app ) {
this.app = app;
@@ -21,8 +22,7 @@
// We got an actual domain
domain = source;
} else {
-   // Assume the client means a WP project
-   domain = source + '.wikipedia.org';
+   domain = new ApiRequest( { context: this.app } ).getDomain( 
source );
}
 
if ( revision ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8196b70280a9d2b756c1a4b2e877288d79ce3fa7
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/services/cxserver
Gerrit-Branch: master
Gerrit-Owner: Santhosh 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: KartikMistry 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: Santhosh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Consistently preserve anchors in the title specified in 'mai...

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381134 )

Change subject: Consistently preserve anchors in the title specified in 
'mainpage' message
..


Consistently preserve anchors in the title specified in 'mainpage' message

When 'mainpage' was used in the 'sidebar' message, the anchor would be
preserved (code in Skin::addToSidebarPlain() uses Title::getLinkURL()).

When 'mainpage' was used on its own in Skin::makeMainPageUrl() (which
is used in SkinTemplate::buildNavUrls(), and many skins use that data
to generate the logo link), it would not be preserved (the code used
Title::getLocalURL()).

Bug: T176583
Change-Id: Icc4895c08089caaa06e37ce765819829b90de0ff
---
M includes/skins/Skin.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php
index 8fb0d1c..167b49d 100644
--- a/includes/skins/Skin.php
+++ b/includes/skins/Skin.php
@@ -1095,7 +1095,7 @@
$title = Title::newMainPage();
self::checkTitle( $title, '' );
 
-   return $title->getLocalURL( $urlaction );
+   return $title->getLinkURL( $urlaction );
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icc4895c08089caaa06e37ce765819829b90de0ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: objectcache: Improve WANObjectCache test coverage

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381270 )

Change subject: objectcache: Improve WANObjectCache test coverage
..


objectcache: Improve WANObjectCache test coverage

class WANObjectCache (methods: 40% -> 67%, lines: 65% -> 88%)

* Allow indirect coverage of protected/private utility methods from
  existing tests.
* Add basic test for setLogger().
* Add basic test for newEmpty().
* Add basic test for getQoS().

Change-Id: Ifb79ed2ff1febbd2f5477b8ed6319992ce88eb29
---
M tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
1 file changed, 57 insertions(+), 7 deletions(-)

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



diff --git a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php 
b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
index 137ef0c..0b2df61 100644
--- a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
+++ b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
@@ -2,6 +2,18 @@
 
 use Wikimedia\TestingAccessWrapper;
 
+/**
+ * @covers WANObjectCache::wrap
+ * @covers WANObjectCache::unwrap
+ * @covers WANObjectCache::worthRefreshExpiring
+ * @covers WANObjectCache::worthRefreshPopular
+ * @covers WANObjectCache::isValid
+ * @covers WANObjectCache::getWarmupKeyMisses
+ * @covers WANObjectCache::prefixCacheKeys
+ * @covers WANObjectCache::getProcessCache
+ * @covers WANObjectCache::getNonProcessCachedKeys
+ * @covers WANObjectCache::getRawKeysForWarmup
+ */
 class WANObjectCacheTest extends PHPUnit_Framework_TestCase {
/** @var WANObjectCache */
private $cache;
@@ -270,9 +282,9 @@
 
/**
 * @dataProvider getMultiWithSetCallback_provider
-* @covers WANObjectCache::getMultiWithSetCallback()
-* @covers WANObjectCache::makeMultiKeys()
-* @covers WANObjectCache::getMulti()
+* @covers WANObjectCache::getMultiWithSetCallback
+* @covers WANObjectCache::makeMultiKeys
+* @covers WANObjectCache::getMulti
 * @param array $extOpts
 * @param bool $versioned
 */
@@ -882,7 +894,9 @@
}
 
/**
-* @covers WANObjectCache::delete()
+* @covers WANObjectCache::delete
+* @covers WANObjectCache::relayDelete
+* @covers WANObjectCache::relayPurge
 */
public function testDelete() {
$key = wfRandomString();
@@ -988,9 +1002,11 @@
}
 
/**
-* @covers WANObjectCache::touchCheckKey()
-* @covers WANObjectCache::resetCheckKey()
-* @covers WANObjectCache::getCheckKeyTime()
+* @covers WANObjectCache::touchCheckKey
+* @covers WANObjectCache::resetCheckKey
+* @covers WANObjectCache::getCheckKeyTime
+* @covers WANObjectCache::makePurgeValue
+* @covers WANObjectCache::parsePurgeValue
 */
public function testTouchKeys() {
$key = wfRandomString();
@@ -1234,6 +1250,40 @@
}
 
/**
+* @covers WANObjectCache::__construct
+* @covers WANObjectCache::newEmpty
+*/
+   public function testNewEmpty() {
+   $this->assertInstanceOf(
+   WANObjectCache::class,
+   WANObjectCache::newEmpty()
+   );
+   }
+
+   /**
+* @covers WANObjectCache::setLogger
+*/
+   public function testSetLogger() {
+   $this->assertSame( null, $this->cache->setLogger( new 
Psr\Log\NullLogger ) );
+   }
+
+   /**
+* @covers WANObjectCache::getQoS
+*/
+   public function testGetQoS() {
+   $backend = $this->getMockBuilder( HashBagOStuff::class )
+   ->setMethods( [ 'getQoS' ] )->getMock();
+   $backend->expects( $this->once() )->method( 'getQoS' )
+   ->willReturn( BagOStuff::QOS_UNKNOWN );
+   $wanCache = new WANObjectCache( [ 'cache' => $backend ] );
+
+   $this->assertSame(
+   $wanCache::QOS_UNKNOWN,
+   $wanCache->getQoS( $wanCache::ATTR_EMULATION )
+   );
+   }
+
+   /**
 * @covers WANObjectCache::makeKey
 */
public function testMakeKey() {

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

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

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix CreditsAction when user has no real name set but real na...

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381160 )

Change subject: Fix CreditsAction when user has no real name set but real names 
enabled
..


Fix CreditsAction when user has no real name set but real names enabled

Change-Id: Ief347739a1231fa8bd814694bdb5b4f44ba41a77
---
M includes/actions/CreditsAction.php
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/includes/actions/CreditsAction.php 
b/includes/actions/CreditsAction.php
index 7025477..ed58686 100644
--- a/includes/actions/CreditsAction.php
+++ b/includes/actions/CreditsAction.php
@@ -198,6 +198,9 @@
protected function link( User $user ) {
if ( $this->canShowRealUserName() && !$user->isAnon() ) {
$real = $user->getRealName();
+   if ( $real === '' ) {
+   $real = $user->getName();
+   }
} else {
$real = $user->getName();
}

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

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

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


[MediaWiki-commits] [Gerrit] labs/toollabs[master]: Convert jsub to python3

2017-09-28 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381386 )

Change subject: Convert jsub to python3
..

Convert jsub to python3

Convert jsub to python3 and drop test and package dependencies on python2.

Change-Id: Iafbae519fd6c18d5c69fdbc5640c0bd8d26fc97f
---
M debian/control
M debian/rules
M jobutils/bin/jsub
M setup.py
M tox.ini
5 files changed, 33 insertions(+), 41 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/toollabs 
refs/changes/86/381386/1

diff --git a/debian/control b/debian/control
index 25167cf..0479dfe 100644
--- a/debian/control
+++ b/debian/control
@@ -6,24 +6,24 @@
  Carl Fürstenberg ,
  Tim Landscheidt ,
  Yuvi Panda 
-Build-Depends: debhelper (>= 8.0.0), dh-autoreconf, libipc-run-perl, 
libstring-shellquote-perl, bash-completion, python-dev, python-setuptools
+Build-Depends: debhelper (>= 8.0.0), dh-autoreconf, libipc-run-perl, 
libstring-shellquote-perl, bash-completion, python3-dev, python3-setuptools
 Standards-Version: 3.9.5
 Vcs-Git: https://gerrit.wikimedia.org/r/labs/toollabs
 Vcs-Browser: https://git.wikimedia.org/summary/labs%2Ftoollabs
-X-Python-Version: >= 2.7
+X-Python3-Version: >= 3.4
 
 Package: misctools
 Architecture: any
-Depends: ${misc:Depends}, ${shlibs:Depends}, ${python:Depends},
- mariadb-client-core-5.5, python, python3, python-mysql.connector
+Depends: ${misc:Depends}, ${shlibs:Depends}, ${python3:Depends},
+ mariadb-client-core-5.5, python3, python3-mysql.connector
 Description: Miscellaneous Labs-specific tools
  Miscellaneous Labs-specific Tools used on Tool Labs
 
 Package: jobutils
 Architecture: all
-Depends: ${misc:Depends}, ${perl:Depends}, ${python:Depends},
+Depends: ${misc:Depends}, ${perl:Depends}, ${python3:Depends},
  gridengine-client, libipc-run-perl, libstring-shellquote-perl,
- python, python3
+ python3
 Description: Set of utilities to use on wikimedia bots and tools cluster
  This package will install jstart (jsub) and jstop, the Tool Labs (more)
  user-friendly wrappers to submit jobs to the gridengine
diff --git a/debian/rules b/debian/rules
index 2114c9f..8e5cff5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -21,7 +21,7 @@
 
 
 %:
-   dh $@ --with autoreconf --with bash-completion --with python2
+   dh $@ --with autoreconf --with bash-completion --with python3
 
 # Make take setuid.
 override_dh_fixperms:
diff --git a/jobutils/bin/jsub b/jobutils/bin/jsub
index 82ccade..67cf9e9 100755
--- a/jobutils/bin/jsub
+++ b/jobutils/bin/jsub
@@ -1,10 +1,10 @@
-#!/usr/bin/python -Es
+#!/usr/bin/python3 -Es
 # -*- coding: utf-8 -*-
 #
 # Submit a job to the job grid.
 #
 # Copyright © 2013 Marc-André Pelletier 
-# Copyright © 2016 Wikimedia Foundation and contributors
+# Copyright © 2017 Wikimedia Foundation and contributors
 #
 # Permission to use, copy, modify, and/or distribute this software for any
 # purpose with or without fee is hereby granted, provided that the above
@@ -17,8 +17,6 @@
 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-from __future__ import print_function
 
 import argparse
 import copy
@@ -58,7 +56,7 @@
 """Parses an XXK, XXm, XXg to the # of kilobytes.
 
 >>> __name__ = 'doctest'
->>> execfile('jobutils/bin/jsub')
+>>> exec(open('jobutils/bin/jsub').read())
 >>> argparse_memkb('1k')
 1
 >>> argparse_memkb('1M')
@@ -68,7 +66,7 @@
 >>> argparse_memkb('pizza') # doctest: +ELLIPSIS
 Traceback (most recent call last):
 ...
-ArgumentTypeError: expected ... followed by 'k', 'm' or 'g'. 'pizza' given.
+argparse.ArgumentTypeError: expected ... 'k', 'm' or 'g'. 'pizza' given.
 >>>
 """
 m = re.match(r'^(?P\d+)(?P[kmg])(?i)$', val)
@@ -89,13 +87,13 @@
 """Validate and convert an octal string value to an int.
 
 >>> __name__ = 'doctest'
->>> execfile('jobutils/bin/jsub')
+>>> exec(open('jobutils/bin/jsub').read())
 >>> argparse_octal('0777')
 511
 >>> argparse_octal('9')
 Traceback (most recent call last):
 ...
-ArgumentTypeError: expected an octal value. '9' given.
+argparse.ArgumentTypeError: expected an octal value. '9' given.
 >>>
 """
 if not re.match(r'^[0-7]+$', val):
@@ -108,7 +106,7 @@
 """Validate a list of email addresses.
 
 >>> __name__ = 'doctest'
->>> execfile('jobutils/bin/jsub')
+>>> exec(open('jobutils/bin/jsub').read())
 >>> argparse_email('exam...@example.com')
 'exam...@example.com'
 >>> argparse_email('exam...@example.com,anot...@example.org')
@@ -116,7 +114,7 @@
 >>> argparse_email('foo')
 Traceback (most recent call last):
 ...
-ArgumentTypeError: expected list of 

[MediaWiki-commits] [Gerrit] labs/toollabs[master]: Convert list-user-databases to python3

2017-09-28 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381385 )

Change subject: Convert list-user-databases to python3
..

Convert list-user-databases to python3

Change-Id: I2a66912faf44e26e36d0a97bec6c250f5658f797
---
M misctools/list-user-databases
M tox.ini
2 files changed, 86 insertions(+), 52 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/toollabs 
refs/changes/85/381385/1

diff --git a/misctools/list-user-databases b/misctools/list-user-databases
index 5dc81eb..574ac89 100755
--- a/misctools/list-user-databases
+++ b/misctools/list-user-databases
@@ -1,63 +1,96 @@
-#!/usr/bin/python
+#!/usr/bin/python3 -Es
+# -*- coding: UTF-8 -*-
+#
+#  Copyright © 2013 Marc-André Pelletier 
+#  Copyright © 2017 Wikimedia Foundation and contributors
+#
+#  Permission to use, copy, modify, and/or distribute this software for any
+#  purpose with or without fee is hereby granted, provided that the above
+#  copyright notice and this permission notice appear in all copies.
+#
+#  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+#  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+#  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+#  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+#  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+#  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+#  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-import ConfigParser
 import argparse
-import os
+import configparser
 import re
 
 import mysql.connector
 
-if __name__ == '__main__':
-# Get list of defaults files to extract user information from.
-parser = argparse.ArgumentParser(description='List databases owned by 
users, given by the credentials files.')
-parser.add_argument('-H', '--host',
-action='append',
-required=True,
-help='database hosts to check')
-parser.add_argument('mycnffilenames',
-metavar='MYCNFFILENAME',
-nargs='+',
-help='name of MySQL defaults file')
-args = parser.parse_args()
+GRANT_REPLICA = "GRANT SELECT, SHOW VIEW ON `%\\_p`.* TO '{}'@'%'"
+GRANT_ANY_RE = (
+"^GRANT (SELECT, )?SHOW VIEW ON \*\.\* TO '{}'@'%'"
+"(?: IDENTIFIED BY PASSWORD '\*[0-9A-F]{{40}}')?$"
+)
+GRANT_ALL_RE = (
+"^GRANT ALL PRIVILEGES ON `([^`]+)`\.\* TO '{}'@'%'"
+"(?: WITH GRANT OPTION)?$"
+)
 
-for mycnffilename in args.mycnffilenames:
-c = ConfigParser.ConfigParser()
-c.read(mycnffilename)
-username = c.get('client', 'user').strip("'")
-password = c.get('client', 'password').strip("'")
-databases_found = []
-for server in args.host:
-conn = mysql.connector.connect(user=username,
-   password=password,
-   host=server,
-   database='mysql')
-cur = conn.cursor()
-cur.execute('SHOW GRANTS')
-database_patterns = []
-for (grantstatement, ) in cur.fetchall():
-# Ignore general grants for replica views.
-if grantstatement == 'GRANT SELECT, SHOW VIEW ON `%%\\_p`.* TO 
\'%s\'@\'%%\'' % username:
-continue
-if re.match('^GRANT SHOW VIEW ON \*\.\* TO \'%s\'@\'%%\'(?: 
IDENTIFIED BY PASSWORD \'\*[0-9A-F]{40}\')?$' % re.escape(username), 
grantstatement):
-continue
+# Get list of defaults files to extract user information from.
+parser = argparse.ArgumentParser(
+description=(
+'List databases owned by users, '
+'given by the credentials files.')
+)
+parser.add_argument(
+'-H', '--host',
+action='append',
+required=True,
+help='database hosts to check')
+parser.add_argument(
+'mycnffilenames',
+metavar='MYCNFFILENAME',
+nargs='+',
+help='name of MySQL defaults file')
+args = parser.parse_args()
 
-# Gather grants for user-specific databases.
-m = re.match('^GRANT ALL PRIVILEGES ON `([^`]+)`\.\* TO 
\'%s\'@\'%%\'(?: WITH GRANT OPTION)?$' % re.escape(username), grantstatement)
-if m:
-database_patterns.append(m.group(1))
-else:
-raise Exception('Cannot parse ' + repr(grantstatement))
+for mycnffilename in args.mycnffilenames:
+c = configparser.ConfigParser()
+c.read(mycnffilename)
+dbuser = c['client']['user'].strip("'")
+dbpass = c['client']['password'].strip("'")
+databases_found = []
+for server in args.host:
+conn = mysql.connector.connect(
+database='mysql',
+

[MediaWiki-commits] [Gerrit] integration/config[master]: Add base "npm" docker image

2017-09-28 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381384 )

Change subject: Add base "npm" docker image
..

Add base "npm" docker image

This is based off of the "contint::packages::javascript" puppet manifest.

Change-Id: I48ec70a795ea27233e058538c5bf7641ed375b12
---
A dockerfiles/npm/Dockerfile
1 file changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/84/381384/1

diff --git a/dockerfiles/npm/Dockerfile b/dockerfiles/npm/Dockerfile
new file mode 100644
index 000..22f8088
--- /dev/null
+++ b/dockerfiles/npm/Dockerfile
@@ -0,0 +1,15 @@
+FROM wmfreleng/ci-jessie:latest
+
+# Install nodejs-legacy to provide /usr/bin/node alias
+RUN apt-get update && \
+apt-get install --yes --no-install-recommends \
+nodejs-legacy npm && \
+apt-get clean && rm -rf /var/lib/apt/lists/*
+
+# DO NOT CHANGE VERSION WITHOUT INVOLVING Krinkle OR hashar
+RUN npm install -g npm@3.8.3
+
+USER nobody
+
+ENTRYPOINT ["npm"]
+CMD ["--help"]

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...cxserver[master]: Reference adaptation: Add a check for mt service

2017-09-28 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381383 )

Change subject: Reference adaptation: Add a check for mt service
..

Reference adaptation: Add a check for mt service

Not all language pairs has mt client. Avoid error if mtClient is
undefined.

Change-Id: I16c59984420d44f87f0610b4d18c3b76a2bd0e17
---
M lib/translationunits/MWReference.js
1 file changed, 9 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/cxserver 
refs/changes/83/381383/1

diff --git a/lib/translationunits/MWReference.js 
b/lib/translationunits/MWReference.js
index 4e74580..337f24e 100644
--- a/lib/translationunits/MWReference.js
+++ b/lib/translationunits/MWReference.js
@@ -42,12 +42,16 @@
}
 
// TODO: Parse recursively instead of just MTing to handle templates
-   // Translate reference contents
-   let translatedRefBody = yield this.context.conf.mtClient.translate(
-   this.sourceLanguage, this.targetLanguage, refBody
-   );
 
-   refData.body.html = translatedRefBody;
+   if ( this.context.conf.mtClient ) {
+   // Translate reference contents
+   let translatedRefBody = yield 
this.context.conf.mtClient.translate(
+   this.sourceLanguage, this.targetLanguage, refBody
+   );
+
+   refData.body.html = translatedRefBody;
+   }
+
this.node.attributes[ 'data-mw' ] = JSON.stringify( refData );
this.node.attributes[ 'data-cx' ] = JSON.stringify( {
adapted: true

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16c59984420d44f87f0610b4d18c3b76a2bd0e17
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/cxserver
Gerrit-Branch: master
Gerrit-Owner: Santhosh 

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


[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Linter: Improve detection of html5-misnesting issues

2017-09-28 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381382 )

Change subject: Linter: Improve detection of html5-misnesting issues
..

Linter: Improve detection of html5-misnesting issues

* Found a couple of unhandled scenarios that causes a number
  of false positives in linter reports.

Change-Id: I15b65d534de6e5e23f9c9788cc66e5606331d4b6
---
M lib/utils/DOMUtils.js
M lib/wt2html/pp/handlers/linter.js
M tests/mocha/linter.js
3 files changed, 55 insertions(+), 7 deletions(-)


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

diff --git a/lib/utils/DOMUtils.js b/lib/utils/DOMUtils.js
index 5de498f..e073bde 100644
--- a/lib/utils/DOMUtils.js
+++ b/lib/utils/DOMUtils.js
@@ -1244,12 +1244,6 @@
return next;
},
 
-   hasFollowingContent: function(node) {
-   return !DU.isBody(node) && (
-   DU.nextNonSepSibling(node) || 
DU.hasFollowingContent(node.parentNode)
-   );
-   },
-
numNonDeletedChildNodes: function(node) {
var n = 0;
var child = node.firstChild;
diff --git a/lib/wt2html/pp/handlers/linter.js 
b/lib/wt2html/pp/handlers/linter.js
index e69aeaa..e22df86 100644
--- a/lib/wt2html/pp/handlers/linter.js
+++ b/lib/wt2html/pp/handlers/linter.js
@@ -164,6 +164,34 @@
}
 }
 
+function hasMisnestableContent(node, name) {
+   // This check for 'A' tag is because Tidy doesn't
+   // seem to do the fixups outside the  tag.
+   // FIXME: Test if there are other tags that have
+   // similar behavior.
+   if (DU.isBody(node) || node.nodeName === 'A') {
+   return false;
+   }
+
+   var next = DU.nextNonSepSibling(node);
+   if (!next) {
+   return hasMisnestableContent(node.parentNode, name);
+   }
+
+   var contentNode;
+   if (next.nodeName === 'P' && !DU.isLiteralHTMLNode(next)) {
+   contentNode = DU.firstNonSepChildNode(next);
+   } else {
+   contentNode = next;
+   }
+
+   return contentNode &&
+   // If the first "content" node we find is a matching
+   // stripped tag, we have nothing that can get misnested
+   !(DU.isMarkerMeta(contentNode, 'mw:Placeholder/StrippedTag') &&
+ DU.getDataParsoid(contentNode).name === name);
+}
+
 /*
  * Log Treebuilder fixups marked by dom.markTreeBuilderFixup.js
  * It handles the following scenarios:
@@ -242,7 +270,7 @@
// changes (to wikitext or html specs), let us make it 
explicit.
if (DU.hasLiteralHTMLMarker(dp) &&

getTagsWithChangedMisnestingBehavior().has(c.nodeName) &&
-   DU.hasFollowingContent(c)
+   hasMisnestableContent(c, c.nodeName)
) {
env.log('lint/html5-misnesting', lintObj);
} else {
diff --git a/tests/mocha/linter.js b/tests/mocha/linter.js
index f176e9c..523e96a 100644
--- a/tests/mocha/linter.js
+++ b/tests/mocha/linter.js
@@ -676,6 +676,32 @@
result[0].params.should.have.a.property("name", 
"span");
});
});
+   it('should not trigger html5 misnesting when there is no 
misnested content', function() {
+   return 
parseWT('foo\n\ny').then(function(result) {
+   result.should.have.length(1);
+   result[0].should.have.a.property("type", 
"misnested-tag");
+   result[0].should.have.a.property("params");
+   result[0].params.should.have.a.property("name", 
"span");
+   });
+   });
+   it('should not trigger html5 misnesting when misnested content 
is outside an a-tag (without link-trails)', function() {
+   return 
parseWT('[[Foo|foo]]Bar').then(function(result) {
+   result.should.have.length(2);
+   result[0].should.have.a.property("type", 
"missing-end-tag");
+   result[0].should.have.a.property("params");
+   result[0].params.should.have.a.property("name", 
"span");
+   result[1].should.have.a.property("type", 
"stripped-tag");
+   });
+   });
+   it('should trigger html5 misnesting when linktrails brings 
content inside an a-tag', function() {
+   return 
parseWT('[[Foo|foo]]bar').then(function(result) {
+   result.should.have.length(2);
+   result[0].should.have.a.property("type", 

[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Get rid of inNoWiki state and comment about other removal code

2017-09-28 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381381 )

Change subject: Get rid of inNoWiki state and comment about other removal code
..

Get rid of inNoWiki state and comment about other removal code

Change-Id: I2e397e65efa4ef5da9ae4108179eab94ed02fa3a
---
M lib/html2wt/DOMHandlers.js
M lib/html2wt/WikitextSerializer.js
2 files changed, 11 insertions(+), 3 deletions(-)


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

diff --git a/lib/html2wt/DOMHandlers.js b/lib/html2wt/DOMHandlers.js
index f7c9fe7..dd3a77d 100644
--- a/lib/html2wt/DOMHandlers.js
+++ b/lib/html2wt/DOMHandlers.js
@@ -1556,6 +1556,10 @@
state.inPHPBlock = true;
}
 
+   // TODO(arlolra): As of 1.3.0, html pre is considered 
an extension
+   // and wrapped in encapsulation.  When that version is 
no longer
+   // accepted for serialization, we can remove this 
backwards
+   // compatibility code.
if (node.nodeName === 'PRE') {
// Handle html-pres specially
// 1. If the node has a leading newline, add 
one like it (logic copied from VE)
diff --git a/lib/html2wt/WikitextSerializer.js 
b/lib/html2wt/WikitextSerializer.js
index 9245dd5..319d27a 100644
--- a/lib/html2wt/WikitextSerializer.js
+++ b/lib/html2wt/WikitextSerializer.js
@@ -168,6 +168,11 @@
 });
 
 WSP._serializeHTMLTag = Promise.method(function(node, wrapperUnmodified) {
+   // TODO(arlolra): As of 1.3.0, html pre is considered an extension
+   // and wrapped in encapsulation.  When that version is no longer
+   // accepted for serialization, we can remove this backwards
+   // compatibility code.
+   //
// 'inHTMLPre' flag has to be updated always,
// even when we are selsering in the wrapperUnmodified case.
var token = DU.mkTagTk(node);
@@ -823,10 +828,9 @@
// Always escape entities
res = Util.escapeEntities(res);
 
-   // If not in nowiki and pre context, escape wikitext
+   // If not in pre context, escape wikitext
// XXX refactor: Handle this with escape handlers instead!
-   state.escapeText = (state.onSOL || !state.currNodeUnmodified) &&
-   !state.inNoWiki && !state.inHTMLPre;
+   state.escapeText = (state.onSOL || !state.currNodeUnmodified) && 
!state.inHTMLPre;
state.emitChunk(res, node);
state.escapeText = false;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e397e65efa4ef5da9ae4108179eab94ed02fa3a
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] mediawiki...parsoid[master]: Not sure what this is trying to be ... but it isn't

2017-09-28 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381380 )

Change subject: Not sure what this is trying to be ... but it isn't
..

Not sure what this is trying to be ... but it isn't

Change-Id: I4a8544c6de2b4598e4d5be60c8f54d6945db970a
---
M lib/html2wt/WikitextSerializer.js
M tests/parserTests-blacklist.js
2 files changed, 9 insertions(+), 11 deletions(-)


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

diff --git a/lib/html2wt/WikitextSerializer.js 
b/lib/html2wt/WikitextSerializer.js
index 01d82d5..9245dd5 100644
--- a/lib/html2wt/WikitextSerializer.js
+++ b/lib/html2wt/WikitextSerializer.js
@@ -814,17 +814,7 @@
newSepMatch = res.match(this.separatorREs.sepSuffixWithNlsRE);
res = res.replace(this.separatorREs.sepSuffixWithNlsRE, '');
 
-   var doubleNewlineMatch = 
res.match(this.separatorREs.doubleNewlineRE_G);
-   var doubleNewlineCount = doubleNewlineMatch && 
doubleNewlineMatch.length || 0;
-
-   // Don't strip two newlines for wikitext like this:
-   // foo
-   //
-   // bar
-   // The PHP parser won't create paragraphs on lines that also 
contain
-   // block-level tags.
-   if (!state.inHTMLPre && 
(!DU.allChildrenAreText(node.parentNode) ||
-   doubleNewlineCount !== 1)) {
+   if (!state.inHTMLPre) {
// Strip more than one consecutive newline
res = res.replace(this.separatorREs.doubleNewlineRE_G, 
'\n');
}
diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js
index 583c919..c97ef87 100644
--- a/tests/parserTests-blacklist.js
+++ b/tests/parserTests-blacklist.js
@@ -290,6 +290,9 @@
 add("wt2wt", "T2529: Uncovered bullet leaving empty list, normally removed by 
tidy", "*** Foo \n{{bullet}}");
 add("wt2wt", "HHP2.1: Heuristics for headings in preprocessor parenthetical 
structures", "{{foo|\n=heading=\n");
 add("wt2wt", "HHP2.2: Heuristics for headings in preprocessor parenthetical 
structures", "{{foo|\n==heading==\n");
+add("wt2wt", "Paragraphs inside divs (no extra line breaks)", "Line 
one\nLine two");
+add("wt2wt", "T8200: paragraphs inside blockquotes (no extra line breaks)", 
"Line one\nLine two");
+add("wt2wt", "Paragraphs inside blockquotes/divs (no extra line breaks)", 
"Line one\nLine two");
 add("wt2wt", "T21052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed 
external links", "[http://www.example.org/ ideograms]\n");
 add("wt2wt", "Ignore pipe between table row attributes", "{|\n| quux\n|- 
id=\"foo\" style=\"color: red\" |\n| bar\n|}");
 add("wt2wt", "2. Bad treebuilder fixup of formatting elt is cleaned up", 
"'''foo'''[[File:Foobar.jpg|thumb|'''caption''']]'''bar'''\n\n[[Image:Foobar.jpg|right|300px]]");
@@ -1739,6 +1742,11 @@
 add("selser", "HHP2.2: Heuristics for headings in preprocessor parenthetical 
structures [0,3,[4]]", "{{foo|\n==fcodkw==");
 add("selser", "HHP2.2: Heuristics for headings in preprocessor parenthetical 
structures [0,0,3]", "{{foo|\n");
 add("selser", "HHP2.2: Heuristics for headings in preprocessor parenthetical 
structures [0,0,[4]]", "{{foo|\n==hxhkvc==");
+add("selser", "Paragraphs inside divs (no extra line breaks) [2]", 
"1dt72utLine one\n\nLine two");
+add("selser", "T8200: paragraphs inside blockquotes (no extra line breaks) 
[2]", "wkz005Line one\n\nLine two");
+add("selser", "Paragraphs inside blockquotes/divs (no extra line breaks) [1]", 
"Line one\n\nLine 
two");
+add("selser", "Paragraphs inside blockquotes/divs (no extra line breaks) [2]", 
"1ajd2vaLine one\n\nLine two");
+add("selser", "Paragraphs inside blockquotes/divs (no extra line breaks) 
[[2]]", "\nxpf83eLine one\n\nLine two");
 add("selser", "Play a bit with r67090 and T5158 [0,2,1,3,0,0,1]", "2furaf\n\n\n");
 add("selser", "percent-encoding and + signs in internal links (T28410) 
[[[3],2,0,4,[2],3,1,0,4,4,0,0,1,0,1,3,0,3,3,3,1]]", 
"[[User:+%|]]1knuzp0 
[[Page+title%]]tecpqf[[%+|mmkufk%+]][[%+|%20]] 
b3wipsvi8sgk[[%+r]]\n[[%]] [[+]][[File:%+abc%39|foo|[[bar[[3E+]]\n");
 add("selser", "T21052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed 
external links [2]", "19d4m8s\n\n[http://www.example.org/ ideograms];);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a8544c6de2b4598e4d5be60c8f54d6945db970a
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] mediawiki...parsoid[master]: Handler prefix separator in emitWikitext

2017-09-28 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381379 )

Change subject: Handler prefix separator in emitWikitext
..

Handler prefix separator in emitWikitext

Change-Id: I720b334c1b8229dd3f7f6811e6c6f2179d63f0b0
---
M lib/html2wt/WikitextSerializer.js
M lib/html2wt/separators.js
2 files changed, 25 insertions(+), 22 deletions(-)


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

diff --git a/lib/html2wt/WikitextSerializer.js 
b/lib/html2wt/WikitextSerializer.js
index 8a414e2..01d82d5 100644
--- a/lib/html2wt/WikitextSerializer.js
+++ b/lib/html2wt/WikitextSerializer.js
@@ -800,15 +800,23 @@
 WSP._serializeTextNode = Promise.method(function(node) {
var res = node.nodeValue;
var state = this.state;
-
-   var doubleNewlineMatch = res.match(this.separatorREs.doubleNewlineRE_G);
-   var doubleNewlineCount = doubleNewlineMatch && 
doubleNewlineMatch.length || 0;
-
-   // Deal with trailing separator-like text (at least 1 newline and other 
whitespace)
-   var newSepMatch = res.match(this.separatorREs.sepSuffixWithNlsRE);
-   res = res.replace(this.separatorREs.sepSuffixWithNlsRE, '');
+   var newSepMatch;
 
if (!state.inIndentPre) {
+   // Strip leading newlines and other whitespace
+   var match = res.match(this.separatorREs.sepPrefixWithNlsRE);
+   if (match) {
+   state.setSep((state.sep.src || '') + match[0]);
+   res = res.substring(match[0].length);
+   }
+
+   // Deal with trailing separator-like text (at least 1 newline 
and other whitespace)
+   newSepMatch = res.match(this.separatorREs.sepSuffixWithNlsRE);
+   res = res.replace(this.separatorREs.sepSuffixWithNlsRE, '');
+
+   var doubleNewlineMatch = 
res.match(this.separatorREs.doubleNewlineRE_G);
+   var doubleNewlineCount = doubleNewlineMatch && 
doubleNewlineMatch.length || 0;
+
// Don't strip two newlines for wikitext like this:
// foo
//
@@ -820,10 +828,6 @@
// Strip more than one consecutive newline
res = res.replace(this.separatorREs.doubleNewlineRE_G, 
'\n');
}
-
-   // Strip leading newlines and other whitespace
-   // They are already added to the separator source in 
handleSeparatorText.
-   res = res.replace(this.separatorREs.sepPrefixWithNlsRE, '');
}
 
// Always escape entities
@@ -850,12 +854,17 @@
 /**
  * Emit non-separator wikitext that does not need to be escaped
  */
-WSP.emitWikitext = function(text, node) {
+WSP.emitWikitext = function(res, node) {
var state = this.state;
 
-   // Strip leading newlines.
-   // They are already added to the separator source in 
handleSeparatorText.
-   var res = text.replace(this.separatorREs.sepPrefixWithNlsRE, '');
+   if (!state.inIndentPre) {
+   // Strip leading newlines and other whitespace
+   var match = res.match(this.separatorREs.sepPrefixWithNlsRE);
+   if (match) {
+   state.setSep((state.sep.src || '') + match[0]);
+   res = res.substring(match[0].length);
+   }
+   }
 
// Deal with trailing newlines
var newSepMatch = res.match(this.separatorREs.sepSuffixWithNlsRE);
diff --git a/lib/html2wt/separators.js b/lib/html2wt/separators.js
index 2c72f2e..098ce94 100644
--- a/lib/html2wt/separators.js
+++ b/lib/html2wt/separators.js
@@ -134,17 +134,11 @@
if (state.inIndentPre) {
return false;
}
-
var text = node.nodeValue;
-   var separatorREs = state.serializer.separatorREs;
-   if (text.match(separatorREs.pureSepRE)) {
+   if (text.match(state.serializer.separatorREs.pureSepRE)) {
state.setSep((state.sep.src || '') + text);
return true;
} else {
-   var match = text.match(separatorREs.sepPrefixWithNlsRE);
-   if (match) {
-   state.setSep((state.sep.src || '') + match[0]);
-   }
return false;
}
 };

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I720b334c1b8229dd3f7f6811e6c6f2179d63f0b0
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] mediawiki...PhpTags[master]: Fix Timer::reset() function (version 5.11)

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381173 )

Change subject: Fix Timer::reset() function (version 5.11)
..


Fix Timer::reset() function (version 5.11)

Change-Id: I7755884993fb39669bbae5cd5af3d492b89b2f42
---
M PhpTags.hooks.php
M extension.json
M includes/Renderer.php
3 files changed, 25 insertions(+), 6 deletions(-)

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



diff --git a/PhpTags.hooks.php b/PhpTags.hooks.php
index 4a855e9..319ba14 100644
--- a/PhpTags.hooks.php
+++ b/PhpTags.hooks.php
@@ -16,7 +16,8 @@
 * @return boolean
 */
public static function onPhpTagsRuntimeFirstInit() {
-   \PhpTags\Hooks::addJsonFile( __DIR__ . '/PhpTags.json', 
PHPTAGS_VERSION );
+   $version = 
ExtensionRegistry::getInstance()->getAllThings()['Empty']['version'];
+   \PhpTags\Hooks::addJsonFile( __DIR__ . '/PhpTags.json', 
$version );
return true;
}
 
@@ -89,7 +90,7 @@
$wgPhpTagsCallsCounter = 0;
 
define ( 'PHPTAGS_HOOK_RELEASE', 8 );
-   define ( 'PHPTAGS_VERSION', '5.10' ); //@todo remove later, it 
only for backward compatibility
+   define ( 'PHPTAGS_VERSION', '5.11' ); //@todo remove later, it 
is for backward compatibility only
}
 
 }
diff --git a/extension.json b/extension.json
index dbb6553..36aa437 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "PhpTags",
-   "version": "5.10",
+   "version": "5.11",
"author": "[https://www.mediawiki.org/wiki/User:Pastakhov Pavel 
Astakhov]",
"url": "https://www.mediawiki.org/wiki/Extension:PhpTags;,
"descriptionmsg": "phptags-desc",
diff --git a/includes/Renderer.php b/includes/Renderer.php
index 8ff8e20..7703796 100644
--- a/includes/Renderer.php
+++ b/includes/Renderer.php
@@ -369,19 +369,26 @@
 }
 
 class Timer {
-   private static $times = array();
+   private static $times = [];
private static $runTime = 0;
private static $compile = 0;
+   private static $reset = false; // allows to make a postponed reset
 
public static function start( $parser ) {
array_unshift( self::$times, 
$parser->mOutput->getTimeSinceStart( 'cpu' ) );
}
 
public static function stop( $parser ) {
-   if ( false === isset(self::$times[1]) ) {
+   if ( !isset( self::$times[1] ) ) { // count the latest stop 
calling only
self::$runTime += $parser->mOutput->getTimeSinceStart( 
'cpu' ) - self::$times[0];
}
array_shift( self::$times );
+
+   if ( self::$reset && !self::$times ) { // make a postponed reset
+   self::$reset = false;
+   self::$runTime = 0;
+   self::$compile = 0;
+   }
}
 
public static function addCompileTime( $parser ) {
@@ -397,9 +404,20 @@
}
 
public static function reset() {
-   self::$times = array();
+   if ( self::$times ) { // the stop function was not called
+   self::$reset = true; // postpone the real reset until 
the stop function is called
+   return;
+   }
+   self::realReset();
+   }
+
+   private static function realReset() {
+   self::$times = [];
self::$runTime = 0;
self::$compile = 0;
+   if ( self::$reset ) {
+   self::$reset = false;
+   }
}
 
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7755884993fb39669bbae5cd5af3d492b89b2f42
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PhpTags
Gerrit-Branch: master
Gerrit-Owner: Pastakhov 
Gerrit-Reviewer: Pastakhov 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] integration/config[master]: Add experimental "composer-package-php70-docker" job

2017-09-28 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381378 )

Change subject: Add experimental "composer-package-php70-docker" job
..

Add experimental "composer-package-php70-docker" job

Change-Id: I3cc35d39b39a7b6e9a38455b9264bb0d2b243ee2
---
A dockerfiles/composer-package-php70/Dockerfile
A dockerfiles/composer-package-php70/example-run.sh
A dockerfiles/composer-package-php70/run.sh
M jjb/php.yaml
M zuul/layout.yaml
5 files changed, 52 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/78/381378/1

diff --git a/dockerfiles/composer-package-php70/Dockerfile 
b/dockerfiles/composer-package-php70/Dockerfile
new file mode 100644
index 000..dee5077
--- /dev/null
+++ b/dockerfiles/composer-package-php70/Dockerfile
@@ -0,0 +1,11 @@
+FROM wmfreleng/composer:latest as composer
+
+FROM wmfreleng/php70-mediawiki:latest
+
+USER root
+
+COPY --from=composer /srv/composer /srv/composer
+
+USER nobody
+COPY run.sh /run.sh
+ENTRYPOINT /bin/bash /run.sh
diff --git a/dockerfiles/composer-package-php70/example-run.sh 
b/dockerfiles/composer-package-php70/example-run.sh
new file mode 100644
index 000..d6f6f97
--- /dev/null
+++ b/dockerfiles/composer-package-php70/example-run.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+install --mode 777 --directory log
+docker run \
+--rm --tty \
+--env ZUUL_URL=https://gerrit.wikimedia.org/r \
+--env ZUUL_PROJECT=utfnormal \
+--env ZUUL_COMMIT=668604441afd899efb073ce4c6b5545341ef6582 \
+--env ZUUL_REF=refs/changes/57/375857/1 \
+--volume /$(pwd)/log://var/lib/jenkins/log \
+ wmfreleng/composer-package-php70:latest
diff --git a/dockerfiles/composer-package-php70/run.sh 
b/dockerfiles/composer-package-php70/run.sh
new file mode 100644
index 000..a0adfbe
--- /dev/null
+++ b/dockerfiles/composer-package-php70/run.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+cd /src
+
+git init
+git fetch --quiet --depth 1 "${ZUUL_URL}/${ZUUL_PROJECT}" "$ZUUL_REF"
+git checkout FETCH_HEAD
+git submodule --quiet update --init --recursive
+
+/srv/composer/vendor/bin/composer install --no-progress
+/srv/composer/vendor/bin/composer test
diff --git a/jjb/php.yaml b/jjb/php.yaml
index 7fefde1..436ef1d 100644
--- a/jjb/php.yaml
+++ b/jjb/php.yaml
@@ -127,6 +127,23 @@
 publishers:
  - castor-save
 
+- job:
+name: 'composer-package-php70-docker'
+node: DebianJessieDocker
+concurrent: true
+properties:
+ - build-discarder:
+ days-to-keep: 15
+triggers:
+ - zuul
+builders:
+ - docker-zuul-env
+ - docker-log-dir
+ - docker-cache-dir
+ - docker-run-with-log-and-workspace-cache:
+image: 'wmfreleng/composer-package-php70:v2017.09.29.XX.XX'
+logdir: '/log'
+
 # Couple jobs with a {name} prefix
 - job-template:
 !!merge : *job_composer-phpflavor-image
@@ -140,8 +157,6 @@
 name: 'composer-flavored-on-nodepool'
 phpflavor:
 - php55:
-image: jessie
-- php70:
 image: jessie
 - hhvm:
 image: jessie
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 3baeca4..89bed08 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -1201,7 +1201,7 @@
   - composer-package-hhvm-jessie
   - composer-package-php55-jessie
 experimental:
-  - composer-package-php70-jessie
+  - composer-package-php70-docker
 
   - name: npm
 test:
@@ -6336,7 +6336,7 @@
   - composer-package-hhvm-jessie
   - composer-package-php55-jessie
 experimental:
-  - composer-package-php70-jessie
+  - composer-package-php70-docker
 
   - name: mediawiki/services/mathoid
 template:

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

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

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


[MediaWiki-commits] [Gerrit] integration/config[master]: docker: Rename php images to php70

2017-09-28 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381377 )

Change subject: docker: Rename php images to php70
..

docker: Rename php images to php70

In preparation for eventual php55 images.

Change-Id: Ib54684818186642837864b92df9c49e9b057f81f
---
M dockerfiles/composer/Dockerfile
M dockerfiles/mediawiki-phan/Dockerfile
M dockerfiles/mediawiki-phpcs/Dockerfile
R dockerfiles/php70-mediawiki/Dockerfile
R dockerfiles/php70/Dockerfile
R dockerfiles/php70/sury-php.gpg
6 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/77/381377/1

diff --git a/dockerfiles/composer/Dockerfile b/dockerfiles/composer/Dockerfile
index 925c585..df7b883 100644
--- a/dockerfiles/composer/Dockerfile
+++ b/dockerfiles/composer/Dockerfile
@@ -1,4 +1,4 @@
-FROM wmfreleng/php:latest
+FROM wmfreleng/php70:latest
 
 USER root
 
diff --git a/dockerfiles/mediawiki-phan/Dockerfile 
b/dockerfiles/mediawiki-phan/Dockerfile
index bf8745a..65c8d93 100644
--- a/dockerfiles/mediawiki-phan/Dockerfile
+++ b/dockerfiles/mediawiki-phan/Dockerfile
@@ -1,6 +1,6 @@
 FROM wmfreleng/composer:latest as composer
 
-FROM wmfreleng/php-mediawiki:latest
+FROM wmfreleng/php7-mediawiki:latest
 
 USER root
 
diff --git a/dockerfiles/mediawiki-phpcs/Dockerfile 
b/dockerfiles/mediawiki-phpcs/Dockerfile
index 2f1edf1..dee5077 100644
--- a/dockerfiles/mediawiki-phpcs/Dockerfile
+++ b/dockerfiles/mediawiki-phpcs/Dockerfile
@@ -1,6 +1,6 @@
 FROM wmfreleng/composer:latest as composer
 
-FROM wmfreleng/php-mediawiki:latest
+FROM wmfreleng/php70-mediawiki:latest
 
 USER root
 
diff --git a/dockerfiles/php-mediawiki/Dockerfile 
b/dockerfiles/php70-mediawiki/Dockerfile
similarity index 96%
rename from dockerfiles/php-mediawiki/Dockerfile
rename to dockerfiles/php70-mediawiki/Dockerfile
index 1d31687..8e7cddc 100644
--- a/dockerfiles/php-mediawiki/Dockerfile
+++ b/dockerfiles/php70-mediawiki/Dockerfile
@@ -1,4 +1,4 @@
-FROM wmfreleng/php:latest
+FROM wmfreleng/php70:latest
 
 USER root
 
diff --git a/dockerfiles/php/Dockerfile b/dockerfiles/php70/Dockerfile
similarity index 100%
rename from dockerfiles/php/Dockerfile
rename to dockerfiles/php70/Dockerfile
diff --git a/dockerfiles/php/sury-php.gpg b/dockerfiles/php70/sury-php.gpg
similarity index 100%
rename from dockerfiles/php/sury-php.gpg
rename to dockerfiles/php70/sury-php.gpg
Binary files differ

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...cxserver[master]: Update express to 4.16

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381376 )

Change subject: Update express to 4.16
..


Update express to 4.16

Per https://nodesecurity.io/advisories/535 express released new
verson https://github.com/expressjs/express/issues/3431

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

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



diff --git a/package.json b/package.json
index b22efe3..965183c 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,7 @@
 "compression": "^1.6.2",
 "core-js": "^2.4.1",
 "domino": "^1.0.25",
-"express": "^4.14.0",
+"express": "^4.16.0",
 "html-entities": "1.2.0",
 "js-yaml": "^3.6.1",
 "jsonwebtoken": "~5.6.0",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If4e4b48dd6a9be89ab2a21b1dfbf1744651f65f5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/cxserver
Gerrit-Branch: master
Gerrit-Owner: Santhosh 
Gerrit-Reviewer: KartikMistry 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...cxserver[master]: Update express to 4.16

2017-09-28 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381376 )

Change subject: Update express to 4.16
..

Update express to 4.16

Per https://nodesecurity.io/advisories/535 express released new
verson https://github.com/expressjs/express/issues/3431

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/cxserver 
refs/changes/76/381376/1

diff --git a/package.json b/package.json
index b22efe3..965183c 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,7 @@
 "compression": "^1.6.2",
 "core-js": "^2.4.1",
 "domino": "^1.0.25",
-"express": "^4.14.0",
+"express": "^4.16.0",
 "html-entities": "1.2.0",
 "js-yaml": "^3.6.1",
 "jsonwebtoken": "~5.6.0",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If4e4b48dd6a9be89ab2a21b1dfbf1744651f65f5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/cxserver
Gerrit-Branch: master
Gerrit-Owner: Santhosh 

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


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Making multi-column lists visually similar to single-column ...

2017-09-28 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381375 )

Change subject: Making multi-column lists visually similar to single-column 
lists.
..

Making multi-column lists visually similar to single-column lists.

Change-Id: Ifccd5f2a7ee091bd9fa4a794f7ace51309facf13
---
M modules/ext.CollaborationKit.list.styles.less
1 file changed, 4 insertions(+), 88 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/75/381375/1

diff --git a/modules/ext.CollaborationKit.list.styles.less 
b/modules/ext.CollaborationKit.list.styles.less
index bf1da1f..01345b8 100644
--- a/modules/ext.CollaborationKit.list.styles.less
+++ b/modules/ext.CollaborationKit.list.styles.less
@@ -7,8 +7,10 @@
 }
 
 .mw-ck-list-image {
+   .grey();
float: left;
overflow: hidden;
+   padding: 1px;
 }
 .mw-ck-list-noimageplaceholder {
width: 64px;
@@ -41,7 +43,6 @@
margin: 0 -0.5em;
 
.mw-ck-list-column {
-   .grey-box();
float: left; // IE9 workaround, maybe
.flex();
margin: 0.5em;
@@ -59,9 +60,6 @@
}
.mw-ck-list-column-header {
padding: 1.25em 1.5em 0.35em;
-
-   // YOU ARE AN IDIOT AND YOU SUCK, SELF
-   // Can anyone else explain how this voodoo works? because now I 
can't figure it out
margin: -1.6em -1.6em 1em;
border-radius: 3px 3px 0 0;
}
@@ -69,88 +67,6 @@
margin-top: 0;
padding-top: 0;
}
-}
-.column-theme-header( #ddd );
-
-// Theme colours mixin and application
-
-.column-theme-header( @color ) {
-   .mw-ck-multilist {
-   .mw-ck-list-column {
-   border-color: fadeout( @color, 25% );
-   }
-   .mw-ck-list-column-header {
-   border: solid 1px @color;
-   border-bottom-width: 3px;
-   background: fadeout( @color, 75% );
-   }
-   }
-}
-.mw-ck-theme-darkred {
-   .column-theme-header( @darkred );
-}
-.mw-ck-theme-red {
-   .column-theme-header( @red );
-}
-.mw-ck-theme-darkgrey {
-   .column-theme-header( @darkgrey );
-}
-.mw-ck-theme-lightgrey {
-   .column-theme-header( @lightgrey );
-}
-.mw-ck-theme-skyblue {
-   .column-theme-header( @skyblue );
-}
-.mw-ck-theme-blue {
-   .column-theme-header( @blue );
-}
-.mw-ck-theme-bluegrey {
-   .column-theme-header( @bluegrey );
-}
-.mw-ck-theme-navyblue {
-   .column-theme-header( @navyblue );
-}
-.mw-ck-theme-darkblue {
-   .column-theme-header( @darkblue );
-}
-.mw-ck-theme-aquamarine {
-   .column-theme-header( @aquamarine );
-}
-.mw-ck-theme-violet {
-   .column-theme-header( @violet );
-}
-.mw-ck-theme-purple {
-   .column-theme-header( @purple );
-}
-.mw-ck-theme-mauve {
-   .column-theme-header( @mauve );
-}
-.mw-ck-theme-lightmauve {
-   .column-theme-header( @lightmauve );
-}
-.mw-ck-theme-salmon {
-   .column-theme-header( @salmon );
-}
-.mw-ck-theme-orange {
-   .column-theme-header( @orange );
-}
-.mw-ck-theme-yellow {
-   .column-theme-header( @yellow );
-}
-.mw-ck-theme-gold {
-   .column-theme-header( @gold );
-}
-.mw-ck-theme-pastelyellow {
-   .column-theme-header( @pastelyellow );
-}
-.mw-ck-theme-forestgreen {
-   .column-theme-header( @forestgreen );
-}
-.mw-ck-theme-brightgreen {
-   .column-theme-header( @brightgreen );
-}
-.mw-ck-theme-khaki {
-   .column-theme-header( @khaki );
 }
 
 /* @todo, should maybe replace styling from toccolours with this class */
@@ -200,8 +116,8 @@
 }
 
 .mw-ck-list-dragplaceholder {
-   border: #000 thin dashed;
-   width: 25%;
+   background: #eee;
+   width: 100%;
 }
 
 .mw-ck-list-title .jquery-confirmable-text,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifccd5f2a7ee091bd9fa4a794f7ace51309facf13
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

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


[MediaWiki-commits] [Gerrit] marvin[master]: Chore: move page redirect to distinct type

2017-09-28 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381374 )

Change subject: Chore: move page redirect to distinct type
..

Chore: move page redirect to distinct type

This parameter is needed by the upcoming page client.

Bug: T173317
Change-Id: Ia94cc899d8fe9abac52b0e174a579da810c7dd95
---
A src/common/data-clients/page-redirect.ts
M src/common/data-clients/page-summary-data-client.ts
2 files changed, 15 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/74/381374/1

diff --git a/src/common/data-clients/page-redirect.ts 
b/src/common/data-clients/page-redirect.ts
new file mode 100644
index 000..0644ff7
--- /dev/null
+++ b/src/common/data-clients/page-redirect.ts
@@ -0,0 +1,13 @@
+/**
+ * When enabled (the default), requests for [redirect pages] return an HTTP
+ * 302 with a redirect target in the Location header and content in the body.
+ * When disabled, an HTTP 200 response is returned instead.
+ *
+ * Beware that redirected pre-flighted cross-origin requests (such as those
+ * sending custom request headers like Api-User-Agent) will fail in most
+ * current browsers due to a [spec bug].
+ *
+ * [redirect pages]: https://www.mediawiki.org/wiki/Help:Redirects
+ * [spec bug]: https://github.com/whatwg/fetch/issues/204
+ */
+export type PageRedirect = boolean;
diff --git a/src/common/data-clients/page-summary-data-client.ts 
b/src/common/data-clients/page-summary-data-client.ts
index e1a109d..3b32d00 100644
--- a/src/common/data-clients/page-summary-data-client.ts
+++ b/src/common/data-clients/page-summary-data-client.ts
@@ -2,24 +2,12 @@
 import { PageSummary, PageTitlePath } from "../models/page";
 import { RESTBase } from "../marshallers/restbase";
 import { unmarshalPageSummary } from "../marshallers/page-unmarshaller";
+import { PageRedirect } from "./page-redirect";
 
 // https://en.wikipedia.org/api/rest_v1/#!/Page_content/get_page_summary_title
 export interface Params {
   titlePath: PageTitlePath;
-
-  /**
-   * When enabled (the default), requests for [redirect pages] return an HTTP
-   * 302 with a redirect target in the Location header and content in the body.
-   * When disabled, an HTTP 200 response is returned instead.
-   *
-   * Beware that redirected pre-flighted cross-origin requests (such as those
-   * sending custom request headers like Api-User-Agent) will fail in most
-   * current browsers due to a [spec bug].
-   *
-   * [redirect pages]: https://www.mediawiki.org/wiki/Help:Redirects
-   * [spec bug]: https://github.com/whatwg/fetch/issues/204
-   */
-  redirect?: boolean;
+  redirect?: PageRedirect;
 }
 
 const url = ({ titlePath, redirect }: Params) => {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia94cc899d8fe9abac52b0e174a579da810c7dd95
Gerrit-PatchSet: 1
Gerrit-Project: marvin
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: Sniedzielski 

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


[MediaWiki-commits] [Gerrit] marvin[master]: Update: add namespace model

2017-09-28 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381373 )

Change subject: Update: add namespace model
..

Update: add namespace model

Bug: T173317
Change-Id: I59f8c557de547cb4e33a178506f090e71cf613f9
---
A src/common/models/page/namespace.test.ts
A src/common/models/page/namespace.ts
2 files changed, 88 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/73/381373/1

diff --git a/src/common/models/page/namespace.test.ts 
b/src/common/models/page/namespace.test.ts
new file mode 100644
index 000..d8863c3
--- /dev/null
+++ b/src/common/models/page/namespace.test.ts
@@ -0,0 +1,25 @@
+import * as assert from "assert";
+import { Namespace, special, main, talk, file } from "./namespace";
+
+describe("namespace", () => {
+  describe(`.special()`, () => {
+it(`is special`, () => assert.ok(special(Namespace.SPECIAL)));
+it(`not special`, () => assert.ok(!special(Namespace.MAIN)));
+  });
+
+  describe(`.main()`, () => {
+it(`is main`, () => assert.ok(main(Namespace.MAIN)));
+it(`not main`, () => assert.ok(!main(Namespace.TALK)));
+  });
+
+  describe(`.talk()`, () => {
+it(`is talk`, () => assert.ok(talk(Namespace.TALK)));
+it(`not talk`, () => assert.ok(!talk(Namespace.MAIN)));
+it(`special is not talk`, () => assert.ok(!talk(Namespace.SPECIAL)));
+  });
+
+  describe(`.file()`, () => {
+it(`is file`, () => assert.ok(file(Namespace.FILE)));
+it(`not file`, () => assert.ok(!file(Namespace.MAIN)));
+  });
+});
diff --git a/src/common/models/page/namespace.ts 
b/src/common/models/page/namespace.ts
new file mode 100644
index 000..702b3b9
--- /dev/null
+++ b/src/common/models/page/namespace.ts
@@ -0,0 +1,63 @@
+const TALK_MASK = 0x1;
+
+/**
+ * An enumeration describing the different possible namespace codes.
+ *
+ * @see {@link 
https://phabricator.wikimedia.org/diffusion/APAW/browse/master/app/src/main/java/org/wikipedia/page/Namespace.java;c1b48fcd848406b646b894217d5561a323eae3ca
 Namespace.java (Android implementation)}
+ * @see {@link https://en.wikipedia.org/wiki/Wikipedia:Namespace 
Wikipedia:Namespace}
+ * @see {@link https://www.mediawiki.org/wiki/Extension_default_namespaces 
Extension default namespaces}
+ * @see {@link 
https://github.com/wikimedia/wikipedia-ios/blob/master/Wikipedia/Code/NSNumber+MWKTitleNamespace.h
 NSNumber+MWKTitleNamespace.h (iOS implementation)}
+ * @see {@link 
https://www.mediawiki.org/wiki/Manual:Namespace#Built-in_namespaces 
Manual:Namespace}
+ * @see {@link 
https://en.wikipedia.org/w/api.php?action=query=siteinfo=namespaces|namespacealiases
 Namespaces reported by API}
+ */
+export enum Namespace {
+  MEDIA = -2,
+  SPECIAL = -1, // The only namespace where a bitwise test of TALK_MASK fails.
+  /** Main page, disambiguation page, or article. */
+  MAIN = 0,
+  TALK = 1,
+  USER = 2,
+  USER_TALK = 3,
+  PROJECT = 4, // Also: WP alias.
+  PROJECT_TALK = 5, // Also: WT alias.
+  FILE = 6, // Also: image alias.
+  FILE_TALK = 7, // Also: image talk alias.
+  MEDIAWIKI = 8,
+  MEDIAWIKI_TALK = 9,
+  TEMPLATE = 10,
+  TEMPLATE_TALK = 11,
+  HELP = 12,
+  HELP_TALK = 13,
+  CATEGORY = 14,
+  CATEGORY_TALK = 15,
+  PORTAL = 100,
+  PORTAL_TALK = 101,
+  BOOK = 108,
+  BOOK_TALK = 109,
+  DRAFT = 118,
+  DRAFT_TALK = 119,
+  EDUCATION_PROGRAM = 446,
+  EDUCATION_PROGRAM_TALK = 447,
+  TIMED_TEXT = 710,
+  TIMED_TEXT_TALK = 711,
+  MODULE = 828,
+  MODULE_TALK = 829,
+  GADGET = 2300,
+  GADGET_TALK = 2301,
+  GADGET_DEFINITION = 2302,
+  GADGET_DEFINITION_TALK = 2303,
+  TOPIC = 2600
+}
+
+export const special = (namespace: Namespace): boolean =>
+  namespace === Namespace.SPECIAL;
+
+export const main = (namespace: Namespace): boolean =>
+  namespace === Namespace.MAIN;
+
+export const talk = (namespace: Namespace): boolean =>
+  // eslint-disable-next-line no-bitwise
+  (namespace & TALK_MASK) === TALK_MASK && !special(namespace);
+
+export const file = (namespace: Namespace): boolean =>
+  namespace === Namespace.FILE;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I59f8c557de547cb4e33a178506f090e71cf613f9
Gerrit-PatchSet: 1
Gerrit-Project: marvin
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: Sniedzielski 

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


[MediaWiki-commits] [Gerrit] marvin[master]: Fix: push test file excludes to server and client

2017-09-28 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381372 )

Change subject: Fix: push test file excludes to server and client
..

Fix: push test file excludes to server and client

By default, the root project configuration is used. By excluding test
files in the root, the editor loses TypeScript compilation support for
them. Simplify and move the configuration into server and client project
files.

Change-Id: I064c277351828d6e558634edce2e7dfe30c44a72
---
M src/client/tsconfig.json
M src/server/tsconfig.json
M tsconfig.json
3 files changed, 7 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/72/381372/1

diff --git a/src/client/tsconfig.json b/src/client/tsconfig.json
index 27816ce..8b1f5f6 100644
--- a/src/client/tsconfig.json
+++ b/src/client/tsconfig.json
@@ -1,5 +1,8 @@
 {
   "extends": "../../tsconfig.json",
+  "exclude": [
+"../**/*.test.*"
+  ],
   "include": [
 "../common", "."
   ],
diff --git a/src/server/tsconfig.json b/src/server/tsconfig.json
index 0bd1839..3993b90 100644
--- a/src/server/tsconfig.json
+++ b/src/server/tsconfig.json
@@ -1,5 +1,9 @@
 {
   "extends": "../../tsconfig.json",
+  "exclude": [
+"../**/*.test.ts",
+"../**/*.test.js"
+  ],
   "include": [
 "../common", "."
   ],
diff --git a/tsconfig.json b/tsconfig.json
index 63935b1..738add8 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,10 +1,4 @@
 {
-  "exclude": [
-"src/**/*.test.ts",
-"src/**/*.test.js",
-"test/**/*.test.ts",
-"test/**/*.test.js"
-  ],
   "include": [
 "src/common"
   ],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I064c277351828d6e558634edce2e7dfe30c44a72
Gerrit-PatchSet: 1
Gerrit-Project: marvin
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: Sniedzielski 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Stop using $wgWikibaseSharedCacheKeyPrefix from Wikidata build

2017-09-28 Thread Aude (Code Review)
Aude has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381371 )

Change subject: Stop using $wgWikibaseSharedCacheKeyPrefix from Wikidata build
..

Stop using $wgWikibaseSharedCacheKeyPrefix from Wikidata build

we can instead incorporate $wmgVersionNumber into the cache key name

Bug: T176948
Change-Id: Iffede42941d1ec4823f7b84e73347315000a4408
---
M wmf-config/Wikibase.php
1 file changed, 3 insertions(+), 5 deletions(-)


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

diff --git a/wmf-config/Wikibase.php b/wmf-config/Wikibase.php
index 4631797..e7bc8db 100644
--- a/wmf-config/Wikibase.php
+++ b/wmf-config/Wikibase.php
@@ -2,11 +2,9 @@
 
 require_once "$IP/extensions/Wikidata/Wikidata.php";
 
-// The version number now comes from the Wikidata build,
-// included above, so that cache invalidations can be in sync
-// extension changes when there is a new extension branch or
-// otherwise needed to change the cache key.
-$wgWBSharedCacheKey = '-' . $wmgWikibaseCachePrefix;
+// This allows cache invalidations to be in sync with deploys
+// and not shared across different versions of wikibase.
+$wgWBSharedCacheKey = '-wikibase_shared/wikidata_' . $wmgVersionNumber;
 
 if ( defined( 'HHVM_VERSION' ) ) {
// Split the cache up for hhvm. T73461

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ArticleRatings[master]: Add composer/phpcs and fix some sniff violations

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/380988 )

Change subject: Add composer/phpcs and fix some sniff violations
..


Add composer/phpcs and fix some sniff violations

Bug: T176878
Change-Id: Ib29e3cedf2ebd9bdb65c288b9cb8806e02e46d5e
---
A .gitignore
M ArticleRatings.alias.php
M ArticleRatingsHooks.php
M RatingDataClass.php
M SpecialChangeRating.php
M SpecialMassRatings.php
A composer.json
A phpcs.xml
8 files changed, 102 insertions(+), 57 deletions(-)

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



diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..8cbff68
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+*.kate-swp
+*~
+.*.swp
+.svn
+/node_modules/
+/vendor/
+composer.lock
diff --git a/ArticleRatings.alias.php b/ArticleRatings.alias.php
index 969d3c1..461d7e2 100644
--- a/ArticleRatings.alias.php
+++ b/ArticleRatings.alias.php
@@ -6,10 +6,10 @@
  * @ingroup Extensions
  */
 
-$specialPageAliases = array();
+$specialPageAliases = [];
 
 /** English */
-$specialPageAliases['en'] = array(
-   'ChangeRating' => array( 'ChangeRating' ),
-   'MassRatings' => array( 'MassRatings' ),
-);
+$specialPageAliases['en'] = [
+   'ChangeRating' => [ 'ChangeRating' ],
+   'MassRatings' => [ 'MassRatings' ],
+];
diff --git a/ArticleRatingsHooks.php b/ArticleRatingsHooks.php
index 3f52157..eb177e6 100644
--- a/ArticleRatingsHooks.php
+++ b/ArticleRatingsHooks.php
@@ -17,7 +17,7 @@
 * @return bool
 */
public static function onParserFirstCallInit( Parser $parser ) {
-   $parser->setHook( 'rating', array( __CLASS__, 'renderRating' ) 
);
+   $parser->setHook( 'rating', [ __CLASS__, 'renderRating' ] );
return true;
}
 
@@ -73,10 +73,10 @@
$field = $dbr->selectField(
'ratings',
'ratings_rating',
-   array(
+   [
'ratings_title' => $title->getDBkey(),
'ratings_namespace' => $title->getNamespace(),
-   ),
+   ],
__METHOD__
);
 
@@ -89,7 +89,8 @@
 
if ( isset( $args['initial-rating'] ) ) {
foreach ( $ratings as $rating ) {
-   if ( $args['initial-rating'] == 
$rating->getCodename() ) { // check if the rating actually exists
+   // check if the rating actually exists
+   if ( $args['initial-rating'] == 
$rating->getCodename() ) {
$useRating = $rating;
}
}
@@ -99,11 +100,11 @@
 
$dbw->insert(
'ratings',
-   array(
+   [
'ratings_rating' => 
$useRating->getCodename(),
'ratings_title' => $title->getDBkey(),
'ratings_namespace' => 
$title->getNamespace()
-   ),
+   ],
__METHOD__
);
}
@@ -124,14 +125,14 @@
 
$res = $dbw->update(
'ratings',
-   array(
+   [
'ratings_title' => $newTitle->getDBkey(),
'ratings_namespace' => $newTitle->getNamespace()
-   ),
-   array(
+   ],
+   [
'ratings_title' => $title->getDBkey(),
'ratings_namespace' => $title->getNamespace()
-   ),
+   ],
__METHOD__
);
 
@@ -146,18 +147,19 @@
$res = $dbr->select(
'ratings',
'ratings_rating',
-   array(
+   [
'ratings_title' => $title->getDBkey(),
'ratings_namespace' => 
$title->getNamespace()
-   ),
+   ],
__METHOD__
);
 
if ( $res && $res->numRows() ) {
-   $toolbox['rating'] = array(
+   $toolbox['rating'] = [
'text' => 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Follow-up 67f04373d fix stupid typo

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381357 )

Change subject: Follow-up 67f04373d fix stupid typo
..


Follow-up 67f04373d fix stupid typo

Fot should be For

Change-Id: I3cb87a94feea32f1c98345ceaa19f9a75fde266d
---
M maintenance/updateSpecialPages.php
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/maintenance/updateSpecialPages.php 
b/maintenance/updateSpecialPages.php
index cc9f763..e2c0c61 100644
--- a/maintenance/updateSpecialPages.php
+++ b/maintenance/updateSpecialPages.php
@@ -101,7 +101,7 @@
$this->output( sprintf( 
"%.2fs\n", $seconds ) );
}
# Reopen any connections that have 
closed
-   $this->reopenAndWaitFotReplicas();
+   $this->reopenAndWaitForReplicas();
} else {
$this->output( "cheap, skipped\n" );
}
@@ -118,7 +118,7 @@
 * Queries that take a really long time, might cause the
 * mysql connection to "go away"
 */
-   private function reopenAndWaiFotReplicas() {
+   private function reopenAndWaitForReplicas() {
if ( !wfGetLB()->pingAll() ) {
$this->output( "\n" );
do {

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

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

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


[MediaWiki-commits] [Gerrit] marvin[master]: Fix: unmarshalled extracts that contain no paragraphs

2017-09-28 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381370 )

Change subject: Fix: unmarshalled extracts that contain no paragraphs
..

Fix: unmarshalled extracts that contain no paragraphs

- When an extract contains no paragraphs, unmarshal the entire extract
  as a property. This was the intended but broken behavior.

- Omit undefined properties from PageSummary and add a test.

- Rename parseExtract() and parameter to include the word "HTML" in
  their names for clarity.

Change-Id: Ib451bd7c607249e0d6a840e88969e9971b7a75df
---
M src/common/marshallers/page-unmarshaller.test.ts
M src/common/marshallers/page-unmarshaller.ts
2 files changed, 59 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/70/381370/1

diff --git a/src/common/marshallers/page-unmarshaller.test.ts 
b/src/common/marshallers/page-unmarshaller.test.ts
index 22418a5..eada598 100644
--- a/src/common/marshallers/page-unmarshaller.test.ts
+++ b/src/common/marshallers/page-unmarshaller.test.ts
@@ -1,13 +1,49 @@
 import * as assert from "assert";
 import * as fetch from "node-fetch";
-import { pageSummaryReviver } from "../models/page";
+import { PageSummary, pageSummaryReviver } from "../models/page";
 import { unmarshalPageSummary } from "./page-unmarshaller";
+import { RESTBase } from "./restbase";
 
+const ETAG = "802006980/4f754377-a235-11e7-a776-efb84f18649a";
 const HEADERS = new fetch.Headers();
-HEADERS.append("etag", "802006980/4f754377-a235-11e7-a776-efb84f18649a");
+HEADERS.append("etag", ETAG);
+
+const NOW = new Date(Date.now()).toString();
 
 describe("page-unmarshaller", () => {
-  it("unmarshalPageSummary() unmarshals", () => {
+  describe(".unmarshalPageSummary() unmarshals", () => {
+// eslint-disable-next-line max-len
+it("omits undefined properties and returns extract even when there are no 
paragraphs", () => {
+  const json: RESTBase.PageSummary.PageSummary = {
+title: "title",
+displaytitle: "displaytitle",
+pageid: 1,
+extract: "extract",
+extract_html: "extract_html",
+lang: "en",
+dir: "ltr",
+timestamp: NOW,
+description: "description"
+  };
+  const expected: PageSummary = {
+pageID: 1,
+titleText: "title",
+titleHTML: "displaytitle",
+descriptionText: "description",
+lastModified: new Date(Date.parse(NOW)),
+etag: ETAG,
+wikiLanguageCode: "en",
+localeDirection: "ltr",
+extractText: "extract",
+extractHTML: ["extract_html"]
+  };
+  const input = { headers: HEADERS, json: json as {} };
+  const actual = unmarshalPageSummary(input);
+  assert.deepStrictEqual(actual, expected);
+});
+  });
+
+  it("unmarshalPageSummary() unmarshals a server response", () => {
 const input = require("./page-restbase-mount-everest-input.test.json");
 const result = unmarshalPageSummary({ headers: HEADERS, json: input });
 const expected = JSON.parse(
diff --git a/src/common/marshallers/page-unmarshaller.ts 
b/src/common/marshallers/page-unmarshaller.ts
index 5033d78..938350c 100644
--- a/src/common/marshallers/page-unmarshaller.ts
+++ b/src/common/marshallers/page-unmarshaller.ts
@@ -58,18 +58,19 @@
 // Domino was chosen for familiarity and because it's already used on the MCS
 // backend. This is a service-only dependency so the client filesize is not
 // affected at the expense of two different code paths.
-const parseExtract = (extract: string) => {
+const parseExtractHTML = (extractHTML: string) => {
   const element =
 typeof document === "undefined"
   ? require("domino").createDocument().body
   : document.implementation.createHTMLDocument("").body;
-  element.innerHTML = extract;
+  element.innerHTML = extractHTML;
+
+  // todo: replace with `Array.of(element.querySelectorAll("p"))` when
+  //   https://github.com/fgnass/domino/issues/99 is fixed.
   const paragraphs = Array.prototype.slice.call(element.querySelectorAll("p"));
-  return (
-paragraphs.map(
-  (paragraph: HTMLParagraphElement) => paragraph.outerHTML
-) || [extract]
-  );
+  return paragraphs.length
+? paragraphs.map((paragraph: HTMLParagraphElement) => paragraph.outerHTML)
+: [extractHTML];
 };
 
 export const unmarshalETag = (headers: IsomorphicHeaders): RESTBase.ETag => {
@@ -88,7 +89,7 @@
   json: JSONObject;
 }): PageSummary => {
   const type: RESTBase.PageSummary.PageSummary = json as any;
-  return {
+  const result: PageSummary = {
 wikiLanguageCode: type.lang,
 localeDirection: type.dir,
 pageID: type.pageid,
@@ -97,11 +98,17 @@
 titleHTML: type.displaytitle,
 descriptionText: type.description,
 extractText: type.extract,
-extractHTML: parseExtract(type.extract_html),
-thumbnail: type.thumbnail && unmarshalPageThumbnail(type.thumbnail as 

[MediaWiki-commits] [Gerrit] marvin[master]: Chore: use API for generating links

2017-09-28 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381369 )

Change subject: Chore: use API for generating links
..

Chore: use API for generating links

Specifying `/` instead of `home.url()` is pretty innocuous. However,
typing is nice so why not be explicit?

Change-Id: Icd2181fb89f0564224e9a4f9c4992a90fbc23f89
---
M src/common/components/header/header.tsx
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/69/381369/1

diff --git a/src/common/components/header/header.tsx 
b/src/common/components/header/header.tsx
index 3d05091..c3810b5 100644
--- a/src/common/components/header/header.tsx
+++ b/src/common/components/header/header.tsx
@@ -2,6 +2,7 @@
 import Icon, { menu, search } from "../icon/icon";
 import Wordmark from "../wordmark/wordmark";
 import Link from "../link";
+import { home } from "../../routers/api";
 
 import "./header.css";
 
@@ -10,7 +11,7 @@
 
   
 
-
+
   
 
   

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd2181fb89f0564224e9a4f9c4992a90fbc23f89
Gerrit-PatchSet: 1
Gerrit-Project: marvin
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: Sniedzielski 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: releases: fix jenkins_prefix, /ci not /jenkins

2017-09-28 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381368 )

Change subject: releases: fix jenkins_prefix, /ci not /jenkins
..


releases: fix jenkins_prefix, /ci not /jenkins

The jenkins_prefix on contint1001 is /ci and the
Apache ReverseProxy setup here also expected /ci
but it was set to /jenkins here, which kept jenkins
from working on releases1001.

https://releases.wikimedia.org/ci/ is up after i manually
fixed that and went through the setup wizard with the
generated admin password.

Bug: T164030
Change-Id: Iaee354c3f4a621532da346d0e880c0cc82aa0f4c
---
M modules/profile/manifests/releases/mediawiki.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/profile/manifests/releases/mediawiki.pp 
b/modules/profile/manifests/releases/mediawiki.pp
index 3a11e24..e662681 100644
--- a/modules/profile/manifests/releases/mediawiki.pp
+++ b/modules/profile/manifests/releases/mediawiki.pp
@@ -7,7 +7,7 @@
 class { '::jenkins':
 access_log => true,
 http_port  => '8080',
-prefix => '/jenkins',
+prefix => '/ci',
 umask  => '0002',
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaee354c3f4a621532da346d0e880c0cc82aa0f4c
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Chad 
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] operations/puppet[production]: releases: fix jenkins_prefix, /ci not /jenkins

2017-09-28 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381368 )

Change subject: releases: fix jenkins_prefix, /ci not /jenkins
..

releases: fix jenkins_prefix, /ci not /jenkins

The jenkins_prefix on contint1001 is /ci and the
Apache ReverseProxy setup here also expected /ci
but it was set to /jenkins here, which kept jenkins
from working on releases1001.

https://releases.wikimedia.org/ci/ is up after i manually
fixed that and went through the setup wizard with the
generated admin password.

Bug: T164030
Change-Id: Iaee354c3f4a621532da346d0e880c0cc82aa0f4c
---
M modules/profile/manifests/releases/mediawiki.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/68/381368/1

diff --git a/modules/profile/manifests/releases/mediawiki.pp 
b/modules/profile/manifests/releases/mediawiki.pp
index 3a11e24..e662681 100644
--- a/modules/profile/manifests/releases/mediawiki.pp
+++ b/modules/profile/manifests/releases/mediawiki.pp
@@ -7,7 +7,7 @@
 class { '::jenkins':
 access_log => true,
 http_port  => '8080',
-prefix => '/jenkins',
+prefix => '/ci',
 umask  => '0002',
 }
 

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...tools[deploy]: Merge branch 'master' into deploy

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381367 )

Change subject: Merge branch 'master' into deploy
..


Merge branch 'master' into deploy

bce4030 Add lastet_currency_symbol to export

Change-Id: I80d8ed100cf1ad3fe3403520562cf96ebd38813b
---
D silverpop_export/tests/minimal_schema.sql
D silverpop_export/tests/test_update.py
2 files changed, 0 insertions(+), 427 deletions(-)

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



diff --git a/silverpop_export/tests/minimal_schema.sql 
b/silverpop_export/tests/minimal_schema.sql
deleted file mode 100644
index dc47786..000
--- a/silverpop_export/tests/minimal_schema.sql
+++ /dev/null
@@ -1,133 +0,0 @@
-<<< HEAD   (69a962 Merge branch 'master' into deploy)
-===
--- TODO: Do something SQLy to make *sure* we're not in a real database.
-
-drop table if exists civicrm_email;
-create table civicrm_email (
-id int(10) unsigned auto_increment primary key,
-contact_id int(10) unsigned,
-email varchar(254) COLLATE utf8_unicode_ci,
-is_primary tinyint(4) default '1',
-on_hold tinyint(4) default '0',
-key UI_email (email)
-);
-
-drop table if exists civicrm_contact;
-create table civicrm_contact (
-id int(10) unsigned auto_increment primary key,
-do_not_email tinyint(4) default '0',
-do_not_phone tinyint(4) default '0',
-do_not_mail tinyint(4) default '0',
-do_not_sms tinyint(4) default '0',
-do_not_trade tinyint(4) default '1',
-is_opt_out tinyint(4) default '0',
-preferred_language varchar(32) COLLATE utf8_unicode_ci,
-first_name varchar(64) COLLATE utf8_unicode_ci,
-middle_name varchar(64) COLLATE utf8_unicode_ci,
-last_name varchar(64) COLLATE utf8_unicode_ci,
-is_deleted tinyint(4) default '0'
-);
-
-drop table if exists civicrm_currency;
-create table civicrm_currency (
-id int(10) unsigned auto_increment primary key,
-name varchar(64) COLLATE utf8_unicode_ci,
-symbol varchar(8) COLLATE utf8_unicode_ci,
-key UI_name (name)
-);
-insert into civicrm_currency (name, symbol)
-values
-('USD', '$'),
-('CAD', '$'),
-('GBP', '£'),
-('DZD', NULL);
-
-drop table if exists wmf_donor;
-create table wmf_donor (
-id int(10) unsigned,
-entity_id int(10) unsigned,
-do_not_solicit tinyint(4),
-is_2006_donor tinyint(4),
-is_2007_donor tinyint(4),
-is_2008_donor tinyint(4),
-is_2009_donor tinyint(4),
-is_2010_donor tinyint(4),
-is_2011_donor tinyint(4),
-is_2012_donor tinyint(4),
-is_2013_donor tinyint(4),
-is_2014_donor tinyint(4),
-is_2015_donor tinyint(4),
-is_2016_donor tinyint(4),
-is_2017_donor tinyint(4),
-is_2018_donor tinyint(4),
-is_2019_donor tinyint(4),
-is_2020_donor tinyint(4),
-is_2021_donor tinyint(4),
-is_2022_donor tinyint(4),
-is_2023_donor tinyint(4),
-is_2024_donor tinyint(4),
-is_2025_donor tinyint(4),
-last_donation_date datetime,
-last_donation_currency varchar(255) COLLATE utf8_unicode_ci,
-last_donation_amount decimal(20,2),
-last_donation_usd decimal(20,2),
-lifetime_usd_total decimal(20,2)
-);
-
-drop table if exists civicrm_contribution;
-create table civicrm_contribution (
-id int(10) unsigned,
-contact_id int(10) unsigned,
-receive_date datetime,
-total_amount decimal(20,2),
-trxn_id varchar(255) COLLATE utf8_unicode_ci,
-contribution_status_id int(10) unsigned
-);
-
-drop table if exists civicrm_address;
-create table civicrm_address (
-id int(10) unsigned auto_increment primary key,
-contact_id int(10) unsigned,
-is_primary tinyint(4),
-city varchar(64) COLLATE utf8_unicode_ci,
-postal_code varchar(64) COLLATE utf8_unicode_ci,
-country_id int(10) unsigned,
-state_province_id int(10) unsigned,
-timezone varchar(8) COLLATE utf8_unicode_ci
-);
-
-drop table if exists civicrm_country;
-create table civicrm_country (
-id int(10) unsigned,
-iso_code char(2) COLLATE utf8_unicode_ci
-);
-
-drop table if exists civicrm_state_province;
-create table civicrm_state_province (
-  id int(10) unsigned,
-  name varchar(64) COLLATE utf8_unicode_ci
-);
-
-drop table if exists wmf_contribution_extra;
-create table wmf_contribution_extra (
-entity_id int(10) unsigned,
-original_amount decimal(20,2),
-original_currency varchar(255) COLLATE utf8_unicode_ci
-);
-
-drop table if exists contribution_tracking;
-create table contribution_tracking (
-contribution_id int(10) unsigned,
-country varchar(2)
-);
-
-drop table if exists log_civicrm_email;
-create table log_civicrm_email (
-email varchar(254) COLLATE utf8_unicode_ci
-);
-
-drop table if exists civicrm_uf_match;
-create table civicrm_uf_match (
-uf_name varchar(128) COLLATE utf8_unicode_ci
-);
->>> BRANCH (bce403 Add lastet_currency_symbol to export)
diff --git 

[MediaWiki-commits] [Gerrit] wikimedia...tools[deploy]: Merge branch 'master' into deploy

2017-09-28 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381367 )

Change subject: Merge branch 'master' into deploy
..

Merge branch 'master' into deploy

bce4030 Add lastet_currency_symbol to export

Change-Id: I80d8ed100cf1ad3fe3403520562cf96ebd38813b
---
D silverpop_export/tests/minimal_schema.sql
D silverpop_export/tests/test_update.py
2 files changed, 0 insertions(+), 427 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/67/381367/1

diff --git a/silverpop_export/tests/minimal_schema.sql 
b/silverpop_export/tests/minimal_schema.sql
deleted file mode 100644
index dc47786..000
--- a/silverpop_export/tests/minimal_schema.sql
+++ /dev/null
@@ -1,133 +0,0 @@
-<<< HEAD   (69a962 Merge branch 'master' into deploy)
-===
--- TODO: Do something SQLy to make *sure* we're not in a real database.
-
-drop table if exists civicrm_email;
-create table civicrm_email (
-id int(10) unsigned auto_increment primary key,
-contact_id int(10) unsigned,
-email varchar(254) COLLATE utf8_unicode_ci,
-is_primary tinyint(4) default '1',
-on_hold tinyint(4) default '0',
-key UI_email (email)
-);
-
-drop table if exists civicrm_contact;
-create table civicrm_contact (
-id int(10) unsigned auto_increment primary key,
-do_not_email tinyint(4) default '0',
-do_not_phone tinyint(4) default '0',
-do_not_mail tinyint(4) default '0',
-do_not_sms tinyint(4) default '0',
-do_not_trade tinyint(4) default '1',
-is_opt_out tinyint(4) default '0',
-preferred_language varchar(32) COLLATE utf8_unicode_ci,
-first_name varchar(64) COLLATE utf8_unicode_ci,
-middle_name varchar(64) COLLATE utf8_unicode_ci,
-last_name varchar(64) COLLATE utf8_unicode_ci,
-is_deleted tinyint(4) default '0'
-);
-
-drop table if exists civicrm_currency;
-create table civicrm_currency (
-id int(10) unsigned auto_increment primary key,
-name varchar(64) COLLATE utf8_unicode_ci,
-symbol varchar(8) COLLATE utf8_unicode_ci,
-key UI_name (name)
-);
-insert into civicrm_currency (name, symbol)
-values
-('USD', '$'),
-('CAD', '$'),
-('GBP', '£'),
-('DZD', NULL);
-
-drop table if exists wmf_donor;
-create table wmf_donor (
-id int(10) unsigned,
-entity_id int(10) unsigned,
-do_not_solicit tinyint(4),
-is_2006_donor tinyint(4),
-is_2007_donor tinyint(4),
-is_2008_donor tinyint(4),
-is_2009_donor tinyint(4),
-is_2010_donor tinyint(4),
-is_2011_donor tinyint(4),
-is_2012_donor tinyint(4),
-is_2013_donor tinyint(4),
-is_2014_donor tinyint(4),
-is_2015_donor tinyint(4),
-is_2016_donor tinyint(4),
-is_2017_donor tinyint(4),
-is_2018_donor tinyint(4),
-is_2019_donor tinyint(4),
-is_2020_donor tinyint(4),
-is_2021_donor tinyint(4),
-is_2022_donor tinyint(4),
-is_2023_donor tinyint(4),
-is_2024_donor tinyint(4),
-is_2025_donor tinyint(4),
-last_donation_date datetime,
-last_donation_currency varchar(255) COLLATE utf8_unicode_ci,
-last_donation_amount decimal(20,2),
-last_donation_usd decimal(20,2),
-lifetime_usd_total decimal(20,2)
-);
-
-drop table if exists civicrm_contribution;
-create table civicrm_contribution (
-id int(10) unsigned,
-contact_id int(10) unsigned,
-receive_date datetime,
-total_amount decimal(20,2),
-trxn_id varchar(255) COLLATE utf8_unicode_ci,
-contribution_status_id int(10) unsigned
-);
-
-drop table if exists civicrm_address;
-create table civicrm_address (
-id int(10) unsigned auto_increment primary key,
-contact_id int(10) unsigned,
-is_primary tinyint(4),
-city varchar(64) COLLATE utf8_unicode_ci,
-postal_code varchar(64) COLLATE utf8_unicode_ci,
-country_id int(10) unsigned,
-state_province_id int(10) unsigned,
-timezone varchar(8) COLLATE utf8_unicode_ci
-);
-
-drop table if exists civicrm_country;
-create table civicrm_country (
-id int(10) unsigned,
-iso_code char(2) COLLATE utf8_unicode_ci
-);
-
-drop table if exists civicrm_state_province;
-create table civicrm_state_province (
-  id int(10) unsigned,
-  name varchar(64) COLLATE utf8_unicode_ci
-);
-
-drop table if exists wmf_contribution_extra;
-create table wmf_contribution_extra (
-entity_id int(10) unsigned,
-original_amount decimal(20,2),
-original_currency varchar(255) COLLATE utf8_unicode_ci
-);
-
-drop table if exists contribution_tracking;
-create table contribution_tracking (
-contribution_id int(10) unsigned,
-country varchar(2)
-);
-
-drop table if exists log_civicrm_email;
-create table log_civicrm_email (
-email varchar(254) COLLATE utf8_unicode_ci
-);
-
-drop table if exists civicrm_uf_match;
-create table civicrm_uf_match (
-uf_name varchar(128) COLLATE utf8_unicode_ci
-);
->>> BRANCH (bce403 Add lastet_currency_symbol to export)

[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381366 )

Change subject: Merge branch 'master' into deployment
..


Merge branch 'master' into deployment

d6c0e44d5 Delete redundant logging module
fcf20bf51 Don't clobber contribution_tracking in makemissing mode

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

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b818013c8dae281628a132e25be40bdaad36ce2
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment

2017-09-28 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381366 )

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

d6c0e44d5 Delete redundant logging module
fcf20bf51 Don't clobber contribution_tracking in makemissing mode

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


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/66/381366/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b818013c8dae281628a132e25be40bdaad36ce2
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: releases/jenkins: add ProxyPassReverse config line

2017-09-28 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381365 )

Change subject: releases/jenkins: add ProxyPassReverse config line
..


releases/jenkins: add ProxyPassReverse config line

Seems this line was missing when comparing the setup
to the working one on contint1001 from the file "jenkins_proxy".

Bug: T164030
Change-Id: I22f908c181f15272e0c5dbd33aa92771533b6685
---
M modules/releases/templates/apache.conf.erb
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/modules/releases/templates/apache.conf.erb 
b/modules/releases/templates/apache.conf.erb
index 664022d..5cf2a81 100644
--- a/modules/releases/templates/apache.conf.erb
+++ b/modules/releases/templates/apache.conf.erb
@@ -26,6 +26,7 @@
 ProxyVia Off
 ProxyPreserveHost On
 ProxyPass /ci/ http://127.0.0.1:8080/ci/ retry=0 nocanon
+ProxyPassReverse /ci http://localhost:8080/ci
 
 ErrorLog /var/log/apache2/<%= @sitename %>.error.log
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I22f908c181f15272e0c5dbd33aa92771533b6685
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Chad 
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] operations/puppet[production]: releases/jenkins: add ProxyPassReverse config line

2017-09-28 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381365 )

Change subject: releases/jenkins: add ProxyPassReverse config line
..

releases/jenkins: add ProxyPassReverse config line

Seems this line was missing when comparing the setup
to the working one on contint1001 from the file "jenkins_proxy".

Bug: T164030
Change-Id: I22f908c181f15272e0c5dbd33aa92771533b6685
---
M modules/releases/templates/apache.conf.erb
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/65/381365/1

diff --git a/modules/releases/templates/apache.conf.erb 
b/modules/releases/templates/apache.conf.erb
index 664022d..5cf2a81 100644
--- a/modules/releases/templates/apache.conf.erb
+++ b/modules/releases/templates/apache.conf.erb
@@ -26,6 +26,7 @@
 ProxyVia Off
 ProxyPreserveHost On
 ProxyPass /ci/ http://127.0.0.1:8080/ci/ retry=0 nocanon
+ProxyPassReverse /ci http://localhost:8080/ci
 
 ErrorLog /var/log/apache2/<%= @sitename %>.error.log
 

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

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

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


[MediaWiki-commits] [Gerrit] labs...heritage[master]: Fix incorrect mapping in am_hy

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381361 )

Change subject: Fix incorrect mapping in am_hy
..


Fix incorrect mapping in am_hy

Bug: T176991
Change-Id: If93d8387b3da6b71d33521cb7e737ead498ba15b
---
M erfgoedbot/monuments_config/am_hy.json
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jean-Frédéric: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/erfgoedbot/monuments_config/am_hy.json 
b/erfgoedbot/monuments_config/am_hy.json
index 7019742..4b0aa17 100644
--- a/erfgoedbot/monuments_config/am_hy.json
+++ b/erfgoedbot/monuments_config/am_hy.json
@@ -83,7 +83,7 @@
 },
 {
 "dest": "registrant_url",
-"source": "gov_doc_id",
+"source": "հղում",
 "conv": "generateRegistrantUrl"
 }
 ],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If93d8387b3da6b71d33521cb7e737ead498ba15b
Gerrit-PatchSet: 2
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 
Gerrit-Reviewer: Jean-Frédéric 
Gerrit-Reviewer: Multichill 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] labs...heritage[master]: Add unmapped fields for al_sq

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381364 )

Change subject: Add unmapped fields for al_sq
..


Add unmapped fields for al_sq

Also drop invalid registrar_url field

Change-Id: I5156279973e79d3011e53f3b3980a40a9de0cebf
Task: T176118
---
M erfgoedbot/monuments_config/al_sq.json
1 file changed, 17 insertions(+), 5 deletions(-)

Approvals:
  Jean-Frédéric: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/erfgoedbot/monuments_config/al_sq.json 
b/erfgoedbot/monuments_config/al_sq.json
index 2c51aa0..a9367da 100644
--- a/erfgoedbot/monuments_config/al_sq.json
+++ b/erfgoedbot/monuments_config/al_sq.json
@@ -26,6 +26,22 @@
 "source": "Nr"
 },
 {
+"dest": "category",
+"source": "Kategoria"
+},
+{
+"dest": "field",
+"source": "Fusha"
+},
+{
+"dest": "type",
+"source": "Tipologjia"
+},
+{
+"dest": "county",
+"source": "Qarku"
+},
+{
 "dest": "place",
 "source": "Lokacioni"
 },
@@ -51,10 +67,6 @@
 "dest": "monument_article",
 "source": "Emërtimi",
 "conv": "extractWikilink"
-},
-{
-"dest": "registrant_url",
-"source": ""
 }
 ],
 "sql_lang": "Albanian",
@@ -113,4 +125,4 @@
 "type": "Field"
 }
 }
-}
\ No newline at end of file
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5156279973e79d3011e53f3b3980a40a9de0cebf
Gerrit-PatchSet: 2
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 
Gerrit-Reviewer: Jean-Frédéric 
Gerrit-Reviewer: Multichill 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] integration/config[master]: lintr-docker timeout 5 mins

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381256 )

Change subject: lintr-docker timeout 5 mins
..


lintr-docker timeout 5 mins

Change-Id: I46a155bad4e3e4963bf97bd0d071a4d035858cb4
---
M jjb/r-jobs.yaml
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/jjb/r-jobs.yaml b/jjb/r-jobs.yaml
index ce085d0..26c7b4c 100644
--- a/jjb/r-jobs.yaml
+++ b/jjb/r-jobs.yaml
@@ -13,7 +13,7 @@
 logdir: '/log'
 wrappers:
  - timeout:
- timeout: 1 # minute
+ timeout: 5 # minute
  - timestamps
  - ansicolor
 publishers:
@@ -27,4 +27,4 @@
 
 - job:
 !!merge : *job_lintr-docker
-name: lintr-docker-non-voting
\ No newline at end of file
+name: lintr-docker-non-voting

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I46a155bad4e3e4963bf97bd0d071a4d035858cb4
Gerrit-PatchSet: 3
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Addshore 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] integration/config[master]: docker: use nobody user instead of creating custom users

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381363 )

Change subject: docker: use nobody user instead of creating custom users
..


docker: use nobody user instead of creating custom users

Change-Id: I7ed2491cbab251c16977f1f39b0c1881c2416e70
---
M dockerfiles/composer/Dockerfile
M dockerfiles/mediawiki-phan/Dockerfile
M dockerfiles/php-mediawiki/Dockerfile
M dockerfiles/php/Dockerfile
4 files changed, 6 insertions(+), 13 deletions(-)

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



diff --git a/dockerfiles/composer/Dockerfile b/dockerfiles/composer/Dockerfile
index cebac5e..925c585 100644
--- a/dockerfiles/composer/Dockerfile
+++ b/dockerfiles/composer/Dockerfile
@@ -7,9 +7,6 @@
 RUN git clone --depth 1 
https://gerrit.wikimedia.org/r/p/integration/composer.git /srv/composer && \
 rm -rf /srv/composer/.git
 
-RUN groupadd -r composer && useradd --no-log-init -r -g composer composer
-
-USER composer
-
+USER nobody
 ENTRYPOINT ["/srv/composer/vendor/bin/composer"]
 CMD ["help"]
diff --git a/dockerfiles/mediawiki-phan/Dockerfile 
b/dockerfiles/mediawiki-phan/Dockerfile
index cba34ea..bf8745a 100644
--- a/dockerfiles/mediawiki-phan/Dockerfile
+++ b/dockerfiles/mediawiki-phan/Dockerfile
@@ -6,16 +6,14 @@
 
 COPY --from=composer /srv/composer /srv/composer
 
-RUN groupadd -r phan && \
-useradd --no-log-init --system --create-home -g phan phan && \
-install -d /srv/phan -o phan -g phan
+RUN install -d /srv/phan -o nobody
 
 ENV PHAN /srv/phan/vendor/bin/phan
 
-USER phan
+USER nobody
 
 RUN  cd /srv/phan && \
  /srv/composer/vendor/bin/composer require etsy/phan:0.8 && \
- rm -rf ~/.composer
+ rm -rf /cache/*
 
 ENTRYPOINT ["/mediawiki/tests/phan/bin/phan"]
diff --git a/dockerfiles/php-mediawiki/Dockerfile 
b/dockerfiles/php-mediawiki/Dockerfile
index 7fbf8d3..1d31687 100644
--- a/dockerfiles/php-mediawiki/Dockerfile
+++ b/dockerfiles/php-mediawiki/Dockerfile
@@ -19,4 +19,4 @@
 apt-get autoremove --yes && apt-get clean && rm -rf /var/lib/apt/lists/* 
&& \
 rm /etc/apt/sources.list.d/php.list
 
-USER php
\ No newline at end of file
+USER nobody
diff --git a/dockerfiles/php/Dockerfile b/dockerfiles/php/Dockerfile
index 08f7e2e..ee511e2 100644
--- a/dockerfiles/php/Dockerfile
+++ b/dockerfiles/php/Dockerfile
@@ -16,9 +16,7 @@
 apt-get autoremove --yes && apt-get clean && rm -rf /var/lib/apt/lists/* 
&& \
 rm /etc/apt/sources.list.d/php.list
 
-RUN groupadd -r php && useradd --no-log-init -r -g php php
-
-USER php
+USER nobody
 
 ENTRYPOINT ["php"]
 CMD ["--help"]

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7ed2491cbab251c16977f1f39b0c1881c2416e70
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Addshore 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...tools[deploy]: Merge branch 'master' into deploy

2017-09-28 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381293 )

Change subject: Merge branch 'master' into deploy
..

Merge branch 'master' into deploy

5708cf1 Add 'first_donation_date' column to Silverpop export
ce509d7 Alter definition of silverpop_countrylangs to match actual

Change-Id: Id6194f31078c6fb3616bc26c457853426286f653
---
D silverpop_export/tests/test_update.py
1 file changed, 0 insertions(+), 263 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/93/381293/1

diff --git a/silverpop_export/tests/test_update.py 
b/silverpop_export/tests/test_update.py
deleted file mode 100644
index 8b4fbe1..000
--- a/silverpop_export/tests/test_update.py
+++ /dev/null
@@ -1,263 +0,0 @@
-<<< HEAD   (8d3980 Merge branch 'master' into deploy)
-===
-import datetime
-from decimal import Decimal
-import mock
-import MySQLdb
-import os
-import warnings
-
-import database.db
-import silverpop_export.update
-
-conn = None
-db_name = None
-
-
-def setup():
-global conn
-global db_name
-# FIXME: parameterize test configuration better
-db_host = "127.0.0.1"
-db_pass = None
-if 'EXECUTOR_NUMBER' in os.environ:
-# We're running under Jenkins.  Assume things.
-db_name = "test"
-db_user = "root"
-else:
-db_name = "test"
-db_user = "test"
-
-db_params = {"user": db_user, "host": db_host}
-if db_pass:
-db_params['passwd'] = db_pass
-
-conn = database.db.Connection(**db_params)
-conn.execute("set default_storage_engine=memory")
-conn.execute("drop database if exists " + db_name)
-conn.execute("create database " + db_name)
-conn.db_conn.select_db(db_name)
-
-
-def test_test_setup():
-'''
-Set up the civcrm and export databases and run the update with no data.
-'''
-run_update_with_fixtures(fixture_queries=[])
-
-
-def test_duplicate():
-'''
-Test that we export one record for a duplicate contact.
-'''
-
-run_update_with_fixtures(fixture_queries=["""
-insert into civicrm_email (contact_id, email, is_primary, on_hold) values
-(1, 'person1@localhost', 1, 0),
-(2, 'person1@localhost', 1, 0);
-""", """
-insert into civicrm_contact (id) values
-(1),
-(2);
-"""])
-
-cursor = conn.db_conn.cursor()
-cursor.execute("select count(*) from silverpop_export")
-assert cursor.fetchone() == (1,)
-
-
-def test_no_donations():
-'''
-Test that we set the donation-related fields correctly when a contact has
-no donations.
-'''
-
-run_update_with_fixtures(fixture_queries=["""
-insert into civicrm_email (contact_id, email, is_primary, on_hold) values
-(1, 'person1@localhost', 1, 0);
-""", """
-insert into civicrm_contact (id) values
-(1);
-"""])
-
-cursor = conn.db_conn.cursor()
-cursor.execute("select has_recurred_donation, highest_usd_amount, " +
-   "highest_native_amount, highest_native_currency, " +
-   "highest_donation_date, lifetime_usd_total, " +
-   "donation_count, latest_currency, latest_native_amount, " +
-   "latest_usd_amount, latest_donation_date from 
silverpop_export_view")
-actual = cursor.fetchone()
-expected = ('NO', Decimal('0.00'),
-Decimal('0.00'), '',
-'', Decimal('0.00'),
-0, '', Decimal('0.00'),
-Decimal('0.00'), '')
-assert actual == expected
-
-
-def test_refund_history():
-'''
-Test that we don't include refunded donations in a donor's history
-'''
-
-run_update_with_fixtures(fixture_queries=["""
-insert into civicrm_email (contact_id, email, is_primary, on_hold) values
-(1, 'person1@localhost', 1, 0);
-""", """
-insert into civicrm_contact (id) values
-(1);
-""", """
-insert into civicrm_contribution (id, contact_id, receive_date, 
total_amount, trxn_id, contribution_status_id) values
-(1, 1, '2015-01-03', 15.25, 'xyz123', 1),
-(2, 1, '2016-05-05', 25.25, 'abc456', 9);
-""", """
-insert into wmf_contribution_extra (entity_id, original_amount, 
original_currency) values
-(1, 20.15, 'CAD'),
-(2, 35.15, 'CAD');
-"""])
-
-cursor = conn.db_conn.cursor()
-cursor.execute("select highest_usd_amount, lifetime_usd_total, 
donation_count, latest_currency, latest_native_amount, latest_usd_amount, 
latest_donation  from silverpop_export")
-expected = (Decimal('15.25'), Decimal('15.25'), 1, 'CAD', 
Decimal('20.15'), Decimal('15.25'), datetime.datetime(2015, 1, 3))
-assert cursor.fetchone() == expected
-
-
-def test_first_donation():
-"""
-Test that we correctly calculate the first donation date,
-not counting refunded donations.
-"""
-
-

[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Add test cases for summary endpoint

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/372875 )

Change subject: Add test cases for summary endpoint
..


Add test cases for summary endpoint

* Show that '.' do not impact summary length
* Show that bolding is retained

Change-Id: Id550eba05ff9d2746834b7802bf5f987aa216e09
---
M test/lib/transformations/summarize.js
1 file changed, 10 insertions(+), 0 deletions(-)

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



diff --git a/test/lib/transformations/summarize.js 
b/test/lib/transformations/summarize.js
index b58e3a3..a76110e 100644
--- a/test/lib/transformations/summarize.js
+++ b/test/lib/transformations/summarize.js
@@ -107,6 +107,16 @@
 [
 'Spain (Spanish: España [esˈpaɲa]), officially the Kingdom 
of Spain (Spanish: Reino de España), is a sovereign state located on the 
Iberian Peninsula in southwestern Europe, with two large archipelagoes, the 
Balearic Islands in the Mediterranean Sea and the Canary Islands off the North 
African Atlantic coast, two cities, Ceuta and Melilla, in the North African 
mainland and several small islands in the Alboran Sea near the Moroccan coast. 
The country\'s mainland is bordered to the south and east by the Mediterranean 
Sea except for a small land boundary with Gibraltar; to the north and northeast 
by France, Andorra, and the Bay of Biscay; and to the west and northwest by 
Portugal and the Atlantic Ocean. It is the only European country to have a 
border with an African country (Morocco) and its African territory accounts for 
nearly 5% of its population, mostly in the Canary Islands but also in Ceuta and 
Melilla',
 'Spain, officially the Kingdom of Spain, is a sovereign 
state located on the Iberian Peninsula in southwestern Europe, with two large 
archipelagoes, the Balearic Islands in the Mediterranean Sea and the Canary 
Islands off the North African Atlantic coast, two cities, Ceuta and Melilla, in 
the North African mainland and several small islands in the Alboran Sea near 
the Moroccan coast. The country\'s mainland is bordered to the south and east 
by the Mediterranean Sea except for a small land boundary with Gibraltar; to 
the north and northeast by France, Andorra, and the Bay of Biscay; and to the 
west and northwest by Portugal and the Atlantic Ocean. It is the only European 
country to have a border with an African country (Morocco) and its African 
territory accounts for nearly 5% of its population, mostly in the Canary 
Islands but also in Ceuta and Melilla'
+],
+// Full stops do not impact the summary length (T173640)
+[
+'Arm. gen. Ing. 
Petr Pavel, M.A., (*1.listopadu 
1961 Planá) je český voják, generál Armády České republiky 
aod června 2015 předseda vojenského výboru NATO. Jako první zástupce zemí bývalé Varšavské smlouvy 
tak nastoupil do nejvyšší vojenské funkce Severoatlantické aliance.[1][2]',
+'Arm. gen. Ing. Petr 
Pavel, M.A., je český 
voják, generál Armády České republiky 
aod června 2015 předseda vojenského výboru 
NATO. Jako první zástupce zemí bývalé Varšavské smlouvy tak 
nastoupil do nejvyšší vojenské funkce Severoatlantické 
aliance.'
+],
+// Bold tags are retained
+[
+'Vladimír Dlouhý (*31. července 1953 Praha) je český ekonom a politik, bývalý místopředseda strany ODA a ministr průmyslu a obchodu v letech 1992–1997 ve vládě Václava Klause. Vletech 1989–1992 byl ministrem hospodářství ČSFR. Nyní působí vsoukromé sféře a věnuje se 
poradenské a pedagogické činnosti, v květnu 2014 byl 
zvolen prezidentem Hospodářské komory ČR.',
+'Vladimír Dlouhý je český 
ekonom a politik, bývalý místopředseda strany 
ODA a ministr průmyslu a obchodu v letech 
1992–1997 ve vládě Václava Klause. 
Vletech 1989–1992 byl ministrem 
hospodářství ČSFR. Nyní působí vsoukromé sféře a věnuje se 
poradenské a pedagogické činnosti, v květnu 2014 byl 
zvolen prezidentem Hospodářské komory ČR.'
 ]
 ];
 testCases.forEach((test) => {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id550eba05ff9d2746834b7802bf5f987aa216e09
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Fjalapeno 
Gerrit-Reviewer: GWicke 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Mhurd 
Gerrit-Reviewer: Mobrovac 
Gerrit-Reviewer: Ppchelko 

[MediaWiki-commits] [Gerrit] labs...heritage[master]: Add unmapped field for al_sq

2017-09-28 Thread Lokal Profil (Code Review)
Lokal Profil has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381364 )

Change subject: Add unmapped field for al_sq
..

Add unmapped field for al_sq

Also drop invalid registrar_url field

Change-Id: I5156279973e79d3011e53f3b3980a40a9de0cebf
Task: T176118
---
M erfgoedbot/monuments_config/al_sq.json
1 file changed, 17 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage 
refs/changes/64/381364/1

diff --git a/erfgoedbot/monuments_config/al_sq.json 
b/erfgoedbot/monuments_config/al_sq.json
index 2c51aa0..a9367da 100644
--- a/erfgoedbot/monuments_config/al_sq.json
+++ b/erfgoedbot/monuments_config/al_sq.json
@@ -26,6 +26,22 @@
 "source": "Nr"
 },
 {
+"dest": "category",
+"source": "Kategoria"
+},
+{
+"dest": "field",
+"source": "Fusha"
+},
+{
+"dest": "type",
+"source": "Tipologjia"
+},
+{
+"dest": "county",
+"source": "Qarku"
+},
+{
 "dest": "place",
 "source": "Lokacioni"
 },
@@ -51,10 +67,6 @@
 "dest": "monument_article",
 "source": "Emërtimi",
 "conv": "extractWikilink"
-},
-{
-"dest": "registrant_url",
-"source": ""
 }
 ],
 "sql_lang": "Albanian",
@@ -113,4 +125,4 @@
 "type": "Field"
 }
 }
-}
\ No newline at end of file
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5156279973e79d3011e53f3b3980a40a9de0cebf
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 

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


[MediaWiki-commits] [Gerrit] integration/config[master]: docker: use nobody user instead of creating custom users

2017-09-28 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381363 )

Change subject: docker: use nobody user instead of creating custom users
..

docker: use nobody user instead of creating custom users

Change-Id: I7ed2491cbab251c16977f1f39b0c1881c2416e70
---
M dockerfiles/composer/Dockerfile
M dockerfiles/mediawiki-phan/Dockerfile
M dockerfiles/php-mediawiki/Dockerfile
M dockerfiles/php/Dockerfile
4 files changed, 6 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/63/381363/1

diff --git a/dockerfiles/composer/Dockerfile b/dockerfiles/composer/Dockerfile
index cebac5e..925c585 100644
--- a/dockerfiles/composer/Dockerfile
+++ b/dockerfiles/composer/Dockerfile
@@ -7,9 +7,6 @@
 RUN git clone --depth 1 
https://gerrit.wikimedia.org/r/p/integration/composer.git /srv/composer && \
 rm -rf /srv/composer/.git
 
-RUN groupadd -r composer && useradd --no-log-init -r -g composer composer
-
-USER composer
-
+USER nobody
 ENTRYPOINT ["/srv/composer/vendor/bin/composer"]
 CMD ["help"]
diff --git a/dockerfiles/mediawiki-phan/Dockerfile 
b/dockerfiles/mediawiki-phan/Dockerfile
index cba34ea..bf8745a 100644
--- a/dockerfiles/mediawiki-phan/Dockerfile
+++ b/dockerfiles/mediawiki-phan/Dockerfile
@@ -6,16 +6,14 @@
 
 COPY --from=composer /srv/composer /srv/composer
 
-RUN groupadd -r phan && \
-useradd --no-log-init --system --create-home -g phan phan && \
-install -d /srv/phan -o phan -g phan
+RUN install -d /srv/phan -o nobody
 
 ENV PHAN /srv/phan/vendor/bin/phan
 
-USER phan
+USER nobody
 
 RUN  cd /srv/phan && \
  /srv/composer/vendor/bin/composer require etsy/phan:0.8 && \
- rm -rf ~/.composer
+ rm -rf /cache/*
 
 ENTRYPOINT ["/mediawiki/tests/phan/bin/phan"]
diff --git a/dockerfiles/php-mediawiki/Dockerfile 
b/dockerfiles/php-mediawiki/Dockerfile
index 7fbf8d3..1d31687 100644
--- a/dockerfiles/php-mediawiki/Dockerfile
+++ b/dockerfiles/php-mediawiki/Dockerfile
@@ -19,4 +19,4 @@
 apt-get autoremove --yes && apt-get clean && rm -rf /var/lib/apt/lists/* 
&& \
 rm /etc/apt/sources.list.d/php.list
 
-USER php
\ No newline at end of file
+USER nobody
diff --git a/dockerfiles/php/Dockerfile b/dockerfiles/php/Dockerfile
index 08f7e2e..ee511e2 100644
--- a/dockerfiles/php/Dockerfile
+++ b/dockerfiles/php/Dockerfile
@@ -16,9 +16,7 @@
 apt-get autoremove --yes && apt-get clean && rm -rf /var/lib/apt/lists/* 
&& \
 rm /etc/apt/sources.list.d/php.list
 
-RUN groupadd -r php && useradd --no-log-init -r -g php php
-
-USER php
+USER nobody
 
 ENTRYPOINT ["php"]
 CMD ["--help"]

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Don't clobber contribution_tracking in makemissing mode

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381360 )

Change subject: Don't clobber contribution_tracking in makemissing mode
..


Don't clobber contribution_tracking in makemissing mode

When the audit processor is supposed to send incomplete data to
Civi, don't stuff the message with fake utm_ stuff if the message
has a contribution_tracking_id.

Bug: T176923
Change-Id: I62d63bc53c2ed6c00bcf999bf5eb7e9a7730ada0
---
M sites/all/modules/wmf_audit/BaseAuditProcessor.php
M sites/all/modules/wmf_audit/wmf_audit.module
2 files changed, 8 insertions(+), 4 deletions(-)

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



diff --git a/sites/all/modules/wmf_audit/BaseAuditProcessor.php 
b/sites/all/modules/wmf_audit/BaseAuditProcessor.php
index ac49482..6aa846b 100644
--- a/sites/all/modules/wmf_audit/BaseAuditProcessor.php
+++ b/sites/all/modules/wmf_audit/BaseAuditProcessor.php
@@ -273,7 +273,7 @@
 * actually make qc choke. Not so necessary with WP, but this will need 
to
 * happen elsewhere, probably. Just thinking ahead.
 * @param array $record transaction data
-* @return type The normalized data we want to send.
+* @return array The normalized data we want to send.
 */
protected function normalize_partial( $record ) {
//@TODO: Still need gateway account to go in here when that 
happens.
@@ -743,8 +743,12 @@
foreach ( $tryme as $date => $missing ) {
if ( (int) $date <= (int) $cutoff ) {
foreach ( $missing as $id => 
$message ) {
-   
$contribution_tracking_data = wmf_audit_make_contribution_tracking_data( 
$message );
-   $all_data = 
array_merge( $message, $contribution_tracking_data );
+   if ( empty( 
$message['contribution_tracking_id'] ) ) {
+   
$contribution_tracking_data = wmf_audit_make_contribution_tracking_data( 
$message );
+   $all_data = 
array_merge( $message, $contribution_tracking_data );
+   } else {
+   $all_data = 
$message;
+   }
$sendme = 
$this->normalize_partial( $all_data );

wmf_audit_send_transaction( $sendme, 'main' );
$made += 1;
diff --git a/sites/all/modules/wmf_audit/wmf_audit.module 
b/sites/all/modules/wmf_audit/wmf_audit.module
index da762c3..59a1a61 100644
--- a/sites/all/modules/wmf_audit/wmf_audit.module
+++ b/sites/all/modules/wmf_audit/wmf_audit.module
@@ -109,7 +109,7 @@
  * Not even a big deal if we overshoot and remove too many, because we'll just
  * remake them next time if they're missing.
  * @param string $date The date string for the oldest log we want to keep
- * @param string $working_logs path to working logs directory
+ * @param array $working_logs list of working log files by date
  */
 function wmf_audit_remove_old_logs($date, $working_logs) {
   if (!empty($working_logs)) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I62d63bc53c2ed6c00bcf999bf5eb7e9a7730ada0
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: XenoRyet 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Update bundled non-pagelib CSS

2017-09-28 Thread Mholloway (Code Review)
Mholloway has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381362 )

Change subject: Update bundled non-pagelib CSS
..

Update bundled non-pagelib CSS

Includes a good amount of work around MediaWiki galleries. I'm not sure
if this will have any effect for good or ill on T176753 as I've not been
able to reproduce that issue at all.

Change-Id: I3a8d615bb9b8d4423d0005e863310e6d327e0e17
---
M app/src/main/assets/preview.css
M app/src/main/assets/styles.css
2 files changed, 124 insertions(+), 78 deletions(-)


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

diff --git a/app/src/main/assets/preview.css b/app/src/main/assets/preview.css
index d6903eb..8fbe76b 100644
--- a/app/src/main/assets/preview.css
+++ b/app/src/main/assets/preview.css
@@ -316,7 +316,7 @@
 a.external {
   background-image: 
url(data:image/png;base64,iVBORw0KGgoNSUhEUgoKCAYAAACNMs+9VElEQVR42n3PgQkAIAhEUXdqJ3dqJ3e6IoTPUSQcgj4EQ5IlUiLE0Jil3PECXhcHGBhZ8kg4hwxAu3MZeCGeyFnAXp4hqNQPnt7QL0nADpD6wHccLvnAKksq8iiaAElFTkSuQmCC);
   background-image: 
url(/w/skins/MinervaNeue/resources/skins.minerva.content.styles/images/external-link-ltr-icon.png?948bf)!ie;
-  background-image: linear-gradient(transparent, transparent), 
url("data:image/svg+xml,%3C%3Fxml version=%221.0%22 
encoding=%22UTF-8%22%3F%3E%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 
width=%2210%22 height=%2210%22%3E%3Cpath fill=%22%23fff%22 stroke=%22%2336c%22 
d=%22M.5 3.518h5.982V9.5H.5z%22/%3E%3Cpath d=%22M4.755-.16H9.99v5.39L8.417 
6.774l-1.31-1.31L4.383 8.19 1.695 5.5l2.808-2.807-1.31-1.31z%22 
fill=%22%2336c%22/%3E%3Cpath d=%22M8.984.845l.022 4.884L7.19 3.91 4.308 6.79 
3.08 5.567l2.882-2.88L4.112.833z%22 fill=%22%23fff%22/%3E%3C/svg%3E");
+  background-image: linear-gradient(transparent, transparent), 
url('data:image/svg+xml,%3C%3Fxml version="1.0" encoding="UTF-8"%3F%3E%3Csvg 
xmlns="http://www.w3.org/2000/svg; width="10" height="10"%3E%3Cpath 
fill="%23fff" stroke="%2336c" d="M.5 3.518h5.982V9.5H.5z"/%3E%3Cpath 
d="M4.755-.16H9.99v5.39L8.417 6.774l-1.31-1.31L4.383 8.19 1.695 
5.5l2.808-2.807-1.31-1.31z" fill="%2336c"/%3E%3Cpath d="M8.984.845l.022 
4.884L7.19 3.91 4.308 6.79 3.08 5.567l2.882-2.88L4.112.833z" 
fill="%23fff"/%3E%3C/svg%3E');
   background-image: -o-linear-gradient(transparent, transparent), 
url(/w/skins/MinervaNeue/resources/skins.minerva.content.styles/images/external-link-ltr-icon.png?948bf);
   background-repeat: no-repeat;
   background-position: center right;
@@ -420,7 +420,7 @@
 .content .navbox {
   display: none;
 }
-.content .fmbox,
+.content .action-edit .fmbox,
 .content .tmbox,
 .content .ambox,
 .content #coordinates,
@@ -702,42 +702,7 @@
 .timeline-wrapper {
max-width: 100%;
overflow: auto;
-}@media print {
-   li.gallerybox {
-   vertical-align: top;
-   display: inline-block;
-   }
-   
-   ul.gallery,
-   li.gallerybox {
-   zoom: 1;
-   *display: inline;
-   }
-   
-   ul.gallery {
-   margin: 2px;
-   padding: 2px;
-   display: block;
-   }
-   
-   li.gallerycaption {
-   font-weight: bold;
-   text-align: center;
-   display: block;
-   word-wrap: break-word;
-   }
-   
-   li.gallerybox div.thumb {
-   background-color: #fff;
-   border: 1px solid #ccc;
-   }
-   
-   div.gallerytext {
-   overflow: hidden;
-   font-size: 10pt;
-   padding: 2px 4px;
-   word-wrap: break-word;
-   }}/* Galleries */
+}/* Galleries */
 /* These display attributes look nonsensical, but are needed to support IE and 
FF2 */
 /* Don't forget to update gallery.print.css */
 li.gallerybox {
@@ -924,7 +889,65 @@
border: 1px solid #c8ccd1;
background-color: #f8f9fa;
}
-}.ipa_button {
+}@media print {
+   li.gallerybox {
+   vertical-align: top;
+   display: inline-block;
+   }
+   
+   ul.gallery,
+   li.gallerybox {
+   zoom: 1;
+   *display: inline;
+   }
+   
+   ul.gallery {
+   margin: 2px;
+   padding: 2px;
+   display: block;
+   }
+   
+   li.gallerycaption {
+   font-weight: bold;
+   text-align: center;
+   display: block;
+   word-wrap: break-word;
+   }
+   
+   li.gallerybox div.thumb {
+   background-color: #fff;
+   border: 1px solid #ccc;
+   }
+   
+   div.gallerytext {
+   overflow: visible;
+   }
+   
+   ul.mw-gallery-packed-hover div.gallerytextwrapper {
+   overflow: visible;
+   height: auto;
+   

[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Make top-pages script take language command line parameter

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/378370 )

Change subject: Make top-pages script take language command line parameter
..


Make top-pages script take language command line parameter

Delay defining the language specific variables until reading the
process parameters.

Also: use the same blacklist as for the most-read endpoint.

Change-Id: Iee46c1744cea2bc80623da424302f3c475fae925
---
M scripts/top-pages-list.js
1 file changed, 20 insertions(+), 15 deletions(-)

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



diff --git a/scripts/top-pages-list.js b/scripts/top-pages-list.js
index 92511a8..ebe1eaf 100755
--- a/scripts/top-pages-list.js
+++ b/scripts/top-pages-list.js
@@ -7,26 +7,22 @@
 const fs = require("fs");
 const preq = require('preq');
 
-const lang = 'en'; // prepped for 'en' and 'zh'
-const topMonthlyPageViews = 
`https://wikimedia.org/api/rest_v1/metrics/pageviews/top/${lang}.wikipedia/all-access/2017/06/all-days`;
 // eslint-disable-line max-len
-const blacklist = [
-'Main_Page', // en: main page
-'Special%3ASearch', // already encoded
-'xHamster',
-'Wikipedia:首页', // zh: main page
-'台灣Youtuber訂閱人數排行榜' // zh: deleted page
-];
-const TOP_PAGES_FILE = `../private/top-pages/top-pages.${lang}.json`;
+const BLACKLIST = require('../etc/feed/blacklist');
 const SPECIAL = 'Special:';
 const SPECIAL2 = 'special:';
-const PARSOID_BASE_URI = `https://${lang}.wikipedia.org/api/rest_v1/page/html`;
+
+// Will be set later
+let lang;
+let topMonthlyPageViews;
+let topPagesFile;
+let parsoidBaseUri;
 
 const fixTitleForRequest = (pageTitle) => {
 return encodeURIComponent(pageTitle);
 };
 
 const writePages = (myPages) => {
-const logger = fs.createWriteStream(TOP_PAGES_FILE, { flags: 'w' });
+const logger = fs.createWriteStream(topPagesFile, { flags: 'w' });
 logger.write(`{ "items": [\n`);
 myPages.forEach((page, index, array) => {
 if (page) {
@@ -41,7 +37,7 @@
 
 const getETags = (myPages) => {
 return BBPromise.map(myPages, (page) => {
-const cmd = `curl --head 
"${PARSOID_BASE_URI}/${fixTitleForRequest(page.title)}"`;
+const cmd = `curl --head 
"${parsoidBaseUri}/${fixTitleForRequest(page.title)}"`;
 return exec(cmd)
 .then((rsp) => {
 if (!/^HTTP\/1.1 200 OK$/m.test(rsp)) {
@@ -68,7 +64,7 @@
 return rsp.body.items[0].articles.filter((article) => {
 const title = article.article;
 return (title.indexOf(SPECIAL) !== 0 && title.indexOf(SPECIAL2) 
!== 0
-&& !blacklist.includes(title));
+&& !BLACKLIST.includes(title));
 }).map((article) => {
 return { "title": article.article };
 });
@@ -79,4 +75,13 @@
 });
 };
 
-getTopPageViews();
+// MAIN
+const arg = process.argv[2];
+if (arg) {
+lang = arg;
+topMonthlyPageViews = 
`https://wikimedia.org/api/rest_v1/metrics/pageviews/top/${lang}.wikipedia/all-access/2017/06/all-days`;
 // eslint-disable-line max-len
+topPagesFile = `../private/top-pages/top-pages.${lang}.json`;
+parsoidBaseUri = `https://${lang}.wikipedia.org/api/rest_v1/page/html`;
+
+getTopPageViews();
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iee46c1744cea2bc80623da424302f3c475fae925
Gerrit-PatchSet: 11
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: BearND 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Fjalapeno 
Gerrit-Reviewer: GWicke 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Mhurd 
Gerrit-Reviewer: Mobrovac 
Gerrit-Reviewer: Ppchelko 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] labs...heritage[master]: Fix incorrect mapping in am_hy

2017-09-28 Thread Lokal Profil (Code Review)
Lokal Profil has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381361 )

Change subject: Fix incorrect mapping in am_hy
..

Fix incorrect mapping in am_hy

Bug: T176991
Change-Id: If93d8387b3da6b71d33521cb7e737ead498ba15b
---
M erfgoedbot/monuments_config/am_hy.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage 
refs/changes/61/381361/1

diff --git a/erfgoedbot/monuments_config/am_hy.json 
b/erfgoedbot/monuments_config/am_hy.json
index 7019742..4b0aa17 100644
--- a/erfgoedbot/monuments_config/am_hy.json
+++ b/erfgoedbot/monuments_config/am_hy.json
@@ -83,7 +83,7 @@
 },
 {
 "dest": "registrant_url",
-"source": "gov_doc_id",
+"source": "հղում",
 "conv": "generateRegistrantUrl"
 }
 ],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If93d8387b3da6b71d33521cb7e737ead498ba15b
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Group2 to 1.31.0-wmf.1

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381266 )

Change subject: Group2 to 1.31.0-wmf.1
..


Group2 to 1.31.0-wmf.1

Change-Id: Ie187bd8546b585ab5a47176b201c5c8bbea55d3e
---
M wikiversions.json
1 file changed, 304 insertions(+), 304 deletions(-)

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



diff --git a/wikiversions.json b/wikiversions.json
index 9163aec..5584cab 100644
--- a/wikiversions.json
+++ b/wikiversions.json
@@ -1,40 +1,40 @@
 {
-"aawiki": "php-1.30.0-wmf.19",
+"aawiki": "php-1.31.0-wmf.1",
 "aawikibooks": "php-1.31.0-wmf.1",
 "aawiktionary": "php-1.31.0-wmf.1",
-"abwiki": "php-1.30.0-wmf.19",
+"abwiki": "php-1.31.0-wmf.1",
 "abwiktionary": "php-1.31.0-wmf.1",
-"acewiki": "php-1.30.0-wmf.19",
+"acewiki": "php-1.31.0-wmf.1",
 "advisorywiki": "php-1.31.0-wmf.1",
-"adywiki": "php-1.30.0-wmf.19",
-"afwiki": "php-1.30.0-wmf.19",
+"adywiki": "php-1.31.0-wmf.1",
+"afwiki": "php-1.31.0-wmf.1",
 "afwikibooks": "php-1.31.0-wmf.1",
 "afwikiquote": "php-1.31.0-wmf.1",
 "afwiktionary": "php-1.31.0-wmf.1",
-"akwiki": "php-1.30.0-wmf.19",
+"akwiki": "php-1.31.0-wmf.1",
 "akwikibooks": "php-1.31.0-wmf.1",
 "akwiktionary": "php-1.31.0-wmf.1",
-"alswiki": "php-1.30.0-wmf.19",
+"alswiki": "php-1.31.0-wmf.1",
 "alswikibooks": "php-1.31.0-wmf.1",
 "alswikiquote": "php-1.31.0-wmf.1",
 "alswiktionary": "php-1.31.0-wmf.1",
-"amwiki": "php-1.30.0-wmf.19",
+"amwiki": "php-1.31.0-wmf.1",
 "amwikiquote": "php-1.31.0-wmf.1",
 "amwiktionary": "php-1.31.0-wmf.1",
-"angwiki": "php-1.30.0-wmf.19",
+"angwiki": "php-1.31.0-wmf.1",
 "angwikibooks": "php-1.31.0-wmf.1",
 "angwikiquote": "php-1.31.0-wmf.1",
 "angwikisource": "php-1.31.0-wmf.1",
 "angwiktionary": "php-1.31.0-wmf.1",
-"anwiki": "php-1.30.0-wmf.19",
+"anwiki": "php-1.31.0-wmf.1",
 "anwiktionary": "php-1.31.0-wmf.1",
-"arbcom_cswiki": "php-1.30.0-wmf.19",
-"arbcom_dewiki": "php-1.30.0-wmf.19",
-"arbcom_enwiki": "php-1.30.0-wmf.19",
-"arbcom_fiwiki": "php-1.30.0-wmf.19",
-"arbcom_nlwiki": "php-1.30.0-wmf.19",
-"arcwiki": "php-1.30.0-wmf.19",
-"arwiki": "php-1.30.0-wmf.19",
+"arbcom_cswiki": "php-1.31.0-wmf.1",
+"arbcom_dewiki": "php-1.31.0-wmf.1",
+"arbcom_enwiki": "php-1.31.0-wmf.1",
+"arbcom_fiwiki": "php-1.31.0-wmf.1",
+"arbcom_nlwiki": "php-1.31.0-wmf.1",
+"arcwiki": "php-1.31.0-wmf.1",
+"arwiki": "php-1.31.0-wmf.1",
 "arwikibooks": "php-1.31.0-wmf.1",
 "arwikimedia": "php-1.31.0-wmf.1",
 "arwikinews": "php-1.31.0-wmf.1",
@@ -42,81 +42,81 @@
 "arwikisource": "php-1.31.0-wmf.1",
 "arwikiversity": "php-1.31.0-wmf.1",
 "arwiktionary": "php-1.31.0-wmf.1",
-"arzwiki": "php-1.30.0-wmf.19",
-"astwiki": "php-1.30.0-wmf.19",
+"arzwiki": "php-1.31.0-wmf.1",
+"astwiki": "php-1.31.0-wmf.1",
 "astwikibooks": "php-1.31.0-wmf.1",
 "astwikiquote": "php-1.31.0-wmf.1",
 "astwiktionary": "php-1.31.0-wmf.1",
-"aswiki": "php-1.30.0-wmf.19",
+"aswiki": "php-1.31.0-wmf.1",
 "aswikibooks": "php-1.31.0-wmf.1",
 "aswikisource": "php-1.31.0-wmf.1",
 "aswiktionary": "php-1.31.0-wmf.1",
-"atjwiki": "php-1.30.0-wmf.19",
+"atjwiki": "php-1.31.0-wmf.1",
 "auditcomwiki": "php-1.31.0-wmf.1",
-"avwiki": "php-1.30.0-wmf.19",
+"avwiki": "php-1.31.0-wmf.1",
 "avwiktionary": "php-1.31.0-wmf.1",
-"aywiki": "php-1.30.0-wmf.19",
+"aywiki": "php-1.31.0-wmf.1",
 "aywikibooks": "php-1.31.0-wmf.1",
 "aywiktionary": "php-1.31.0-wmf.1",
-"azbwiki": "php-1.30.0-wmf.19",
-"azwiki": "php-1.30.0-wmf.19",
+"azbwiki": "php-1.31.0-wmf.1",
+"azwiki": "php-1.31.0-wmf.1",
 "azwikibooks": "php-1.31.0-wmf.1",
 "azwikiquote": "php-1.31.0-wmf.1",
 "azwikisource": "php-1.31.0-wmf.1",
 "azwiktionary": "php-1.31.0-wmf.1",
-"barwiki": "php-1.30.0-wmf.19",
-"bat_smgwiki": "php-1.30.0-wmf.19",
-"bawiki": "php-1.30.0-wmf.19",
+"barwiki": "php-1.31.0-wmf.1",
+"bat_smgwiki": "php-1.31.0-wmf.1",
+"bawiki": "php-1.31.0-wmf.1",
 "bawikibooks": "php-1.31.0-wmf.1",
-"bclwiki": "php-1.30.0-wmf.19",
+"bclwiki": "php-1.31.0-wmf.1",
 "bdwikimedia": "php-1.31.0-wmf.1",
-"be_x_oldwiki": "php-1.30.0-wmf.19",
+"be_x_oldwiki": "php-1.31.0-wmf.1",
 "betawikiversity": "php-1.31.0-wmf.1",
-"bewiki": "php-1.30.0-wmf.19",
+"bewiki": "php-1.31.0-wmf.1",
 "bewikibooks": "php-1.31.0-wmf.1",
 "bewikimedia": "php-1.31.0-wmf.1",
 "bewikiquote": "php-1.31.0-wmf.1",
 "bewikisource": "php-1.31.0-wmf.1",
 "bewiktionary": "php-1.31.0-wmf.1",
-"bgwiki": "php-1.30.0-wmf.19",
+"bgwiki": "php-1.31.0-wmf.1",
 "bgwikibooks": "php-1.31.0-wmf.1",
 "bgwikinews": "php-1.31.0-wmf.1",
 

[MediaWiki-commits] [Gerrit] integration/quibble[master]: Reorder commands in Dockerfile

2017-09-28 Thread Hashar (Code Review)
Hashar has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/355241 )

Change subject: Reorder commands in Dockerfile
..


Reorder commands in Dockerfile

mediawiki repos are no more added to the container, instead one should
clone them on the host then bind mount read-only. Updated README.md for
instructions.

Install the CI utilities composer and slave-scripts as shallow
repositories. We don't need the history. Ideally we could even just use
a snapshot with `git archive`, but gerrit over https does not support
it. Just strip their .git directories for now.

Change-Id: I928b4c02e4484b31cf8f83e24065dac018ad7e7d
---
M .dockerignore
M .gitignore
M Dockerfile
M README.md
4 files changed, 35 insertions(+), 16 deletions(-)

Approvals:
  jenkins-bot: Verified

Objections:
  Hashar: Do not submit



diff --git a/.dockerignore b/.dockerignore
index 43ff9b5..abf352d 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,7 +1,8 @@
 # vim
 **/*.swp
-# Local cache when mounting with -v`pwd`/cache:cache
+# Local caches bind mounted in the container
 cache
+ref
 # Dev related
 .git
 .tox
diff --git a/.gitignore b/.gitignore
index bfbeb7a..10354db 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,8 @@
 /.coverage
 /quibble.egg-info/
+/cache/
 /cover/
+/ref/
 /.tox
 *.pyc
 /tests/.tmp
diff --git a/Dockerfile b/Dockerfile
index 9a7151c..d37d761 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,23 +1,25 @@
 FROM debian:jessie
 
-RUN apt-get update && apt-get install -y \
+# Git repositories mirroring to speed up git clone in CI
+RUN apt-get update && apt-get install -y git
+
+# CI utilities
+RUN git clone --depth=1 
"https://gerrit.wikimedia.org/r/p/integration/composer; 
"/srv/deployment/integration/composer" && \
+rm -fR /srv/deployment/integration/composer/.git && \
+git clone --depth=1 "https://gerrit.wikimedia.org/r/p/integration/jenkins; 
"/srv/deployment/integration/slave-scripts" && \
+rm -fR /srv/deployment/integration/slave-scripts/.git && \
+   ln -s "/srv/deployment/integration/composer/vendor/bin/composer" 
"/usr/local/bin/composer"
+
+# Mediawiki related dependencies
+RUN DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server php5 
php5-mysql php5-gd php5-curl djvulibre-bin nodejs-legacy
+
+# Quibble dependencies
+RUN apt-get install -y \
+python3-pip \
+python3-paramiko \
 python3 \
 python3-dev \
 python-tox
-
-RUN apt-get install -y python3-pip git python3-paramiko
-RUN mkdir -p /srv/git/mediawiki && \
-mkdir -p /srv/deployment/integration && \
-git clone --bare "https://gerrit.wikimedia.org/r/p/mediawiki/core; 
"/srv/git/mediawiki/core.git" && \
-git clone --bare "https://gerrit.wikimedia.org/r/p/mediawiki/vendor; 
"/srv/git/mediawiki/vendor.git" && \
-git clone "https://gerrit.wikimedia.org/r/p/integration/jenkins; 
"/srv/deployment/integration/slave-scripts"
-
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server php5 
php5-mysql php5-gd php5-curl djvulibre-bin nodejs-legacy && \
-/usr/sbin/service mysql start
-
-RUN git clone "https://gerrit.wikimedia.org/r/p/integration/composer; 
"/srv/deployment/integration/composer" && \
-   ln -s "/srv/deployment/integration/composer/vendor/bin/composer" 
"/usr/local/bin/composer"
-
 # Some of Zuul dependencies. Would be better done by install the zuul.deb 
package from apt.wikimedia.org
 RUN apt-get install -y \
 python3-pbr \
diff --git a/README.md b/README.md
index ba7b9e2..a2a958a 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,20 @@
service mysql start
ZUUL_URL=https://gerrit.wikimedia.org/r/p ZUUL_BRANCH=master 
ZUUL_REF=master quibble --packages-source vendor --workspace /workspace
 
+CACHING
+---
+
+To avoid cloning MediaWiki over the network, you should initialize local bare
+repositories to be used as cache to copy from:
+
+  mkdir -p ref/mediawiki
+  git clone --bare mediawiki/core ref/mediawiki/core.git
+  git clone --bare mediawiki/vendor ref/mediawiki/vendor.git
+
+Then bindmount it READ-ONLY as /srv/git:
+
+  docker run -it --rm -v `pwd`/ref:/srv/git:ro quibble bash
+
 TESTING
 ---
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I928b4c02e4484b31cf8f83e24065dac018ad7e7d
Gerrit-PatchSet: 2
Gerrit-Project: integration/quibble
Gerrit-Branch: master
Gerrit-Owner: Hashar 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: Thcipriani 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Don't clobber contribution_tracking in makemissing mode

2017-09-28 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381360 )

Change subject: Don't clobber contribution_tracking in makemissing mode
..

Don't clobber contribution_tracking in makemissing mode

When the audit processor is supposed to send incomplete data to
Civi, don't stuff the message with fake utm_ stuff if the message
has a contribution_tracking_id.

Bug: T176923
Change-Id: I62d63bc53c2ed6c00bcf999bf5eb7e9a7730ada0
---
M sites/all/modules/wmf_audit/BaseAuditProcessor.php
M sites/all/modules/wmf_audit/wmf_audit.module
2 files changed, 8 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/60/381360/1

diff --git a/sites/all/modules/wmf_audit/BaseAuditProcessor.php 
b/sites/all/modules/wmf_audit/BaseAuditProcessor.php
index ac49482..6aa846b 100644
--- a/sites/all/modules/wmf_audit/BaseAuditProcessor.php
+++ b/sites/all/modules/wmf_audit/BaseAuditProcessor.php
@@ -273,7 +273,7 @@
 * actually make qc choke. Not so necessary with WP, but this will need 
to
 * happen elsewhere, probably. Just thinking ahead.
 * @param array $record transaction data
-* @return type The normalized data we want to send.
+* @return array The normalized data we want to send.
 */
protected function normalize_partial( $record ) {
//@TODO: Still need gateway account to go in here when that 
happens.
@@ -743,8 +743,12 @@
foreach ( $tryme as $date => $missing ) {
if ( (int) $date <= (int) $cutoff ) {
foreach ( $missing as $id => 
$message ) {
-   
$contribution_tracking_data = wmf_audit_make_contribution_tracking_data( 
$message );
-   $all_data = 
array_merge( $message, $contribution_tracking_data );
+   if ( empty( 
$message['contribution_tracking_id'] ) ) {
+   
$contribution_tracking_data = wmf_audit_make_contribution_tracking_data( 
$message );
+   $all_data = 
array_merge( $message, $contribution_tracking_data );
+   } else {
+   $all_data = 
$message;
+   }
$sendme = 
$this->normalize_partial( $all_data );

wmf_audit_send_transaction( $sendme, 'main' );
$made += 1;
diff --git a/sites/all/modules/wmf_audit/wmf_audit.module 
b/sites/all/modules/wmf_audit/wmf_audit.module
index da762c3..59a1a61 100644
--- a/sites/all/modules/wmf_audit/wmf_audit.module
+++ b/sites/all/modules/wmf_audit/wmf_audit.module
@@ -109,7 +109,7 @@
  * Not even a big deal if we overshoot and remove too many, because we'll just
  * remake them next time if they're missing.
  * @param string $date The date string for the oldest log we want to keep
- * @param string $working_logs path to working logs directory
+ * @param array $working_logs list of working log files by date
  */
 function wmf_audit_remove_old_logs($date, $working_logs) {
   if (!empty($working_logs)) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I62d63bc53c2ed6c00bcf999bf5eb7e9a7730ada0
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: More top-pages script improvements

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/378371 )

Change subject: More top-pages script improvements
..


More top-pages script improvements

Get rid of curl call. Use preq instead.
Add redirect handling.
Add timeout output + delay to avoid timeouts.

Change-Id: Ia4d06cc9ec2074185b45a77163ffe1a78b4f1c17
---
M scripts/top-pages-list.js
1 file changed, 34 insertions(+), 16 deletions(-)

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



diff --git a/scripts/top-pages-list.js b/scripts/top-pages-list.js
index ebe1eaf..ec36664 100755
--- a/scripts/top-pages-list.js
+++ b/scripts/top-pages-list.js
@@ -3,7 +3,6 @@
 'use strict';
 
 const BBPromise = require('bluebird');
-const exec = BBPromise.promisify(require('child_process').exec);
 const fs = require("fs");
 const preq = require('preq');
 
@@ -21,6 +20,10 @@
 return encodeURIComponent(pageTitle);
 };
 
+const uriForParsoid = (pageTitle) => {
+return `${parsoidBaseUri}/${fixTitleForRequest(pageTitle)}`;
+};
+
 const writePages = (myPages) => {
 const logger = fs.createWriteStream(topPagesFile, { flags: 'w' });
 logger.write(`{ "items": [\n`);
@@ -35,23 +38,38 @@
 logger.end();
 };
 
+const processOnePage = (page) => {
+process.stdout.write('.');
+return preq.get({ uri: uriForParsoid(page.title) })
+.then((rsp) => {
+return BBPromise.delay(300, rsp); // avoid timeouts
+}).then((rsp) => {
+if (rsp.status !== 200) {
+if (rsp.status === 302) {
+page.title = rsp.headers.location;
+return processOnePage(page);
+}
+process.stderr.write(` WARNING: skipping parsoid for 
${page.title}!`);
+return BBPromise.resolve();
+}
+const etag = rsp.headers.etag;
+const revMatch = /"(\S+?)"/m.exec(etag);
+page.rev = revMatch[1];
+return page;
+}).catch((err) => {
+if (err.status === 504) {
+process.stderr.write(` Timeout for ${page.title}: 
${uriForParsoid(page.title)}! `);
+// time out encountered: wait a few seconds and try again
+return BBPromise.delay(2000).then(() => processOnePage(page));
+} else {
+process.stderr.write(` ERROR getting metadata ${page.title}: 
${err.status}! `);
+}
+});
+};
+
 const getETags = (myPages) => {
 return BBPromise.map(myPages, (page) => {
-const cmd = `curl --head 
"${parsoidBaseUri}/${fixTitleForRequest(page.title)}"`;
-return exec(cmd)
-.then((rsp) => {
-if (!/^HTTP\/1.1 200 OK$/m.test(rsp)) {
-process.stderr.write(`WARNING: skipping parsoid for 
${page.title}`);
-return BBPromise.resolve();
-}
-const etagMatch = /^ETag:\s+W\/"(\S+?)"$/m.exec(rsp);
-process.stdout.write('.');
-page.rev = etagMatch[1];
-return page;
-})
-.catch((err) => {
-process.stderr.write(`ERROR getting parsoid ${page.title}: 
${err}`);
-});
+return processOnePage(page);
 }, { concurrency: 1 })
 .then((myPages) => {
 writePages(myPages);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia4d06cc9ec2074185b45a77163ffe1a78b4f1c17
Gerrit-PatchSet: 10
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: BearND 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Fjalapeno 
Gerrit-Reviewer: GWicke 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Mhurd 
Gerrit-Reviewer: Mobrovac 
Gerrit-Reviewer: Ppchelko 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Add lastet_currency_symbol to export

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381351 )

Change subject: Add lastet_currency_symbol to export
..


Add lastet_currency_symbol to export

Bug: T156410
Change-Id: I697e07d2d36184c976f43037d664c03c2bc45262
---
M silverpop_export/tests/minimal_schema.sql
M silverpop_export/tests/test_update.py
M silverpop_export/update_table.sql
3 files changed, 63 insertions(+), 10 deletions(-)

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



diff --git a/silverpop_export/tests/minimal_schema.sql 
b/silverpop_export/tests/minimal_schema.sql
index c2e35a4..8d904bf 100644
--- a/silverpop_export/tests/minimal_schema.sql
+++ b/silverpop_export/tests/minimal_schema.sql
@@ -26,6 +26,20 @@
 is_deleted tinyint(4) default '0'
 );
 
+drop table if exists civicrm_currency;
+create table civicrm_currency (
+id int(10) unsigned auto_increment primary key,
+name varchar(64) COLLATE utf8_unicode_ci,
+symbol varchar(8) COLLATE utf8_unicode_ci,
+key UI_name (name)
+);
+insert into civicrm_currency (name, symbol)
+values
+('USD', '$'),
+('CAD', '$'),
+('GBP', '£'),
+('DZD', NULL);
+
 drop table if exists wmf_donor;
 create table wmf_donor (
 id int(10) unsigned,
diff --git a/silverpop_export/tests/test_update.py 
b/silverpop_export/tests/test_update.py
index 8d951a7..d9f9c19 100644
--- a/silverpop_export/tests/test_update.py
+++ b/silverpop_export/tests/test_update.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 import datetime
 from decimal import Decimal
 import mock
@@ -26,7 +27,7 @@
 db_name = "test"
 db_user = "test"
 
-db_params = {"user": db_user, "host": db_host}
+db_params = {"user": db_user, "host": db_host, "charset": "utf8"}
 if db_pass:
 db_params['passwd'] = db_pass
 
@@ -219,6 +220,36 @@
 assert actual == expected
 
 
+def test_currency_symbol():
+'''
+Test that we correctly pull in the currency symbol for the latest donation
+'''
+
+run_update_with_fixtures(fixture_queries=["""
+insert into civicrm_email (contact_id, email, is_primary, on_hold) values
+(1, 'person1@localhost', 1, 0);
+""", """
+insert into civicrm_contact (id) values
+(1);
+""", """
+insert into civicrm_contribution (id, contact_id, receive_date, 
total_amount, trxn_id, contribution_status_id) values
+(1, 1, '2015-01-03', 9.50, 'xyz123', 1),
+(2, 1, '2017-07-07', 10.95, 'nnn777', 1),
+(3, 1, '2016-05-05', 10.00, 'abc456', 1);
+""", """
+insert into wmf_contribution_extra (entity_id, original_amount, 
original_currency) values
+(1, 1000, 'JPY'),
+(2, 9.00, 'GBP'),
+(3, 10.00, 'USD');
+"""])
+
+cursor = conn.db_conn.cursor()
+cursor.execute("select latest_currency, latest_currency_symbol from 
silverpop_export")
+expected = ('GBP', u'£')
+actual = cursor.fetchone()
+assert actual == expected
+
+
 def run_update_with_fixtures(fixture_path=None, fixture_queries=None):
 with mock.patch("database.db.Connection") as MockConnection:
 
diff --git a/silverpop_export/update_table.sql 
b/silverpop_export/update_table.sql
index 9ae49bd..61e5ca5 100755
--- a/silverpop_export/update_table.sql
+++ b/silverpop_export/update_table.sql
@@ -35,6 +35,7 @@
 
   -- Latest contribution statistics
   latest_currency varchar(3) not null default '',
+  latest_currency_symbol varchar(8) not null default '',
   latest_native_amount decimal(20,2) not null default 0,
   latest_usd_amount decimal(20,2) not null default 0,
   latest_donation datetime null,
@@ -57,6 +58,7 @@
 CREATE TABLE IF NOT EXISTS silverpop_export_latest(
   email varchar(255) PRIMARY KEY,
   latest_currency varchar(3),
+  latest_currency_symbol varchar(8),
   latest_native_amount decimal(20,2),
   latest_usd_amount decimal(20,2),
   latest_donation datetime
@@ -91,16 +93,19 @@
   SELECT
 e.email,
 ex.original_currency,
+COALESCE(cur.symbol, ex.original_currency),
 ex.original_amount,
 ct.total_amount,
 ct.receive_date
   FROM
-silverpop_export_staging e,
-civicrm.civicrm_contribution ct,
-civicrm.wmf_contribution_extra ex
+silverpop_export_staging e
+INNER JOIN civicrm.civicrm_contribution ct
+  ON ct.contact_id = e.contact_id
+INNER JOIN civicrm.wmf_contribution_extra ex
+  ON ex.entity_id = ct.id
+LEFT JOIN civicrm.civicrm_currency cur
+  ON cur.name = ex.original_currency
   WHERE
-e.contact_id = ct.contact_id AND
-ex.entity_id = ct.id AND
 ct.receive_date IS NOT NULL AND
 ct.total_amount > 0 AND -- Refunds don't count
 ct.contribution_status_id = 1 -- 'Completed'
@@ -269,6 +274,7 @@
 ex.has_recurred_donation = exs.has_recurred_donation,
 ex.first_donation_date = exs.first_donation_date,
 ex.latest_currency = lt.latest_currency,
+ex.latest_currency_symbol = 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Move static hook handler to the class

2017-09-28 Thread Code Review
Matěj Suchánek has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381294 )

Change subject: Move static hook handler to the class
..

Move static hook handler to the class

It's better to have related code together.

Change-Id: I9712ce13bb3ee2806c622a80e71d494d41166cd1
---
M client/WikibaseClient.hooks.php
M client/WikibaseClient.php
M client/includes/Hooks/InfoActionHookHandler.php
3 files changed, 40 insertions(+), 42 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/94/381294/1

diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index 4853c6d..584b0b6 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -6,7 +6,6 @@
 use BaseTemplate;
 use EchoEvent;
 use EditPage;
-use IContextSource;
 use OutputPage;
 use Parser;
 use Skin;
@@ -21,14 +20,12 @@
 use Wikibase\Client\Hooks\DeletePageNoticeCreator;
 use Wikibase\Client\Hooks\EchoNotificationsHandlers;
 use Wikibase\Client\Hooks\EditActionHookHandler;
-use Wikibase\Client\Hooks\InfoActionHookHandler;
+use Wikibase\Client\Specials\SpecialEntityUsage;
 use Wikibase\Client\Specials\SpecialPagesWithBadges;
 use Wikibase\Client\Specials\SpecialUnconnectedPages;
-use Wikibase\Client\Specials\SpecialEntityUsage;
 use Wikibase\Client\WikibaseClient;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\Lib\AutoCommentFormatter;
-use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory;
 
 /**
  * File defining the hook handlers for the Wikibase Client extension.
@@ -280,42 +277,6 @@
 */
public static function onParserFirstCallInit( Parser &$parser ) {

WikibaseClient::getDefaultInstance()->getParserFunctionRegistrant()->register( 
$parser );
-
-   return true;
-   }
-
-   /**
-* Adds the Entity ID of the corresponding Wikidata item in action=info
-*
-* @param IContextSource $context
-* @param array $pageInfo
-*
-* @return bool
-*/
-   public static function onInfoAction( IContextSource $context, array 
&$pageInfo ) {
-   $wikibaseClient = WikibaseClient::getDefaultInstance();
-   $settings = $wikibaseClient->getSettings();
-
-   $namespaceChecker = $wikibaseClient->getNamespaceChecker();
-   $usageLookup = $wikibaseClient->getStore()->getUsageLookup();
-   $labelDescriptionLookupFactory = new 
LanguageFallbackLabelDescriptionLookupFactory(
-   $wikibaseClient->getLanguageFallbackChainFactory(),
-   $wikibaseClient->getTermLookup(),
-   $wikibaseClient->getTermBuffer()
-   );
-   $idParser = $wikibaseClient->getEntityIdParser();
-
-   $infoActionHookHandler = new InfoActionHookHandler(
-   $namespaceChecker,
-   $wikibaseClient->newRepoLinker(),
-   $wikibaseClient->getStore()->getSiteLinkLookup(),
-   $settings->getSetting( 'siteGlobalID' ),
-   $usageLookup,
-   $labelDescriptionLookupFactory,
-   $idParser
-   );
-
-   $pageInfo = $infoActionHookHandler->handle( $context, $pageInfo 
);
 
return true;
}
diff --git a/client/WikibaseClient.php b/client/WikibaseClient.php
index f71a631..baf0bec 100644
--- a/client/WikibaseClient.php
+++ b/client/WikibaseClient.php
@@ -139,7 +139,7 @@
$wgHooks['BeforePageDisplay'][] = 
'\Wikibase\ClientHooks::onBeforePageDisplay';
$wgHooks['BeforePageDisplay'][] = 
'\Wikibase\ClientHooks::onBeforePageDisplayAddJsConfig';
$wgHooks['ScribuntoExternalLibraries'][] = 
'\Wikibase\ClientHooks::onScribuntoExternalLibraries';
-   $wgHooks['InfoAction'][] = '\Wikibase\ClientHooks::onInfoAction';
+   $wgHooks['InfoAction'][] = 
'\Wikibase\Client\Hooks\InfoActionHookHandler::onInfoAction';
$wgHooks['EditPage::showStandardInputs:options'][] = 
'\Wikibase\ClientHooks::onEditAction';
$wgHooks['BaseTemplateAfterPortlet'][] = 
'\Wikibase\ClientHooks::onBaseTemplateAfterPortlet';
$wgHooks['GetBetaFeaturePreferences'][] = 
'\Wikibase\ClientHooks::onGetBetaFeaturePreferences';
diff --git a/client/includes/Hooks/InfoActionHookHandler.php 
b/client/includes/Hooks/InfoActionHookHandler.php
index a87e6d5..2478b89 100644
--- a/client/includes/Hooks/InfoActionHookHandler.php
+++ b/client/includes/Hooks/InfoActionHookHandler.php
@@ -9,9 +9,10 @@
 use Wikibase\Client\Usage\UsageLookup;
 use Wikibase\DataModel\Entity\EntityIdParser;
 use Wikibase\DataModel\Entity\ItemId;
-use Wikibase\Lib\Store\SiteLinkLookup;
 use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory;
+use Wikibase\Lib\Store\SiteLinkLookup;
 use 

[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Add compare script for old and new extracts

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/378368 )

Change subject: Add compare script for old and new extracts
..


Add compare script for old and new extracts

Compare the top 1000 pages viewed on enwiki, and compares
HTML version of the extract of old and new summary implementations.

Arguments: provide a single argument which is the language code for
the Wikipedia project.

MAke sure your local MCS instance is running, then execute the
comparison script with a command like this:
cd scripts
node ./compare-extracts.js en

The output will be three files in the ../private/extracts folder:
* en.html
* en.v1.txt
* en.v2.txt

The HTML file is good for an overview of the visible quality. The two
txt files are better when using a good diff tool, and allow more control
and show details better. Compare the txt files if you are concerned
about how the HTML tags compare.

Bug: T175286
Change-Id: Ia217c9613c8458352882862b43a6005cb6092158
---
A private/extracts/static/compare-table.css
A scripts/compare-extracts.js
2 files changed, 220 insertions(+), 0 deletions(-)

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



diff --git a/private/extracts/static/compare-table.css 
b/private/extracts/static/compare-table.css
new file mode 100644
index 000..8eb0575
--- /dev/null
+++ b/private/extracts/static/compare-table.css
@@ -0,0 +1,47 @@
+body {
+background-color: #CCC;
+}
+
+tr:nth-child(even) {
+background: #FFF
+}
+tr:nth-child(odd) {
+background: #EEE
+}
+
+th {
+padding: 1rem;
+}
+
+th.titleColumn {
+width: 10%;
+}
+
+th.valueColumn {
+width: 45%;
+}
+
+td {
+padding: .5rem;
+vertical-align: baseline;
+}
+
+.same-old,.same-new {
+color: white;
+background: -webkit-repeating-linear-gradient(-45deg, #606dbc, #606dbc 
10px, #465298 10px, #465298 20px);
+background: repeating-linear-gradient(-45deg, #606dbc, #606dbc 10px, 
#465298 10px, #465298 20px);
+}
+
+a[id][href]::before {
+content: "(";
+}
+
+a[id][href]::after {
+content: ")";
+}
+
+/*
+figure, img, blockquote, dl, td table {
+display: none;
+}
+*/
\ No newline at end of file
diff --git a/scripts/compare-extracts.js b/scripts/compare-extracts.js
new file mode 100755
index 000..1ca2fa5
--- /dev/null
+++ b/scripts/compare-extracts.js
@@ -0,0 +1,173 @@
+#!/usr/bin/env node
+
+'use strict';
+
+/*
+  Notes:
+  * Start a local MCS instance for the "new" version before running this 
script.
+  * Run the script from the script folder.
+
+  Arguments: provide a single argument which is the language code for
+  the Wikipedia project.
+
+  Example:
+  $ npm start
+  In another terminal run:
+  $ cd scripts
+  $ ./compare-extracts.js en
+
+  The output will be in the private/extracts folder.
+*/
+
+const BBPromise = require('bluebird');
+const fs = require('fs');
+const preq = require('preq');
+
+const DELAY = 100; // delay between requests in ms
+const topPagesDir = '../private/top-pages';
+const outDir = '../private/extracts';
+
+let lang;
+let topPages;
+
+let oldFileName;
+let newFileName;
+let htmlFileName;
+
+let oldFile;
+let newFile;
+let htmlFile;
+
+const uriForWikiLink = (title, lang) => {
+return `https://${lang}.m.wikipedia.org/wiki/${title}`;
+};
+
+const uriForProdSummary = (title, lang) => {
+return 
`https://${lang}.wikipedia.org/api/rest_v1/page/summary/${encodeURIComponent(title)}`;
+};
+
+const uriForLocalSummary = (title, lang) => {
+return 
`http://localhost:6927/${lang}.wikipedia.org/v1/page/summary/${encodeURIComponent(title)}`;
+};
+
+const outputStart = () => {
+htmlFile.write(`\n`);
+htmlFile.write(`\n`);
+htmlFile.write(`\n`);
+htmlFile.write(`\n`);
+htmlFile.write(`\n`);
+htmlFile.write(`\n`);
+htmlFile.write(`Extract comparison for top pages in 
${lang}.wikipedia.org\n`);
+htmlFile.write(`\n`);
+htmlFile.write(`\n`);
+htmlFile.write(`Title\n`);
+htmlFile.write(`Old\n`);
+htmlFile.write(`New\n`);
+htmlFile.write(`\n`);
+};
+
+const outputEnd = () => {
+htmlFile.write(`\n`);
+htmlFile.write(`\n`);
+htmlFile.write(`\n`);
+
+oldFile.end();
+newFile.end();
+htmlFile.end();
+};
+
+const compareExtractsHTML = (oldExtract, newExtract, counter, title, lang) => {
+const displayTitle = title.replace(/_/g, ' ');
+const wikiLink = uriForWikiLink(title, lang);
+const positionLink = `${counter}`;
+htmlFile.write(`${positionLink} ${displayTitle}\n`);
+if (oldExtract !== newExtract) {
+htmlFile.write(`${oldExtract}\n`);
+htmlFile.write(`${newExtract}\n`);
+} else {
+htmlFile.write(`${oldExtract}\n`);
+htmlFile.write(`${newExtract}\n`);
+}
+htmlFile.write(`\n`);
+};
+
+/**
+ * Make the src and srcset values https URLs instead of protocol-relative URLs.
+ * Only needed if the HTML files are viewed locally (=base 

[MediaWiki-commits] [Gerrit] wikimedia...tools[deploy]: Merge branch 'master' into deploy

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381293 )

Change subject: Merge branch 'master' into deploy
..


Merge branch 'master' into deploy

5708cf1 Add 'first_donation_date' column to Silverpop export
ce509d7 Alter definition of silverpop_countrylangs to match actual

Change-Id: Id6194f31078c6fb3616bc26c457853426286f653
---
D silverpop_export/tests/test_update.py
1 file changed, 0 insertions(+), 263 deletions(-)

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



diff --git a/silverpop_export/tests/test_update.py 
b/silverpop_export/tests/test_update.py
deleted file mode 100644
index 8b4fbe1..000
--- a/silverpop_export/tests/test_update.py
+++ /dev/null
@@ -1,263 +0,0 @@
-<<< HEAD   (8d3980 Merge branch 'master' into deploy)
-===
-import datetime
-from decimal import Decimal
-import mock
-import MySQLdb
-import os
-import warnings
-
-import database.db
-import silverpop_export.update
-
-conn = None
-db_name = None
-
-
-def setup():
-global conn
-global db_name
-# FIXME: parameterize test configuration better
-db_host = "127.0.0.1"
-db_pass = None
-if 'EXECUTOR_NUMBER' in os.environ:
-# We're running under Jenkins.  Assume things.
-db_name = "test"
-db_user = "root"
-else:
-db_name = "test"
-db_user = "test"
-
-db_params = {"user": db_user, "host": db_host}
-if db_pass:
-db_params['passwd'] = db_pass
-
-conn = database.db.Connection(**db_params)
-conn.execute("set default_storage_engine=memory")
-conn.execute("drop database if exists " + db_name)
-conn.execute("create database " + db_name)
-conn.db_conn.select_db(db_name)
-
-
-def test_test_setup():
-'''
-Set up the civcrm and export databases and run the update with no data.
-'''
-run_update_with_fixtures(fixture_queries=[])
-
-
-def test_duplicate():
-'''
-Test that we export one record for a duplicate contact.
-'''
-
-run_update_with_fixtures(fixture_queries=["""
-insert into civicrm_email (contact_id, email, is_primary, on_hold) values
-(1, 'person1@localhost', 1, 0),
-(2, 'person1@localhost', 1, 0);
-""", """
-insert into civicrm_contact (id) values
-(1),
-(2);
-"""])
-
-cursor = conn.db_conn.cursor()
-cursor.execute("select count(*) from silverpop_export")
-assert cursor.fetchone() == (1,)
-
-
-def test_no_donations():
-'''
-Test that we set the donation-related fields correctly when a contact has
-no donations.
-'''
-
-run_update_with_fixtures(fixture_queries=["""
-insert into civicrm_email (contact_id, email, is_primary, on_hold) values
-(1, 'person1@localhost', 1, 0);
-""", """
-insert into civicrm_contact (id) values
-(1);
-"""])
-
-cursor = conn.db_conn.cursor()
-cursor.execute("select has_recurred_donation, highest_usd_amount, " +
-   "highest_native_amount, highest_native_currency, " +
-   "highest_donation_date, lifetime_usd_total, " +
-   "donation_count, latest_currency, latest_native_amount, " +
-   "latest_usd_amount, latest_donation_date from 
silverpop_export_view")
-actual = cursor.fetchone()
-expected = ('NO', Decimal('0.00'),
-Decimal('0.00'), '',
-'', Decimal('0.00'),
-0, '', Decimal('0.00'),
-Decimal('0.00'), '')
-assert actual == expected
-
-
-def test_refund_history():
-'''
-Test that we don't include refunded donations in a donor's history
-'''
-
-run_update_with_fixtures(fixture_queries=["""
-insert into civicrm_email (contact_id, email, is_primary, on_hold) values
-(1, 'person1@localhost', 1, 0);
-""", """
-insert into civicrm_contact (id) values
-(1);
-""", """
-insert into civicrm_contribution (id, contact_id, receive_date, 
total_amount, trxn_id, contribution_status_id) values
-(1, 1, '2015-01-03', 15.25, 'xyz123', 1),
-(2, 1, '2016-05-05', 25.25, 'abc456', 9);
-""", """
-insert into wmf_contribution_extra (entity_id, original_amount, 
original_currency) values
-(1, 20.15, 'CAD'),
-(2, 35.15, 'CAD');
-"""])
-
-cursor = conn.db_conn.cursor()
-cursor.execute("select highest_usd_amount, lifetime_usd_total, 
donation_count, latest_currency, latest_native_amount, latest_usd_amount, 
latest_donation  from silverpop_export")
-expected = (Decimal('15.25'), Decimal('15.25'), 1, 'CAD', 
Decimal('20.15'), Decimal('15.25'), datetime.datetime(2015, 1, 3))
-assert cursor.fetchone() == expected
-
-
-def test_first_donation():
-"""
-Test that we correctly calculate the first donation date,
-not counting refunded donations.
-"""
-
-

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Delete redundant logging module

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381152 )

Change subject: Delete redundant logging module
..


Delete redundant logging module

DEPLOYMENT NOTE: drush dis wmf_logging

Looks like a copy of the built-in drupal syslog module. Did we copy
this over when we were running on a super early version?

Bug: T121799
Change-Id: I3421a9c57de719a051ef7f99f2acf921c18b8e29
---
D sites/all/modules/wmf_logging/wmf_logging.info
D sites/all/modules/wmf_logging/wmf_logging.module
M sites/default/enabled_modules
3 files changed, 0 insertions(+), 171 deletions(-)

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



diff --git a/sites/all/modules/wmf_logging/wmf_logging.info 
b/sites/all/modules/wmf_logging/wmf_logging.info
deleted file mode 100644
index d48a5ae..000
--- a/sites/all/modules/wmf_logging/wmf_logging.info
+++ /dev/null
@@ -1,5 +0,0 @@
-name = WMF Logging
-description = WMF specific log framework. Hooks into Watchdog.
-core = 7.x
-package = Wikimedia
-configure = admin/config/logging/wmf_logging
diff --git a/sites/all/modules/wmf_logging/wmf_logging.module 
b/sites/all/modules/wmf_logging/wmf_logging.module
deleted file mode 100644
index 0280a56..000
--- a/sites/all/modules/wmf_logging/wmf_logging.module
+++ /dev/null
@@ -1,165 +0,0 @@
- 'Logging',
-'page callback' => 'system_admin_menu_block_page',
-'file' => 'system.admin.inc',
-'file path' => drupal_get_path('module', 'system'),
-'access arguments' => array( 'administer site configuration' ),
-  );
-
-  $items[ 'admin/config/logging/wmf_logging' ] = array(
-'title'=> 'WMF Logging',
-'description'  => 'Settings for the WMF logging module.',
-'page callback'=> 'drupal_get_form',
-'page arguments'   => array( 'wmf_logging_settings' ),
-'access arguments' => array( 'administer site configuration' ),
-  );
-
-  return $items;
-}
-
-/**
- * Settings form linked to from @see wmf_logging_menu
- *
- * @return array Settings form
- */
-function wmf_logging_settings() {
-  $form = array();
-
-  $form[ 'wmf_logging_syslog_identity' ] = array(
-'#type'  => 'textfield',
-'#title' => t('Syslog identity'),
-'#default_value' => variable_get('wmf_logging_syslog_identity', 
DEFAULT_WMF_LOGGING_IDENTITY),
-'#description'   => t('String that will be prepended to the Syslog 
output'),
-  );
-
-  $form[ 'wmf_logging_syslog_facility' ] = array(
-'#type'  => 'select',
-'#title' => t('Send events to this syslog facility'),
-'#default_value' => variable_get('wmf_logging_syslog_facility', 
DEFAULT_WMF_LOGGING_FACILITY),
-'#options'   => wmf_logging_syslog_facility_list(),
-'#description'   => t('Select the syslog facility code under which 
Drupal\'s messages should be sent. On UNIX/Linux systems, Drupal can flag its 
messages with the code LOG_LOCAL0 through LOG_LOCAL7; for Microsoft Windows, 
all messages are flagged with the code LOG_USER.'),
-  );
-
-  $form[ 'wmf_logging_syslog_pid' ] = array(
-'#type'  => 'checkbox',
-'#title' => t('Add process ID to log message string'),
-'#default_value' => variable_get('wmf_logging_syslog_pid', 
DEFAULT_WMF_LOGGING_PID),
-'#description'   => t('The process identifier can be used to differentiate 
different requests.'),
-  );
-
-  $form[ 'wmf_logging_syslog_persistent' ] = array(
-'#type'  => 'checkbox',
-'#title' => t('Use persistent Syslog connection'),
-'#default_value' => variable_get('wmf_logging_syslog_persistent', 
DEFAULT_WMF_LOGGING_PERSISTENT),
-'#description'   => t('Some webserver configurations may require the 
Syslog connection to be closed after a log message is written to avoid logging 
webserver errors as Drupal errors. http://www.php.net/manual/en/function.syslog.php#97843;>Details.'),
-  );
-
-  return system_settings_form($form);
-}
-
-/**
- * Provides the list of available Syslog facilities
- *
- * @return array of facilities
- */
-function wmf_logging_syslog_facility_list() {
-  $facility_list = array(
-LOG_USER   => t('LOG_USER - User level messages. Use this for Windows.'),
-  );
-  if (defined('LOG_LOCAL0')) {
-$facility_list += array(
-  LOG_LOCAL0 => t('LOG_LOCAL0 - Local 0'),
-  LOG_LOCAL1 => t('LOG_LOCAL1 - Local 1'),
-  LOG_LOCAL2 => t('LOG_LOCAL2 - Local 2'),
-  LOG_LOCAL3 => t('LOG_LOCAL3 - Local 3'),
-  LOG_LOCAL4 => t('LOG_LOCAL4 - Local 4'),
-  LOG_LOCAL5 => t('LOG_LOCAL5 - Local 5'),
-  LOG_LOCAL6 => t('LOG_LOCAL6 - Local 6'),
-  LOG_LOCAL7 => t('LOG_LOCAL7 - Local 7'),
-);
-  }
-  return $facility_list;
-}
-
-/**
- * Hook into the drupal watchdog dispatcher. Implements the custom log handler.
- *
- * @param $entry
- */
-function wmf_logging_watchdog($entry) {
-  global $base_url;
-
-  static $log_init = FALSE;
-
-  if 

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Track integration test tag setup with server process

2017-09-28 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381358 )

Change subject: Track integration test tag setup with server process
..

Track integration test tag setup with server process

The wdio test runner runs each feature file in its own
process. This means we have no direct way to share state
about what has been setup and what still needs to be
setup.

This is perhaps not the simplest solution, but it seemed
the most flexible. It spins up an extra process during
test setup that knows what tags have been previously
initialized, and talks over a unix socket connection
to the child processes to tell them about the state.
This approach was taken because onPrepare, the only hook
that is run globally, does not have information about
what tests will be run, what tags they contain, etc. Keeping
with cucumber's existing Before hooks means we don't have
to reimplement all of that.

The current implementation will not gracefully handle
multiple feature files executing in parallel, although
extending it to do that doesn't seem too complicated.

Change-Id: I5d3c0135b13cbb0f91ffaa0738b3dcaec16d238e
---
M tests/integration/config/wdio.conf.js
M tests/integration/features/support/hooks.js
M tests/integration/features/support/world.js
3 files changed, 81 insertions(+), 32 deletions(-)


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

diff --git a/tests/integration/config/wdio.conf.js 
b/tests/integration/config/wdio.conf.js
index 890a026..d1fc0ff 100644
--- a/tests/integration/config/wdio.conf.js
+++ b/tests/integration/config/wdio.conf.js
@@ -6,11 +6,14 @@
 /* eslint-disable no-console, comma-dangle */
 'use strict';
 
-const path = require( 'path' );
+const child_process = require( 'child_process' ),
+   path = require( 'path' );
 
 function relPath( foo ) {
return path.resolve( __dirname, '../..', foo );
 }
+
+var forkedTracker;
 
 exports.config = {
 
@@ -215,9 +218,23 @@
// methods to it. If one of them returns with a promise, WebdriverIO 
will wait until that promise got
// resolved to continue.
//
+   // unix socket path for tag tracker
+   trackerPath: '/tmp/cirrussearch-integration-tagtracker',
+   //
// Gets executed once before all workers get launched.
-   // onPrepare: function ( config, capabilities ) {
-   // }
+   onPrepare: function ( config ) {
+   forkedTracker = child_process.fork( relPath( 
'./integration/lib/tracker.js' ) );
+   forkedTracker.send( { config: config } );
+   return new Promise( ( resolve, reject ) => {
+   forkedTracker.on( 'message', ( msg ) => {
+   if ( msg.initialized ) {
+   resolve();
+   } else {
+   reject( msg.error );
+   }
+   } );
+   } );
+   },
//
// Gets executed before test execution begins. At this point you can 
access all global
// variables, such as `browser`. It is the perfect place to define 
custom commands.
@@ -276,6 +293,8 @@
//
// Gets executed after all workers got shut down and the process is 
about to exit. It is not
// possible to defer the end of the process using a promise.
-   // onComplete: function(exitCode) {
-   // }
+   onComplete: function(exitCode) {
+   // TODO: Is this method being called a guarantee, or should we 
handle signals to be sure?
+   forkedTracker.send( { exit: true } );
+   }
 };
diff --git a/tests/integration/features/support/hooks.js 
b/tests/integration/features/support/hooks.js
index 6f53a1b..bb96f46 100644
--- a/tests/integration/features/support/hooks.js
+++ b/tests/integration/features/support/hooks.js
@@ -1,32 +1,31 @@
-/*jshint esversion: 6, node:true */
+/*jshint: esversion: 6, node:true */
 
-/**
- * Hooks are run before or after Cucumber executes a test scenario.
- * The World object is bound to the hooks as `this`, so any method
- * or property in World is available here.
- */
 var {defineSupportCode} = require( 'cucumber' );
 
-// This file is loaded in the initial cucumbe setup,
-// so these variables are retained across tests.
-var clean = false,
-   suggest = false;
-
 defineSupportCode( function( { After, Before } ) {
+   let BeforeOnce = function ( options, fn ) {
+   Before( options, function () {
+   if ( options.tags ) {
+   return this.checkTag( options.tags ).then( ( 
initialized ) => {
+   if ( !initialized ) {
+   return fn.call( this );
+   }
+   

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Convert integration test api objects to single use

2017-09-28 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381359 )

Change subject: Convert integration test api objects to single use
..

Convert integration test api objects to single use

There are some annoying problems with re-using api clients
around api tokens, namely that the tokens can be accidentally
overwritten if multiple things are using it asyncronously.

Convert to a more direct model where new api clients are created
on demand. Also makes it a bit clearer how to do things on multiple
wikis with the api. Multiple wikis on the browser is not handled
here.

Change-Id: I06519bc43f8c17d81920f6210ea2deb1b310d5e4
---
M tests/integration/features/step_definitions/page_step_helpers.js
M tests/integration/features/support/hooks.js
M tests/integration/features/support/world.js
3 files changed, 56 insertions(+), 48 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/59/381359/1

diff --git a/tests/integration/features/step_definitions/page_step_helpers.js 
b/tests/integration/features/step_definitions/page_step_helpers.js
index 4af1791..2ca50c6 100644
--- a/tests/integration/features/step_definitions/page_step_helpers.js
+++ b/tests/integration/features/step_definitions/page_step_helpers.js
@@ -13,34 +13,45 @@
 const expect = require( 'chai' ).expect;
 
 class StepHelpers {
-   constructor( world ) {
+   constructor( world, wiki ) {
this.world = world;
+   this.apiPromise = world.onWiki( wiki || 
world.config.wikis.default );
+   }
+
+   onWiki( wiki ) {
+   return new StepHelpers( this.world, wiki );
}
 
deletePage( title ) {
-   return this.world.apiClient.loginAndEditToken().then( () => {
-   return this.world.apiClient.delete( title, 
"CirrusSearch integration test delete" )
-   .catch( ( err ) => {
-   // still return true if page doesn't 
exist
-   return expect( err.message 
).to.include( "doesn't exist" );
-   } );
+   return this.apiPromise.then( ( api ) => {
+   return api.loginGetEditToken().then( () => {
+   return api.delete( title, "CirrusSearch 
integration test delete" )
+   .catch( ( err ) => {
+   // still return true if page 
doesn't exist
+   return expect( err.message 
).to.include( "doesn't exist" );
+   } );
+   } );
} );
}
editPage( title, content ) {
-   return this.world.apiClient.loginAndEditToken().then( () => {
-   return this.world.apiClient.edit( title, content, 
"CirrusSearch integration test edit" );
+   return this.apiPromise.then( ( api ) => {
+   return api.loginGetEditToken().then( () => {
+   return api.edit( title, content, "CirrusSearch 
integration test edit" );
+   } );
} );
}
 
suggestionSearch( query, limit = 'max' ) {
-   return this.world.apiClient.request( {
-   action: 'opensearch',
-   search: query,
-   cirrusUseCompletionSuggester: 'yes',
-   limit: limit
+   return this.apiPromise.then( ( api ) => {
+   return api.request( {
+   action: 'opensearch',
+   search: query,
+   cirrusUseCompletionSuggester: 'yes',
+   limit: limit
+   } );
} ).then( ( response ) => this.world.setApiResponse( response ) 
);
}
 
 }
 
-module.exports = StepHelpers;
\ No newline at end of file
+module.exports = StepHelpers;
diff --git a/tests/integration/features/support/hooks.js 
b/tests/integration/features/support/hooks.js
index bb96f46..26e3dcb 100644
--- a/tests/integration/features/support/hooks.js
+++ b/tests/integration/features/support/hooks.js
@@ -53,9 +53,10 @@
"はーい": "makes sure we do not fail to index 
empty tokens (T156234)"
}
};
-   return this.apiClient.loginAndEditToken().then( () => {
-   return this.apiClient.batch(batchJobs, 'CirrusSearch 
integration test edit');
+   return this.onWiki().then( ( api ) => {
+   return api.loginGetEditToken().then( () => {
+   return api.batch(batchJobs, 'CirrusSearch 
integration test edit');
+

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Provide message/warning/error box abstraction

2017-09-28 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381291 )

Change subject: Provide message/warning/error box abstraction
..

Provide message/warning/error box abstraction

This will help us consolidate the various uses into one single
method which will help us drive standardisation of these defacto
widgets.

Hopefully, by being a method of the Html class, which has a very
low barrier for use will drive down the inconsistent display of
warning/error boxes across MediaWiki's products

Various usages of warningbox and errorbox have been ported over.
I've retained some more complicated usages which make use of the
parser (wrapWikiMsg) and any where id and class are medled with
- we'll probably want to consider whether we want to encourage
those going forward as they encourage adjusting the styling.

Bug: T166915
Change-Id: I2757e1f4ff2599e93a7257fc644cab69063896d2
---
M includes/Html.php
M includes/exception/MWException.php
M includes/page/Article.php
M includes/skins/SkinFallbackTemplate.php
M includes/specials/SpecialEditTags.php
M includes/specials/SpecialMovepage.php
M includes/specials/SpecialRecentchangeslinked.php
M includes/specials/SpecialRevisiondelete.php
M includes/specials/SpecialSearch.php
A includes/templates/MessageBox.mustache
10 files changed, 82 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/91/381291/1

diff --git a/includes/Html.php b/includes/Html.php
index 8fe4dbe..cc03f26 100644
--- a/includes/Html.php
+++ b/includes/Html.php
@@ -697,6 +697,57 @@
}
 
/**
+* Return a message box.
+* @param string $html of contents of box
+* @param string $className corresponding to box
+* @param string $heading (optional)
+* @return string of html representing a box.
+*/
+   public static function messageBox( $html, $className, $heading = '' ) {
+   $templateParser = new TemplateParser( __DIR__ . '/templates/' );
+
+   $templateOptions = [
+   'className' => $className,
+   'msg' => $html
+   ];
+   if ( $heading ) {
+   $templateOptions += [
+   'heading' => $heading,
+   'hasHeading' => true,
+   ];
+   }
+   return $templateParser->processTemplate( 'MessageBox', 
$templateOptions );
+   }
+
+   /**
+* Return a warning box.
+* @param string $html of contents of box
+* @return string of html representing a warning box.
+*/
+   public static function warningBox( $html ) {
+   return self::messageBox( $html, 'warningbox' );
+   }
+
+   /**
+* Return an error box.
+* @param string $html of contents of error box
+* @param string $heading (optional)
+* @return string of html representing an error box.
+*/
+   public static function errorBox( $html, $heading = '' ) {
+   return self::messageBox( $html, 'errorbox', $heading );
+   }
+
+   /**
+* Return a success box.
+* @param string $html of contents of box
+* @return string of html representing a success box.
+*/
+   public static function successBox( $html ) {
+   return self::messageBox( $html, 'successbox' );
+   }
+
+   /**
 * Convenience function to produce a radio button (input element with 
type=radio)
 *
 * @param string $name Name attribute
diff --git a/includes/exception/MWException.php 
b/includes/exception/MWException.php
index 8c1f8dc..a53d11f 100644
--- a/includes/exception/MWException.php
+++ b/includes/exception/MWException.php
@@ -102,7 +102,7 @@
} else {
$logId = WebRequest::getRequestId();
$type = static::class;
-   return "" .
+   return Html::errorBox(
'[' . $logId . '] ' .
gmdate( 'Y-m-d H:i:s' ) . ": " .
$this->msg( "internalerror-fatal-exception",
@@ -110,7 +110,7 @@
$type,
$logId,
MWExceptionHandler::getURL( $this )
-   ) . "\n" .
+   ) );
"";
diff --git a/includes/page/Article.php b/includes/page/Article.php
index b91bd9a..0fcc135 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -590,7 +590,7 @@

$outputPage->setRobotPolicy( 'noindex,nofollow' );
 
$errortext = 
$error->getWikiText( false, 'view-pool-error' );
-  

[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Check for duplicate subscr_cancel

2017-09-28 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381292 )

Change subject: Check for duplicate subscr_cancel
..

Check for duplicate subscr_cancel

Change-Id: Ia16dde10485e56399a07f206349c4e4f535ec8db
TODO: tests
---
M audit/paypal/SarFile.py
M civicrm/civicrm.py
2 files changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/92/381292/1

diff --git a/audit/paypal/SarFile.py b/audit/paypal/SarFile.py
index f86e8e6..102603a 100644
--- a/audit/paypal/SarFile.py
+++ b/audit/paypal/SarFile.py
@@ -101,6 +101,9 @@
 
log.info("-Ignored\t{id}\t{date}\tsubscr_modify".format(id=out['subscr_id'], 
date=out['subscr_date']))
 return
 elif row['Subscription Action Type'] == 'S0200':
+if not self.crm.subscription_exists(out['subscr_id']):
+
log.info("-Duplicate\t{id}\t{date}\tsubscr_cancel".format(id=out['subscr_id'], 
date=out['subscr_date']))
+return
 out['txn_type'] = 'subscr_cancel'
 out['cancel_date'] = out['subscr_date']
 elif row['Subscription Action Type'] == 'S0300':
diff --git a/civicrm/civicrm.py b/civicrm/civicrm.py
index 14ac187..5e5d0c1 100644
--- a/civicrm/civicrm.py
+++ b/civicrm/civicrm.py
@@ -31,7 +31,7 @@
 # FIXME: trxn_id style is inconsistent between gateways.  This will 
only work for paypal.
 sql = """
 SELECT COUNT(*) AS count FROM civicrm_contribution_recur
-WHERE trxn_id = %s
+WHERE trxn_id = %s AND end_date IS NULL
 """
 
 count = list(self.db.execute(sql, (subscr_id, )))

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia16dde10485e56399a07f206349c4e4f535ec8db
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Follow-up 67f04373d fix stupid typo

2017-09-28 Thread Brian Wolff (Code Review)
Brian Wolff has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381357 )

Change subject: Follow-up 67f04373d fix stupid typo
..

Follow-up 67f04373d fix stupid typo

Fot should be For

Change-Id: I3cb87a94feea32f1c98345ceaa19f9a75fde266d
---
M maintenance/updateSpecialPages.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/57/381357/1

diff --git a/maintenance/updateSpecialPages.php 
b/maintenance/updateSpecialPages.php
index cc9f763..e2c0c61 100644
--- a/maintenance/updateSpecialPages.php
+++ b/maintenance/updateSpecialPages.php
@@ -101,7 +101,7 @@
$this->output( sprintf( 
"%.2fs\n", $seconds ) );
}
# Reopen any connections that have 
closed
-   $this->reopenAndWaitFotReplicas();
+   $this->reopenAndWaitForReplicas();
} else {
$this->output( "cheap, skipped\n" );
}
@@ -118,7 +118,7 @@
 * Queries that take a really long time, might cause the
 * mysql connection to "go away"
 */
-   private function reopenAndWaiFotReplicas() {
+   private function reopenAndWaitForReplicas() {
if ( !wfGetLB()->pingAll() ) {
$this->output( "\n" );
do {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3cb87a94feea32f1c98345ceaa19f9a75fde266d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff 

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


[MediaWiki-commits] [Gerrit] All-Projects[refs/meta/config]: Allow all users to rebase

2017-09-28 Thread Paladox (Code Review)
Paladox has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381356 )

Change subject: Allow all users to rebase
..

Allow all users to rebase

The reason why is technolly you can already rebase by using the cherry pick 
functionality and clicking the same branch. So granting this for everyone 
should really effect no one as you can use the workaround.

Change-Id: I8d4599b9ec4115d1e96866cdb73df80a3250928d
---
M project.config
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/All-Projects 
refs/changes/56/381356/1

diff --git a/project.config b/project.config
index 4967b0f..8946489 100644
--- a/project.config
+++ b/project.config
@@ -19,6 +19,7 @@
deleteDrafts = group security
publishDrafts = group security
rebase = group Project Owners
+   rebase = group Registered Users
 [access "refs/for/refs/*"]
push = group Registered Users
pushMerge = group Registered Users
@@ -90,5 +91,3 @@
addPatchSet = group Registered Users
 [plugin "its-phabricator"]
enabled = true
-
-

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d4599b9ec4115d1e96866cdb73df80a3250928d
Gerrit-PatchSet: 1
Gerrit-Project: All-Projects
Gerrit-Branch: refs/meta/config
Gerrit-Owner: Paladox 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Update CiviCRM submodule for dedupe limit

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381354 )

Change subject: Update CiviCRM submodule for dedupe limit
..


Update CiviCRM submodule for dedupe limit

Change-Id: I87b26ab2adc41b5eaffb9b3d0364c997c4208ac1
---
M civicrm
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/civicrm b/civicrm
index 13dc2d7..6bf58ef 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit 13dc2d7b4649540983712a6071b250efb347d3d5
+Subproject commit 6bf58ef39323eae2f3d5928159aefa4ee41eac9a

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381355 )

Change subject: Merge branch 'master' into deployment
..


Merge branch 'master' into deployment

33bb710ce CiviFixtures cleans up after itself better
45a8dad0f Duplicate invoice special handling in message requeue
bb236a869 WmfDatabase: Rollback all if Civi txn marked for rollback
d57689655 When updating an email return early on email match, set on_hold to 0 
if email is not on hold in DB already.
b27179c18 Add test for Exception Rollback
0248b45c7 Update CiviCRM submodule for dedupe limit

Change-Id: Id90953097606d74a8da34440c41c42bd90547941
---
D sites/all/modules/wmf_civicrm/tests/includes/CiviFixtures.php
D sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php
D sites/all/modules/wmf_common/tests/phpunit/WmfTransactionTest.php
3 files changed, 0 insertions(+), 1,005 deletions(-)

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



diff --git a/sites/all/modules/wmf_civicrm/tests/includes/CiviFixtures.php 
b/sites/all/modules/wmf_civicrm/tests/includes/CiviFixtures.php
deleted file mode 100644
index e17aeae..000
--- a/sites/all/modules/wmf_civicrm/tests/includes/CiviFixtures.php
+++ /dev/null
@@ -1,113 +0,0 @@
-<<< HEAD   (3f48cb Merge branch 'master' into deployment)
-===
- 'Individual',
-  'first_name' => 'Test',
-  'last_name' => 'Es'
-));
-$out->contact_id = $individual['id'];
-
-$out->org_contact_name = 'Test DAF ' . mt_rand();
-
-$organization = civicrm_api3('Contact', 'Create', array(
-  'contact_type' => 'Organization',
-  'organization_name' => $out->org_contact_name,
-));
-$out->org_contact_id = $organization['id'];
-
-$out->recur_amount = '2.34';
-$out->subscription_id = 'SUB-' . mt_rand();
-$out->epoch_time = time();
-$out->sql_time = wmf_common_date_unix_to_sql( $out->epoch_time );
-
-$subscription_params = array(
-'contact_id' => $out->contact_id,
-'amount' => $out->recur_amount,
-'currency' => 'USD',
-'frequency_unit' => 'month',
-'frequency_interval' => '1',
-'installments' => '0',
-'start_date' => wmf_common_date_unix_to_civicrm( $out->epoch_time 
),
-'create_date' => wmf_common_date_unix_to_civicrm( $out->epoch_time 
),
-'cancel_date' => null,
-'processor_id' => 1,
-'cycle_day' => '1',
-'next_sched_contribution' => null,
-'trxn_id' => "RECURRING TEST_GATEWAY {$out->subscription_id}-1 
{$out->epoch_time}",
-
-'version' => 3,
-);
-$contributionRecur = civicrm_api3('ContributionRecur', 'Create', 
$subscription_params);
-$out->contribution_recur_id = $contributionRecur['id'];
-
-$out->contact_group_name = 'test_thrilled_demographic';
-$group = civicrm_api3('Group', 'get', array('title' => 
$out->contact_group_name));
-
-if ($group['count'] === 1 ) {
-$out->contact_group_id = $group['id'];
-} else {
-$group = civicrm_api3('Group', 'create', array(
-  'title' => $out->contact_group_name,
-  'name' => $out->contact_group_name,
-));
-$out->contact_group_id = $group['id'];
-}
-
-$out->contribution_amount = '1.00';
-
-$contribution_params = array(
-'contact_id' => $out->contact_id,
-'amount' => $out->contribution_amount,
-'total_amount' => $out->contribution_amount,
-'create_date' => wmf_common_date_unix_to_civicrm( $out->epoch_time 
),
-'financial_type_id' => 1,
-'invoice_id' => mt_rand(),
-);
-$contribution = civicrm_api3('Contribution', 'Create', 
$contribution_params);
-   $out->contribution_id = $contribution['id'];
-$contribution_values = $contribution['values'][$out->contribution_id];
-$out->contribution_invoice_id = $contribution_values['invoice_id'];
-
-   (new CRM_Core_Transaction())->commit();
-return $out;
-}
-
-  /**
-   * Tear down function.
-   */
-public function __destruct() {
-civicrm_api3('ContributionRecur', 'delete', array('id' => 
$this->contribution_recur_id));
-   civicrm_api3('Contribution', 'delete', array('id' => 
$this->contribution_id));
-civicrm_api3('Contact', 'delete', array('id' => $this->contact_id));
-}
-}
->>> BRANCH (0248b4 Update CiviCRM submodule for dedupe limit)
diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php 
b/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php
deleted file mode 100644
index cdc96c8..000
--- a/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php
+++ 

[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Add more top-pages lists

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/378372 )

Change subject: Add more top-pages lists
..


Add more top-pages lists

Chose the top WP projects based on number of users.

Change-Id: Ie60ecea877ef345fd4dc52aa220f30ba5369c66c
---
M .eslintignore
A private/top-pages/top-pages.ar.json
A private/top-pages/top-pages.bg.json
A private/top-pages/top-pages.bn.json
A private/top-pages/top-pages.ca.json
A private/top-pages/top-pages.cs.json
A private/top-pages/top-pages.da.json
A private/top-pages/top-pages.de.json
A private/top-pages/top-pages.el.json
A private/top-pages/top-pages.es.json
A private/top-pages/top-pages.fa.json
A private/top-pages/top-pages.fi.json
A private/top-pages/top-pages.fr.json
A private/top-pages/top-pages.he.json
A private/top-pages/top-pages.hi.json
A private/top-pages/top-pages.hr.json
A private/top-pages/top-pages.hu.json
A private/top-pages/top-pages.id.json
A private/top-pages/top-pages.it.json
A private/top-pages/top-pages.ja.json
A private/top-pages/top-pages.ko.json
A private/top-pages/top-pages.ms.json
A private/top-pages/top-pages.nl.json
A private/top-pages/top-pages.no.json
A private/top-pages/top-pages.pl.json
A private/top-pages/top-pages.pt.json
A private/top-pages/top-pages.ro.json
A private/top-pages/top-pages.ru.json
A private/top-pages/top-pages.sk.json
A private/top-pages/top-pages.sl.json
A private/top-pages/top-pages.sr.json
A private/top-pages/top-pages.sv.json
A private/top-pages/top-pages.th.json
A private/top-pages/top-pages.tr.json
A private/top-pages/top-pages.uk.json
A private/top-pages/top-pages.vi.json
M private/top-pages/top-pages.zh.json
37 files changed, 34,496 insertions(+), 0 deletions(-)

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie60ecea877ef345fd4dc52aa220f30ba5369c66c
Gerrit-PatchSet: 10
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: BearND 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Fjalapeno 
Gerrit-Reviewer: GWicke 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Mhurd 
Gerrit-Reviewer: Mobrovac 
Gerrit-Reviewer: Ppchelko 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment

2017-09-28 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381355 )

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

33bb710ce CiviFixtures cleans up after itself better
45a8dad0f Duplicate invoice special handling in message requeue
bb236a869 WmfDatabase: Rollback all if Civi txn marked for rollback
d57689655 When updating an email return early on email match, set on_hold to 0 
if email is not on hold in DB already.
b27179c18 Add test for Exception Rollback
0248b45c7 Update CiviCRM submodule for dedupe limit

Change-Id: Id90953097606d74a8da34440c41c42bd90547941
---
D sites/all/modules/wmf_civicrm/tests/includes/CiviFixtures.php
D sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php
D sites/all/modules/wmf_common/tests/phpunit/WmfTransactionTest.php
3 files changed, 0 insertions(+), 1,005 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/55/381355/1

diff --git a/sites/all/modules/wmf_civicrm/tests/includes/CiviFixtures.php 
b/sites/all/modules/wmf_civicrm/tests/includes/CiviFixtures.php
deleted file mode 100644
index e17aeae..000
--- a/sites/all/modules/wmf_civicrm/tests/includes/CiviFixtures.php
+++ /dev/null
@@ -1,113 +0,0 @@
-<<< HEAD   (3f48cb Merge branch 'master' into deployment)
-===
- 'Individual',
-  'first_name' => 'Test',
-  'last_name' => 'Es'
-));
-$out->contact_id = $individual['id'];
-
-$out->org_contact_name = 'Test DAF ' . mt_rand();
-
-$organization = civicrm_api3('Contact', 'Create', array(
-  'contact_type' => 'Organization',
-  'organization_name' => $out->org_contact_name,
-));
-$out->org_contact_id = $organization['id'];
-
-$out->recur_amount = '2.34';
-$out->subscription_id = 'SUB-' . mt_rand();
-$out->epoch_time = time();
-$out->sql_time = wmf_common_date_unix_to_sql( $out->epoch_time );
-
-$subscription_params = array(
-'contact_id' => $out->contact_id,
-'amount' => $out->recur_amount,
-'currency' => 'USD',
-'frequency_unit' => 'month',
-'frequency_interval' => '1',
-'installments' => '0',
-'start_date' => wmf_common_date_unix_to_civicrm( $out->epoch_time 
),
-'create_date' => wmf_common_date_unix_to_civicrm( $out->epoch_time 
),
-'cancel_date' => null,
-'processor_id' => 1,
-'cycle_day' => '1',
-'next_sched_contribution' => null,
-'trxn_id' => "RECURRING TEST_GATEWAY {$out->subscription_id}-1 
{$out->epoch_time}",
-
-'version' => 3,
-);
-$contributionRecur = civicrm_api3('ContributionRecur', 'Create', 
$subscription_params);
-$out->contribution_recur_id = $contributionRecur['id'];
-
-$out->contact_group_name = 'test_thrilled_demographic';
-$group = civicrm_api3('Group', 'get', array('title' => 
$out->contact_group_name));
-
-if ($group['count'] === 1 ) {
-$out->contact_group_id = $group['id'];
-} else {
-$group = civicrm_api3('Group', 'create', array(
-  'title' => $out->contact_group_name,
-  'name' => $out->contact_group_name,
-));
-$out->contact_group_id = $group['id'];
-}
-
-$out->contribution_amount = '1.00';
-
-$contribution_params = array(
-'contact_id' => $out->contact_id,
-'amount' => $out->contribution_amount,
-'total_amount' => $out->contribution_amount,
-'create_date' => wmf_common_date_unix_to_civicrm( $out->epoch_time 
),
-'financial_type_id' => 1,
-'invoice_id' => mt_rand(),
-);
-$contribution = civicrm_api3('Contribution', 'Create', 
$contribution_params);
-   $out->contribution_id = $contribution['id'];
-$contribution_values = $contribution['values'][$out->contribution_id];
-$out->contribution_invoice_id = $contribution_values['invoice_id'];
-
-   (new CRM_Core_Transaction())->commit();
-return $out;
-}
-
-  /**
-   * Tear down function.
-   */
-public function __destruct() {
-civicrm_api3('ContributionRecur', 'delete', array('id' => 
$this->contribution_recur_id));
-   civicrm_api3('Contribution', 'delete', array('id' => 
$this->contribution_id));
-civicrm_api3('Contact', 'delete', array('id' => $this->contact_id));
-}
-}
->>> BRANCH (0248b4 Update CiviCRM submodule for dedupe limit)
diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php 
b/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php
deleted file mode 100644
index cdc96c8..000
--- a/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php

[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: CRM-21224 reinstate use of limit on dedupe searches

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381311 )

Change subject: CRM-21224 reinstate use of limit on dedupe searches
..


CRM-21224 reinstate use of limit on dedupe searches

https://github.com/civicrm/civicrm-core/pull/11030

I'm not sure this is the last we'll hear of this but I'm sure this is at
least part of the fix

Bug: T175382
Change-Id: Ice270d01d8d9033ff9db3f18c1762544b8bfaa79
---
M CRM/Contact/Page/DedupeFind.php
M CRM/Core/BAO/PrevNextCache.php
M CRM/Dedupe/Finder.php
M CRM/Dedupe/Merger.php
4 files changed, 28 insertions(+), 15 deletions(-)

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



diff --git a/CRM/Contact/Page/DedupeFind.php b/CRM/Contact/Page/DedupeFind.php
index decfdbc..41fa2ea 100644
--- a/CRM/Contact/Page/DedupeFind.php
+++ b/CRM/Contact/Page/DedupeFind.php
@@ -157,7 +157,7 @@
 CRM_Dedupe_Merger::resetMergeStats($cacheKeyString);
   }
 
-  $this->_mainContacts = CRM_Dedupe_Merger::getDuplicatePairs($rgid, $gid, 
!$isConflictMode, 0, $isConflictMode, '', $isConflictMode, $criteria, TRUE);
+  $this->_mainContacts = CRM_Dedupe_Merger::getDuplicatePairs($rgid, $gid, 
!$isConflictMode, 0, $isConflictMode, '', $isConflictMode, $criteria, TRUE, 
$limit);
 
   if (empty($this->_mainContacts)) {
 if ($isConflictMode) {
diff --git a/CRM/Core/BAO/PrevNextCache.php b/CRM/Core/BAO/PrevNextCache.php
index a3d6f44..0eab40d 100644
--- a/CRM/Core/BAO/PrevNextCache.php
+++ b/CRM/Core/BAO/PrevNextCache.php
@@ -366,11 +366,16 @@
* @param bool $checkPermissions
*   Respect logged in user's permissions.
*
+   * @param int $searchLimit
+   *  Limit for the number of contacts to be used for comparison.
+   *  The search methodology finds all matches for the searchedContacts so 
this limits
+   *  the number of searched contacts, not the matches found.
+   *
* @return bool
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
-  public static function refillCache($rgid, $gid, $cacheKeyString, $criteria, 
$checkPermissions) {
+  public static function refillCache($rgid, $gid, $cacheKeyString, $criteria, 
$checkPermissions, $searchLimit = 0) {
 if (!$cacheKeyString && $rgid) {
   $cacheKeyString = CRM_Dedupe_Merger::getMergeCacheKeyString($rgid, $gid, 
$criteria, $checkPermissions);
 }
@@ -389,7 +394,7 @@
 // 2. FILL cache
 $foundDupes = array();
 if ($rgid && $gid) {
-  $foundDupes = CRM_Dedupe_Finder::dupesInGroup($rgid, $gid);
+  $foundDupes = CRM_Dedupe_Finder::dupesInGroup($rgid, $gid, $searchLimit);
 }
 elseif ($rgid) {
   $contactIDs = array();
@@ -397,7 +402,7 @@
 $contacts = civicrm_api3('Contact', 'get', array_merge(array('options' 
=> array('limit' => 0), 'return' => 'id'), $criteria['contact']));
 $contactIDs = array_keys($contacts['values']);
   }
-  $foundDupes = CRM_Dedupe_Finder::dupes($rgid, $contactIDs, 
$checkPermissions);
+  $foundDupes = CRM_Dedupe_Finder::dupes($rgid, $contactIDs, 
$checkPermissions, $searchLimit);
 }
 
 if (!empty($foundDupes)) {
diff --git a/CRM/Dedupe/Finder.php b/CRM/Dedupe/Finder.php
index 4504447..aa092e4 100644
--- a/CRM/Dedupe/Finder.php
+++ b/CRM/Dedupe/Finder.php
@@ -51,9 +51,10 @@
* @param bool $checkPermissions
*   Respect logged in user permissions.
*
-   * @param int $limit
-   *   Optional limit. This limits the number of contacts for which the code 
will
-   *   attempt to find matches.
+   * @param int $searchLimit
+   *  Limit for the number of contacts to be used for comparison.
+   *  The search methodology finds all matches for the searchedContacts so 
this limits
+   *  the number of searched contacts, not the matches found.
*
* @return array
*   Array of (cid1, cid2, weight) dupe triples
@@ -61,18 +62,18 @@
* @throws CiviCRM_API3_Exception
* @throws Exception
*/
-  public static function dupes($rgid, $cids = array(), $checkPermissions = 
TRUE, $limit = NULL) {
+  public static function dupes($rgid, $cids = array(), $checkPermissions = 
TRUE, $searchLimit = 0) {
 $rgBao = new CRM_Dedupe_BAO_RuleGroup();
 $rgBao->id = $rgid;
 $rgBao->contactIds = $cids;
 if (!$rgBao->find(TRUE)) {
   CRM_Core_Error::fatal("Dedupe rule not found for selected contacts");
 }
-if (empty($rgBao->contactIds) && !empty($limit)) {
+if (empty($rgBao->contactIds) && !empty($searchLimit)) {
   $limitedContacts = civicrm_api3('Contact', 'get', array(
 'return' => 'id',
 'contact_type' => $rgBao->contact_type,
-'options' => array('limit' => $limit),
+'options' => array('limit' => $searchLimit),
   ));
   $rgBao->contactIds = array_keys($limitedContacts['values']);
 }
@@ -167,12 +168,16 @@
* @param int $gid
*   Contact group id (currently, works only with 

[MediaWiki-commits] [Gerrit] labs...heritage[master]: Add `base` parameter for France in French (fr_fr)

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381192 )

Change subject: Add `base` parameter for France in French (fr_fr)
..


Add `base` parameter for France in French (fr_fr)

`base` is a legit parameter of {{Ligne de tableau MH}}.

Change-Id: I6076b3b5f800d4015b800c85c5910fd7c85dae0e
---
M erfgoedbot/monuments_config/fr_fr.json
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/erfgoedbot/monuments_config/fr_fr.json 
b/erfgoedbot/monuments_config/fr_fr.json
index 1cddb45..774899a 100644
--- a/erfgoedbot/monuments_config/fr_fr.json
+++ b/erfgoedbot/monuments_config/fr_fr.json
@@ -80,6 +80,10 @@
 "type": "varchar(11)"
 },
 {
+"dest": "base",
+"source": "base"
+},
+{
 "dest": "protection",
 "source": "protection"
 },

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6076b3b5f800d4015b800c85c5910fd7c85dae0e
Gerrit-PatchSet: 5
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Jean-Frédéric 
Gerrit-Reviewer: Lokal Profil 
Gerrit-Reviewer: Multichill 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Update CiviCRM submodule for dedupe limit

2017-09-28 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381354 )

Change subject: Update CiviCRM submodule for dedupe limit
..

Update CiviCRM submodule for dedupe limit

Change-Id: I87b26ab2adc41b5eaffb9b3d0364c997c4208ac1
---
M civicrm
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/54/381354/1

diff --git a/civicrm b/civicrm
index 13dc2d7..6bf58ef 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit 13dc2d7b4649540983712a6071b250efb347d3d5
+Subproject commit 6bf58ef39323eae2f3d5928159aefa4ee41eac9a

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I87b26ab2adc41b5eaffb9b3d0364c997c4208ac1
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Merge branch 'master' into deployment 77a7ef7 Short array sy...

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381353 )

Change subject: Merge branch 'master' into deployment 77a7ef7 Short array 
syntax 1e695c9 Handle additional paypal refund reason codes.
..


Merge branch 'master' into deployment
77a7ef7 Short array syntax
1e695c9 Handle additional paypal refund reason codes.

Change-Id: Ieb77ee391e3731cfffe5439af72f9e609890976a
---
D PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php
D PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php
D PaymentProviders/Adyen/Tests/phpunit/AuditTest.php
D PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php
D PaymentProviders/Adyen/Tests/phpunit/CaptureResponseActionTest.php
D PaymentProviders/Adyen/Tests/phpunit/PaymentCaptureActionTest.php
D PaymentProviders/Adyen/Tests/phpunit/ReportAvailableTest.php
D PaymentProviders/Amazon/Tests/AmazonTestCase.php
D PaymentProviders/Amazon/Tests/phpunit/AuditTest.php
D PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php
D PaymentProviders/AstroPay/Tests/phpunit/AuditTest.php
D PaymentProviders/AstroPay/Tests/phpunit/NormalizeTest.php
D PaymentProviders/Ingenico/Tests/phpunit/ApiTest.php
D PaymentProviders/Ingenico/Tests/phpunit/AuditTest.php
D PaymentProviders/Ingenico/Tests/phpunit/BankPaymentProviderTest.php
D PaymentProviders/Ingenico/Tests/phpunit/HostedCheckoutProviderTest.php
D PaymentProviders/Ingenico/Tests/phpunit/IdealStatusProviderTest.php
D PaymentProviders/Ingenico/Tests/phpunit/IngenicoPaymentProviderTest.php
D PaymentProviders/PayPal/Tests/Data/refund_admin_fraud_reversal.json
D 
PaymentProviders/PayPal/Tests/Data/refund_admin_fraud_reversal_transformed.json
D PaymentProviders/PayPal/Tests/Data/refund_unauthorized_spoof.json
D PaymentProviders/PayPal/Tests/Data/refund_unauthorized_spoof_transformed.json
D PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
D Tests/BaseSmashPigUnitTestCase.php
D Tests/ConfigurationTest.php
D Tests/DamagedDatabaseTest.php
D Tests/FileDumperTest.php
D Tests/MessageTest.php
D Tests/PaymentsInitialDatabaseTest.php
D Tests/PendingDatabaseTest.php
D Tests/PendingQueueConsumerTest.php
D Tests/QueueConsumerTest.php
D Tests/TestingDatabase.php
D Tests/TestingGlobalConfiguration.php
D Tests/TestingProviderConfiguration.php
D Tests/TestingQueueConsumer.php
36 files changed, 0 insertions(+), 2,790 deletions(-)

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



diff --git a/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php 
b/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php
deleted file mode 100644
index f430842..000
--- a/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<<< HEAD   (dc6220 Merge branch 'master' into deployment)
-===
-override( $overrides );
-
-   return $config;
-   }
-
-   public static function createWithSuccessfulApi( GlobalConfiguration 
$globalConfig ) {
-   $override = [ 'api' =>
-   [
-   'class' => 
'SmashPig\PaymentProviders\Adyen\Tests\MockAdyenPaymentsAPI',
-   'constructor-parameters' =>
-   [ 'Success!' ]
-   ]
-   ];
-   return self::instance( $override, $globalConfig );
-   }
-
-   public static function createWithUnsuccessfulApi( GlobalConfiguration 
$globalConfig ) {
-   $override = [ 'api' =>
-   [
-   'class' => 
'SmashPig\PaymentProviders\Adyen\Tests\MockAdyenPaymentsAPI',
-   'constructor-parameters' =>
-   // FIXME: Really?  or boolean `false` 
as it would be if
-   // we parsed "false" from yaml?
-   [ 'false' ]
-   ]
-   ];
-   return self::instance( $override, $globalConfig );
-   }
-}
->>> BRANCH (1e695c Handle additional paypal refund reason codes.)
diff --git a/PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php 
b/PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php
deleted file mode 100644
index d150bae..000
--- a/PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<<< HEAD   (dc6220 Merge branch 'master' into deployment)
-===
-returnCode = $returnCode;
-   }
-
-   public function setAccount( $account ) {
-   $this->account = $account;
-   }
-
-   /**
-* Fakes a Capture modification to a given Adyen transaction.
-*
-* @param string $currency Original currency of the request
-* @param int $amount Amount to be captured. Less than or equal to the 
original request
-* @param string $pspReference Original pspReference of the request
-  

[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Merge branch 'master' into deployment 77a7ef7 Short array sy...

2017-09-28 Thread XenoRyet (Code Review)
XenoRyet has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381353 )

Change subject: Merge branch 'master' into deployment 77a7ef7 Short array 
syntax 1e695c9 Handle additional paypal refund reason codes.
..

Merge branch 'master' into deployment
77a7ef7 Short array syntax
1e695c9 Handle additional paypal refund reason codes.

Change-Id: Ieb77ee391e3731cfffe5439af72f9e609890976a
---
D PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php
D PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php
D PaymentProviders/Adyen/Tests/phpunit/AuditTest.php
D PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php
D PaymentProviders/Adyen/Tests/phpunit/CaptureResponseActionTest.php
D PaymentProviders/Adyen/Tests/phpunit/PaymentCaptureActionTest.php
D PaymentProviders/Adyen/Tests/phpunit/ReportAvailableTest.php
D PaymentProviders/Amazon/Tests/AmazonTestCase.php
D PaymentProviders/Amazon/Tests/phpunit/AuditTest.php
D PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php
D PaymentProviders/AstroPay/Tests/phpunit/AuditTest.php
D PaymentProviders/AstroPay/Tests/phpunit/NormalizeTest.php
D PaymentProviders/Ingenico/Tests/phpunit/ApiTest.php
D PaymentProviders/Ingenico/Tests/phpunit/AuditTest.php
D PaymentProviders/Ingenico/Tests/phpunit/BankPaymentProviderTest.php
D PaymentProviders/Ingenico/Tests/phpunit/HostedCheckoutProviderTest.php
D PaymentProviders/Ingenico/Tests/phpunit/IdealStatusProviderTest.php
D PaymentProviders/Ingenico/Tests/phpunit/IngenicoPaymentProviderTest.php
D PaymentProviders/PayPal/Tests/Data/refund_admin_fraud_reversal.json
D 
PaymentProviders/PayPal/Tests/Data/refund_admin_fraud_reversal_transformed.json
D PaymentProviders/PayPal/Tests/Data/refund_unauthorized_spoof.json
D PaymentProviders/PayPal/Tests/Data/refund_unauthorized_spoof_transformed.json
D PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
D Tests/BaseSmashPigUnitTestCase.php
D Tests/ConfigurationTest.php
D Tests/DamagedDatabaseTest.php
D Tests/FileDumperTest.php
D Tests/MessageTest.php
D Tests/PaymentsInitialDatabaseTest.php
D Tests/PendingDatabaseTest.php
D Tests/PendingQueueConsumerTest.php
D Tests/QueueConsumerTest.php
D Tests/TestingDatabase.php
D Tests/TestingGlobalConfiguration.php
D Tests/TestingProviderConfiguration.php
D Tests/TestingQueueConsumer.php
36 files changed, 0 insertions(+), 2,790 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/53/381353/1

diff --git a/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php 
b/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php
deleted file mode 100644
index f430842..000
--- a/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<<< HEAD   (dc6220 Merge branch 'master' into deployment)
-===
-override( $overrides );
-
-   return $config;
-   }
-
-   public static function createWithSuccessfulApi( GlobalConfiguration 
$globalConfig ) {
-   $override = [ 'api' =>
-   [
-   'class' => 
'SmashPig\PaymentProviders\Adyen\Tests\MockAdyenPaymentsAPI',
-   'constructor-parameters' =>
-   [ 'Success!' ]
-   ]
-   ];
-   return self::instance( $override, $globalConfig );
-   }
-
-   public static function createWithUnsuccessfulApi( GlobalConfiguration 
$globalConfig ) {
-   $override = [ 'api' =>
-   [
-   'class' => 
'SmashPig\PaymentProviders\Adyen\Tests\MockAdyenPaymentsAPI',
-   'constructor-parameters' =>
-   // FIXME: Really?  or boolean `false` 
as it would be if
-   // we parsed "false" from yaml?
-   [ 'false' ]
-   ]
-   ];
-   return self::instance( $override, $globalConfig );
-   }
-}
->>> BRANCH (1e695c Handle additional paypal refund reason codes.)
diff --git a/PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php 
b/PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php
deleted file mode 100644
index d150bae..000
--- a/PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<<< HEAD   (dc6220 Merge branch 'master' into deployment)
-===
-returnCode = $returnCode;
-   }
-
-   public function setAccount( $account ) {
-   $this->account = $account;
-   }
-
-   /**
-* Fakes a Capture modification to a given Adyen transaction.
-*
-* @param string $currency Original currency of the request
-* @param int $amount Amount to be captured. Less than or equal to the 
original request
-* @param string $pspReference Original pspReference of 

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: When updating an email return early on email match, set on_h...

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/379467 )

Change subject: When updating an email return early on email match, set on_hold 
to 0 if email is not on hold in DB already.
..


When updating an email return early on email match, set on_hold to 0 if email 
is not on hold in DB already.

Bug: T170350
Change-Id: If092a9131c85d5ec332818d1eb9984142c1c3dda
---
M sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
2 files changed, 99 insertions(+), 10 deletions(-)

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



diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php 
b/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php
index cc18669..3cba6c7 100644
--- a/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php
+++ b/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php
@@ -473,7 +473,77 @@
 $this->assertEquals($fixtures->contact_group_id, $group['group_id']);
 }
 
-public function testDuplicateHandling() {
+  /**
+   * Test that existing on hold setting is retained.
+   */
+public function testKeepOnHold() {
+  self::$fixtures = CiviFixtures::create();
+  $this->callAPISuccess('Email', 'create', array(
+'email' => 'aga...@wikimedia.org',
+'on_hold' => 1,
+'location_type_id' => 1,
+'contact_id' => self::$fixtures->contact_id,
+  ));
+
+  $msg = array(
+'contact_id' => self::$fixtures->contact_id,
+'contribution_recur_id' => self::$fixtures->contribution_recur_id,
+'currency' => 'USD',
+'date' => '2014-01-01 00:00:00',
+'effort_id' => 2,
+'email' => 'aga...@wikimedia.org',
+'gateway' => 'test_gateway',
+'gateway_txn_id' => mt_rand(),
+'gross' => self::$fixtures->recur_amount,
+'payment_method' => 'cc',
+  );
+  $contribution = wmf_civicrm_contribution_message_import($msg);
+  $emails = $this->callAPISuccess('Email', 'get', array('contact_id' => 
self::$fixtures->contact_id, 'sequential' => 1));
+  $this->assertEquals(1, $emails['count']);
+
+  $this->assertEquals(1, $emails['values'][0]['on_hold']);
+  $this->assertEquals('aga...@wikimedia.org', 
$emails['values'][0]['email']);
+
+  $this->callAPISuccess('Contribution', 'delete', array('id' => 
$contribution['id']));
+
+}
+
+  /**
+   * Test that existing on hold setting is removed if the email changes.
+   */
+  public function testRemoveOnHoldWhenUpdating() {
+self::$fixtures = CiviFixtures::create();
+$this->callAPISuccess('Email', 'create', array(
+  'email' => 'aga...@wikimedia.org',
+  'on_hold' => 1,
+  'location_type_id' => 1,
+  'contact_id' => self::$fixtures->contact_id,
+));
+
+$msg = array(
+  'contact_id' => self::$fixtures->contact_id,
+  'contribution_recur_id' => self::$fixtures->contribution_recur_id,
+  'currency' => 'USD',
+  'date' => '2014-01-01 00:00:00',
+  'effort_id' => 2,
+  'email' => 'pan...@wikimedia.org',
+  'gateway' => 'test_gateway',
+  'gateway_txn_id' => mt_rand(),
+  'gross' => self::$fixtures->recur_amount,
+  'payment_method' => 'cc',
+);
+$contribution = wmf_civicrm_contribution_message_import($msg);
+$emails = $this->callAPISuccess('Email', 'get', array('contact_id' => 
self::$fixtures->contact_id, 'sequential' => 1));
+$this->assertEquals(1, $emails['count']);
+
+$this->assertEquals(0, $emails['values'][0]['on_hold']);
+$this->assertEquals('pan...@wikimedia.org', $emails['values'][0]['email']);
+
+$this->callAPISuccess('Contribution', 'delete', array('id' => 
$contribution['id']));
+  }
+
+
+  public function testDuplicateHandling() {
 $fixtures = CiviFixtures::create();
 $error = null;
 $msg = array(
diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 51f4683..087 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -1401,8 +1401,9 @@
 /**
  * Updates the email for a contact.
  *
- * @param string $msg
+ * @param array $msg
  * @param int $contact_id
+ *
  * @throws \WmfException
  */
 function wmf_civicrm_message_email_update($msg, $contact_id ) {
@@ -1413,16 +1414,34 @@
   try {
 $loc_type_id = isset($msg['email_location_type_id']) ? 
$msg['email_location_type_id'] : wmf_civicrm_get_default_location_type_id();
 $isPrimary = isset($msg['email_location_type_id']) ? 0 : 1;
-civicrm_api3( "Email", "Replace", array(
-  'debug' => 1,
+
+$emailParams = array(
+  'email' => $msg['email'],
+  'is_primary' => $isPrimary,
+  'is_billing' => $isPrimary,
+  'contact_id' => $contact_id,
+);
+

[MediaWiki-commits] [Gerrit] integration/quibble[master]: Update run instruction to benefit from caching

2017-09-28 Thread Hashar (Code Review)
Hashar has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381352 )

Change subject: Update run instruction to benefit from caching
..

Update run instruction to benefit from caching

Change-Id: I3f609eb4a8b89d09ae36174a59365c91c880bd84
---
M README.md
1 file changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/quibble 
refs/changes/52/381352/1

diff --git a/README.md b/README.md
index a2a958a..be35646 100644
--- a/README.md
+++ b/README.md
@@ -18,9 +18,15 @@
   git clone --bare mediawiki/core ref/mediawiki/core.git
   git clone --bare mediawiki/vendor ref/mediawiki/vendor.git
 
-Then bindmount it READ-ONLY as /srv/git:
+We have `XDG_CACHE_HOME=/cache` which is recognized by package managers.
+Create a cache directory writable by any user:
 
-  docker run -it --rm -v `pwd`/ref:/srv/git:ro quibble bash
+  install --directory --mode 777 cache
+
+We then mount the git repositories as a READ-ONLY volume as /srv/git and the
+cache dir in read-write:
+
+  docker run -it --rm -v "$(pwd)"/ref:/srv/git:ro -v "$(pwd)"/cache:/cache 
quibble bash
 
 TESTING
 ---

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f609eb4a8b89d09ae36174a59365c91c880bd84
Gerrit-PatchSet: 1
Gerrit-Project: integration/quibble
Gerrit-Branch: master
Gerrit-Owner: Hashar 

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


[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Add lastet_currency_symbol to export

2017-09-28 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381351 )

Change subject: Add lastet_currency_symbol to export
..

Add lastet_currency_symbol to export

Bug: T156410
Change-Id: I697e07d2d36184c976f43037d664c03c2bc45262
---
M silverpop_export/tests/minimal_schema.sql
M silverpop_export/tests/test_update.py
M silverpop_export/update_table.sql
3 files changed, 63 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/51/381351/1

diff --git a/silverpop_export/tests/minimal_schema.sql 
b/silverpop_export/tests/minimal_schema.sql
index c2e35a4..8d904bf 100644
--- a/silverpop_export/tests/minimal_schema.sql
+++ b/silverpop_export/tests/minimal_schema.sql
@@ -26,6 +26,20 @@
 is_deleted tinyint(4) default '0'
 );
 
+drop table if exists civicrm_currency;
+create table civicrm_currency (
+id int(10) unsigned auto_increment primary key,
+name varchar(64) COLLATE utf8_unicode_ci,
+symbol varchar(8) COLLATE utf8_unicode_ci,
+key UI_name (name)
+);
+insert into civicrm_currency (name, symbol)
+values
+('USD', '$'),
+('CAD', '$'),
+('GBP', '£'),
+('DZD', NULL);
+
 drop table if exists wmf_donor;
 create table wmf_donor (
 id int(10) unsigned,
diff --git a/silverpop_export/tests/test_update.py 
b/silverpop_export/tests/test_update.py
index 8d951a7..d9f9c19 100644
--- a/silverpop_export/tests/test_update.py
+++ b/silverpop_export/tests/test_update.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 import datetime
 from decimal import Decimal
 import mock
@@ -26,7 +27,7 @@
 db_name = "test"
 db_user = "test"
 
-db_params = {"user": db_user, "host": db_host}
+db_params = {"user": db_user, "host": db_host, "charset": "utf8"}
 if db_pass:
 db_params['passwd'] = db_pass
 
@@ -219,6 +220,36 @@
 assert actual == expected
 
 
+def test_currency_symbol():
+'''
+Test that we correctly pull in the currency symbol for the latest donation
+'''
+
+run_update_with_fixtures(fixture_queries=["""
+insert into civicrm_email (contact_id, email, is_primary, on_hold) values
+(1, 'person1@localhost', 1, 0);
+""", """
+insert into civicrm_contact (id) values
+(1);
+""", """
+insert into civicrm_contribution (id, contact_id, receive_date, 
total_amount, trxn_id, contribution_status_id) values
+(1, 1, '2015-01-03', 9.50, 'xyz123', 1),
+(2, 1, '2017-07-07', 10.95, 'nnn777', 1),
+(3, 1, '2016-05-05', 10.00, 'abc456', 1);
+""", """
+insert into wmf_contribution_extra (entity_id, original_amount, 
original_currency) values
+(1, 1000, 'JPY'),
+(2, 9.00, 'GBP'),
+(3, 10.00, 'USD');
+"""])
+
+cursor = conn.db_conn.cursor()
+cursor.execute("select latest_currency, latest_currency_symbol from 
silverpop_export")
+expected = ('GBP', u'£')
+actual = cursor.fetchone()
+assert actual == expected
+
+
 def run_update_with_fixtures(fixture_path=None, fixture_queries=None):
 with mock.patch("database.db.Connection") as MockConnection:
 
diff --git a/silverpop_export/update_table.sql 
b/silverpop_export/update_table.sql
index 9ae49bd..61e5ca5 100755
--- a/silverpop_export/update_table.sql
+++ b/silverpop_export/update_table.sql
@@ -35,6 +35,7 @@
 
   -- Latest contribution statistics
   latest_currency varchar(3) not null default '',
+  latest_currency_symbol varchar(8) not null default '',
   latest_native_amount decimal(20,2) not null default 0,
   latest_usd_amount decimal(20,2) not null default 0,
   latest_donation datetime null,
@@ -57,6 +58,7 @@
 CREATE TABLE IF NOT EXISTS silverpop_export_latest(
   email varchar(255) PRIMARY KEY,
   latest_currency varchar(3),
+  latest_currency_symbol varchar(8),
   latest_native_amount decimal(20,2),
   latest_usd_amount decimal(20,2),
   latest_donation datetime
@@ -91,16 +93,19 @@
   SELECT
 e.email,
 ex.original_currency,
+COALESCE(cur.symbol, ex.original_currency),
 ex.original_amount,
 ct.total_amount,
 ct.receive_date
   FROM
-silverpop_export_staging e,
-civicrm.civicrm_contribution ct,
-civicrm.wmf_contribution_extra ex
+silverpop_export_staging e
+INNER JOIN civicrm.civicrm_contribution ct
+  ON ct.contact_id = e.contact_id
+INNER JOIN civicrm.wmf_contribution_extra ex
+  ON ex.entity_id = ct.id
+LEFT JOIN civicrm.civicrm_currency cur
+  ON cur.name = ex.original_currency
   WHERE
-e.contact_id = ct.contact_id AND
-ex.entity_id = ct.id AND
 ct.receive_date IS NOT NULL AND
 ct.total_amount > 0 AND -- Refunds don't count
 ct.contribution_status_id = 1 -- 'Completed'
@@ -269,6 +274,7 @@
 ex.has_recurred_donation = exs.has_recurred_donation,
 ex.first_donation_date = exs.first_donation_date,
 ex.latest_currency = lt.latest_currency,
+

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Update pagelib to 4.7.0

2017-09-28 Thread Mholloway (Code Review)
Mholloway has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381350 )

Change subject: Update pagelib to 4.7.0
..

Update pagelib to 4.7.0

Change-Id: I6ddf3e406ff69d57e9080cda4ac3008ad9e677c2
---
M app/src/main/assets/bundle.js
M app/src/main/assets/preview.js
M app/src/main/assets/wikimedia-page-library.css
M www/package-lock.json
M www/package.json
5 files changed, 89 insertions(+), 42 deletions(-)


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

diff --git a/app/src/main/assets/bundle.js b/app/src/main/assets/bundle.js
index 08f4656..6baef47 100644
--- a/app/src/main/assets/bundle.js
+++ b/app/src/main/assets/bundle.js
@@ -1935,23 +1935,34 @@
  */
 
 /**
+  * @typedef {function} FooterBrowserClickCallback
+  * @return {void}
+  */
+
+/**
  * Adds legal footer html to 'containerID' element.
  * @param {!Element} content
  * @param {?string} licenseString
  * @param {?string} licenseSubstitutionString
  * @param {!string} containerID
  * @param {!FooterLegalClickCallback} licenseLinkClickHandler
+ * @param {!string} viewInBrowserString
+ * @param {!FooterBrowserClickCallback} browserLinkClickHandler
  * @return {void}
  */
-var add = function add(content, licenseString, licenseSubstitutionString, 
containerID, licenseLinkClickHandler) {
+var add = function add(content, licenseString, licenseSubstitutionString, 
containerID, licenseLinkClickHandler, viewInBrowserString, 
browserLinkClickHandler) {
   // todo: don't manipulate the selector. The client can make this an ID if 
they want it to be.
   var container = content.querySelector('#' + containerID);
   var licenseStringHalves = licenseString.split('$1');
 
-  container.innerHTML = '\n
\n\n  ' + licenseStringHalves[0] + '\n 
 \n' + 
licenseSubstitutionString + '\n  \n  ' + licenseStringHalves[1] + 
'\n\n  ';
+  container.innerHTML = '\n
\n\n  ' + licenseStringHalves[0] + '\n 
 \n' + 
licenseSubstitutionString + '\n  \n  ' + licenseStringHalves[1] + 
'\n  \n  \n\n  ' + viewInBrowserString + '\n 
   \n  \n\n  ';
 
   
container.querySelector('.pagelib_footer_legal_license_link').addEventListener('click',
 function () {
 licenseLinkClickHandler();
+  });
+
+  
container.querySelector('.pagelib_footer_browser_link').addEventListener('click',
 function () {
+browserLinkClickHandler();
   });
 };
 
@@ -2057,6 +2068,8 @@
   return 'pagelib_footer_menu_icon_languages';
 case MenuItemType.lastEdited:
   return 'pagelib_footer_menu_icon_last_edited';
+case MenuItemType.talkPage:
+  return 'pagelib_footer_menu_icon_talk_page';
 case MenuItemType.pageIssues:
   return 'pagelib_footer_menu_icon_page_issues';
 case MenuItemType.disambiguation:
@@ -2705,6 +2718,8 @@
* @param {!string} license
* @param {!string} licenseSubstitutionString
* @param {!FooterLegalClickCallback} licenseLinkClickHandler
+   * @param {!string} viewInBrowserString
+   * @param {!FooterBrowserClickCallback} browserLinkClickHandler
* @param {!TitlesShownHandler} titlesShownHandler
* @param {!SaveButtonClickHandler} saveButtonClickHandler
* @return {void}
@@ -2713,11 +2728,11 @@
 
   createClass(_class, [{
 key: 'add',
-value: function add(window, container, baseURL, title, readMoreHeader, 
readMoreLimit, license, licenseSubstitutionString, licenseLinkClickHandler, 
titlesShownHandler, saveButtonClickHandler) {
+value: function add(window, container, baseURL, title, readMoreHeader, 
readMoreLimit, license, licenseSubstitutionString, licenseLinkClickHandler, 
viewInBrowserString, browserLinkClickHandler, titlesShownHandler, 
saveButtonClickHandler) {
   this.remove(window);
   
container.appendChild(FooterContainer.containerFragment(window.document));
 
-  FooterLegal.add(window.document, license, licenseSubstitutionString, 
ID_LEGAL_CONTAINER, licenseLinkClickHandler);
+  FooterLegal.add(window.document, license, licenseSubstitutionString, 
ID_LEGAL_CONTAINER, licenseLinkClickHandler, viewInBrowserString, 
browserLinkClickHandler);
 
   FooterReadMore.setHeading(readMoreHeader, ID_READ_MORE_HEADER, 
window.document);
   FooterReadMore.add(title, readMoreLimit, ID_READ_MORE_CONTAINER, 
baseURL, saveButtonClickHandler, function (titles) {
diff --git a/app/src/main/assets/preview.js b/app/src/main/assets/preview.js
index 7b37964..d5764d7 100644
--- a/app/src/main/assets/preview.js
+++ b/app/src/main/assets/preview.js
@@ -1099,23 +1099,34 @@
  */
 
 /**
+  * @typedef {function} FooterBrowserClickCallback
+  * @return {void}
+  */
+
+/**
  * Adds legal footer html to 'containerID' element.
  * @param {!Element} content
  * @param {?string} licenseString
  * @param {?string} licenseSubstitutionString
  * @param {!string} containerID
  

[MediaWiki-commits] [Gerrit] labs/private[master]: hiera keys for pdns_server in openstack deployments

2017-09-28 Thread Rush (Code Review)
Rush has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381345 )

Change subject: hiera keys for pdns_server in openstack deployments
..


hiera keys for pdns_server in openstack deployments

Change-Id: I7410003a79fce11cb899f314cc48d03b2e833035
---
A hieradata/codfw/profile/openstack/labtest/pdns.yaml
A hieradata/codfw/profile/openstack/labtestn/pdns.yaml
A hieradata/eqiad/profile/openstack/main/pdns.yaml
3 files changed, 6 insertions(+), 0 deletions(-)

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



diff --git a/hieradata/codfw/profile/openstack/labtest/pdns.yaml 
b/hieradata/codfw/profile/openstack/labtest/pdns.yaml
new file mode 100644
index 000..b632986
--- /dev/null
+++ b/hieradata/codfw/profile/openstack/labtest/pdns.yaml
@@ -0,0 +1,2 @@
+profile::openstack::labtest::pdns::db_pass: 'lt-pdns_db_pass'
+profile::openstack::labtest::pdns::db_admin_pass: 'lt-db-admin_pass'
diff --git a/hieradata/codfw/profile/openstack/labtestn/pdns.yaml 
b/hieradata/codfw/profile/openstack/labtestn/pdns.yaml
new file mode 100644
index 000..c87356f
--- /dev/null
+++ b/hieradata/codfw/profile/openstack/labtestn/pdns.yaml
@@ -0,0 +1,2 @@
+profile::openstack::labtestn::pdns::db_pass: 'ltn-pdns_db_pass'
+profile::openstack::labtestn::pdns::db_admin_pass: 'ltn-pdns_db_pass'
diff --git a/hieradata/eqiad/profile/openstack/main/pdns.yaml 
b/hieradata/eqiad/profile/openstack/main/pdns.yaml
new file mode 100644
index 000..57066e5
--- /dev/null
+++ b/hieradata/eqiad/profile/openstack/main/pdns.yaml
@@ -0,0 +1,2 @@
+profile::openstack::main::pdns::db_pass: 'ltn-pdns_db_pass'
+profile::openstack::main::pdns::db_admin_pass: 'ltn-db_admin_pass'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7410003a79fce11cb899f314cc48d03b2e833035
Gerrit-PatchSet: 1
Gerrit-Project: labs/private
Gerrit-Branch: master
Gerrit-Owner: Rush 
Gerrit-Reviewer: Rush 

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


[MediaWiki-commits] [Gerrit] labs/private[master]: hiera keys for pdns_server in openstack deployments

2017-09-28 Thread Rush (Code Review)
Rush has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381345 )

Change subject: hiera keys for pdns_server in openstack deployments
..

hiera keys for pdns_server in openstack deployments

Change-Id: I7410003a79fce11cb899f314cc48d03b2e833035
---
A hieradata/codfw/profile/openstack/labtest/pdns.yaml
A hieradata/codfw/profile/openstack/labtestn/pdns.yaml
A hieradata/eqiad/profile/openstack/main/pdns.yaml
3 files changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/private 
refs/changes/45/381345/1

diff --git a/hieradata/codfw/profile/openstack/labtest/pdns.yaml 
b/hieradata/codfw/profile/openstack/labtest/pdns.yaml
new file mode 100644
index 000..b632986
--- /dev/null
+++ b/hieradata/codfw/profile/openstack/labtest/pdns.yaml
@@ -0,0 +1,2 @@
+profile::openstack::labtest::pdns::db_pass: 'lt-pdns_db_pass'
+profile::openstack::labtest::pdns::db_admin_pass: 'lt-db-admin_pass'
diff --git a/hieradata/codfw/profile/openstack/labtestn/pdns.yaml 
b/hieradata/codfw/profile/openstack/labtestn/pdns.yaml
new file mode 100644
index 000..c87356f
--- /dev/null
+++ b/hieradata/codfw/profile/openstack/labtestn/pdns.yaml
@@ -0,0 +1,2 @@
+profile::openstack::labtestn::pdns::db_pass: 'ltn-pdns_db_pass'
+profile::openstack::labtestn::pdns::db_admin_pass: 'ltn-pdns_db_pass'
diff --git a/hieradata/eqiad/profile/openstack/main/pdns.yaml 
b/hieradata/eqiad/profile/openstack/main/pdns.yaml
new file mode 100644
index 000..57066e5
--- /dev/null
+++ b/hieradata/eqiad/profile/openstack/main/pdns.yaml
@@ -0,0 +1,2 @@
+profile::openstack::main::pdns::db_pass: 'ltn-pdns_db_pass'
+profile::openstack::main::pdns::db_admin_pass: 'ltn-db_admin_pass'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7410003a79fce11cb899f314cc48d03b2e833035
Gerrit-PatchSet: 1
Gerrit-Project: labs/private
Gerrit-Branch: master
Gerrit-Owner: Rush 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Add test for Exception Rollback

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381162 )

Change subject: Add test for Exception Rollback
..


Add test for Exception Rollback

Bug: T171349
Change-Id: Ibd08450f1223c12b9e285da944fdfeb3cbd4683d
---
M sites/all/modules/wmf_common/tests/phpunit/WmfTransactionTest.php
1 file changed, 59 insertions(+), 0 deletions(-)

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



diff --git a/sites/all/modules/wmf_common/tests/phpunit/WmfTransactionTest.php 
b/sites/all/modules/wmf_common/tests/phpunit/WmfTransactionTest.php
index b01483c..d884430 100644
--- a/sites/all/modules/wmf_common/tests/phpunit/WmfTransactionTest.php
+++ b/sites/all/modules/wmf_common/tests/phpunit/WmfTransactionTest.php
@@ -111,6 +111,7 @@
 }
 
 function testExistsNone() {
+civicrm_initialize();
 $transaction = WmfTransaction::from_unique_id( 'TEST_GATEWAY ' . 
mt_rand() );
 $this->assertEquals( false, $transaction->exists() );
 }
@@ -159,4 +160,62 @@
 $transaction = WmfTransaction::from_unique_id( 'TEST_GATEWAY ' . 
$gateway_txn_id );
 $transaction->getContribution();
 }
+
+  /**
+   * Test that when an exception is thrown without our wrapper no further 
rollback happens.
+   *
+   * (this is really just the 'control' for the following test.
+   */
+public function testNoRollBack() {
+  civicrm_initialize();
+  CRM_Core_DAO::executeQuery("UPDATE civicrm_domain SET description = 
'WMF'");
+
+  $this->callbackFunction(1);
+
+  $this->assertEquals('Cool planet', 
CRM_Core_DAO::singleValueQuery('SELECT description FROM civicrm_domain LIMIT 
1'));
+  $contact = $this->callAPISuccess('Contact', 'get', 
array('external_identifier' => 'oh so strange'));
+  $this->assertEquals(1, $contact['count']);
+
+  // Cleanup
+  $this->callAPISuccess('Contact', 'delete', array('id' => 
$contact['id']));
+  CRM_Core_DAO::executeQuery("UPDATE civicrm_domain SET description = 
'WMF'");
+}
+
+  /**
+   * Test that when an exception is thrown with our wrapper the whole lot 
rolls back.
+   */
+  public function testFullRollBack() {
+civicrm_initialize();
+CRM_Core_DAO::executeQuery("UPDATE civicrm_domain SET description = 
'WMF'");
+
+try {
+  WmfDatabase::transactionalCall(array($this, 'callbackFunction'), 
array());
+}
+catch (RuntimeException $e) {
+  // We were expecting this :-)
+}
+
+$this->assertEquals('WMF', CRM_Core_DAO::singleValueQuery('SELECT 
description FROM civicrm_domain LIMIT 1'));
+$contact = $this->callAPISuccess('Contact', 'getcount', 
array('external_identifier' => 'oh so strange'));
+$this->assertEquals(0, $contact['count']);
+  }
+
+public function callbackFunction() {
+  CRM_Core_DAO::executeQuery("UPDATE civicrm_domain SET description = 
'Cool planet'");
+  $contact = array(
+'contact_type' => 'Individual',
+'first_name' => 'Dr',
+'last_name' => 'Strange',
+'external_identifier' => 'oh so strange',
+  );
+  $this->callAPISuccess('Contact', 'create', $contact);
+  try {
+civicrm_api3('Contact', 'create', $contact);
+  }
+  catch (Exception $e) {
+// We have done nothing to roll back.
+return;
+  }
+}
+
 }

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

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

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


[MediaWiki-commits] [Gerrit] labs...stewardbots[master]: Update composer.json to use MW_CodeSniffer and fix detected ...

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/380355 )

Change subject: Update composer.json to use MW_CodeSniffer and fix detected 
issues
..


Update composer.json to use MW_CodeSniffer and fix detected issues

Bug: T176635
Change-Id: I0762b400f10d1d8d8d94390bbf363f6cc6b002ff
---
M .gitignore
M Elections/elections.php
M composer.json
M hat-web-tool/delete.php
M hat-web-tool/projects.php
A phpcs.xml
6 files changed, 318 insertions(+), 280 deletions(-)

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



diff --git a/.gitignore b/.gitignore
index a5bb05c..3937ac1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,8 @@
+*.kate-swp
+*~
+.*.swp
+.svn
 /.tox/
+/node_modules/
 /vendor/
-/composer.lock
+composer.lock
\ No newline at end of file
diff --git a/Elections/elections.php b/Elections/elections.php
index edbaacd..bbc14f7 100644
--- a/Elections/elections.php
+++ b/Elections/elections.php
@@ -1,242 +1,243 @@
 https://meta.wikimedia.org/w/api.php'
-. 
'?action=query=php=revisions=content=';
-if ( is_array( $titles ) ) {
-foreach ( $titles as $t ) {
-$URL .= urlencode( $t ) . '|';
-}
-$URL = rtrim( $URL, '|' );
-} else {
-$URL .= urlencode( $titles );
-}
+   $URL = 'https://meta.wikimedia.org/w/api.php'
+   . 
'?action=query=php=revisions=content=';
+   if ( is_array( $titles ) ) {
+   foreach ( $titles as $t ) {
+   $URL .= urlencode( $t ) . '|';
+   }
+   $URL = rtrim( $URL, '|' );
+   } else {
+   $URL .= urlencode( $titles );
+   }
 
-echo "";
-$ch = curl_init( $URL );
-curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
-curl_setopt( $ch, CURLOPT_USERAGENT, 'Toolforge Bot - 
https://tools.wmflabs.org/stewardbots' );
-$result = unserialize( curl_exec( $ch ) );
-curl_close( $ch );
-$resultPages = $result['query']['pages'];
-if ( $resultPages ) {
-$output = [];
-foreach ( $resultPages as $page ) {
-$output[] = [
-'title' => $page['title'],
-'content' => $page['revisions'][0]['*']
-];
-}
-return $output;
-}
+   echo "";
+   $ch = curl_init( $URL );
+   curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
+   curl_setopt( $ch, CURLOPT_USERAGENT, 'Toolforge Bot - 
https://tools.wmflabs.org/stewardbots' );
+   $result = unserialize( curl_exec( $ch ) );
+   curl_close( $ch );
+   $resultPages = $result['query']['pages'];
+   if ( $resultPages ) {
+   $output = [];
+   foreach ( $resultPages as $page ) {
+   $output[] = [
+   'title' => $page['title'],
+   'content' => $page['revisions'][0]['*']
+   ];
+   }
+   return $output;
+   }
 
-return false;
+   return false;
 }
-// To sort the array returned by getPages()
+
+// To sort the array returned by getPages
 function titleSort( $a, $b ) {
-return strnatcasecmp( $a['title'], $b['title'] );
+   return strnatcasecmp( $a['title'], $b['title'] );
 }
 ?>
 http://www.w3.org/TR/html4/loose.dtd;>
 http://www.w3.org/1999/xhtml; xml:lang="en" lang="en" dir="ltr">
 
-Steward elections 2017
-
-
-
-https://tools-static.wmflabs.org/static/jquery/2.1.0/jquery.min.js";>
-https://tools-static.wmflabs.org/static/jquery-tablesorter/2.0.5/jquery.tablesorter.min.js";>
-
-jQuery(document).ready( function() {
-   jQuery('table.sortable').tablesorter();
-} );
-
+   Steward elections 2017
+   
+   
+   
+   https://tools-static.wmflabs.org/static/jquery/2.1.0/jquery.min.js";>
+   https://tools-static.wmflabs.org/static/jquery-tablesorter/2.0.5/jquery.tablesorter.min.js";>
+   
+   jQuery(document).ready( function() {
+  jQuery('table.sortable').tablesorter();
+   } );
+   
 
 
-
-
-Steward elections
-This page contains an unofficial tally of the votes in the 2017 steward 
elections.
+   
+   
+   Steward elections
+   This page contains an unofficial tally of the votes 
in the 2017 steward 
elections.
  60 ) {
-// Cache can be purged only once within a minute
-$useCache = false;
-}
+   $useCache = true;
+   $lastModifiedTime = filemtime( $cacheFile );
+   if ( $_GET['action'] === 'purge' && time() - $lastModifiedTime > 60 ) {
+   // Cache can be purged only once within a minute
+   $useCache = false;
+   }
 }
 
 if ( $useCache ) {
-echo ''
-. 'Using cached data from '
-. strftime( '%H:%M, 

[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: Hygiene: Refactor execute function

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375075 )

Change subject: Hygiene: Refactor execute function
..


Hygiene: Refactor execute function

Trying to make sense of all the commands - the list is extremely
long - as is the execute function.
This refactors execute to 2 private functions
More will follow if this is deemed a good idea.

Change-Id: I3dd4507dcd9d3b350c49f3ee8a8262e4a01f8836
---
M Collection.body.php
1 file changed, 79 insertions(+), 59 deletions(-)

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



diff --git a/Collection.body.php b/Collection.body.php
index a83ca09..00b3255 100644
--- a/Collection.body.php
+++ b/Collection.body.php
@@ -220,42 +220,7 @@
$this->postZIP( $collection, $partner );
return;
case 'save_collection':
-   if ( $request->getVal( 'abort' ) ) {
-   $out->redirect( 
SkinTemplate::makeSpecialUrl( 'Book' ) );
-   return;
-   }
-   if ( !$user->matchEditToken( $request->getVal( 
'token' ) ) ) {
-   return;
-   }
-   $colltype = $request->getVal( 'colltype' );
-   $prefixes = self::getBookPagePrefixes();
-   $title = null;
-   if ( $colltype == 'personal' ) {
-   $collname = $request->getVal( 
'pcollname' );
-   if ( !$user->isAllowed( 
'collectionsaveasuserpage' ) || empty( $collname ) ) {
-   return;
-   }
-   $title = Title::newFromText( 
$prefixes['user-prefix'] . $collname );
-   } elseif ( $colltype == 'community' ) {
-   $collname = $request->getVal( 
'ccollname' );
-   if ( !$user->isAllowed( 
'collectionsaveascommunitypage' ) || empty( $collname ) ) {
-   return;
-   }
-   $title = Title::newFromText( 
$prefixes['community-prefix'] . $collname );
-   }
-   if ( !$title ) {
-   return;
-   }
-   if ( $this->saveCollection( $title, 
$request->getBool( 'overwrite' ) ) ) {
-   $out->redirect( $title->getFullURL() );
-   } else {
-   $this->renderSaveOverwritePage(
-   $colltype,
-   $title,
-   $request->getVal( 'pcollname' ),
-   $request->getVal( 'ccollname' )
-   );
-   }
+   $this->processSaveCollectionCommand();
return;
case 'render':
$this->renderCollection(
@@ -301,29 +266,7 @@
$this->postZIP( 
CollectionSession::getCollection(), $partner );
return;
case 'suggest':
-   $add = $request->getVal( 'add' );
-   $ban = $request->getVal( 'ban' );
-   $remove = $request->getVal( 'remove' );
-   $addselected = $request->getVal( 'addselected' 
);
-
-   if ( $request->getVal( 'resetbans' ) ) {
-   CollectionSuggest::run( 'resetbans' );
-   } elseif ( isset( $add ) ) {
-   CollectionSuggest::run( 'add', $add );
-   } elseif ( isset( $ban ) ) {
-   CollectionSuggest::run( 'ban', $ban );
-   } elseif ( isset( $remove ) ) {
-   CollectionSuggest::run( 'remove', 
$remove );
-   } elseif ( isset( $addselected ) ) {
-   $articleList = $request->getArray( 
'articleList' );
-   if ( !is_null( $articleList ) ) {
-   CollectionSuggest::run( 
'addAll', 

[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Render add discussion button in PHP not JS

2017-09-28 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381315 )

Change subject: Render add discussion button in PHP not JS
..

Render add discussion button in PHP not JS

The talk page JavaScript progressively enhances an
existing button in the page.

Remove the frontend logic and rely entirely on whether
the button is in the page or not.

This was previously done in the client due to the requirement
to only show to users with 5 or more edits, but now the logic
only considers whether they are logged in.

Update tests to reflect that.

Bug: T167728
Change-Id: Iacedea30bdd0775b3d785db5b143abafd7a18b39
---
M includes/skins/SkinMinerva.php
M resources/skins.minerva.talk/init.js
M skin.json
M tests/browser/features/talk.feature
4 files changed, 49 insertions(+), 37 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/15/381315/1

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 2214508..1ca3301 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -993,12 +993,20 @@
 * @param array $talkButton Array with data of desktop talk button
 * @return array
 */
-   protected function getTalkButton( $talkTitle, $talkButton ) {
+   protected function getTalkButton( $talkTitle, $talkButton, $addSection 
= false ) {
+   if ( $addSection ) {
+   $params = [ 'action' => 'edit', 'section' => 'new' ];
+   $className = 'talk continue add';
+   } else {
+   $params = [];
+   $className = 'talk';
+   }
+
return [
'attributes' => [
-   'href' => $talkTitle->getLinkURL(),
+   'href' => $talkTitle->getLinkURL( $params ),
'data-title' => $talkTitle->getFullText(),
-   'class' => 'talk',
+   'class' => $className,
],
'label' => $talkButton['text'],
];
@@ -1037,10 +1045,16 @@
// FIXME [core]: This seems unnecessary..
$subjectId = $title->getNamespaceKey( '' );
$talkId = $subjectId === 'main' ? 'talk' : 
"{$subjectId}_talk";
-   if ( isset( $namespaces[$talkId] ) && 
!$title->isTalkPage() ) {
+
+   if ( isset( $namespaces[$talkId] ) ) {
$talkButton = $namespaces[$talkId];
$talkTitle = $title->getTalkPage();
-   $buttons['talk'] = $this->getTalkButton( 
$talkTitle, $talkButton );
+   if ( $title->isTalkPage() ) {
+   $talkButton['text'] = wfMessage( 
'minerva-talk-add-topic' );
+   $buttons['talk'] = 
$this->getTalkButton( $title, $talkButton, true );
+   } else {
+   $buttons['talk'] = 
$this->getTalkButton( $talkTitle, $talkButton );
+   }
}
}
 
@@ -1264,8 +1278,7 @@
protected function isTalkAllowed() {
$title = $this->getTitle();
return $this->isAllowedPageAction( 'talk' ) &&
-   !$title->isTalkPage() &&
-   $title->canHaveTalkPage() &&
+   ( $title->isTalkPage() || $title->canHaveTalkPage() ) &&
$this->getUser()->isLoggedIn();
}
 
diff --git a/resources/skins.minerva.talk/init.js 
b/resources/skins.minerva.talk/init.js
index 7d8c1d7..c55846b 100644
--- a/resources/skins.minerva.talk/init.js
+++ b/resources/skins.minerva.talk/init.js
@@ -1,15 +1,13 @@
 ( function ( M, $ ) {
var loader = M.require( 'mobile.startup/rlModuleLoader' ),
LoadingOverlay = M.require( 'mobile.startup/LoadingOverlay' ),
-   user = M.require( 'mobile.startup/user' ),
-   Button = M.require( 'mobile.startup/Button' ),
$talk = $( '.talk' ),
// use the plain return value here - T128273
title = $talk.attr( 'data-title' ),
-   page = M.getCurrentPage(),
overlayManager = M.require( 
'skins.minerva.scripts/overlayManager' ),
skin = M.require( 'skins.minerva.scripts/skin' ),
-   pageTitle, talkTitle;
+   inTalkNamespace = false,
+   pageTitle, talkTitle, talkNs, pageNs;
 
// if there's no title for any reason, don't do anything
if ( !title ) {
@@ -25,12 +23,15 @@
// The method to get associated namespaces will change later 

[MediaWiki-commits] [Gerrit] integration/quibble[master]: Switch to wmfreleng/ci-jessie

2017-09-28 Thread Hashar (Code Review)
Hashar has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381312 )

Change subject: Switch to wmfreleng/ci-jessie
..

Switch to wmfreleng/ci-jessie

That let us install zuul via apt-get among other things.
Set DEBIAN_FRONTEND as an ARG so it is not forgotten.
Explode an apt-get to have each package on its own line.

Change-Id: I1c9d0ee13a7cf6a7b36a2d59f798b434814d6bbb
---
M Dockerfile
1 file changed, 11 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/quibble 
refs/changes/12/381312/1

diff --git a/Dockerfile b/Dockerfile
index d37d761..26e187b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,8 @@
-FROM debian:jessie
+FROM wmfreleng/ci-jessie
 
-# Git repositories mirroring to speed up git clone in CI
-RUN apt-get update && apt-get install -y git
+ARG DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get update && apt-get install -y zuul
 
 # CI utilities
 RUN git clone --depth=1 
"https://gerrit.wikimedia.org/r/p/integration/composer; 
"/srv/deployment/integration/composer" && \
@@ -11,8 +12,13 @@
ln -s "/srv/deployment/integration/composer/vendor/bin/composer" 
"/usr/local/bin/composer"
 
 # Mediawiki related dependencies
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server php5 
php5-mysql php5-gd php5-curl djvulibre-bin nodejs-legacy
-
+RUN apt-get install -y \
+mysql-server \
+php5 php5-mysql \
+php5-gd \
+php5-curl \
+djvulibre-bin \
+nodejs-legacy
 # Quibble dependencies
 RUN apt-get install -y \
 python3-pip \
@@ -20,20 +26,6 @@
 python3 \
 python3-dev \
 python-tox
-# Some of Zuul dependencies. Would be better done by install the zuul.deb 
package from apt.wikimedia.org
-RUN apt-get install -y \
-python3-pbr \
-python3-yaml \
-python3-paste \
-python3-webob \
-python3-paramiko \
-python3-prettytable \
-python3-extras \
-python3-voluptuous \
-python3-six \
-python3-tz \
-python3-docutils \
-python3-babel
 
 COPY . /opt/quibble
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c9d0ee13a7cf6a7b36a2d59f798b434814d6bbb
Gerrit-PatchSet: 1
Gerrit-Project: integration/quibble
Gerrit-Branch: master
Gerrit-Owner: Hashar 

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


[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: CRM-21224 reinstate use of limit on dedupe searches

2017-09-28 Thread Eileen (Code Review)
Eileen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381311 )

Change subject: CRM-21224 reinstate use of limit on dedupe searches
..

CRM-21224 reinstate use of limit on dedupe searches

https://github.com/civicrm/civicrm-core/pull/11030

I'm not sure this is the last we'll hear of this but I'm sure this is at
least part of the fix

Bug: T175382
Change-Id: Ice270d01d8d9033ff9db3f18c1762544b8bfaa79
---
M CRM/Contact/Page/DedupeFind.php
M CRM/Core/BAO/PrevNextCache.php
M CRM/Dedupe/Finder.php
M CRM/Dedupe/Merger.php
4 files changed, 28 insertions(+), 15 deletions(-)


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

diff --git a/CRM/Contact/Page/DedupeFind.php b/CRM/Contact/Page/DedupeFind.php
index decfdbc..41fa2ea 100644
--- a/CRM/Contact/Page/DedupeFind.php
+++ b/CRM/Contact/Page/DedupeFind.php
@@ -157,7 +157,7 @@
 CRM_Dedupe_Merger::resetMergeStats($cacheKeyString);
   }
 
-  $this->_mainContacts = CRM_Dedupe_Merger::getDuplicatePairs($rgid, $gid, 
!$isConflictMode, 0, $isConflictMode, '', $isConflictMode, $criteria, TRUE);
+  $this->_mainContacts = CRM_Dedupe_Merger::getDuplicatePairs($rgid, $gid, 
!$isConflictMode, 0, $isConflictMode, '', $isConflictMode, $criteria, TRUE, 
$limit);
 
   if (empty($this->_mainContacts)) {
 if ($isConflictMode) {
diff --git a/CRM/Core/BAO/PrevNextCache.php b/CRM/Core/BAO/PrevNextCache.php
index a3d6f44..0eab40d 100644
--- a/CRM/Core/BAO/PrevNextCache.php
+++ b/CRM/Core/BAO/PrevNextCache.php
@@ -366,11 +366,16 @@
* @param bool $checkPermissions
*   Respect logged in user's permissions.
*
+   * @param int $searchLimit
+   *  Limit for the number of contacts to be used for comparison.
+   *  The search methodology finds all matches for the searchedContacts so 
this limits
+   *  the number of searched contacts, not the matches found.
+   *
* @return bool
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
-  public static function refillCache($rgid, $gid, $cacheKeyString, $criteria, 
$checkPermissions) {
+  public static function refillCache($rgid, $gid, $cacheKeyString, $criteria, 
$checkPermissions, $searchLimit = 0) {
 if (!$cacheKeyString && $rgid) {
   $cacheKeyString = CRM_Dedupe_Merger::getMergeCacheKeyString($rgid, $gid, 
$criteria, $checkPermissions);
 }
@@ -389,7 +394,7 @@
 // 2. FILL cache
 $foundDupes = array();
 if ($rgid && $gid) {
-  $foundDupes = CRM_Dedupe_Finder::dupesInGroup($rgid, $gid);
+  $foundDupes = CRM_Dedupe_Finder::dupesInGroup($rgid, $gid, $searchLimit);
 }
 elseif ($rgid) {
   $contactIDs = array();
@@ -397,7 +402,7 @@
 $contacts = civicrm_api3('Contact', 'get', array_merge(array('options' 
=> array('limit' => 0), 'return' => 'id'), $criteria['contact']));
 $contactIDs = array_keys($contacts['values']);
   }
-  $foundDupes = CRM_Dedupe_Finder::dupes($rgid, $contactIDs, 
$checkPermissions);
+  $foundDupes = CRM_Dedupe_Finder::dupes($rgid, $contactIDs, 
$checkPermissions, $searchLimit);
 }
 
 if (!empty($foundDupes)) {
diff --git a/CRM/Dedupe/Finder.php b/CRM/Dedupe/Finder.php
index 4504447..aa092e4 100644
--- a/CRM/Dedupe/Finder.php
+++ b/CRM/Dedupe/Finder.php
@@ -51,9 +51,10 @@
* @param bool $checkPermissions
*   Respect logged in user permissions.
*
-   * @param int $limit
-   *   Optional limit. This limits the number of contacts for which the code 
will
-   *   attempt to find matches.
+   * @param int $searchLimit
+   *  Limit for the number of contacts to be used for comparison.
+   *  The search methodology finds all matches for the searchedContacts so 
this limits
+   *  the number of searched contacts, not the matches found.
*
* @return array
*   Array of (cid1, cid2, weight) dupe triples
@@ -61,18 +62,18 @@
* @throws CiviCRM_API3_Exception
* @throws Exception
*/
-  public static function dupes($rgid, $cids = array(), $checkPermissions = 
TRUE, $limit = NULL) {
+  public static function dupes($rgid, $cids = array(), $checkPermissions = 
TRUE, $searchLimit = 0) {
 $rgBao = new CRM_Dedupe_BAO_RuleGroup();
 $rgBao->id = $rgid;
 $rgBao->contactIds = $cids;
 if (!$rgBao->find(TRUE)) {
   CRM_Core_Error::fatal("Dedupe rule not found for selected contacts");
 }
-if (empty($rgBao->contactIds) && !empty($limit)) {
+if (empty($rgBao->contactIds) && !empty($searchLimit)) {
   $limitedContacts = civicrm_api3('Contact', 'get', array(
 'return' => 'id',
 'contact_type' => $rgBao->contact_type,
-'options' => array('limit' => $limit),
+'options' => array('limit' => $searchLimit),
   ));
   $rgBao->contactIds = array_keys($limitedContacts['values']);
 }
@@ -167,12 +168,16 @@
* @param int $gid
*   Contact group id (currently, works 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make the RC/Watchlist legend not jump when initially collapsed

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381151 )

Change subject: Make the RC/Watchlist legend not jump when initially collapsed
..


Make the RC/Watchlist legend not jump when initially collapsed

Look at the collapsed/expanded cookie and add class="mw-collapsed"
if it's going to be collapsed.

This is kind of a prelude to T42812.

Change-Id: Icaca762a9d7b000c973d9275f395623129f67979
---
M includes/specialpage/ChangesListSpecialPage.php
M resources/src/mediawiki.special/mediawiki.special.changeslist.css
2 files changed, 8 insertions(+), 1 deletion(-)

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



diff --git a/includes/specialpage/ChangesListSpecialPage.php 
b/includes/specialpage/ChangesListSpecialPage.php
index 88ec327..dcd14e8 100644
--- a/includes/specialpage/ChangesListSpecialPage.php
+++ b/includes/specialpage/ChangesListSpecialPage.php
@@ -1467,8 +1467,10 @@
$context->msg( 'recentchanges-legend-heading' 
)->parse();
 
# Collapsible
+   $collapsedState = $this->getRequest()->getCookie( 
'changeslist-state' );
+   $collapsedClass = $collapsedState === 'collapsed' ? ' 
mw-collapsed' : '';
$legend =
-   '' .
+   '' .
$legendHeading .
'' . 
$legend . '' .
'';
diff --git a/resources/src/mediawiki.special/mediawiki.special.changeslist.css 
b/resources/src/mediawiki.special/mediawiki.special.changeslist.css
index 3e1bd4e..532ca86 100644
--- a/resources/src/mediawiki.special/mediawiki.special.changeslist.css
+++ b/resources/src/mediawiki.special/mediawiki.special.changeslist.css
@@ -39,3 +39,8 @@
unicode-bidi: -moz-isolate;
unicode-bidi: isolate;
 }
+
+/* Prevent FOUC if legend is initially collapsed */
+.mw-changeslist-legend.mw-collapsed .mw-collapsible-content {
+   display: none;
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icaca762a9d7b000c973d9275f395623129f67979
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Sbisson 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Use BagOfStuff::makeKey() instead of deprecated wfM...

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375424 )

Change subject: Hygiene: Use BagOfStuff::makeKey() instead of deprecated 
wfMemcKey()
..


Hygiene: Use BagOfStuff::makeKey() instead of deprecated wfMemcKey()

Change-Id: I13c619ab4aedc9f9d4208ba62098cb27b41c283e
---
M includes/api/ApiMobileView.php
M includes/diff/InlineDifferenceEngine.php
2 files changed, 23 insertions(+), 7 deletions(-)

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



diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php
index 8234f93..a19df63 100644
--- a/includes/api/ApiMobileView.php
+++ b/includes/api/ApiMobileView.php
@@ -530,11 +530,11 @@
 * @return array
 */
private function getData( Title $title, $noImages, $oldid = null ) {
+   global $wgMemc;
+
$mfConfig = MobileContext::singleton()->getMFConfig();
$mfMinCachedPageSize = $mfConfig->get( 'MFMinCachedPageSize' );
$mfSpecialCaseMainPage = $mfConfig->get( 
'MFSpecialCaseMainPage' );
-
-   global $wgMemc;
 
$result = $this->getResult();
$wp = $this->makeWikiPage( $title );
@@ -563,8 +563,16 @@
$touched = $wp->getTouched();
$revId = $oldid ? $oldid : $title->getLatestRevID();
if ( $this->file ) {
-   $key = wfMemcKey( 'mf', 'mobileview', 
self::CACHE_VERSION, $noImages,
-   $touched, $this->noTransform, 
$this->file->getSha1(), $this->variant );
+   $key = $wgMemc->makeKey(
+   'mf',
+   'mobileview',
+   self::CACHE_VERSION,
+   $noImages,
+   $touched,
+   $this->noTransform,
+   $this->file->getSha1(),
+   $this->variant
+   );
$cacheExpiry = 3600;
} else {
if ( !$latest ) {
@@ -575,7 +583,7 @@
$parserOptions = $this->makeParserOptions( $wp );
$parserCacheKey = 
\MediaWiki\MediaWikiServices::getInstance()->getParserCache()->getKey( $wp,
$parserOptions );
-   $key = wfMemcKey(
+   $key = $wgMemc->makeKey(
'mf',
'mobileview',
self::CACHE_VERSION,
diff --git a/includes/diff/InlineDifferenceEngine.php 
b/includes/diff/InlineDifferenceEngine.php
index 2354819..a32ddc5 100644
--- a/includes/diff/InlineDifferenceEngine.php
+++ b/includes/diff/InlineDifferenceEngine.php
@@ -206,12 +206,20 @@
 * @return string
 */
protected function getDiffBodyCacheKey() {
+   global $wgMemc;
if ( !$this->mOldid || !$this->mNewid ) {
throw new Exception( 'mOldid and mNewid must be set to 
get diff cache key.' );
}
 
-   return wfMemcKey( 'diff', 'inline', self::DIFF_VERSION,
-   'oldid', $this->mOldid, 'newid', $this->mNewid );
+   return $wgMemc->makeKey(
+   'diff',
+   'inline',
+   self::DIFF_VERSION,
+   'oldid',
+   $this->mOldid,
+   'newid',
+   $this->mNewid
+   );
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I13c619ab4aedc9f9d4208ba62098cb27b41c283e
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Pmiazga 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Pmiazga 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: Start migration off $wgExperimentalHtmlIds

2017-09-28 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381301 )

Change subject: Start migration off $wgExperimentalHtmlIds
..

Start migration off $wgExperimentalHtmlIds

It's deprecated and will die.
Stage 1: retain old style IDs but populate parser
cache with new style fallbacks.

Change-Id: I431d0ade0b0c44365077fb5365a25cedfb8f9114
---
M TranslatewikiSettings.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/01/381301/1

diff --git a/TranslatewikiSettings.php b/TranslatewikiSettings.php
index 8370172..ebb754d 100644
--- a/TranslatewikiSettings.php
+++ b/TranslatewikiSettings.php
@@ -20,7 +20,9 @@
 /**
  * Experimentalism
  */
-$wgExperimentalHtmlIds = true;
+// Migrate off $wgExperimentalHtmlIds
+$wgFragmentMode = [ 'html5-legacy', 'html5' ];
+
 $wgAllUnicodeFixes = true;
 $wgDevelopmentWarnings = true;
 $wgResourceLoaderStorageEnabled = true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I431d0ade0b0c44365077fb5365a25cedfb8f9114
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...UserMerge[master]: Update UserMerge log messages

2017-09-28 Thread MarcoAurelio (Code Review)
MarcoAurelio has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381298 )

Change subject: Update UserMerge log messages
..

Update UserMerge log messages

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


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

diff --git a/i18n/en.json b/i18n/en.json
index 87affa0..6ad4662 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -16,16 +16,16 @@
"usermerge-submit": "Merge user",
"usermerge-badtoken": "Invalid edit token.",
"usermerge-userdeleted": "{{GENDER:$1|$1}} ($2) has been deleted.",
-   "usermerge-userdeleted-log": "Deleted user: $2 ($3)",
+   "usermerge-userdeleted-log": "deleted the {{GENDER:$2|user}} account $2 
($3)",
"usermerge-success": "Merge from {{GENDER:$1|$1}} ($2) to 
{{GENDER:$3|$3}} ($4) is complete.",
-   "usermerge-success-log": "User {{GENDER:$2|$2}} ($3) merged to 
{{GENDER:$4|$4}} ($5)",
+   "usermerge-success-log": "merged {{GENDER:$2|user}} account \"$2\" ($3) 
into \"[[User:$4|$4]]\" ($5)",
"usermerge-logpage": "User merge log",
"usermerge-logpagetext": "This is a log of user merge actions.",
"usermerge-noselfdelete": "You cannot delete or merge from 
{{GENDER:$1|yourself}}!",
"usermerge-protectedgroup": "Unable to merge from {{GENDER:$1|user}}: 
User is in a protected group.",
"right-usermerge": "Merge users",
"action-usermerge": "merge users",
-   "usermerge-autopagedelete": "Automatically deleted when merging users",
+   "usermerge-autopagedelete": "Automatically deleted page while merging 
users",
"usermerge-page-unmoved": "The page $1 could not be moved to $2.",
-   "usermerge-move-log": "Automatically moved page while merging the user 
\"[[User:$1|$1]]\" to \"[[User:$2|{{GENDER:$2|$2}}]]\""
+   "usermerge-move-log": "Automatically moved page while merging the 
{{GENDER:$1|user}} account \"$1\" to \"[[User:$2|$2]]\""
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I99208c1cf3ba724db53430efbb7639d84fd0fb4d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UserMerge
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio 

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Fix: Deep link feature for non /wiki/ URL

2017-09-28 Thread Cooltey (Code Review)
Cooltey has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381297 )

Change subject: Fix: Deep link feature for non /wiki/ URL
..

Fix: Deep link feature for non /wiki/ URL

In this update:
 - Add an intent-filter for non /wiki/ URL.
 - Handle the variant from deep link URL, and setup the Header based on it.

For people who would like to do the test, please check the Phabricator task 
below.

Bug: T176909, T137039
Change-Id: I13d64873ba615f7c7ab279e2f199c8fa538f4039
---
M app/src/main/AndroidManifest.xml
M app/src/main/java/org/wikipedia/dataclient/WikiSite.java
M app/src/main/java/org/wikipedia/dataclient/okhttp/OkHttpWebViewClient.java
M app/src/main/java/org/wikipedia/dataclient/retrofit/RetrofitFactory.java
M app/src/main/java/org/wikipedia/util/L10nUtil.java
M app/src/main/java/org/wikipedia/util/UriUtil.java
6 files changed, 35 insertions(+), 8 deletions(-)


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

diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 0acb712..22e0c23 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -103,6 +103,8 @@
 
 
 
+
+
 
 
 
diff --git a/app/src/main/java/org/wikipedia/dataclient/WikiSite.java 
b/app/src/main/java/org/wikipedia/dataclient/WikiSite.java
index 909d1d5..0320580 100644
--- a/app/src/main/java/org/wikipedia/dataclient/WikiSite.java
+++ b/app/src/main/java/org/wikipedia/dataclient/WikiSite.java
@@ -55,6 +55,7 @@
 // todo: remove @SerializedName. this is now in the TypeAdapter and a 
"uri" case may be added
 @SerializedName("domain") @NonNull private final Uri uri;
 @NonNull private final String languageCode; // possibly empty
+@NonNull private String internalLinkLanguageCode; // for url
 
 /**
  * @return True if the authority is supported by the app.
@@ -205,6 +206,11 @@
 return languageCode;
 }
 
+@NonNull
+public String internalLinkLanguageCode() {
+return internalLinkLanguageCode;
+}
+
 // TODO: this method doesn't have much to do with WikiSite. Move to 
PageTitle?
 /**
  * Create a PageTitle object from an internal link string.
@@ -214,7 +220,8 @@
  * @return A {@link PageTitle} object representing the internalLink passed 
in.
  */
 public PageTitle titleForInternalLink(String internalLink) {
-// FIXME: Handle language variant links properly
+// Handle language variants on non /wiki/ site.
+internalLinkLanguageCode = 
UriUtil.getLanguageCodeFromUrl(internalLink);
 // Strip the /wiki/ from the href
 return new PageTitle(UriUtil.removeInternalLinkPrefix(internalLink), 
this);
 }
diff --git 
a/app/src/main/java/org/wikipedia/dataclient/okhttp/OkHttpWebViewClient.java 
b/app/src/main/java/org/wikipedia/dataclient/okhttp/OkHttpWebViewClient.java
index 6949f73..cd99585 100644
--- a/app/src/main/java/org/wikipedia/dataclient/okhttp/OkHttpWebViewClient.java
+++ b/app/src/main/java/org/wikipedia/dataclient/okhttp/OkHttpWebViewClient.java
@@ -12,8 +12,8 @@
 import android.webkit.WebViewClient;
 
 import org.apache.commons.lang3.StringUtils;
-import org.wikipedia.WikipediaApp;
 import org.wikipedia.dataclient.WikiSite;
+import org.wikipedia.util.L10nUtil;
 import org.wikipedia.util.log.L;
 
 import java.io.BufferedReader;
@@ -91,7 +91,7 @@
 return OkHttpConnectionFactory.getClient().newCall(new 
Request.Builder()
 .url(url)
 // TODO: Find a common way to set this header between here and 
RetrofitFactory.
-.header("Accept-Language", 
WikipediaApp.getInstance().getAcceptLanguage(getWikiSite()))
+.header("Accept-Language", 
L10nUtil.getAcceptLanguageCode(getWikiSite()))
 .build())
 .execute();
 }
diff --git 
a/app/src/main/java/org/wikipedia/dataclient/retrofit/RetrofitFactory.java 
b/app/src/main/java/org/wikipedia/dataclient/retrofit/RetrofitFactory.java
index 7c3f09d..a6a1e74 100644
--- a/app/src/main/java/org/wikipedia/dataclient/retrofit/RetrofitFactory.java
+++ b/app/src/main/java/org/wikipedia/dataclient/retrofit/RetrofitFactory.java
@@ -2,10 +2,10 @@
 
 import android.support.annotation.NonNull;
 
-import org.wikipedia.WikipediaApp;
 import org.wikipedia.dataclient.WikiSite;
 import org.wikipedia.dataclient.okhttp.OkHttpConnectionFactory;
 import org.wikipedia.json.GsonUtil;
+import org.wikipedia.util.L10nUtil;
 
 import java.io.IOException;
 
@@ -42,7 +42,7 @@
 public Response intercept(Interceptor.Chain chain) throws IOException {
 Request request = chain.request();
 request = request.newBuilder()
-.header("Accept-Language", 

[MediaWiki-commits] [Gerrit] operations...tools-webservice[master]: Explaination of what scripts/webservice does when a user run...

2017-09-28 Thread Mridubhatnagar (Code Review)
Mridubhatnagar has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381296 )

Change subject: Explaination of what scripts/webservice does when a user runs 
it as: webservice --backend kubernetes start webservice --backend kubernetes 
stop Along with this the file contains line by line explaination of source code 
present in scripts/webservice.
..

Explaination of what scripts/webservice does when a user runs it as:
webservice --backend kubernetes start
webservice --backend kubernetes stop
Along with this the file contains line by line explaination of
source code present in scripts/webservice.

Change-Id: I537663a2c92a725eccee4448d8f772f6fc619fb3
---
A Outreachy-task.mridub.txt
1 file changed, 259 insertions(+), 0 deletions(-)


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

diff --git a/Outreachy-task.mridub.txt b/Outreachy-task.mridub.txt
new file mode 100644
index 000..a9b05b2
--- /dev/null
+++ b/Outreachy-task.mridub.txt
@@ -0,0 +1,259 @@
+Microtask for Outreachy Round 15
+
+*Read over the source code and try to understand what scripts/webservice does 
when a user runs it as:
+ -webservice --backend kubernetes start
+ -webservice --backend kubernetes stop
+
+
+Line 65 if __name__ == '__main__':
+   Signifies that file script/webservice must be run from the python 
interpreter directly and must not be
+   imported.
+
+Line 66 log_command_invocation('webservice', ' '.join(sys.argv))
+Function call is made to log_command_invocation(commandname, commandline)
+commandname - 'webservice'
+commandline - ' '.join(sys.argv)
+ 
+tools-webservice/toollabs/common/el.py - file path where 
log_command_invocation is defined.
+   
+log_command_invocation(commandname, commandline)- in this method username 
and hostname are setup. 
+This queries the  user by userid. 
+
+a) os.getuid() - returns the userid.(Integer)
+b) pwd.getpwd(uid) - returns (pwd_name, pw_passwd, pw_uid, pw_gid, 
pw_gecos, pw_dir, pw_shell)
+   password database entry for numeric user ID.
+   example: 
+   pw_name='mridu'(username)
+   pw_passwd = 'X'
+   pw_uid = 1000
+   pw_gid = 1000
+   pw_gecos = 'Mridu,,,'
+   pw_dir = '/home/mridu'
+   pw_shell = '/bin/bash'
+   
+   username = pwd.getpwuid(os.getuid()).pw_name  # Sets username to mridu
+   hostname = socket.getfqdn() # returns a domain name for name. Incase 
the name is empty, it is interpreted as localhost.
+   event variable is assigned a dictionary. Dictionary consists of keys 
like username, commandname, commandline, hostname, 
+   parentcommandline. 
+
+ Once the command is invoked. Logging of events takes place. And method 
log_event(schema, rev_id, wiki, event) is called.
+ 
+ schema - 'CommandInvocation'
+ rev_id - 15243810
+ wiki - 'metawiki'
+ event - event ( dictionary consisting of username,hostname,commandname, 
commandline)
+ Events are sent to the client-side Event logging endpoint. 
+ 
+ URL = 'https://meta.wikimedia.org/beacon/event'
+
+ A valid url is assigned to variable url. 
+ a)url = "%s?%s" % (URL, urllib.quote_plus(json.dumps(payload)))
+   urllib.quote_plus(string, safe='') - Replaces ' '(space) with a '+'. 
Example urllib.quote_plus(' connolly') would return '+connolly'.
+ 
+ b)urllib2.urlopen(url).read() # fetches the data present in the url. 
fetched data is string.
+ 
+Line 67 args = argparser.parse_args()
+  Argument parser parses the arguments through parse_args(). The arguments 
that are added to be parsed include 
+  type - type of webservice to start.
+  backend - Which cluster backend to use run the webservice. Ex - 
gridengine or kubernetes
+  action - Action to perform. Ex - start, stop, shell etc
+  extra_args- extra arguments are optional.
+  release -
+  Once the arguments are parsed. They can be accessed as args.type, 
args.backend, args.action, args.release etc.
+
+Line 69 tool = Tool.from_currentuser()
+Creates a tools instance from the current running user. 
+pwd_entry = pwd.getpwuid(os.geteuid())
+from_currentuser() method consists of details of the user. pwd_entry 
will have (pw_name, pw_passwd, pw_uid, pw_gid, pw_gecos, pw_dir,
+pw_shell)
+Example:
+pw_name='mridu'(username)
+pw_passwd = 'X'
+pw_uid = 1000
+pw_gid = 1000
+pw_gecos = 'Mridu,,,'
+pw_dir = '/home/mridu'
+pw_shell = '/bin/bash'
+This method returns Tool.from_pwd(pwd_entry). from_pwd(pwd_entry) 
method gets called. 
+
+a) from_pwd(pwd_entry)
+   Creates tool instance from a given pwd entry.
+   If pw_name does not start with Tools.PREFIX--->'tools.'. Invalid 
tool exception will be raised. If userid is less than 50,000
+   

  1   2   3   4   >