[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix code style between "

2016-11-17 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review.

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

Change subject: Fix code style between "https://gerrit.wikimedia.org/r/322237
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac0b3673877086f7bf3427a412dfe4256be5ff17
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) 

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


[MediaWiki-commits] [Gerrit] integration/config[master]: Notify wikidata-monitoring on WIkibase browsertest failures

2016-11-17 Thread Tobias Gritschacher (Code Review)
Tobias Gritschacher has uploaded a new change for review.

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

Change subject: Notify wikidata-monitoring on WIkibase browsertest failures
..

Notify wikidata-monitoring on WIkibase browsertest failures

per T150856.

Bug: T150856
Change-Id: Ifd0965938617af48d7d10fd21b1fa07a65a47ac1
---
M jjb/selenium.yaml
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/82/322082/1

diff --git a/jjb/selenium.yaml b/jjb/selenium.yaml
index 39c9d7c..887cbab 100644
--- a/jjb/selenium.yaml
+++ b/jjb/selenium.yaml
@@ -120,7 +120,8 @@
 
 - project:
 name: Wikibase
-recipients: qa-ale...@lists.wikimedia.org tobias.gritschac...@wikimedia.de 
# @Tobi_WMDE_SW #wikidata
+# recipients: @Tobi_WMDE_SW, @hoo, @aude, @Lydia_Pintscher, @Addshore
+recipients: qa-ale...@lists.wikimedia.org wikidata-monitor...@wikimedia.de 
# wikidata
 repository: mediawiki/extensions/Wikibase
 
 jobs:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd0965938617af48d7d10fd21b1fa07a65a47ac1
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher 
Gerrit-Reviewer: Addshore 
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...EmailAuth[master]: Fix CI errors + code review issues

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

Change subject: Fix CI errors + code review issues
..


Fix CI errors + code review issues

Change-Id: Ie20b8bf2de5cb6ee56099318212f036cfd7ac91c
---
D README.md
M includes/EmailAuthSecondaryAuthenticationProvider.php
M includes/Hooks.php
M tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php
4 files changed, 7 insertions(+), 26 deletions(-)

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



diff --git a/README.md b/README.md
deleted file mode 100644
index c973562..000
--- a/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-This is a blank extension template. It doesn't really do anything on its own.
-It is intended to provide a boiler template for an actual MediaWiki extension.
-
-If you are checking this out from Git and intend to use it, you may use the
-following commands to make a clean directory of just this template without the
-Git meta-data and other examples.
-
-   cd extensions
-   git clone 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/BoilerPlate.git
-   cp -R BoilerPlate ./MyExtension
-
-This automates the recommended code checkers for PHP and JavaScript code in 
Wikimedia projects
-(see https://www.mediawiki.org/wiki/Continuous_integration/Entry_points).
-To take advantage of this automation.
-  # install nodejs, npm, and PHP composer
-  # change to the extension's directory
-  # npm install
-  # composer install
-
-Once set up, running `npm test` and `composer test` will run automated code 
checks.
diff --git a/includes/EmailAuthSecondaryAuthenticationProvider.php 
b/includes/EmailAuthSecondaryAuthenticationProvider.php
index 543266d..f3c55f1 100644
--- a/includes/EmailAuthSecondaryAuthenticationProvider.php
+++ b/includes/EmailAuthSecondaryAuthenticationProvider.php
@@ -54,7 +54,7 @@
'ip' => $user->getRequest()->getIP(),
] );
return AuthenticationResponse::newPass();
-   } else if ( $req && $req->token ) {
+   } elseif ( $req && $req->token ) {
// do not log if the code is simply missing - 
accidental enter or confused bot
LoggerFactory::getInstance( 'EmailAuth' )->info( 
'Failed verification for {user}', [
'user' => $user->getName(),
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 898075b..429d765 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -8,7 +8,9 @@
public static function onAuthChangeFormFields(
array $requests, array $fieldInfo, array &$formDescriptor, 
$action
) {
-   if ( AuthenticationRequest::getRequestByClass( $requests, 
EmailAuthAuthenticationRequest::class ) ) {
+   if ( AuthenticationRequest::getRequestByClass( $requests,
+   EmailAuthAuthenticationRequest::class )
+   ) {
$formDescriptor['token'] += [
'size' => 6,
'autofocus' => true,
diff --git a/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php 
b/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php
index c687d1d..635376e 100644
--- a/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php
+++ b/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php
@@ -22,10 +22,11 @@
/** @var LoggerInterface|PHPUnit_Framework_MockObject_MockObject */
protected $logger;
 
-   public function setUp() {
+   protected function setUp() {
parent::setUp();
 
-   $this->setTemporaryHook( 'EmailAuthRequireToken', function () 
{} );
+   $this->setTemporaryHook( 'EmailAuthRequireToken', function () {
+   } );
 
$this->provider = new 
EmailAuthSecondaryAuthenticationProvider();
 
@@ -44,8 +45,6 @@
return $this->session->get( $key );
} );
$this->provider->setManager( $this->manager );
-
-   return $this->provider;
}
 
public function testGetAuthenticationRequests() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie20b8bf2de5cb6ee56099318212f036cfd7ac91c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EmailAuth
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Gergő Tisza 
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...CirrusSearch[master]: Remove unused imports and unused code

2016-11-17 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review.

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

Change subject: Remove unused imports and unused code
..

Remove unused imports and unused code

Change-Id: I2cf48f01a01a4034639a3fec47ba180508ece85d
---
M includes/Api/SuggestIndex.php
M includes/BuildDocument/RedirectsAndIncomingLinks.php
M includes/DataSender.php
M includes/InterwikiSearcher.php
M includes/LanguageDetector/Detector.php
M includes/Maintenance/MappingConfigBuilder.php
M includes/Query/FileNumericFeature.php
M includes/Query/FileTypeFeature.php
M includes/RequestLogger.php
M includes/Sanity/Checker.php
M includes/Search/BooleanIndexField.php
M includes/Search/CirrusIndexField.php
M includes/Search/DatetimeIndexField.php
M includes/Search/Filters.php
M includes/Search/IntegerIndexField.php
M includes/Search/KeywordIndexField.php
M includes/Search/NestedIndexField.php
M includes/Search/NumberIndexField.php
M includes/Search/OpeningTextIndexField.php
A includes/Search/SearchTextQueryBuilders.php
M includes/Search/ShortTextIndexField.php
M includes/Search/SourceTextIndexField.php
M includes/Search/TextIndexField.php
M includes/Searcher.php
M includes/SiteMatrixInterwikiResolver.php
M maintenance/dumpIndex.php
M maintenance/saneitizeJobs.php
M maintenance/updateOneSearchIndexConfig.php
M maintenance/updateVersionIndex.php
M tests/jenkins/Jenkins.php
M tests/unit/ConnectionTest.php
M tests/unit/HooksTest.php
M tests/unit/InterwikiSearcherTest.php
M tests/unit/Maintenance/AnalysisConfigBuilderTest.php
M tests/unit/Query/GeoFeatureTest.php
M tests/unit/RequestLoggerTest.php
M tests/unit/UtilTest.php
37 files changed, 225 insertions(+), 37 deletions(-)


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

diff --git a/includes/Api/SuggestIndex.php b/includes/Api/SuggestIndex.php
index 8bd005f..31fe236 100644
--- a/includes/Api/SuggestIndex.php
+++ b/includes/Api/SuggestIndex.php
@@ -1,4 +1,5 @@
 getBacklinkCache()
->getLinks( 'redirect', false, false, 
$wgCirrusSearchIndexedRedirects );
$redirects = [];
+   /** @var Title $redirect */
foreach ( $redirectTitles as $redirect ) {
// If the redirect is in main OR the same namespace as 
the article the index it
if ( $redirect->getNamespace() === NS_MAIN || 
$redirect->getNamespace() === $title->getNamespace()) {
diff --git a/includes/DataSender.php b/includes/DataSender.php
index 034b299..12ec9dd 100644
--- a/includes/DataSender.php
+++ b/includes/DataSender.php
@@ -305,7 +305,7 @@
'send_data_other_idx_write'
) );
$bulk->send();
-   } catch ( \Elastica\Exception\Bulk\ResponseException $e 
) {
+   } catch ( ResponseException $e ) {
if ( 
!$this->bulkResponseExceptionIsJustDocumentMissing( $e ) ) {
$exception = $e;
}
diff --git a/includes/InterwikiSearcher.php b/includes/InterwikiSearcher.php
index 07f9bf4..2f3ea45 100644
--- a/includes/InterwikiSearcher.php
+++ b/includes/InterwikiSearcher.php
@@ -4,9 +4,7 @@
 
 use CirrusSearch\Search\InterwikiResultsType;
 use CirrusSearch\Search\ResultSet;
-use ObjectCache;
 use SpecialPageFactory;
-use Title;
 use User;
 
 /**
@@ -32,11 +30,6 @@
 * @var int Max number of results to fetch from other wiki
 */
const MAX_RESULTS = 5;
-
-   /**
-* @var string interwiki prefix
-*/
-   private $interwiki;
 
/**
 * @var bool Is the interwiki load test configured?
diff --git a/includes/LanguageDetector/Detector.php 
b/includes/LanguageDetector/Detector.php
index 2493578..3cd705b 100644
--- a/includes/LanguageDetector/Detector.php
+++ b/includes/LanguageDetector/Detector.php
@@ -1,4 +1,5 @@
 checkExisitingPage( $docId, 
$pageId, $page, $fromIndex );
diff --git a/includes/Search/BooleanIndexField.php 
b/includes/Search/BooleanIndexField.php
index 1a01edf..8e6a13d 100644
--- a/includes/Search/BooleanIndexField.php
+++ b/includes/Search/BooleanIndexField.php
@@ -1,4 +1,5 @@
 addMust( $must );
}
diff --git a/includes/Search/IntegerIndexField.php 
b/includes/Search/IntegerIndexField.php
index 748a94f..592e619 100644
--- a/includes/Search/IntegerIndexField.php
+++ b/includes/Search/IntegerIndexField.php
@@ -1,4 +1,5 @@
 http://www.gnu.org/copyleft/gpl.html
+ */
+
+/**
+ * Factory of SearchTextQueryBuilder.
+ * Maintains all the SearchTextQueryBuilder designed to
+ * write the main full text query.
+ */
+class SearchTextQueryBuilderFactory {
+   /**
+* @var SearchTextQueryBuilder[]
+*/
+   private $builders = array();
+
+   /**
+* @var 

[MediaWiki-commits] [Gerrit] mediawiki...EmailAuth[master]: Fix CI errors + code review issues

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

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

Change subject: Fix CI errors + code review issues
..

Fix CI errors + code review issues

Change-Id: Ie20b8bf2de5cb6ee56099318212f036cfd7ac91c
---
D README.md
M includes/EmailAuthSecondaryAuthenticationProvider.php
M includes/Hooks.php
M tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php
4 files changed, 7 insertions(+), 26 deletions(-)


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

diff --git a/README.md b/README.md
deleted file mode 100644
index c973562..000
--- a/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-This is a blank extension template. It doesn't really do anything on its own.
-It is intended to provide a boiler template for an actual MediaWiki extension.
-
-If you are checking this out from Git and intend to use it, you may use the
-following commands to make a clean directory of just this template without the
-Git meta-data and other examples.
-
-   cd extensions
-   git clone 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/BoilerPlate.git
-   cp -R BoilerPlate ./MyExtension
-
-This automates the recommended code checkers for PHP and JavaScript code in 
Wikimedia projects
-(see https://www.mediawiki.org/wiki/Continuous_integration/Entry_points).
-To take advantage of this automation.
-  # install nodejs, npm, and PHP composer
-  # change to the extension's directory
-  # npm install
-  # composer install
-
-Once set up, running `npm test` and `composer test` will run automated code 
checks.
diff --git a/includes/EmailAuthSecondaryAuthenticationProvider.php 
b/includes/EmailAuthSecondaryAuthenticationProvider.php
index 543266d..f3c55f1 100644
--- a/includes/EmailAuthSecondaryAuthenticationProvider.php
+++ b/includes/EmailAuthSecondaryAuthenticationProvider.php
@@ -54,7 +54,7 @@
'ip' => $user->getRequest()->getIP(),
] );
return AuthenticationResponse::newPass();
-   } else if ( $req && $req->token ) {
+   } elseif ( $req && $req->token ) {
// do not log if the code is simply missing - 
accidental enter or confused bot
LoggerFactory::getInstance( 'EmailAuth' )->info( 
'Failed verification for {user}', [
'user' => $user->getName(),
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 898075b..429d765 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -8,7 +8,9 @@
public static function onAuthChangeFormFields(
array $requests, array $fieldInfo, array &$formDescriptor, 
$action
) {
-   if ( AuthenticationRequest::getRequestByClass( $requests, 
EmailAuthAuthenticationRequest::class ) ) {
+   if ( AuthenticationRequest::getRequestByClass( $requests,
+   EmailAuthAuthenticationRequest::class )
+   ) {
$formDescriptor['token'] += [
'size' => 6,
'autofocus' => true,
diff --git a/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php 
b/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php
index c687d1d..635376e 100644
--- a/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php
+++ b/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php
@@ -22,10 +22,11 @@
/** @var LoggerInterface|PHPUnit_Framework_MockObject_MockObject */
protected $logger;
 
-   public function setUp() {
+   protected function setUp() {
parent::setUp();
 
-   $this->setTemporaryHook( 'EmailAuthRequireToken', function () 
{} );
+   $this->setTemporaryHook( 'EmailAuthRequireToken', function () {
+   } );
 
$this->provider = new 
EmailAuthSecondaryAuthenticationProvider();
 
@@ -44,8 +45,6 @@
return $this->session->get( $key );
} );
$this->provider->setManager( $this->manager );
-
-   return $this->provider;
}
 
public function testGetAuthenticationRequests() {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Add emailauth role

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

Change subject: Add emailauth role
..


Add emailauth role

Change-Id: Ibf475d791fbefc0feafc5a445aa60648b624ca44
Depends-On: Ia6ed8f1952fd727af352646433b5f90f7083a8c2
Depends-On: Ie15c45c9b29de0a0f926c2467808ca144f05e866
---
A puppet/modules/role/manifests/emailauth.pp
A puppet/modules/role/templates/emailauth/VagrantRoleEmailAuth.wiki
A puppet/modules/role/templates/emailauth/conf.php.erb
3 files changed, 35 insertions(+), 0 deletions(-)

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



diff --git a/puppet/modules/role/manifests/emailauth.pp 
b/puppet/modules/role/manifests/emailauth.pp
new file mode 100644
index 000..a0105a3
--- /dev/null
+++ b/puppet/modules/role/manifests/emailauth.pp
@@ -0,0 +1,16 @@
+# == Class: role::emailauth
+# Provisions the EmailAuth[1] extension, which allows
+# account verification via email.
+#
+# [1] https://www.mediawiki.org/wiki/Extension:EmailAuth
+#
+class role::emailauth {
+mediawiki::extension { 'EmailAuth':
+settings => template('role/emailauth/conf.php.erb'),
+}
+
+mediawiki::import::text { 'VagrantRoleEmailAuth':
+content => template('role/emailauth/VagrantRoleEmailAuth.wiki'),
+}
+}
+
diff --git a/puppet/modules/role/templates/emailauth/VagrantRoleEmailAuth.wiki 
b/puppet/modules/role/templates/emailauth/VagrantRoleEmailAuth.wiki
new file mode 100644
index 000..6c22b52
--- /dev/null
+++ b/puppet/modules/role/templates/emailauth/VagrantRoleEmailAuth.wiki
@@ -0,0 +1,4 @@
+[https://www.mediawiki.org/wiki/Extension:EmailAuth EmailAuth] can request 
email-based verification on login.
+It can be activated with the 
[https://www.mediawiki.org/wiki/Extension:EmailAuth/EmailAuthRequireToken 
EmailAuthRequireToken] hook.
+The vagrant role enables it for admins who do not have OATH authentication 
enabled.
+
diff --git a/puppet/modules/role/templates/emailauth/conf.php.erb 
b/puppet/modules/role/templates/emailauth/conf.php.erb
new file mode 100644
index 000..6697f2d
--- /dev/null
+++ b/puppet/modules/role/templates/emailauth/conf.php.erb
@@ -0,0 +1,15 @@
+$wgHooks['EmailAuthRequireToken'][] = function (
+   $user, &$verificationRequired, &$formMessage, &$subjectMessage, 
&$bodyMessage
+) {
+   if (
+class_exists( OATHAuthUtils::class ) &&
+OATHAuthUtils::isEnabledFor( $user )
+) {
+return;
+}
+
+   if ( $user->isAllowed( 'delete' ) ) {
+   $verificationRequired = true;
+   return false;
+   }
+};

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibf475d791fbefc0feafc5a445aa60648b624ca44
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Dduvall 
Gerrit-Reviewer: Gergő Tisza 
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]: Fix server logout case when logged in user edits

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

Change subject: Fix server logout case when logged in user edits
..


Fix server logout case when logged in user edits

When a user is logged into the app and makes an edit, EditClient
requests that the server verify the user is still logged in and that the
edit will be associated with their account. If the user is logged out,
the request fails. This patch checks for and retries in that scenario.
I no longer reproduce this issue but I wrote a test to exercise the
scenario.

Bug: T150529
Change-Id: I88b700b2bfb9433ddcaab86829b32557000f772d
---
M app/src/main/java/org/wikipedia/edit/EditClient.java
M app/src/main/java/org/wikipedia/edit/EditSectionActivity.java
A app/src/main/java/org/wikipedia/edit/UserNotLoggedInException.java
M app/src/test/java/org/wikipedia/edit/EditUnitTest.java
A app/src/test/res/raw/edit_user_not_logged_in.json
5 files changed, 42 insertions(+), 9 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/edit/EditClient.java 
b/app/src/main/java/org/wikipedia/edit/EditClient.java
index 6af48a3..f8ee30e 100644
--- a/app/src/main/java/org/wikipedia/edit/EditClient.java
+++ b/app/src/main/java/org/wikipedia/edit/EditClient.java
@@ -68,6 +68,8 @@
 } else {
 cb.failure(call, new RuntimeException("Received 
unrecognized edit response"));
 }
+} else if ("assertuserfailed".equals(response.body().code())) {
+cb.failure(call, new UserNotLoggedInException());
 } else if (response.body().info() != null) {
 String info = response.body().info();
 cb.failure(call, new RuntimeException(info));
diff --git a/app/src/main/java/org/wikipedia/edit/EditSectionActivity.java 
b/app/src/main/java/org/wikipedia/edit/EditSectionActivity.java
index 20e2529..68fa763 100644
--- a/app/src/main/java/org/wikipedia/edit/EditSectionActivity.java
+++ b/app/src/main/java/org/wikipedia/edit/EditSectionActivity.java
@@ -338,10 +338,12 @@
 if (caught instanceof ApiException) {
 // This is a fairly standard editing 
exception. Handle it appropriately.
 handleEditingException((ApiException) 
caught);
+} else if (caught instanceof 
UserNotLoggedInException) {
+retry();
 } else {
 // If it's not an API exception, we have 
no idea what's wrong.
 // Show the user a generic error message.
-L.w("Caught " + caught.toString());
+L.w(caught);
 showRetryDialog();
 }
 }
@@ -382,20 +384,23 @@
 retryDialog.show();
 }
 
+private void retry() {
+// looks like our session expired.
+app.getEditTokenStorage().clearAllTokens();
+app.getCookieManager().clearAllCookies();
+
+User user = User.getUser();
+doLoginAndSave(user);
+}
+
 /**
  * Processes API error codes encountered during editing, and handles them 
as appropriate.
  * @param e The ApiException to handle.
  */
 private void handleEditingException(@NonNull ApiException e) {
 String code = e.getCode();
-if (User.isLoggedIn() && ("badtoken".equals(code)
-|| "assertuserfailed".equals(code))) {
-// looks like our session expired.
-app.getEditTokenStorage().clearAllTokens();
-app.getCookieManager().clearAllCookies();
-
-User user = User.getUser();
-doLoginAndSave(user);
+if (User.isLoggedIn() && ("badtoken".equals(code) || 
"assertuserfailed".equals(code))) {
+retry();
 } else if ("blocked".equals(code) || 
"wikimedia-globalblocking-ipblocked".equals(code)) {
 // User is blocked, locally or globally
 // If they were anon, canedit does not catch this, so we can't 
show them the locked pencil
diff --git a/app/src/main/java/org/wikipedia/edit/UserNotLoggedInException.java 
b/app/src/main/java/org/wikipedia/edit/UserNotLoggedInException.java
new file mode 100644
index 000..7464302
--- /dev/null
+++ b/app/src/main/java/org/wikipedia/edit/UserNotLoggedInException.java
@@ -0,0 +1,8 @@
+package org.wikipedia.edit;
+
+// https://www.mediawiki.org/wiki/API:Assert
+public class UserNotLoggedInException extends RuntimeException {
+public UserNotLoggedInException() {
+super("User not logged in.");
+}
+}
\ No newline 

[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Hygiene: forbid unused variables and fix offenders

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

Change subject: Hygiene: forbid unused variables and fix offenders
..


Hygiene: forbid unused variables and fix offenders

Change-Id: I4e55de89de579369b01876e9db9a4365df24d606
---
M .jscsrc
M lib/feed/featured-image.js
M lib/feed/featured.js
M lib/feed/news.js
M lib/mwapi.js
M lib/parseDefinition.js
M lib/parseProperty.js
M lib/parseSection.js
M lib/parsoid-access.js
M lib/transforms.js
M routes/announcements.js
M routes/definition.js
M routes/media.js
M routes/mobile-sections.js
M routes/mobile-summary.js
M routes/mobile-text.js
M test/features/mobile-sections-remaining/pagecontent.js
M test/features/most-read/most-read.js
M test/features/news/news.js
M test/features/random/summary.js
M test/lib/api-util/api-util-test.js
M test/lib/dateUtil/date-util-test.js
M test/lib/mobile-util/mobile-util-test.js
M test/utils/server.js
24 files changed, 4 insertions(+), 35 deletions(-)

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



diff --git a/.jscsrc b/.jscsrc
index 7b34c72..27a0ed2 100644
--- a/.jscsrc
+++ b/.jscsrc
@@ -26,6 +26,7 @@
   "requireLineFeedAtFileEnd": null,
   "requireSpacesInsideObjectBrackets": null,
   "requireSpaceBetweenArguments": null,
+  "disallowUnusedVariables": true,
   "disallowVar": true,
   "requireVarDeclFirst": null,
   "jsDoc": null,
diff --git a/lib/feed/featured-image.js b/lib/feed/featured-image.js
index 8439fed..b0ec58c 100644
--- a/lib/feed/featured-image.js
+++ b/lib/feed/featured-image.js
@@ -5,7 +5,6 @@
 'use strict';
 
 const BBPromise = require('bluebird');
-const preq = require('preq');
 const api = require('../api-util');
 const dateUtil = require('../dateUtil');
 const domino = require('domino');
diff --git a/lib/feed/featured.js b/lib/feed/featured.js
index 17967e3..5a1a28c 100644
--- a/lib/feed/featured.js
+++ b/lib/feed/featured.js
@@ -4,7 +4,6 @@
 
 'use strict';
 
-const preq = require('preq');
 const mUtil = require('../mobile-util');
 const api = require('../api-util');
 const mwapi = require('../mwapi');
diff --git a/lib/feed/news.js b/lib/feed/news.js
index 7c4225e..40560aa 100644
--- a/lib/feed/news.js
+++ b/lib/feed/news.js
@@ -2,9 +2,8 @@
 
 const BBPromise = require('bluebird');
 const domino = require('domino');
-const api = require('../api-util');
+
 const mUtil = require('../mobile-util');
-const mwapi = require('../mwapi');
 const parsoid = require('../parsoid-access');
 const HTTPError = require('../util').HTTPError;
 const NEWS_TEMPLATES = require('../../etc/feed/news-sites');
diff --git a/lib/mwapi.js b/lib/mwapi.js
index e60062b..653b3e3 100644
--- a/lib/mwapi.js
+++ b/lib/mwapi.js
@@ -4,7 +4,6 @@
 
 'use strict';
 
-const preq = require('preq');
 const sUtil = require('./util');
 const api = require('./api-util');
 const HTTPError = sUtil.HTTPError;
diff --git a/lib/parseDefinition.js b/lib/parseDefinition.js
index 883d5e4..6f74164 100644
--- a/lib/parseDefinition.js
+++ b/lib/parseDefinition.js
@@ -7,11 +7,8 @@
 
 'use strict';
 
-const domino = require('domino');
 const sUtil = require('./util');
-const mUtil = require('./mobile-util');
 const transforms = require('./transforms');
-const parseSection = require('./parseSection');
 const languageList = require('../static/languages_list.json');
 
 /* This list has expanded beyond parts of speech to something more like 
"whatever
diff --git a/lib/parseProperty.js b/lib/parseProperty.js
index 48beda0..f045d1e 100644
--- a/lib/parseProperty.js
+++ b/lib/parseProperty.js
@@ -6,7 +6,6 @@
 'use strict';
 
 const mUtil = require('../lib/mobile-util');
-const util = require('util');
 const escape = require('escape-string-regexp');
 
 function parseInfobox(doc) {
diff --git a/lib/parseSection.js b/lib/parseSection.js
index ee6dfb8..f874eb6 100644
--- a/lib/parseSection.js
+++ b/lib/parseSection.js
@@ -1,6 +1,5 @@
 'use strict';
 
-const transforms = require('./transforms');
 const a = require('./anchorencode');
 
 function parse(sectionDiv, startingNode) {
diff --git a/lib/parsoid-access.js b/lib/parsoid-access.js
index a5de178..972c216 100644
--- a/lib/parsoid-access.js
+++ b/lib/parsoid-access.js
@@ -4,12 +4,10 @@
 
 'use strict';
 
-const preq = require('preq');
 const domino = require('domino');
 const a = require('./anchorencode');
 const sUtil = require('./util');
 const api = require('./api-util');
-const mUtil = require('./mobile-util');
 const parseSection = require('./parseSection');
 const parseProperty = require('./parseProperty');
 const parseDefinition = require('./parseDefinition');
@@ -23,7 +21,6 @@
  * @return {promise} a Promise, which if fulfilled, will return the Parsoid 
content of the given page.
  */
 function getParsoidHtml(app, req) {
-const revision = req.params.revision;
 const domain = req.params.domain.replace(/^(\w+\.)m\./, '$1');
 const path = 'page/html/' + encodeURIComponent(req.params.title);
 const restReq 

[MediaWiki-commits] [Gerrit] mediawiki...Gadgets[master]: [WIP] Implement 'peers' feature for loading extra styles-typ...

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

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

Change subject: [WIP] Implement 'peers' feature for loading extra styles-type 
gadgets
..

[WIP] Implement 'peers' feature for loading extra styles-type gadgets

Ref discussion on T42284.

Test plan:
* Create gadget A with a .css file only. (Maybe mark as 'hidden')
* Create gadget B with .js file, and peers=A.
* Verify that enabling B will result in B being loaded as general module,
  and A being loaded as page style module.

Change-Id: Ib6207e72c576ff387ecdba685a063bdfbb828199
---
M GadgetHooks.php
M Gadgets_body.php
M SpecialGadgets.php
M api/ApiQueryGadgets.php
M includes/MediaWikiGadgetsDefinitionRepo.php
M includes/content/GadgetDefinitionContentHandler.php
M includes/content/GadgetDefinitionValidator.php
7 files changed, 61 insertions(+), 7 deletions(-)


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

diff --git a/GadgetHooks.php b/GadgetHooks.php
index 3e3d1b7..90e7f3f 100644
--- a/GadgetHooks.php
+++ b/GadgetHooks.php
@@ -182,12 +182,31 @@
} catch ( InvalidArgumentException $e ) {
continue;
}
+   $peers = [];
+   foreach ( $gadget->getPeers() as $peerName ) {
+   try {
+   $peers[] = $repo->getGadget( $peerName 
);
+   } catch ( InvalidArgumentException $e ) {
+   // Ignore
+   // @todo: Emit warning for invalid peer?
+   }
+   }
if ( $gadget->isEnabled( $user ) && $gadget->isAllowed( 
$user ) ) {
if ( $gadget->hasModule() ) {
if ( $gadget->getType() === 'styles' ) {
$out->addModuleStyles( 
Gadget::getModuleName( $gadget->getName() ) );
} elseif ( $gadget->getType() === 
'general' ) {
$out->addModules( 
Gadget::getModuleName( $gadget->getName() ) );
+   // Load peer modules
+   foreach ( $peers as $peer ) {
+   if ( $peer->getType() 
=== 'styles' ) {
+   
$out->addModuleStyles( Gadget::getModuleName( $peer->getName() ) );
+   }
+   // Else if not 
type=styles: Use dependencies instead.
+   // Note: No need for 
recursion as styles modules don't support
+   // either of 
'dependencies' and 'peers'.
+   // @todo: Emit warning 
for non-styles peer?
+   }
} else {
$out->addModuleStyles( 
Gadget::getModuleName( $gadget->getName() ) );
$out->addModules( 
Gadget::getModuleName( $gadget->getName() ) );
diff --git a/Gadgets_body.php b/Gadgets_body.php
index 9d80757..2f70504 100644
--- a/Gadgets_body.php
+++ b/Gadgets_body.php
@@ -26,6 +26,7 @@
private $scripts = array(),
$styles = array(),
$dependencies = array(),
+   $peers = array(),
$messages = array(),
$name,
$definition,
@@ -45,6 +46,7 @@
case 'scripts':
case 'styles':
case 'dependencies':
+   case 'peers':
case 'messages':
case 'name':
case 'definition':
@@ -88,6 +90,7 @@
'scripts' => array_map( $prefixGadgetNs, 
$data['module']['scripts'] ),
'styles' => array_map( $prefixGadgetNs, 
$data['module']['styles'] ),
'dependencies' => $data['module']['dependencies'],
+   'peers' => $data['module']['peers'],
'messages' => $data['module']['messages'],
'position' => $data['module']['position'],
'type' => $data['module']['type'],
@@ -260,6 +263,19 @@
}
 
/**
+* Get list of extra modules that should be loaded when this gadget is 

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: APIGenerator.set_maximum_items: Don't compare int with None

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

Change subject: APIGenerator.set_maximum_items: Don't compare int with None
..


APIGenerator.set_maximum_items: Don't compare int with None

`query_increment` can be None. In Python 2 None is less than any number but
Python 3 raises "TypeError: unorderable types: int() < NoneType()".

test_continue (tests.site_tests.TestDataSiteSearchEntities) was failing
because of this issue.

Change-Id: I73e711014303a397a1009c76798d2cfefabc608b
---
M pywikibot/data/api.py
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index c087bb5..3b2ae9d 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -2435,7 +2435,7 @@
 @type value: int
 """
 self.limit = int(value)
-if self.limit < self.query_increment:
+if self.query_increment and self.limit < self.query_increment:
 self.request[self.limit_name] = self.limit
 pywikibot.debug(u"%s: Set request item limit to %i"
 % (self.__class__.__name__, self.limit), _logger)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I73e711014303a397a1009c76798d2cfefabc608b
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: wikibase_tests.py: Fix typo

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

Change subject: wikibase_tests.py: Fix typo
..


wikibase_tests.py: Fix typo

Change-Id: Ia6d69b8ee8ced4a127727d28dc4f1289542ae3e5
---
M tests/wikibase_tests.py
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index 990d9ab..1e41852 100644
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -646,7 +646,7 @@
 wikidata = self.get_repo()
 item = ItemPage(wikidata, 'Q1')
 self.assertFalse(item.isRedirectPage())
-self.assertTrue(item.exits())
+self.assertTrue(item.exists())
 self.assertRaises(pywikibot.IsNotRedirectPage, item.getRedirectTarget)
 
 def test_redirect_item(self):

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia6d69b8ee8ced4a127727d28dc4f1289542ae3e5
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Xqt 
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...Gadgets[master]: Implement support for 'hidden' feature in MediaWikiGadgetsDe...

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

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

Change subject: Implement support for 'hidden' feature in 
MediaWikiGadgetsDefinitionRepo
..

Implement support for 'hidden' feature in MediaWikiGadgetsDefinitionRepo

Follows-up 152484566, which added support for it in Gadgets 2.0, but
it's easy enough to make it work in existing definitions as well.

That way, people can stop using 'rights=hidden' hacks.

Change-Id: Idd6944a9ad38279e117c1a02a4b5fd0343455ba0
---
M includes/MediaWikiGadgetsDefinitionRepo.php
M tests/phpunit/GadgetTest.php
2 files changed, 14 insertions(+), 0 deletions(-)


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

diff --git a/includes/MediaWikiGadgetsDefinitionRepo.php 
b/includes/MediaWikiGadgetsDefinitionRepo.php
index dbb3ae8..9ce192b 100644
--- a/includes/MediaWikiGadgetsDefinitionRepo.php
+++ b/includes/MediaWikiGadgetsDefinitionRepo.php
@@ -202,6 +202,9 @@
case 'rights':
$info['requiredRights'] = $params;
break;
+   case 'hidden':
+   $info['hidden'] = true;
+   break;
case 'skins':
$info['requiredSkins'] = $params;
break;
diff --git a/tests/phpunit/GadgetTest.php b/tests/phpunit/GadgetTest.php
index a327a2a..789082c 100644
--- a/tests/phpunit/GadgetTest.php
+++ b/tests/phpunit/GadgetTest.php
@@ -132,6 +132,17 @@
$this->assertEquals( $mType, $this->getModule( $g )->getType(), 
"Module: $message" );
}
 
+   public function testIsHidden() {
+   $g = $this->create( '* foo[hidden]|bar.js' );
+   $this->assertTrue( $g->isHidden() );
+
+   $g = $this->create( '* foo[ResourceLoader|hidden]|bar.js' );
+   $this->assertTrue( $g->isHidden() );
+
+   $g = $this->create( '* foo[ResourceLoader]|bar.js' );
+   $this->assertFalse( $g->isHidden() );
+   }
+
public function testPreferences() {
$prefs = array();
$repo = TestingAccessWrapper::newFromObject( new 
MediaWikiGadgetsDefinitionRepo() );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idd6944a9ad38279e117c1a02a4b5fd0343455ba0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gadgets
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: APIGenerator.set_maximum_items: Don't compare int with None

2016-11-17 Thread Dalba (Code Review)
Dalba has uploaded a new change for review.

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

Change subject: APIGenerator.set_maximum_items: Don't compare int with None
..

APIGenerator.set_maximum_items: Don't compare int with None

`query_increment` can be None. In Python 2 None is less than any number but
Python 3 raises "TypeError: unorderable types: int() < NoneType()".

test_continue (tests.site_tests.TestDataSiteSearchEntities) was failing on
because of this issue.

Change-Id: I73e711014303a397a1009c76798d2cfefabc608b
---
M pywikibot/data/api.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/32/322232/1

diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index c087bb5..3b2ae9d 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -2435,7 +2435,7 @@
 @type value: int
 """
 self.limit = int(value)
-if self.limit < self.query_increment:
+if self.query_increment and self.limit < self.query_increment:
 self.request[self.limit_name] = self.limit
 pywikibot.debug(u"%s: Set request item limit to %i"
 % (self.__class__.__name__, self.limit), _logger)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I73e711014303a397a1009c76798d2cfefabc608b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba 

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Fix code coverage execution

2016-11-17 Thread Pmiazga (Code Review)
Pmiazga has uploaded a new change for review.

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

Change subject: Hygiene: Fix code coverage execution
..

Hygiene: Fix code coverage execution

Fix incorrect @cover statements as PHPUnit fails to generate code
coverage report

Change-Id: Ibdc11dc8667bfb898d636b098bae9b9de23b6b6d
---
M includes/MobileFormatter.php
M tests/phpunit/MenuBuilderTest.php
M tests/phpunit/MobileFormatterTest.php
3 files changed, 19 insertions(+), 24 deletions(-)


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

diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php
index 5940852..82210b9 100644
--- a/includes/MobileFormatter.php
+++ b/includes/MobileFormatter.php
@@ -110,7 +110,7 @@
/**
 * Mark whether a placeholder table of contents should be included at 
the end of the lead
 * section
-* @param boolean $value
+* @param boolean $flag
 */
public function enableTOCPlaceholder( $flag = true ) {
$this->isTOCEnabled = $flag;
diff --git a/tests/phpunit/MenuBuilderTest.php 
b/tests/phpunit/MenuBuilderTest.php
index ceb8193..c867ee9 100644
--- a/tests/phpunit/MenuBuilderTest.php
+++ b/tests/phpunit/MenuBuilderTest.php
@@ -22,7 +22,7 @@
];
 
/**
-* @covers MenuBuilder::getEntries
+* @covers \MobileFrontend\MenuBuilder::getEntries
 */
public function test_it_shouldnt_have_entries_by_default() {
$menu = new MenuBuilder();
@@ -31,9 +31,9 @@
}
 
/**
-* @covers MenuBuilder::insert
-* @covers MenuEntry::addComponent
-* @covers MenuBuilder::getEntries
+* @covers \MobileFrontend\MenuBuilder::insert
+* @covers \MobileFrontend\MenuEntry::addComponent
+* @covers \MobileFrontend\MenuBuilder::getEntries
 */
public function test_inserting_an_entry() {
$menu = new MenuBuilder();
@@ -58,9 +58,9 @@
}
 
/**
-* @covers MenuBuilder::insert
-* @covers MenuEntry::addComponent
-* @covers MenuBuilder::getEntries
+* @covers \MobileFrontend\MenuBuilder::insert
+* @covers \MobileFrontend\MenuEntry::addComponent
+* @covers \MobileFrontend\MenuBuilder::getEntries
 */
public function test_inserting_an_entry_after_another() {
$menu = new MenuBuilder();
@@ -110,8 +110,8 @@
/**
 * @expectedException DomainException
 * @expectedExceptionMessage The "home" entry doesn't exist.
-* @covers MenuBuilder::insertAfter
-* @covers MenuEntry::addComponent
+* @covers \MobileFrontend\MenuBuilder::insertAfter
+* @covers \MobileFrontend\MenuEntry::addComponent
 */
public function test_inserting_an_entry_after_that_doesnt_exist() {
$menu = new MenuBuilder();
@@ -126,7 +126,7 @@
/**
 * @expectedException DomainException
 * @expectedExceptionMessage The "home" entry already exists.
-* @covers MenuBuilder::insert
+* @covers \MobileFrontend\MenuBuilder::insert
 */
public function test_inserting_an_entry_with_an_existing_name() {
$menu = new MenuBuilder();
@@ -137,7 +137,7 @@
/**
 * @expectedException DomainException
 * @expectedExceptionMessage The "home" entry already exists.
-* @covers MenuBuilder::insert
+* @covers \MobileFrontend\MenuBuilder::insert
 */
public function test_inserting_an_entry_with_an_existing_name_after() {
$menu = new MenuBuilder();
@@ -146,9 +146,9 @@
}
 
/**
-* @covers MenuBuilder::insert
-* @covers MenuEntry::addComponent
-* @covers MenuBuilder::getEntries
+* @covers \MobileFrontend\MenuBuilder::insert
+* @covers \MobileFrontend\MenuEntry::addComponent
+* @covers \MobileFrontend\MenuBuilder::getEntries
 */
public function test_inserting_an_entry_with_multiple_components() {
$authLoginComponent = [
@@ -191,9 +191,9 @@
}
 
/**
-* @covers MenuBuilder::insert
-* @covers MenuEntry::addComponent
-* @covers MenuBuilder::getEntries
+* @covers \MobileFrontend\MenuBuilder::insert
+* @covers \MobileFrontend\MenuEntry::addComponent
+* @covers \MobileFrontend\MenuBuilder::getEntries
 */
public function test_inserting_a_javascript_only_entry() {
$menu = new MenuBuilder();
diff --git a/tests/phpunit/MobileFormatterTest.php 
b/tests/phpunit/MobileFormatterTest.php
index 79fdee7..2ddd5b2 100644
--- a/tests/phpunit/MobileFormatterTest.php
+++ b/tests/phpunit/MobileFormatterTest.php
@@ -55,7 +55,6 @@
 * @param bool $lazyLoadImages
 * @param bool 

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: use constants

2016-11-17 Thread Pmiazga (Code Review)
Pmiazga has uploaded a new change for review.

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

Change subject: Hygiene: use constants
..

Hygiene: use constants

For better maintenance use contants instead of strings

Changes:
 - introduced constants for all cookies
 - introduced constants for stable/mode
 - unit tests now will also use constants

Change-Id: I67743bb5b9512578d0a4efbdd9af9d1c0f586339
---
M includes/MobileContext.php
M includes/MobileFrontend.hooks.php
M tests/phpunit/MobileContextTest.php
M tests/phpunit/context/MobileContextShouldDisplayMobileViewIntegrationTest.php
4 files changed, 36 insertions(+), 27 deletions(-)


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

diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index c9233e3..58a4f5e 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -11,7 +11,11 @@
  * Provide various request-dependant methods to use in mobile context
  */
 class MobileContext extends ContextSource {
-
+   const MODE_BETA = 'beta';
+   const MODE_STABLE = 'stable';
+   const DISABLE_IMAGES_COOKIE_NAME = 'disableImages';
+   const OPTIN_COOKIE_NAME = 'optin';
+   const STOP_MOBILE_REDIRECT_COKIE_NAME = 'stopMobileRedirect';
const USEFORMAT_COOKIE_NAME = 'mf_useformat';
const USER_MODE_PREFERENCE_NAME = 'mfMode';
const LAZY_LOAD_IMAGES_COOKIE_NAME = 'mfLazyLoadImages';
@@ -261,8 +265,9 @@
public function imagesDisabled() {
if ( is_null( $this->disableImages ) ) {
$this->disableImages = (
-   ( isset( $_COOKIE['disableImages'] ) && 
$_COOKIE['disableImages'] === '1' ) ||
-   (bool) $this->getRequest()->getCookie( 
'disableImages' )
+   ( isset( $_COOKIE[ 
self::DISABLE_IMAGES_COOKIE_NAME ] )
+ && $_COOKIE[ self::DISABLE_IMAGES_COOKIE_NAME 
] === '1' ) ||
+   (bool) $this->getRequest()->getCookie( 
self::DISABLE_IMAGES_COOKIE_NAME )
);
}
 
@@ -343,7 +348,7 @@
 * If the cookie is not set the value will be an empty string.
 */
private function loadMobileModeCookie() {
-   $this->mobileMode = $this->getRequest()->getCookie( 'optin', '' 
);
+   $this->mobileMode = $this->getRequest()->getCookie( 
self::OPTIN_COOKIE_NAME, '' );
}
 
/**
@@ -358,7 +363,7 @@
}
if ( is_null( $this->mobileMode ) ) {
$mobileAction = $this->getMobileAction();
-   if ( $mobileAction === 'beta' || $mobileAction === 
'stable' ) {
+   if ( $mobileAction === self::MODE_BETA || $mobileAction 
=== self::MODE_STABLE ) {
$this->mobileMode = $mobileAction;
} else {
$user = $this->getUser();
@@ -384,11 +389,11 @@
 * @param string $mode Mode to set
 */
public function setMobileMode( $mode ) {
-   if ( $mode !== 'beta' ) {
+   if ( $mode !== self::MODE_BETA ) {
$mode = '';
}
// Update statistics
-   if ( $mode === 'beta' ) {
+   if ( $mode === self::MODE_BETA ) {
wfIncrStats( 'mobile.opt_in_cookie_set' );
}
if ( !$mode ) {
@@ -399,7 +404,7 @@
$user->setOption( self::USER_MODE_PREFERENCE_NAME, $mode );
$user->saveSettings();
 
-   $this->getRequest()->response()->setCookie( 'optin', $mode, 0, [
+   $this->getRequest()->response()->setCookie( 
self::OPTIN_COOKIE_NAME, $mode, 0, [
'prefix' => '',
'domain' => $this->getBaseDomain()
] );
@@ -410,7 +415,7 @@
 * @return boolean
 */
public function isBetaGroupMember() {
-   return $this->getMobileMode() === 'beta';
+   return $this->getMobileMode() === self::MODE_BETA;
}
 
/**
@@ -605,7 +610,8 @@
$expiry = $this->getUseFormatCookieExpiry();
}
 
-   $this->getRequest()->response()->setcookie( 
'stopMobileRedirect', 'true', $expiry,
+   $this->getRequest()->response()->setcookie(
+   self::STOP_MOBILE_REDIRECT_COKIE_NAME, 'true', $expiry,
[
'domain' => 
$this->getStopMobileRedirectCookieDomain(),
'prefix' => '',
@@ -631,7 +637,8 @@
 * @return string
 */
public function getStopMobileRedirectCookie() {
-   $stopMobileRedirectCookie = 

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Adding hub image selector and embedding icon and color selec...

2016-11-17 Thread Harej (Code Review)
Harej has uploaded a new change for review.

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

Change subject: Adding hub image selector and embedding icon and color 
selectors in proper places.
..

Adding hub image selector and embedding icon and color selectors in proper 
places.

Adds VisualEditor as a dependency.

Change-Id: I1c2a2f028f647390ec8cd98741c9b2dcf5bf7e31
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/CollaborationHubContentEditor.php
M includes/SpecialCreateCollaborationHub.php
M modules/ext.CollaborationKit.colour.js
A modules/ext.CollaborationKit.hubimage.js
M modules/ext.CollaborationKit.icon.js
8 files changed, 155 insertions(+), 16 deletions(-)


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

diff --git a/extension.json b/extension.json
index c120287..ea49f1f 100644
--- a/extension.json
+++ b/extension.json
@@ -111,6 +111,23 @@
"cancel"
]
},
+   "ext.CollaborationKit.hubimage": {
+   "scripts": "ext.CollaborationKit.hubimage.js",
+   "dependencies": [
+   "oojs-ui",
+   "oojs-ui.styles.icons-movement",
+   "mediawiki.widgets",
+   "mediawiki.widgets.UserInputWidget",
+   "ext.visualEditor.mwimage",
+   "mediawiki.api"
+   ],
+   "messages": [
+   "collaborationkit-hubimage-browser",
+   "collaborationkit-hubimage-select",
+   "collaborationkit-hubimage-launchbutton",
+   "cancel"
+   ]
+   },
"ext.CollaborationKit.colour": {
"scripts": "ext.CollaborationKit.colour.js",
"dependencies": [
diff --git a/i18n/en.json b/i18n/en.json
index 62f7fb9..c072ca0 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -92,6 +92,9 @@
"collaborationkit-colour-launchbutton": "Browse colors",
"collaborationkit-colour-browser": "Color browser",
"collaborationkit-colour-select": "Select",
+   "collaborationkit-hubimage-launchbutton": "Browse images",
+   "collaborationkit-hubimage-browser": "Media browser",
+   "collaborationkit-hubimage-select": "Select",
"collaborationkit-subpage-toc-label": "Part of a project:",
"collaborationkit-red1": "Dark red",
"collaborationkit-red2": "Red",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 51ea868..4a9d86c 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -92,6 +92,9 @@
"collaborationkit-colour-launchbutton": "Button label for button that 
launches the hub colour browser",
"collaborationkit-colour-browser": "Header label for the hub colour 
browser",
"collaborationkit-colour-select": "Button for selecting a colour in the 
hub colour browser",
+   "collaborationkit-hubimage-launchbutton": "Button label for button that 
launches the hub image browser",
+   "collaborationkit-hubimage-browser": "Header label for the hub image 
browser",
+   "collaborationkit-hubimage-select": "Button for selecting an image in 
the hub image browser",
"collaborationkit-subpage-toc-label": "Label for the toc on a 
Collaboration Hub subpage",
"collaborationkit-red1": "Color label",
"collaborationkit-red2": "Color label",
diff --git a/includes/CollaborationHubContentEditor.php 
b/includes/CollaborationHubContentEditor.php
index 8094556..66c7df9 100644
--- a/includes/CollaborationHubContentEditor.php
+++ b/includes/CollaborationHubContentEditor.php
@@ -9,6 +9,13 @@
// Make human readable the default format for editing, but still
// save as json. Can be overriden by url 
?format=application/json param.
$this->contentFormat = 
CollaborationHubContentHandler::FORMAT_WIKI;
+
+   // Nice JavaScript buttons
+   $out = $this->getContext()->getOutput();
+   $out->addModules( 'ext.CollaborationKit.colour' );
+   $out->addModules( 'ext.CollaborationKit.hubimage' );
+   $out->addModuleStyles( 
'ext.CollaborationKit.colourbrowser.styles' );
+   $out->addJsConfigVars( 'wgCollaborationKitColourList', 
CollaborationHubContent::getThemeColours() );
}
 
/**
diff --git a/includes/SpecialCreateCollaborationHub.php 
b/includes/SpecialCreateCollaborationHub.php
index 0551cdd..d0153b0 100644
--- a/includes/SpecialCreateCollaborationHub.php
+++ b/includes/SpecialCreateCollaborationHub.php
@@ -19,8 +19,10 @@
public function execute( $par ) {
$out = 

[MediaWiki-commits] [Gerrit] mediawiki...EmailAuth[master]: Disable autocomplete

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

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

Change subject: Disable autocomplete
..

Disable autocomplete

Change-Id: I5715549e33124a545e3dca5707d08b08ccd3fa84
Depends-On: Ic0539d5a61d9862e670d10686adc1e41f65d908e
---
M includes/Hooks.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/includes/Hooks.php b/includes/Hooks.php
index 898075b..4159f0c 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -13,6 +13,7 @@
'size' => 6,
'autofocus' => true,
'persistent' => false,
+   'autocomplete' => false,
'spellcheck' => false,
];
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Log user out when their account gets globally locked

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

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

Change subject: Log user out when their account gets globally locked
..

Log user out when their account gets globally locked

Bug: 761269
Change-Id: Ia720323b34a09e83db1db4ad9afb4383c6b8d0c2
---
M includes/CentralAuthUser.php
1 file changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/includes/CentralAuthUser.php b/includes/CentralAuthUser.php
index b2859e1..4ad3f21 100644
--- a/includes/CentralAuthUser.php
+++ b/includes/CentralAuthUser.php
@@ -1488,6 +1488,8 @@
}
 
$this->invalidateCache();
+   $user = User::newFromName( $this->mName );
+   
\MediaWiki\Session\SessionManager::singleton()->invalidateSessionsForUser( 
$user );
 
return Status::newGood();
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...PageAssessments[master]: Add a maintenance script for purging unused projects

2016-11-17 Thread Kaldari (Code Review)
Kaldari has uploaded a new change for review.

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

Change subject: Add a maintenance script for purging unused projects
..

Add a maintenance script for purging unused projects

This is mostly just for local use, as WikiProjects are rarely
killed or renamed on Wikipedia.

Change-Id: I2c34a161c40d31efc4a54dd1a4d48ec2927a438a
---
A maintenance/purgeUnusedProjects.php
1 file changed, 37 insertions(+), 0 deletions(-)


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

diff --git a/maintenance/purgeUnusedProjects.php 
b/maintenance/purgeUnusedProjects.php
new file mode 100644
index 000..55cc458
--- /dev/null
+++ b/maintenance/purgeUnusedProjects.php
@@ -0,0 +1,37 @@
+addDescription( "Purge unused projects from the 
page_assessments_projects table" );
+   $this->addOption( 'dry-run', "Show how many projects would be 
deleted, but don't actually purge them." );
+   }
+
+   public function execute() {
+   $dbw = $this->getDB( DB_MASTER );
+   $dbr = $this->getDB( DB_REPLICA );
+   $initialCount = $dbr->selectField( 'page_assessments_projects', 
'COUNT(*)' );
+   $this->output( "Projects before purge: $initialCount\n" );
+   if ( $this->hasOption( 'dry-run' ) ) {
+   $finalCount = $dbr->selectField( 'page_assessments', 
'COUNT( DISTINCT pa_project_id )' );
+   } else {
+   $this->output( "Purging unused projects from 
page_assessments_projects...\n" );
+   $cond = 'pap_project_id NOT IN ( SELECT DISTINCT( 
pa_project_id ) FROM page_assessments )';
+   $dbw->delete( 'page_assessments_projects', [ $cond ], 
__METHOD__ );
+   $this->output( "Done.\n" );
+   wfWaitForSlaves();
+   $finalCount = $dbr->selectField( 
'page_assessments_projects', 'COUNT(*)' );
+   }
+   $this->output( "Projects after purge: $finalCount\n" );
+   }
+
+}
+
+$maintClass = "PurgeUnusedProjects";
+require_once RUN_MAINTENANCE_IF_MAIN;

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: labstore: Add account_services to secondary too

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

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

Change subject: labstore: Add account_services to secondary too
..

labstore: Add account_services to secondary too

Since labstore1004 is technically secondary rn

Change-Id: Ia13e8dbc2977e57032e2e678c97fa8c35b58860e
---
M modules/labstore/manifests/account_services.pp
M modules/role/manifests/labs/nfs/secondary.pp
2 files changed, 4 insertions(+), 16 deletions(-)


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

diff --git a/modules/labstore/manifests/account_services.pp 
b/modules/labstore/manifests/account_services.pp
index ba21125..082dfcc 100644
--- a/modules/labstore/manifests/account_services.pp
+++ b/modules/labstore/manifests/account_services.pp
@@ -27,10 +27,6 @@
 ensure => present,
 }
 
-# Set to true only for the labstore that is currently
-# actively serving files
-$is_active = (hiera('active_labstore_host') == $::hostname)
-
 $ldapconfig = hiera_hash('labsldapconfig', {})
 include passwords::mysql::labsdb
 
@@ -77,21 +73,12 @@
 mode   => '0550',
 }
 
-# Terrible hack
-if $is_active {
-$service_ensure = 'present'
-} else {
-$service_ensure = 'absent'
-}
-
 base::service_unit { 'create-dbusers':
-ensure  => $service_ensure,
+ensure  => present,
 systemd => true,
 }
 
-if $is_active {
-nrpe::monitor_systemd_unit_state { 'create-dbusers':
-description => 'Ensure mysql credential creation for tools users 
is running',
-}
+nrpe::monitor_systemd_unit_state { 'create-dbusers':
+description => 'Ensure mysql credential creation for tools users is 
running',
 }
 }
diff --git a/modules/role/manifests/labs/nfs/secondary.pp 
b/modules/role/manifests/labs/nfs/secondary.pp
index 6bc2a7b..9aad6c5 100644
--- a/modules/role/manifests/labs/nfs/secondary.pp
+++ b/modules/role/manifests/labs/nfs/secondary.pp
@@ -7,6 +7,7 @@
 include labstore::fileserver::exports
 include labstore::fileserver::secondary
 include labstore::backup_keys
+include labstore::account_services
 
 # Enable RPS to balance IRQs over CPUs
 interface::rps { $monitor: }

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

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

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: wikibase_tests.py: Fix typo

2016-11-17 Thread Dalba (Code Review)
Dalba has uploaded a new change for review.

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

Change subject: wikibase_tests.py: Fix typo
..

wikibase_tests.py: Fix typo

Change-Id: Ia6d69b8ee8ced4a127727d28dc4f1289542ae3e5
---
M tests/wikibase_tests.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/25/35/1

diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index 990d9ab..1e41852 100644
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -646,7 +646,7 @@
 wikidata = self.get_repo()
 item = ItemPage(wikidata, 'Q1')
 self.assertFalse(item.isRedirectPage())
-self.assertTrue(item.exits())
+self.assertTrue(item.exists())
 self.assertRaises(pywikibot.IsNotRedirectPage, item.getRedirectTarget)
 
 def test_redirect_item(self):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6d69b8ee8ced4a127727d28dc4f1289542ae3e5
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba 

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


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Add script to fix inconsistent state for board name

2016-11-17 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review.

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

Change subject: Add script to fix inconsistent state for board name
..

Add script to fix inconsistent state for board name

This loops through all Flow boards (optionally with a namespace
constraint).  It checks the JSON workflow ID, loads the workflow
from that, then checks that the Flow title matches the core (page
table) title.

You can optionally limit the number of boards modified in each run.

There is also a dry run mode.

Small supporting changes elsewhere, including renaming a parameter
in another maintenance script to match.

Bug: T148057
Change-Id: I6a1a410db0893049651fbbbd6f9b9f13360c34c3
---
M Hooks.php
M includes/BoardMover.php
M includes/WorkflowLoaderFactory.php
A maintenance/FlowFixInconsistentBoards.php
M maintenance/convertNamespaceFromWikitext.php
5 files changed, 146 insertions(+), 5 deletions(-)


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

diff --git a/Hooks.php b/Hooks.php
index 0ef70bd..072f17e 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -280,6 +280,9 @@
require_once __DIR__.'/maintenance/FlowPopulateRefId.php';
$updater->addPostDatabaseUpdateMaintenance( 'FlowPopulateRefId' 
);
 
+   require_once 
__DIR__.'/maintenance/FlowFixInconsistentBoards.php';
+   $updater->addPostDatabaseUpdateMaintenance( 
'FlowFixInconsistentBoards' );
+
/*
 * Add primary key, but only after we've made sure the newly 
added
 * column has been populated (otherwise they'd all be null 
values)
diff --git a/includes/BoardMover.php b/includes/BoardMover.php
index b0978a7..979408f 100644
--- a/includes/BoardMover.php
+++ b/includes/BoardMover.php
@@ -51,9 +51,8 @@
 
/**
 * Collects the workflow and header (if it exists) and puts them into 
the database. Does
-* not commit yet. It is intended for begin to be called at the 
beginning of the
-* transaction, move to be called for each move, and commit to be 
called at the end
-* the core transaction, via a hook.
+* not commit yet. It is intended for move to be called for each move, 
and commit
+* to be called at the end the core transaction, via a hook.
 *
 * @param int $oldPageId Page ID before move/change
 * @param Title $newPage Page after move/change
diff --git a/includes/WorkflowLoaderFactory.php 
b/includes/WorkflowLoaderFactory.php
index 647ece0..fd52375 100644
--- a/includes/WorkflowLoaderFactory.php
+++ b/includes/WorkflowLoaderFactory.php
@@ -113,7 +113,7 @@
 * @throws InvalidInputException
 * @throws UnknownWorkflowIdException
 */
-   protected function loadWorkflowById( /* Title or false */ $title, 
$workflowId ) {
+   public function loadWorkflowById( /* Title or false */ $title, 
$workflowId ) {
/** @var Workflow $workflow */
$workflow = $this->storage->getStorage( 'Workflow' )->get( 
$workflowId );
if ( !$workflow ) {
diff --git a/maintenance/FlowFixInconsistentBoards.php 
b/maintenance/FlowFixInconsistentBoards.php
new file mode 100644
index 000..885dc64
--- /dev/null
+++ b/maintenance/FlowFixInconsistentBoards.php
@@ -0,0 +1,139 @@
+mDescription = 'Changes Flow boards and their topics to 
be associated with their current title, based on the JSON content.  Must be run 
separately for each affected wiki.';
+
+   $this->addOption( 'dry-run', 'Only prints the board names, 
without changing anything.' );
+   $this->addOption( 'namespaceName', 'Name of namespace to check, 
otherwise all', false, true );
+   $this->addOption( 'limit', 'Limit of inconsistent pages to 
identify (and fix if not a dry run).  Defaults to no limit', false, true );
+
+   $this->setBatchSize( 300 );
+   }
+
+   protected function getUpdateKey() {
+   return 'FlowFixInconsistentBoards:version1';
+   }
+
+   public function doDBUpdates() {
+   global $wgLang;
+
+   $this->dbFactory = Container::get( 'db.factory' );
+   $this->workflowLoaderFactory = Container::get( 
'factory.loader.workflow' );
+
+   $this->boardMover = Container::get( 'board_mover' );
+
+   $dryRun = $this->hasOption( 'dry-run' );
+
+   $limit = $this->getOption( 'limit' );
+
+   $wikiDbw = $this->dbFactory->getWikiDB( DB_MASTER );
+
+   $iterator = new BatchRowIterator( $wikiDbw, 'page', 'page_id', 
$this->mBatchSize );
+   $iterator->setFetchColumns( [ 'page_namespace', 'page_title', 
'page_latest' ] );
+   $iterator->addConditions( [
+   'page_content_model' => CONTENT_MODEL_FLOW_BOARD,
+   ] );
+
+   

[MediaWiki-commits] [Gerrit] operations...hhvm_exporter[master]: Initial commit

2016-11-17 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged.

Change subject: Initial commit
..


Initial commit

Bug: T147423
Change-Id: Ia156b8b057d04e7b0beedbbfe313c018d1b80477
---
A .gitignore
A LICENSE
A README.md
A hhvm_exporter.py
A hhvm_exporter_test.py
A setup.py
A tox.ini
7 files changed, 520 insertions(+), 0 deletions(-)

Approvals:
  Filippo Giunchedi: Verified; Looks good to me, approved
  Giuseppe Lavagetto: Looks good to me, but someone else must approve



diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..3cb8065
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+__pycache__/
+*.egg-info/
+.venv/
+.tox/
+*.pyc
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000..261eeb9
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+   Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+  "License" shall mean the terms and conditions for use, reproduction,
+  and distribution as defined by Sections 1 through 9 of this document.
+
+  "Licensor" shall mean the copyright owner or entity authorized by
+  the copyright owner that is granting the License.
+
+  "Legal Entity" shall mean the union of the acting entity and all
+  other entities that control, are controlled by, or are under common
+  control with that entity. For the purposes of this definition,
+  "control" means (i) the power, direct or indirect, to cause the
+  direction or management of such entity, whether by contract or
+  otherwise, or (ii) ownership of fifty percent (50%) or more of the
+  outstanding shares, or (iii) beneficial ownership of such entity.
+
+  "You" (or "Your") shall mean an individual or Legal Entity
+  exercising permissions granted by this License.
+
+  "Source" form shall mean the preferred form for making modifications,
+  including but not limited to software source code, documentation
+  source, and configuration files.
+
+  "Object" form shall mean any form resulting from mechanical
+  transformation or translation of a Source form, including but
+  not limited to compiled object code, generated documentation,
+  and conversions to other media types.
+
+  "Work" shall mean the work of authorship, whether in Source or
+  Object form, made available under the License, as indicated by a
+  copyright notice that is included in or attached to the work
+  (an example is provided in the Appendix below).
+
+  "Derivative Works" shall mean any work, whether in Source or Object
+  form, that is based on (or derived from) the Work and for which the
+  editorial revisions, annotations, elaborations, or other modifications
+  represent, as a whole, an original work of authorship. For the purposes
+  of this License, Derivative Works shall not include works that remain
+  separable from, or merely link (or bind by name) to the interfaces of,
+  the Work and Derivative Works thereof.
+
+  "Contribution" shall mean any work of authorship, including
+  the original version of the Work and any modifications or additions
+  to that Work or Derivative Works thereof, that is intentionally
+  submitted to Licensor for inclusion in the Work by the copyright owner
+  or by an individual or Legal Entity authorized to submit on behalf of
+  the copyright owner. For the purposes of this definition, "submitted"
+  means any form of electronic, verbal, or written communication sent
+  to the Licensor or its representatives, including but not limited to
+  communication on electronic mailing lists, source code control systems,
+  and issue tracking systems that are managed by, or on behalf of, the
+  Licensor for the purpose of discussing and improving the Work, but
+  excluding communication that is conspicuously marked or otherwise
+  designated in writing by the copyright owner as "Not a Contribution."
+
+  "Contributor" shall mean Licensor and any individual or Legal Entity
+  on behalf of whom a Contribution has been received by Licensor and
+  subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+  this License, each Contributor hereby grants to You a perpetual,
+  worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+  copyright license to reproduce, prepare Derivative Works of,
+  publicly display, publicly perform, sublicense, and distribute the
+  Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+  this License, each Contributor hereby grants to You a perpetual,
+  worldwide, 

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [bugfix] Solve pagegeneratrors_tests.TestFactoryGeneratorWik...

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

Change subject: [bugfix] Solve 
pagegeneratrors_tests.TestFactoryGeneratorWikibase tests
..


[bugfix] Solve pagegeneratrors_tests.TestFactoryGeneratorWikibase tests

- P357 was redirected to P1476. Use the new property ID to solve the
  KeyError
- There was a hidden bug when comparing the WbMonolingualText because
  value is a basestring and does not have a __dict__ which is used by
  the WbRepresentation class. Add a new part for WBMonolingualText into
  Claim.target_equals() to solve it

Bug: T150653
Change-Id: I4a2602d7d27f66615699af90b599a8a0ad623c50
---
M pywikibot/page.py
M tests/pagegenerators_tests.py
2 files changed, 7 insertions(+), 2 deletions(-)

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



diff --git a/pywikibot/page.py b/pywikibot/page.py
index 165e7c8..9c59baf 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -4631,6 +4631,7 @@
 - ItemPage ID equality
 - WbTime year equality
 - Coordinate equality, regarding precision
+- WbMonolingualText text equality
 - direct equality
 
 @param value: the value to compare with
@@ -4662,6 +4663,10 @@
 return (abs(self.target.lat - coord_args[0]) <= precision and
 abs(self.target.lon - coord_args[1]) <= precision)
 
+if (isinstance(self.target, pywikibot.WbMonolingualText) and
+isinstance(value, basestring)):
+return self.target.text == value
+
 return self.target == value
 
 def has_qualifier(self, qualifier_id, target):
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index 06380ef..6b243ee 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -1007,7 +1007,7 @@
 """Test -onlyif without qualifiers."""
 gf = pagegenerators.GeneratorFactory(site=self.site)
 gf.handleArg('-page:Q15745378')
-gf.handleArg('-onlyif:P357=International Journal of Minerals\, '
+gf.handleArg('-onlyif:P1476=International Journal of Minerals\, '
  'Metallurgy\, and Materials')
 gen = gf.getCombinedGenerator()
 self.assertIsNotNone(gen)
@@ -1017,7 +1017,7 @@
 """Test -onlyifnot without qualifiers."""
 gf = pagegenerators.GeneratorFactory(site=self.site)
 gf.handleArg('-page:Q15745378')
-gf.handleArg('-onlyifnot:P357=International Journal of Minerals\, '
+gf.handleArg('-onlyifnot:P1476=International Journal of Minerals\, '
  'Metallurgy\, and Materials')
 gen = gf.getCombinedGenerator()
 self.assertIsNotNone(gen)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4a2602d7d27f66615699af90b599a8a0ad623c50
Gerrit-PatchSet: 6
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt 
Gerrit-Reviewer: Dalba 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: M4tx 
Gerrit-Reviewer: Merlijn van Deen 
Gerrit-Reviewer: Mpaa 
Gerrit-Reviewer: Xqt 
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]: Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/me...

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

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

Change subject: Merge branch 'master' of 
ssh://gerrit.wikimedia.org:29418/mediawiki/core into 
review/mooeypoo/mw-recentchanges-filters
..

Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/mediawiki/core into 
review/mooeypoo/mw-recentchanges-filters

Change-Id: I2bef24481460a0ea20f38635f0098de854590eb5
---
M tests/qunit/QUnitTestResources.php
A 
tests/qunit/suites/resources/mediawiki.rcfilters/mediawiki.rcfilters.dm.FiltersViewModel.test.js
2 files changed, 365 insertions(+), 0 deletions(-)


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

diff --git a/tests/qunit/QUnitTestResources.php 
b/tests/qunit/QUnitTestResources.php
index e30088d..2f8372c 100644
--- a/tests/qunit/QUnitTestResources.php
+++ b/tests/qunit/QUnitTestResources.php
@@ -93,6 +93,7 @@

'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.watch.test.js',

'tests/qunit/suites/resources/mediawiki.api/mediawiki.ForeignApi.test.js',

'tests/qunit/suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js',
+   
'tests/qunit/suites/resources/mediawiki.rcfilters/mediawiki.rcfilters.dm.FiltersViewModel.test.js',

'tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js',

'tests/qunit/suites/resources/mediawiki/mediawiki.cldr.test.js',

'tests/qunit/suites/resources/mediawiki/mediawiki.cookie.test.js',
@@ -136,6 +137,7 @@
'mediawiki.util',
'mediawiki.viewport',
'mediawiki.special.recentchanges',
+   'mediawiki.rcfilters.filters',
'mediawiki.language',
'mediawiki.cldr',
'mediawiki.cookie',
diff --git 
a/tests/qunit/suites/resources/mediawiki.rcfilters/mediawiki.rcfilters.dm.FiltersViewModel.test.js
 
b/tests/qunit/suites/resources/mediawiki.rcfilters/mediawiki.rcfilters.dm.FiltersViewModel.test.js
new file mode 100644
index 000..98b9d3f
--- /dev/null
+++ 
b/tests/qunit/suites/resources/mediawiki.rcfilters/mediawiki.rcfilters.dm.FiltersViewModel.test.js
@@ -0,0 +1,363 @@
+( function ( mw, $ ) {
+   QUnit.module( 'mediawiki.rcfilters - FiltersViewModel' );
+
+   QUnit.test( 'Setting up filters', function ( assert ) {
+   var definition = {
+   group1: {
+   title: 'Group 1',
+   type: 'send_unselected_if_any',
+   filters: [
+   {
+   name: 'group1filter1',
+   label: 'Group 1: Filter 
1',
+   description: 
'Description of Filter 1 in Group 1'
+   },
+   {
+   name: 'group1filter2',
+   label: 'Group 1: Filter 
2',
+   description: 
'Description of Filter 2 in Group 1'
+   }
+   ]
+   },
+   group2: {
+   title: 'Group 2',
+   type: 'send_unselected_if_any',
+   filters: [
+   {
+   name: 'group2filter1',
+   label: 'Group 2: Filter 
1',
+   description: 
'Description of Filter 1 in Group 2'
+   },
+   {
+   name: 'group2filter2',
+   label: 'Group 2: Filter 
2',
+   description: 
'Description of Filter 2 in Group 2'
+   }
+   ]
+   }
+   },
+   model = new mw.rcfilters.dm.FiltersViewModel();
+
+   model.setFilters( definition );
+
+   assert.ok(
+   model.getItemByName( 'group1filter1' ) instanceof 
mw.rcfilters.dm.FilterItem &&
+  

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Shift 10 more extensions to use wfLoadExtension()

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

Change subject: Shift 10 more extensions to use wfLoadExtension()
..


Shift 10 more extensions to use wfLoadExtension()

Swap in extension-list too:

* CodeEditor
* ContactPage
* DynamicPageList (intersection)
* PagedTiffHandler
* PageImages
* Renameuser
* SiteMatrix
* wikihiero
* ZeroBanner
* ZeroPortal

Bug: T140852
Change-Id: I40453260166f076f626838a4ab3a7105776e2446
---
M wmf-config/CommonSettings.php
M wmf-config/extension-list
2 files changed, 13 insertions(+), 14 deletions(-)

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



diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index e348553..edd6574 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -466,7 +466,7 @@
 }
 
 if ( $wmgUsePagedTiffHandler ) {
-   include( $IP . '/extensions/PagedTiffHandler/PagedTiffHandler.php' );
+   wfLoadExtension( 'PagedTiffHandler' );
 }
 $wgTiffUseTiffinfo = true;
 $wgTiffMaxMetaSize = 1048576;
@@ -689,10 +689,10 @@
 putenv( "GDFONTPATH=/srv/mediawiki/fonts" );
 
 if ( $wmgUseWikiHiero ) {
-   include( $IP . '/extensions/wikihiero/wikihiero.php' );
+   wfLoadExtension( 'wikihiero' );
 }
 
-include( $IP . '/extensions/SiteMatrix/SiteMatrix.php' );
+wfLoadExtension( 'SiteMatrix' );
 
 // Config for sitematrix
 $wgSiteMatrixFile = ( $wmfRealm === 'labs' ) ? "$IP/../langlist-labs" : 
"$IP/../langlist";
@@ -961,7 +961,7 @@
 $wgTrustedXffFile = "$wmfConfigDir/trusted-xff.php";
 
 if ( $wmgUseContactPage ) {
-   include( $IP . '/extensions/ContactPage/ContactPage.php' );
+   wfLoadExtension( 'ContactPage' );
$wgContactConfig = [];
$wgContactConfig['default'] = [
'RecipientUser' => null,
@@ -1150,10 +1150,10 @@
 $wgAPIModules['imagerotate'] = 'ApiDisabled';
 
 if ( $wmgUseDPL ) {
-   include( $IP . '/extensions/intersection/DynamicPageList.php' );
+   wfLoadExtension( 'intersection' );
 }
 
-include( $IP . '/extensions/Renameuser/Renameuser.php' );
+wfLoadExtension( 'Renameuser' );
 $wgGroupPermissions['bureaucrat']['renameuser'] = $wmgAllowLocalRenameuser;
 
 if ( $wmgUseSpecialNuke ) {
@@ -2883,7 +2883,7 @@
$wgExtraNamespaces[470] = 'Schema';
$wgExtraNamespaces[471] = 'Schema_talk';
 
-   include_once( "$IP/extensions/CodeEditor/CodeEditor.php" );
+   wfLoadExtension( 'CodeEditor' );
$wgCodeEditorEnableCore = $wmgUseCodeEditorForCore; // For 
safety's sake
}
 
@@ -3011,7 +3011,7 @@
 }
 
 if ( $wmgUsePageImages ) {
-   require_once( "$IP/extensions/PageImages/PageImages.php" );
+   wfLoadExtension( 'PageImages' );
$wgPageImagesExpandOpenSearchXml = $wmgPageImagesExpandOpenSearchXml;
$wgPageImagesUseGalleries = $wmgPageImagesUseGalleries;
 }
@@ -3031,8 +3031,7 @@
 }
 
 if ( $wmgZeroPortal ) {
-   require_once( "$IP/extensions/ZeroBanner/ZeroBanner.php" );
-   require_once( "$IP/extensions/ZeroPortal/ZeroPortal.php" );
+   wfLoadExtensions( [ 'ZeroBanner', 'ZeroPortal' ] );
 
// zerowiki treats all logged-in users the same as anonymous, without 
giving them any extra rights
// Only sysops and scripts get additional rights on zerowiki
diff --git a/wmf-config/extension-list b/wmf-config/extension-list
index 37ca054..7c5ab66 100644
--- a/wmf-config/extension-list
+++ b/wmf-config/extension-list
@@ -85,8 +85,8 @@
 $IP/extensions/OAuth/extension.json
 $IP/extensions/ORES/extension.json
 $IP/extensions/PageAssessments/extension.json
-$IP/extensions/PagedTiffHandler/PagedTiffHandler.php
-$IP/extensions/PageImages/PageImages.php
+$IP/extensions/PagedTiffHandler/extension.json
+$IP/extensions/PageImages/extension.json
 $IP/extensions/PageTriage/PageTriage.php
 $IP/extensions/ParserFunctions/extension.json
 $IP/extensions/ParsoidBatchAPI/extension.json
@@ -142,8 +142,8 @@
 $IP/extensions/WikimediaIncubator/extension.json
 $IP/extensions/WikimediaMessages/extension.json
 $IP/extensions/XAnalytics/extension.json
-$IP/extensions/ZeroBanner/ZeroBanner.php
-$IP/extensions/ZeroPortal/ZeroPortal.php
+$IP/extensions/ZeroBanner/extension.json
+$IP/extensions/ZeroPortal/extension.json
 $IP/skins/CologneBlue/skin.json
 $IP/skins/Modern/skin.json
 $IP/skins/MonoBook/skin.json

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I40453260166f076f626838a4ab3a7105776e2446
Gerrit-PatchSet: 4
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Fix utf8 output of explain printer

2016-11-17 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Fix utf8 output of explain printer
..

Fix utf8 output of explain printer

Change-Id: I98d6ec8d0491a32b3918442d104d658370ca42d5
---
M includes/CirrusSearch.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/includes/CirrusSearch.php b/includes/CirrusSearch.php
index 4681375..b75221c 100644
--- a/includes/CirrusSearch.php
+++ b/includes/CirrusSearch.php
@@ -445,6 +445,7 @@
if ( $dumpQuery || $dumpResult ) {
$header = null;
if ( $this->request && $this->request->getVal( 
'cirrusExplain' ) === 'pretty' ) {
+   $header = 'Content-type: text/html; 
charset=UTF-8';
$printer = new CirrusSearch\ExplainPrinter();
$result = $printer->format( $result );
} else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I98d6ec8d0491a32b3918442d104d658370ca42d5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: WIP Add grafana_json_datasource

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

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

Change subject: WIP Add grafana_json_datasource
..

WIP Add grafana_json_datasource

Bug: T147328
Change-Id: I42be8d7f6ee5a6873541fcf00ee6f3af98920981
---
A modules/grafana_json_datasource/files/annotations.php
A modules/grafana_json_datasource/files/index.php
A modules/grafana_json_datasource/files/query.php
A modules/grafana_json_datasource/files/search.php
A modules/grafana_json_datasource/manifests/init.pp
A modules/role/manifests/grafana_json_datasource.pp
6 files changed, 156 insertions(+), 0 deletions(-)


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

diff --git a/modules/grafana_json_datasource/files/annotations.php 
b/modules/grafana_json_datasource/files/annotations.php
new file mode 100644
index 000..394ae33
--- /dev/null
+++ b/modules/grafana_json_datasource/files/annotations.php
@@ -0,0 +1,82 @@
+https://github.com/grafana/simple-json-datasource
+ *
+ * @TODO
+ *  - Only provide annotations for the given range?
+ */
+
+if ( $_SERVER['REQUEST_METHOD'] === 'OPTIONS' ) {
+   header('Access-Control-Allow-Headers:accept, content-type');
+   header('Access-Control-Allow-Methods:POST');
+   header('Access-Control-Allow-Origin:*');
+   return;
+}
+
+
+if ( $_SERVER['REQUEST_METHOD'] === 'POST' ) {
+   $requestBody = file_get_contents('php://input');
+   $request = json_decode( $requestBody, true );
+
+   if ( $request === null ) {
+   die( 'Bad request JSON.' );
+   }
+
+   $query = trim( strtok( $request['annotation']['query'], ' ' ), '#' );
+
+   if ( strpos( $query, 'metawiki:' ) !== 0 ) {
+   die( 'Couldn\'t find metawiki: prefix.' );
+   }
+   $pageTitle = substr( $query, 9 );
+
+   $pageUrl = 'https://meta.wikimedia.org/wiki/' . $pageTitle . 
'?action=raw';
+   $pageBody = file_get_contents( $pageUrl );
+
+   if( $pageBody === false ) {
+   die( 'Request to ' . $pageUrl . ' failed.' );
+   }
+
+   $data = json_decode( $pageBody, true );
+
+   if ( $data === null ) {
+   die( 'Bad page JSON.' );
+   }
+
+   $response = array();
+
+   foreach( $data as $annotationData ) {
+
+   if ( $annotationData['start'] == $annotationData['end'] ) {
+   $response[] = array(
+   'annotation' => $request['annotation'],
+   'title' => 'Event',
+   'time' => strval( strtotime( 
$annotationData['start'] ) ) . '000',
+   'text' => $annotationData['note'],
+   );
+   } else {
+   $response[] = array(
+   'annotation' => $request['annotation'],
+   'title' => 'Start Event',
+   'time' => strval( strtotime( 
$annotationData['start'] ) ) . '000',
+   'text' => 'Start: ' . $annotationData['note'],
+   );
+   $response[] = array(
+   'annotation' => $request['annotation'],
+   'title' => 'End Event',
+   'time' => strval( strtotime( 
$annotationData['end'] ) ) . '000',
+   'text' => 'End: ' . $annotationData['note'],
+   );
+   }
+   }
+
+   header( 'Access-Control-Allow-Origin: *' );
+   echo json_encode( $response );
+   return;
+}
+
+die( 'Request must be POST or OPTIONS.' );
diff --git a/modules/grafana_json_datasource/files/index.php 
b/modules/grafana_json_datasource/files/index.php
new file mode 100644
index 000..5142b3f
--- /dev/null
+++ b/modules/grafana_json_datasource/files/index.php
@@ -0,0 +1,5 @@
+http://grafana.org/> for details.
+#
+# This Grafana JSON datasource is a collection of simple scripts forming
+# a web api endpoint conforming to the spec laid out in by:
+# https://github.com/grafana/simple-json-datasource
+#
+class grafana_json_datasource(
+$site_name,
+$docroot
+) {
+
+apache::site { $site_name:
+content => 
template("grafana_json_datasource/apache/grafana-json-datasource.wikimedia.org.erb");
+}
+
+file { '/srv/grafana_json_datasource':
+ensure => 'directory',
+owner  => 'www-data',
+group  => 'www-data',
+}
+
+$files = [
+"index.php",
+"annotations.php",
+"query.php",
+"search.php",
+]
+
+file { "/srv/grafana_json_datasource/$files":
+ensure  => present,
+owner   => 'root',
+group   => 'root',
+source  => "puppet:///modules/grafana_json_datasource/$files",
+}
+}
diff --git a/modules/role/manifests/grafana_json_datasource.pp 

[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Remove unused MinfraudActionRanges global

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

Change subject: Remove unused MinfraudActionRanges global
..


Remove unused MinfraudActionRanges global

The MinFraud score is not considered on its own, rather it is combined
with the rest of the filter scores and an action is determined by
consulting the CustomFiltersActionRanges global.

Change-Id: I9d9d07c16a2f1f7a9342c3aa571c9aff7854c48f
---
M README.txt
M extension.json
M extras/custom_filters/filters/minfraud/minfraud.body.php
3 files changed, 18 insertions(+), 59 deletions(-)

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



diff --git a/README.txt b/README.txt
index 317bca0..dc47937 100644
--- a/README.txt
+++ b/README.txt
@@ -383,7 +383,21 @@
 $wgDonationInterfaceForbiddenCountries = array()
 
 //Custom Filters globals
-//Define the action to take for a given $risk_score
+/**
+ * Set the risk score ranges that will cause a particular 'action'
+ *
+ * The keys to the array are the 'actions' to be taken (eg 'process').
+ * The value for one of these keys is an array representing the lower
+ * and upper bounds for that action.  For instance,
+ *  $wgDonationInterfaceCustomFiltersActionRanges = array(
+ * 'process' => array( 0, 100)
+ * ...
+ * )
+ * means that any transaction with a risk score greater than or equal
+ * to 0 and less than or equal to 100 will be given the 'process' action.
+ *
+ * These are evaluated on a >= or <= basis.
+ */
 $wgDonationInterfaceCustomFiltersActionRanges = array(
'process' => array( 0, 100 ),
'review' => array( -1, -1 ),
@@ -392,11 +406,11 @@
 )
 
 /**
- * A value for tracking the 'riskiness' of a transaction
+ * A base value for tracking the 'riskiness' of a transaction
  *
  * The action to take based on a transaction's riskScore is determined by
- * $action_ranges.  This is built assuming a range of possible risk scores
- * as 0-100, although you can probably bend this as needed.
+ * CustomFiltersActionRanges.  This is built assuming a range of possible
+ * risk scores as 0-100, although you can probably bend this as needed.
  */
 $wgDonationInterfaceCustomFiltersRiskScore = 0
 
@@ -405,29 +419,6 @@
  * Your minFraud license key.
  */
 $wgMinFraudLicenseKey = ''
-
-/**
- * Set the risk score ranges that will cause a particular 'action'
- *
- * The keys to the array are the 'actions' to be taken (eg 'process').
- * The value for one of these keys is an array representing the lower
- * and upper bounds for that action.  For instance,
- *   $wgDonationInterfaceMinFraudActionRanges = array(
- * 'process' => array( 0, 100)
- * ...
- * )
- * means that any transaction with a risk score greather than or equal
- * to 0 and less than or equal to 100 will be given the 'process' action.
- *
- * These are evauluated on a >= or <= basis.  Please refer to minFraud
- * documentation for a thorough explanation of the 'riskScore'.
- */
-$wgDonationInterfaceMinFraudActionRanges = array(
-   'process' => array( 0, 100 ),
-   'review' => array( -1, -1 ),
-   'challenge' => array( -1, -1 ),
-   'reject' => array( -1, -1 )
-)
 
 /**
  * This allows setting where to point the minFraud servers.
diff --git a/extension.json b/extension.json
index 494c229..8dc238b 100644
--- a/extension.json
+++ b/extension.json
@@ -408,25 +408,6 @@
},
"DonationInterfaceCustomFiltersRiskScore": 0,
"MinFraudLicenseKey": "",
-   "DonationInterfaceMinFraudActionRanges": {
-   "process": [
-   0,
-   100
-   ],
-   "review": [
-   -1,
-   -1
-   ],
-   "challenge": [
-   -1,
-   -1
-   ],
-   "reject": [
-   -1,
-   -1
-   ],
-   "_merge_strategy": "array_plus_2d"
-   },
"DonationInterfaceMinFraudServers": [],
"MinFraudTimeout": 2,
"DonationInterfaceMinFraudAlarmLimit": 25000,
diff --git a/extras/custom_filters/filters/minfraud/minfraud.body.php 
b/extras/custom_filters/filters/minfraud/minfraud.body.php
index 009f96d..ee523fb 100644
--- a/extras/custom_filters/filters/minfraud/minfraud.body.php
+++ b/extras/custom_filters/filters/minfraud/minfraud.body.php
@@ -31,7 +31,6 @@
  * @code
  * $wgDonationInterfaceEnableMinfraud = true;
  * $wgMinFraudLicenseKey = 'YOUR LICENSE KEY';
- * $wgDonationInterfaceMinFraudActionRanges
  * @endcode
  */
 class Gateway_Extras_CustomFilters_MinFraud extends Gateway_Extras {
@@ -85,12 +84,6 @@
protected 

[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.29.0-wmf.3]: Revert "Revert "resourceloader: Make cache-eval in mw.loader...

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

Change subject: Revert "Revert "resourceloader: Make cache-eval in 
mw.loader.work asynchronous""
..


Revert "Revert "resourceloader: Make cache-eval in mw.loader.work asynchronous""

Undo the temp revert for observing metrics for T146510.

This reverts commit 29f0b2319f34651d6f494567450af4132f554bb0.

Change-Id: I67e972dc4dd8149d97a407f08887db6a008705cb
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 33 insertions(+), 16 deletions(-)

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



diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 9bb0ec8..d525813 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -1666,6 +1666,26 @@
}
 
/**
+* @private
+* @param {string[]} implementations Array containing 
pieces of JavaScript code in the
+*  form of calls to mw.loader#implement().
+* @param {Function} cb Callback in case of failure
+* @param {Error} cb.err
+*/
+   function asyncEval( implementations, cb ) {
+   if ( !implementations.length ) {
+   return;
+   }
+   mw.requestIdleCallback( function () {
+   try {
+   $.globalEval( 
implementations.join( ';' ) );
+   } catch ( err ) {
+   cb( err );
+   }
+   } );
+   }
+
+   /**
 * Make a versioned key for a specific module.
 *
 * @private
@@ -1718,7 +1738,7 @@
 * @protected
 */
work: function () {
-   var q, batch, concatSource, origBatch;
+   var q, batch, implementations, 
sourceModules;
 
batch = [];
 
@@ -1748,19 +1768,18 @@
 
mw.loader.store.init();
if ( mw.loader.store.enabled ) {
-   concatSource = [];
-   origBatch = batch;
+   implementations = [];
+   sourceModules = [];
batch = $.grep( batch, function 
( module ) {
-   var source = 
mw.loader.store.get( module );
-   if ( source ) {
-   
concatSource.push( source );
+   var implementation = 
mw.loader.store.get( module );
+   if ( implementation ) {
+   
implementations.push( implementation );
+   
sourceModules.push( module );
return false;
}
return true;
} );
-   try {
-   $.globalEval( 
concatSource.join( ';' ) );
-   } catch ( err ) {
+   asyncEval( implementations, 
function ( err ) {
// Not good, the cached 
mw.loader.implement calls failed! This should
// never happen, 
barring ResourceLoader bugs, browser bugs and PEBKACs.
// Depending on how 
corrupt the string is, it is likely that some
@@ -1772,16 +1791,14 @@
// something that 
infected the implement call itself, don't take any
// risks and clear 
everything in this cache.
mw.loader.store.clear();
-   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: registration: Set "FileExtensions" to $GLOBALS

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

Change subject: registration: Set "FileExtensions" to $GLOBALS
..


registration: Set "FileExtensions" to $GLOBALS

Change-Id: Ie52004d25ebc06c81cd7d8d7de60479ff365ccea
---
M docs/extension.schema.json
M docs/extension.schema.v1.json
M includes/registration/ExtensionProcessor.php
3 files changed, 9 insertions(+), 0 deletions(-)

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



diff --git a/docs/extension.schema.json b/docs/extension.schema.json
index 38b5dea..638ee5d 100644
--- a/docs/extension.schema.json
+++ b/docs/extension.schema.json
@@ -650,6 +650,10 @@
"type": "object",
"description": "Password policies"
},
+   "FileExtensions": {
+   "type": "object",
+   "description": "Preferred file extensions for uploading"
+   },
"callback": {
"type": [
"array",
diff --git a/docs/extension.schema.v1.json b/docs/extension.schema.v1.json
index f7c0a2b..4d5c44f 100644
--- a/docs/extension.schema.v1.json
+++ b/docs/extension.schema.v1.json
@@ -640,6 +640,10 @@
"type": "object",
"description": "Password policies"
},
+   "FileExtensions": {
+   "type": "object",
+   "description": "Preferred file extensions for uploading"
+   },
"callback": {
"type": [
"array",
diff --git a/includes/registration/ExtensionProcessor.php 
b/includes/registration/ExtensionProcessor.php
index 8fa71be..207f884 100644
--- a/includes/registration/ExtensionProcessor.php
+++ b/includes/registration/ExtensionProcessor.php
@@ -26,6 +26,7 @@
'ExtensionEntryPointListFiles',
'ExtensionFunctions',
'FeedClasses',
+   'FileExtensions',
'FilterLogTypes',
'GrantPermissionGroups',
'GrantPermissions',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie52004d25ebc06c81cd7d8d7de60479ff365ccea
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Jforrester 
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[wmf/1.29.0-wmf.3]: Revert "Revert "resourceloader: Make cache-eval in mw.loader...

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

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

Change subject: Revert "Revert "resourceloader: Make cache-eval in 
mw.loader.work asynchronous""
..

Revert "Revert "resourceloader: Make cache-eval in mw.loader.work asynchronous""

Undo the temp revert for observing metrics for T146510.

This reverts commit 29f0b2319f34651d6f494567450af4132f554bb0.

Change-Id: I67e972dc4dd8149d97a407f08887db6a008705cb
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 33 insertions(+), 16 deletions(-)


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

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 9bb0ec8..d525813 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -1666,6 +1666,26 @@
}
 
/**
+* @private
+* @param {string[]} implementations Array containing 
pieces of JavaScript code in the
+*  form of calls to mw.loader#implement().
+* @param {Function} cb Callback in case of failure
+* @param {Error} cb.err
+*/
+   function asyncEval( implementations, cb ) {
+   if ( !implementations.length ) {
+   return;
+   }
+   mw.requestIdleCallback( function () {
+   try {
+   $.globalEval( 
implementations.join( ';' ) );
+   } catch ( err ) {
+   cb( err );
+   }
+   } );
+   }
+
+   /**
 * Make a versioned key for a specific module.
 *
 * @private
@@ -1718,7 +1738,7 @@
 * @protected
 */
work: function () {
-   var q, batch, concatSource, origBatch;
+   var q, batch, implementations, 
sourceModules;
 
batch = [];
 
@@ -1748,19 +1768,18 @@
 
mw.loader.store.init();
if ( mw.loader.store.enabled ) {
-   concatSource = [];
-   origBatch = batch;
+   implementations = [];
+   sourceModules = [];
batch = $.grep( batch, function 
( module ) {
-   var source = 
mw.loader.store.get( module );
-   if ( source ) {
-   
concatSource.push( source );
+   var implementation = 
mw.loader.store.get( module );
+   if ( implementation ) {
+   
implementations.push( implementation );
+   
sourceModules.push( module );
return false;
}
return true;
} );
-   try {
-   $.globalEval( 
concatSource.join( ';' ) );
-   } catch ( err ) {
+   asyncEval( implementations, 
function ( err ) {
// Not good, the cached 
mw.loader.implement calls failed! This should
// never happen, 
barring ResourceLoader bugs, browser bugs and PEBKACs.
// Depending on how 
corrupt the string is, it is likely that some
@@ -1772,16 +1791,14 @@
// something that 
infected the implement call itself, don't take any
// risks and clear 
everything in this cache.

[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Fix width of timezone column

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

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

Change subject: Fix width of timezone column
..

Fix width of timezone column

Match the source table in CiviCRM. We were getting a lot of
truncation warnings.

Change-Id: I06e137a37b2aa03a3cc0756dc743ad0debde0ecb
---
M silverpop_export/update_table.sql
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/18/322218/1

diff --git a/silverpop_export/update_table.sql 
b/silverpop_export/update_table.sql
index 06e2e5d..fc0f563 100755
--- a/silverpop_export/update_table.sql
+++ b/silverpop_export/update_table.sql
@@ -45,7 +45,7 @@
   country varchar(2),
   state varchar(64),
   postal_code varchar(128),
-  timezone varchar(5),
+  timezone varchar(8),
 
   INDEX spex_contact_id (contact_id),
   INDEX spex_email (email),
@@ -232,7 +232,7 @@
   country varchar(2),
   state varchar(64),
   postal_code varchar(128),
-  timezone varchar(5)
+  timezone varchar(8)
 ) COLLATE 'utf8_unicode_ci';
 
 -- (16 minutes)
@@ -374,7 +374,7 @@
   country varchar(2),
   state varchar(64),
   postal_code varchar(128),
-  timezone varchar(5),
+  timezone varchar(8),
 
   INDEX rspex_contact_id (contact_id),
   INDEX rspex_email (email),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I06e137a37b2aa03a3cc0756dc743ad0debde0ecb
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[wmf/1.29.0-wmf.3]: Revert "resourceloader: Make cache-eval in mw.loader.work as...

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

Change subject: Revert "resourceloader: Make cache-eval in mw.loader.work 
asynchronous"
..


Revert "resourceloader: Make cache-eval in mw.loader.work asynchronous"

This is to be applied to wmf.3 only to help verify the root cause
of T146510 one last time.

This reverts commit 2a895edbd23f796206e26fb7d08a79fe6c653103.

Change-Id: Ie21f5c3a7c34ccb273342fc3952bafd975cec088
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 16 insertions(+), 33 deletions(-)

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



diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index d525813..9bb0ec8 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -1666,26 +1666,6 @@
}
 
/**
-* @private
-* @param {string[]} implementations Array containing 
pieces of JavaScript code in the
-*  form of calls to mw.loader#implement().
-* @param {Function} cb Callback in case of failure
-* @param {Error} cb.err
-*/
-   function asyncEval( implementations, cb ) {
-   if ( !implementations.length ) {
-   return;
-   }
-   mw.requestIdleCallback( function () {
-   try {
-   $.globalEval( 
implementations.join( ';' ) );
-   } catch ( err ) {
-   cb( err );
-   }
-   } );
-   }
-
-   /**
 * Make a versioned key for a specific module.
 *
 * @private
@@ -1738,7 +1718,7 @@
 * @protected
 */
work: function () {
-   var q, batch, implementations, 
sourceModules;
+   var q, batch, concatSource, origBatch;
 
batch = [];
 
@@ -1768,18 +1748,19 @@
 
mw.loader.store.init();
if ( mw.loader.store.enabled ) {
-   implementations = [];
-   sourceModules = [];
+   concatSource = [];
+   origBatch = batch;
batch = $.grep( batch, function 
( module ) {
-   var implementation = 
mw.loader.store.get( module );
-   if ( implementation ) {
-   
implementations.push( implementation );
-   
sourceModules.push( module );
+   var source = 
mw.loader.store.get( module );
+   if ( source ) {
+   
concatSource.push( source );
return false;
}
return true;
} );
-   asyncEval( implementations, 
function ( err ) {
+   try {
+   $.globalEval( 
concatSource.join( ';' ) );
+   } catch ( err ) {
// Not good, the cached 
mw.loader.implement calls failed! This should
// never happen, 
barring ResourceLoader bugs, browser bugs and PEBKACs.
// Depending on how 
corrupt the string is, it is likely that some
@@ -1791,14 +1772,16 @@
// something that 
infected the implement call itself, don't take any
// risks and clear 
everything in this cache.
mw.loader.store.clear();
-
+   

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

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

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


Merge branch 'master' into deploy

b1006f5 Fix spacing
06124bb Paypal audit: fix checking for refunds in CiviCRM

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

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6c1a60989a221e808b9fb740853bb1feb9921c08
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: deploy
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] operations/mediawiki-config[master]: Add REL1_28 to ExtensionDistributor

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

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

Change subject: Add REL1_28 to ExtensionDistributor
..

Add REL1_28 to ExtensionDistributor

Not enabling it as stable yet since there is no stable release yet, but we 
should still addit.

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


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


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bb11c3e58164e750de15610ac2c6b53221bd501
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: 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

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

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

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

Merge branch 'master' into deploy

b1006f5 Fix spacing
06124bb Paypal audit: fix checking for refunds in CiviCRM

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


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/16/322216/1


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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Fix query snippet logging

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

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

Change subject: Fix query snippet logging
..

Fix query snippet logging

It's useless right now, because it always gets the first 80
characters of the query prefix.

Change-Id: I0f5d151be5f08144d5b6dd2ab44ad688f4f8b5b5
---
M silverpop_export/update.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/15/322215/1

diff --git a/silverpop_export/update.py b/silverpop_export/update.py
index cd117d5..67ec95c 100644
--- a/silverpop_export/update.py
+++ b/silverpop_export/update.py
@@ -42,7 +42,8 @@
 def run_queries(db, queries):
 i = 1
 for query in queries:
-info = (i, query[:80])
+no_prefix = query[query.index("\n")+1:]
+info = (i, no_prefix[:80])
 log.info("Running query #%s: %s" % info)
 db.execute(query)
 i += 1

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f5d151be5f08144d5b6dd2ab44ad688f4f8b5b5
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] operations/puppet[production]: toollabs: Fix maintain-kubeusers crashing

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

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

Change subject: toollabs: Fix maintain-kubeusers crashing
..

toollabs: Fix maintain-kubeusers crashing

Looks like if it was interrupted *once* between dir creation and
writing out the token file, it'll continue to fail forever.
Make it a little bit more robust

Change-Id: I98af8e27a328adba8daf4c039e8618456655dbce
---
M modules/toollabs/files/maintain-kubeusers
1 file changed, 19 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/13/322213/1

diff --git a/modules/toollabs/files/maintain-kubeusers 
b/modules/toollabs/files/maintain-kubeusers
index 3b4118c..991a097 100755
--- a/modules/toollabs/files/maintain-kubeusers
+++ b/modules/toollabs/files/maintain-kubeusers
@@ -234,7 +234,9 @@
 }
 dirpath = os.path.join('/data', 'project', user.name, '.kube')
 path = os.path.join(dirpath, 'config')
-os.makedirs(dirpath, mode=0o775, exist_ok=False)
+# exist_ok=True is fine here, and not a security issue (Famous last 
words?).
+# We also keep it owned by root, which is fine.
+os.makedirs(dirpath, mode=0o775, exist_ok=True)
 f = os.open(path, os.O_CREAT | os.O_WRONLY | os.O_NOFOLLOW)
 try:
 os.write(f, json.dumps(config, indent=4, 
sort_keys=True).encode('utf-8'))
@@ -252,11 +254,24 @@
 def create_homedir(user):
 """
 Create homedirs for new users
+
 """
 homepath = os.path.join('/data', 'project', user.name)
-os.makedirs(homepath, mode=0o775, exist_ok=False)
-os.chmod(homepath, 0o775 | stat.S_ISGID)
-os.chown(homepath, int(user.id), int(user.id))
+if not os.path.exists(homepath):
+# Try to not touch it if it already exists
+# This prevents us from messing with permissions while also
+# not crashing if homedirs already do exist
+# This also protects against the race exploit that can be done
+# by having a symlink from /data/project/$username point as a symlink
+# to anywhere else. The ordering we have here prevents it - if
+# it already exists in the race between the 'exists' check and the 
makedirs,
+# we will just fail. Then we switch mode but not ownership, so attacker
+# can not just delete and create a symlink to wherever. The chown
+# happens last, so should be ok.
+self.log.info('Homedir already exists for %s', homepath)
+os.makedirs(homepath, mode=0o775, exist_ok=False)
+os.chmod(homepath, 0o775 | stat.S_ISGID)
+os.chown(homepath, int(user.id), int(user.id))
 
 
 def create_namespace(user):

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: populateContentModel: Invalidate content model and revision ...

2016-11-17 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review.

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

Change subject: populateContentModel: Invalidate content model and revision 
cache
..

populateContentModel: Invalidate content model and revision cache

The cache is computed from both the default values and the DB.

If someone visits the page when the wrong default value is there,
it will be cached.

When we populate the DB with the correct value (usually in preparation
for changing the namespace default), we need to invalidate the
potentially broken cache.

Change-Id: I995c0d9fdec529a456762571d5406d0bd0d33aed
---
M maintenance/populateContentModel.php
1 file changed, 40 insertions(+), 1 deletion(-)


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

diff --git a/maintenance/populateContentModel.php 
b/maintenance/populateContentModel.php
index c6bd794..95e7a63 100644
--- a/maintenance/populateContentModel.php
+++ b/maintenance/populateContentModel.php
@@ -28,6 +28,10 @@
  *  populateContentModel.php --ns=1 --table=page
  */
 class PopulateContentModel extends Maintenance {
+   protected $wikiId;
+
+   protected $wanCache;
+
public function __construct() {
parent::__construct();
$this->addDescription( 'Populate the various content_* fields' 
);
@@ -38,6 +42,11 @@
 
public function execute() {
$dbw = $this->getDB( DB_MASTER );
+
+   $this->wikiId = $dbw->getWikiID();
+
+   $this->wanCache = ObjectCache::getMainWANInstance();
+
$ns = $this->getOption( 'ns' );
if ( !ctype_digit( $ns ) && $ns !== 'all' ) {
$this->error( 'Invalid namespace', 1 );
@@ -55,6 +64,17 @@
default:
$this->error( "Invalid table name: $table", 1 );
}
+   }
+
+   protected function clearCache( $page_id, $rev_id ) {
+   $contentModelKey = $this->wanCache->makeKey( 'page', 
'content-model', $rev_id );
+   $revisionKey = $this->wanCache->makeGlobalKey( 'revision', 
$this->wikiId, $page_id, $rev_id );
+
+   // WikiPage content model cache
+   $this->wanCache->delete( $contentModelKey );
+
+   // Revision object cache, which contains a content model
+   $this->wanCache->delete( $revisionKey );
}
 
private function updatePageRows( Database $dbw, $pageIds, $model ) {
@@ -117,6 +137,7 @@
[ $key => $ids ],
__METHOD__
);
+
$this->output( "done.\n" );
}
 
@@ -130,19 +151,24 @@
$fields = [ 'ar_namespace', 'ar_title' ];
$join_conds = [];
$where = $ns === 'all' ? [] : [ 'ar_namespace' => $ns ];
+   $page_id_column = 'ar_page_id';
+   $rev_id_column = 'ar_rev_id';
} else { // revision
$selectTables = [ 'revision', 'page' ];
$fields = [ 'page_title', 'page_namespace' ];
$join_conds = [ 'page' => [ 'INNER JOIN', 
'rev_page=page_id' ] ];
$where = $ns === 'all' ? [] : [ 'page_namespace' => $ns 
];
+   $page_id_column = 'rev_page';
+   $rev_id_column = 'rev_id';
}
 
$toSave = [];
+   $idsToClear = [];
$lastId = 0;
do {
$rows = $dbw->select(
$selectTables,
-   array_merge( $fields, [ $model_column, 
$format_column, $key ] ),
+   array_merge( $fields, [ $model_column, 
$format_column, $key, $page_id_column, $rev_id_column ] ),
// @todo support populating format if model is 
already set
[
$model_column => null,
@@ -174,9 +200,17 @@
if ( $dbModel === null && $dbFormat === null ) {
// Set the defaults
$toSave[$defaultModel][] = $row->{$key};
+   $idsToClear[] = [
+   'page_id' => 
$row->{$page_id_column},
+   'rev_id' => 
$row->{$rev_id_column},
+   ];
} else { // $dbModel === null, $dbFormat set.
if ( $dbFormat === $defaultFormat ) {
$toSave[$defaultModel][] = 
$row->{$key};
+   $idsToClear[] 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: registration: Support setting $wgPasswordPolicy in extension...

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

Change subject: registration: Support setting $wgPasswordPolicy in 
extension.json
..


registration: Support setting $wgPasswordPolicy in extension.json

Bug: T149597
Change-Id: I56c0b8932fcd42ec9b748529daa32a998fb19bf8
---
M docs/extension.schema.json
M docs/extension.schema.v1.json
M includes/registration/ExtensionProcessor.php
3 files changed, 10 insertions(+), 0 deletions(-)

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



diff --git a/docs/extension.schema.json b/docs/extension.schema.json
index 2cf5fe1..38b5dea 100644
--- a/docs/extension.schema.json
+++ b/docs/extension.schema.json
@@ -646,6 +646,10 @@
"SkinOOUIThemes": {
"type": "object"
},
+   "PasswordPolicy": {
+   "type": "object",
+   "description": "Password policies"
+   },
"callback": {
"type": [
"array",
diff --git a/docs/extension.schema.v1.json b/docs/extension.schema.v1.json
index 8659dff..f7c0a2b 100644
--- a/docs/extension.schema.v1.json
+++ b/docs/extension.schema.v1.json
@@ -636,6 +636,10 @@
"SkinOOUIThemes": {
"type": "object"
},
+   "PasswordPolicy": {
+   "type": "object",
+   "description": "Password policies"
+   },
"callback": {
"type": [
"array",
diff --git a/includes/registration/ExtensionProcessor.php 
b/includes/registration/ExtensionProcessor.php
index 26fbfa1..8fa71be 100644
--- a/includes/registration/ExtensionProcessor.php
+++ b/includes/registration/ExtensionProcessor.php
@@ -42,6 +42,7 @@
'LogRestrictions',
'LogTypes',
'MediaHandlers',
+   'PasswordPolicy',
'RateLimits',
'RecentChangesFlags',
'RemoveCredentialsBlacklist',
@@ -72,6 +73,7 @@
'wgNamespaceContentModels' => 'array_plus',
'wgNamespaceProtection' => 'array_plus',
'wgNamespacesWithSubpages' => 'array_plus',
+   'wgPasswordPolicy' => 'array_merge_recursive',
'wgRateLimits' => 'array_plus_2d',
'wgRevokePermissions' => 'array_plus_2d',
];

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I56c0b8932fcd42ec9b748529daa32a998fb19bf8
Gerrit-PatchSet: 8
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.29.0-wmf.3]: [DNM] Revert "resourceloader: Make cache-eval in mw.loader.w...

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

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

Change subject: [DNM] Revert "resourceloader: Make cache-eval in mw.loader.work 
asynchronous"
..

[DNM] Revert "resourceloader: Make cache-eval in mw.loader.work asynchronous"

This is to be applied to wmf.3 only to help verify the root cause
of T146510 one last time.

This reverts commit 2a895edbd23f796206e26fb7d08a79fe6c653103.

Change-Id: Ie21f5c3a7c34ccb273342fc3952bafd975cec088
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 16 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/12/322212/1

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index d525813..9bb0ec8 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -1666,26 +1666,6 @@
}
 
/**
-* @private
-* @param {string[]} implementations Array containing 
pieces of JavaScript code in the
-*  form of calls to mw.loader#implement().
-* @param {Function} cb Callback in case of failure
-* @param {Error} cb.err
-*/
-   function asyncEval( implementations, cb ) {
-   if ( !implementations.length ) {
-   return;
-   }
-   mw.requestIdleCallback( function () {
-   try {
-   $.globalEval( 
implementations.join( ';' ) );
-   } catch ( err ) {
-   cb( err );
-   }
-   } );
-   }
-
-   /**
 * Make a versioned key for a specific module.
 *
 * @private
@@ -1738,7 +1718,7 @@
 * @protected
 */
work: function () {
-   var q, batch, implementations, 
sourceModules;
+   var q, batch, concatSource, origBatch;
 
batch = [];
 
@@ -1768,18 +1748,19 @@
 
mw.loader.store.init();
if ( mw.loader.store.enabled ) {
-   implementations = [];
-   sourceModules = [];
+   concatSource = [];
+   origBatch = batch;
batch = $.grep( batch, function 
( module ) {
-   var implementation = 
mw.loader.store.get( module );
-   if ( implementation ) {
-   
implementations.push( implementation );
-   
sourceModules.push( module );
+   var source = 
mw.loader.store.get( module );
+   if ( source ) {
+   
concatSource.push( source );
return false;
}
return true;
} );
-   asyncEval( implementations, 
function ( err ) {
+   try {
+   $.globalEval( 
concatSource.join( ';' ) );
+   } catch ( err ) {
// Not good, the cached 
mw.loader.implement calls failed! This should
// never happen, 
barring ResourceLoader bugs, browser bugs and PEBKACs.
// Depending on how 
corrupt the string is, it is likely that some
@@ -1791,14 +1772,16 @@
// something that 
infected the implement call itself, don't take any
// risks and clear 
everything in this cache.
   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [DNM] Revert "resourceloader: Make cache-eval in mw.loader.w...

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

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

Change subject: [DNM] Revert "resourceloader: Make cache-eval in mw.loader.work 
asynchronous"
..

[DNM] Revert "resourceloader: Make cache-eval in mw.loader.work asynchronous"

This is to be applied to wmf.3 only to help verify the root cause
of T146510 one last time.

This reverts commit 2a895edbd23f796206e26fb7d08a79fe6c653103.

Change-Id: Ie21f5c3a7c34ccb273342fc3952bafd975cec088
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 16 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/11/322211/1

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 6b23439..f878e42 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -1681,26 +1681,6 @@
}
 
/**
-* @private
-* @param {string[]} implementations Array containing 
pieces of JavaScript code in the
-*  form of calls to mw.loader#implement().
-* @param {Function} cb Callback in case of failure
-* @param {Error} cb.err
-*/
-   function asyncEval( implementations, cb ) {
-   if ( !implementations.length ) {
-   return;
-   }
-   mw.requestIdleCallback( function () {
-   try {
-   $.globalEval( 
implementations.join( ';' ) );
-   } catch ( err ) {
-   cb( err );
-   }
-   } );
-   }
-
-   /**
 * Make a versioned key for a specific module.
 *
 * @private
@@ -1753,7 +1733,7 @@
 * @protected
 */
work: function () {
-   var q, batch, implementations, 
sourceModules;
+   var q, batch, concatSource, origBatch;
 
batch = [];
 
@@ -1783,18 +1763,19 @@
 
mw.loader.store.init();
if ( mw.loader.store.enabled ) {
-   implementations = [];
-   sourceModules = [];
+   concatSource = [];
+   origBatch = batch;
batch = $.grep( batch, function 
( module ) {
-   var implementation = 
mw.loader.store.get( module );
-   if ( implementation ) {
-   
implementations.push( implementation );
-   
sourceModules.push( module );
+   var source = 
mw.loader.store.get( module );
+   if ( source ) {
+   
concatSource.push( source );
return false;
}
return true;
} );
-   asyncEval( implementations, 
function ( err ) {
+   try {
+   $.globalEval( 
concatSource.join( ';' ) );
+   } catch ( err ) {
// Not good, the cached 
mw.loader.implement calls failed! This should
// never happen, 
barring ResourceLoader bugs, browser bugs and PEBKACs.
// Depending on how 
corrupt the string is, it is likely that some
@@ -1805,14 +1786,16 @@
// something that 
infected the implement call itself, don't take any
// risks and clear 
everything in this cache.
   

[MediaWiki-commits] [Gerrit] operations/puppet[production]: wikistatus: Further attempt to solve login races

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

Change subject: wikistatus:  Further attempt to solve login races
..


wikistatus:  Further attempt to solve login races

- Increase the sleep between login attempts by a lot
- Log each login attempt so I can tell if the caching is working

Bug: T139773
Change-Id: Ic632e2bc077c960723a4cadf4d75d1bb5da10a87
---
M modules/openstack/files/liberty/nova/wikistatus/wikistatus.py
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  Chad: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/openstack/files/liberty/nova/wikistatus/wikistatus.py 
b/modules/openstack/files/liberty/nova/wikistatus/wikistatus.py
index 817d5f3..9879ea5 100644
--- a/modules/openstack/files/liberty/nova/wikistatus/wikistatus.py
+++ b/modules/openstack/files/liberty/nova/wikistatus/wikistatus.py
@@ -107,6 +107,7 @@
 
 @staticmethod
 def _wiki_login(host):
+LOG.warning("Logging in to wikitech to update a status page.")
 site = mwclient.Site(("https", host),
  retry_timeout=10,
  max_retries=3)
@@ -121,7 +122,7 @@
 except mwclient.APIError:
 LOG.exception(
 "mwclient login failed, %d more tries" % count)
-time.sleep(2)
+time.sleep(20)
 raise mwclient.MaximumRetriesExceeded()
 else:
 LOG.warning("Unable to reach %s.  We'll keep trying, "

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic632e2bc077c960723a4cadf4d75d1bb5da10a87
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Volans 
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]: Paypal audit: fix checking for refunds in CiviCRM

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

Change subject: Paypal audit: fix checking for refunds in CiviCRM
..


Paypal audit: fix checking for refunds in CiviCRM

We no longer refund by creating a new negative transaction. Instead,
check the contribution_status_id.

Bug: T150998
Change-Id: I98113545e61a14fc483f064d07a22746e6aaed62
---
M audit/paypal/TrrFile.py
M audit/paypal/tests/test_trr_file.py
M civicrm/civicrm.py
3 files changed, 118 insertions(+), 1 deletion(-)

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



diff --git a/audit/paypal/TrrFile.py b/audit/paypal/TrrFile.py
index a8ee28d..a5911eb 100644
--- a/audit/paypal/TrrFile.py
+++ b/audit/paypal/TrrFile.py
@@ -178,7 +178,11 @@
 log.info("-Unknown\t{id}\t{date}\t(Type 
{type})".format(id=out['gateway_txn_id'], date=out['date'], type=event_type))
 return
 
-if self.crm.transaction_exists(gateway_txn_id=out['gateway_txn_id'], 
gateway='paypal'):
+if queue == 'donations' and 
self.crm.transaction_exists(gateway_txn_id=out['gateway_txn_id'], 
gateway='paypal'):
+
log.info("-Duplicate\t{id}\t{date}\t{type}".format(id=out['gateway_txn_id'], 
date=row['Transaction Initiation Date'], type=queue))
+return
+
+if queue == 'refund' and 
self.crm.transaction_refunded(gateway_txn_id=out['gateway_parent_id'], 
gateway='paypal'):
 
log.info("-Duplicate\t{id}\t{date}\t{type}".format(id=out['gateway_txn_id'], 
date=row['Transaction Initiation Date'], type=queue))
 return
 
diff --git a/audit/paypal/tests/test_trr_file.py 
b/audit/paypal/tests/test_trr_file.py
index 3d78f77..fc1981c 100644
--- a/audit/paypal/tests/test_trr_file.py
+++ b/audit/paypal/tests/test_trr_file.py
@@ -84,3 +84,104 @@
 
 # Make sure we didn't try to send anything to the queue.
 MockRedis().send.assert_has_calls([])
+
+
+def get_refund_row():
+
+return {
+"Column Type": "SB",
+"Transaction ID": "AS7D98AS7D9A8S7D9AS",
+"Invoice ID": "",
+"PayPal Reference ID": "3GJH3GJ3334214812",
+"PayPal Reference ID Type": "TXN",
+"Transaction Event Code": "T1107",
+"Transaction Initiation Date": "2016/09/24 11:55:01 -0700",
+"Transaction Completion Date": "2016/09/24 11:55:01 -0700",
+"Transaction  Debit or Credit": "DR",
+"Gross Transaction Amount": "1000",
+"Gross Transaction Currency": "USD",
+"Fee Debit or Credit": "CR",
+"Fee Amount": "55",
+"Fee Currency": "USD",
+"Transactional Status": "S",
+"Insurance Amount": "",
+"Sales Tax Amount": "0",
+"Shipping Amount": "0",
+"Transaction Subject": "",
+"Transaction Note": "r",
+"Payer's Account ID": "pranks...@anonymous.net",
+"Payer Address Status": "N",
+"Item Name": "Generous benificence",
+"Item ID": "GIMME",
+"Option 1 Name": "",
+"Option 1 Value": "",
+"Option 2 Name": "",
+"Option 2 Value": "",
+"Auction Site": "",
+"Auction Buyer ID": "",
+"Auction Closing Date": "",
+"Shipping Address Line1": "",
+"Shipping Address Line2": "",
+"Shipping Address City": "",
+"Shipping Address State": "",
+"Shipping Address Zip": "",
+"Shipping Address Country": "",
+"Shipping Method": "",
+"Custom Field": "1234567",
+"Billing Address Line1": "",
+"Billing Address Line2": "",
+"Billing Address City": "",
+"Billing Address State": "",
+"Billing Address Zip": "",
+"Billing Address Country": "",
+"Consumer ID": "",
+"First Name": "Banana",
+"Last Name": "Man",
+"Consumer Business Name": "",
+"Card Type": "",
+"Payment Source": "",
+"Shipping Name": "",
+"Authorization Review Status": "",
+"Protection Eligibility": "",
+"Payment Tracking ID": "",
+}
+
+
+@patch("queue.redis_wrap.Redis")
+@patch("civicrm.civicrm.Civicrm")
+@patch("process.globals")
+def test_refund_send(MockGlobals, MockCivicrm, MockRedis):
+'''
+Test that we send a refund for a donation that isn't yet refunded
+'''
+row = get_refund_row()
+MockCivicrm().transaction_refunded.return_value = False
+
+parser = audit.paypal.TrrFile.TrrFile("dummy_path")
+
+parser.parse_line(row)
+
+# Did we send it?
+args = MockRedis().send.call_args
+assert args[0][0] == 'refund'
+expected = sorted({'last_name': 'Man', 'thankyou_date': 0, 'city': '', 
'payment_method': '', 'gateway_status': 'S', 'currency': 'USD', 'postal_code': 
'', 'date': '1474736101', 'gateway_refund_id': 'AS7D98AS7D9A8S7D9AS', 
'gateway': 'paypal', 'state_province': '', 'gross': 10.0, 'first_name': 
'Banana', 'fee': 0.55, 'gateway_txn_id': 

[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Fix spacing

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

Change subject: Fix spacing
..


Fix spacing

Change-Id: I00560d6f5632deb03324ed13ff0936f50a8483aa
---
M FundraiserStatisticsGen/fundstatgen.py
M database/db.py
M live_analysis/dump_tests.py
3 files changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/FundraiserStatisticsGen/fundstatgen.py 
b/FundraiserStatisticsGen/fundstatgen.py
index acb5ae1..06528cf 100644
--- a/FundraiserStatisticsGen/fundstatgen.py
+++ b/FundraiserStatisticsGen/fundstatgen.py
@@ -269,6 +269,7 @@
 json.dump(mapstats, f)
 f.close()
 
+
 if __name__ == "__main__":
 logging.getLogger().setLevel(logging.DEBUG)
 
diff --git a/database/db.py b/database/db.py
index ac00ab3..2390f52 100644
--- a/database/db.py
+++ b/database/db.py
@@ -201,5 +201,6 @@
 signal(SIGTERM, SIG_DFL)
 os.kill(os.getpid(), signum)
 
+
 atexit.register(close_all)
 signal(SIGTERM, handle_sigterm)
diff --git a/live_analysis/dump_tests.py b/live_analysis/dump_tests.py
index 0497f95..3138e38 100755
--- a/live_analysis/dump_tests.py
+++ b/live_analysis/dump_tests.py
@@ -56,5 +56,6 @@
 
 cur = cur + pagesize
 
+
 if __name__ == "__main__":
 fetch()

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I00560d6f5632deb03324ed13ff0936f50a8483aa
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
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] mediawiki/core[master]: Set FileExtensions to $GLOBALS

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

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

Change subject: Set FileExtensions to $GLOBALS
..

Set FileExtensions to $GLOBALS

Change-Id: Ie52004d25ebc06c81cd7d8d7de60479ff365ccea
---
M docs/extension.schema.json
M docs/extension.schema.v1.json
M includes/registration/ExtensionProcessor.php
3 files changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/09/322209/1

diff --git a/docs/extension.schema.json b/docs/extension.schema.json
index 38b5dea..638ee5d 100644
--- a/docs/extension.schema.json
+++ b/docs/extension.schema.json
@@ -650,6 +650,10 @@
"type": "object",
"description": "Password policies"
},
+   "FileExtensions": {
+   "type": "object",
+   "description": "Preferred file extensions for uploading"
+   },
"callback": {
"type": [
"array",
diff --git a/docs/extension.schema.v1.json b/docs/extension.schema.v1.json
index f7c0a2b..4d5c44f 100644
--- a/docs/extension.schema.v1.json
+++ b/docs/extension.schema.v1.json
@@ -640,6 +640,10 @@
"type": "object",
"description": "Password policies"
},
+   "FileExtensions": {
+   "type": "object",
+   "description": "Preferred file extensions for uploading"
+   },
"callback": {
"type": [
"array",
diff --git a/includes/registration/ExtensionProcessor.php 
b/includes/registration/ExtensionProcessor.php
index 8fa71be..207f884 100644
--- a/includes/registration/ExtensionProcessor.php
+++ b/includes/registration/ExtensionProcessor.php
@@ -26,6 +26,7 @@
'ExtensionEntryPointListFiles',
'ExtensionFunctions',
'FeedClasses',
+   'FileExtensions',
'FilterLogTypes',
'GrantPermissionGroups',
'GrantPermissions',

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Fix spacing

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

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

Change subject: Fix spacing
..

Fix spacing

Change-Id: I00560d6f5632deb03324ed13ff0936f50a8483aa
---
M FundraiserStatisticsGen/fundstatgen.py
M database/db.py
M live_analysis/dump_tests.py
3 files changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/10/322210/1

diff --git a/FundraiserStatisticsGen/fundstatgen.py 
b/FundraiserStatisticsGen/fundstatgen.py
index acb5ae1..06528cf 100644
--- a/FundraiserStatisticsGen/fundstatgen.py
+++ b/FundraiserStatisticsGen/fundstatgen.py
@@ -269,6 +269,7 @@
 json.dump(mapstats, f)
 f.close()
 
+
 if __name__ == "__main__":
 logging.getLogger().setLevel(logging.DEBUG)
 
diff --git a/database/db.py b/database/db.py
index ac00ab3..2390f52 100644
--- a/database/db.py
+++ b/database/db.py
@@ -201,5 +201,6 @@
 signal(SIGTERM, SIG_DFL)
 os.kill(os.getpid(), signum)
 
+
 atexit.register(close_all)
 signal(SIGTERM, handle_sigterm)
diff --git a/live_analysis/dump_tests.py b/live_analysis/dump_tests.py
index 0497f95..3138e38 100755
--- a/live_analysis/dump_tests.py
+++ b/live_analysis/dump_tests.py
@@ -56,5 +56,6 @@
 
 cur = cur + pagesize
 
+
 if __name__ == "__main__":
 fetch()

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I00560d6f5632deb03324ed13ff0936f50a8483aa
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] operations/puppet[production]: wikistatus: Further attempt to solve login races

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

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

Change subject: wikistatus:  Further attempt to solve login races
..

wikistatus:  Further attempt to solve login races

- Increase the sleep between login attempts by a lot
- Log each login attempt so I can tell if the caching is working

Bug: T139773
Change-Id: Ic632e2bc077c960723a4cadf4d75d1bb5da10a87
---
M modules/openstack/files/liberty/nova/wikistatus/wikistatus.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/08/322208/1

diff --git a/modules/openstack/files/liberty/nova/wikistatus/wikistatus.py 
b/modules/openstack/files/liberty/nova/wikistatus/wikistatus.py
index 817d5f3..9879ea5 100644
--- a/modules/openstack/files/liberty/nova/wikistatus/wikistatus.py
+++ b/modules/openstack/files/liberty/nova/wikistatus/wikistatus.py
@@ -107,6 +107,7 @@
 
 @staticmethod
 def _wiki_login(host):
+LOG.warning("Logging in to wikitech to update a status page.")
 site = mwclient.Site(("https", host),
  retry_timeout=10,
  max_retries=3)
@@ -121,7 +122,7 @@
 except mwclient.APIError:
 LOG.exception(
 "mwclient login failed, %d more tries" % count)
-time.sleep(2)
+time.sleep(20)
 raise mwclient.MaximumRetriesExceeded()
 else:
 LOG.warning("Unable to reach %s.  We'll keep trying, "

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Wikitech: Increase login throttle limits x4

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

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

Change subject: Wikitech:  Increase login throttle limits x4
..

Wikitech:  Increase login throttle limits x4

Hopefully high enough that labslogbot won't get punished
so much, but low enough that we aren't introducing new
ddos opportunities.

Bug: T150373
Change-Id: Ia9c90e8c98825ccb21145380098c32f2246f6843
---
M wmf-config/CommonSettings.php
1 file changed, 9 insertions(+), 0 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index e348553..6bf889d 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2691,6 +2691,15 @@
$wgCookieDomain = "labtestwikitech.wikimedia.org"; // TODO: Is 
this really necessary?
}
 
+   $wgPasswordAttemptThrottle = [
+   // Short term limit
+   [ 'count' => 20, 'seconds' => 300 ],
+   // Long term limit. We need to balance the risk
+   // of somebody using this as a DoS attack to lock someone
+   // out of their account, and someone doing a brute force attack.
+   [ 'count' => 600, 'seconds' => 60*60*48 ],
+   ];
+
// Some settings specific to wikitech's extensions
include( "$wmfConfigDir/wikitech.php" );
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9c90e8c98825ccb21145380098c32f2246f6843
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Andrew Bogott 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: contint/doc.wm.org: drop dir.php from DirectoryIndex

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

Change subject: contint/doc.wm.org: drop dir.php from DirectoryIndex
..


contint/doc.wm.org: drop dir.php from DirectoryIndex

As hashar points out we don't want the old dir.php custom
index file anymore to be a DirectoryIndex file, we just want
index.php and index.html.

Bug: T149928
Change-Id: I7e474fc368ddd2414382302d513f778b0a7e783d
---
M modules/contint/templates/apache/doc.wikimedia.org.erb
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/contint/templates/apache/doc.wikimedia.org.erb 
b/modules/contint/templates/apache/doc.wikimedia.org.erb
index cc61d6b..33d23c4 100644
--- a/modules/contint/templates/apache/doc.wikimedia.org.erb
+++ b/modules/contint/templates/apache/doc.wikimedia.org.erb
@@ -23,7 +23,7 @@
 # Back-compat for T73060: Redirect mediawiki-core/master/php/html/ to 
mediawiki-core/master/php/
 RewriteRule ^mediawiki-core/master/php/html/(.*)$ 
https://doc.wikimedia.org/mediawiki-core/master/php/$1 [L,QSA]
 
-DirectoryIndex dir.php index.html index.php
+DirectoryIndex index.html index.php
 
 
 Require all granted

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7e474fc368ddd2414382302d513f778b0a7e783d
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Hashar 
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...SmashPig[deployment]: Merge branch 'master' into deployment

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

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


Merge branch 'master' into deployment

52706ae Fix check for Amazon-generated IDs

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

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id2c795b9d44748a98ae6e583d1b5d9dd15b317b8
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
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] operations/puppet[production]: contint/doc.wm.org: drop dir.php from DirectoryIndex

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

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

Change subject: contint/doc.wm.org: drop dir.php from DirectoryIndex
..

contint/doc.wm.org: drop dir.php from DirectoryIndex

As hashar points out we don't want the old dir.php custom
index file anymore to be a DirectoryIndex file, we just want
index.php and index.html.

Bug: T149928
Change-Id: I7e474fc368ddd2414382302d513f778b0a7e783d
---
M modules/contint/templates/apache/doc.wikimedia.org.erb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/06/322206/1

diff --git a/modules/contint/templates/apache/doc.wikimedia.org.erb 
b/modules/contint/templates/apache/doc.wikimedia.org.erb
index cc61d6b..33d23c4 100644
--- a/modules/contint/templates/apache/doc.wikimedia.org.erb
+++ b/modules/contint/templates/apache/doc.wikimedia.org.erb
@@ -23,7 +23,7 @@
 # Back-compat for T73060: Redirect mediawiki-core/master/php/html/ to 
mediawiki-core/master/php/
 RewriteRule ^mediawiki-core/master/php/html/(.*)$ 
https://doc.wikimedia.org/mediawiki-core/master/php/$1 [L,QSA]
 
-DirectoryIndex dir.php index.html index.php
+DirectoryIndex index.html index.php
 
 
 Require all granted

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e474fc368ddd2414382302d513f778b0a7e783d
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...SmashPig[deployment]: Merge branch 'master' into deployment

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

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

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

Merge branch 'master' into deployment

52706ae Fix check for Amazon-generated IDs

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


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/05/322205/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2c795b9d44748a98ae6e583d1b5d9dd15b317b8
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
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] wikimedia...SmashPig[master]: Fix check for Amazon-generated IDs

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

Change subject: Fix check for Amazon-generated IDs
..


Fix check for Amazon-generated IDs

Oops, flubbed that equality check.

Bug: T147973
Change-Id: Ie263b51b4fe95c110ea4ea281846b4ba81cace53
---
M PaymentProviders/Amazon/Actions/ReconstructMerchantReference.php
M PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php
2 files changed, 15 insertions(+), 1 deletion(-)

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



diff --git a/PaymentProviders/Amazon/Actions/ReconstructMerchantReference.php 
b/PaymentProviders/Amazon/Actions/ReconstructMerchantReference.php
index 5b25b91..3bda459 100644
--- a/PaymentProviders/Amazon/Actions/ReconstructMerchantReference.php
+++ b/PaymentProviders/Amazon/Actions/ReconstructMerchantReference.php
@@ -19,7 +19,7 @@
return true;
}
$captureReference = $msg->getOrderId();
-   if ( !substr( $captureReference, 0, 10 ) === 'AUTHORIZE_' ) {
+   if ( substr( $captureReference, 0, 10 ) !== 'AUTHORIZE_' ) {
// We only have to fix Amazon-generated IDs with that 
prefix
return true;
}
diff --git a/PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php 
b/PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php
index af1d965..9b34964 100644
--- a/PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php
+++ b/PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php
@@ -10,8 +10,22 @@
$captureCompleted = $this->loadJson( __DIR__ . 
"/../Data/IPN/CaptureCompleted.json" );
$captureCompleted["CaptureDetails"]["CaptureReferenceId"] = 
'AUTHORIZE_123456767';
$message = new CaptureCompleted( $captureCompleted );
+   $this->assertEquals( 'AUTHORIZE_123456767', 
$message->getOrderId() );
$action = new ReconstructMerchantReference();
$action->execute( $message );
+   // This ID comes from getOrderReferenceDetails.json
$this->assertEquals( '123456789-0', $message->getOrderId() );
}
+
+   /**
+* Don't waste API calls when it's not an AUTHORIZE_ id
+*/
+   public function testReconstructMerchantIdNotNeeded() {
+   $captureCompleted = $this->loadJson( __DIR__ . 
"/../Data/IPN/CaptureCompleted.json" );
+   $message = new CaptureCompleted( $captureCompleted );
+   $action = new ReconstructMerchantReference();
+   $action->execute( $message );
+   $this->assertEquals( '98765432-1', $message->getOrderId() );
+   $this->assertEmpty( $this->mockClient->calls );
+   }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie263b51b4fe95c110ea4ea281846b4ba81cace53
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
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] mediawiki...LdapAuthentication[master]: Try and prevent CAS errors in LDAP code

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

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

Change subject: Try and prevent CAS errors in LDAP code
..

Try and prevent CAS errors in LDAP code

Bug: T150373
Change-Id: I3a35309e5a835151d63e0a9414a8982579253b85
---
M LdapAuthenticationPlugin.php
1 file changed, 12 insertions(+), 13 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LdapAuthentication 
refs/changes/04/322204/1

diff --git a/LdapAuthenticationPlugin.php b/LdapAuthenticationPlugin.php
index 6d5a774..0981b5a 100644
--- a/LdapAuthenticationPlugin.php
+++ b/LdapAuthenticationPlugin.php
@@ -1133,43 +1133,45 @@
return;
}
 
+   $userToUpdate = $user->getInstanceForUpdate();
+
if ( $this->getConf( 'Preferences' ) ) {
$this->printDebug( "Setting user preferences.", 
NONSENSITIVE );
if ( is_string( $this->lang ) ) {
$this->printDebug( "Setting language.", 
NONSENSITIVE );
-   $user->setOption( 'language', $this->lang );
+   $userToUpdate->setOption( 'language', 
$this->lang );
}
if ( is_string( $this->nickname ) ) {
$this->printDebug( "Setting nickname.", 
NONSENSITIVE );
-   $user->setOption( 'nickname', $this->nickname );
+   $userToUpdate->setOption( 'nickname', 
$this->nickname );
}
if ( is_string( $this->realname ) ) {
$this->printDebug( "Setting realname.", 
NONSENSITIVE );
-   $user->setRealName( $this->realname );
+   $userToUpdate->setRealName( $this->realname );
}
if ( is_string( $this->email ) ) {
$this->printDebug( "Setting email.", 
NONSENSITIVE );
-   $user->setEmail( $this->email );
-   $user->confirmEmail();
+   $userToUpdate->setEmail( $this->email );
+   $userToUpdate->confirmEmail();
}
}
 
if ( $this->getConf( 'UseLDAPGroups' ) ) {
$this->printDebug( "Setting user groups.", NONSENSITIVE 
);
-   $this->setGroups( $user );
+   $this->setGroups( $userToUpdate );
}
 
# We must set a user option if we want token based logins to 
work
-   if ( $user->getToken( false ) ) {
+   if ( $userToUpdate->getToken( false ) ) {
$this->printDebug( "User has a token, setting domain in 
user options.", NONSENSITIVE );
-   self::saveDomain( $user, $_SESSION['wsDomain'] );
+   self::saveDomain( $userToUpdate, $_SESSION['wsDomain'] 
);
}
 
# Let other extensions update the user
-   Hooks::run( 'LDAPUpdateUser', array( &$user ) );
+   Hooks::run( 'LDAPUpdateUser', array( &$userToUpdate ) );
 
$this->printDebug( "Saving user settings.", NONSENSITIVE );
-   $user->saveSettings();
+   $userToUpdate->saveSettings();
}
 
/**
@@ -1193,9 +1195,6 @@
 
// The update user function does everything else we need done.
$this->updateUser( $user );
-
-   // updateUser() won't necessarily save the user's settings
-   $user->saveSettings();
}
 
/**

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Fix check for Amazon-generated IDs

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

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

Change subject: Fix check for Amazon-generated IDs
..

Fix check for Amazon-generated IDs

Oops, flubbed that equality check.

Bug: T147973
Change-Id: Ie263b51b4fe95c110ea4ea281846b4ba81cace53
---
M PaymentProviders/Amazon/Actions/ReconstructMerchantReference.php
M PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php
2 files changed, 15 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/03/322203/1

diff --git a/PaymentProviders/Amazon/Actions/ReconstructMerchantReference.php 
b/PaymentProviders/Amazon/Actions/ReconstructMerchantReference.php
index 5b25b91..3bda459 100644
--- a/PaymentProviders/Amazon/Actions/ReconstructMerchantReference.php
+++ b/PaymentProviders/Amazon/Actions/ReconstructMerchantReference.php
@@ -19,7 +19,7 @@
return true;
}
$captureReference = $msg->getOrderId();
-   if ( !substr( $captureReference, 0, 10 ) === 'AUTHORIZE_' ) {
+   if ( substr( $captureReference, 0, 10 ) !== 'AUTHORIZE_' ) {
// We only have to fix Amazon-generated IDs with that 
prefix
return true;
}
diff --git a/PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php 
b/PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php
index af1d965..9b34964 100644
--- a/PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php
+++ b/PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php
@@ -10,8 +10,22 @@
$captureCompleted = $this->loadJson( __DIR__ . 
"/../Data/IPN/CaptureCompleted.json" );
$captureCompleted["CaptureDetails"]["CaptureReferenceId"] = 
'AUTHORIZE_123456767';
$message = new CaptureCompleted( $captureCompleted );
+   $this->assertEquals( 'AUTHORIZE_123456767', 
$message->getOrderId() );
$action = new ReconstructMerchantReference();
$action->execute( $message );
+   // This ID comes from getOrderReferenceDetails.json
$this->assertEquals( '123456789-0', $message->getOrderId() );
}
+
+   /**
+* Don't waste API calls when it's not an AUTHORIZE_ id
+*/
+   public function testReconstructMerchantIdNotNeeded() {
+   $captureCompleted = $this->loadJson( __DIR__ . 
"/../Data/IPN/CaptureCompleted.json" );
+   $message = new CaptureCompleted( $captureCompleted );
+   $action = new ReconstructMerchantReference();
+   $action->execute( $message );
+   $this->assertEquals( '98765432-1', $message->getOrderId() );
+   $this->assertEmpty( $this->mockClient->calls );
+   }
 }

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: contint/doc.wm.org: add missing DirectoryIndex, remove old 2...

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

Change subject: contint/doc.wm.org: add missing DirectoryIndex, remove old 2.2 
syntax
..


contint/doc.wm.org: add missing DirectoryIndex, remove old 2.2 syntax

We moved doc.wm.org to Apache 2.4 on contint1001 and we moved
the .htaccess files to the main config in Change-Id: Ief4a6a296c533bbb7b.

It caused errors, and would not display the / of doc.wm.org anymore,
with "missing DirectoryIndex" and as the comment says that would have
been the nicer option anyways but it didn't work on 2.2. Now we don't
have 2.2 anymore. 

This was already applied as a temp. live hack to fix the doc mainpage.

Bug: T149928
Change-Id: I527d4f40415e8f1bee73699e4c63e6884cd1314c
---
M modules/contint/templates/apache/doc.wikimedia.org.erb
1 file changed, 1 insertion(+), 5 deletions(-)

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



diff --git a/modules/contint/templates/apache/doc.wikimedia.org.erb 
b/modules/contint/templates/apache/doc.wikimedia.org.erb
index 4541d66..cc61d6b 100644
--- a/modules/contint/templates/apache/doc.wikimedia.org.erb
+++ b/modules/contint/templates/apache/doc.wikimedia.org.erb
@@ -23,11 +23,7 @@
 # Back-compat for T73060: Redirect mediawiki-core/master/php/html/ to 
mediawiki-core/master/php/
 RewriteRule ^mediawiki-core/master/php/html/(.*)$ 
https://doc.wikimedia.org/mediawiki-core/master/php/$1 [L,QSA]
 
-# DirectoryIndex would be neater, but doesn't work properly under Apache 
2.2
-RewriteCond %{REQUEST_FILENAME} -d
-RewriteCond %{REQUEST_FILENAME}/index.php !-f
-RewriteCond %{REQUEST_FILENAME}/index.html !-f
-RewriteRule .* dir.php
+DirectoryIndex dir.php index.html index.php
 
 
 Require all granted

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Only apply wgDBschema to postgres/mssql

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

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

Change subject: Only apply wgDBschema to postgres/mssql
..

Only apply wgDBschema to postgres/mssql

Bug: T148956
Change-Id: I14f0aa7dd52bd0bdd0d3f8729b562a0fee2df6fa
---
M includes/db/MWLBFactory.php
1 file changed, 15 insertions(+), 4 deletions(-)


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

diff --git a/includes/db/MWLBFactory.php b/includes/db/MWLBFactory.php
index 42ef685..0d12c80 100644
--- a/includes/db/MWLBFactory.php
+++ b/includes/db/MWLBFactory.php
@@ -37,6 +37,8 @@
public static function applyDefaultConfig( array $lbConf, Config 
$mainConfig ) {
global $wgCommandLineMode;
 
+   static $typesWithSchema = [ 'postgres', 'msssql' ];
+
$lbConf += [
'localDomain' => new DatabaseDomain(
$mainConfig->get( 'DBname' ),
@@ -70,13 +72,18 @@
'keywordTableMap' => [ 
'user' => 'mwuser', 'text' => 'pagecontent' ]
];
}
-   $lbConf['servers'][$i] = $server + [
-   'schema' => $mainConfig->get( 
'DBmwschema' ),
+   if ( in_array( $server['type'], 
$typesWithSchema, true ) ) {
+   $server['schema'] = 
$mainConfig->get( 'DBmwschema' );
+   }
+
+   $server += [
'tablePrefix' => 
$mainConfig->get( 'DBprefix' ),
'flags' => DBO_DEFAULT,
'sqlMode' => $mainConfig->get( 
'SQLMode' ),
'utf8Mode' => $mainConfig->get( 
'DBmysql5' )
];
+
+   $lbConf['servers'][$i] = $server;
}
} else {
$flags = DBO_DEFAULT;
@@ -88,7 +95,6 @@
'user' => $mainConfig->get( 'DBuser' ),
'password' => $mainConfig->get( 
'DBpassword' ),
'dbname' => $mainConfig->get( 'DBname' 
),
-   'schema' => $mainConfig->get( 
'DBmwschema' ),
'tablePrefix' => $mainConfig->get( 
'DBprefix' ),
'type' => $mainConfig->get( 'DBtype' ),
'load' => 1,
@@ -96,6 +102,9 @@
'sqlMode' => $mainConfig->get( 
'SQLMode' ),
'utf8Mode' => $mainConfig->get( 
'DBmysql5' )
];
+   if ( in_array( $server['type'], 
$typesWithSchema, true ) ) {
+   $server['schema'] = $mainConfig->get( 
'DBmwschema' );
+   }
if ( $server['type'] === 'sqlite' ) {
$server[ 'dbDirectory'] = 
$mainConfig->get( 'SQLiteDataDir' );
} elseif ( $server['type'] === 'postgres' ) {
@@ -110,7 +119,9 @@
}
} elseif ( $lbConf['class'] === 'LBFactoryMulti' ) {
if ( isset( $lbConf['serverTemplate'] ) ) {
-   $lbConf['serverTemplate']['schema'] = 
$mainConfig->get( 'DBmwschema' );
+   if ( in_array( 
$lbConf['serverTemplate']['type'], $typesWithSchema, true ) ) {
+   $lbConf['serverTemplate']['schema'] = 
$mainConfig->get( 'DBmwschema' );
+   }
$lbConf['serverTemplate']['sqlMode'] = 
$mainConfig->get( 'SQLMode' );
$lbConf['serverTemplate']['utf8Mode'] = 
$mainConfig->get( 'DBmysql5' );
}

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: contint/doc.wm.org: add missing DirectoryIndex, remove old 2...

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

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

Change subject: contint/doc.wm.org: add missing DirectoryIndex, remove old 2.2 
syntax
..

contint/doc.wm.org: add missing DirectoryIndex, remove old 2.2 syntax

Change-Id: I527d4f40415e8f1bee73699e4c63e6884cd1314c
---
M modules/contint/templates/apache/doc.wikimedia.org.erb
1 file changed, 1 insertion(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/01/322201/1

diff --git a/modules/contint/templates/apache/doc.wikimedia.org.erb 
b/modules/contint/templates/apache/doc.wikimedia.org.erb
index 4541d66..cc61d6b 100644
--- a/modules/contint/templates/apache/doc.wikimedia.org.erb
+++ b/modules/contint/templates/apache/doc.wikimedia.org.erb
@@ -23,11 +23,7 @@
 # Back-compat for T73060: Redirect mediawiki-core/master/php/html/ to 
mediawiki-core/master/php/
 RewriteRule ^mediawiki-core/master/php/html/(.*)$ 
https://doc.wikimedia.org/mediawiki-core/master/php/$1 [L,QSA]
 
-# DirectoryIndex would be neater, but doesn't work properly under Apache 
2.2
-RewriteCond %{REQUEST_FILENAME} -d
-RewriteCond %{REQUEST_FILENAME}/index.php !-f
-RewriteCond %{REQUEST_FILENAME}/index.html !-f
-RewriteRule .* dir.php
+DirectoryIndex dir.php index.html index.php
 
 
 Require all granted

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I527d4f40415e8f1bee73699e4c63e6884cd1314c
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] operations/puppet[production]: Switch discovery-stats cronjob to a dedicated script

2016-11-17 Thread Gehel (Code Review)
Gehel has submitted this change and it was merged.

Change subject: Switch discovery-stats cronjob to a dedicated script
..


Switch discovery-stats cronjob to a dedicated script

Change-Id: I850b4a1c01164b1d8626db016cf1fa9d8cb5d6b3
Depends-On: Iadd6d29bb4404fe533bbf51e849a79ba818eb0d3
Bug: T149722
---
M modules/statistics/manifests/discovery.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/statistics/manifests/discovery.pp 
b/modules/statistics/manifests/discovery.pp
index e2f2827..7c2f2c5 100644
--- a/modules/statistics/manifests/discovery.pp
+++ b/modules/statistics/manifests/discovery.pp
@@ -57,7 +57,7 @@
   }
 
   cron { 'discovery-stats':
-command => "/usr/bin/php ${scripts_dir}/tracking-category-count.php >> 
${log_dir}/tracking-category-count.log 2>&1",
+command => "${scripts_dir}/bin/hourly.sh >> ${log_dir}/hourly.log 2>&1",
 minute  => '14',
 require => Git::Clone['analytics/discovery-stats'],
 user=> $user,

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

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

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


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

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

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


Merge branch 'master' into deployment

bcb1e40 DRY finding OrderReferenceId, get_class() -> instanceOf
86d27c4 closeOrderReference errors don't blow up
cb7e31b Fix Amazon order IDs for manual captures

Change-Id: If3fde1ab75e359f92be8f0c7467126ee51d7a632
---
D PaymentProviders/Amazon/Tests/Data/responses/getOrderReferenceDetails.json
D PaymentProviders/Amazon/Tests/phpunit/ApiTest.php
2 files changed, 0 insertions(+), 57 deletions(-)

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



diff --git 
a/PaymentProviders/Amazon/Tests/Data/responses/getOrderReferenceDetails.json 
b/PaymentProviders/Amazon/Tests/Data/responses/getOrderReferenceDetails.json
deleted file mode 100644
index 407a227..000
--- a/PaymentProviders/Amazon/Tests/Data/responses/getOrderReferenceDetails.json
+++ /dev/null
@@ -1,40 +0,0 @@
-<<< HEAD   (cac1a1 Merge branch 'master' into deployment)
-===
-{
-"GetOrderReferenceDetailsResult": {
-"OrderReferenceDetails": {
-"OrderReferenceStatus": {
-"LastUpdateTimestamp": "2015-09-28T17:49:08.123Z",
-"ReasonCode": "SellerClosed",
-"State": "Closed"
-},
-"ExpirationTimestamp": "2016-03-27T17:48:23.249Z",
-"IdList": {
-"member": [
-"P01-0133129-0199515-A068790",
-"P01-0133129-0199515-A019658"
-]
-},
-"SellerOrderAttributes": {
-"SellerOrderId": "123456789-0"
-},
-"OrderTotal": {
-"CurrencyCode": "USD",
-"Amount": "10.00"
-},
-"Buyer": {
-"Name": "Testy Test",
-"Email": "nob...@wikimedia.org"
-},
-"ReleaseEnvironment": "Sandbox",
-"SellerNote": "Donation to the Wikimedia Foundation",
-"AmazonOrderReferenceId": "P01-0133129-0199515",
-"CreationTimestamp": "2015-09-28T17:48:23.123Z"
-}
-},
-"ResponseMetadata": {
-"RequestId": "896332ae-e316-4eb6-865e-79278e1aa214"
-},
-"ResponseStatus": "200"
-}
->>> BRANCH (62e99a Merge "closeOrderReference errors don't blow up")
diff --git a/PaymentProviders/Amazon/Tests/phpunit/ApiTest.php 
b/PaymentProviders/Amazon/Tests/phpunit/ApiTest.php
deleted file mode 100644
index 74f1b81..000
--- a/PaymentProviders/Amazon/Tests/phpunit/ApiTest.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<<< HEAD   (cac1a1 Merge branch 'master' into deployment)
-===
-mockClient->returns['getAuthorizationDetails'][] = 
'Declined';
-   $this->mockClient->returns['getAuthorizationDetails'][] = 
'Closed';
-   $parentId = AmazonApi::get()->findCaptureId( 
'P01-0133129-0199515' );
-   $this->assertEquals( 'P01-0133129-0199515-C019658', $parentId, 
'Did not get the right refund parent ID' );
-   }
-}
->>> BRANCH (62e99a Merge "closeOrderReference errors don't blow up")

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If3fde1ab75e359f92be8f0c7467126ee51d7a632
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
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...SmashPig[deployment]: Merge branch 'master' into deployment

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

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

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

Merge branch 'master' into deployment

bcb1e40 DRY finding OrderReferenceId, get_class() -> instanceOf
86d27c4 closeOrderReference errors don't blow up
cb7e31b Fix Amazon order IDs for manual captures

Change-Id: If3fde1ab75e359f92be8f0c7467126ee51d7a632
---
D PaymentProviders/Amazon/Tests/Data/responses/getOrderReferenceDetails.json
D PaymentProviders/Amazon/Tests/phpunit/ApiTest.php
2 files changed, 0 insertions(+), 57 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/96/322196/1

diff --git 
a/PaymentProviders/Amazon/Tests/Data/responses/getOrderReferenceDetails.json 
b/PaymentProviders/Amazon/Tests/Data/responses/getOrderReferenceDetails.json
deleted file mode 100644
index 407a227..000
--- a/PaymentProviders/Amazon/Tests/Data/responses/getOrderReferenceDetails.json
+++ /dev/null
@@ -1,40 +0,0 @@
-<<< HEAD   (cac1a1 Merge branch 'master' into deployment)
-===
-{
-"GetOrderReferenceDetailsResult": {
-"OrderReferenceDetails": {
-"OrderReferenceStatus": {
-"LastUpdateTimestamp": "2015-09-28T17:49:08.123Z",
-"ReasonCode": "SellerClosed",
-"State": "Closed"
-},
-"ExpirationTimestamp": "2016-03-27T17:48:23.249Z",
-"IdList": {
-"member": [
-"P01-0133129-0199515-A068790",
-"P01-0133129-0199515-A019658"
-]
-},
-"SellerOrderAttributes": {
-"SellerOrderId": "123456789-0"
-},
-"OrderTotal": {
-"CurrencyCode": "USD",
-"Amount": "10.00"
-},
-"Buyer": {
-"Name": "Testy Test",
-"Email": "nob...@wikimedia.org"
-},
-"ReleaseEnvironment": "Sandbox",
-"SellerNote": "Donation to the Wikimedia Foundation",
-"AmazonOrderReferenceId": "P01-0133129-0199515",
-"CreationTimestamp": "2015-09-28T17:48:23.123Z"
-}
-},
-"ResponseMetadata": {
-"RequestId": "896332ae-e316-4eb6-865e-79278e1aa214"
-},
-"ResponseStatus": "200"
-}
->>> BRANCH (62e99a Merge "closeOrderReference errors don't blow up")
diff --git a/PaymentProviders/Amazon/Tests/phpunit/ApiTest.php 
b/PaymentProviders/Amazon/Tests/phpunit/ApiTest.php
deleted file mode 100644
index 74f1b81..000
--- a/PaymentProviders/Amazon/Tests/phpunit/ApiTest.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<<< HEAD   (cac1a1 Merge branch 'master' into deployment)
-===
-mockClient->returns['getAuthorizationDetails'][] = 
'Declined';
-   $this->mockClient->returns['getAuthorizationDetails'][] = 
'Closed';
-   $parentId = AmazonApi::get()->findCaptureId( 
'P01-0133129-0199515' );
-   $this->assertEquals( 'P01-0133129-0199515-C019658', $parentId, 
'Did not get the right refund parent ID' );
-   }
-}
->>> BRANCH (62e99a Merge "closeOrderReference errors don't blow up")

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3fde1ab75e359f92be8f0c7467126ee51d7a632
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
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] mediawiki...Popups[mpga]: Link Previews -> Page Previews

2016-11-17 Thread Phuedx (Code Review)
Phuedx has uploaded a new change for review.

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

Change subject: Link Previews -> Page Previews
..

Link Previews -> Page Previews

Change-Id: I08e80220c76a65cadaba20ce78b9eb2b36139095
---
M doc/adr/0002-contain-and-manage-state.md
M resources/ext.popups/actions.js
M resources/ext.popups/experiment.js
M resources/ext.popups/footerLinkChangeListener.js
M resources/ext.popups/userSettings.js
M tests/qunit/ext.popups/experiment.test.js
M tests/qunit/ext.popups/processLinks.test.js
7 files changed, 16 insertions(+), 16 deletions(-)


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

diff --git a/doc/adr/0002-contain-and-manage-state.md 
b/doc/adr/0002-contain-and-manage-state.md
index 5c7ad33..4e9a329 100644
--- a/doc/adr/0002-contain-and-manage-state.md
+++ b/doc/adr/0002-contain-and-manage-state.md
@@ -8,12 +8,12 @@
 
 ## Context
 
-The hardest part of debugging Link Previews issues (especially those related to
+The hardest part of debugging Page Previews issues (especially those related to
 EventLogging) was understanding the state of the system (the "state") and how
 it's mutated given some interaction(s). This was in no small part because the
 state was defined, initialized, and mutated in various parts of the codebase.
 
-The state required for Link Previews to function isn't actually overly
+The state required for Page Previews to function isn't actually overly
 complicated. To keep things easy to debug/easy to reason about we should
 endeavour to isolate the state and its mutations from the various other parts 
of
 the system.
diff --git a/resources/ext.popups/actions.js b/resources/ext.popups/actions.js
index 80a3587..c6c4a51 100644
--- a/resources/ext.popups/actions.js
+++ b/resources/ext.popups/actions.js
@@ -19,14 +19,14 @@
FETCH_START_DELAY = 500; // ms.
 
/**
-* Represents Link Previews booting.
+* Represents Page Previews booting.
 *
 * When a Redux store is created, the `@@INIT` action is immediately
 * dispatched to it. To avoid overriding the term, we refer to booting 
rather
 * than initializing.
 *
-* Link Previews persists critical pieces of information to local 
storage.
-* Since reading from and writing to local storage are synchronous, Link
+* Page Previews persists critical pieces of information to local 
storage.
+* Since reading from and writing to local storage are synchronous, Page
 * Previews is booted when the browser is idle (using
 * 
[`mw.requestIdleCallback`](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback))
 * so as not to impact latency-critical events.
diff --git a/resources/ext.popups/experiment.js 
b/resources/ext.popups/experiment.js
index fb35e5c..253993f 100644
--- a/resources/ext.popups/experiment.js
+++ b/resources/ext.popups/experiment.js
@@ -2,13 +2,13 @@
 
/**
 * Given the global state of the application, creates a function that 
gets
-* whether or not the user should have Link Previews enabled, i.e. 
whether
+* whether or not the user should have Page Previews enabled, i.e. 
whether
 * they are in the experiment condition.
 *
 * The user is in the experiment condition if:
-* * They've enabled by Link Previews by clicking "Enable previews" in 
the
+* * They've enabled by Page Previews by clicking "Enable previews" in 
the
 *   footer menu.
-* * They've enabled Link Previews as a beta feature.
+* * They've enabled Page Previews as a beta feature.
 * * They aren't in the control bucket of the experiment.
 *
 * @param {mw.Map} config
diff --git a/resources/ext.popups/footerLinkChangeListener.js 
b/resources/ext.popups/footerLinkChangeListener.js
index 7aa68fe..a471ab3 100644
--- a/resources/ext.popups/footerLinkChangeListener.js
+++ b/resources/ext.popups/footerLinkChangeListener.js
@@ -43,7 +43,7 @@
 *
 * * The "Enable previews" link (the "link") is appended to the footer 
menu
 *   (see `createFooterLink` above).
-* * When Link Previews are disabled, then the link is shown; 
otherwise, the
+* * When Page Previews are disabled, then the link is shown; 
otherwise, the
 *   link is hidden.
 * * When the user clicks the link, then the `showSettings` bound action
 *   creator is called.
diff --git a/resources/ext.popups/userSettings.js 
b/resources/ext.popups/userSettings.js
index 9f7cda6..ca65e3e 100644
--- a/resources/ext.popups/userSettings.js
+++ b/resources/ext.popups/userSettings.js
@@ -19,9 +19,9 @@
return {
 
/**
-* Gets whether or not the user has previously enabled 
Link Previews.
+ 

[MediaWiki-commits] [Gerrit] mediawiki...ParsoidBatchAPI[master]: Use namespaced version of IPSet

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

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

Change subject: Use namespaced version of IPSet
..

Use namespaced version of IPSet

The un-namespaced version is deprecated.

Change-Id: I5190f54cd7baa5c32dc0fc214626c5372048177e
---
M includes/ApiParsoidBatch.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ParsoidBatchAPI 
refs/changes/61/322161/1

diff --git a/includes/ApiParsoidBatch.php b/includes/ApiParsoidBatch.php
index 9045d84..592e452 100644
--- a/includes/ApiParsoidBatch.php
+++ b/includes/ApiParsoidBatch.php
@@ -1,5 +1,7 @@
 extractRequestParams();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5190f54cd7baa5c32dc0fc214626c5372048177e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ParsoidBatchAPI
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...Popups[mpga]: reducers: Add the nextState helper function

2016-11-17 Thread Phuedx (Code Review)
Phuedx has uploaded a new change for review.

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

Change subject: reducers: Add the nextState helper function
..

reducers: Add the nextState helper function

OO.copy doesn't copy Element instances, whereas $.extend does. However,
OO.copy does copy properties whose values are undefined or null, whereas
$.extend doesn't.

Since the state tree contains an Element instance - the
preview.activeLink property - we need to use $.extend.

Add the nextState helper function which copies the current state tree
with $.extend and mixes in all updates manually.

Change-Id: Ie8edd9fa0cc3a62a792ed60b49288f85b3ca73e9
---
M resources/ext.popups/reducers.js
M tests/qunit/ext.popups/reducers.test.js
2 files changed, 34 insertions(+), 19 deletions(-)


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

diff --git a/resources/ext.popups/reducers.js b/resources/ext.popups/reducers.js
index 3a840b2..9592223 100644
--- a/resources/ext.popups/reducers.js
+++ b/resources/ext.popups/reducers.js
@@ -2,6 +2,32 @@
mw.popups.reducers = {};
 
/**
+* Creates the next state tree from the current state tree and some 
updates.
+*
+* In [change listeners](/doc/change_listeners.md), for example, we 
talk about
+* the previous state and the current state (the `prevState` and `state`
+* parameters, respectively). Since
+* [reducers](http://redux.js.org/docs/basics/Reducers.html) take the 
current
+* state and an action and make updates, "next state" seems appropriate.
+*
+* @param {Object} state
+* @param {Object} updates
+* @return {Object}
+*/
+   function nextState( state, updates ) {
+   var result = $.extend( {}, state ),
+   key;
+
+   for ( key in updates ) {
+   if ( updates.hasOwnProperty( key ) ) {
+   result[key] = updates[key];
+   }
+   }
+
+   return result;
+   }
+
+   /**
 * Reducer for actions that modify the state of the preview model
 *
 * @param {Object} state before action
@@ -26,49 +52,42 @@
 
switch ( action.type ) {
case mw.popups.actionTypes.BOOT:
-   // FIXME: $.extend doesn't copy properties 
whose values are null or
-   // undefined. If we were to do the following:
-   //
-   //   return $.extend( {}, state, { /* ... */ } 
);
-   //
-   // Then the shape of the state tree would vary. 
Is this necessarily bad?
-   return $.extend( OO.copy( state ), {
+   return nextState( state, {
enabled: action.isUserInCondition,
sessionToken: action.sessionToken,
pageToken: action.pageToken
} );
case mw.popups.actionTypes.LINK_DWELL:
-   return $.extend( OO.copy( state ), {
+   return nextState( state, {
activeLink: action.el,
interactionStarted: 
action.interactionStarted,
isDelayingFetch: true,
linkInteractionToken: 
action.linkInteractionToken
} );
case mw.popups.actionTypes.LINK_ABANDON:
-   return $.extend( OO.copy( state ), {
-   previousActiveLink: state.activeLink,
+   return nextState( state, {
activeLink: undefined,
interactionStarted: undefined,
-   isDelayingFetc: false,
+   isDelayingFetch: false,
linkInteractionToken: undefined
} );
case mw.popups.actionTypes.LINK_CLICK:
-   return $.extend( OO.copy( state ), {
+   return nextState( state, {
isDelayingFetch: false
} );
case mw.popups.actionTypes.FETCH_START:
-   return $.extend( OO.copy( state ), {
+   return nextState( state, {
isDelayingFetch: false,
  

[MediaWiki-commits] [Gerrit] mediawiki...Popups[mpga]: Add link title change listener

2016-11-17 Thread Phuedx (Code Review)
Phuedx has uploaded a new change for review.

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

Change subject: Add link title change listener
..

Add link title change listener

Supporting changes:
* Remove the preview.previousActiveLink property from the state tree as
  it's unnecessary.

Change-Id: I657decf9425a7a9e2b27a798ed60b162569661d8
---
M extension.json
M resources/ext.popups/footerLinkChangeListener.js
A resources/ext.popups/linkTitleChangeListener.js
M resources/ext.popups/reducers.js
A tests/qunit/ext.popups/linkTitleChangeListener.test.js
M tests/qunit/ext.popups/reducers.test.js
6 files changed, 95 insertions(+), 3 deletions(-)


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

diff --git a/extension.json b/extension.json
index 1562708..d1ffca8 100644
--- a/extension.json
+++ b/extension.json
@@ -66,6 +66,7 @@
"resources/ext.popups/reducers.js",
"resources/ext.popups/changeListener.js",

"resources/ext.popups/footerLinkChangeListener.js",
+   
"resources/ext.popups/linkTitleChangeListener.js",
"resources/ext.popups/boot.js"
],
"templates": {
diff --git a/resources/ext.popups/footerLinkChangeListener.js 
b/resources/ext.popups/footerLinkChangeListener.js
index 81d8a76..7aa68fe 100644
--- a/resources/ext.popups/footerLinkChangeListener.js
+++ b/resources/ext.popups/footerLinkChangeListener.js
@@ -49,7 +49,7 @@
 *   creator is called.
 *
 * @param {Object} boundActions
-* @return {et.popups.ChangeListener}
+* @return {ext.popups.ChangeListener}
 */
mw.popups.changeListeners.footerLink = function ( boundActions ) {
var $footerLink;
diff --git a/resources/ext.popups/linkTitleChangeListener.js 
b/resources/ext.popups/linkTitleChangeListener.js
new file mode 100644
index 000..a490bf3
--- /dev/null
+++ b/resources/ext.popups/linkTitleChangeListener.js
@@ -0,0 +1,32 @@
+( function ( mw, $ ) {
+
+   /**
+* Creates an instance of the link title change listener.
+*
+* While the user dwells on a link, then it becomes the active link. The
+* change listener will remove the link's `title` attribute until the 
user
+* The change listener will remove the active link's `title` attribute.
+*
+* @return {ext.popups.ChangeListener}
+*/
+   mw.popups.changeListeners.linkTitle = function () {
+   var title;
+
+   return function ( prevState, state ) {
+   var $link;
+
+   if ( state.preview.activeLink && !title ) {
+   $link = $( state.preview.activeLink );
+
+   title = $link.attr( 'title' );
+
+   $link.attr( 'title', '' );
+   } else if ( prevState && prevState.preview.activeLink ) 
{
+   $( prevState.preview.activeLink ).attr( 
'title', title );
+
+   title = undefined;
+   }
+   };
+   };
+
+}( mediaWiki, jQuery ) );
diff --git a/resources/ext.popups/reducers.js b/resources/ext.popups/reducers.js
index 9592223..080bc25 100644
--- a/resources/ext.popups/reducers.js
+++ b/resources/ext.popups/reducers.js
@@ -43,7 +43,6 @@
pageToken: undefined,
linkInteractionToken: undefined,
activeLink: undefined,
-   previousActiveLink: undefined,
interactionStarted: undefined,
isDelayingFetch: false,
isFetching: false
diff --git a/tests/qunit/ext.popups/linkTitleChangeListener.test.js 
b/tests/qunit/ext.popups/linkTitleChangeListener.test.js
new file mode 100644
index 000..87f2144
--- /dev/null
+++ b/tests/qunit/ext.popups/linkTitleChangeListener.test.js
@@ -0,0 +1,61 @@
+( function( mw, $ ) {
+
+   // Since mw.popups.changeListeners.footerLink manipulates the DOM, this 
test
+   // is, by necessity, an integration test.
+   QUnit.module( 'ext.popups/footerLinkChangeListener @integration', {
+   setup: function () {
+   var that = this;
+
+   that.$link = $( '' )
+   .attr( 'title', 'Foo' );
+
+   that.linkTitleChangeListener = 
mw.popups.changeListeners.linkTitle();
+
+   that.state = {
+   preview: {
+   activeLink: that.$link
+   }
+   };
+
+  

[MediaWiki-commits] [Gerrit] integration/docroot[master]: delete .htaccess files for doc/integration

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

Change subject: delete .htaccess files for doc/integration
..


delete .htaccess files for doc/integration

Ief4a6a296c533bb moves the content of these files
over into the normal Apache config template in the puppet repo,
along with the rest of the config for these virtual hosts.

When that gets merged, delete the files over here.

Bug: T149928
Bug: T150727
Depends-On: Ief4a6a296c533bbb7bdb0f140fc4f71a60d2a5ca
Change-Id: I05ece775026557ed56701586cdffcff614d6f0a3
---
D org/wikimedia/doc/.htaccess
D org/wikimedia/integration/.htaccess
2 files changed, 0 insertions(+), 15 deletions(-)

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



diff --git a/org/wikimedia/doc/.htaccess b/org/wikimedia/doc/.htaccess
deleted file mode 100644
index ad84b12..000
--- a/org/wikimedia/doc/.htaccess
+++ /dev/null
@@ -1,10 +0,0 @@
-# Back-compat for T73060: Redirect mediawiki-core/master/php/html/ to 
mediawiki-core/master/php/
-RewriteEngine On
-RewriteRule ^mediawiki-core/master/php/html/(.*)$ 
https://doc.wikimedia.org/mediawiki-core/master/php/$1 [L,QSA]
-
-# DirectoryIndex would be neater, but doesn't work properly under Apache 2.2
-RewriteEngine on
-RewriteCond %{REQUEST_FILENAME} -d
-RewriteCond %{REQUEST_FILENAME}/index.php !-f
-RewriteCond %{REQUEST_FILENAME}/index.html !-f
-RewriteRule .* dir.php
diff --git a/org/wikimedia/integration/.htaccess 
b/org/wikimedia/integration/.htaccess
deleted file mode 100644
index 12d1e30..000
--- a/org/wikimedia/integration/.htaccess
+++ /dev/null
@@ -1,5 +0,0 @@
-RewriteEngine On
-RewriteRule ^cover$ https://doc.wikimedia.org/cover/ [R=301,L]
-
-Redirect 301 /monitoring/ https://tools.wmflabs.org/nagf/?project=integration
-Redirect 301 /cover/ https://doc.wikimedia.org/cover/

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I05ece775026557ed56701586cdffcff614d6f0a3
Gerrit-PatchSet: 3
Gerrit-Project: integration/docroot
Gerrit-Branch: master
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Krinkle 
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] operations/puppet[production]: contint: move .htaccess content for doc/integration to puppet

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

Change subject: contint: move .htaccess content for doc/integration to puppet
..


contint: move .htaccess content for doc/integration to puppet

Formerly the repository integration/docroot.git included
2 .htaccess file, one for doc.wm and one for integration.wm, that
added these very same rewrite rules. 

With the migration of gallium to contint1001 we have stopped
honoring .htaccess file.

On Change-Id: Ib555a7d894b887b9 we agreed that we want to move these
config snippets into the main Apache config files in puppet repo.

You can compare the old files on Change-Id: I05ece775026557e.

It has caused us confusion before that there were separate places with
config snippets.

When this gets merged the .htacces files should be deleted in the old
location.

Bug: T149928
Bug: T150727
Change-Id: Ief4a6a296c533bbb7bdb0f140fc4f71a60d2a5ca
---
M modules/contint/templates/apache/doc.wikimedia.org.erb
M modules/contint/templates/apache/integration.wikimedia.org.erb
2 files changed, 14 insertions(+), 1 deletion(-)

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



diff --git a/modules/contint/templates/apache/doc.wikimedia.org.erb 
b/modules/contint/templates/apache/doc.wikimedia.org.erb
index c7d3ab4..4541d66 100644
--- a/modules/contint/templates/apache/doc.wikimedia.org.erb
+++ b/modules/contint/templates/apache/doc.wikimedia.org.erb
@@ -11,6 +11,8 @@
 ErrorLog /var/log/apache2/doc_error.log
 CustomLog /var/log/apache2/doc_access.log wmf
 
+DocumentRoot /srv/org/wikimedia/doc
+
 RewriteEngine On
 
 # T95164
@@ -18,7 +20,14 @@
 RewriteCond %{REQUEST_FILENAME} -d
 RewriteRule ^(.+[^/])$ https://doc.wikimedia.org/$1/ [R=301,QSA]
 
-DocumentRoot /srv/org/wikimedia/doc
+# Back-compat for T73060: Redirect mediawiki-core/master/php/html/ to 
mediawiki-core/master/php/
+RewriteRule ^mediawiki-core/master/php/html/(.*)$ 
https://doc.wikimedia.org/mediawiki-core/master/php/$1 [L,QSA]
+
+# DirectoryIndex would be neater, but doesn't work properly under Apache 
2.2
+RewriteCond %{REQUEST_FILENAME} -d
+RewriteCond %{REQUEST_FILENAME}/index.php !-f
+RewriteCond %{REQUEST_FILENAME}/index.html !-f
+RewriteRule .* dir.php
 
 
 Require all granted
diff --git a/modules/contint/templates/apache/integration.wikimedia.org.erb 
b/modules/contint/templates/apache/integration.wikimedia.org.erb
index 33f86bb..18e5b6a 100644
--- a/modules/contint/templates/apache/integration.wikimedia.org.erb
+++ b/modules/contint/templates/apache/integration.wikimedia.org.erb
@@ -13,7 +13,11 @@
 
 DocumentRoot /srv/org/wikimedia/integration
 
+RewriteEngine On
+RewriteRule ^cover$ https://doc.wikimedia.org/cover/ [R=301,L]
+
 Redirect 301 /monitoring/ 
https://tools.wmflabs.org/nagf/?project=integration
+Redirect 301 /cover/ https://doc.wikimedia.org/cover/
 
 Include *_proxy
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ief4a6a296c533bbb7bdb0f140fc4f71a60d2a5ca
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Krinkle 
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] operations/mediawiki-config[master]: Test cookie blocking on Test Wikipedia

2016-11-17 Thread Kaldari (Code Review)
Kaldari has uploaded a new change for review.

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

Change subject: Test cookie blocking on Test Wikipedia
..

Test cookie blocking on Test Wikipedia

Don't merge until 1.29.0-wmf.4 is deployed to testwiki (Nov. 29).

Bug: T150991
Change-Id: Iae8e05f651e4036bed752380932848d1a0d8e458
---
M wmf-config/InitialiseSettings.php
1 file changed, 5 insertions(+), 0 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 9886561..228d6b2 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -7352,6 +7352,11 @@
'votewiki' => true, // T74589
 ],
 
+'wgCookieSetOnAutoblock' => [
+   'default' => false,
+   'testwiki' => true, // T150991
+],
+
 # groupOverrides @{
 'groupOverrides' => [
// Note: don't change the default setting here, because it won't take

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Sort member list between active/inactive.

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

Change subject: Sort member list between active/inactive.
..


Sort member list between active/inactive.

Probably needs to tweak how transclusion works.

Bug: T141184
Change-Id: I5d92bdb3545edfae1a0c1d4d2704130478a13d1b
---
M i18n/en.json
M i18n/qqq.json
M includes/content/CollaborationListContent.php
3 files changed, 62 insertions(+), 21 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 758bf87..62f7fb9 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -115,5 +115,7 @@
"collaborationkit-green1": "Forest green",
"collaborationkit-green2": "Bright green",
"collaborationkit-green3": "Khaki",
-   "collaborationkit-black": "Black"
+   "collaborationkit-black": "Black",
+   "collaborationkit-column-active": "Active members",
+   "collaborationkit-column-inactive": "Inactive members"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 2859656..51ea868 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -115,5 +115,7 @@
"collaborationkit-green1": "Color label",
"collaborationkit-green2": "Color label",
"collaborationkit-green3": "Color label",
-   "collaborationkit-black": "Color label"
+   "collaborationkit-black": "Color label",
+   "collaborationkit-column-active": "Column header for the list of active 
members of a collaboration hub project",
+   "collaborationkit-column-inactive": "Column header for the list of 
members of a project who are no longer active on wiki."
 }
diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index 46ba902..6a8012d 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -234,10 +234,16 @@
return $text;
}
 
-   $listclass = count( $this->columns ) > 1 ? 'mw-ck-multilist' : 
'mw-ck-singlelist';
+   if ( $this->displaymode === 'members' && count( $this->columns 
) === 1 ) {
+   $columns = $this->sortUsersIntoColumns( 
$this->columns[0] );
+   } else {
+   $columns = $this->columns;
+   }
+
+   $listclass = count( $columns ) > 1 ? 'mw-ck-multilist' : 
'mw-ck-singlelist';
$text .= '' . "\n";
$offset = $options['defaultSort'] === 'random' ? 0 : 
$options['offset'];
-   foreach ( $this->columns as $column ) {
+   foreach ( $columns as $column ) {
$text .= '' . "\n";
if ( isset( $column->label ) && $column->label !== '' ) 
{
$text .= "=== {$column->label} ===\n";
@@ -833,17 +839,53 @@
}
 
/**
+* Sort users into active/inactive column
+*
+* @param $column Array An array containing key items, which
+*  is an array of stdClass's representing each list item.
+*  Each of these has a key named title which contains
+*  a user name (including namespace). May have non-users too.
+* @return Array Two column structure sorted active/inactive.
+* @todo Should link property be taken into account as actual name?
+*/
+   private function sortUsersIntoColumns( $column ) {
+   $nonUserItems = [];
+   $userItems = [];
+   foreach ( $column->items as $item ) {
+   $title = Title::newFromText( $item->title );
+   if ( !$title ||
+   !$title->inNamespace( NS_USER ) ||
+   $title->isSubpage()
+   ) {
+   $nonUserItems[] = $item;
+   } else {
+   $userItems[ $title->getDBKey() ] = $item;
+   }
+   }
+   $res = $this->filterActiveUsers( $userItems );
+   $inactiveFlatList = array_merge( array_values( $res['inactive'] 
), $nonUserItems );
+
+   $activeColumn = (object)[
+   'items' => array_values( $res['active'] ),
+   'label' => wfMessage( 'collaborationkit-column-active' 
)->inContentLanguage()->text(),
+   ];
+   $inactiveColumn = (object)[
+   'items' => $inactiveFlatList,
+   'label' => wfMessage( 
'collaborationkit-column-inactive' )->inContentLanguage()->text(),
+   ];
+
+   return [ $activeColumn, $inactiveColumn ];
+   }
+
+   /**
 * Filter users into active and inactive.
 *
-* @param $userList Array of titles
+* @note The results of this function get stored in parser cache.
+* 

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Sort member list between active/inactive.

2016-11-17 Thread Brian Wolff (Code Review)
Brian Wolff has uploaded a new change for review.

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

Change subject: Sort member list between active/inactive.
..

Sort member list between active/inactive.

Probably needs to tweak how transclusion works.

Bug: T141184
Change-Id: I5d92bdb3545edfae1a0c1d4d2704130478a13d1b
---
M i18n/en.json
M i18n/qqq.json
M includes/content/CollaborationListContent.php
3 files changed, 62 insertions(+), 21 deletions(-)


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

diff --git a/i18n/en.json b/i18n/en.json
index 758bf87..62f7fb9 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -115,5 +115,7 @@
"collaborationkit-green1": "Forest green",
"collaborationkit-green2": "Bright green",
"collaborationkit-green3": "Khaki",
-   "collaborationkit-black": "Black"
+   "collaborationkit-black": "Black",
+   "collaborationkit-column-active": "Active members",
+   "collaborationkit-column-inactive": "Inactive members"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 2859656..51ea868 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -115,5 +115,7 @@
"collaborationkit-green1": "Color label",
"collaborationkit-green2": "Color label",
"collaborationkit-green3": "Color label",
-   "collaborationkit-black": "Color label"
+   "collaborationkit-black": "Color label",
+   "collaborationkit-column-active": "Column header for the list of active 
members of a collaboration hub project",
+   "collaborationkit-column-inactive": "Column header for the list of 
members of a project who are no longer active on wiki."
 }
diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index 46ba902..b445db8 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -234,10 +234,16 @@
return $text;
}
 
-   $listclass = count( $this->columns ) > 1 ? 'mw-ck-multilist' : 
'mw-ck-singlelist';
+   if ( $this->displaymode === 'members' && count( $this->columns 
) === 1 ) {
+   $columns = $this->sortUsersIntoColumns( 
$this->columns[0] );
+   } else {
+   $columns = $this->columns;
+   }
+
+   $listclass = count( $columns ) > 1 ? 'mw-ck-multilist' : 
'mw-ck-singlelist';
$text .= '' . "\n";
$offset = $options['defaultSort'] === 'random' ? 0 : 
$options['offset'];
-   foreach ( $this->columns as $column ) {
+   foreach ( $columns as $column ) {
$text .= '' . "\n";
if ( isset( $column->label ) && $column->label !== '' ) 
{
$text .= "=== {$column->label} ===\n";
@@ -833,17 +839,53 @@
}
 
/**
+* Sort users into active/inactive column
+*
+* @param $column Array An array containing key items, which
+*  is an array of stdClass's representing each list item.
+*  Each of these has a key named title which contains
+*  a user name (including namespace). May have non-users too.
+* @return Array Two column structure sorted active/inactive.
+* @todo Should link property be taken into account as actual name?
+*/
+   private function sortUsersIntoColumns( $column ) {
+   $nonUserItems = [];
+   $userItems = [];
+   foreach( $column->items as $item ) {
+   $title = Title::newFromText( $item->title );
+   if ( !$title ||
+   !$title->inNamespace( NS_USER ) ||
+   $title->isSubpage()
+   ) {
+   $nonUserItems[] = $item;
+   } else {
+   $userItems[ $title->getDBKey() ] = $item;
+   }
+   }
+   $res = $this->filterActiveUsers( $userItems );
+   $inactiveFlatList = array_merge( array_values( $res['inactive'] 
), $nonUserItems );
+
+   $activeColumn = (object)[
+   'items' => array_values( $res['active'] ),
+   'label' => wfMessage( 'collaborationkit-column-active' 
)->inContentLanguage()->text(),
+   ];
+   $inactiveColumn = (object)[
+   'items' => $inactiveFlatList,
+   'label' => wfMessage( 
'collaborationkit-column-inactive' )->inContentLanguage()->text(),
+   ];
+
+   return [ $activeColumn, $inactiveColumn ];
+   }
+
+   /**
 * Filter users into active and inactive.
 *
-* @param $userList Array of titles
+* @note The 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: eslint: Re-enable valid-jsdoc and make a pass

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

Change subject: eslint: Re-enable valid-jsdoc and make a pass
..


eslint: Re-enable valid-jsdoc and make a pass

Change-Id: I5c3c942d5a9c51628619227c4bbaefd1d92a842d
---
M .eslintrc.json
M resources/src/jquery/jquery.accessKeyLabel.js
M resources/src/jquery/jquery.confirmable.js
M resources/src/jquery/jquery.expandableField.js
M resources/src/jquery/jquery.hidpi.js
M resources/src/jquery/jquery.qunit.completenessTest.js
M resources/src/jquery/jquery.tablesorter.js
M resources/src/jquery/jquery.textSelection.js
M resources/src/mediawiki.action/mediawiki.action.history.js
M resources/src/mediawiki.legacy/protect.js
M resources/src/mediawiki.legacy/wikibits.js
M resources/src/mediawiki.special/mediawiki.special.apisandbox.js
M resources/src/mediawiki.special/mediawiki.special.upload.js
M resources/src/mediawiki.toolbar/toolbar.js
M resources/src/mediawiki.widgets.datetime/CalendarWidget.js
M resources/src/mediawiki.widgets.datetime/DateTimeFormatter.js
M resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.js
M resources/src/mediawiki.widgets/mw.widgets.CalendarWidget.js
M resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js
M resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js
M resources/src/mediawiki.widgets/mw.widgets.NamespaceInputWidget.js
M resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js
M resources/src/mediawiki.widgets/mw.widgets.TitleInputWidget.js
M resources/src/mediawiki.widgets/mw.widgets.TitleSearchWidget.js
M resources/src/mediawiki.widgets/mw.widgets.UserInputWidget.js
M resources/src/mediawiki/api.js
M resources/src/mediawiki/api/upload.js
M resources/src/mediawiki/api/watch.js
M resources/src/mediawiki/htmlform/htmlform.Element.js
M resources/src/mediawiki/mediawiki.ForeignStructuredUpload.BookletLayout.js
M resources/src/mediawiki/mediawiki.ForeignStructuredUpload.js
M resources/src/mediawiki/mediawiki.ForeignUpload.js
M resources/src/mediawiki/mediawiki.Title.js
M resources/src/mediawiki/mediawiki.Upload.Dialog.js
M resources/src/mediawiki/mediawiki.Upload.js
M resources/src/mediawiki/mediawiki.Uri.js
M resources/src/mediawiki/mediawiki.confirmCloseWindow.js
M resources/src/mediawiki/mediawiki.debug.js
M resources/src/mediawiki/mediawiki.errorLogger.js
M resources/src/mediawiki/mediawiki.inspect.js
M resources/src/mediawiki/mediawiki.jqueryMsg.js
M resources/src/mediawiki/mediawiki.js
M resources/src/mediawiki/mediawiki.notification.js
M resources/src/mediawiki/mediawiki.searchSuggest.js
M resources/src/mediawiki/mediawiki.template.mustache.js
M resources/src/mediawiki/mediawiki.util.js
M resources/src/mediawiki/mediawiki.viewport.js
M resources/src/mediawiki/page/gallery-slideshow.js
M resources/src/startup.js
49 files changed, 182 insertions(+), 39 deletions(-)

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



diff --git a/.eslintrc.json b/.eslintrc.json
index 135d3b9..044dd72 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -13,7 +13,6 @@
"OO": false
},
"rules": {
-   "dot-notation": 0,
-   "valid-jsdoc": 0
+   "dot-notation": 0
}
 }
diff --git a/resources/src/jquery/jquery.accessKeyLabel.js 
b/resources/src/jquery/jquery.accessKeyLabel.js
index 63b599b..f25944c 100644
--- a/resources/src/jquery/jquery.accessKeyLabel.js
+++ b/resources/src/jquery/jquery.accessKeyLabel.js
@@ -204,6 +204,8 @@
 *
 * @method updateTooltipAccessKeys_getAccessKeyPrefix
 * @deprecated since 1.27 Use #getAccessKeyModifiers
+* @param {Object} [ua] An object with a 'userAgent' and 'platform' 
property.
+* @return {string}
 */
$.fn.updateTooltipAccessKeys.getAccessKeyPrefix = function ( ua ) {
return getAccessKeyModifiers( ua ).join( '-' ) + '-';
diff --git a/resources/src/jquery/jquery.confirmable.js 
b/resources/src/jquery/jquery.confirmable.js
index 1ecce6c..7931c81 100644
--- a/resources/src/jquery/jquery.confirmable.js
+++ b/resources/src/jquery/jquery.confirmable.js
@@ -12,6 +12,7 @@
return data;
};
 
+   // eslint-disable-next-line valid-jsdoc
/**
 * Enable inline confirmation for given clickable element (like `` 
or ``).
 *
diff --git a/resources/src/jquery/jquery.expandableField.js 
b/resources/src/jquery/jquery.expandableField.js
index f9db72f..0bfa8f3 100644
--- a/resources/src/jquery/jquery.expandableField.js
+++ b/resources/src/jquery/jquery.expandableField.js
@@ -19,6 +19,9 @@
$.expandableField = {
/**
 * Expand the field, make the callback
+*
+* @param {jQuery.Event} e Event
+* @param {Object} context
 */
expandField: function ( e, context ) {

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mw.loader: For using() errors, reject Promise instead of thr...

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

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

Change subject: mw.loader: For using() errors, reject Promise instead of 
throwing
..

mw.loader: For using() errors, reject Promise instead of throwing

The "Unknown module" and "Circular dependency" errors both come from the
resolve() function. Add a try/catch around that and reject the promise
if caught.

Bug: T131612
Change-Id: I900909cd00df6a51f3bf1f3df91bdb610c11c446
---
M resources/src/mediawiki/mediawiki.js
M tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
2 files changed, 51 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/50/322150/1

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 4dce192..dd3d6de 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -1168,6 +1168,7 @@
 * @private
 * @param {string[]} modules Array of string module 
names
 * @return {Array} List of dependencies, including 
'module'.
+* @throws {Error} If an unregistered module or a 
dependency loop is encountered
 */
function resolve( modules ) {
var resolved = [];
@@ -1993,8 +1994,12 @@
deferred.fail( error );
}
 
-   // Resolve entire dependency map
-   dependencies = resolve( dependencies );
+   try {
+   // Resolve entire dependency map
+   dependencies = resolve( 
dependencies );
+   } catch ( e ) {
+   return deferred.reject( e 
).promise();
+   }
if ( allReady( dependencies ) ) {
// Run ready immediately
deferred.resolve( 
mw.loader.require );
diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
index 505d9a1..6d24e6e 100644
--- a/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
+++ b/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
@@ -134,6 +134,50 @@
} );
} );
 
+   QUnit.test( '.using() Error: Circular dependency', function ( assert ) {
+   mw.loader.register( [
+   [ 'test.circle1', '0', [ 'test.circle2' ] ],
+   [ 'test.circle2', '0', [ 'test.circle3' ] ],
+   [ 'test.circle3', '0', [ 'test.circle1' ] ]
+   ] );
+   mw.loader.using( 'test.circle3' ).then(
+   function done() {
+   assert.ok( false, 'Unexpected resolution, 
expected error.' );
+   },
+   function fail( e ) {
+   assert.ok( /Circular/.test( String( e ) ), 
'Detect circular dependency' );
+   }
+   );
+   } );
+
+   QUnit.test( '.load() - Error: Circular dependency', function ( assert ) 
{
+   mw.loader.register( [
+   [ 'test.circleA', '0', [ 'test.circleB' ] ],
+   [ 'test.circleB', '0', [ 'test.circleC' ] ],
+   [ 'test.circleC', '0', [ 'test.circleA' ] ]
+   ] );
+   assert.throws( function () {
+   mw.loader.load( 'test.circleC' );
+   }, /Circular/, 'Detect circular dependency' );
+   } );
+
+   QUnit.test( '.using() Error: Unregistered', function ( assert ) {
+   mw.loader.using( 'test.using.unreg' ).then(
+   function done() {
+   assert.ok( false, 'Unexpected resolution, 
expected error.' );
+   },
+   function fail( e ) {
+   assert.ok( /Unknown/.test( String( e ) ), 
'Detect unknown dependency' );
+   }
+   );
+   } );
+
+   QUnit.test( '.load() Error: Unregistered', function ( assert ) {
+   assert.throws( function () {
+   mw.loader.load( 'test.using.unreg' );
+   }, /Unknown/, 'Detect unknown dependency' );
+   } );
+
QUnit.test( '.implement( styles={ "css": [text, ..] } )', 2, function ( 
assert ) {
var $element = $( '' 
).appendTo( '#qunit-fixture' );
 
@@ 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: gridengine: refactor and establish norms

2016-11-17 Thread Rush (Code Review)
Rush has uploaded a new change for review.

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

Change subject: gridengine: refactor and establish norms
..

gridengine: refactor and establish norms

* consistent () and {} for class params
* params end w/ a ','
* require as last stanza item
* Ditch static class headers
* consistent spacing in stanza params

Change-Id: I4f2ec6f544c5a07471743c6880b0a49f34728eda
---
M modules/gridengine/manifests/admin_host.pp
M modules/gridengine/manifests/collector.pp
M modules/gridengine/manifests/exec_host.pp
M modules/gridengine/manifests/hostgroup.pp
M modules/gridengine/manifests/init.pp
M modules/gridengine/manifests/join.pp
M modules/gridengine/manifests/queue.pp
M modules/gridengine/manifests/resource.pp
M modules/gridengine/manifests/resourcedir.pp
M modules/gridengine/manifests/shadow_master.pp
M modules/gridengine/manifests/submit_host.pp
11 files changed, 25 insertions(+), 34 deletions(-)


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

diff --git a/modules/gridengine/manifests/admin_host.pp 
b/modules/gridengine/manifests/admin_host.pp
index b8306c0..9c188af 100644
--- a/modules/gridengine/manifests/admin_host.pp
+++ b/modules/gridengine/manifests/admin_host.pp
@@ -2,13 +2,10 @@
 
 class gridengine::admin_host(
 $config = undef,
-)
-{
+) {
 gridengine::resource { "admin-${::fqdn}":
 rname  => $::fqdn,
 dir=> 'adminhosts',
 config => $config,
 }
-
 }
-
diff --git a/modules/gridengine/manifests/collector.pp 
b/modules/gridengine/manifests/collector.pp
index 14cad3f..bf58193 100644
--- a/modules/gridengine/manifests/collector.pp
+++ b/modules/gridengine/manifests/collector.pp
@@ -4,8 +4,9 @@
 $dir,
 $sourcedir,
 $rname   = $title,
-$config  = undef )
-{
+$config  = undef,
+) {
+
 $etcdir  = '/var/lib/gridengine/etc'
 $conf= "${etcdir}/${dir}/${rname}"
 $dotfile = "${etcdir}/${dir}/.${rname}"
@@ -23,6 +24,4 @@
 command => "${etcdir}/bin/collector '${rname}' '${sourcedir}' 
'${dotfile}' '${conf}'",
 require => File[$dotfile],
 }
-
 }
-
diff --git a/modules/gridengine/manifests/exec_host.pp 
b/modules/gridengine/manifests/exec_host.pp
index d575d3e..05019e5 100644
--- a/modules/gridengine/manifests/exec_host.pp
+++ b/modules/gridengine/manifests/exec_host.pp
@@ -2,8 +2,8 @@
 
 class gridengine::exec_host(
 $config = undef,
-)
-{
+) {
+
 include gridengine
 
 package { 'gridengine-exec':
@@ -24,5 +24,4 @@
 dir=> 'exechosts',
 config => $config,
 }
-
 }
diff --git a/modules/gridengine/manifests/hostgroup.pp 
b/modules/gridengine/manifests/hostgroup.pp
index 5ac1485..87a2b51 100644
--- a/modules/gridengine/manifests/hostgroup.pp
+++ b/modules/gridengine/manifests/hostgroup.pp
@@ -2,13 +2,12 @@
 
 define gridengine::hostgroup(
 $rname  = $title,
-$config = undef )
-{
+$config = undef,
+) {
 
 gridengine::resource { $rname:
 dir=> 'hostgroups',
 config => $config,
 }
-
 }
 
diff --git a/modules/gridengine/manifests/init.pp 
b/modules/gridengine/manifests/init.pp
index 59bac74..38140c2 100644
--- a/modules/gridengine/manifests/init.pp
+++ b/modules/gridengine/manifests/init.pp
@@ -1,5 +1,3 @@
-# gridengine/init.pp
-#
 # The gridmaster parameter is used in the template to preseed the package
 # installation with the (annoyingly) semi-hardcoded FQDN to the grid
 # master server.
@@ -17,6 +15,7 @@
 # definition.  If you change it here, you must change it everywhere.
 
 class gridengine($gridmaster) {
+
 file { '/var/local/preseed':
 ensure => directory,
 mode   => '0600',
@@ -24,16 +23,16 @@
 
 file { '/var/local/preseed/gridengine.preseed':
 ensure  => 'file',
-require => File['/var/local/preseed'],
 mode=> '0600',
 backup  => false,
 content => template('gridengine/gridengine.preseed.erb'),
+require => File['/var/local/preseed'],
 }
 
 package { 'gridengine-common':
 ensure   => latest,
-require  => File['/var/local/preseed/gridengine.preseed'],
 responsefile => '/var/local/preseed/gridengine.preseed',
+require  => File['/var/local/preseed/gridengine.preseed'],
 }
 
 $etcdir = '/var/lib/gridengine/etc'
diff --git a/modules/gridengine/manifests/join.pp 
b/modules/gridengine/manifests/join.pp
index b82d5dd..7e208c3 100644
--- a/modules/gridengine/manifests/join.pp
+++ b/modules/gridengine/manifests/join.pp
@@ -2,8 +2,9 @@
 
 define gridengine::join(
 $sourcedir,
-$list  = undef )
-{
+$list  = undef,
+) {
+
 if $list {
 file { "${sourcedir}/${::fqdn}":
 ensure  => file,
@@ -18,4 +19,3 @@
 }
 }
 }
-
diff --git a/modules/gridengine/manifests/queue.pp 
b/modules/gridengine/manifests/queue.pp
index 8069e32..1cef26c 100644
--- 

[MediaWiki-commits] [Gerrit] mediawiki...Linter[master]: Display self-closed tags

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

Change subject: Display self-closed tags
..


Display self-closed tags

Change-Id: I6c084a6c72114b57a21cd367d398c673c5c4d991
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/LintErrorsPager.php
4 files changed, 10 insertions(+), 3 deletions(-)

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



diff --git a/extension.json b/extension.json
index ce616c9..ee3efe6 100644
--- a/extension.json
+++ b/extension.json
@@ -55,7 +55,8 @@
"obsolete-tag": true,
"bogus-image-options": true,
"missing-end-tag": true,
-   "stripped-tag": true
+   "stripped-tag": true,
+   "self-closed-tag": true
},
"LinterSubmitterWhitelist": {
"127.0.0.1": true
diff --git a/i18n/en.json b/i18n/en.json
index 1d2f2d5..66bd5fa 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -13,6 +13,7 @@
"linter-pager-bogus-image-options-details": "Bogus file option",
"linter-pager-missing-end-tag-details": "Missing end tag",
"linter-pager-stripped-tag-details": "Stripped tag",
+   "linter-pager-self-closed-tag-details": "Self-closed tag",
"linter-category-fostered": "Fostered content",
"linter-category-fostered-desc": "These pages have fostered content.",
"linter-category-obsolete-tag": "Obsolete HTML tags",
@@ -23,6 +24,8 @@
"linter-category-missing-end-tag-desc": "These pages have missing end 
tags.",
"linter-category-stripped-tag": "Stripped tags",
"linter-category-stripped-tag-desc": "These pages have stripped tags.",
+   "linter-category-self-closed-tag": "Self-closed tags",
+   "linter-category-self-closed-tag-desc": "These pages have self-closed 
tags.",
"linker-page-title-edit": "$1 ($2)",
"linker-page-edit": "edit",
"apihelp-query+linterrors-description": "Get a list of lint errors",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 3b8a6d7..07d511a 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -15,6 +15,7 @@
"linter-pager-bogus-image-options-details": "Table column heading",
"linter-pager-missing-end-tag-details": "Table column heading",
"linter-pager-stripped-tag-details": "Table column heading",
+   "linter-pager-self-closed-tag-details": "Table column heading",
"linter-category-fostered": "Name of lint error category. See 
[[:mw:Help:Extension:Linter/fostered]]",
"linter-category-fostered-desc": "Description of category.",
"linter-category-obsolete-tag": "Name of lint error category. See 
[[:mw:Help:Extension:Linter/obsolete-tag]]",
@@ -23,8 +24,10 @@
"linter-category-bogus-image-options-desc": "Description of category",
"linter-category-missing-end-tag": "Name of lint error category. See 
[[:mw:Help:Extension:Linter/missing-end-tag]]",
"linter-category-missing-end-tag-desc": "Description of category",
-   "linter-category-stripped-tag": "Name of lint error category",
+   "linter-category-stripped-tag": "Name of lint error category. See 
[[:mw:Help:Extension:Linter/stripped-tag]]",
"linter-category-stripped-tag-desc": "Description of category",
+   "linter-category-self-closed-tag": "Name of lint error category. See 
[[:mw:Help:Extension:Linter/self-closed-tag]]",
+   "linter-category-self-closed-tag-desc": "Description of category",
"linker-page-title-edit": "Used in a table cell. $1 is a link to the 
page, $2 is a link to edit that page, the link text is 
{{msg-mw|linker-page-edit}}",
"linker-page-edit": "Link text for edit link in 
{{msg-mw|linker-page-title-edit}} and 
{{msg-mw|linker-page-title-edit-template}}\n{{Identical|Edit}}",
"apihelp-query+linterrors-description": 
"{{doc-apihelp-description|query+linterrors}}",
diff --git a/includes/LintErrorsPager.php b/includes/LintErrorsPager.php
index 56abe1c..a9992f0 100644
--- a/includes/LintErrorsPager.php
+++ b/includes/LintErrorsPager.php
@@ -95,7 +95,7 @@
 
return $this->msg( 'linker-page-title-edit' 
)->rawParams( $viewLink, $editLink )->escaped();
case 'details':
-   $hasNameCats = [ 'obsolete-tag', 
'missing-end-tag' ];
+   $hasNameCats = [ 'obsolete-tag', 
'missing-end-tag', 'self-closed-tag' ];
if ( in_array( $this->category, $hasNameCats ) 
&& isset( $lintError->params['name'] ) ) {
return Html::element( 'code', [], 
$lintError->params['name'] );
} elseif ( $this->category === 
'bogus-image-options' && isset( $lintError->params['items'] ) ) {

-- 
To view, visit 

[MediaWiki-commits] [Gerrit] operations/software[master]: mariadb: Update package creation method

2016-11-17 Thread Jcrespo (Code Review)
Jcrespo has uploaded a new change for review.

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

Change subject: mariadb: Update package creation method
..

mariadb: Update package creation method

* Updated mariadb-deb script to indentify automatically the vendor
* Added postinst and postrm scripts handling update-alternatives
* Now can handle mariadb 10.0, 10.1, 10.2, mysql 5.6, 5.7 and 8.0
* Removed init script handling (it is done with puppet)
* Several bugs and fixes

Bug: T127811
Change-Id: I468cd56bf5a225d3964a127c5b222f1f26f5c46b
---
M dbtools/control-mariadb-10.0
A dbtools/control-mariadb-10.1
A dbtools/control-mariadb-10.2
A dbtools/control-mysql-5.6
A dbtools/control-mysql-5.7
A dbtools/control-mysql-8.0
M dbtools/mariadb-deb
A dbtools/mariadb-deb-postinst.tpl.sh
A dbtools/mariadb-deb-postrm.tpl.sh
9 files changed, 122 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software 
refs/changes/47/322147/1

diff --git a/dbtools/control-mariadb-10.0 b/dbtools/control-mariadb-10.0
index a4e0976..4fbc1d9 100644
--- a/dbtools/control-mariadb-10.0
+++ b/dbtools/control-mariadb-10.0
@@ -1,7 +1,12 @@
 Package: wmf-mariadb10
-Version: 10.0.11-1
+Version: 10.0.28-1
 Section: misc
 Priority: optional
 Architecture: amd64
-Maintainer: Sean Pringle 
+Maintainer: Jaime Crespo 
 Description: MariaDB plus patches.
+Depends: libaio1 (>= 0.3.93), libncurses5, libjemalloc1, libdbi-perl,
+ perl (>= 5.6), psmisc, debconf (>= 0.5) | debconf-2.0,
+ libaio1 (>= 0.3.93), libc6 (>= 2.17), libpam0g (>= 0.99.7.1),
+ libstdc++6 (>= 4.9), zlib1g (>= 1:1.2.0)
+
diff --git a/dbtools/control-mariadb-10.1 b/dbtools/control-mariadb-10.1
new file mode 100644
index 000..20833d8
--- /dev/null
+++ b/dbtools/control-mariadb-10.1
@@ -0,0 +1,12 @@
+Package: wmf-mariadb101
+Version: 10.1.19-1
+Section: misc
+Priority: optional
+Architecture: amd64
+Maintainer: Jaime Crespo 
+Description: MariaDB plus patches.
+Depends: libaio1 (>= 0.3.93), libncurses5, libjemalloc1, libdbi-perl,
+ perl (>= 5.6), psmisc, debconf (>= 0.5) | debconf-2.0,
+ libaio1 (>= 0.3.93), libc6 (>= 2.17), libpam0g (>= 0.99.7.1),
+ libstdc++6 (>= 4.9), zlib1g (>= 1:1.2.0)
+
diff --git a/dbtools/control-mariadb-10.2 b/dbtools/control-mariadb-10.2
new file mode 100644
index 000..d1cefba
--- /dev/null
+++ b/dbtools/control-mariadb-10.2
@@ -0,0 +1,12 @@
+Package: wmf-mariadb102
+Version: 10.2.2-1
+Section: misc
+Priority: optional
+Architecture: amd64
+Maintainer: Jaime Crespo 
+Description: MariaDB plus patches.
+Depends: libaio1 (>= 0.3.93), libncurses5, libjemalloc1, libdbi-perl,
+ perl (>= 5.6), psmisc, debconf (>= 0.5) | debconf-2.0,
+ libaio1 (>= 0.3.93), libc6 (>= 2.17), libpam0g (>= 0.99.7.1),
+ libstdc++6 (>= 4.9), zlib1g (>= 1:1.2.0)
+
diff --git a/dbtools/control-mysql-5.6 b/dbtools/control-mysql-5.6
new file mode 100644
index 000..5695cec
--- /dev/null
+++ b/dbtools/control-mysql-5.6
@@ -0,0 +1,12 @@
+Package: wmf-mysql56
+Version: 5.6.34-1
+Section: misc
+Priority: optional
+Architecture: amd64
+Maintainer: Jaime Crespo 
+Description: MySQL plus patches.
+Depends: libaio1 (>= 0.3.93), libncurses5, libjemalloc1, libdbi-perl,
+ perl (>= 5.6), psmisc, debconf (>= 0.5) | debconf-2.0,
+ libaio1 (>= 0.3.93), libc6 (>= 2.17), libpam0g (>= 0.99.7.1),
+ libstdc++6 (>= 4.9), zlib1g (>= 1:1.2.0)
+
diff --git a/dbtools/control-mysql-5.7 b/dbtools/control-mysql-5.7
new file mode 100644
index 000..bdd19ab
--- /dev/null
+++ b/dbtools/control-mysql-5.7
@@ -0,0 +1,12 @@
+Package: wmf-mysql57
+Version: 5.7.16-1
+Section: misc
+Priority: optional
+Architecture: amd64
+Maintainer: Jaime Crespo 
+Description: MySQL plus patches.
+Depends: libaio1 (>= 0.3.93), libncurses5, libjemalloc1, libdbi-perl,
+ perl (>= 5.6), psmisc, debconf (>= 0.5) | debconf-2.0,
+ libaio1 (>= 0.3.93), libc6 (>= 2.17), libpam0g (>= 0.99.7.1),
+ libstdc++6 (>= 4.9), zlib1g (>= 1:1.2.0)
+
diff --git a/dbtools/control-mysql-8.0 b/dbtools/control-mysql-8.0
new file mode 100644
index 000..47f060b
--- /dev/null
+++ b/dbtools/control-mysql-8.0
@@ -0,0 +1,12 @@
+Package: wmf-mysql80
+Version: 8.0.0-dmr-1
+Section: misc
+Priority: optional
+Architecture: amd64
+Maintainer: Jaime Crespo 
+Description: MySQL plus patches.
+Depends: libaio1 (>= 0.3.93), libncurses5, libjemalloc1, libdbi-perl,
+ perl (>= 5.6), psmisc, debconf (>= 0.5) | debconf-2.0,
+ libaio1 (>= 0.3.93), libc6 (>= 2.17), libpam0g (>= 0.99.7.1),
+ libstdc++6 (>= 4.9), zlib1g (>= 1:1.2.0)
+
diff --git a/dbtools/mariadb-deb b/dbtools/mariadb-deb
index 952eb1e..2040965 100755
--- a/dbtools/mariadb-deb
+++ b/dbtools/mariadb-deb
@@ -17,10 +17,11 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: toollabs: refactor and establish norms

2016-11-17 Thread Rush (Code Review)
Rush has submitted this change and it was merged.

Change subject: toollabs: refactor and establish norms
..


toollabs: refactor and establish norms

No Op refactor for style and cruft.

* New comments
* Ditch static class headers
* space between description and class declaration
  and class declaration and first line of stanza
* Attribute ordering: user, group, mode
* when using "require_package" don't have comments
  like "need this package".
* remove empty useless class preamble that is not
  actually fleshed out
* In simple cases (or where it makes sense):
- motd
- include(s)
- package(s)
- file
- service
- monitoring
* trailing comma's on params (even if single param)

Change-Id: Ib0c3b8299754d2b0c76642c4ee579bbb4a055d11
---
M modules/toollabs/manifests/admin_web_updater.pp
M modules/toollabs/manifests/bastion.pp
M modules/toollabs/manifests/bigbrother.pp
M modules/toollabs/manifests/checker.pp
M modules/toollabs/manifests/composer.pp
M modules/toollabs/manifests/compute.pp
M modules/toollabs/manifests/cronrunner.pp
M modules/toollabs/manifests/dev_environ.pp
M modules/toollabs/manifests/exec_environ.pp
M modules/toollabs/manifests/hba.pp
M modules/toollabs/manifests/hostgroups.pp
M modules/toollabs/manifests/images.pp
M modules/toollabs/manifests/infrastructure.pp
M modules/toollabs/manifests/init.pp
M modules/toollabs/manifests/kube2proxy.pp
M modules/toollabs/manifests/kubebuilder.pp
M modules/toollabs/manifests/legacy/fonts.pp
M modules/toollabs/manifests/mailrelay.pp
M modules/toollabs/manifests/maintain_kubeusers.pp
M modules/toollabs/manifests/master.pp
M modules/toollabs/manifests/monitoring/shinken.pp
M modules/toollabs/manifests/node/all.pp
M modules/toollabs/manifests/proxy.pp
M modules/toollabs/manifests/puppetmaster.pp
M modules/toollabs/manifests/queue/continuous.pp
M modules/toollabs/manifests/queue/task.pp
M modules/toollabs/manifests/queues.pp
M modules/toollabs/manifests/redis.pp
M modules/toollabs/manifests/services.pp
M modules/toollabs/manifests/shadow.pp
M modules/toollabs/manifests/static.pp
M modules/toollabs/manifests/updatetools.pp
32 files changed, 124 insertions(+), 237 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, but someone else must approve
  Rush: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/toollabs/manifests/admin_web_updater.pp 
b/modules/toollabs/manifests/admin_web_updater.pp
index 311a0b3..fe9b2af 100644
--- a/modules/toollabs/manifests/admin_web_updater.pp
+++ b/modules/toollabs/manifests/admin_web_updater.pp
@@ -1,8 +1,9 @@
-# Deploy and update root web.
+# This is responsible for http://tools.wmflabs.org/
 class toollabs::admin_web_updater(
 $active
 ) {
 if $active {
+
 # Deploy and update root web.
 git::clone { 'labs/toollabs':
 ensure=> latest,
diff --git a/modules/toollabs/manifests/bastion.pp 
b/modules/toollabs/manifests/bastion.pp
index e587786..e262a82 100644
--- a/modules/toollabs/manifests/bastion.pp
+++ b/modules/toollabs/manifests/bastion.pp
@@ -1,5 +1,3 @@
-# Class: toollabs::bastion
-#
 # This role sets up an bastion/dev instance in the Tool Labs model.
 #
 # [*nproc]
@@ -173,17 +171,17 @@
 
 file {'/etc/security/limits.conf':
 ensure  => file,
-mode=> '0444',
 owner   => 'root',
 group   => 'root',
+mode=> '0444',
 content => template('toollabs/limits.conf.erb'),
 }
 
 file { '/etc/ssh/ssh_config':
 ensure => file,
-mode   => '0444',
 owner  => 'root',
 group  => 'root',
+mode   => '0444',
 source => 'puppet:///modules/toollabs/submithost-ssh_config',
 }
 
@@ -207,9 +205,9 @@
 $cron_host = hiera('active_cronrunner')
 file { '/usr/local/bin/crontab':
 ensure  => file,
-mode=> '0755',
 owner   => 'root',
 group   => 'root',
+mode=> '0755',
 content => template('toollabs/crontab.erb'),
 }
 
@@ -228,5 +226,4 @@
 mode   => '0655',
 source => 'puppet:///modules/toollabs/exec-manage',
 }
-
 }
diff --git a/modules/toollabs/manifests/bigbrother.pp 
b/modules/toollabs/manifests/bigbrother.pp
index 8f43784..c16e4e7 100644
--- a/modules/toollabs/manifests/bigbrother.pp
+++ b/modules/toollabs/manifests/bigbrother.pp
@@ -1,7 +1,5 @@
-# Set up a bigbrother service.
 class toollabs::bigbrother($active) {
 
-# bigbrother needs this perl package
 require_package('libxml-simple-perl')
 
 file { '/usr/local/sbin/bigbrother':
diff --git a/modules/toollabs/manifests/checker.pp 
b/modules/toollabs/manifests/checker.pp
index 45ada30..7e63c61 100644
--- a/modules/toollabs/manifests/checker.pp
+++ b/modules/toollabs/manifests/checker.pp
@@ -1,12 +1,12 @@
-# = Class: toollabs::checker
-#
 # Exposes a set of web endpoints that perform an explicit check for a
 # particular set of internal services, and 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: all wikis to 1.29.0-wmf.3

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

Change subject: all wikis to 1.29.0-wmf.3
..


all wikis to 1.29.0-wmf.3

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

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



diff --git a/wikiversions.json b/wikiversions.json
index 3b6c0bf..5abc2fc 100644
--- a/wikiversions.json
+++ b/wikiversions.json
@@ -1,39 +1,39 @@
 {
-"aawiki": "php-1.29.0-wmf.2",
+"aawiki": "php-1.29.0-wmf.3",
 "aawikibooks": "php-1.29.0-wmf.3",
 "aawiktionary": "php-1.29.0-wmf.3",
-"abwiki": "php-1.29.0-wmf.2",
+"abwiki": "php-1.29.0-wmf.3",
 "abwiktionary": "php-1.29.0-wmf.3",
-"acewiki": "php-1.29.0-wmf.2",
+"acewiki": "php-1.29.0-wmf.3",
 "advisorywiki": "php-1.29.0-wmf.3",
-"adywiki": "php-1.29.0-wmf.2",
-"afwiki": "php-1.29.0-wmf.2",
+"adywiki": "php-1.29.0-wmf.3",
+"afwiki": "php-1.29.0-wmf.3",
 "afwikibooks": "php-1.29.0-wmf.3",
 "afwikiquote": "php-1.29.0-wmf.3",
 "afwiktionary": "php-1.29.0-wmf.3",
-"akwiki": "php-1.29.0-wmf.2",
+"akwiki": "php-1.29.0-wmf.3",
 "akwikibooks": "php-1.29.0-wmf.3",
 "akwiktionary": "php-1.29.0-wmf.3",
-"alswiki": "php-1.29.0-wmf.2",
+"alswiki": "php-1.29.0-wmf.3",
 "alswikibooks": "php-1.29.0-wmf.3",
 "alswikiquote": "php-1.29.0-wmf.3",
 "alswiktionary": "php-1.29.0-wmf.3",
-"amwiki": "php-1.29.0-wmf.2",
+"amwiki": "php-1.29.0-wmf.3",
 "amwikiquote": "php-1.29.0-wmf.3",
 "amwiktionary": "php-1.29.0-wmf.3",
-"angwiki": "php-1.29.0-wmf.2",
+"angwiki": "php-1.29.0-wmf.3",
 "angwikibooks": "php-1.29.0-wmf.3",
 "angwikiquote": "php-1.29.0-wmf.3",
 "angwikisource": "php-1.29.0-wmf.3",
 "angwiktionary": "php-1.29.0-wmf.3",
-"anwiki": "php-1.29.0-wmf.2",
+"anwiki": "php-1.29.0-wmf.3",
 "anwiktionary": "php-1.29.0-wmf.3",
-"arbcom_dewiki": "php-1.29.0-wmf.2",
-"arbcom_enwiki": "php-1.29.0-wmf.2",
-"arbcom_fiwiki": "php-1.29.0-wmf.2",
-"arbcom_nlwiki": "php-1.29.0-wmf.2",
-"arcwiki": "php-1.29.0-wmf.2",
-"arwiki": "php-1.29.0-wmf.2",
+"arbcom_dewiki": "php-1.29.0-wmf.3",
+"arbcom_enwiki": "php-1.29.0-wmf.3",
+"arbcom_fiwiki": "php-1.29.0-wmf.3",
+"arbcom_nlwiki": "php-1.29.0-wmf.3",
+"arcwiki": "php-1.29.0-wmf.3",
+"arwiki": "php-1.29.0-wmf.3",
 "arwikibooks": "php-1.29.0-wmf.3",
 "arwikimedia": "php-1.29.0-wmf.3",
 "arwikinews": "php-1.29.0-wmf.3",
@@ -41,80 +41,80 @@
 "arwikisource": "php-1.29.0-wmf.3",
 "arwikiversity": "php-1.29.0-wmf.3",
 "arwiktionary": "php-1.29.0-wmf.3",
-"arzwiki": "php-1.29.0-wmf.2",
-"astwiki": "php-1.29.0-wmf.2",
+"arzwiki": "php-1.29.0-wmf.3",
+"astwiki": "php-1.29.0-wmf.3",
 "astwikibooks": "php-1.29.0-wmf.3",
 "astwikiquote": "php-1.29.0-wmf.3",
 "astwiktionary": "php-1.29.0-wmf.3",
-"aswiki": "php-1.29.0-wmf.2",
+"aswiki": "php-1.29.0-wmf.3",
 "aswikibooks": "php-1.29.0-wmf.3",
 "aswikisource": "php-1.29.0-wmf.3",
 "aswiktionary": "php-1.29.0-wmf.3",
 "auditcomwiki": "php-1.29.0-wmf.3",
-"avwiki": "php-1.29.0-wmf.2",
+"avwiki": "php-1.29.0-wmf.3",
 "avwiktionary": "php-1.29.0-wmf.3",
-"aywiki": "php-1.29.0-wmf.2",
+"aywiki": "php-1.29.0-wmf.3",
 "aywikibooks": "php-1.29.0-wmf.3",
 "aywiktionary": "php-1.29.0-wmf.3",
-"azbwiki": "php-1.29.0-wmf.2",
-"azwiki": "php-1.29.0-wmf.2",
+"azbwiki": "php-1.29.0-wmf.3",
+"azwiki": "php-1.29.0-wmf.3",
 "azwikibooks": "php-1.29.0-wmf.3",
 "azwikiquote": "php-1.29.0-wmf.3",
 "azwikisource": "php-1.29.0-wmf.3",
 "azwiktionary": "php-1.29.0-wmf.3",
-"barwiki": "php-1.29.0-wmf.2",
-"bat_smgwiki": "php-1.29.0-wmf.2",
-"bawiki": "php-1.29.0-wmf.2",
+"barwiki": "php-1.29.0-wmf.3",
+"bat_smgwiki": "php-1.29.0-wmf.3",
+"bawiki": "php-1.29.0-wmf.3",
 "bawikibooks": "php-1.29.0-wmf.3",
-"bclwiki": "php-1.29.0-wmf.2",
+"bclwiki": "php-1.29.0-wmf.3",
 "bdwikimedia": "php-1.29.0-wmf.3",
-"be_x_oldwiki": "php-1.29.0-wmf.2",
+"be_x_oldwiki": "php-1.29.0-wmf.3",
 "betawikiversity": "php-1.29.0-wmf.3",
-"bewiki": "php-1.29.0-wmf.2",
+"bewiki": "php-1.29.0-wmf.3",
 "bewikibooks": "php-1.29.0-wmf.3",
 "bewikimedia": "php-1.29.0-wmf.3",
 "bewikiquote": "php-1.29.0-wmf.3",
 "bewikisource": "php-1.29.0-wmf.3",
 "bewiktionary": "php-1.29.0-wmf.3",
-"bgwiki": "php-1.29.0-wmf.2",
+"bgwiki": "php-1.29.0-wmf.3",
 "bgwikibooks": "php-1.29.0-wmf.3",
 "bgwikinews": "php-1.29.0-wmf.3",
 "bgwikiquote": "php-1.29.0-wmf.3",
 "bgwikisource": "php-1.29.0-wmf.3",
 "bgwiktionary": "php-1.29.0-wmf.3",
-"bhwiki": "php-1.29.0-wmf.2",
+"bhwiki": "php-1.29.0-wmf.3",
 "bhwiktionary": 

[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Add Czech alias of special page

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

Change subject: Add Czech alias of special page
..


Add Czech alias of special page

Change-Id: Ifa48eee319c1dbc980c4978a4b352363739dde9b
---
M CentralAuth.alias.php
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/CentralAuth.alias.php b/CentralAuth.alias.php
index f72e973..c6d808d 100644
--- a/CentralAuth.alias.php
+++ b/CentralAuth.alias.php
@@ -167,6 +167,10 @@
'GlobalUsers' => array( 'Глобальни_декъашхой' ),
 );
 
+$specialPageAliases['cs'] = array(
+   'CentralAuth' => array ( 'Centrální_ověření' ),
+);
+
 /** German (Deutsch) */
 $specialPageAliases['de'] = array(
'CentralAuth' => array( 'Verwaltung_Benutzerkonten-Zusammenführung' ),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifa48eee319c1dbc980c4978a4b352363739dde9b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Urbanecm 
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] operations/mediawiki-config[master]: all wikis to 1.29.0-wmf.3

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

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

Change subject: all wikis to 1.29.0-wmf.3
..

all wikis to 1.29.0-wmf.3

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


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

diff --git a/wikiversions.json b/wikiversions.json
index 3b6c0bf..5abc2fc 100644
--- a/wikiversions.json
+++ b/wikiversions.json
@@ -1,39 +1,39 @@
 {
-"aawiki": "php-1.29.0-wmf.2",
+"aawiki": "php-1.29.0-wmf.3",
 "aawikibooks": "php-1.29.0-wmf.3",
 "aawiktionary": "php-1.29.0-wmf.3",
-"abwiki": "php-1.29.0-wmf.2",
+"abwiki": "php-1.29.0-wmf.3",
 "abwiktionary": "php-1.29.0-wmf.3",
-"acewiki": "php-1.29.0-wmf.2",
+"acewiki": "php-1.29.0-wmf.3",
 "advisorywiki": "php-1.29.0-wmf.3",
-"adywiki": "php-1.29.0-wmf.2",
-"afwiki": "php-1.29.0-wmf.2",
+"adywiki": "php-1.29.0-wmf.3",
+"afwiki": "php-1.29.0-wmf.3",
 "afwikibooks": "php-1.29.0-wmf.3",
 "afwikiquote": "php-1.29.0-wmf.3",
 "afwiktionary": "php-1.29.0-wmf.3",
-"akwiki": "php-1.29.0-wmf.2",
+"akwiki": "php-1.29.0-wmf.3",
 "akwikibooks": "php-1.29.0-wmf.3",
 "akwiktionary": "php-1.29.0-wmf.3",
-"alswiki": "php-1.29.0-wmf.2",
+"alswiki": "php-1.29.0-wmf.3",
 "alswikibooks": "php-1.29.0-wmf.3",
 "alswikiquote": "php-1.29.0-wmf.3",
 "alswiktionary": "php-1.29.0-wmf.3",
-"amwiki": "php-1.29.0-wmf.2",
+"amwiki": "php-1.29.0-wmf.3",
 "amwikiquote": "php-1.29.0-wmf.3",
 "amwiktionary": "php-1.29.0-wmf.3",
-"angwiki": "php-1.29.0-wmf.2",
+"angwiki": "php-1.29.0-wmf.3",
 "angwikibooks": "php-1.29.0-wmf.3",
 "angwikiquote": "php-1.29.0-wmf.3",
 "angwikisource": "php-1.29.0-wmf.3",
 "angwiktionary": "php-1.29.0-wmf.3",
-"anwiki": "php-1.29.0-wmf.2",
+"anwiki": "php-1.29.0-wmf.3",
 "anwiktionary": "php-1.29.0-wmf.3",
-"arbcom_dewiki": "php-1.29.0-wmf.2",
-"arbcom_enwiki": "php-1.29.0-wmf.2",
-"arbcom_fiwiki": "php-1.29.0-wmf.2",
-"arbcom_nlwiki": "php-1.29.0-wmf.2",
-"arcwiki": "php-1.29.0-wmf.2",
-"arwiki": "php-1.29.0-wmf.2",
+"arbcom_dewiki": "php-1.29.0-wmf.3",
+"arbcom_enwiki": "php-1.29.0-wmf.3",
+"arbcom_fiwiki": "php-1.29.0-wmf.3",
+"arbcom_nlwiki": "php-1.29.0-wmf.3",
+"arcwiki": "php-1.29.0-wmf.3",
+"arwiki": "php-1.29.0-wmf.3",
 "arwikibooks": "php-1.29.0-wmf.3",
 "arwikimedia": "php-1.29.0-wmf.3",
 "arwikinews": "php-1.29.0-wmf.3",
@@ -41,80 +41,80 @@
 "arwikisource": "php-1.29.0-wmf.3",
 "arwikiversity": "php-1.29.0-wmf.3",
 "arwiktionary": "php-1.29.0-wmf.3",
-"arzwiki": "php-1.29.0-wmf.2",
-"astwiki": "php-1.29.0-wmf.2",
+"arzwiki": "php-1.29.0-wmf.3",
+"astwiki": "php-1.29.0-wmf.3",
 "astwikibooks": "php-1.29.0-wmf.3",
 "astwikiquote": "php-1.29.0-wmf.3",
 "astwiktionary": "php-1.29.0-wmf.3",
-"aswiki": "php-1.29.0-wmf.2",
+"aswiki": "php-1.29.0-wmf.3",
 "aswikibooks": "php-1.29.0-wmf.3",
 "aswikisource": "php-1.29.0-wmf.3",
 "aswiktionary": "php-1.29.0-wmf.3",
 "auditcomwiki": "php-1.29.0-wmf.3",
-"avwiki": "php-1.29.0-wmf.2",
+"avwiki": "php-1.29.0-wmf.3",
 "avwiktionary": "php-1.29.0-wmf.3",
-"aywiki": "php-1.29.0-wmf.2",
+"aywiki": "php-1.29.0-wmf.3",
 "aywikibooks": "php-1.29.0-wmf.3",
 "aywiktionary": "php-1.29.0-wmf.3",
-"azbwiki": "php-1.29.0-wmf.2",
-"azwiki": "php-1.29.0-wmf.2",
+"azbwiki": "php-1.29.0-wmf.3",
+"azwiki": "php-1.29.0-wmf.3",
 "azwikibooks": "php-1.29.0-wmf.3",
 "azwikiquote": "php-1.29.0-wmf.3",
 "azwikisource": "php-1.29.0-wmf.3",
 "azwiktionary": "php-1.29.0-wmf.3",
-"barwiki": "php-1.29.0-wmf.2",
-"bat_smgwiki": "php-1.29.0-wmf.2",
-"bawiki": "php-1.29.0-wmf.2",
+"barwiki": "php-1.29.0-wmf.3",
+"bat_smgwiki": "php-1.29.0-wmf.3",
+"bawiki": "php-1.29.0-wmf.3",
 "bawikibooks": "php-1.29.0-wmf.3",
-"bclwiki": "php-1.29.0-wmf.2",
+"bclwiki": "php-1.29.0-wmf.3",
 "bdwikimedia": "php-1.29.0-wmf.3",
-"be_x_oldwiki": "php-1.29.0-wmf.2",
+"be_x_oldwiki": "php-1.29.0-wmf.3",
 "betawikiversity": "php-1.29.0-wmf.3",
-"bewiki": "php-1.29.0-wmf.2",
+"bewiki": "php-1.29.0-wmf.3",
 "bewikibooks": "php-1.29.0-wmf.3",
 "bewikimedia": "php-1.29.0-wmf.3",
 "bewikiquote": "php-1.29.0-wmf.3",
 "bewikisource": "php-1.29.0-wmf.3",
 "bewiktionary": "php-1.29.0-wmf.3",
-"bgwiki": "php-1.29.0-wmf.2",
+"bgwiki": "php-1.29.0-wmf.3",
 "bgwikibooks": "php-1.29.0-wmf.3",
 "bgwikinews": "php-1.29.0-wmf.3",
 "bgwikiquote": "php-1.29.0-wmf.3",
 "bgwikisource": "php-1.29.0-wmf.3",
 "bgwiktionary": "php-1.29.0-wmf.3",
-"bhwiki": "php-1.29.0-wmf.2",
+"bhwiki": 

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Fix MediaDownloadReceiver to work with all API versions.

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

Change subject: Fix MediaDownloadReceiver to work with all API versions.
..


Fix MediaDownloadReceiver to work with all API versions.

This resolves one of the blockers for targeting API 24+.

This fixes the way we update the device's MediaStore upon completion of a
downloaded image or other media file. Instead of using the deprecated
COLUMN_LOCAL_FILENAME, we now use COLUMN_LOCAL_URI. All of the other logic
remains unchanged.

Also, it looks like the MediaDownloadReceiver wasn't wired correctly into
MainFragment, so it wasn't receiving the download completion event. This
patch wires it in correctly.

Bug: T144920
Change-Id: Ie760cd7f86f52a18d0c63ad658f73eba8f0e7c1e
---
M app/src/main/java/org/wikipedia/main/MainFragment.java
M app/src/main/java/org/wikipedia/page/gallery/MediaDownloadReceiver.java
2 files changed, 22 insertions(+), 10 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/main/MainFragment.java 
b/app/src/main/java/org/wikipedia/main/MainFragment.java
index 822b093..2155771 100644
--- a/app/src/main/java/org/wikipedia/main/MainFragment.java
+++ b/app/src/main/java/org/wikipedia/main/MainFragment.java
@@ -2,8 +2,10 @@
 
 import android.annotation.TargetApi;
 import android.app.Activity;
+import android.app.DownloadManager;
 import android.content.ActivityNotFoundException;
 import android.content.Intent;
+import android.content.IntentFilter;
 import android.graphics.Bitmap;
 import android.location.Location;
 import android.os.Build;
@@ -75,6 +77,7 @@
 @BindView(R.id.fragment_main_nav_tab_layout) TabLayout tabLayout;
 private Unbinder unbinder;
 private ExclusiveBottomSheetPresenter bottomSheetPresenter = new 
ExclusiveBottomSheetPresenter();
+private MediaDownloadReceiver mediaDownloadReceiver;
 
 // The permissions request API doesn't take a callback, so in the event we 
have to
 // ask for permission to download a featured image from the feed, we'll 
have to hold
@@ -110,8 +113,16 @@
 return view;
 }
 
+@Override
+public void onPause() {
+super.onPause();
+getContext().unregisterReceiver(mediaDownloadReceiver);
+}
+
 @Override public void onResume() {
 super.onResume();
+getContext().registerReceiver(mediaDownloadReceiver,
+new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
 // update toolbar, since Tab count might have changed
 getActivity().supportInvalidateOptionsMenu();
 // reset the last-page-viewed timer
@@ -146,6 +157,7 @@
 public void onActivityCreated(Bundle savedInstanceState) {
 super.onActivityCreated(savedInstanceState);
 setHasOptionsMenu(true);
+mediaDownloadReceiver = new MediaDownloadReceiver(getActivity());
 }
 
 @Override
diff --git 
a/app/src/main/java/org/wikipedia/page/gallery/MediaDownloadReceiver.java 
b/app/src/main/java/org/wikipedia/page/gallery/MediaDownloadReceiver.java
index 63896b5..fa40e86 100644
--- a/app/src/main/java/org/wikipedia/page/gallery/MediaDownloadReceiver.java
+++ b/app/src/main/java/org/wikipedia/page/gallery/MediaDownloadReceiver.java
@@ -21,21 +21,21 @@
 public class MediaDownloadReceiver extends BroadcastReceiver {
 private static final String FILE_NAMESPACE = "File:";
 
-private Activity activity;
-private DownloadManager downloadManager;
+@NonNull private Activity activity;
+@NonNull private DownloadManager downloadManager;
 
-public MediaDownloadReceiver(Activity activity) {
+public MediaDownloadReceiver(@NonNull Activity activity) {
 this.activity = activity;
 downloadManager = (DownloadManager) 
activity.getSystemService(Context.DOWNLOAD_SERVICE);
 }
 
-public void download(FeaturedImage featuredImage) {
+public void download(@NonNull FeaturedImage featuredImage) {
 String filename = FileUtil.sanitizeFileName(featuredImage.title());
 String targetDirectory = Environment.DIRECTORY_PICTURES;
 performDownloadRequest(featuredImage.image().source(), 
targetDirectory, filename, null);
 }
 
-public void download(GalleryItem galleryItem) {
+public void download(@NonNull GalleryItem galleryItem) {
 String saveFilename = 
FileUtil.sanitizeFileName(trimFileNamespace(galleryItem.getName()));
 String targetDirectory;
 if (FileUtil.isVideo(galleryItem.getMimeType())) {
@@ -77,11 +77,12 @@
 try {
 if (c.moveToFirst()) {
 int statusIndex = 
c.getColumnIndexOrThrow(DownloadManager.COLUMN_STATUS);
-int pathIndex = 
c.getColumnIndexOrThrow(DownloadManager.COLUMN_LOCAL_FILENAME);
+int pathIndex = 

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: DRY up some message date code

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

Change subject: DRY up some message date code
..


DRY up some message date code

Change-Id: Ic0ba331824d7934031f84f270cbc36e8f5344a2f
---
M sites/all/modules/wmf_common/WmfQueueConsumer.php
1 file changed, 5 insertions(+), 12 deletions(-)

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



diff --git a/sites/all/modules/wmf_common/WmfQueueConsumer.php 
b/sites/all/modules/wmf_common/WmfQueueConsumer.php
index 54cae44..61376c8 100644
--- a/sites/all/modules/wmf_common/WmfQueueConsumer.php
+++ b/sites/all/modules/wmf_common/WmfQueueConsumer.php
@@ -2,6 +2,7 @@
 
 use SmashPig\Core\QueueConsumers\BaseQueueConsumer;
 use Exception;
+use SmashPig\CrmLink\Messages\DateFields;
 use WmfException;
 
 /**
@@ -47,18 +48,10 @@
$delay = intval( variable_get( 
'wmf_common_requeue_delay', 20 * 60 ) );
$maxTries = intval( variable_get( 
'wmf_common_requeue_max', 10 ) );
$ageLimit = $delay * $maxTries;
-   if ( isset( $message['source_enqueued_time'] ) ) {
-   // This should be set the first time a message 
is queued and
-   // not updated on retry.
-   $queuedTime = $message['source_enqueued_time'];
-   } else if ( isset( $message['date'] ) ) {
-   // This is not entirely accurate, being the 
date the payment
-   // actually occurred. Can still use it as 
fallback.
-   $queuedTime = $message['date'];
-   } else {
-   // Setting this to 0 means we'll always go the 
reject route
-   // and log an error.
-   $queuedTime = 0;
+   // Defaulting to 0 means we'll always go the reject 
route
+   // and log an error if no date fields are set.
+   $queuedTime = DateFields::getOriginalDateOrDefault( 
$message, 0 );
+   if ( $queuedTime === 0 ) {
watchdog(
'wmf_common',
"Message has no useful information 
about queued date",

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...WikimediaEvents[wmf/1.29.0-wmf.3]: visibilitychange: Consider all changes to imply hidden

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

Change subject: visibilitychange: Consider all changes to imply hidden
..


visibilitychange: Consider all changes to imply hidden

Previously we only emitted "hidden" if the visibilitychange event
was emitted to change state from visible to hidden, not if it
changed from visible to hidden.

It shouldn't make any difference since we already check the initial
value as well. To verify that this doesn't matter, this commit
simplifies the code by removing the document.hidden check from
the change event handler. See also I8e8ec96fc.

Change-Id: Ibd0935bef8f76a0e1a675db5242e2d4e301b0233
(cherry picked from commit c1714315a9459bf1cd8f2752d11675fc2765595d)
---
M modules/ext.wikimediaEvents.visibilitychange.js
1 file changed, 7 insertions(+), 4 deletions(-)

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



diff --git a/modules/ext.wikimediaEvents.visibilitychange.js 
b/modules/ext.wikimediaEvents.visibilitychange.js
index 473cebd..8378a4d 100644
--- a/modules/ext.wikimediaEvents.visibilitychange.js
+++ b/modules/ext.wikimediaEvents.visibilitychange.js
@@ -33,8 +33,8 @@
 
}
 
-   function check() {
-   if ( document[ hidden ] === true && !( mwLoadEnd && 
document.readyState === 'complete' ) ) {
+   function changeHandler() {
+   if ( !( mwLoadEnd && document.readyState === 'complete' ) ) {
trackOnce( 'hidden' );
}
}
@@ -64,8 +64,11 @@
return;
}
 
-   check();
-   document.addEventListener( eventName, check, false );
+   document.addEventListener( eventName, changeHandler, false );
+   // Initial value
+   if ( document[ hidden ] === true ) {
+   trackOnce( 'hidden' );
+   }
trackOnce( 'supported' );
if ( vendor ) {
trackOnce( 'vendor' );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibd0935bef8f76a0e1a675db5242e2d4e301b0233
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: wmf/1.29.0-wmf.3
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Store time spent reading in History entries.

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

Change subject: Store time spent reading in History entries.
..


Store time spent reading in History entries.

This improves the smartness of our History database by adding a "time
spent" column, which keeps track of the total time the user spends looking
at the article. This field is cumulative: if the user visits the article
multiple times, the reading durations are added together.

This also makes use of this new column by plugging it into our Feed
content: the Continue Reading and Because You Read cards will now only
show suggestions for articles that have been read for 30 or more seconds.

Bug: T146646
Bug: T146647
Change-Id: Id8d198a3340c58f7077bd46ebc6147545143d4c4
---
M app/src/main/java/org/wikipedia/database/Database.java
M app/src/main/java/org/wikipedia/database/contract/PageHistoryContract.java
M app/src/main/java/org/wikipedia/feed/continuereading/LastPageReadTask.java
M app/src/main/java/org/wikipedia/history/HistoryEntry.java
M app/src/main/java/org/wikipedia/history/HistoryEntryDatabaseTable.java
D app/src/main/java/org/wikipedia/history/SaveHistoryTask.java
A app/src/main/java/org/wikipedia/history/UpdateHistoryTask.java
M app/src/main/java/org/wikipedia/page/PageDataClient.java
M app/src/main/java/org/wikipedia/page/PageFragment.java
M app/src/main/java/org/wikipedia/page/PageViewModel.java
M 
app/src/main/java/org/wikipedia/page/bottomcontent/MainPageReadMoreTopicTask.java
A app/src/main/java/org/wikipedia/util/ActiveTimer.java
M app/src/main/res/values/dimens.xml
13 files changed, 159 insertions(+), 71 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/database/Database.java 
b/app/src/main/java/org/wikipedia/database/Database.java
index 8345bb4..70ee5b9 100644
--- a/app/src/main/java/org/wikipedia/database/Database.java
+++ b/app/src/main/java/org/wikipedia/database/Database.java
@@ -17,7 +17,7 @@
 
 public class Database extends SQLiteOpenHelper {
 private static final String DATABASE_NAME = "wikipedia.db";
-private static final int DATABASE_VERSION = 14;
+private static final int DATABASE_VERSION = 15;
 
 private final DatabaseTable[] databaseTables = {
 HistoryEntry.DATABASE_TABLE,
diff --git 
a/app/src/main/java/org/wikipedia/database/contract/PageHistoryContract.java 
b/app/src/main/java/org/wikipedia/database/contract/PageHistoryContract.java
index 28dd031..595d393 100644
--- a/app/src/main/java/org/wikipedia/database/contract/PageHistoryContract.java
+++ b/app/src/main/java/org/wikipedia/database/contract/PageHistoryContract.java
@@ -22,6 +22,7 @@
 StrColumn NAMESPACE = new StrColumn(TABLE, "namespace", "string");
 DateColumn TIMESTAMP = new DateColumn(TABLE, "timestamp", "integer");
 IntColumn SOURCE = new IntColumn(TABLE, "source", "integer");
+IntColumn TIME_SPENT = new IntColumn(TABLE, "timeSpent", "integer"); 
// seconds
 
 String[] SELECTION = DbUtil.qualifiedNames(SITE, LANG, NAMESPACE, 
TITLE);
 }
@@ -50,7 +51,7 @@
 StrColumn IMAGE_NAME = PageImageHistoryContract.Col.IMAGE_NAME;
 
 String[] PROJECTION = DbUtil.qualifiedNames(ID, SITE, LANG, TITLE, 
NAMESPACE, TIMESTAMP,
-SOURCE, IMAGE_NAME);
+SOURCE, TIME_SPENT, IMAGE_NAME);
 }
 
 private PageHistoryContract() { }
diff --git 
a/app/src/main/java/org/wikipedia/feed/continuereading/LastPageReadTask.java 
b/app/src/main/java/org/wikipedia/feed/continuereading/LastPageReadTask.java
index bdc409a..648dea6 100644
--- a/app/src/main/java/org/wikipedia/feed/continuereading/LastPageReadTask.java
+++ b/app/src/main/java/org/wikipedia/feed/continuereading/LastPageReadTask.java
@@ -9,6 +9,7 @@
 import android.support.annotation.Nullable;
 import android.text.format.DateUtils;
 
+import org.wikipedia.R;
 import org.wikipedia.concurrency.SaneAsyncTask;
 import org.wikipedia.database.contract.PageHistoryContract;
 import org.wikipedia.database.contract.PageImageHistoryContract;
@@ -51,12 +52,14 @@
 try {
 Uri uri = PageHistoryContract.PageWithImage.URI;
 final String[] projection = null;
-final String selection = ":timestampCol < ? and :sourceCol != ? 
and :sourceCol != ? "
+final String selection = ":timestampCol < ? and :sourceCol != ? 
and :sourceCol != ? and :timeSpentCol >= ?"
 .replaceAll(":timestampCol", 
PageHistoryContract.Col.TIMESTAMP.getName())
-.replaceAll(":sourceCol", 
PageHistoryContract.Page.SOURCE.qualifiedName());
+.replaceAll(":sourceCol", 
PageHistoryContract.Page.SOURCE.qualifiedName())
+.replaceAll(":timeSpentCol", 
PageHistoryContract.Page.TIME_SPENT.qualifiedName());
 final String[] selectionArgs = 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: prometheus: switch 'ops' prometheus to varbit encoding

2016-11-17 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged.

Change subject: prometheus: switch 'ops' prometheus to varbit encoding
..


prometheus: switch 'ops' prometheus to varbit encoding

See also:
* https://prometheus.io/docs/operating/storage/#chunk-encoding
* https://prometheus.io/blog/2016/05/08/when-to-use-varbit-chunks/

Change-Id: I734301d35093ca75bf9ca7b57b6cd68d6d11d3ec
---
M modules/prometheus/manifests/server.pp
M modules/prometheus/templates/initscripts/prometh...@.systemd.erb
M modules/role/manifests/prometheus/ops.pp
3 files changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/modules/prometheus/manifests/server.pp 
b/modules/prometheus/manifests/server.pp
index 61fb13f..a144360 100644
--- a/modules/prometheus/manifests/server.pp
+++ b/modules/prometheus/manifests/server.pp
@@ -50,6 +50,7 @@
 $scrape_interval = '60s',
 $base_path = "/srv/prometheus/${title}",
 $storage_retention = '4320h0m0s',
+$storage_encoding = '1',
 $global_config_extra = {},
 $scrape_configs_extra = [],
 $rule_files_extra = [],
diff --git a/modules/prometheus/templates/initscripts/prometh...@.systemd.erb 
b/modules/prometheus/templates/initscripts/prometh...@.systemd.erb
index 1a261eb..cc8e479 100644
--- a/modules/prometheus/templates/initscripts/prometh...@.systemd.erb
+++ b/modules/prometheus/templates/initscripts/prometh...@.systemd.erb
@@ -3,7 +3,7 @@
 
 [Service]
 User=prometheus
-ExecStart=/usr/bin/prometheus -storage.local.path <%= @metrics_path %> 
-web.listen-address <%= @listen_address %> -web.external-url <%= @external_url 
%> -storage.local.retention <%= @storage_retention %> -config.file <%= 
@base_path %>/prometheus.yml
+ExecStart=/usr/bin/prometheus -storage.local.path <%= @metrics_path %> 
-web.listen-address <%= @listen_address %> -web.external-url <%= @external_url 
%> -storage.local.retention <%= @storage_retention %> -config.file <%= 
@base_path %>/prometheus.yml -storage.local.chunk-encoding-version <%= 
@storage_encoding %>
 Restart=on-failure
 RestartSec=2s
 TimeoutStopSec=10m
diff --git a/modules/role/manifests/prometheus/ops.pp 
b/modules/role/manifests/prometheus/ops.pp
index 26035cd..746d022 100644
--- a/modules/role/manifests/prometheus/ops.pp
+++ b/modules/role/manifests/prometheus/ops.pp
@@ -111,6 +111,7 @@
 }
 
 prometheus::server { 'ops':
+storage_encoding => '2',
 listen_address   => '127.0.0.1:9900',
 scrape_configs_extra => array_concat($mysql_jobs, $varnish_jobs, 
$memcached_jobs),
 global_config_extra  => $config_extra,

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Drop bad banner history entries w/o failmail

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

Change subject: Drop bad banner history entries w/o failmail
..


Drop bad banner history entries w/o failmail

No need to move 'em to the damaged queue - all the bad ones we've
gotten since fixing the length check are malicious.

Bug: T146063
Change-Id: I41ba2b42c24b3af28776173d7c367e70e73101e7
---
M sites/all/modules/wmf_common/WmfException.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/sites/all/modules/wmf_common/WmfException.php 
b/sites/all/modules/wmf_common/WmfException.php
index 6e00b68..22d9e66 100644
--- a/sites/all/modules/wmf_common/WmfException.php
+++ b/sites/all/modules/wmf_common/WmfException.php
@@ -73,7 +73,7 @@
 'no-email' => TRUE,
 ),
 'BANNER_HISTORY' => array(
- 'reject' => TRUE,
+ 'drop' => TRUE,
  'no-email' => TRUE,
 ),
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Get rid of some unused CSS

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

Change subject: Get rid of some unused CSS
..


Get rid of some unused CSS

adyen.css is totally unused, there are no -addl- anything elements

Change-Id: I11a54d1c08ce7875fe556de2136182d0cc3ad3f0
---
D adyen_gateway/forms/css/adyen.css
M gateway_forms/mustache/forms.css
M modules/css/gateway.css
3 files changed, 1 insertion(+), 211 deletions(-)

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



diff --git a/adyen_gateway/forms/css/adyen.css 
b/adyen_gateway/forms/css/adyen.css
deleted file mode 100644
index d8d4937..000
--- a/adyen_gateway/forms/css/adyen.css
+++ /dev/null
@@ -1,184 +0,0 @@
-table#donation_amount {
-   background-color:transparent;
-   border:1px solid #AA;
-   border-collapse:collapse;
-   width: 600px;
-}
-table#donation_amount td {
-   border:1px solid #AA;
-}
-table#donation_amount td.amount_header {
-   background-color:#eef2f7;
-   font-size:90%;
-}
-table#donation_amount td.amount_data {
-   background-color:#daf2db;
-}
-h3.cc_header {
-   padding-bottom: 0;
-   margin-bottom: 0;
-   font-weight: normal;
-}
-div#payment_gateway-donate-addl-info-text {
-   font-size: 90%;
-   line-height: 120%;
-padding-top: 12px;
-}
-div#payment_gateway-donate-submessage {
-   font-size: 90%;
-   line-height: 120%;
-}
-#payment-table-donor td.label, #payment-table-comment td.label, 
#payment-table-cc td.label {
-   white-space: nowrap;
-display: block;
-padding-right: 1em;
-text-align: right;
-width: 94px;
-}
-
-
-.payment-cc-form-section {
-float: none;
-margin-right: 0em;
-margin-bottom: 1em;
-}
-
-#payment_gateway-cc_form_container {
-width: 100%;
-}
-
-#payment_gateway-cc_form_form {
-width: 475px;
-float: right;
-margin-left: 2em;
-padding-left: 2em;
-border-left: 1px solid #BB;
-}
-
-#payment_gateway-cc_form_letter {
-height: 100%;
-}
-
-#payment_gateway-cc_form_letter p {
-font-size: 1.125em;
-margin-bottom: 1.2em;
-}
-
-#payment_gateway-personal-info {
-   margin-right:0 !important;
-}
-
-#payment_gateway-donate-addl-info-secure-logos {
-   float: left;
-   margin-right: 2em;
-}
-
-#payment_gateway-cc_form_letter_inside {   
-   padding-top: .5em;
-}
-
-#payment_gateway-cc_otherways {
-   padding-top: .5em;
-   display: block;
-}
-#payment_gateway-donate-addl-info {
-   margin-top:2em !important;
-   margin-bottom:1em !important;
-}
-
-#appeal {
-   background-color:transparent;
-   border-color:transparent;
-   border-style:solid;
-   border-width:1px 0 1px 1px;
-   padding:16px 24px 24px;
-}
-#appeal-head {
-   font-size:1.5em;
-   line-height:1.125em;
-   padding-bottom:0.5em;
-   padding-top:0.125em;
-}
-#appeal-body {
-   font-size:1.125em;
-   margin-bottom:1em;
-   padding:0.2em 0;
-}
-#donate {
-}
-#donate-head {
-   border:none;
-   font-size:1.5em;
-   line-height:1.125em;
-   padding-bottom:0em;
-   padding-top:0.125em;
-}
-#donate-body {
-   font-size:1.125em;
-   margin-bottom:1em;
-}
-
-/* Move the form up */
-#mw-head-base {
-   height: 1em !important;
-}
-
-/* Hiding content border */
-table {
-   background-color: transparent;
-}
-div#content {
-   background-color: transparent !important;
-   background-image: none !important;
-}
-div#mw-head-base {
-   background-image: none !important;
-}
-#footer {
-   background-image: none !important;
-}
-
-/* Hiding stuff we don't need */
-h1#firstHeading, div#contentSub {
-   display: none;
-}
-
-/* NEW STUFF */
-#greenBackground{
-padding:16px 24px;
-   width:400px;
-background-color:#CCE7CD;
-   border:1px solid #5EAC58;
-}
-p#informationsharing, p#monthlycancel {
-width: 400px;
-padding: 0 15px;
-line-height: 14px;
-font-size: 11px;
-}
-ul#moreinfolinks li{
-list-style: none !important;
-list-style-image: none !important;
-}
-h3.amount_header {
-   padding: 0 0 0.4em 0;
-   margin-bottom: 0;
-   font-weight: normal;
-}
-
-table#payment-table-donor{
-/*margin-left: 10px;*/
-}
-
-/* From Webitects */
-/* Options */
-.form .options-h, .form .options-v { margin: 0; }
-.options-h, .options-v { list-style: none; margin: 0 0 1em 0; }
-.options-h img, .options-v img { vertical-align: middle; }
-.options-h li, .options-v li { background: none; margin-bottom: 0.3em; 
padding: 0; }
-.options-h li { display: inline; line-height: 2.5; margin-right: 0.3em; 
white-space: nowrap; }
-.options-h li select { vertical-align: middle; }
-.options-h li:last-child { margin: 0; }
-.form .options-v { margin-top: 5px; }
-.options-v li { padding-left: 25px; text-indent: -25px; }
-
diff --git a/gateway_forms/mustache/forms.css b/gateway_forms/mustache/forms.css
index 

[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Fix editing the titles of topics with summaries

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

Change subject: Fix editing the titles of topics with summaries
..


Fix editing the titles of topics with summaries

Bug: T149827
Change-Id: Ice677dbe311effd0c2b5f1db7f330317d7fae692
---
M includes/UrlGenerator.php
1 file changed, 1 insertion(+), 16 deletions(-)

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



diff --git a/includes/UrlGenerator.php b/includes/UrlGenerator.php
index 39d82a5..7a0d1f9 100644
--- a/includes/UrlGenerator.php
+++ b/includes/UrlGenerator.php
@@ -86,21 +86,6 @@
}
 
/**
-* Edit the title of a topic workflow.
-*
-* @param Title|null $title
-* @param UUID $workflowId
-* @return Anchor
-*/
-   public function editTitleLink( Title $title = null, UUID $workflowId ) {
-   return new Anchor(
-   wfMessage( 'flow-edit-title' ),
-   $this->resolveTitle( $title, $workflowId ),
-   array( 'action' => 'edit-title' )
-   );
-   }
-
-   /**
 * View a specific revision of a header workflow.
 *
 * @param Title|null $title
@@ -666,7 +651,7 @@
array(
'action' => 'edit-title',
'topic_postId' => $postId->getAlphadecimal(),
-   'topic_format' => 'topic-title-wikitext',
+   'topic_format' => 'wikitext',
)
);
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ice677dbe311effd0c2b5f1db7f330317d7fae692
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 
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] apps...wikipedia[master]: Persist channel parameter from install referrer.

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

Change subject: Persist channel parameter from install referrer.
..


Persist channel parameter from install referrer.

This introduces a new parameter for our install referrer string, called
"channel". If this parameter is present, we will save the channel in
SharedPreferences, so that it will be passed through to the userAgent that
the app uses for all network requests. (The logic of putting the channel
into the userAgent is already there.)

Bug: T149917
Change-Id: Ia4ea46765dacde8e1c1957dc6f94bd36d5807462
---
M app/src/main/java/org/wikipedia/analytics/InstallReceiver.java
M app/src/main/java/org/wikipedia/analytics/InstallReferrerFunnel.java
M app/src/main/java/org/wikipedia/util/ReleaseUtil.java
3 files changed, 12 insertions(+), 11 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/analytics/InstallReceiver.java 
b/app/src/main/java/org/wikipedia/analytics/InstallReceiver.java
index ff7cb72..b06fae4 100644
--- a/app/src/main/java/org/wikipedia/analytics/InstallReceiver.java
+++ b/app/src/main/java/org/wikipedia/analytics/InstallReceiver.java
@@ -9,6 +9,7 @@
 
 import org.wikipedia.WikipediaApp;
 import org.wikipedia.page.PageActivity;
+import org.wikipedia.settings.Prefs;
 import org.wikipedia.util.ReleaseUtil;
 import org.wikipedia.util.ShareUtil;
 import org.wikipedia.util.log.L;
@@ -62,12 +63,14 @@
 String refUrl = null;
 String refCampaignId = null;
 String refCampaignInstallId = null;
+String refChannel = null;
 try {
 // build a proper dummy URI with the referrer appended to it, so 
that we can parse it.
 Uri uri = Uri.parse("/?" + referrerStr);
 refUrl = 
uri.getQueryParameter(InstallReferrerFunnel.PARAM_REFERRER_URL);
 refCampaignId = 
uri.getQueryParameter(InstallReferrerFunnel.PARAM_CAMPAIGN_ID);
 refCampaignInstallId = 
uri.getQueryParameter(InstallReferrerFunnel.PARAM_CAMPAIGN_INSTALL_ID);
+refChannel = 
uri.getQueryParameter(InstallReferrerFunnel.PARAM_CHANNEL);
 } catch (UnsupportedOperationException e) {
 // Can be thrown by getQueryParameter() if the referrer is 
malformed.
 // Don't worry about it.
@@ -81,6 +84,9 @@
 if (!TextUtils.isEmpty(refUrl) && ShareUtil.canOpenUrlInApp(ctx, 
refUrl)) {
 openPageFromUrl(ctx, refUrl);
 }
+if (!TextUtils.isEmpty(refChannel)) {
+Prefs.setAppChannel(refChannel);
+}
 }
 
 private void recordChannelId(@NonNull Context ctx) {
diff --git 
a/app/src/main/java/org/wikipedia/analytics/InstallReferrerFunnel.java 
b/app/src/main/java/org/wikipedia/analytics/InstallReferrerFunnel.java
index aeca557..469f8fa 100644
--- a/app/src/main/java/org/wikipedia/analytics/InstallReferrerFunnel.java
+++ b/app/src/main/java/org/wikipedia/analytics/InstallReferrerFunnel.java
@@ -14,6 +14,7 @@
 public static final String PARAM_REFERRER_URL = "referrer_url";
 public static final String PARAM_CAMPAIGN_ID = "campaign_id";
 public static final String PARAM_CAMPAIGN_INSTALL_ID = "install_id";
+public static final String PARAM_CHANNEL = "channel";
 
 public InstallReferrerFunnel(WikipediaApp app) {
 super(app, SCHEMA_NAME, REV_ID);
diff --git a/app/src/main/java/org/wikipedia/util/ReleaseUtil.java 
b/app/src/main/java/org/wikipedia/util/ReleaseUtil.java
index 582c3be..76a8ce0 100644
--- a/app/src/main/java/org/wikipedia/util/ReleaseUtil.java
+++ b/app/src/main/java/org/wikipedia/util/ReleaseUtil.java
@@ -3,6 +3,7 @@
 import android.content.Context;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
+import android.support.annotation.NonNull;
 
 import org.wikipedia.BuildConfig;
 import org.wikipedia.settings.Prefs;
@@ -42,11 +43,11 @@
 /**
  * Gets the distribution channel for the app from SharedPreferences
  */
-public static String getChannel(Context ctx) {
+@NonNull public static String getChannel(@NonNull Context ctx) {
 String channel = Prefs.getAppChannel();
 if (channel == null) {
-channel = getChannelDescriptor(ctx);
-setChannel(channel);
+channel = getChannelFromManifest(ctx);
+Prefs.setAppChannel(channel);
 }
 return channel;
 }
@@ -68,7 +69,7 @@
  * Returns the distribution channel for the app from AndroidManifest.xml
  * @return The channel (the empty string if not defined)
  */
-private static String getChannelDescriptor(Context ctx) {
+@NonNull private static String getChannelFromManifest(@NonNull Context 
ctx) {
 try {
 ApplicationInfo info = ctx.getPackageManager()
 .getApplicationInfo(BuildConfig.APPLICATION_ID, 

[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: closeOrderReference errors don't blow up

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

Change subject: closeOrderReference errors don't blow up
..


closeOrderReference errors don't blow up

It's nice to clean up the console, but they'll close themselves
after a month anyway. Don't drop the capture and send failmail when
something goes wrong here.

Bug: T150770
Change-Id: I91aee83c560dbe2ba419d626580838bf092f0d56
---
M PaymentProviders/Amazon/Actions/CloseOrderReference.php
1 file changed, 21 insertions(+), 7 deletions(-)

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



diff --git a/PaymentProviders/Amazon/Actions/CloseOrderReference.php 
b/PaymentProviders/Amazon/Actions/CloseOrderReference.php
index 3a1f1bb..13bf1ad 100644
--- a/PaymentProviders/Amazon/Actions/CloseOrderReference.php
+++ b/PaymentProviders/Amazon/Actions/CloseOrderReference.php
@@ -1,5 +1,6 @@
 getOrderReferenceId();
 
Logger::info( "Closing order reference $orderReferenceId" );
-   $response = $client->closeOrderReference( array(
-   'amazon_order_reference_id' => $orderReferenceId,
-   ) )->toArray();
 
-   if ( !empty( $response['Error'] ) ) {
-   Logger::info(
+   // Failure is unexpected, but shouldn't stop us recording
+   // the successful capture
+   try {
+   $response = $client->closeOrderReference(
+   array(
+   'amazon_order_reference_id' => 
$orderReferenceId,
+   )
+   )->toArray();
+
+   if ( !empty( $response['Error'] ) ) {
+   Logger::warning(
+   "Error closing order reference 
$orderReferenceId: " .
+   $response['Error']['Code'] . ': ' .
+   $response['Error']['Message']
+   );
+   return false;
+   }
+   } catch( Exception $ex ) {
+   Logger::warning(
"Error closing order reference 
$orderReferenceId: " .
-   $response['Error']['Code'] . ': ' .
-   $response['Error']['Message']
+   $ex->getMessage()
);
return false;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I91aee83c560dbe2ba419d626580838bf092f0d56
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Cdentinger 
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] wikimedia...SmashPig[master]: Fix Amazon order IDs for manual captures

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

Change subject: Fix Amazon order IDs for manual captures
..


Fix Amazon order IDs for manual captures

When a capture that we request via the front end goes through
correctly, the associated IPN message has our merchant reference
as 'CaptureReferenceId'. However, when the capture fails and DS
has to push it through via the payments console, it gets an
Amazon-generated CaptureReferenceId starting with AUTHORIZE_.
That ID is useless to us, but we can look up the original
merchant reference via the AmazonCaptureId.

The order reference ID is the first 19 digits of that number,
and we should now be setting the merchant reference on the parent
order ID.

Bug: T147973
Change-Id: I02f54e8f74f07e436a3d25409c5377ed08c68b21
---
A PaymentProviders/Amazon/Actions/ReconstructMerchantReference.php
M PaymentProviders/Amazon/AmazonApi.php
A PaymentProviders/Amazon/Tests/AmazonTestCase.php
M PaymentProviders/Amazon/Tests/Data/responses/getOrderReferenceDetails.json
A PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php
M PaymentProviders/Amazon/Tests/phpunit/ApiTest.php
M SmashPig.yaml
7 files changed, 109 insertions(+), 18 deletions(-)

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



diff --git a/PaymentProviders/Amazon/Actions/ReconstructMerchantReference.php 
b/PaymentProviders/Amazon/Actions/ReconstructMerchantReference.php
new file mode 100644
index 000..5b25b91
--- /dev/null
+++ b/PaymentProviders/Amazon/Actions/ReconstructMerchantReference.php
@@ -0,0 +1,42 @@
+getOrderId();
+   if ( !substr( $captureReference, 0, 10 ) === 'AUTHORIZE_' ) {
+   // We only have to fix Amazon-generated IDs with that 
prefix
+   return true;
+   }
+
+   $orderReferenceId = $msg->getOrderReferenceId();
+   Logger::info(
+   "Looking up merchant reference for OrderReference 
$orderReferenceId"
+   );
+   try {
+   $orderId = AmazonApi::get()->findMerchantReference( 
$orderReferenceId );
+   if ( $orderId ) {
+   $msg->setOrderId( $orderId );
+   }
+   return true;
+   } catch ( SmashPigException $ex ) {
+   Logger::error( $ex->getMessage() );
+   return false;
+   }
+   }
+}
diff --git a/PaymentProviders/Amazon/AmazonApi.php 
b/PaymentProviders/Amazon/AmazonApi.php
index 530fb0d..6e27411 100644
--- a/PaymentProviders/Amazon/AmazonApi.php
+++ b/PaymentProviders/Amazon/AmazonApi.php
@@ -87,6 +87,20 @@
}
 
/**
+* @param string $orderReferenceId
+* @return string|null Merchant reference for the order ID, or null if
+*  not set
+*/
+   public function findMerchantReference( $orderReferenceId ) {
+   $details = $this->getOrderReferenceDetails( $orderReferenceId );
+
+   if ( isset( $details['SellerOrderAttributes']['SellerOrderId'] 
) ) {
+   return 
$details['SellerOrderAttributes']['SellerOrderId'];
+   }
+   return null;
+   }
+
+   /**
 * @param string $orderReferenceId 19 character Amazon order ID
 * @return array OrderReferenceDetails as an associative array
 *  @see 
https://payments.amazon.com/documentation/apireference/201752660
diff --git a/PaymentProviders/Amazon/Tests/AmazonTestCase.php 
b/PaymentProviders/Amazon/Tests/AmazonTestCase.php
new file mode 100644
index 000..3e95efd
--- /dev/null
+++ b/PaymentProviders/Amazon/Tests/AmazonTestCase.php
@@ -0,0 +1,30 @@
+mockClient = $config->object( 'payments-client', true );
+   $this->mockClient->calls = array();
+   $this->mockClient->returns = array();
+   $this->mockClient->exceptions = array();
+   }
+
+   public function tearDown() {
+   parent::tearDown();
+   $api = new ReflectionClass( 
'SmashPig\PaymentProviders\Amazon\AmazonApi' );
+   $instance = $api->getProperty( 'instance' );
+   $instance->setAccessible( true );
+   $instance->setValue( null );
+   }
+}
diff --git 
a/PaymentProviders/Amazon/Tests/Data/responses/getOrderReferenceDetails.json 
b/PaymentProviders/Amazon/Tests/Data/responses/getOrderReferenceDetails.json
index 04c8f42..3d6ffc6 100644
--- a/PaymentProviders/Amazon/Tests/Data/responses/getOrderReferenceDetails.json
+++ b/PaymentProviders/Amazon/Tests/Data/responses/getOrderReferenceDetails.json
@@ -13,7 +13,9 @@
 "P01-0133129-0199515-A019658"
 ]
 },
-"SellerOrderAttributes": [],
+"SellerOrderAttributes": {
+"SellerOrderId": "123456789-0"
+},

[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: DRY finding OrderReferenceId, get_class() -> instanceOf

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

Change subject: DRY finding OrderReferenceId, get_class() -> instanceOf
..


DRY finding OrderReferenceId, get_class() -> instanceOf

Refactor AmazonApi and AmazonMessage for less duplicated code
(in the future).

There are a lot of places we might want the order reference ID,
which is the first 19 characters of a the derived IDs. Also, the
client setup has to happen for any API calls, so make in an
instance variable. Finally, use instanceOf instead of get_class
for less brittleness.

Bug: T147973
Change-Id: Ia074b1d9a475f3dfed5b25d09d77a3fc23197228
---
M PaymentProviders/Amazon/Actions/AssociateRefundParent.php
M PaymentProviders/Amazon/Actions/CloseOrderReference.php
M PaymentProviders/Amazon/AmazonApi.php
M PaymentProviders/Amazon/ExpatriatedMessages/AmazonMessage.php
M PaymentProviders/Amazon/ExpatriatedMessages/PaymentCapture.php
M PaymentProviders/Amazon/Tests/phpunit/ApiTest.php
6 files changed, 87 insertions(+), 35 deletions(-)

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



diff --git a/PaymentProviders/Amazon/Actions/AssociateRefundParent.php 
b/PaymentProviders/Amazon/Actions/AssociateRefundParent.php
index 094ca66..9f790d0 100644
--- a/PaymentProviders/Amazon/Actions/AssociateRefundParent.php
+++ b/PaymentProviders/Amazon/Actions/AssociateRefundParent.php
@@ -5,22 +5,23 @@
 use SmashPig\Core\Messages\ListenerMessage;
 use SmashPig\Core\SmashPigException;
 use SmashPig\PaymentProviders\Amazon\AmazonApi;
+use SmashPig\PaymentProviders\Amazon\ExpatriatedMessages\RefundCompleted;
 
 /**
  * Associate refunds with their parent contribution
  */
 class AssociateRefundParent implements IListenerMessageAction {
-   const MESSAGE_CLASS = 
'SmashPig\PaymentProviders\Amazon\ExpatriatedMessages\RefundCompleted';
 
public function execute( ListenerMessage $msg ) {
// Bail out if not a refund
-   if ( get_class( $msg ) !== self::MESSAGE_CLASS ) {
+   if ( !( $msg instanceof RefundCompleted ) ) {
return true;
}
-   $refundId = $msg->getGatewayTransactionId();
-   Logger::info( "Looking up ID of original transaction for refund 
$refundId" );
+
+   $orderReferenceId = $msg->getOrderReferenceId();
+   Logger::info( "Looking up capture ID for order reference 
$orderReferenceId" );
try {
-   $parentId = AmazonApi::findRefundParentId( $refundId );
+   $parentId = AmazonApi::get()->findCaptureId( 
$orderReferenceId );
$msg->setParentId( $parentId );
return true;
} catch ( SmashPigException $ex ) {
diff --git a/PaymentProviders/Amazon/Actions/CloseOrderReference.php 
b/PaymentProviders/Amazon/Actions/CloseOrderReference.php
index 34acd0e..3a1f1bb 100644
--- a/PaymentProviders/Amazon/Actions/CloseOrderReference.php
+++ b/PaymentProviders/Amazon/Actions/CloseOrderReference.php
@@ -4,21 +4,20 @@
 use SmashPig\Core\Context;
 use SmashPig\Core\Logging\Logger;
 use SmashPig\Core\Messages\ListenerMessage;
+use SmashPig\PaymentProviders\Amazon\ExpatriatedMessages\CaptureCompleted;
 
 class CloseOrderReference implements IListenerMessageAction {
-   const MESSAGE_CLASS = 
'SmashPig\PaymentProviders\Amazon\ExpatriatedMessages\CaptureCompleted';
 
public function execute( ListenerMessage $msg ) {
// only close after successful capture
-   if ( get_class( $msg ) !== self::MESSAGE_CLASS ) {
+   if ( !( $msg instanceof CaptureCompleted ) ) {
return true;
}
 
$config = Context::get()->getConfiguration();
$client = $config->object( 'payments-client', true );
 
-   $captureId = $msg->getGatewayTransactionId();
-   $orderReferenceId = substr( $captureId, 0, 19 );
+   $orderReferenceId = $msg->getOrderReferenceId();
 
Logger::info( "Closing order reference $orderReferenceId" );
$response = $client->closeOrderReference( array(
@@ -27,7 +26,7 @@
 
if ( !empty( $response['Error'] ) ) {
Logger::info(
-   "Error losing order reference 
$orderReferenceId: " .
+   "Error closing order reference 
$orderReferenceId: " .
$response['Error']['Code'] . ': ' .
$response['Error']['Message']
);
diff --git a/PaymentProviders/Amazon/AmazonApi.php 
b/PaymentProviders/Amazon/AmazonApi.php
index d02fc51..530fb0d 100644
--- a/PaymentProviders/Amazon/AmazonApi.php
+++ b/PaymentProviders/Amazon/AmazonApi.php
@@ -1,6 +1,7 @@
 getConfiguration();
+   $this->client = 

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Raise error when raplace is done synchronously

2016-11-17 Thread Magul (Code Review)
Magul has uploaded a new change for review.

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

Change subject: Raise error when raplace is done synchronously
..

Raise error when raplace is done synchronously

Bug: T98707
Change-Id: Iba614480373477af41ab245d6383918f59b9d287
---
M scripts/replace.py
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/45/322145/1

diff --git a/scripts/replace.py b/scripts/replace.py
index ff9b06f..41d9c0b 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -670,6 +670,8 @@
 self.changed_pages += 1
 self._pending_processed_titles.put((page.title(asLink=True), True))
 else:  # unsuccessful pages
+if self.getOption('always'):
+raise err
 self._pending_processed_titles.put((page.title(asLink=True), 
False))
 
 def generate_summary(self, applied_replacements):
@@ -712,7 +714,7 @@
 try:
 # Load the page's text from the wiki
 original_text = page.get(get_redirect=True)
-if not page.canBeEdited():
+if not self.getOption('always') and not page.canBeEdited():
 pywikibot.output(u"You can't edit page %s"
  % page.title(asLink=True))
 continue

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba614480373477af41ab245d6383918f59b9d287
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Magul 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikidata[wmf/1.29.0-wmf.3]: Backporting fix for quantity precision issue.

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

Change subject: Backporting fix for quantity precision issue.
..


Backporting fix for quantity precision issue.

The actual fix is in data-values/number,
see https://github.com/DataValues/Number/pull/89

Bug: T150948
Change-Id: I671387133d5caff0b3eaea129fa6cfe5394d6f73
---
M composer.json
M composer.lock
M 
extensions/Wikibase/client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
M extensions/Wikibase/composer.json
M extensions/Wikibase/lib/includes/Formatters/QuantityDetailsFormatter.php
M 
extensions/Wikibase/lib/tests/phpunit/Formatters/WikibaseValueFormatterBuildersTest.php
M extensions/Wikibase/repo/tests/phpunit/includes/Api/FormatSnakValueTest.php
M vendor/composer/installed.json
M vendor/data-values/number/Number.php
M vendor/data-values/number/README.md
M vendor/data-values/number/phpcs.xml
M vendor/data-values/number/src/ValueFormatters/QuantityFormatter.php
M vendor/data-values/number/src/ValueFormatters/QuantityHtmlFormatter.php
M vendor/data-values/number/tests/DataValues/DecimalMathTest.php
M vendor/data-values/number/tests/DataValues/DecimalValueTest.php
M vendor/data-values/number/tests/ValueFormatters/QuantityFormatterTest.php
M vendor/data-values/number/tests/ValueFormatters/QuantityHtmlFormatterTest.php
M vendor/data-values/number/tests/ValueParsers/QuantityParserTest.php
18 files changed, 221 insertions(+), 158 deletions(-)

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



diff --git a/composer.json b/composer.json
index efeecc9..97e68d3 100644
--- a/composer.json
+++ b/composer.json
@@ -30,7 +30,7 @@
 ],
 "require": {
 "php": ">=5.5.0",
-"mediawiki/article-placeholder": "dev-master",
+"mediawiki/article-placeholder": 
"dev-master#769b04978d11696e3315592a5d8fe9ebe4df3bd3",
 "propertysuggester/property-suggester": "~3.1.2",
 "wikibase/wikibase": "dev-wmf/1.29.0-wmf.3",
 "wikibase/wikimedia-badges": "dev-master",
@@ -66,4 +66,4 @@
 "merge-dev": false
 }
 }
-}
+}
\ No newline at end of file
diff --git a/composer.lock b/composer.lock
index fa74344..07e3f10 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,8 @@
 "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file;,
 "This file is @generated automatically"
 ],
-"hash": "53b735cea98fd0171b84207619c377aa",
-"content-hash": "8428755becafb343c71aa61a6e7aacb2",
+"hash": "261f0e0f55d8dc1d595ab8c78277f3d5",
+"content-hash": "5daf02a3cf406c54ae53e71c1ef1749d",
 "packages": [
 {
 "name": "composer/installers",
@@ -457,16 +457,16 @@
 },
 {
 "name": "data-values/number",
-"version": "0.8.1",
+"version": "0.8.2",
 "source": {
 "type": "git",
 "url": "https://github.com/DataValues/Number.git;,
-"reference": "f3d5e648898c3dc54cd1503948b3a7cd6c64b7f1"
+"reference": "312b48b8cd89cae2fcf5fd2b7dbcbcecb352f87a"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/DataValues/Number/zipball/f3d5e648898c3dc54cd1503948b3a7cd6c64b7f1;,
-"reference": "f3d5e648898c3dc54cd1503948b3a7cd6c64b7f1",
+"url": 
"https://api.github.com/repos/DataValues/Number/zipball/312b48b8cd89cae2fcf5fd2b7dbcbcecb352f87a;,
+"reference": "312b48b8cd89cae2fcf5fd2b7dbcbcecb352f87a",
 "shasum": ""
 },
 "require": {
@@ -507,7 +507,7 @@
 "valueparsers",
 "wikidata"
 ],
-"time": "2016-08-03 10:00:30"
+"time": "2016-11-17 12:28:42"
 },
 {
 "name": "data-values/serialization",
@@ -827,7 +827,7 @@
 ],
 "description": "Provides a special page with Wikibase information 
about a certain topic, with invitation to create an article for the topic",
 "homepage": 
"https://www.mediawiki.org/wiki/Extension:ArticlePlaceholder;,
-"time": "2016-11-14 21:48:06"
+"time": "2016-11-16 21:55:38"
 },
 {
 "name": "propertysuggester/property-suggester",
@@ -1471,12 +1471,12 @@
 "source": {
 "type": "git",
 "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git;,
-"reference": "f6078e3439308e687bfaba9e664459ed552d6988"
+"reference": "6f5f1bb42b61f2cc675433f1021d9daf9b4b5f64"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/f6078e3439308e687bfaba9e664459ed552d6988;,
-

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Phab: Remove custom UI string translations not in use anymore

2016-11-17 Thread Aklapper (Code Review)
Aklapper has uploaded a new change for review.

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

Change subject: Phab: Remove custom UI string translations not in use anymore
..

Phab: Remove custom UI string translations not in use anymore

Change-Id: I0e9c4754a06bdcf6b626898c3a346dbeb9429e13
---
M modules/phabricator/data/fixed_settings.yaml
1 file changed, 0 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/44/322144/1

diff --git a/modules/phabricator/data/fixed_settings.yaml 
b/modules/phabricator/data/fixed_settings.yaml
index 3664abc..36112ae 100644
--- a/modules/phabricator/data/fixed_settings.yaml
+++ b/modules/phabricator/data/fixed_settings.yaml
@@ -188,10 +188,6 @@
   'Maniphest Task': 'Task'
   'Pholio Mock': 'Mockup'
   'Real Name': 'Also Known As'
-  # T33
-  'Edit Blocking Tasks': "Edit 'Blocked By' Tasks"
-  'Current Blocking Tasks': "Current 'Blocked By' Tasks"
-  'Save Blocking Tasks': "Save 'Blocked By' Tasks"
   # T152, 257
   'Export to Excel': 'Export (disabled)'
   'Export Tasks to Excel': 'Export Tasks'

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Interwiki map update

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

Change subject: Interwiki map update
..


Interwiki map update

Includes creation of projectcomwiki as well as several changes to HTTPS links

Bug: T150926
Change-Id: Ibd3a975d2d081f31a42ffedc25f83ef87a131c3f
---
M wmf-config/interwiki.php
1 file changed, 17 insertions(+), 6 deletions(-)

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



diff --git a/wmf-config/interwiki.php b/wmf-config/interwiki.php
index c8d0672..bb74124 100644
--- a/wmf-config/interwiki.php
+++ b/wmf-config/interwiki.php
@@ -1,5 +1,5 @@
  '0 
http://www.acronymfinder.com/af-query.asp?String=exact=$1',
'__global:advisory' => '1 https://advisory.wikimedia.org/wiki/$1',
@@ -170,7 +170,7 @@
'__global:lojban' => '0 http://mw.lojban.org/papri/$1',
'__global:lostpedia' => '0 http://lostpedia.wikia.com/wiki/$1',
'__global:lqwiki' => '0 http://wiki.linuxquestions.org/wiki/$1',
-   '__global:luxo' => '0 //tools.wmflabs.org/guc/?user=$1',
+   '__global:luxo' => '0 https://tools.wmflabs.org/guc/?user=$1',
'__global:mail' => '1 https://lists.wikimedia.org/mailman/listinfo/$1',
'__global:mailarchive' => '1 https://lists.wikimedia.org/pipermail/$1',
'__global:mariowiki' => '0 http://www.mariowiki.com/$1',
@@ -270,7 +270,7 @@
'__global:species' => '1 //species.wikimedia.org/wiki/$1',
'__global:squeak' => '0 http://wiki.squeak.org/squeak/$1',
'__global:stats' => '1 //stats.wikimedia.org/$1',
-   '__global:stewardry' => '0 //tools.wmflabs.org/meta/stewardry/?wiki=$1',
+   '__global:stewardry' => '0 
https://tools.wmflabs.org/meta/stewardry/?wiki=$1',
'__global:strategy' => '1 https://strategy.wikimedia.org/wiki/$1',
'__global:strategywiki' => '0 http://strategywiki.org/wiki/$1',
'__global:sulutil' => '1 
https://meta.wikimedia.org/wiki/Special:CentralAuth/$1',
@@ -293,7 +293,7 @@
'__global:tmbw' => '0 http://tmbw.net/wiki/$1',
'__global:tmnet' => '0 http://www.technomanifestos.net/?$1',
'__global:tmwiki' => '0 http://www.EasyTopicMaps.com/?page=$1',
-   '__global:toollabs' => '0 //tools.wmflabs.org/$1',
+   '__global:toollabs' => '0 https://tools.wmflabs.org/$1',
'__global:tools' => '0 //toolserver.org/$1',
'__global:tswiki' => '1 //www.mediawiki.org/wiki/Toolserver:$1',
'__global:translatewiki' => '0 https://translatewiki.net/wiki/$1',
@@ -404,7 +404,7 @@
'__global:wmtw' => '0 http://wikimedia.tw/wiki/index.php5/$1',
'__global:wmua' => '1 https://ua.wikimedia.org/wiki/$1',
'__global:wmuk' => '1 https://wikimedia.org.uk/wiki/$1',
-   '__global:wmve' => '1 http://wikimedia.org.ve/wiki/$1',
+   '__global:wmve' => '1 https://wikimedia.org.ve/wiki/$1',
'__global:wmza' => '1 http://wikimedia.org.za/wiki/$1',
'__global:wm2005' => '1 https://wikimania2005.wikimedia.org/wiki/$1',
'__global:wm2006' => '1 https://wikimania2006.wikimedia.org/wiki/$1',
@@ -8801,6 +8801,16 @@
'pntwiki:chapter' => '1 https://pnt.wikimedia.org/wiki/$1',
'pntwiki:v' => '1 https://pnt.wikiversity.org/wiki/$1',
'pntwiki:voy' => '1 https://pnt.wikivoyage.org/wiki/$1',
+   '__sites:projectcomwiki' => 'wiki',
+   'projectcomwiki:w' => '1 https://en.wikipedia.org/wiki/$1',
+   'projectcomwiki:wikt' => '1 https://en.wiktionary.org/wiki/$1',
+   'projectcomwiki:q' => '1 https://en.wikiquote.org/wiki/$1',
+   'projectcomwiki:b' => '1 https://en.wikibooks.org/wiki/$1',
+   'projectcomwiki:n' => '1 https://en.wikinews.org/wiki/$1',
+   'projectcomwiki:s' => '1 https://en.wikisource.org/wiki/$1',
+   'projectcomwiki:chapter' => '1 https://en.wikimedia.org/wiki/$1',
+   'projectcomwiki:v' => '1 https://en.wikiversity.org/wiki/$1',
+   'projectcomwiki:voy' => '1 https://en.wikivoyage.org/wiki/$1',
'__sites:pswiki' => 'wiki',
'pswiki:wikt' => '1 https://ps.wiktionary.org/wiki/$1',
'pswiki:q' => '1 https://ps.wikiquote.org/wiki/$1',
@@ -11437,7 +11447,7 @@
'__list:_wikimedia' => 'aa ab ace ady af ak als am an ang ar arc arz as 
ast av ay az azb ba bar bat-smg bcl be be-tarask be-x-old bg bh bi bjn bm bn bo 
bpy br bs bug bxr ca cbk-zam cdo ce ceb ch cho chr chy ckb cmn co cr crh cs csb 
cu cv cy cz da de diq dk dsb dv dz ee egl el eml en eo epo es et eu ext fa ff 
fi fiu-vro fj fo fr frp frr fur fy ga gag gan gd gl glk gn gom got gsw gu gv ha 
hak haw he hi hif ho hr hsb ht hu hy hz ia id ie ig ii ik ilo io is it iu ja 
jam jbo jp jv ka kaa kab kbd kg ki kj kk kl km kn ko koi kr krc ks ksh ku kv kw 
ky la lad lb lbe lez lg li lij lmo ln lo lrc lt ltg lv lzh mai map-bms mdf mg 
mh mhr mi min minnan mk ml mn mo mr mrj ms mt mus mwl my myv mzn na nah nan nap 
nb nds nds-nl ne new ng nl nn no nov nrm nso nv ny oc olo om or os pa 

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Persist channel parameter from install referrer.

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

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

Change subject: Persist channel parameter from install referrer.
..

Persist channel parameter from install referrer.

This introduces a new parameter for our install referrer string, called
"channel". If this parameter is present, we will save the channel in
SharedPreferences, so that it will be passed through to the userAgent that
the app uses for all network requests. (The logic of putting the channel
into the userAgent is already there.)

Bug: T149917
Change-Id: Ia4ea46765dacde8e1c1957dc6f94bd36d5807462
---
M app/src/main/java/org/wikipedia/analytics/InstallReceiver.java
M app/src/main/java/org/wikipedia/analytics/InstallReferrerFunnel.java
M app/src/main/java/org/wikipedia/util/ReleaseUtil.java
3 files changed, 12 insertions(+), 11 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/analytics/InstallReceiver.java 
b/app/src/main/java/org/wikipedia/analytics/InstallReceiver.java
index ff7cb72..b06fae4 100644
--- a/app/src/main/java/org/wikipedia/analytics/InstallReceiver.java
+++ b/app/src/main/java/org/wikipedia/analytics/InstallReceiver.java
@@ -9,6 +9,7 @@
 
 import org.wikipedia.WikipediaApp;
 import org.wikipedia.page.PageActivity;
+import org.wikipedia.settings.Prefs;
 import org.wikipedia.util.ReleaseUtil;
 import org.wikipedia.util.ShareUtil;
 import org.wikipedia.util.log.L;
@@ -62,12 +63,14 @@
 String refUrl = null;
 String refCampaignId = null;
 String refCampaignInstallId = null;
+String refChannel = null;
 try {
 // build a proper dummy URI with the referrer appended to it, so 
that we can parse it.
 Uri uri = Uri.parse("/?" + referrerStr);
 refUrl = 
uri.getQueryParameter(InstallReferrerFunnel.PARAM_REFERRER_URL);
 refCampaignId = 
uri.getQueryParameter(InstallReferrerFunnel.PARAM_CAMPAIGN_ID);
 refCampaignInstallId = 
uri.getQueryParameter(InstallReferrerFunnel.PARAM_CAMPAIGN_INSTALL_ID);
+refChannel = 
uri.getQueryParameter(InstallReferrerFunnel.PARAM_CHANNEL);
 } catch (UnsupportedOperationException e) {
 // Can be thrown by getQueryParameter() if the referrer is 
malformed.
 // Don't worry about it.
@@ -81,6 +84,9 @@
 if (!TextUtils.isEmpty(refUrl) && ShareUtil.canOpenUrlInApp(ctx, 
refUrl)) {
 openPageFromUrl(ctx, refUrl);
 }
+if (!TextUtils.isEmpty(refChannel)) {
+Prefs.setAppChannel(refChannel);
+}
 }
 
 private void recordChannelId(@NonNull Context ctx) {
diff --git 
a/app/src/main/java/org/wikipedia/analytics/InstallReferrerFunnel.java 
b/app/src/main/java/org/wikipedia/analytics/InstallReferrerFunnel.java
index aeca557..469f8fa 100644
--- a/app/src/main/java/org/wikipedia/analytics/InstallReferrerFunnel.java
+++ b/app/src/main/java/org/wikipedia/analytics/InstallReferrerFunnel.java
@@ -14,6 +14,7 @@
 public static final String PARAM_REFERRER_URL = "referrer_url";
 public static final String PARAM_CAMPAIGN_ID = "campaign_id";
 public static final String PARAM_CAMPAIGN_INSTALL_ID = "install_id";
+public static final String PARAM_CHANNEL = "channel";
 
 public InstallReferrerFunnel(WikipediaApp app) {
 super(app, SCHEMA_NAME, REV_ID);
diff --git a/app/src/main/java/org/wikipedia/util/ReleaseUtil.java 
b/app/src/main/java/org/wikipedia/util/ReleaseUtil.java
index 582c3be..76a8ce0 100644
--- a/app/src/main/java/org/wikipedia/util/ReleaseUtil.java
+++ b/app/src/main/java/org/wikipedia/util/ReleaseUtil.java
@@ -3,6 +3,7 @@
 import android.content.Context;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
+import android.support.annotation.NonNull;
 
 import org.wikipedia.BuildConfig;
 import org.wikipedia.settings.Prefs;
@@ -42,11 +43,11 @@
 /**
  * Gets the distribution channel for the app from SharedPreferences
  */
-public static String getChannel(Context ctx) {
+@NonNull public static String getChannel(@NonNull Context ctx) {
 String channel = Prefs.getAppChannel();
 if (channel == null) {
-channel = getChannelDescriptor(ctx);
-setChannel(channel);
+channel = getChannelFromManifest(ctx);
+Prefs.setAppChannel(channel);
 }
 return channel;
 }
@@ -68,7 +69,7 @@
  * Returns the distribution channel for the app from AndroidManifest.xml
  * @return The channel (the empty string if not defined)
  */
-private static String getChannelDescriptor(Context ctx) {
+@NonNull private static String getChannelFromManifest(@NonNull Context 
ctx) {
 try {
 ApplicationInfo info = ctx.getPackageManager()
 

[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update mobileapps to bf44547

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

Change subject: Update mobileapps to bf44547
..


Update mobileapps to bf44547

List of changes:
04c08ad Announcements on other wikis also return 200
f1ea24f Hygiene: replace let with const where noted
6dcd11a Forbid var usage
f22ed8c Fix: don't autofix style offenders
xxx Update node module dependencies

Change-Id: Ib85fb6c5d57ce8944a95465ba1a059499ffde65f
---
M node_modules/heapdump/build/Makefile
M 
node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d
M node_modules/heapdump/build/addon.target.mk
M node_modules/heapdump/build/config.gypi
M node_modules/http-errors/node_modules/setprototypeof/index.js
M node_modules/http-errors/node_modules/setprototypeof/package.json
M node_modules/http-errors/package.json
M node_modules/inherits/inherits.js
M node_modules/inherits/package.json
D node_modules/inherits/test.js
M 
node_modules/service-runner/node_modules/limitation/node_modules/kad/package.json
M src
12 files changed, 119 insertions(+), 121 deletions(-)

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



diff --git a/node_modules/heapdump/build/Makefile 
b/node_modules/heapdump/build/Makefile
index 285e8ee..c9d9d51 100644
--- a/node_modules/heapdump/build/Makefile
+++ b/node_modules/heapdump/build/Makefile
@@ -308,8 +308,8 @@
 endif
 
 quiet_cmd_regen_makefile = ACTION Regenerating $@
-cmd_regen_makefile = cd $(srcdir); 
/usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py
 -fmake --ignore-environment "--toplevel-dir=." 
-I/opt/service/node_modules/heapdump/build/config.gypi 
-I/usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
 -I/root/.node-gyp/4.6.0/include/node/common.gypi "--depth=." "-Goutput_dir=." 
"--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" 
"-Dnode_root_dir=/root/.node-gyp/4.6.0" 
"-Dnode_gyp_dir=/usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp"
 "-Dnode_lib_file=node.lib" 
"-Dmodule_root_dir=/opt/service/node_modules/heapdump" binding.gyp
-Makefile: 
$(srcdir)/../../../../usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
 $(srcdir)/build/config.gypi $(srcdir)/binding.gyp 
$(srcdir)/../../../../root/.node-gyp/4.6.0/include/node/common.gypi
+cmd_regen_makefile = cd $(srcdir); 
/usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py
 -fmake --ignore-environment "--toplevel-dir=." 
-I/opt/service/node_modules/heapdump/build/config.gypi 
-I/usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
 -I/home/runuser/.node-gyp/4.6.0/include/node/common.gypi "--depth=." 
"-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" 
"-Dvisibility=default" "-Dnode_root_dir=/home/runuser/.node-gyp/4.6.0" 
"-Dnode_gyp_dir=/usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp"
 "-Dnode_lib_file=node.lib" 
"-Dmodule_root_dir=/opt/service/node_modules/heapdump" binding.gyp
+Makefile: 
$(srcdir)/../../../../home/runuser/.node-gyp/4.6.0/include/node/common.gypi 
$(srcdir)/../../../../usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
 $(srcdir)/build/config.gypi $(srcdir)/binding.gyp
$(call do_cmd,regen_makefile)
 
 # "all" is a concatenation of the "all" targets from all the included
diff --git 
a/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d
 
b/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d
index 022660f..9af41a7 100644
--- 
a/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d
+++ 
b/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d
@@ -1,34 +1,36 @@
-cmd_Release/obj.target/addon/src/heapdump.o := g++ 
'-DNODE_GYP_MODULE_NAME=addon' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' 
'-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' 
'-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/4.6.0/include/node 
-I/root/.node-gyp/4.6.0/src -I/root/.node-gyp/4.6.0/deps/uv/include 
-I/root/.node-gyp/4.6.0/deps/v8/include  -fPIC -pthread -Wall -Wextra 
-Wno-unused-parameter -m64 -O3 -ffunction-sections -fdata-sections 
-fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF 
./Release/.deps/Release/obj.target/addon/src/heapdump.o.d.raw   -c -o 
Release/obj.target/addon/src/heapdump.o ../src/heapdump.cc
+cmd_Release/obj.target/addon/src/heapdump.o := g++ 
'-DNODE_GYP_MODULE_NAME=addon' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' 
'-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' 
'-DBUILDING_NODE_EXTENSION' -I/home/runuser/.node-gyp/4.6.0/include/node 
-I/home/runuser/.node-gyp/4.6.0/src 

[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update mobileapps to bf44547

2016-11-17 Thread BearND (Code Review)
BearND has uploaded a new change for review.

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

Change subject: Update mobileapps to bf44547
..

Update mobileapps to bf44547

List of changes:
04c08ad Announcements on other wikis also return 200
f1ea24f Hygiene: replace let with const where noted
6dcd11a Forbid var usage
f22ed8c Fix: don't autofix style offenders
xxx Update node module dependencies

Change-Id: Ib85fb6c5d57ce8944a95465ba1a059499ffde65f
---
M node_modules/heapdump/build/Makefile
M 
node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d
M node_modules/heapdump/build/addon.target.mk
M node_modules/heapdump/build/config.gypi
M node_modules/http-errors/node_modules/setprototypeof/index.js
M node_modules/http-errors/node_modules/setprototypeof/package.json
M node_modules/http-errors/package.json
M node_modules/inherits/inherits.js
M node_modules/inherits/package.json
D node_modules/inherits/test.js
M 
node_modules/service-runner/node_modules/limitation/node_modules/kad/package.json
M src
12 files changed, 119 insertions(+), 121 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps/deploy 
refs/changes/42/322142/1

diff --git a/node_modules/heapdump/build/Makefile 
b/node_modules/heapdump/build/Makefile
index 285e8ee..c9d9d51 100644
--- a/node_modules/heapdump/build/Makefile
+++ b/node_modules/heapdump/build/Makefile
@@ -308,8 +308,8 @@
 endif
 
 quiet_cmd_regen_makefile = ACTION Regenerating $@
-cmd_regen_makefile = cd $(srcdir); 
/usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py
 -fmake --ignore-environment "--toplevel-dir=." 
-I/opt/service/node_modules/heapdump/build/config.gypi 
-I/usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
 -I/root/.node-gyp/4.6.0/include/node/common.gypi "--depth=." "-Goutput_dir=." 
"--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" 
"-Dnode_root_dir=/root/.node-gyp/4.6.0" 
"-Dnode_gyp_dir=/usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp"
 "-Dnode_lib_file=node.lib" 
"-Dmodule_root_dir=/opt/service/node_modules/heapdump" binding.gyp
-Makefile: 
$(srcdir)/../../../../usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
 $(srcdir)/build/config.gypi $(srcdir)/binding.gyp 
$(srcdir)/../../../../root/.node-gyp/4.6.0/include/node/common.gypi
+cmd_regen_makefile = cd $(srcdir); 
/usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py
 -fmake --ignore-environment "--toplevel-dir=." 
-I/opt/service/node_modules/heapdump/build/config.gypi 
-I/usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
 -I/home/runuser/.node-gyp/4.6.0/include/node/common.gypi "--depth=." 
"-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" 
"-Dvisibility=default" "-Dnode_root_dir=/home/runuser/.node-gyp/4.6.0" 
"-Dnode_gyp_dir=/usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp"
 "-Dnode_lib_file=node.lib" 
"-Dmodule_root_dir=/opt/service/node_modules/heapdump" binding.gyp
+Makefile: 
$(srcdir)/../../../../home/runuser/.node-gyp/4.6.0/include/node/common.gypi 
$(srcdir)/../../../../usr/local/nvm/versions/node/v4.6.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
 $(srcdir)/build/config.gypi $(srcdir)/binding.gyp
$(call do_cmd,regen_makefile)
 
 # "all" is a concatenation of the "all" targets from all the included
diff --git 
a/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d
 
b/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d
index 022660f..9af41a7 100644
--- 
a/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d
+++ 
b/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d
@@ -1,34 +1,36 @@
-cmd_Release/obj.target/addon/src/heapdump.o := g++ 
'-DNODE_GYP_MODULE_NAME=addon' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' 
'-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' 
'-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/4.6.0/include/node 
-I/root/.node-gyp/4.6.0/src -I/root/.node-gyp/4.6.0/deps/uv/include 
-I/root/.node-gyp/4.6.0/deps/v8/include  -fPIC -pthread -Wall -Wextra 
-Wno-unused-parameter -m64 -O3 -ffunction-sections -fdata-sections 
-fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF 
./Release/.deps/Release/obj.target/addon/src/heapdump.o.d.raw   -c -o 
Release/obj.target/addon/src/heapdump.o ../src/heapdump.cc
+cmd_Release/obj.target/addon/src/heapdump.o := g++ 
'-DNODE_GYP_MODULE_NAME=addon' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' 
'-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' 
'-DBUILDING_NODE_EXTENSION' -I/home/runuser/.node-gyp/4.6.0/include/node 

  1   2   3   >