[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Return true from job()

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

Change subject: Return true from job()
..


Return true from job()

The listener script expects it

Change-Id: I2d4630370b752b6d9c7b375dd5ddad543fc4275b
---
M PaymentProviders/PayPal/Job.php
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/PaymentProviders/PayPal/Job.php b/PaymentProviders/PayPal/Job.php
index c1b7711..00848e0 100644
--- a/PaymentProviders/PayPal/Job.php
+++ b/PaymentProviders/PayPal/Job.php
@@ -68,5 +68,8 @@
$this->config->object( 'data-store/' . $msg_type )
->push( $new_msg );
 
+   // TODO It would be nice if push() returned something useful so 
we
+   // could return something here too
+   return true;
}
 }

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Make PayPal tests get queues directly from config

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

Change subject: Make PayPal tests get queues directly from config
..


Make PayPal tests get queues directly from config

Change-Id: I2028a629b7c9434eefe31dfe9e54bd557470
---
M PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
1 file changed, 2 insertions(+), 4 deletions(-)

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



diff --git 
a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 
b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
index 740acdf..251780e 100644
--- a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
+++ b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
@@ -44,8 +44,7 @@
 
$this->capture( self::$verified_msg );
 
-   // TODO why get it from BaseQueueConsumer instead of config?
-   $jobQueue = BaseQueueConsumer::getQueue( 'jobs-paypal' );
+   $jobQueue = $this->config->object( 'data-store/jobs-paypal' );
$jobMessage = $jobQueue->pop();
 
$this->assertEquals( $jobMessage['php-message-class'],
@@ -59,8 +58,7 @@
 
$this->capture( self::$verified_msg );
 
-   // TODO DRY?
-   $jobQueue = BaseQueueConsumer::getQueue( 'jobs-paypal' );
+   $jobQueue = $this->config->object( 'data-store/jobs-paypal' );
$jobMessage = $jobQueue->pop();
 
$job = KeyedOpaqueStorableObject::fromJsonProxy(

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Temporarily override broken toolbar border colour

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

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

Change subject: Temporarily override broken toolbar border colour
..

Temporarily override broken toolbar border colour

Will be fixed in the next OOUI release via I91862c2e609.

Change-Id: I741bb8d5396bed256ee1907eaa4ba86e4697f325
---
M modules/ve-mw/init/styles/ve.init.mw.ArticleTarget.css
1 file changed, 6 insertions(+), 0 deletions(-)


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

diff --git a/modules/ve-mw/init/styles/ve.init.mw.ArticleTarget.css 
b/modules/ve-mw/init/styles/ve.init.mw.ArticleTarget.css
index 952e42a..71e01eb 100644
--- a/modules/ve-mw/init/styles/ve.init.mw.ArticleTarget.css
+++ b/modules/ve-mw/init/styles/ve.init.mw.ArticleTarget.css
@@ -23,3 +23,9 @@
 .ve-init-target-ie .ve-ce-surface h6 {
overflow: visible;
 }
+
+/* HACK: Fix border color from MW theme, will be fixed in next OO-UI release */
+.oo-ui-toolbar-actions .oo-ui-toolGroup,
+.oo-ui-toolbar-actions > .oo-ui-toolbar:not( :last-child ) {
+   border-color: #c8ccd1;
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I741bb8d5396bed256ee1907eaa4ba86e4697f325
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 

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


[MediaWiki-commits] [Gerrit] mediawiki...UniversalLanguageSelector[master]: Use an empty array instead of the uls-p-lang-dummy entry

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

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

Change subject: Use an empty array instead of the uls-p-lang-dummy entry
..

Use an empty array instead of the uls-p-lang-dummy entry

Change-Id: I54a18f5bd85a8261a25e1160dda7a33fbdf3dd7b
---
M UniversalLanguageSelector.hooks.php
M resources/js/ext.uls.interface.js
2 files changed, 4 insertions(+), 8 deletions(-)


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

diff --git a/UniversalLanguageSelector.hooks.php 
b/UniversalLanguageSelector.hooks.php
index fed4065..a3e1a51 100644
--- a/UniversalLanguageSelector.hooks.php
+++ b/UniversalLanguageSelector.hooks.php
@@ -434,12 +434,10 @@
return true;
}
 
-   // A dummy link, just to make sure that the section appears
-   $template->data['language_urls'][] = [
-   'href' => '#',
-   'text' => '',
-   'class' => 'uls-p-lang-dummy',
-   ];
+   // Set to an empty array, just to make sure that the section 
appears
+   if ( $template->get( 'language_urls' ) === false ) {
+   $template->set( 'language_urls', [] );
+   }
 
return true;
}
diff --git a/resources/js/ext.uls.interface.js 
b/resources/js/ext.uls.interface.js
index 910ac10..8873b59 100644
--- a/resources/js/ext.uls.interface.js
+++ b/resources/js/ext.uls.interface.js
@@ -319,8 +319,6 @@
$pLang.prepend( $ulsTrigger );
// Take care of any other elements with this class.
$ulsTrigger = $( '.uls-settings-trigger' );
-   // Remove the dummy link, which was added to make sure 
that the section appears
-   $pLang.find( '.uls-p-lang-dummy' ).remove();
 
if ( !$pLang.find( 'div ul' ).children().length ) {
// Replace the title of the interlanguage links 
area

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I54a18f5bd85a8261a25e1160dda7a33fbdf3dd7b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Fomafix 

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


[MediaWiki-commits] [Gerrit] generator-wikimedia-php-library[master]: Tag v0.0.2

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

Change subject: Tag v0.0.2
..


Tag v0.0.2

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

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



diff --git a/package.json b/package.json
index da96b89..375df92 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
"name": "generator-wikimedia-php-library",
-   "version": "0.0.1",
+   "version": "0.0.2",
"description": "Yeoman generator for standalone PHP libraries, 
following Wikimedia standards",
"license": "Apache-2.0",
"main": "app/index.js",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaaf53ceadb10f1063b39c461e1631c929f41f90b
Gerrit-PatchSet: 1
Gerrit-Project: generator-wikimedia-php-library
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
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] generator-wikimedia-php-library[master]: Tag v0.0.2

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

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

Change subject: Tag v0.0.2
..

Tag v0.0.2

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


  git pull ssh://gerrit.wikimedia.org:29418/generator-wikimedia-php-library 
refs/changes/17/311917/1

diff --git a/package.json b/package.json
index da96b89..375df92 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
"name": "generator-wikimedia-php-library",
-   "version": "0.0.1",
+   "version": "0.0.2",
"description": "Yeoman generator for standalone PHP libraries, 
following Wikimedia standards",
"license": "Apache-2.0",
"main": "app/index.js",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaaf53ceadb10f1063b39c461e1631c929f41f90b
Gerrit-PatchSet: 1
Gerrit-Project: generator-wikimedia-php-library
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] generator-wikimedia-php-library[master]: Expect new libraries to be created under mediawiki/libs/

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

Change subject: Expect new libraries to be created under mediawiki/libs/
..


Expect new libraries to be created under mediawiki/libs/

Change-Id: Id2fb4aeb1b88a8e11e2a73531bb07877e094ad3f
---
M generators/app/templates/_.gitreview
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/generators/app/templates/_.gitreview 
b/generators/app/templates/_.gitreview
index 4ced937..5b65c32 100644
--- a/generators/app/templates/_.gitreview
+++ b/generators/app/templates/_.gitreview
@@ -1,6 +1,6 @@
 [gerrit]
 host=gerrit.wikimedia.org
 port=29418
-project=<%= name %>.git
+project=mediawiki/libs/<%= name %>.git
 defaultbranch=master
 defaultrebase=0

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id2fb4aeb1b88a8e11e2a73531bb07877e094ad3f
Gerrit-PatchSet: 1
Gerrit-Project: generator-wikimedia-php-library
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
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] generator-wikimedia-php-library[master]: Expect new libraries to be created under mediawiki/libs/

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

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

Change subject: Expect new libraries to be created under mediawiki/libs/
..

Expect new libraries to be created under mediawiki/libs/

Change-Id: Id2fb4aeb1b88a8e11e2a73531bb07877e094ad3f
---
M generators/app/templates/_.gitreview
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/generator-wikimedia-php-library 
refs/changes/16/311916/1

diff --git a/generators/app/templates/_.gitreview 
b/generators/app/templates/_.gitreview
index 4ced937..5b65c32 100644
--- a/generators/app/templates/_.gitreview
+++ b/generators/app/templates/_.gitreview
@@ -1,6 +1,6 @@
 [gerrit]
 host=gerrit.wikimedia.org
 port=29418
-project=<%= name %>.git
+project=mediawiki/libs/<%= name %>.git
 defaultbranch=master
 defaultrebase=0

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2fb4aeb1b88a8e11e2a73531bb07877e094ad3f
Gerrit-PatchSet: 1
Gerrit-Project: generator-wikimedia-php-library
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...WaitConditionLoop[master]: Initial import from MediaWiki core

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

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

Change subject: Initial import from MediaWiki core
..

Initial import from MediaWiki core

Change-Id: I758a98603d51ca0f1d4d70625b04ce9c87fa6d6d
---
A .editorconfig
A .gitignore
M .gitreview
A .travis.yml
A COPYING
A Doxyfile
A README.md
A composer.json
A phpcs.xml
A phpunit.xml.dist
A src/WaitConditionLoop.php
A tests/WaitConditionLoopTest.php
12 files changed, 862 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/libs/WaitConditionLoop 
refs/changes/15/311915/1

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000..42aefb6
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,6 @@
+# http://editorconfig.org
+root = true
+
+[*]
+indent_style = tab
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..3a761dd
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/coverage
+/doc
+vendor
+composer.lock
diff --git a/.gitreview b/.gitreview
index 8925f9d..cd32255 100644
--- a/.gitreview
+++ b/.gitreview
@@ -1,6 +1,6 @@
 [gerrit]
 host=gerrit.wikimedia.org
 port=29418
-project=mediawiki/libs/WaitConditionLoop.git
+project=WaitConditionLoop.git
 defaultbranch=master
 defaultrebase=0
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000..5ec3af6
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,10 @@
+sudo: false
+language: php
+php:
+  - "5.5"
+  - "5.6"
+  - "hhvm"
+install:
+  - composer install
+script:
+  - composer test
diff --git a/COPYING b/COPYING
new file mode 100644
index 000..d159169
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,339 @@
+GNU GENERAL PUBLIC LICENSE
+   Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such 

[MediaWiki-commits] [Gerrit] mediawiki...WaitConditionLoop[master]: Add .gitreview

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

Change subject: Add .gitreview
..


Add .gitreview

Change-Id: I34cc2527b406656ea91a790634c2e7dc59efa8cb
---
A .gitreview
1 file changed, 6 insertions(+), 0 deletions(-)

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



diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..8925f9d
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/libs/WaitConditionLoop.git
+defaultbranch=master
+defaultrebase=0

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I34cc2527b406656ea91a790634c2e7dc59efa8cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/libs/WaitConditionLoop
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Legoktm 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix importation of weird file names in importTextFiles.php

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

Change subject: Fix importation of weird file names in importTextFiles.php
..


Fix importation of weird file names in importTextFiles.php

When importing a file whose name contains a #, the script would call
e.g. Title::newFromText( '#foo' ), which succeeds (because titles
are allowed to contain fragments) but causes problems when trying
to create the revision.

Also avoid fatals on actual invalid titles.

Bug: T142675
Change-Id: I6b4c8fd8dd09db14c0704c74137e112b292c964a
---
M maintenance/importTextFiles.php
1 file changed, 5 insertions(+), 5 deletions(-)

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



diff --git a/maintenance/importTextFiles.php b/maintenance/importTextFiles.php
index 5531ffc..2894653 100644
--- a/maintenance/importTextFiles.php
+++ b/maintenance/importTextFiles.php
@@ -103,16 +103,16 @@
$timestamp = $useTimestamp ? wfTimestamp( TS_UNIX, 
filemtime( $file ) ) : wfTimestampNow();
 
$title = Title::newFromText( $pageName );
-   $exists = $title->exists();
-   $oldRevID = $title->getLatestRevID();
-   $oldRev = $oldRevID ? Revision::newFromId( $oldRevID ) 
: null;
-
-   if ( !$title ) {
+   // Have to check for # manually, since it gets 
interpreted as a fragment
+   if ( !$title || $title->hasFragment() ) {
$this->error( "Invalid title $pageName. 
Skipping.\n" );
$skipCount++;
continue;
}
 
+   $exists = $title->exists();
+   $oldRevID = $title->getLatestRevID();
+   $oldRev = $oldRevID ? Revision::newFromId( $oldRevID ) 
: null;
$actualTitle = $title->getPrefixedText();
 
if ( $exists ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6b4c8fd8dd09db14c0704c74137e112b292c964a
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TTO 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: Samwilson 
Gerrit-Reviewer: TTO 
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...WaitConditionLoop[master]: Add .gitreview

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

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

Change subject: Add .gitreview
..

Add .gitreview

Change-Id: I34cc2527b406656ea91a790634c2e7dc59efa8cb
---
A .gitreview
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/libs/WaitConditionLoop 
refs/changes/14/311914/1

diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..8925f9d
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/libs/WaitConditionLoop.git
+defaultbranch=master
+defaultrebase=0

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I34cc2527b406656ea91a790634c2e7dc59efa8cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/libs/WaitConditionLoop
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/core[master]: Simplify and clean up FileBackend exceptions

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

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

Change subject: Simplify and clean up FileBackend exceptions
..

Simplify and clean up FileBackend exceptions

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

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/13/311913/1

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

[MediaWiki-commits] [Gerrit] oojs/ui[master]: Fix border colours in MW toolbar

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

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

Change subject: Fix border colours in MW toolbar
..

Fix border colours in MW toolbar

Change-Id: I91862c2e609b5cd65d3bb50e626813a72746b1d6
---
M src/themes/mediawiki/tools.less
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/12/311912/1

diff --git a/src/themes/mediawiki/tools.less b/src/themes/mediawiki/tools.less
index 52e6230..8ce76e0 100644
--- a/src/themes/mediawiki/tools.less
+++ b/src/themes/mediawiki/tools.less
@@ -32,7 +32,7 @@
}
 
> .oo-ui-toolbar:not( :last-child ) {
-   border-right: @border-default;
+   border-right: @border-toolbar;
}
}
 }
@@ -83,7 +83,7 @@
 
.oo-ui-toolbar-actions & {
border-right: 0;
-   border-left: @border-default;
+   border-left: @border-toolbar;
}
 
.oo-ui-toolbar-narrow & {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I91862c2e609b5cd65d3bb50e626813a72746b1d6
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Esanders 

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: convert SearchCardView to Butter Knife

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

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

Change subject: Hygiene: convert SearchCardView to Butter Knife
..

Hygiene: convert SearchCardView to Butter Knife

Change-Id: Ia6f2d97f9155384ccce07ed664dea0c4f15e5796
---
M app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java
1 file changed, 12 insertions(+), 23 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java 
b/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java
index 6acf685..82348f5 100644
--- a/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java
+++ b/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java
@@ -1,42 +1,31 @@
 package org.wikipedia.feed.searchbar;
 
 import android.content.Context;
-import android.view.View;
 
 import org.wikipedia.R;
 import org.wikipedia.feed.view.DefaultFeedCardView;
 import org.wikipedia.util.FeedbackUtil;
 
-import butterknife.BindView;
 import butterknife.ButterKnife;
+import butterknife.OnClick;
 
 public class SearchCardView extends DefaultFeedCardView {
-@BindView(R.id.search_container) View searchContainer;
-@BindView(R.id.voice_search_button) View voiceSearchButton;
-
 public SearchCardView(Context context) {
 super(context);
-
 inflate(getContext(), R.layout.view_search_bar, this);
 ButterKnife.bind(this);
-FeedbackUtil.setToolbarButtonLongPressToast(voiceSearchButton);
+
FeedbackUtil.setToolbarButtonLongPressToast(findViewById(R.id.voice_search_button));
+}
 
-searchContainer.setOnClickListener(new OnClickListener() {
-@Override
-public void onClick(View v) {
-if (getCallback() != null) {
-getCallback().onSearchRequested();
-}
-}
-});
+@OnClick(R.id.search_container) void onSearchClick() {
+if (getCallback() != null) {
+getCallback().onSearchRequested();
+}
+}
 
-voiceSearchButton.setOnClickListener(new OnClickListener() {
-@Override
-public void onClick(View v) {
-if (getCallback() != null) {
-getCallback().onVoiceSearchRequested();
-}
-}
-});
+@OnClick(R.id.voice_search_button) void onVoiceSearchClick() {
+if (getCallback() != null) {
+getCallback().onVoiceSearchRequested();
+}
 }
 }
\ No newline at end of file

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Return true from job()

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

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

Change subject: Return true from job()
..

Return true from job()

The listener script expects it

Change-Id: I2d4630370b752b6d9c7b375dd5ddad543fc4275b
---
M PaymentProviders/PayPal/Job.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/10/311910/1

diff --git a/PaymentProviders/PayPal/Job.php b/PaymentProviders/PayPal/Job.php
index c1b7711..00848e0 100644
--- a/PaymentProviders/PayPal/Job.php
+++ b/PaymentProviders/PayPal/Job.php
@@ -68,5 +68,8 @@
$this->config->object( 'data-store/' . $msg_type )
->push( $new_msg );
 
+   // TODO It would be nice if push() returned something useful so 
we
+   // could return something here too
+   return true;
}
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move XMP* classes to includes/libs

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

Change subject: Move XMP* classes to includes/libs
..


Move XMP* classes to includes/libs

These no longer have any dependencies upon MediaWiki and can be split
out into a separate library.

Tests were updated for the new location and to no longer depend upon
MediaWikiTestCase.

Bug: T100922
Change-Id: I6ad507fa883d5934b807f9e31c507659d0730b52
---
M autoload.php
R includes/libs/xmp/XMP.php
R includes/libs/xmp/XMPInfo.php
R includes/libs/xmp/XMPValidate.php
R tests/phpunit/includes/libs/xmp/XMPTest.php
R tests/phpunit/includes/libs/xmp/XMPValidateTest.php
6 files changed, 14 insertions(+), 11 deletions(-)

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



diff --git a/autoload.php b/autoload.php
index 198e477..b6e0b8c 100644
--- a/autoload.php
+++ b/autoload.php
@@ -1561,9 +1561,9 @@
'XCFHandler' => __DIR__ . '/includes/media/XCF.php',
'XCacheBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/XCacheBagOStuff.php',
'XMLRCFeedFormatter' => __DIR__ . 
'/includes/rcfeed/XMLRCFeedFormatter.php',
-   'XMPInfo' => __DIR__ . '/includes/media/XMPInfo.php',
-   'XMPReader' => __DIR__ . '/includes/media/XMP.php',
-   'XMPValidate' => __DIR__ . '/includes/media/XMPValidate.php',
+   'XMPInfo' => __DIR__ . '/includes/libs/xmp/XMPInfo.php',
+   'XMPReader' => __DIR__ . '/includes/libs/xmp/XMP.php',
+   'XMPValidate' => __DIR__ . '/includes/libs/xmp/XMPValidate.php',
'Xhprof' => __DIR__ . '/includes/libs/Xhprof.php',
'XhprofData' => __DIR__ . '/includes/libs/XhprofData.php',
'Xml' => __DIR__ . '/includes/Xml.php',
diff --git a/includes/media/XMP.php b/includes/libs/xmp/XMP.php
similarity index 100%
rename from includes/media/XMP.php
rename to includes/libs/xmp/XMP.php
diff --git a/includes/media/XMPInfo.php b/includes/libs/xmp/XMPInfo.php
similarity index 100%
rename from includes/media/XMPInfo.php
rename to includes/libs/xmp/XMPInfo.php
diff --git a/includes/media/XMPValidate.php b/includes/libs/xmp/XMPValidate.php
similarity index 100%
rename from includes/media/XMPValidate.php
rename to includes/libs/xmp/XMPValidate.php
diff --git a/tests/phpunit/includes/media/XMPTest.php 
b/tests/phpunit/includes/libs/xmp/XMPTest.php
similarity index 93%
rename from tests/phpunit/includes/media/XMPTest.php
rename to tests/phpunit/includes/libs/xmp/XMPTest.php
index bffe415..ac52a39 100644
--- a/tests/phpunit/includes/media/XMPTest.php
+++ b/tests/phpunit/includes/libs/xmp/XMPTest.php
@@ -4,11 +4,14 @@
  * @group Media
  * @covers XMPReader
  */
-class XMPTest extends MediaWikiTestCase {
+class XMPTest extends PHPUnit_Framework_TestCase  {
 
protected function setUp() {
parent::setUp();
-   $this->checkPHPExtension( 'exif' ); # Requires libxml to do XMP 
parsing
+   # Requires libxml to do XMP parsing
+   if ( !extension_loaded( 'exif' ) ) {
+   $this->markTestSkipped( "PHP extension 'exif' is not 
loaded, skipping." );
+   }
}
 
/**
@@ -33,7 +36,7 @@
}
 
public static function provideXMPParse() {
-   $xmpPath = __DIR__ . '/../../data/xmp/';
+   $xmpPath = __DIR__ . '/../../../data/xmp/';
$data = [];
 
// $xmpFiles format: array of arrays with first arg file base 
name,
@@ -86,7 +89,7 @@
 * @covers XMPReader::parseExtended
 */
public function testExtendedXMP() {
-   $xmpPath = __DIR__ . '/../../data/xmp/';
+   $xmpPath = __DIR__ . '/../../../data/xmp/';
$standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
$extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
 
@@ -118,7 +121,7 @@
 * @covers XMPReader::parseExtended
 */
public function testExtendedXMPWithWrongGUID() {
-   $xmpPath = __DIR__ . '/../../data/xmp/';
+   $xmpPath = __DIR__ . '/../../../data/xmp/';
$standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
$extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
 
@@ -149,7 +152,7 @@
 * @covers XMPReader::parseExtended
 */
public function testExtendedXMPMissingPacket() {
-   $xmpPath = __DIR__ . '/../../data/xmp/';
+   $xmpPath = __DIR__ . '/../../../data/xmp/';
$standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
$extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
 
@@ -180,7 +183,7 @@
public function testCheckParseSafety() {
 
// Test for detection
-   $xmpPath = __DIR__ . '/../../data/xmp/';
+   $xmpPath = __DIR__ . '/../../../data/xmp/';
$file = fopen( $xmpPath . 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: XMPValidate: Use ConvertibleTimestamp instead of wfTimestamp()

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

Change subject: XMPValidate: Use ConvertibleTimestamp instead of wfTimestamp()
..


XMPValidate: Use ConvertibleTimestamp instead of wfTimestamp()

This removes the last MediaWiki dependency in the XMP* classes, and they
can now be moved to libs/ (in a follow up patch).

Change-Id: Iee509fce0e44ec0697e1cdd4cd711846cf35e1e6
---
M includes/media/XMPValidate.php
1 file changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/includes/media/XMPValidate.php b/includes/media/XMPValidate.php
index fe47f47..32a3340 100644
--- a/includes/media/XMPValidate.php
+++ b/includes/media/XMPValidate.php
@@ -329,13 +329,15 @@
// We know that if we got to this step, year, month day 
hour and min must be set
// by virtue of regex not failing.
 
-   $unix = wfTimestamp( TS_UNIX, $res[1] . $res[2] . 
$res[3] . $res[4] . $res[5] . $res[6] );
+   $unix = ( new ConvertableTimestamp(
+   $res[1] . $res[2] . $res[3] . $res[4] . $res[5] 
. $res[6]
+   ) )->getTimestamp( TS_UNIX );
$offset = intval( substr( $res[7], 1, 2 ) ) * 60 * 60;
$offset += intval( substr( $res[7], 4, 2 ) ) * 60;
if ( substr( $res[7], 0, 1 ) === '-' ) {
$offset = -$offset;
}
-   $val = wfTimestamp( TS_EXIF, $unix + $offset );
+   $val = ( new ConvertableTimestamp( $unix + $offset ) 
)->getTimestamp( TS_EXIF );
 
if ( $stripSeconds ) {
// If seconds weren't specified, remove the 
trailing ':00'.

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

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

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: unify feed card interface

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

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

Change subject: Hygiene: unify feed card interface
..

Hygiene: unify feed card interface

Handle all feed cards in the same way. Also, use set/get prefixes to
avoid less obvious mistakes like calling super.card() instead of
super.card(Card) when overriding card(Card).

Change-Id: Icda23061f7d07b73cccebaa74fb7907f695d2786
---
M 
app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java
M 
app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCardView.java
M app/src/main/java/org/wikipedia/feed/featured/FeaturedArticleCardView.java
M app/src/main/java/org/wikipedia/feed/image/FeaturedImageCardView.java
M app/src/main/java/org/wikipedia/feed/mainpage/MainPageCardView.java
M app/src/main/java/org/wikipedia/feed/model/CardType.java
M app/src/main/java/org/wikipedia/feed/mostread/MostReadCardView.java
M app/src/main/java/org/wikipedia/feed/news/NewsListCardView.java
M app/src/main/java/org/wikipedia/feed/progress/ProgressCardView.java
M app/src/main/java/org/wikipedia/feed/random/RandomCardView.java
M app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java
A app/src/main/java/org/wikipedia/feed/view/DefaultFeedCardView.java
M app/src/main/java/org/wikipedia/feed/view/FeedAdapter.java
M app/src/main/java/org/wikipedia/feed/view/FeedCardView.java
M app/src/main/java/org/wikipedia/feed/view/HorizontalScrollingListCardView.java
M app/src/main/java/org/wikipedia/feed/view/ListCardView.java
M app/src/main/java/org/wikipedia/feed/view/StaticCardView.java
17 files changed, 134 insertions(+), 151 deletions(-)


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

diff --git 
a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java
 
b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java
index 5d1ed1a..7bb7fce 100644
--- 
a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java
+++ 
b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java
@@ -19,14 +19,15 @@
 
 import java.util.List;
 
-public class BecauseYouReadCardView extends ListCardView
+public class BecauseYouReadCardView extends ListCardView
 implements ItemTouchHelperSwipeAdapter.SwipeableView {
 
 public BecauseYouReadCardView(Context context) {
 super(context);
 }
 
-public void set(@NonNull final BecauseYouReadCard card) {
+@Override public void setCard(@NonNull BecauseYouReadCard card) {
+super.setCard(card);
 header(card);
 set(new RecyclerAdapter(card.items(), getCallback()));
 }
diff --git 
a/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCardView.java
 
b/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCardView.java
index a5c8a63..d9e26ad 100644
--- 
a/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCardView.java
+++ 
b/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCardView.java
@@ -12,16 +12,14 @@
 import org.wikipedia.history.HistoryEntry;
 import org.wikipedia.views.ItemTouchHelperSwipeAdapter;
 
-public class ContinueReadingCardView extends ListCardView
+public class ContinueReadingCardView extends ListCardView
 implements ItemTouchHelperSwipeAdapter.SwipeableView {
-private ContinueReadingCard card;
-
 public ContinueReadingCardView(Context context) {
 super(context);
 }
 
-public void set(@NonNull ContinueReadingCard card) {
-this.card = card;
+@Override public void setCard(@NonNull ContinueReadingCard card) {
+super.setCard(card);
 header(card);
 }
 
@@ -46,9 +44,10 @@
 private class CardClickListener implements OnClickListener {
 @Override
 public void onClick(View v) {
-if (getCallback() != null) {
-getCallback().onSelectPage(new HistoryEntry(card.pageTitle(), 
HistoryEntry.SOURCE_FEED_CONTINUE_READING));
+if (getCallback() != null && getCard() != null) {
+getCallback().onSelectPage(new 
HistoryEntry(getCard().pageTitle(),
+HistoryEntry.SOURCE_FEED_CONTINUE_READING));
 }
 }
 }
-}
+}
\ No newline at end of file
diff --git 
a/app/src/main/java/org/wikipedia/feed/featured/FeaturedArticleCardView.java 
b/app/src/main/java/org/wikipedia/feed/featured/FeaturedArticleCardView.java
index 0748f0c..40e5531 100644
--- a/app/src/main/java/org/wikipedia/feed/featured/FeaturedArticleCardView.java
+++ b/app/src/main/java/org/wikipedia/feed/featured/FeaturedArticleCardView.java
@@ -10,7 +10,7 @@
 import org.wikipedia.R;
 import org.wikipedia.feed.view.ActionFooterView;
 import org.wikipedia.feed.view.CardHeaderView;
-import org.wikipedia.feed.view.FeedCardView;
+import 

[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.20]: mediawiki.requestIdleCallback: Avoid native window.requestId...

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

Change subject: mediawiki.requestIdleCallback: Avoid native 
window.requestIdleCallback
..


mediawiki.requestIdleCallback: Avoid native window.requestIdleCallback

Follows-up 482ad8d9fb.

This currently has bugs in Chrome that can cause it to not get called
for up to 30 seconds.

https://bugs.chromium.org/p/chromium/issues/detail?id=647870

Change-Id: I221cd6c2bcdbee89bc7401c071f2ab1865a738ed
---
M resources/src/mediawiki/mediawiki.requestIdleCallback.js
M tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
2 files changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/resources/src/mediawiki/mediawiki.requestIdleCallback.js 
b/resources/src/mediawiki/mediawiki.requestIdleCallback.js
index dfc98ad..b58cb69 100644
--- a/resources/src/mediawiki/mediawiki.requestIdleCallback.js
+++ b/resources/src/mediawiki/mediawiki.requestIdleCallback.js
@@ -24,8 +24,12 @@
 * @member mw
 * @param {Function} callback
 */
+   mw.requestIdleCallback = mw.requestIdleCallbackInternal;
+   /*
+   // XXX: Polyfill disabled due to 
https://bugs.chromium.org/p/chromium/issues/detail?id=647870
mw.requestIdleCallback = window.requestIdleCallback
// Bind because it throws TypeError if context is not window
? window.requestIdleCallback.bind( window )
: mw.requestIdleCallbackInternal;
+   */
 }( mediaWiki ) );
diff --git 
a/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
index 7a09964..df02693 100644
--- 
a/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
+++ 
b/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
@@ -95,8 +95,9 @@
if ( window.requestIdleCallback ) {
QUnit.test( 'native', function ( assert ) {
var done = assert.async();
-   // Remove polyfill
+   // Remove polyfill and clock stub
mw.requestIdleCallback.restore();
+   this.clock.restore();
mw.requestIdleCallback( function () {
assert.expect( 0 );
done();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I221cd6c2bcdbee89bc7401c071f2ab1865a738ed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.19]: mediawiki.requestIdleCallback: Avoid native window.requestId...

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

Change subject: mediawiki.requestIdleCallback: Avoid native 
window.requestIdleCallback
..


mediawiki.requestIdleCallback: Avoid native window.requestIdleCallback

Follows-up 482ad8d9fb.

This currently has bugs in Chrome that can cause it to not get called
for up to 30 seconds.

https://bugs.chromium.org/p/chromium/issues/detail?id=647870

Change-Id: I221cd6c2bcdbee89bc7401c071f2ab1865a738ed
---
M resources/src/mediawiki/mediawiki.requestIdleCallback.js
M tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
2 files changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/resources/src/mediawiki/mediawiki.requestIdleCallback.js 
b/resources/src/mediawiki/mediawiki.requestIdleCallback.js
index dfc98ad..b58cb69 100644
--- a/resources/src/mediawiki/mediawiki.requestIdleCallback.js
+++ b/resources/src/mediawiki/mediawiki.requestIdleCallback.js
@@ -24,8 +24,12 @@
 * @member mw
 * @param {Function} callback
 */
+   mw.requestIdleCallback = mw.requestIdleCallbackInternal;
+   /*
+   // XXX: Polyfill disabled due to 
https://bugs.chromium.org/p/chromium/issues/detail?id=647870
mw.requestIdleCallback = window.requestIdleCallback
// Bind because it throws TypeError if context is not window
? window.requestIdleCallback.bind( window )
: mw.requestIdleCallbackInternal;
+   */
 }( mediaWiki ) );
diff --git 
a/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
index 7a09964..df02693 100644
--- 
a/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
+++ 
b/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
@@ -95,8 +95,9 @@
if ( window.requestIdleCallback ) {
QUnit.test( 'native', function ( assert ) {
var done = assert.async();
-   // Remove polyfill
+   // Remove polyfill and clock stub
mw.requestIdleCallback.restore();
+   this.clock.restore();
mw.requestIdleCallback( function () {
assert.expect( 0 );
done();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I221cd6c2bcdbee89bc7401c071f2ab1865a738ed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.19
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.18]: mediawiki.requestIdleCallback: Avoid native window.requestId...

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

Change subject: mediawiki.requestIdleCallback: Avoid native 
window.requestIdleCallback
..


mediawiki.requestIdleCallback: Avoid native window.requestIdleCallback

Follows-up 482ad8d9fb.

This currently has bugs in Chrome that can cause it to not get called
for up to 30 seconds.

https://bugs.chromium.org/p/chromium/issues/detail?id=647870

Change-Id: I221cd6c2bcdbee89bc7401c071f2ab1865a738ed
---
M resources/src/mediawiki/mediawiki.requestIdleCallback.js
M tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
2 files changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/resources/src/mediawiki/mediawiki.requestIdleCallback.js 
b/resources/src/mediawiki/mediawiki.requestIdleCallback.js
index dfc98ad..b58cb69 100644
--- a/resources/src/mediawiki/mediawiki.requestIdleCallback.js
+++ b/resources/src/mediawiki/mediawiki.requestIdleCallback.js
@@ -24,8 +24,12 @@
 * @member mw
 * @param {Function} callback
 */
+   mw.requestIdleCallback = mw.requestIdleCallbackInternal;
+   /*
+   // XXX: Polyfill disabled due to 
https://bugs.chromium.org/p/chromium/issues/detail?id=647870
mw.requestIdleCallback = window.requestIdleCallback
// Bind because it throws TypeError if context is not window
? window.requestIdleCallback.bind( window )
: mw.requestIdleCallbackInternal;
+   */
 }( mediaWiki ) );
diff --git 
a/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
index 7a09964..df02693 100644
--- 
a/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
+++ 
b/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
@@ -95,8 +95,9 @@
if ( window.requestIdleCallback ) {
QUnit.test( 'native', function ( assert ) {
var done = assert.async();
-   // Remove polyfill
+   // Remove polyfill and clock stub
mw.requestIdleCallback.restore();
+   this.clock.restore();
mw.requestIdleCallback( function () {
assert.expect( 0 );
done();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I221cd6c2bcdbee89bc7401c071f2ab1865a738ed
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.18
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.18]: Revert "Always use the requestIdleCallback polyfill for batc...

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

Change subject: Revert "Always use the requestIdleCallback polyfill for 
batchEval"
..


Revert "Always use the requestIdleCallback polyfill for batchEval"

Replace with I221cd6c2bcdbee8 for consistency with master and 1.28-wmf.20.

This reverts commit 78afd2ca3a32000e72cc5b47a8066dd8aa06007f.

Change-Id: Id985db83491977a5090ccdf94bf6e8aad379c389
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 2 insertions(+), 2 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 9fd8fb5..db5a4fb 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -1680,7 +1680,7 @@
if ( !implementations.length ) {
return;
}
-   mw.requestIdleCallbackInternal( function 
iterate( deadline ) {
+   mw.requestIdleCallback( function iterate( 
deadline ) {
while ( implementations[ 0 ] && 
deadline.timeRemaining() > 5 ) {
try {
$.globalEval( 
implementations.shift() );
@@ -1690,7 +1690,7 @@
}
}
if ( implementations[ 0 ] ) {
-   mw.requestIdleCallbackInternal( 
iterate );
+   mw.requestIdleCallback( iterate 
);
}
} );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id985db83491977a5090ccdf94bf6e8aad379c389
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.18
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Fix to prevent duplicate Home addresses resulting in no prim...

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

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

Change subject: Fix to prevent duplicate Home addresses resulting in no primary 
on merge.
..

Fix to prevent duplicate Home addresses resulting in no primary on merge.

Bug: T145873
Change-Id: Icee9aab5179e6e42cbedd2fa615072053834962b
---
M sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
2 files changed, 125 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/08/311908/1

diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php 
b/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php
index 349c8d9..1f71ccd 100644
--- a/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php
+++ b/sites/all/modules/wmf_civicrm/tests/phpunit/MergeTest.php
@@ -426,7 +426,7 @@
*/
   public function getMergeLocations($locationParams1, $locationParams2, 
$locationParams3, $entity, $additionalExpected = array()) {
 $data = array(
-  1 => array(
+  'matching_primary' => array(
 'matching_primary' => array(
   'merged' => 1,
   'skipped' => 0,
@@ -461,7 +461,7 @@
   )),
 ),
   ),
-  2 => array(
+  'matching_primary_reverse' => array(
 'matching_primary_reverse' => array(
   'merged' => 1,
   'skipped' => 0,
@@ -496,7 +496,7 @@
   )),
 ),
   ),
-  3 => array(
+  'only_one_has_address' => array(
 'only_one_has_address' => array(
   'merged' => 1,
   'skipped' => 0,
@@ -528,7 +528,7 @@
   )),
 ),
   ),
-  4 => array(
+  'only_one_has_address_reverse' => array(
 'only_one_has_address_reverse' => array(
   'merged' => 1,
   'skipped' => 0,
@@ -558,7 +558,7 @@
   )),
 ),
   ),
-  5 => array(
+  'different_primaries_with_different_location_type' => array(
 'different_primaries_with_different_location_type' => array(
   'merged' => 1,
   'skipped' => 0,
@@ -589,7 +589,7 @@
   )),
 ),
   ),
-  6 => array(
+  'different_primaries_with_different_location_type_reverse' => array(
 'different_primaries_with_different_location_type_reverse' => array(
   'merged' => 1,
   'skipped' => 0,
@@ -619,7 +619,7 @@
   )),
 ),
   ),
-  7 => array(
+  'different_primaries_location_match_only_one_address' => array(
 'different_primaries_location_match_only_one_address' => array(
   'merged' => 1,
   'skipped' => 0,
@@ -654,7 +654,7 @@
   )),
 ),
   ),
-  8 => array(
+  'different_primaries_location_match_only_one_address_reverse' => array(
 'different_primaries_location_match_only_one_address_reverse' => array(
   'merged' => 1,
   'skipped' => 0,
@@ -688,7 +688,7 @@
   )),
 ),
   ),
-  9 => array(
+  'same_primaries_different_location' => array(
 'same_primaries_different_location' => array(
   'fix_required_for_reverse' => 1,
   'comment' => 'core is not identifying this as an address conflict in 
reverse order'
@@ -719,7 +719,7 @@
   )),
 ),
   ),
-  10 => array(
+  'same_primaries_different_location_reverse' => array(
 'same_primaries_different_location_reverse' => array(
   'fix_required_for_reverse' => 1,
   'comment' => 'core is not identifying this as an address conflict in 
reverse order'
@@ -749,7 +749,7 @@
   )),
 ),
   ),
-  11 => array(
+  'conflicting_home_address_major_gifts' => array(
 'conflicting_home_address_major_gifts' => array(
   'merged' => 0,
   'skipped' => 1,
@@ -775,7 +775,7 @@
   )),
 ),
   ),
-  12 => array(
+  'conflicting_home_address_not_major_gifts' => array(
 'conflicting_home_address_not_major_gifts' => array(
   'fix_required_for_reverse' => 1,
   'comment' => 'our code needs an update as both are being kept'
@@ -805,7 +805,7 @@
   )),
 ),
   ),
-  13 => array(
+  'conflicting_home_address_one_more_major_gifts' => array(
 'conflicting_home_address_one_more_major_gifts' => array(
   'merged' => 0,
   'skipped' => 1,
@@ -843,7 +843,7 @@
   )),
 ),
   ),
-  14 => array(
+  'conflicting_home_address__one_more_not_major_gifts' => array(
 'conflicting_home_address__one_more_not_major_gifts' => array(
   'fix_required_for_reverse' => 1,
   'comment' => 'our code needs an update as an extra 1 is being kept'
@@ -885,6 +885,75 @@
   )),
 ),
   ),
+  'duplicate_home_address_on_one_contact' => array(
+

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: XMPValidate: Use ConvertibleTimestamp instead of wfTimestamp()

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

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

Change subject: XMPValidate: Use ConvertibleTimestamp instead of wfTimestamp()
..

XMPValidate: Use ConvertibleTimestamp instead of wfTimestamp()

This removes the last MediaWiki dependency in the XMP* classes, and they
can now be moved to libs/ (in a follow up patch).

Change-Id: Iee509fce0e44ec0697e1cdd4cd711846cf35e1e6
---
M includes/media/XMPValidate.php
1 file changed, 4 insertions(+), 2 deletions(-)


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

diff --git a/includes/media/XMPValidate.php b/includes/media/XMPValidate.php
index fe47f47..32a3340 100644
--- a/includes/media/XMPValidate.php
+++ b/includes/media/XMPValidate.php
@@ -329,13 +329,15 @@
// We know that if we got to this step, year, month day 
hour and min must be set
// by virtue of regex not failing.
 
-   $unix = wfTimestamp( TS_UNIX, $res[1] . $res[2] . 
$res[3] . $res[4] . $res[5] . $res[6] );
+   $unix = ( new ConvertableTimestamp(
+   $res[1] . $res[2] . $res[3] . $res[4] . $res[5] 
. $res[6]
+   ) )->getTimestamp( TS_UNIX );
$offset = intval( substr( $res[7], 1, 2 ) ) * 60 * 60;
$offset += intval( substr( $res[7], 4, 2 ) ) * 60;
if ( substr( $res[7], 0, 1 ) === '-' ) {
$offset = -$offset;
}
-   $val = wfTimestamp( TS_EXIF, $unix + $offset );
+   $val = ( new ConvertableTimestamp( $unix + $offset ) 
)->getTimestamp( TS_EXIF );
 
if ( $stripSeconds ) {
// If seconds weren't specified, remove the 
trailing ':00'.

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move XMP* classes to includes/libs

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

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

Change subject: Move XMP* classes to includes/libs
..

Move XMP* classes to includes/libs

These no longer have any dependencies upon MediaWiki and can be split
out into a separate library.

Tests were updated for the new location and to no longer depend upon
MediaWikiTestCase.

Bug: T100922
Change-Id: I6ad507fa883d5934b807f9e31c507659d0730b52
---
M autoload.php
R includes/libs/xmp/XMP.php
R includes/libs/xmp/XMPInfo.php
R includes/libs/xmp/XMPValidate.php
R tests/phpunit/includes/libs/xmp/XMPTest.php
R tests/phpunit/includes/libs/xmp/XMPValidateTest.php
6 files changed, 14 insertions(+), 11 deletions(-)


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

diff --git a/autoload.php b/autoload.php
index 198e477..b6e0b8c 100644
--- a/autoload.php
+++ b/autoload.php
@@ -1561,9 +1561,9 @@
'XCFHandler' => __DIR__ . '/includes/media/XCF.php',
'XCacheBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/XCacheBagOStuff.php',
'XMLRCFeedFormatter' => __DIR__ . 
'/includes/rcfeed/XMLRCFeedFormatter.php',
-   'XMPInfo' => __DIR__ . '/includes/media/XMPInfo.php',
-   'XMPReader' => __DIR__ . '/includes/media/XMP.php',
-   'XMPValidate' => __DIR__ . '/includes/media/XMPValidate.php',
+   'XMPInfo' => __DIR__ . '/includes/libs/xmp/XMPInfo.php',
+   'XMPReader' => __DIR__ . '/includes/libs/xmp/XMP.php',
+   'XMPValidate' => __DIR__ . '/includes/libs/xmp/XMPValidate.php',
'Xhprof' => __DIR__ . '/includes/libs/Xhprof.php',
'XhprofData' => __DIR__ . '/includes/libs/XhprofData.php',
'Xml' => __DIR__ . '/includes/Xml.php',
diff --git a/includes/media/XMP.php b/includes/libs/xmp/XMP.php
similarity index 100%
rename from includes/media/XMP.php
rename to includes/libs/xmp/XMP.php
diff --git a/includes/media/XMPInfo.php b/includes/libs/xmp/XMPInfo.php
similarity index 100%
rename from includes/media/XMPInfo.php
rename to includes/libs/xmp/XMPInfo.php
diff --git a/includes/media/XMPValidate.php b/includes/libs/xmp/XMPValidate.php
similarity index 100%
rename from includes/media/XMPValidate.php
rename to includes/libs/xmp/XMPValidate.php
diff --git a/tests/phpunit/includes/media/XMPTest.php 
b/tests/phpunit/includes/libs/xmp/XMPTest.php
similarity index 93%
rename from tests/phpunit/includes/media/XMPTest.php
rename to tests/phpunit/includes/libs/xmp/XMPTest.php
index bffe415..ac52a39 100644
--- a/tests/phpunit/includes/media/XMPTest.php
+++ b/tests/phpunit/includes/libs/xmp/XMPTest.php
@@ -4,11 +4,14 @@
  * @group Media
  * @covers XMPReader
  */
-class XMPTest extends MediaWikiTestCase {
+class XMPTest extends PHPUnit_Framework_TestCase  {
 
protected function setUp() {
parent::setUp();
-   $this->checkPHPExtension( 'exif' ); # Requires libxml to do XMP 
parsing
+   # Requires libxml to do XMP parsing
+   if ( !extension_loaded( 'exif' ) ) {
+   $this->markTestSkipped( "PHP extension 'exif' is not 
loaded, skipping." );
+   }
}
 
/**
@@ -33,7 +36,7 @@
}
 
public static function provideXMPParse() {
-   $xmpPath = __DIR__ . '/../../data/xmp/';
+   $xmpPath = __DIR__ . '/../../../data/xmp/';
$data = [];
 
// $xmpFiles format: array of arrays with first arg file base 
name,
@@ -86,7 +89,7 @@
 * @covers XMPReader::parseExtended
 */
public function testExtendedXMP() {
-   $xmpPath = __DIR__ . '/../../data/xmp/';
+   $xmpPath = __DIR__ . '/../../../data/xmp/';
$standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
$extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
 
@@ -118,7 +121,7 @@
 * @covers XMPReader::parseExtended
 */
public function testExtendedXMPWithWrongGUID() {
-   $xmpPath = __DIR__ . '/../../data/xmp/';
+   $xmpPath = __DIR__ . '/../../../data/xmp/';
$standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
$extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
 
@@ -149,7 +152,7 @@
 * @covers XMPReader::parseExtended
 */
public function testExtendedXMPMissingPacket() {
-   $xmpPath = __DIR__ . '/../../data/xmp/';
+   $xmpPath = __DIR__ . '/../../../data/xmp/';
$standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
$extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
 
@@ -180,7 +183,7 @@
public function testCheckParseSafety() {
 
// Test for detection
-   $xmpPath = __DIR__ . '/../../data/xmp/';
+   $xmpPath = __DIR__ . '/../../../data/xmp/';
$file 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Dependency inject $wgTmpDirectory into FileBackend classes

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

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

Change subject: Dependency inject $wgTmpDirectory into FileBackend classes
..

Dependency inject $wgTmpDirectory into FileBackend classes

Change-Id: I219daffa67ff672bf5bd38921f4b1ca058d96b0f
---
M includes/filebackend/FSFileBackend.php
M includes/filebackend/FileBackendGroup.php
M includes/filebackend/MemoryFileBackend.php
M includes/filebackend/SwiftFileBackend.php
M includes/filerepo/FSRepo.php
M includes/libs/filebackend/FileBackend.php
6 files changed, 12 insertions(+), 5 deletions(-)


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

diff --git a/includes/filebackend/FSFileBackend.php 
b/includes/filebackend/FSFileBackend.php
index b0e3eee..45951ec 100644
--- a/includes/filebackend/FSFileBackend.php
+++ b/includes/filebackend/FSFileBackend.php
@@ -195,7 +195,7 @@
}
 
if ( !empty( $params['async'] ) ) { // deferred
-   $tempFile = TempFSFile::factory( 'create_', 'tmp' );
+   $tempFile = TempFSFile::factory( 'create_', 'tmp', 
$this->tmpDirectory );
if ( !$tempFile ) {
$status->fatal( 'backend-fail-create', 
$params['dst'] );
 
@@ -653,7 +653,7 @@
} else {
// Create a new temporary file with the same 
extension...
$ext = FileBackend::extensionFromPath( $src );
-   $tmpFile = TempFSFile::factory( 'localcopy_', 
$ext );
+   $tmpFile = TempFSFile::factory( 'localcopy_', 
$ext, $this->tmpDirectory );
if ( !$tmpFile ) {
$tmpFiles[$src] = null;
} else {
diff --git a/includes/filebackend/FileBackendGroup.php 
b/includes/filebackend/FileBackendGroup.php
index 0bae5ff..b560e94 100644
--- a/includes/filebackend/FileBackendGroup.php
+++ b/includes/filebackend/FileBackendGroup.php
@@ -168,6 +168,7 @@
$config['wanCache'] = ObjectCache::getMainWANInstance();
$config['mimeCallback'] = [ $this, 'guessMimeInternal' 
];
$config['statusWrapper'] = [ 'Status', 'wrap' ];
+   $config['tmpDirectory'] = wfTempDir();
 
$this->backends[$name]['instance'] = new $class( 
$config );
}
@@ -222,7 +223,7 @@
if ( !$type && $fsPath ) {
$type = $magic->guessMimeType( $fsPath, false );
} elseif ( !$type && strlen( $content ) ) {
-   $tmpFile = TempFSFile::factory( 'mime_' );
+   $tmpFile = TempFSFile::factory( 'mime_', '', 
wfTempDir() );
file_put_contents( $tmpFile->getPath(), $content );
$type = $magic->guessMimeType( $tmpFile->getPath(), 
false );
}
diff --git a/includes/filebackend/MemoryFileBackend.php 
b/includes/filebackend/MemoryFileBackend.php
index 74a0068..44fe2cb 100644
--- a/includes/filebackend/MemoryFileBackend.php
+++ b/includes/filebackend/MemoryFileBackend.php
@@ -169,7 +169,7 @@
} else {
// Create a new temporary file with the same 
extension...
$ext = FileBackend::extensionFromPath( $src );
-   $fsFile = TempFSFile::factory( 'localcopy_', 
$ext );
+   $fsFile = TempFSFile::factory( 'localcopy_', 
$ext, $this->tmpDirectory );
if ( $fsFile ) {
$bytes = file_put_contents( 
$fsFile->getPath(), $this->files[$src]['data'] );
if ( $bytes !== strlen( 
$this->files[$src]['data'] ) ) {
diff --git a/includes/filebackend/SwiftFileBackend.php 
b/includes/filebackend/SwiftFileBackend.php
index a0027e4..0a0e9f5 100644
--- a/includes/filebackend/SwiftFileBackend.php
+++ b/includes/filebackend/SwiftFileBackend.php
@@ -1127,7 +1127,7 @@
// Get source file extension
$ext = FileBackend::extensionFromPath( $path );
// Create a new temporary file...
-   $tmpFile = TempFSFile::factory( 'localcopy_', $ext );
+   $tmpFile = TempFSFile::factory( 'localcopy_', $ext, 
$this->tmpDirectory );
if ( $tmpFile ) {
$handle = fopen( $tmpFile->getPath(), 'wb' );
if ( $handle ) {
diff --git a/includes/filerepo/FSRepo.php b/includes/filerepo/FSRepo.php
index b24354d..d06acf2 100644
--- a/includes/filerepo/FSRepo.php
+++ b/includes/filerepo/FSRepo.php
@@ -66,6 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mediawiki.requestIdleCallback: Avoid native window.requestId...

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

Change subject: mediawiki.requestIdleCallback: Avoid native 
window.requestIdleCallback
..


mediawiki.requestIdleCallback: Avoid native window.requestIdleCallback

Follows-up 482ad8d9fb.

This currently has bugs in Chrome that can cause it to not get called
for up to 30 seconds.

https://bugs.chromium.org/p/chromium/issues/detail?id=647870

Change-Id: I221cd6c2bcdbee89bc7401c071f2ab1865a738ed
---
M resources/src/mediawiki/mediawiki.requestIdleCallback.js
M tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
2 files changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/resources/src/mediawiki/mediawiki.requestIdleCallback.js 
b/resources/src/mediawiki/mediawiki.requestIdleCallback.js
index dfc98ad..b58cb69 100644
--- a/resources/src/mediawiki/mediawiki.requestIdleCallback.js
+++ b/resources/src/mediawiki/mediawiki.requestIdleCallback.js
@@ -24,8 +24,12 @@
 * @member mw
 * @param {Function} callback
 */
+   mw.requestIdleCallback = mw.requestIdleCallbackInternal;
+   /*
+   // XXX: Polyfill disabled due to 
https://bugs.chromium.org/p/chromium/issues/detail?id=647870
mw.requestIdleCallback = window.requestIdleCallback
// Bind because it throws TypeError if context is not window
? window.requestIdleCallback.bind( window )
: mw.requestIdleCallbackInternal;
+   */
 }( mediaWiki ) );
diff --git 
a/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
index 7a09964..df02693 100644
--- 
a/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
+++ 
b/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
@@ -95,8 +95,9 @@
if ( window.requestIdleCallback ) {
QUnit.test( 'native', function ( assert ) {
var done = assert.async();
-   // Remove polyfill
+   // Remove polyfill and clock stub
mw.requestIdleCallback.restore();
+   this.clock.restore();
mw.requestIdleCallback( function () {
assert.expect( 0 );
done();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I221cd6c2bcdbee89bc7401c071f2ab1865a738ed
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Gilles 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: rename FeedRecyclerAdapter to FeedAdapter

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

Change subject: Hygiene: rename FeedRecyclerAdapter to FeedAdapter
..


Hygiene: rename FeedRecyclerAdapter to FeedAdapter

FeedView now descends from a RecyclerView. Everything in FeedView is
RecyclerView-centric. Rename FeedRecyclerAdapter to FeedAdapter.

Change-Id: I994d1e82eea6c198f2b488ee5207134ce2d86d4e
---
M app/src/main/java/org/wikipedia/feed/FeedFragment.java
M app/src/main/java/org/wikipedia/feed/model/Card.java
R app/src/main/java/org/wikipedia/feed/view/FeedAdapter.java
M app/src/main/java/org/wikipedia/feed/view/FeedView.java
4 files changed, 21 insertions(+), 20 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/feed/FeedFragment.java 
b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
index 3195a70..d1ea969 100644
--- a/app/src/main/java/org/wikipedia/feed/FeedFragment.java
+++ b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
@@ -28,7 +28,7 @@
 import org.wikipedia.feed.image.FeaturedImageCard;
 import org.wikipedia.feed.model.Card;
 import org.wikipedia.feed.news.NewsItemCard;
-import org.wikipedia.feed.view.FeedRecyclerAdapter;
+import org.wikipedia.feed.view.FeedAdapter;
 import org.wikipedia.feed.view.FeedView;
 import org.wikipedia.feed.view.FeedViewCallback;
 import org.wikipedia.history.HistoryEntry;
@@ -244,7 +244,7 @@
 @Override
 public boolean onRequestDismissCard(@NonNull Card card) {
 int position = coordinator.dismissCard(card);
-funnel.dismissCard(FeedRecyclerAdapter.getCardType(card), 
position);
+funnel.dismissCard(FeedAdapter.getCardType(card), position);
 showDismissCardUndoSnackbar(card, position);
 return true;
 }
diff --git a/app/src/main/java/org/wikipedia/feed/model/Card.java 
b/app/src/main/java/org/wikipedia/feed/model/Card.java
index 27fb306..e360f60 100644
--- a/app/src/main/java/org/wikipedia/feed/model/Card.java
+++ b/app/src/main/java/org/wikipedia/feed/model/Card.java
@@ -4,7 +4,7 @@
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
 
-import org.wikipedia.feed.view.FeedRecyclerAdapter;
+import org.wikipedia.feed.view.FeedAdapter;
 import org.wikipedia.model.BaseModel;
 
 public abstract class Card extends BaseModel {
@@ -23,7 +23,7 @@
 }
 
 public String getHideKey() {
-return Long.toString(FeedRecyclerAdapter.getCardType(this) + 
dismissHashCode());
+return Long.toString(FeedAdapter.getCardType(this) + 
dismissHashCode());
 }
 
 protected int dismissHashCode() {
diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedRecyclerAdapter.java 
b/app/src/main/java/org/wikipedia/feed/view/FeedAdapter.java
similarity index 97%
rename from app/src/main/java/org/wikipedia/feed/view/FeedRecyclerAdapter.java
rename to app/src/main/java/org/wikipedia/feed/view/FeedAdapter.java
index a0e81c3..862e9b7 100644
--- a/app/src/main/java/org/wikipedia/feed/view/FeedRecyclerAdapter.java
+++ b/app/src/main/java/org/wikipedia/feed/view/FeedAdapter.java
@@ -31,7 +31,7 @@
 import org.wikipedia.views.DefaultRecyclerAdapter;
 import org.wikipedia.views.DefaultViewHolder;
 
-public class FeedRecyclerAdapter extends DefaultRecyclerAdapter {
+public class FeedAdapter extends DefaultRecyclerAdapter {
 private static final int VIEW_TYPE_SEARCH_BAR = 0;
 private static final int VIEW_TYPE_CONTINUE_READING = 1;
 private static final int VIEW_TYPE_BECAUSE_YOU_READ = 2;
@@ -72,7 +72,7 @@
 }
 }
 
-public FeedRecyclerAdapter(@NonNull FeedCoordinatorBase coordinator, 
@Nullable FeedViewCallback callback) {
+public FeedAdapter(@NonNull FeedCoordinatorBase coordinator, @Nullable 
FeedViewCallback callback) {
 super(coordinator.getCards());
 this.coordinator = coordinator;
 this.callback = callback;
diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedView.java 
b/app/src/main/java/org/wikipedia/feed/view/FeedView.java
index fdf90af..812a134 100644
--- a/app/src/main/java/org/wikipedia/feed/view/FeedView.java
+++ b/app/src/main/java/org/wikipedia/feed/view/FeedView.java
@@ -16,8 +16,8 @@
 
 public class FeedView extends AutoFitRecyclerView {
 private StaggeredGridLayoutManager recyclerLayoutManager;
-@Nullable private FeedRecyclerAdapter recyclerAdapter;
-@Nullable private ItemTouchHelper recyclerItemTouchHelper;
+@Nullable private FeedAdapter adapter;
+@Nullable private ItemTouchHelper itemTouchHelper;
 
 public FeedView(Context context) {
 super(context);
@@ -35,23 +35,23 @@
 }
 
 public void set(@NonNull FeedCoordinatorBase coordinator, @Nullable 
FeedViewCallback callback) {
-recyclerAdapter = new FeedRecyclerAdapter(coordinator, callback);
-setAdapter(recyclerAdapter);
+

[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.18]: mediawiki.requestIdleCallback: Avoid native window.requestId...

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

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

Change subject: mediawiki.requestIdleCallback: Avoid native 
window.requestIdleCallback
..

mediawiki.requestIdleCallback: Avoid native window.requestIdleCallback

Follows-up 482ad8d9fb.

This currently has bugs in Chrome that can cause it to not get called
for up to 30 seconds.

https://bugs.chromium.org/p/chromium/issues/detail?id=647870

Change-Id: I221cd6c2bcdbee89bc7401c071f2ab1865a738ed
---
M resources/src/mediawiki/mediawiki.requestIdleCallback.js
M tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
2 files changed, 6 insertions(+), 1 deletion(-)


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

diff --git a/resources/src/mediawiki/mediawiki.requestIdleCallback.js 
b/resources/src/mediawiki/mediawiki.requestIdleCallback.js
index dfc98ad..b58cb69 100644
--- a/resources/src/mediawiki/mediawiki.requestIdleCallback.js
+++ b/resources/src/mediawiki/mediawiki.requestIdleCallback.js
@@ -24,8 +24,12 @@
 * @member mw
 * @param {Function} callback
 */
+   mw.requestIdleCallback = mw.requestIdleCallbackInternal;
+   /*
+   // XXX: Polyfill disabled due to 
https://bugs.chromium.org/p/chromium/issues/detail?id=647870
mw.requestIdleCallback = window.requestIdleCallback
// Bind because it throws TypeError if context is not window
? window.requestIdleCallback.bind( window )
: mw.requestIdleCallbackInternal;
+   */
 }( mediaWiki ) );
diff --git 
a/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
index 7a09964..df02693 100644
--- 
a/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
+++ 
b/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
@@ -95,8 +95,9 @@
if ( window.requestIdleCallback ) {
QUnit.test( 'native', function ( assert ) {
var done = assert.async();
-   // Remove polyfill
+   // Remove polyfill and clock stub
mw.requestIdleCallback.restore();
+   this.clock.restore();
mw.requestIdleCallback( function () {
assert.expect( 0 );
done();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I221cd6c2bcdbee89bc7401c071f2ab1865a738ed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.18
Gerrit-Owner: Krinkle 

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


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

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

Change subject: Merge master into deployment
..


Merge master into deployment

6a86a2b0d8b1247ae177e7c5d0f09fb2fb137da6 Correct IPN verification URL
045a244c514d5eb62e0a77ea41e71f9917c16f49 Move postback-url key

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

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I94a631e2a51d65496987446cb0074ee911564c84
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Awight 
Gerrit-Reviewer: Awight 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.18]: Revert "Always use the requestIdleCallback polyfill for batc...

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

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

Change subject: Revert "Always use the requestIdleCallback polyfill for 
batchEval"
..

Revert "Always use the requestIdleCallback polyfill for batchEval"

Replace with I221cd6c2bcdbee8 for consistency with master and 1.28-wmf.20.

This reverts commit 78afd2ca3a32000e72cc5b47a8066dd8aa06007f.

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


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

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 9fd8fb5..db5a4fb 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -1680,7 +1680,7 @@
if ( !implementations.length ) {
return;
}
-   mw.requestIdleCallbackInternal( function 
iterate( deadline ) {
+   mw.requestIdleCallback( function iterate( 
deadline ) {
while ( implementations[ 0 ] && 
deadline.timeRemaining() > 5 ) {
try {
$.globalEval( 
implementations.shift() );
@@ -1690,7 +1690,7 @@
}
}
if ( implementations[ 0 ] ) {
-   mw.requestIdleCallbackInternal( 
iterate );
+   mw.requestIdleCallback( iterate 
);
}
} );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id985db83491977a5090ccdf94bf6e8aad379c389
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.18
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.20]: mediawiki.requestIdleCallback: Avoid native window.requestId...

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

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

Change subject: mediawiki.requestIdleCallback: Avoid native 
window.requestIdleCallback
..

mediawiki.requestIdleCallback: Avoid native window.requestIdleCallback

Follows-up 482ad8d9fb.

This currently has bugs in Chrome that can cause it to not get called
for up to 30 seconds.

https://bugs.chromium.org/p/chromium/issues/detail?id=647870

Change-Id: I221cd6c2bcdbee89bc7401c071f2ab1865a738ed
---
M resources/src/mediawiki/mediawiki.requestIdleCallback.js
M tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
2 files changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/01/311901/1

diff --git a/resources/src/mediawiki/mediawiki.requestIdleCallback.js 
b/resources/src/mediawiki/mediawiki.requestIdleCallback.js
index dfc98ad..b58cb69 100644
--- a/resources/src/mediawiki/mediawiki.requestIdleCallback.js
+++ b/resources/src/mediawiki/mediawiki.requestIdleCallback.js
@@ -24,8 +24,12 @@
 * @member mw
 * @param {Function} callback
 */
+   mw.requestIdleCallback = mw.requestIdleCallbackInternal;
+   /*
+   // XXX: Polyfill disabled due to 
https://bugs.chromium.org/p/chromium/issues/detail?id=647870
mw.requestIdleCallback = window.requestIdleCallback
// Bind because it throws TypeError if context is not window
? window.requestIdleCallback.bind( window )
: mw.requestIdleCallbackInternal;
+   */
 }( mediaWiki ) );
diff --git 
a/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
index 7a09964..df02693 100644
--- 
a/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
+++ 
b/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
@@ -95,8 +95,9 @@
if ( window.requestIdleCallback ) {
QUnit.test( 'native', function ( assert ) {
var done = assert.async();
-   // Remove polyfill
+   // Remove polyfill and clock stub
mw.requestIdleCallback.restore();
+   this.clock.restore();
mw.requestIdleCallback( function () {
assert.expect( 0 );
done();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I221cd6c2bcdbee89bc7401c071f2ab1865a738ed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.19]: mediawiki.requestIdleCallback: Avoid native window.requestId...

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

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

Change subject: mediawiki.requestIdleCallback: Avoid native 
window.requestIdleCallback
..

mediawiki.requestIdleCallback: Avoid native window.requestIdleCallback

Follows-up 482ad8d9fb.

This currently has bugs in Chrome that can cause it to not get called
for up to 30 seconds.

https://bugs.chromium.org/p/chromium/issues/detail?id=647870

Change-Id: I221cd6c2bcdbee89bc7401c071f2ab1865a738ed
---
M resources/src/mediawiki/mediawiki.requestIdleCallback.js
M tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
2 files changed, 6 insertions(+), 1 deletion(-)


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

diff --git a/resources/src/mediawiki/mediawiki.requestIdleCallback.js 
b/resources/src/mediawiki/mediawiki.requestIdleCallback.js
index dfc98ad..b58cb69 100644
--- a/resources/src/mediawiki/mediawiki.requestIdleCallback.js
+++ b/resources/src/mediawiki/mediawiki.requestIdleCallback.js
@@ -24,8 +24,12 @@
 * @member mw
 * @param {Function} callback
 */
+   mw.requestIdleCallback = mw.requestIdleCallbackInternal;
+   /*
+   // XXX: Polyfill disabled due to 
https://bugs.chromium.org/p/chromium/issues/detail?id=647870
mw.requestIdleCallback = window.requestIdleCallback
// Bind because it throws TypeError if context is not window
? window.requestIdleCallback.bind( window )
: mw.requestIdleCallbackInternal;
+   */
 }( mediaWiki ) );
diff --git 
a/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
index 7a09964..df02693 100644
--- 
a/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
+++ 
b/tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js
@@ -95,8 +95,9 @@
if ( window.requestIdleCallback ) {
QUnit.test( 'native', function ( assert ) {
var done = assert.async();
-   // Remove polyfill
+   // Remove polyfill and clock stub
mw.requestIdleCallback.restore();
+   this.clock.restore();
mw.requestIdleCallback( function () {
assert.expect( 0 );
done();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I221cd6c2bcdbee89bc7401c071f2ab1865a738ed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.19
Gerrit-Owner: Krinkle 

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


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

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

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

Change subject: Merge master into deployment
..

Merge master into deployment

6a86a2b0d8b1247ae177e7c5d0f09fb2fb137da6 Correct IPN verification URL
045a244c514d5eb62e0a77ea41e71f9917c16f49 Move postback-url key

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


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/00/311900/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I94a631e2a51d65496987446cb0074ee911564c84
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Awight 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Be strict about PayPal IPN postback response.

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

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

Change subject: Be strict about PayPal IPN postback response.
..

Be strict about PayPal IPN postback response.

Change-Id: I551ce9265c4941c11153c52f63bf0ce41ebcc932
---
M PaymentProviders/PayPal/PayPalPaymentsAPI.php
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/99/311899/1

diff --git a/PaymentProviders/PayPal/PayPalPaymentsAPI.php 
b/PaymentProviders/PayPal/PayPalPaymentsAPI.php
index ec2c6c8..f92c6c3 100644
--- a/PaymentProviders/PayPal/PayPalPaymentsAPI.php
+++ b/PaymentProviders/PayPal/PayPalPaymentsAPI.php
@@ -24,6 +24,14 @@
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_POST, 1 );
// TODO we can put VERIFIED in config and generalize this
-   return $this->curl( $ch, $post_fields ) === 'VERIFIED';
+   $response = $this->curl( $ch, $post_fields );
+
+   if ( $response === 'VERIFIED' ) {
+   return true;
+   } elseif ( $response === 'INVALID' ) {
+   return false;
+   } else {
+   throw new \RuntimeException( "Unknown response from 
PayPal IPN PB: [{$response}]" );
+   }
}
 }

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Move postback-url key

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

Change subject: Move postback-url key
..


Move postback-url key

Change-Id: I6d108ee8de47a48fc8f3b1b2c29dc205d541e44d
---
M PaymentProviders/PayPal/PayPalPaymentsAPI.php
M SmashPig.yaml
2 files changed, 5 insertions(+), 4 deletions(-)

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



diff --git a/PaymentProviders/PayPal/PayPalPaymentsAPI.php 
b/PaymentProviders/PayPal/PayPalPaymentsAPI.php
index 272e857..ec2c6c8 100644
--- a/PaymentProviders/PayPal/PayPalPaymentsAPI.php
+++ b/PaymentProviders/PayPal/PayPalPaymentsAPI.php
@@ -16,7 +16,7 @@
 */
function validate( $post_fields ) {
$url = Configuration::getDefaultConfig()
-   ->val( 'endpoints/listener/postback-url' );
+   ->val( 'postback-url' );
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_HEADER, 0 );
diff --git a/SmashPig.yaml b/SmashPig.yaml
index 94e65f1..fedca6a 100644
--- a/SmashPig.yaml
+++ b/SmashPig.yaml
@@ -358,9 +358,10 @@
 endpoints:
 listener:
 class: SmashPig\PaymentProviders\PayPal\Listener
-# In production, override this entry with
-# postback-url: https://ipnpb.paypal.com/cgi-bin/webscr
-postback-url: https://ipnpb.sandbox.paypal.com/cgi-bin/webscr
+
+# For testing, override with
+# postback-url: https://ipnpb.sandbox.paypal.com/cgi-bin/webscr
+postback-url: https://ipnpb.paypal.com/cgi-bin/webscr
 
 data-store:
 jobs-paypal:

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Move postback-url key

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

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

Change subject: Move postback-url key
..

Move postback-url key

Change-Id: I6d108ee8de47a48fc8f3b1b2c29dc205d541e44d
---
M PaymentProviders/PayPal/PayPalPaymentsAPI.php
M SmashPig.yaml
2 files changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/98/311898/1

diff --git a/PaymentProviders/PayPal/PayPalPaymentsAPI.php 
b/PaymentProviders/PayPal/PayPalPaymentsAPI.php
index 272e857..ec2c6c8 100644
--- a/PaymentProviders/PayPal/PayPalPaymentsAPI.php
+++ b/PaymentProviders/PayPal/PayPalPaymentsAPI.php
@@ -16,7 +16,7 @@
 */
function validate( $post_fields ) {
$url = Configuration::getDefaultConfig()
-   ->val( 'endpoints/listener/postback-url' );
+   ->val( 'postback-url' );
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_HEADER, 0 );
diff --git a/SmashPig.yaml b/SmashPig.yaml
index 94e65f1..fedca6a 100644
--- a/SmashPig.yaml
+++ b/SmashPig.yaml
@@ -358,9 +358,10 @@
 endpoints:
 listener:
 class: SmashPig\PaymentProviders\PayPal\Listener
-# In production, override this entry with
-# postback-url: https://ipnpb.paypal.com/cgi-bin/webscr
-postback-url: https://ipnpb.sandbox.paypal.com/cgi-bin/webscr
+
+# For testing, override with
+# postback-url: https://ipnpb.sandbox.paypal.com/cgi-bin/webscr
+postback-url: https://ipnpb.paypal.com/cgi-bin/webscr
 
 data-store:
 jobs-paypal:

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Correct IPN verification URL

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

Change subject: Correct IPN verification URL
..


Correct IPN verification URL

See 
https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNImplementation/

Change-Id: I93aa24597a44e16407a38001ba7843622aae36ce
---
M SmashPig.yaml
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/SmashPig.yaml b/SmashPig.yaml
index a8c266f..94e65f1 100644
--- a/SmashPig.yaml
+++ b/SmashPig.yaml
@@ -358,9 +358,9 @@
 endpoints:
 listener:
 class: SmashPig\PaymentProviders\PayPal\Listener
-# For testing purposes override this entry with
-# postback-url: https://www.sandbox.paypal.com/cgi-bin/webscr
-postback-url: https://www.sandbox.paypal.com/cgi-bin/webscr
+# In production, override this entry with
+# postback-url: https://ipnpb.paypal.com/cgi-bin/webscr
+postback-url: https://ipnpb.sandbox.paypal.com/cgi-bin/webscr
 
 data-store:
 jobs-paypal:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I93aa24597a44e16407a38001ba7843622aae36ce
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Awight 
Gerrit-Reviewer: Cdentinger 
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[master]: Correct IPN verification URL

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

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

Change subject: Correct IPN verification URL
..

Correct IPN verification URL

See 
https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNImplementation/

Change-Id: I93aa24597a44e16407a38001ba7843622aae36ce
---
M SmashPig.yaml
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/97/311897/1

diff --git a/SmashPig.yaml b/SmashPig.yaml
index a8c266f..94e65f1 100644
--- a/SmashPig.yaml
+++ b/SmashPig.yaml
@@ -358,9 +358,9 @@
 endpoints:
 listener:
 class: SmashPig\PaymentProviders\PayPal\Listener
-# For testing purposes override this entry with
-# postback-url: https://www.sandbox.paypal.com/cgi-bin/webscr
-postback-url: https://www.sandbox.paypal.com/cgi-bin/webscr
+# In production, override this entry with
+# postback-url: https://ipnpb.paypal.com/cgi-bin/webscr
+postback-url: https://ipnpb.sandbox.paypal.com/cgi-bin/webscr
 
 data-store:
 jobs-paypal:

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

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

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


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

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

Change subject: Merge master into deployment
..


Merge master into deployment

59bc92fc9a7d92db0e2d7fd13d16f5858c7449a7 Missing use statement

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

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I48159f2547399364e36552654753b86b344fb2dc
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Awight 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: jenkins-bot <>

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


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

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

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

Change subject: Merge master into deployment
..

Merge master into deployment

59bc92fc9a7d92db0e2d7fd13d16f5858c7449a7 Missing use statement

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


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


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I48159f2547399364e36552654753b86b344fb2dc
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Awight 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Missing use statement

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

Change subject: Missing use statement
..


Missing use statement

Change-Id: I87d4909d1169511d0262e9460ee2dfd3a9898cf6
---
M Core/QueueConsumers/JobQueueConsumer.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/Core/QueueConsumers/JobQueueConsumer.php 
b/Core/QueueConsumers/JobQueueConsumer.php
index 530a719..c96ad4e 100644
--- a/Core/QueueConsumers/JobQueueConsumer.php
+++ b/Core/QueueConsumers/JobQueueConsumer.php
@@ -2,7 +2,7 @@
 
 use RuntimeException;
 use SmashPig\Core\DataStores\KeyedOpaqueStorableObject;
-use SmashPig\Core\Jobs\RunnableJob;
+use SmashPig\Core\Runnable;
 
 class JobQueueConsumer extends BaseQueueConsumer {
 

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Missing use statement

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

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

Change subject: Missing use statement
..

Missing use statement

Change-Id: I87d4909d1169511d0262e9460ee2dfd3a9898cf6
---
M Core/QueueConsumers/JobQueueConsumer.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/95/311895/1

diff --git a/Core/QueueConsumers/JobQueueConsumer.php 
b/Core/QueueConsumers/JobQueueConsumer.php
index 530a719..c96ad4e 100644
--- a/Core/QueueConsumers/JobQueueConsumer.php
+++ b/Core/QueueConsumers/JobQueueConsumer.php
@@ -2,7 +2,7 @@
 
 use RuntimeException;
 use SmashPig\Core\DataStores\KeyedOpaqueStorableObject;
-use SmashPig\Core\Jobs\RunnableJob;
+use SmashPig\Core\Runnable;
 
 class JobQueueConsumer extends BaseQueueConsumer {
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...BiblioPlus[master]: Changed all NCBI urls from http to https.

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

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

Change subject: Changed all NCBI urls from http to https.
..

Changed all NCBI urls from http to https.

Change-Id: I36f0bb65337b24735ffde74680cd9af2f96bbc02
---
M BiblioPlus.body.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/BiblioPlus.body.php b/BiblioPlus.body.php
index 034dc8f..3c988d6 100644
--- a/BiblioPlus.body.php
+++ b/BiblioPlus.body.php
@@ -148,7 +148,7 @@
 function eSummary( $pmids ) {
 if ( count( $pmids ) > 0 ) {
 global $wgSitename, $wgEmergencyContact;
-define( 'EUTILS_ROOT', 
"http://eutils.ncbi.nlm.nih.gov/entrez/eutils/; );
+define( 'EUTILS_ROOT', 
"https://eutils.ncbi.nlm.nih.gov/entrez/eutils/; );
 define( 'ESUMMARY_URL', EUTILS_ROOT . 'esummary.fcgi' );
 
wfSuppressWarnings();
@@ -266,7 +266,7 @@
$doi, "DOI: $doi" ) . ' |';
 } elseif ( $pmid != '' ) {
 $title = 'title="' .wfMessage( 'biblioplus-pmid-tooltip' 
)->escaped() . '"';
-$result = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?cmd=prlinks=pubmed=ref=$pmid\;
 $title $style>$result";
+$result = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?cmd=prlinks=pubmed=ref=$pmid\;
 $title $style>$result";
 } elseif ( $isbn != '' ) {
 $title = 'title="' . wfMessage( 'biblioplus-isbn-tooltip' 
)->escaped() . '"';
 $result = "http://isbndb.com/d/book/$isbndbref.html\; 
$title $style>$result";
@@ -309,7 +309,7 @@
*/
 function pubMedUrl( $pmids ) {
 $listUids = implode( ',', $pmids );
-return 
"http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve=pubmed=Abstract_uids=$listUids;;
+return 
"https://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve=pubmed=Abstract_uids=$listUids;;
 }
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I36f0bb65337b24735ffde74680cd9af2f96bbc02
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BiblioPlus
Gerrit-Branch: master
Gerrit-Owner: KarenEddy 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Make PayPal tests get queues directly from config

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

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

Change subject: Make PayPal tests get queues directly from config
..

Make PayPal tests get queues directly from config

Change-Id: I2028a629b7c9434eefe31dfe9e54bd557470
---
M PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
1 file changed, 2 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/93/311893/1

diff --git 
a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 
b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
index 740acdf..251780e 100644
--- a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
+++ b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
@@ -44,8 +44,7 @@
 
$this->capture( self::$verified_msg );
 
-   // TODO why get it from BaseQueueConsumer instead of config?
-   $jobQueue = BaseQueueConsumer::getQueue( 'jobs-paypal' );
+   $jobQueue = $this->config->object( 'data-store/jobs-paypal' );
$jobMessage = $jobQueue->pop();
 
$this->assertEquals( $jobMessage['php-message-class'],
@@ -59,8 +58,7 @@
 
$this->capture( self::$verified_msg );
 
-   // TODO DRY?
-   $jobQueue = BaseQueueConsumer::getQueue( 'jobs-paypal' );
+   $jobQueue = $this->config->object( 'data-store/jobs-paypal' );
$jobMessage = $jobQueue->pop();
 
$job = KeyedOpaqueStorableObject::fromJsonProxy(

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...2ColConflict[master]: Add mw.org URL

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

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

Change subject: Add mw.org URL
..

Add mw.org URL

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/2ColConflict 
refs/changes/16/311716/1

diff --git a/extension.json b/extension.json
index 7323209..8580733 100644
--- a/extension.json
+++ b/extension.json
@@ -4,7 +4,7 @@
"author": [
"WMDE"
],
-   "url": "https://phabricator.wikimedia.org/T143823;,
+   "url": "https://www.mediawiki.org/wiki/Extension:TwoColConflict;,
"descriptionmsg": "twoColConflict-desc",
"license-name": "GPL-2.0+",
"type": "other",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I66d2172bf4c1dafa62c865563c66b46a7b79b34c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/2ColConflict
Gerrit-Branch: master
Gerrit-Owner: Addshore 

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


[MediaWiki-commits] [Gerrit] mediawiki...OAuth[master]: Use HTMLRestrictionsField

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

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

Change subject: Use HTMLRestrictionsField
..

Use HTMLRestrictionsField

Change-Id: I8c2a2713e94b0254d840bd71044a6cc1318a1b7c
Depends-On: Ib50238e3be5eec63eb5df97154b60dc4ca33d581
---
M control/MWOAuthConsumerSubmitControl.php
M frontend/specialpages/SpecialMWOAuthConsumerRegistration.php
2 files changed, 6 insertions(+), 26 deletions(-)


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

diff --git a/control/MWOAuthConsumerSubmitControl.php 
b/control/MWOAuthConsumerSubmitControl.php
index a987621..32c4f8c 100644
--- a/control/MWOAuthConsumerSubmitControl.php
+++ b/control/MWOAuthConsumerSubmitControl.php
@@ -88,14 +88,6 @@
$grants = \FormatJson::decode( $s, true 
);
return is_array( $grants ) && 
MWOAuthUtils::grantsAreValid( $grants );
},
-   'restrictions' => function( $s ) {
-   try {
-   \MWRestrictions::newFromJson( 
$s );
-   return true;
-   } catch ( \InvalidArgumentException $ex 
) {
-   return false;
-   }
-   },
'rsaKey'   => $validateRsaKey,
'agreement'=> function( $s ) {
return ( $s == true );
@@ -103,14 +95,6 @@
),
'update'  => array(
'consumerKey'  => '/^[0-9a-f]{32}$/',
-   'restrictions' => function( $s ) {
-   try {
-   \MWRestrictions::newFromJson( 
$s );
-   return true;
-   } catch ( \InvalidArgumentException $ex 
) {
-   return false;
-   }
-   },
'rsaKey'   => $validateRsaKey,
'resetSecret'  => function( $s ) { return 
is_bool( $s ); },
'reason'   => '/^.{0,255}$/',
@@ -242,7 +226,7 @@
'stage'  => $stage,
'stageTimestamp' => $now,
'grants' => $grants,
-   'restrictions'   => 
\MWRestrictions::newFromJson( $this->vals['restrictions'] ),
+   'restrictions'   => 
$this->vals['restrictions'],
'deleted'=> 0
) + $this->vals
);
@@ -295,7 +279,7 @@
 
$cmr->setFields( array(
'rsaKey'   => $this->vals['rsaKey'],
-   'restrictions' => \MWRestrictions::newFromJson( 
$this->vals['restrictions'] ),
+   'restrictions' => $this->vals['restrictions'],
'secretKey'=> $this->vals['resetSecret']
? \MWCryptRand::generateHex( 32 )
: $cmr->get( 'secretKey' )
diff --git a/frontend/specialpages/SpecialMWOAuthConsumerRegistration.php 
b/frontend/specialpages/SpecialMWOAuthConsumerRegistration.php
index 3d4ad9f..13d93bb 100644
--- a/frontend/specialpages/SpecialMWOAuthConsumerRegistration.php
+++ b/frontend/specialpages/SpecialMWOAuthConsumerRegistration.php
@@ -177,11 +177,9 @@
'validation-callback' => null 
// different format
),
'restrictions' => array(
-   'type' => 'textarea',
-   'label-message' => 
'mwoauth-consumer-restrictions-json',
+   'class' => 
'HTMLRestrictionsField',
'required' => true,
-   'default' => 
\MWRestrictions::newDefault()->toJson( true ),
-   'rows' => 5
+   'default' => 
\MWRestrictions::newDefault(),
),
'rsaKey' => array(
  

[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Use config for test queue instantiation

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

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

Change subject: Use config for test queue instantiation
..

Use config for test queue instantiation

Change-Id: I520852aa2c22e253ef337badc8169f89aa4069bd
---
M PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
1 file changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/92/311892/1

diff --git 
a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 
b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
index 740acdf..42788ce 100644
--- a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
+++ b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
@@ -3,7 +3,6 @@
 
 use SmashPig\Core\Configuration;
 use SmashPig\Core\Context;
-use SmashPig\Core\QueueConsumers\BaseQueueConsumer;
 use SmashPig\PaymentProviders\PayPal\Listener;
 use SmashPig\PaymentProviders\PayPal\Job;
 use SmashPig\PaymentProviders\PayPal\Tests\PayPalTestConfiguration;
@@ -44,8 +43,7 @@
 
$this->capture( self::$verified_msg );
 
-   // TODO why get it from BaseQueueConsumer instead of config?
-   $jobQueue = BaseQueueConsumer::getQueue( 'jobs-paypal' );
+   $jobQueue = $this->config->object( 'data-store/jobs-paypal' );
$jobMessage = $jobQueue->pop();
 
$this->assertEquals( $jobMessage['php-message-class'],

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

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

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Add RESTBaseUriFormat list to dev settings

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

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

Change subject: Add RESTBaseUriFormat list to dev settings
..

Add RESTBaseUriFormat list to dev settings

The dev settings option for RESTBaseUriFormat has become
very big and complex. This patch adds a ListPreference which lets
users select from the most common options.

The last, "custom", option is still a free form text to allow for flexibility.
It is already populated with the string one had to copy over before.
As before, you still need to replace  the string "host" with the actual
hostname or IP address of the developer machine you have MCS running on.

Change-Id: Ib5c931f9a108a46bedd12302b624b9f8000dd826
---
M 
app/src/main/java/org/wikipedia/settings/DeveloperSettingsPreferenceLoader.java
M app/src/main/java/org/wikipedia/settings/Prefs.java
M app/src/main/res/values/preference_keys.xml
M app/src/main/res/values/preference_values.xml
M app/src/main/res/xml/developer_preferences.xml
5 files changed, 96 insertions(+), 12 deletions(-)


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

diff --git 
a/app/src/main/java/org/wikipedia/settings/DeveloperSettingsPreferenceLoader.java
 
b/app/src/main/java/org/wikipedia/settings/DeveloperSettingsPreferenceLoader.java
index b82bd25..c3e90c1 100644
--- 
a/app/src/main/java/org/wikipedia/settings/DeveloperSettingsPreferenceLoader.java
+++ 
b/app/src/main/java/org/wikipedia/settings/DeveloperSettingsPreferenceLoader.java
@@ -1,17 +1,18 @@
 package org.wikipedia.settings;
 
-import android.content.Context;
-import android.support.annotation.NonNull;
-import android.support.v7.preference.Preference;
-import android.support.v7.preference.PreferenceCategory;
-import android.support.v7.preference.PreferenceFragmentCompat;
-import android.support.v7.preference.TwoStatePreference;
-
 import org.wikipedia.R;
 import org.wikipedia.WikipediaApp;
 import org.wikipedia.crash.RemoteLogException;
 import org.wikipedia.useroption.ui.UserOptionRowActivity;
 import org.wikipedia.util.log.L;
+
+import android.content.Context;
+import android.support.annotation.NonNull;
+import android.support.v7.preference.ListPreference;
+import android.support.v7.preference.Preference;
+import android.support.v7.preference.PreferenceCategory;
+import android.support.v7.preference.PreferenceFragmentCompat;
+import android.support.v7.preference.TwoStatePreference;
 
 import java.util.List;
 
@@ -46,6 +47,7 @@
 public void loadPreferences() {
 loadPreferences(R.xml.developer_preferences);
 setUpRestBaseCheckboxes();
+setUpRestBaseUriFormat();
 setUpCookies((PreferenceCategory) 
findPreference(R.string.preferences_developer_cookies_key));
 setUpEditTokens((PreferenceCategory) 
findPreference(R.string.preferences_developer_edit_tokens_key));
 setUpCrashButton(findPreference(getCrashButtonKey()));
@@ -78,6 +80,63 @@
 return context.getString(R.string.preference_key_use_restbase);
 }
 
+private void setUpRestBaseUriFormat() {
+ListPreference preference = (ListPreference) 
findPreference(getRestBaseUriFormatListKey());
+
preference.setOnPreferenceChangeListener(setRestBaseUriFormatChangeListener);
+setRestBaseUriFormatEnabled(preference, preference.getValue());
+}
+
+private String getRestBaseUriFormatListKey() {
+return 
context.getString(R.string.preference_key_restbase_uri_format_list);
+}
+
+public String getRestBaseUriFormatKey() {
+return context.getString(R.string.preference_key_restbase_uri_format);
+}
+
+@NonNull private final Preference.OnPreferenceChangeListener 
setRestBaseUriFormatChangeListener
+= new Preference.OnPreferenceChangeListener() {
+/**
+ * Called when the RESTBase Uri Format preference has been changed by 
the user. This is
+ * called before the state of the Preference is about to be updated and
+ * before the state is persisted.
+ *
+ * @param preference The changed Preference.
+ * @param newValue   The new value of the Preference.
+ * @return True to update the state of the Preference with the new 
value.
+ */
+@Override
+public boolean onPreferenceChange(Preference preference, Object 
newValue) {
+final String value = (String) newValue;
+setRestBaseUriFormatEnabled((ListPreference) preference, value);
+setRestBaseUriFormat(value);
+return true;
+}
+};
+
+private void setRestBaseUriFormat(String newValue) {
+Prefs.setRestbaseUriFormat(newValue);
+getRestBaseUriFormatPreference().callChangeListener(newValue);
+getRestBaseUriFormatPreference().setDefaultValue(newValue);
+}
+
+private void setRestBaseUriFormatEnabled(ListPreference preference, String 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: admin: access to stats1002/webrequest logs for Melody Kramer

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

Change subject: admin: access to stats1002/webrequest logs for Melody Kramer
..


admin: access to stats1002/webrequest logs for Melody Kramer

Bug: T145387
Change-Id: I94e639eea6afa9c650c4c0d8e63de28ee5421d53
---
M modules/admin/data/data.yaml
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index d9cbbab..ce8e082 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -179,7 +179,7 @@
 members: [ezachte, milimetric, dartar, yurik, halfak, awight, dr0ptp4kt, 
nuria,
   leila, ellery, nettrom, mforns, bmansurov, tbayer, joal,
   madhuvishy, tjones, legoktm, dcausse, bearloga, dpatrick, 
atgomez, dstrine,
-  joewalsh, marktraceur, mtizzoni, panisson, paolotti, ciro]
+  joewalsh, marktraceur, mtizzoni, panisson, paolotti, ciro, 
melodykramer]
   statistics-users:
 gid: 726
 description: Access statistics number crunching hosts. NO PRIVS.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I94e639eea6afa9c650c4c0d8e63de28ee5421d53
Gerrit-PatchSet: 6
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add HTMLFormField class for MWRestrictions and use it for bo...

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

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

Change subject: Add HTMLFormField class for MWRestrictions and use it for bot 
passwords
..

Add HTMLFormField class for MWRestrictions and use it for bot passwords

Change-Id: Ib50238e3be5eec63eb5df97154b60dc4ca33d581
---
M autoload.php
M includes/htmlform/HTMLFormField.php
A includes/htmlform/fields/HTMLRestrictionsField.php
M includes/specials/SpecialBotPasswords.php
M includes/utils/MWRestrictions.php
M languages/i18n/en.json
M languages/i18n/qqq.json
A tests/phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php
8 files changed, 200 insertions(+), 18 deletions(-)


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

diff --git a/autoload.php b/autoload.php
index 198e477..1b21365 100644
--- a/autoload.php
+++ b/autoload.php
@@ -544,6 +544,7 @@
'HTMLMultiSelectField' => __DIR__ . 
'/includes/htmlform/fields/HTMLMultiSelectField.php',
'HTMLNestedFilterable' => __DIR__ . 
'/includes/htmlform/HTMLNestedFilterable.php',
'HTMLRadioField' => __DIR__ . 
'/includes/htmlform/fields/HTMLRadioField.php',
+   'HTMLRestrictionsField' => __DIR__ . 
'/includes/htmlform/fields/HTMLRestrictionsField.php',
'HTMLSelectAndOtherField' => __DIR__ . 
'/includes/htmlform/fields/HTMLSelectAndOtherField.php',
'HTMLSelectField' => __DIR__ . 
'/includes/htmlform/fields/HTMLSelectField.php',
'HTMLSelectLimitField' => __DIR__ . 
'/includes/htmlform/fields/HTMLSelectLimitField.php',
diff --git a/includes/htmlform/HTMLFormField.php 
b/includes/htmlform/HTMLFormField.php
index 8604ba2..4afdea7 100644
--- a/includes/htmlform/HTMLFormField.php
+++ b/includes/htmlform/HTMLFormField.php
@@ -821,7 +821,7 @@
/**
 * Determine the help text to display
 * @since 1.20
-* @return string HTML
+* @return string|null HTML
 */
public function getHelpText() {
$helptext = null;
diff --git a/includes/htmlform/fields/HTMLRestrictionsField.php 
b/includes/htmlform/fields/HTMLRestrictionsField.php
new file mode 100644
index 000..f97962f
--- /dev/null
+++ b/includes/htmlform/fields/HTMLRestrictionsField.php
@@ -0,0 +1,121 @@
+mLabel ) {
+   $this->mLabel = $this->msg( 
'restrictionsfield-label')->parse();
+   }
+   }
+
+   public function getHelpText() {
+   $helpText = parent::getHelpText();
+   if ( $helpText === null ) {
+   $helpText = $this->msg( 
'restrictionsfield-help')->parse();
+   }
+   return $helpText;
+   }
+
+   /**
+* @param WebRequest $request
+* @return string|MWRestrictions Restrictions object or original string 
if invalid
+*/
+   function loadDataFromRequest( $request ) {
+   if ( !$request->getCheck( $this->mName ) ) {
+   return $this->getDefault();
+   }
+
+   $value = rtrim( $request->getText( $this->mName ), "\r\n" );
+   $ips = $value === '' ? [] : explode( PHP_EOL, $value );
+   try {
+   return MWRestrictions::newFromArray( [ 'IPAddresses' => 
$ips ] );
+   } catch ( InvalidArgumentException $e ) {
+   return $value;
+   }
+   }
+
+   /**
+* @return MWRestrictions
+*/
+   public function getDefault() {
+   $default = parent::getDefault();
+   if ( $default === null ) {
+   $default = MWRestrictions::newDefault();
+   }
+   return $default;
+   }
+
+   /**
+* @param string|MWRestrictions $value The value the field was 
submitted with
+* @param array $alldata The data collected from the form
+*
+* @return bool|string True on success, or String error to display, or
+*   false to fail validation without displaying an error.
+*/
+   public function validate( $value, $alldata ) {
+   if ( $this->isHidden( $alldata ) ) {
+   return true;
+   }
+
+   if (
+   isset( $this->mParams['required'] ) && 
$this->mParams['required'] !== false
+   && $value instanceof MWRestrictions && 
!$value->toArray()['IPAddresses']
+   ) {
+   return $this->msg( 'htmlform-required' )->parse();
+   }
+
+   if ( is_string( $value ) ) {
+   // MWRestrictions::newFromArray failed; one of the IP 
ranges must be invalid
+   $status = Status::newGood();
+   foreach ( explode( PHP_EOL,  $value ) as $range ) {
+   if ( !\IP::isIPAddress( $range ) ) {
+   

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Add beta cluster to RB Uri formats

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

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

Change subject: Add beta cluster to RB Uri formats
..

Add beta cluster to RB Uri formats

So we can eventually test beta cluster RB deployments in the app
before deploying to production. The beta cluster feed endpoints
still have issues at this time.

Breaking change for developers:
Since the beta cluster URI format differs from the other ones significantly
we only use the Wikipedia subdomain. So, the second string
parameter passed in is only "en" instead of "en.wikipedia.org".

Examples of actual URIs to illustrate this:
Prod: https://en.wikipedia.org/api/rest_v1
Beta cluster: https://en.wikipedia.beta.wmflabs.org/api/rest_v1

Another minor issue with this patch is that now the hint text is so
long that on smaller devices you may have to scroll down to see the
input field.

Change-Id: I2aceab513b6761f7a18130db0f31722c0efe65f3
---
M app/src/main/java/org/wikipedia/Site.java
M 
app/src/main/java/org/wikipedia/feed/aggregated/AggregatedFeedContentClient.java
M app/src/main/java/org/wikipedia/server/restbase/RbPageEndpointsCache.java
M app/src/main/java/org/wikipedia/settings/Prefs.java
M app/src/main/res/xml/developer_preferences.xml
5 files changed, 22 insertions(+), 15 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/Site.java 
b/app/src/main/java/org/wikipedia/Site.java
index a21ccd0..90ba9f1 100644
--- a/app/src/main/java/org/wikipedia/Site.java
+++ b/app/src/main/java/org/wikipedia/Site.java
@@ -123,6 +123,11 @@
 }
 
 @NonNull
+public String subdomain() {
+return languageCodeToSubdomain(languageCode);
+}
+
+@NonNull
 public String host() {
 return uri.getHost();
 }
diff --git 
a/app/src/main/java/org/wikipedia/feed/aggregated/AggregatedFeedContentClient.java
 
b/app/src/main/java/org/wikipedia/feed/aggregated/AggregatedFeedContentClient.java
index db0a504..48f214c 100644
--- 
a/app/src/main/java/org/wikipedia/feed/aggregated/AggregatedFeedContentClient.java
+++ 
b/app/src/main/java/org/wikipedia/feed/aggregated/AggregatedFeedContentClient.java
@@ -38,7 +38,7 @@
 cancel();
 UtcDate date = DateUtil.getUtcRequestDateFor(age);
 String endpoint = String.format(Locale.ROOT, 
Prefs.getRestbaseUriFormat(), site.scheme(),
-site.authority());
+site.subdomain());
 Retrofit retrofit = RetrofitFactory.newInstance(site, endpoint);
 AggregatedFeedContentClient.Service service = 
retrofit.create(Service.class);
 call = service.get(date.year(), date.month(), date.date());
diff --git 
a/app/src/main/java/org/wikipedia/server/restbase/RbPageEndpointsCache.java 
b/app/src/main/java/org/wikipedia/server/restbase/RbPageEndpointsCache.java
index bff2202..9e35e50 100644
--- a/app/src/main/java/org/wikipedia/server/restbase/RbPageEndpointsCache.java
+++ b/app/src/main/java/org/wikipedia/server/restbase/RbPageEndpointsCache.java
@@ -23,7 +23,7 @@
 
 public static Retrofit retrofit(@NonNull Site site) {
 String endpoint = String.format(Locale.ROOT, 
Prefs.getRestbaseUriFormat(), site.scheme(),
-site.authority());
+site.subdomain());
 return RetrofitFactory.newInstance(site, endpoint);
 }
 
diff --git a/app/src/main/java/org/wikipedia/settings/Prefs.java 
b/app/src/main/java/org/wikipedia/settings/Prefs.java
index fdbbb52..054d86c 100644
--- a/app/src/main/java/org/wikipedia/settings/Prefs.java
+++ b/app/src/main/java/org/wikipedia/settings/Prefs.java
@@ -1,9 +1,5 @@
 package org.wikipedia.settings;
 
-import android.net.Uri;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-
 import org.wikipedia.Constants;
 import org.wikipedia.R;
 import org.wikipedia.SharedPreferenceCookieManager;
@@ -18,12 +14,16 @@
 import org.wikipedia.theme.Theme;
 import org.wikipedia.util.StringUtil;
 
+import okhttp3.logging.HttpLoggingInterceptor.Level;
+
+import android.net.Uri;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+
 import java.util.Collections;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
-
-import okhttp3.logging.HttpLoggingInterceptor.Level;
 
 import static org.wikipedia.settings.PrefsIoUtil.contains;
 import static org.wikipedia.settings.PrefsIoUtil.getBoolean;
@@ -271,7 +271,9 @@
 
 public static int getSessionTimeout() {
 // return the timeout, but don't let it be less than the minimum
-return Math.max(getInt(R.string.preference_key_session_timeout, 
SessionFunnel.DEFAULT_SESSION_TIMEOUT), SessionFunnel.MIN_SESSION_TIMEOUT);
+return Math.max(
+getInt(R.string.preference_key_session_timeout, 
SessionFunnel.DEFAULT_SESSION_TIMEOUT),
+  

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

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

Change subject: Merge master into deployment
..


Merge master into deployment

ce6531b855f165dac095a2f80e8f14909e975776 Explicitly configure queue name cos 
silly

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

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9d4510da0ad18e0f61a8391266184a4f90da0b86
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Awight 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: jenkins-bot <>

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


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

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

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

Change subject: Merge master into deployment
..

Merge master into deployment

ce6531b855f165dac095a2f80e8f14909e975776 Explicitly configure queue name cos 
silly

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


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/88/311888/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d4510da0ad18e0f61a8391266184a4f90da0b86
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Awight 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Explicitly configure queue name cos silly

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

Change subject: Explicitly configure queue name cos silly
..


Explicitly configure queue name cos silly

Change-Id: Ic892ca79977d90e41f26ecc40cd89aac7b13e603
---
M SmashPig.yaml
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/SmashPig.yaml b/SmashPig.yaml
index 544a529..a8c266f 100644
--- a/SmashPig.yaml
+++ b/SmashPig.yaml
@@ -368,6 +368,9 @@
 constructor-parameters:
 -
 <<: *REDIS
+# FIXME: This queue thing is introspected at times, and at
+# others not.  Make it consistent (and invisible).
+queue: jobs-paypal
 
 var_map:
 payment_date: date # needs strtotime(payment_date)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic892ca79977d90e41f26ecc40cd89aac7b13e603
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Awight 
Gerrit-Reviewer: Cdentinger 
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...Kartographer[master]: GeometryCollection is a subset of Geometry

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

Change subject: GeometryCollection is a subset of Geometry
..


GeometryCollection is a subset of Geometry

https://tools.ietf.org/html/rfc7946#section-3.1.8

Bug: T146157
Change-Id: I60b36c87350eb428780729e7e1cc5d252e94ad4c
---
M schemas/geojson.json
A tests/phpunit/data/bad-schemas/41-nested-geometry-collections.json
A tests/phpunit/data/good-schemas/09-geometry-collection.json
3 files changed, 70 insertions(+), 2 deletions(-)

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



diff --git a/schemas/geojson.json b/schemas/geojson.json
index 567ccc6..0063cae 100644
--- a/schemas/geojson.json
+++ b/schemas/geojson.json
@@ -16,7 +16,6 @@
},
"oneOf": [
{ "$ref": "#/definitions/geometry" },
-   { "$ref": "#/definitions/geometryCollection" },
{ "$ref": "#/definitions/feature" },
{ "$ref": "#/definitions/featureCollection" },
{ "$ref": "#/definitions/externalData" }
@@ -50,7 +49,17 @@
"title": "geometry",
"description": "One geometry as defined by GeoJSON",
"type": "object",
-   "required": [ "type", "coordinates" ],
+   "required": [ "type" ],
+   "oneOf": [
+   { "$ref": "#/definitions/primitiveGeometry" },
+   { "$ref": "#/definitions/geometryCollection" }
+   ]
+   },
+   "primitiveGeometry": {
+   "title": "primitiveGeometry",
+   "description": "All the non-collection Geometry types",
+   "type": "object",
+   "required": [ "coordinates" ],
"oneOf": [
{
"title": "Point",
diff --git a/tests/phpunit/data/bad-schemas/41-nested-geometry-collections.json 
b/tests/phpunit/data/bad-schemas/41-nested-geometry-collections.json
new file mode 100644
index 000..5de9976
--- /dev/null
+++ b/tests/phpunit/data/bad-schemas/41-nested-geometry-collections.json
@@ -0,0 +1,18 @@
+{
+   "type": "GeometryCollection",
+   "geometries": [
+   {
+   "type": "GeometryCollection",
+   "geometries": [
+   {
+   "type": "Point",
+   "coordinates": [
+   10,
+   20,
+   "fail"
+   ]
+   }
+   ]
+   }
+   ]
+}
\ No newline at end of file
diff --git a/tests/phpunit/data/good-schemas/09-geometry-collection.json 
b/tests/phpunit/data/good-schemas/09-geometry-collection.json
new file mode 100644
index 000..2e8aa2c
--- /dev/null
+++ b/tests/phpunit/data/good-schemas/09-geometry-collection.json
@@ -0,0 +1,41 @@
+{
+   "type": "Feature",
+   "geometry": {
+   "type": "GeometryCollection",
+   "geometries": [
+   {
+   "type": "LineString",
+   "coordinates": [
+   [
+   -20.78146426141457,
+   -20.24797277602244
+   ],
+   [
+   20.80974825712424,
+   30.094641604394508
+   ]
+   ]
+   },
+   {
+   "type": "Point",
+   "coordinates": [
+   10,
+   20
+   ]
+   },
+   {
+   "type": "GeometryCollection",
+   "properties": {},
+   "geometries": [
+   {
+   "type": "Point",
+   "coordinates": [
+   30,
+   40
+   ]
+   }
+

[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Explicitly configure queue name cos silly

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

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

Change subject: Explicitly configure queue name cos silly
..

Explicitly configure queue name cos silly

Change-Id: Ic892ca79977d90e41f26ecc40cd89aac7b13e603
---
M SmashPig.yaml
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/87/311887/1

diff --git a/SmashPig.yaml b/SmashPig.yaml
index 544a529..a8c266f 100644
--- a/SmashPig.yaml
+++ b/SmashPig.yaml
@@ -368,6 +368,9 @@
 constructor-parameters:
 -
 <<: *REDIS
+# FIXME: This queue thing is introspected at times, and at
+# others not.  Make it consistent (and invisible).
+queue: jobs-paypal
 
 var_map:
 payment_date: date # needs strtotime(payment_date)

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Toolbox: Mark RecentChangesLinked link as nofollow

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

Change subject: Toolbox: Mark RecentChangesLinked link as nofollow
..


Toolbox: Mark RecentChangesLinked link as nofollow

Bug: T146233
Change-Id: I2dd0b3a179dc0d1d7210d98748f45e75f953d2bf
---
M includes/skins/BaseTemplate.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/skins/BaseTemplate.php b/includes/skins/BaseTemplate.php
index 2d37a0f..87865df 100644
--- a/includes/skins/BaseTemplate.php
+++ b/includes/skins/BaseTemplate.php
@@ -55,7 +55,6 @@
 * @return array
 */
function getToolbox() {
-
$toolbox = [];
if ( isset( $this->data['nav_urls']['whatlinkshere'] )
&& $this->data['nav_urls']['whatlinkshere']
@@ -69,6 +68,7 @@
$toolbox['recentchangeslinked'] = 
$this->data['nav_urls']['recentchangeslinked'];
$toolbox['recentchangeslinked']['msg'] = 
'recentchangeslinked-toolbox';
$toolbox['recentchangeslinked']['id'] = 
't-recentchangeslinked';
+   $toolbox['recentchangeslinked']['rel'] = 'nofollow';
}
if ( isset( $this->data['feeds'] ) && $this->data['feeds'] ) {
$toolbox['feeds']['id'] = 'feedlinks';

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2dd0b3a179dc0d1d7210d98748f45e75f953d2bf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Mattflaschen 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Pass document to preview through PST

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

Change subject: Pass document to preview through PST
..


Pass document to preview through PST

Change-Id: I2712c26c94cf62f8ec8e68a9912e6a557f41f6a4
---
M modules/ve-mw/init/ve.init.mw.ArticleTarget.js
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js 
b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
index 4ae2277..3ffbf51 100644
--- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
+++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
@@ -918,7 +918,8 @@
action: 'visualeditor',
paction: 'parsefragment',
page: mw.config.get( 'wgRelevantPageName' ),
-   wikitext: this.getDocToSave()
+   wikitext: this.getDocToSave(),
+   pst: true
} ).always( function ( response, details ) {
if ( ve.getProp( response, 'visualeditor', 'result' ) 
=== 'success' ) {
target.saveDialog.showPreview( 
response.visualeditor.content );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2712c26c94cf62f8ec8e68a9912e6a557f41f6a4
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Improve lag/flag behavior and docs in LoadBalancer

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

Change subject: Improve lag/flag behavior and docs in LoadBalancer
..


Improve lag/flag behavior and docs in LoadBalancer

* Set DBO_DEFAULT if "flags" is not set. MediaWiki config bootstrapping
  does this, but for outside users, it should still be the default too.
* Make "is static" do more than no-oping DatabaseMysqlBase::masterPosWait().
  It now also treats servers with this flag as having 0 lag at all times.
  This makes it far more useful, as the point of the flag is to mark DBs
  that are archival clones of each other and may not even replicate.
* Add more ILoadBalancer usage documentation.

Change-Id: Ib0b44e42e9f4c57a292d6a6ea17beb454db464bc
---
M includes/libs/rdbms/loadbalancer/ILoadBalancer.php
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
2 files changed, 65 insertions(+), 8 deletions(-)

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



diff --git a/includes/libs/rdbms/loadbalancer/ILoadBalancer.php 
b/includes/libs/rdbms/loadbalancer/ILoadBalancer.php
index 0efd8bc..3b2479f1 100644
--- a/includes/libs/rdbms/loadbalancer/ILoadBalancer.php
+++ b/includes/libs/rdbms/loadbalancer/ILoadBalancer.php
@@ -23,7 +23,51 @@
  */
 
 /**
- * Interface for database load balancing object that manages IDatabase handles
+ * Database cluster connection, tracking, load balancing, and transaction 
manager interface
+ *
+ * A "cluster" is considered to be one master database and zero or more 
replica databases.
+ * Typically, the replica DBs replicate from the master asynchronously. The 
first node in the
+ * "servers" configuration array is always considered the "master". However, 
this class can still
+ * be used when all or some of the "replica" DBs are multi-master peers of the 
master or even
+ * when all the DBs are non-replicating clones of each other holding read-only 
data. Thus, the
+ * role of "master" is in some cases merely nominal.
+ *
+ * By default, each DB server uses DBO_DEFAULT for its 'flags' setting, unless 
explicitly set
+ * otherwise in configuration. DBO_DEFAULT behavior depends on whether 
'cliMode' is set:
+ *   - In CLI mode, the flag has no effect with regards to LoadBalancer.
+ *   - In non-CLI mode, the flag causes implicit transactions to be used; the 
first query on
+ * a database starts a transaction on that database. The transactions are 
meant to remain
+ * pending until either commitMasterChanges() or rollbackMasterChanges() 
is called. The
+ * application must have some point where it calls commitMasterChanges() 
near the end of
+ * the PHP request.
+ * Every iteration of beginMasterChanges()/commitMasterChanges() is called a 
"transaction round".
+ * Rounds are useful on the master DB connections because they make single-DB 
(and by and large
+ * multi-DB) updates in web requests all-or-nothing. Also, transactions on 
replica DBs are useful
+ * when REPEATABLE-READ or SERIALIZABLE isolation is used because all foriegn 
keys and constraints
+ * hold across separate queries in the DB transaction since the data appears 
within a consistent
+ * point-in-time snapshot.
+ *
+ * The typical caller will use LoadBalancer::getConnection( DB_* ) to yield a 
live database
+ * connection handle. The choice of which DB server to use is based on 
pre-defined loads for
+ * weighted random selection, adjustments thereof by LoadMonitor, and the 
amount of replication
+ * lag on each DB server. Lag checks might cause problems in certain setups, 
so they should be
+ * tuned in the server configuration maps as follows:
+ *   - Master + N Replica(s): set 'max lag' to an appropriate threshold for 
avoiding any database
+ *  lagged by this much or more. If all DBs are this lagged, then the load 
balancer considers
+ *  the cluster to be read-only.
+ *   - Galera Cluster: Seconds_Behind_Master will be 0, so there probably is 
nothing to tune.
+ *  Note that lag is still possible depending on how wsrep-sync-wait is 
set server-side.
+ *   - Read-only archive clones: set 'is static' in the server configuration 
maps. This will
+ *  treat all such DBs as having 0 lag.
+ *   - SQL load balancing proxy: any proxy should handle lag checks on its 
own, so the 'max lag'
+ * parameter should probably be set to INF in the server configuration 
maps. This will make
+ * the load balancer ignore whatever it detects as the lag of the logical 
replica is (which
+ * would probably just randomly bounce around).
+ *
+ * If using a SQL proxy service, it would probably be best to have two proxy 
hosts for the
+ * load balancer to talk to. One would be the 'host' of the master server 
entry and another for
+ * the (logical) replica server entry. The proxy could map the load balancer's 
"replica" DB to
+ * any number of physical replica DBs.
  *
  * @since 1.28
  * @ingroup Database
diff --git 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: ciphersuite: remove chapoly draft-mode ciphers

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

Change subject: ciphersuite: remove chapoly draft-mode ciphers
..


ciphersuite: remove chapoly draft-mode ciphers

These will go away implicitly when we switch to openssl-1.1.0, so
we should make this transition first if we can to separate the
effects we see in graphs.

Currently ~3.8% of clients are using this.  That number has been
on the decline, and those clients should revert to the same strong
(but slower, for them) AES-GCM options they had before we deployed
the chapoly patches.  The clients can fix this on their own by
upgrading Chrome.  Some percentage is coming from a Google Search
App on iOS that has yet to see an RFC chapoly release, but I don't
think we care much about it in the net.

Change-Id: Id7b7bb38b2e55df17e1a1c7f942e693535ce00dd
---
M modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb
1 file changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb 
b/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb
index d8bad83..b690a17 100644
--- a/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb
+++ b/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb
@@ -94,8 +94,6 @@
   '-ALL',
   'ECDHE-ECDSA-CHACHA20-POLY1305',   # openssl-1.1.0, 1.0.2+cloudflare
   'ECDHE-RSA-CHACHA20-POLY1305', # openssl-1.1.0, 1.0.2+cloudflare
-  'ECDHE-ECDSA-CHACHA20-POLY1305-D', # 1.0.2+cloudflare
-  'ECDHE-RSA-CHACHA20-POLY1305-D',   # 1.0.2+cloudflare
   'ECDHE-ECDSA-AES128-GCM-SHA256',
   'ECDHE-ECDSA-AES256-GCM-SHA384',
   'ECDHE-RSA-AES128-GCM-SHA256',

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Test Configuration merge edge case

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

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

Change subject: Test Configuration merge edge case
..

Test Configuration merge edge case

Change-Id: Ida4664b0806e2a38f8f863494c6e55e210c68959
---
M Tests/ConfigurationTest.php
1 file changed, 34 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/86/311886/1

diff --git a/Tests/ConfigurationTest.php b/Tests/ConfigurationTest.php
index 4cace76..1044a2e 100644
--- a/Tests/ConfigurationTest.php
+++ b/Tests/ConfigurationTest.php
@@ -18,4 +18,38 @@
$this->assertEquals( 'FOO', $config->val( 
'logging/root-context' ),
'Config was overridden.' );
}
+
+   /**
+* Check that sparsely populated deep structures override one another
+* additively, and we don't lose branches from half of the union.
+* TODO: Provide more cases using a dataProvider.
+*/
+   public function testOverrideDeep() {
+   $config = $this->setConfig();
+
+   $config->override( array(
+   'endpoints' => array(
+   'listener' => array(
+   'class' => 'SmashPig\Ham',
+   'postback-url' => 'http://Salad',
+   ),
+   ),
+   ) );
+
+   $config->override( array(
+   'endpoints' => array(
+   'listener' => array(
+   'postback-url' => 'http://Rice',
+   ),
+   ),
+   ) );
+
+   $expected = array(
+   'class' => 'SmashPig\Ham',
+   'postback-url' => 'http://Rice',
+   );
+
+   $this->assertEquals( $expected, $config->val( 
'endpoints/listener' ),
+   'Deep merge went as hoped' );
+   }
 }

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Revise update to primaries not set.

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

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

Change subject: Revise update to primaries not set.
..

Revise update to primaries not set.

This worked on staging but it must be missing some triggers as it failed on a 
circularity on prod.

The temporary table should get past that

Bug: T143062
Change-Id: I73ecc0da3b89ea45db3cd4a1f6841ad850369d36
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/85/311885/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index 9aeb973..78b227f 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -2202,14 +2202,18 @@
 function wmf_civicrm_update_7250() {
   civicrm_initialize();
   CRM_Core_DAO::executeQuery("
-UPDATE civicrm_email SET is_primary = 1
-WHERE id IN (SELECT id FROM
+CREATE TEMPORARY TABLE civicrm_email_updates
+ SELECT id FROM
   (
 SELECT contact_id, sum(is_primary) as c, e.id
 FROM civicrm_email e
 INNER JOIN civicrm_contact c ON c.id = contact_id AND is_deleted = 0
 GROUP BY contact_id HAVING c = 0
   ) as i
-)
+  ");
+
+  CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_email_updates ADD INDEX 
index_id(id)");
+  CRM_Core_DAO::executeQuery("UPDATE civicrm_email e INNER JOIN 
civicrm_email_updates u ON e.id = u.id
+SET e.is_primary = 1
   ");
 }

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: [WIP] SourceFields experiment

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

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

Change subject: [WIP] SourceFields experiment
..

[WIP] SourceFields experiment

Change-Id: I35a801b30a3d2565b1e4d4d1520ffc122d8c7574
---
A CrmLink/Messages/SourceFields.php
M SmashPig.yaml
2 files changed, 44 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/84/311884/1

diff --git a/CrmLink/Messages/SourceFields.php 
b/CrmLink/Messages/SourceFields.php
new file mode 100644
index 000..32fddd7
--- /dev/null
+++ b/CrmLink/Messages/SourceFields.php
@@ -0,0 +1,23 @@
+https://gerrit.wikimedia.org/r/311884
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Toolbox: Mark RecentChangesLinked link as nofollow

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

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

Change subject: Toolbox: Mark RecentChangesLinked link as nofollow
..

Toolbox: Mark RecentChangesLinked link as nofollow

Bug: T146233
Change-Id: I2dd0b3a179dc0d1d7210d98748f45e75f953d2bf
---
M includes/skins/BaseTemplate.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/83/311883/1

diff --git a/includes/skins/BaseTemplate.php b/includes/skins/BaseTemplate.php
index 2d37a0f..87865df 100644
--- a/includes/skins/BaseTemplate.php
+++ b/includes/skins/BaseTemplate.php
@@ -55,7 +55,6 @@
 * @return array
 */
function getToolbox() {
-
$toolbox = [];
if ( isset( $this->data['nav_urls']['whatlinkshere'] )
&& $this->data['nav_urls']['whatlinkshere']
@@ -69,6 +68,7 @@
$toolbox['recentchangeslinked'] = 
$this->data['nav_urls']['recentchangeslinked'];
$toolbox['recentchangeslinked']['msg'] = 
'recentchangeslinked-toolbox';
$toolbox['recentchangeslinked']['id'] = 
't-recentchangeslinked';
+   $toolbox['recentchangeslinked']['rel'] = 'nofollow';
}
if ( isset( $this->data['feeds'] ) && $this->data['feeds'] ) {
$toolbox['feeds']['id'] = 'feedlinks';

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Remove jobrunner01 from deployment-prep

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

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

Change subject: Remove jobrunner01 from deployment-prep
..

Remove jobrunner01 from deployment-prep

Bug: T144006
Change-Id: I8da43f456a160dd0e396f729357e0468df859783
---
M hieradata/labs/deployment-prep/common.yaml
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/17/311717/1

diff --git a/hieradata/labs/deployment-prep/common.yaml 
b/hieradata/labs/deployment-prep/common.yaml
index 5bc0e50..7beed94 100644
--- a/hieradata/labs/deployment-prep/common.yaml
+++ b/hieradata/labs/deployment-prep/common.yaml
@@ -171,7 +171,6 @@
 scap::dsh::groups:
 mediawiki-installation:
 hosts:
-- deployment-jobrunner01.deployment-prep.eqiad.wmflabs
 - deployment-jobrunner02.deployment-prep.eqiad.wmflabs
 - deployment-mediawiki04.deployment-prep.eqiad.wmflabs
 - deployment-mediawiki05.deployment-prep.eqiad.wmflabs

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...MassMessage[master]: MassMessage flow mention fixed

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

Change subject: MassMessage flow mention fixed
..


MassMessage flow mention fixed

Bug: T86812
Change-Id: I4eaf454e8bb9d662a9037532e3be964823c2f42b
---
M MassMessage.hooks.php
1 file changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/MassMessage.hooks.php b/MassMessage.hooks.php
index a61cd01..07d31aa 100644
--- a/MassMessage.hooks.php
+++ b/MassMessage.hooks.php
@@ -137,8 +137,9 @@
 */
public static function onBeforeEchoEventInsert( EchoEvent $event ) {
// Don't spam a user with mention notifications if it's a 
MassMessage
-   if ( $event->getType() == 'mention' && $event->getAgent() && // 
getAgent() can return null
-   $event->getAgent()->getId() == 
MassMessage::getMessengerUser()->getId() ) {
+   if ( ( $event->getType() == 'mention' || $event->getType() == 
'flow-mention' ) &&
+   $event->getAgent() && // getAgent() can return 
null
+   $event->getAgent()->getId() == 
MassMessage::getMessengerUser()->getId() ) {
return false;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4eaf454e8bb9d662a9037532e3be964823c2f42b
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Kmuthu 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Wctaiwan 
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]: Clean up lock name in lock messages in DatabaseMysqlBase

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

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

Change subject: Clean up lock name in lock messages in DatabaseMysqlBase
..

Clean up lock name in lock messages in DatabaseMysqlBase

Change-Id: I9d3eb566f4e4f6d982cbc15df082cf2dd3f9614e
---
M includes/libs/rdbms/database/DatabaseMysqlBase.php
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/82/311882/1

diff --git a/includes/libs/rdbms/database/DatabaseMysqlBase.php 
b/includes/libs/rdbms/database/DatabaseMysqlBase.php
index 7abfb17..627cad0 100644
--- a/includes/libs/rdbms/database/DatabaseMysqlBase.php
+++ b/includes/libs/rdbms/database/DatabaseMysqlBase.php
@@ -968,8 +968,8 @@
 * @since 1.20
 */
public function lockIsFree( $lockName, $method ) {
-   $lockName = $this->addQuotes( $this->makeLockName( $lockName ) 
);
-   $result = $this->query( "SELECT IS_FREE_LOCK($lockName) AS 
lockstatus", $method );
+   $encName = $this->addQuotes( $this->makeLockName( $lockName ) );
+   $result = $this->query( "SELECT IS_FREE_LOCK($encName) AS 
lockstatus", $method );
$row = $this->fetchObject( $result );
 
return ( $row->lockstatus == 1 );
@@ -982,8 +982,8 @@
 * @return bool
 */
public function lock( $lockName, $method, $timeout = 5 ) {
-   $lockName = $this->addQuotes( $this->makeLockName( $lockName ) 
);
-   $result = $this->query( "SELECT GET_LOCK($lockName, $timeout) 
AS lockstatus", $method );
+   $encName = $this->addQuotes( $this->makeLockName( $lockName ) );
+   $result = $this->query( "SELECT GET_LOCK($encName, $timeout) AS 
lockstatus", $method );
$row = $this->fetchObject( $result );
 
if ( $row->lockstatus == 1 ) {
@@ -1004,8 +1004,8 @@
 * @return bool
 */
public function unlock( $lockName, $method ) {
-   $lockName = $this->addQuotes( $this->makeLockName( $lockName ) 
);
-   $result = $this->query( "SELECT RELEASE_LOCK($lockName) as 
lockstatus", $method );
+   $encName = $this->addQuotes( $this->makeLockName( $lockName ) );
+   $result = $this->query( "SELECT RELEASE_LOCK($encName) as 
lockstatus", $method );
$row = $this->fetchObject( $result );
 
if ( $row->lockstatus == 1 ) {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: time: Implement ConvertableTimestamp::convert()

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

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

Change subject: time: Implement ConvertableTimestamp::convert()
..

time: Implement ConvertableTimestamp::convert()

* This method is analogous to wfTimestamp(). Optimise for the common
  idiom of just converting a timestamp without having the caller hold
  on to any object.

* Make wfTimestamp() use this (it could already since it didn't
  use any MWTimestamp methods). Use via MWTimestamp. While this is
  the same as direct access, it allows future changes.

* Add tests covering this new method.

Change-Id: I7f9104f1701d92fe25d72c7943581c64e1d093fa
---
M includes/GlobalFunctions.php
M includes/libs/time/ConvertableTimestamp.php
M tests/phpunit/includes/libs/time/ConvertableTimestampTest.php
3 files changed, 35 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/81/311881/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index e5f518f..7c86db2 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -2003,13 +2003,11 @@
  * @return string|bool String / false The same date in the format specified in 
$outputtype or false
  */
 function wfTimestamp( $outputtype = TS_UNIX, $ts = 0 ) {
-   try {
-   $timestamp = new MWTimestamp( $ts );
-   return $timestamp->getTimestamp( $outputtype );
-   } catch ( TimestampException $e ) {
+   $ret = MWTimestamp::convert( $outputtype, $ts );
+   if ( $ret === false ) {
wfDebug( "wfTimestamp() fed bogus time value: TYPE=$outputtype; 
VALUE=$ts\n" );
-   return false;
}
+   return $ret;
 }
 
 /**
diff --git a/includes/libs/time/ConvertableTimestamp.php 
b/includes/libs/time/ConvertableTimestamp.php
index af7eca6..deb1225 100644
--- a/includes/libs/time/ConvertableTimestamp.php
+++ b/includes/libs/time/ConvertableTimestamp.php
@@ -162,6 +162,22 @@
}
 
/**
+* Convert a timestamp string to a given format.
+*
+* @param int $style Constant Output format for timestamp
+* @param string|bool $ts Timestamp, or false for now
+* @return string|bool Formatted timestamp or false on failure
+*/
+   public static function convert( $style = TS_UNIX, $ts = false ) {
+   try {
+   $ct = new static( $ts );
+   return $ct->getTimestamp( $style );
+   } catch ( TimestampException $e ) {
+   return false;
+   }
+   }
+
+   /**
 * Get the timestamp represented by this object in a certain form.
 *
 * Convert the internal timestamp to the specified format and then
diff --git a/tests/phpunit/includes/libs/time/ConvertableTimestampTest.php 
b/tests/phpunit/includes/libs/time/ConvertableTimestampTest.php
index 88c2989..26ed708 100644
--- a/tests/phpunit/includes/libs/time/ConvertableTimestampTest.php
+++ b/tests/phpunit/includes/libs/time/ConvertableTimestampTest.php
@@ -72,6 +72,22 @@
}
 
/**
+* @dataProvider provideValidTimestamps
+* @covers ConvertableTimestamp::convert
+*/
+   public function testConvert( $format, $expected, $original ) {
+   $this->assertSame( $expected, ConvertableTimestamp::convert( 
$format, $original ) );
+   }
+
+   /**
+* Format an invalid timestamp.
+* @covers ConvertableTimestamp::convert
+*/
+   public function testConvertInvalid() {
+   $this->assertSame( false, ConvertableTimestamp::convert( 'Not a 
timestamp' ) );
+   }
+
+   /**
 * Test an out of range timestamp
 * @dataProvider provideOutOfRangeTimestamps
 * @expectedException TimestampException

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...PageTriage[master]: Fix check for content text, so falsy values (e.g. the string...

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

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

Change subject: Fix check for content text, so falsy values (e.g. the string 
'0') do not prevent metadata generation.
..

Fix check for content text, so falsy values (e.g. the string '0')
do not prevent metadata generation.

Change-Id: Ie505bfe26b7b52c843ef6dadc8777f22d147a36e
---
M includes/ArticleMetadata.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageTriage 
refs/changes/80/311880/1

diff --git a/includes/ArticleMetadata.php b/includes/ArticleMetadata.php
index 75d1d3a..8bdcbe9 100755
--- a/includes/ArticleMetadata.php
+++ b/includes/ArticleMetadata.php
@@ -727,7 +727,7 @@
if ( $article ) {
$content = $article->getContent();
$text = ContentHandler::getContentText( 
$content );
-   if ( $text ) {
+   if ( $text !== null ) {
$this->metadata[$pageId]['snippet'] = 
self::generateArticleSnippet( $text );
$this->metadata[$pageId]['reference'] = 
self::checkReferenceTag( $text );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie505bfe26b7b52c843ef6dadc8777f22d147a36e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTriage
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use Status::isOK() method in FileDeleteForm

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

Change subject: Use Status::isOK() method in FileDeleteForm
..


Use Status::isOK() method in FileDeleteForm

Change-Id: I3c21ee1f0ecc402ddba6e740a67ed143ece0
---
M includes/FileDeleteForm.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php
index 65638f2..47360df 100644
--- a/includes/FileDeleteForm.php
+++ b/includes/FileDeleteForm.php
@@ -125,7 +125,7 @@
$status->getWikiText( 
'filedeleteerror-short', 'filedeleteerror-long' )
. '' );
}
-   if ( $status->ok ) {
+   if ( $status->isOK() ) {
$wgOut->setPageTitle( wfMessage( 
'actioncomplete' ) );
$wgOut->addHTML( $this->prepareMessage( 
'filedelete-success' ) );
// Return to the main page if we just deleted 
all versions of the

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3c21ee1f0ecc402ddba6e740a67ed143ece0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Catrope 
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/portals[master]: Align UI elements to improved WCAG compliant color palette

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

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

Change subject: Align UI elements to improved WCAG compliant color palette
..

Align UI elements to improved WCAG compliant color palette

Aligning user-interface elements of the Wikimedia Portal to improved
WCAG compliant color palette https://phabricator.wikimedia.org/M82
similar to
https://phabricator.wikimedia.org/rGOJUed9fef533beaf2191f1ea718a3210831541305d7
Integrating variables of v0.6.1 of 
https://phabricator.wikimedia.org/diffusion/WMUI/
to get the job done correctly.
Also removing obsolete `constructive` buttons - there are no `constructive` 
buttons
any more in our user interface (concepts).

Bug: T146231
Change-Id: Idbd1b01e5d7b0e2700c106a678624972443aa6de
---
M dev/wikipedia.org/assets/postcss/_buttons.css
M dev/wikipedia.org/assets/postcss/_lang-dropdown.css
M dev/wikipedia.org/assets/postcss/_vars.css
M dev/wikipedia.org/assets/postcss/_wm-portal.css
4 files changed, 183 insertions(+), 109 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/portals 
refs/changes/79/311879/1

diff --git a/dev/wikipedia.org/assets/postcss/_buttons.css 
b/dev/wikipedia.org/assets/postcss/_buttons.css
index cdc8883..6b1213f 100644
--- a/dev/wikipedia.org/assets/postcss/_buttons.css
+++ b/dev/wikipedia.org/assets/postcss/_buttons.css
@@ -22,14 +22,14 @@
 box-sizing: border-box;
 
 /* from OOjs UI */
-background-color: #fff;
-color: #555;
+background-color: var( --background-color-framed );
+color: var( --color-base );
 position: relative;
 min-height: 1.2em;
 min-width: 1em;
 margin: 0.1em 0;
-border: 1px solid #cdcdcd;
-border-radius: 2px;
+border: var( --border-base );
+border-radius: var( --border-radius-base );
 padding: 0.5em 1em;
 font-family: inherit;
 font-size: inherit;
@@ -47,18 +47,20 @@
 
 .pure-button-hover,
 .pure-button:hover {
-background-color: #ebebeb;
-outline: 0;
-}
-.pure-button:focus {
-outline: 0;
-box-shadow: inset 0 0 0 1px rgba( 0, 0, 0, 0.2 );
+background-color: var( --background-color-framed-hover );
+color: var( --color-base-hover );
+border-color: var( --border-color-base-hover );
 }
 .pure-button-active,
 .pure-button:active {
 background-color: #d9d9d9;
-border-color: #d9d9d9;
-box-shadow: none;
+color: var( --color-base-active );
+border-color: var( --border-color-base-active );
+}
+.pure-button:focus {
+border-color: var( --color-progressive-focus );
+box-shadow: var( --box-shadow-base-focus );
+outline: 0;
 }
 
 .pure-button[disabled],
@@ -98,7 +100,7 @@
 /*.pure-button-selected,*/
 /*a.pure-button-primary,*/
 /*a.pure-button-selected {*/
-/*background-color: var( --c-primary );*/
+/*background-color: var( --color-primary );*/
 /*color: #fff;*/
 /*}*/
 
@@ -106,50 +108,9 @@
 color: #fff;
 }
 
-/* Constructive Buttons */
-.pure-button-constructive {
-color: #00af89;
-}
-.pure-button-constructive:hover {
-background-color: #00af89;
-background-color: rgba( 0, 171, 137, 0.1 );
-border-color: #00af89;
-border-color: #00af89 rgba( 0, 89, 70, 0.5 );
-}
-.pure-button-constructive:active {
-color: #005946;
-border-color: #005946;
-box-shadow: none;
-}
-.pure-button-constructive:focus {
-box-shadow: inset 0 0 0 1px #005946;
-border-color: #005946;
-}
-
-.pure-button-primary-constructive {
-color: #fff;
-background-color: #00af89;
-border-color: #00af89;
-}
-.pure-button-primary-constructive:hover {
-background: #008064;
-border-color: #008064;
-}
-.pure-button-primary-constructive:active {
-color: #fff;
-background-color: #005946;
-border-color: #005946;
-box-shadow: none;
-
-}
-.pure-button-primary-constructive:focus {
-box-shadow: inset 0 0 0 1px #fff;
-border-color: #00af89;
-}
-
 /* Destructive Buttons */
 .pure-button-destructive {
-color: #d11d13;
+color: var( --color-destructive );
 }
 .pure-button-destructive:hover {
 background-color: #73100a;
@@ -158,72 +119,72 @@
 border-color: rgba( 115, 16, 10, 0.5 );
 }
 .pure-button-destructive:active {
-color: #73100a;
-border-color: #73100a;
+color: #873636;
+border-color: #873636;
 box-shadow: none;
 }
 .pure-button-destructive:focus {
-box-shadow: inset 0 0 0 1px #73100a;
-border-color: #73100a;
+box-shadow: inset 0 0 0 1px var( --color-destructive );
+border-color: var( --color-destructive );
 }
 
 .pure-button-primary-destructive {
-color: #fff;
-background-color: #d11d13;
-border-color: #d11d13;
+color: var( --color-base-contrast );
+background-color: var( --color-destructive );
+border-color: var( --color-destructive );
 }
 .pure-button-primary-destructive:hover {
-background: #8c130d;
-border-color: #8c130d;
+background: #e53939;
+border-color: 

[MediaWiki-commits] [Gerrit] mediawiki...AntiSpoof[master]: Allow the special string «NUL» to replace a literal byte \x0...

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

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

Change subject: Allow the special string «NUL» to replace a literal byte \x00 
on equivset.in
..

Allow the special string «NUL» to replace a literal byte \x00 on equivset.in

A literal NUL in the file forbid storing it on MediaWiki and made
some text editors unable to edit the file (if not producing a truncation).

Change-Id: I56904fbf4c0d9ac3d4ca9562713dbf459d03b44c
---
M maintenance/equivset.in
M maintenance/generateEquivset.php
2 files changed, 31 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AntiSpoof 
refs/changes/78/311878/1

diff --git a/maintenance/equivset.in b/maintenance/equivset.in
index 055ed7d..e37d9a5 100644
--- a/maintenance/equivset.in
+++ b/maintenance/equivset.in
@@ -854,7 +854,7 @@
 20A6 ₦ => 4E N
 20A7 ₧ => 50 P
 20A9 â‚© => 57 W
-200B ​ => 0 
+200B ​ => 0 NUL
 2127 ℧ => 1B1 Ʊ
 2146 â…† => 44 D
 217C â…¼ => 4C L
diff --git a/maintenance/generateEquivset.php b/maintenance/generateEquivset.php
index 31104d9..db40e43 100644
--- a/maintenance/generateEquivset.php
+++ b/maintenance/generateEquivset.php
@@ -65,7 +65,7 @@
++$lineNum;
$mapToEmpty = false;
 
-   # Whether the line ends with a null character
+   # Whether the line ends with a nul character
$mapToEmpty = ( strpos( $line, "\0" ) === strlen( $line 
) - 2 );
 
$line = trim( $line );
@@ -85,37 +85,36 @@
}
$error = false;
 
-   if ( $mapToEmpty ) {
+   if ( codepointToUtf8( hexdec( $m['hexleft'] ) ) != 
$m['charleft'] ) {
+   $actual = utf8ToCodepoint( $m['charleft'] );
+   if ( $actual === false ) {
+   $this->output( "Bytes: " . strlen( 
$m['charleft'] ) . "\n" );
+   $this->output( bin2hex( $line ) . "\n" 
);
+   $hexForm = bin2hex( $m['charleft'] );
+   $this->output( "Invalid UTF-8 character 
\"{$m['charleft']}\" ($hexForm) at line $lineNum: $line\n" );
+   } else {
+   $this->output( "Error: left number 
({$m['hexleft']}) does not match left character ($actual) " .
+   "at line $lineNum: 
$line\n" );
+   }
+   $error = true;
+   }
+   if ( !empty( $m['hexright'] ) && codepointToUtf8( 
hexdec( $m['hexright'] ) ) != $m['charright'] ) {
+   $actual = utf8ToCodepoint( $m['charright'] );
+   if ( $actual === false ) {
+   $hexForm = bin2hex( $m['charright'] );
+   $this->output( "Invalid UTF-8 character 
\"{$m['charleft']}\" ($hexForm) at line $lineNum: $line\n" );
+   } else {
+   $this->output( "Error: right number 
({$m['hexright']}) does not match right character ($actual) " .
+   "at line $lineNum: 
$line\n" );
+   }
+   $error = true;
+   }
+   if ( $error ) {
+   $exitStatus = 1;
+   continue;
+   }
+   if ( $mapToEmpty || $m['charright'] == 'NUL' ) {
$m['charright'] = '';
-   } else {
-   if ( codepointToUtf8( hexdec( $m['hexleft'] ) ) 
!= $m['charleft'] ) {
-   $actual = utf8ToCodepoint( 
$m['charleft'] );
-   if ( $actual === false ) {
-   $this->output( "Bytes: " . 
strlen( $m['charleft'] ) . "\n" );
-   $this->output( bin2hex( $line ) 
. "\n" );
-   $hexForm = bin2hex( 
$m['charleft'] );
-   $this->output( "Invalid UTF-8 
character \"{$m['charleft']}\" ($hexForm) at line $lineNum: $line\n" );
-   } else {
-   $this->output( "Error: left 
number ({$m['hexleft']}) does not match left character ($actual) " .
-   "at line 
$lineNum: $line\n" );
-   }
-  

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: New wikitext editor: Enable the Beta Feature in Beta Cluster

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

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

Change subject: New wikitext editor: Enable the Beta Feature in Beta Cluster
..

New wikitext editor: Enable the Beta Feature in Beta Cluster

Change-Id: Iaa67ca519868c51005b4ec0097d4379c601e0450
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings-labs.php
M wmf-config/InitialiseSettings.php
3 files changed, 14 insertions(+), 1 deletion(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 7a6fc43..d1587d8 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2154,6 +2154,9 @@
$wgVisualEditorTabPosition = 'after';
}
}
+   if ( $wmgVisualEditorEnableWikitext ) {
+   $wgVisualEditorEnableWikitext = true;
+   }
 
// Namespace configuration
$wgVisualEditorAvailableNamespaces = 
$wmgVisualEditorAvailableNamespaces;
diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index cb9ce27..1ad6aca 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -319,6 +319,9 @@
'wmgVisualEditorTransitionDefault' => [
'default' => false,
],
+   'wmgVisualEditorEnableWikitext' => [
+   'default' => true,
+   ],
 
///
///  BetaFeatures end ---
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 45d0768..fc164e9 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -13697,7 +13697,8 @@
'enwiki' => true, // T132806
 ],
 
-// Whether VisualEditor's second tab and section link come after those for 
wikitext (on non-SET wikis)
+// Whether VisualEditor's second tab and section link come after (rather than 
before) those for
+// wikitext (on non-SET wikis)
 'wmgVisualEditorSecondaryTabs' => [
'default' => false,
'enwiki' => true,
@@ -13705,6 +13706,12 @@
'hewiki' => true, // T54552
 ],
 
+// Whether to enable the 2017 wikitext editor alongside the visual editor. 
This is a feature flag
+// on top of the Beta Feature which needs each user to opt-in (once it's added 
to the whitelist).
+'wmgVisualEditorEnableWikitext' => [
+   'default' => false,
+],
+
 // Namespaces for VisualEditor to be active in, as well as wgContentNamespaces
 'wmgVisualEditorAvailableNamespaces' => [
'default' => [

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: jsduck: Remove custom @source tag

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

Change subject: jsduck: Remove custom @source tag
..


jsduck: Remove custom @source tag

Only used in external.js to render a simple link. These methods
don't have a regular description and as such the link renders
effectively the same way in the same place without `@source`.

Change-Id: I83cd524b6b53e67c5c2d18258c804ebd49a29b74
---
M .jscsrc
M jsduck.external.js
M jsduck_custom_tags.rb
3 files changed, 10 insertions(+), 27 deletions(-)

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



diff --git a/.jscsrc b/.jscsrc
index 91dcadb..4bb4c0c 100644
--- a/.jscsrc
+++ b/.jscsrc
@@ -6,7 +6,6 @@
"preset": "jsduck5",
"extra": {
"mixin": false,
-   "source": true,
"todo": true,
"see": true
}
diff --git a/jsduck.external.js b/jsduck.external.js
index 907869c..14eb9e8 100644
--- a/jsduck.external.js
+++ b/jsduck.external.js
@@ -1,47 +1,48 @@
 /**
+ * Source: 
  * @class jQuery
- * 
  */
 
 /**
+ * Source: 
  * @method ajax
- * @source 
+ * @static
  * @return {jqXHR}
  */
 
 /**
+ * Source: 
  * @class jQuery.Event
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.Promise
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.Deferred
  * @mixins jQuery.Promise
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.jqXHR
- * @source 
  * @alternateClassName jqXHR
  */
 
 /**
+ * Source: 
  * @class mw.Api
- * @source 
  */
 
 /**
+ * Source: 

  * @class mw.Title
- * @source 
  */
diff --git a/jsduck_custom_tags.rb b/jsduck_custom_tags.rb
index 083f45a..6a4da00 100644
--- a/jsduck_custom_tags.rb
+++ b/jsduck_custom_tags.rb
@@ -31,23 +31,6 @@
   end
 end
 
-class SourceTag < CommonTag
-  def initialize
-@tagname = :source
-@pattern = 'source'
-super
-  end
-
-  def to_html(context)
-context[@tagname].map do |source|
-  <<-EOHTML
-Source
-#{source[:doc]}
-  EOHTML
-end.join
-  end
-end
-
 class SeeTag < CommonTag
   def initialize
 @tagname = :see

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I83cd524b6b53e67c5c2d18258c804ebd49a29b74
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: jsduck: Remove custom @source tag

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

Change subject: jsduck: Remove custom @source tag
..


jsduck: Remove custom @source tag

Only used in external.js to render a simple link. These methods
don't have a regular description and as such the link renders
effectively the same way in the same place without `@source`.

Also:
* Add missing '@static' to jQuery.ajax (matches MediaWiki core).
* Add 'docs/' to .gitignore to avoid a dirty state after
  running 'npm run doc'.

Change-Id: I83cd524b6b53e67c5c2d18258c804ebd49a29b74
---
M .gitignore
M jsduck.external.js
M jsduck_custom_tags.rb
3 files changed, 13 insertions(+), 28 deletions(-)

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



diff --git a/.gitignore b/.gitignore
index 35d2258..f53c5df 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@
 vendor/autoload.php
 \#*#
 /composer.lock
+/docs
diff --git a/jsduck.external.js b/jsduck.external.js
index 8c5c469..9684cc1 100644
--- a/jsduck.external.js
+++ b/jsduck.external.js
@@ -1,58 +1,59 @@
 /**
+ * Source: 
  * @class jQuery
- * 
  */
 
 /**
+ * Source: 
  * @method ajax
- * @source 
+ * @static
  * @return {jqXHR}
  */
 
 /**
+ * Source: 
  * @class jQuery.Event
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.Promise
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.Deferred
  * @mixins jQuery.Promise
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.jqXHR
- * @source 
  * @alternateClassName jqXHR
  */
 
 /**
+ * Source: 
  * @class mw.Api
- * @source 
  */
 
 /**
+ * Source: 

  * @class mw.Title
- * @source 
  */
 
 /**
+ * Source: 
  * @class Handlebars
- * 
  */
 
 /**
+ * Source: 
  * @class Handlebars.SafeString
- * 
  */
 
diff --git a/jsduck_custom_tags.rb b/jsduck_custom_tags.rb
index 96b1ea6..e6b19ed 100644
--- a/jsduck_custom_tags.rb
+++ b/jsduck_custom_tags.rb
@@ -31,23 +31,6 @@
   end
 end
 
-class SourceTag < CommonTag
-  def initialize
-@tagname = :source
-@pattern = "source"
-super
-  end
-
-  def to_html(context)
-context[@tagname].map do |source|
-  <<-EOHTML
-Source
-#{source[:doc]}
-  EOHTML
-end.join
-  end
-end
-
 class UntilTag < CommonTag
   def initialize
 @tagname = :until

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I83cd524b6b53e67c5c2d18258c804ebd49a29b74
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: jsduck: Remove custom @source tag

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

Change subject: jsduck: Remove custom @source tag
..


jsduck: Remove custom @source tag

Only used in external.js to render a simple link. These methods
don't have a regular description and as such the link renders
effectively the same way in the same place without `@source`.

Change-Id: I83cd524b6b53e67c5c2d18258c804ebd49a29b74
---
M .jscsrc
M maintenance/jsduck/custom_tags.rb
M maintenance/jsduck/external.js
3 files changed, 8 insertions(+), 26 deletions(-)

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



diff --git a/.jscsrc b/.jscsrc
index f3db218..3f7e90d 100644
--- a/.jscsrc
+++ b/.jscsrc
@@ -10,7 +10,6 @@
"preset": "jsduck5",
"extra": {
"context": "some",
-   "source": "some",
"see": "some"
}
},
diff --git a/maintenance/jsduck/custom_tags.rb 
b/maintenance/jsduck/custom_tags.rb
index 33008d1..21cb658 100644
--- a/maintenance/jsduck/custom_tags.rb
+++ b/maintenance/jsduck/custom_tags.rb
@@ -30,23 +30,6 @@
   end
 end
 
-class SourceTag < CommonTag
-  def initialize
-@tagname = :source
-@pattern = 'source'
-super
-  end
-
-  def to_html(context)
-context[@tagname].map do |source|
-  <<-EOHTML
-Source
-#{source[:doc]}
-  EOHTML
-end.join
-  end
-end
-
 class SeeTag < CommonTag
   def initialize
 @tagname = :see
diff --git a/maintenance/jsduck/external.js b/maintenance/jsduck/external.js
index c901240..1613111 100644
--- a/maintenance/jsduck/external.js
+++ b/maintenance/jsduck/external.js
@@ -1,43 +1,43 @@
 /**
+ * Source: 
  * @class jQuery
- * @source 
  */
 
 /**
+ * Source: 
  * @method ajax
  * @static
- * @source 
  * @return {jqXHR}
  */
 
 /**
+ * Source: 
  * @class jQuery.Event
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.Callbacks
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.Promise
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.Deferred
  * @mixins jQuery.Promise
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.jqXHR
- * @source 
  * @alternateClassName jqXHR
  */
 
 /**
+ * Source: 
  * @class QUnit
- * @source 
  */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I83cd524b6b53e67c5c2d18258c804ebd49a29b74
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: TTO 
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...Flow[master]: jsduck: Remove custom @source tag

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

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

Change subject: jsduck: Remove custom @source tag
..

jsduck: Remove custom @source tag

Only used in external.js to render a simple link. These methods
don't have a regular description and as such the link renders
effectively the same way in the same place without `@source`.

Also:
* Add missing '@static' to jQuery.ajax (matches MediaWiki core).
* Add 'docs/' to .gitignore to avoid a dirty state after
  running 'npm run doc'.

Change-Id: I83cd524b6b53e67c5c2d18258c804ebd49a29b74
---
M .gitignore
M jsduck.external.js
M jsduck_custom_tags.rb
3 files changed, 13 insertions(+), 28 deletions(-)


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

diff --git a/.gitignore b/.gitignore
index 35d2258..f53c5df 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@
 vendor/autoload.php
 \#*#
 /composer.lock
+/docs
diff --git a/jsduck.external.js b/jsduck.external.js
index 8c5c469..9684cc1 100644
--- a/jsduck.external.js
+++ b/jsduck.external.js
@@ -1,58 +1,59 @@
 /**
+ * Source: 
  * @class jQuery
- * 
  */
 
 /**
+ * Source: 
  * @method ajax
- * @source 
+ * @static
  * @return {jqXHR}
  */
 
 /**
+ * Source: 
  * @class jQuery.Event
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.Promise
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.Deferred
  * @mixins jQuery.Promise
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.jqXHR
- * @source 
  * @alternateClassName jqXHR
  */
 
 /**
+ * Source: 
  * @class mw.Api
- * @source 
  */
 
 /**
+ * Source: 

  * @class mw.Title
- * @source 
  */
 
 /**
+ * Source: 
  * @class Handlebars
- * 
  */
 
 /**
+ * Source: 
  * @class Handlebars.SafeString
- * 
  */
 
diff --git a/jsduck_custom_tags.rb b/jsduck_custom_tags.rb
index 96b1ea6..e6b19ed 100644
--- a/jsduck_custom_tags.rb
+++ b/jsduck_custom_tags.rb
@@ -31,23 +31,6 @@
   end
 end
 
-class SourceTag < CommonTag
-  def initialize
-@tagname = :source
-@pattern = "source"
-super
-  end
-
-  def to_html(context)
-context[@tagname].map do |source|
-  <<-EOHTML
-Source
-#{source[:doc]}
-  EOHTML
-end.join
-  end
-end
-
 class UntilTag < CommonTag
   def initialize
 @tagname = :until

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: jsduck: Remove custom @source tag

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

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

Change subject: jsduck: Remove custom @source tag
..

jsduck: Remove custom @source tag

Only used in external.js to render a simple link. These methods
don't have a regular description and as such the link renders
effectively the same way in the same place without `@source`.

Change-Id: I83cd524b6b53e67c5c2d18258c804ebd49a29b74
---
M .jscsrc
M jsduck.external.js
M jsduck_custom_tags.rb
3 files changed, 10 insertions(+), 27 deletions(-)


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

diff --git a/.jscsrc b/.jscsrc
index 91dcadb..4bb4c0c 100644
--- a/.jscsrc
+++ b/.jscsrc
@@ -6,7 +6,6 @@
"preset": "jsduck5",
"extra": {
"mixin": false,
-   "source": true,
"todo": true,
"see": true
}
diff --git a/jsduck.external.js b/jsduck.external.js
index 907869c..14eb9e8 100644
--- a/jsduck.external.js
+++ b/jsduck.external.js
@@ -1,47 +1,48 @@
 /**
+ * Source: 
  * @class jQuery
- * 
  */
 
 /**
+ * Source: 
  * @method ajax
- * @source 
+ * @static
  * @return {jqXHR}
  */
 
 /**
+ * Source: 
  * @class jQuery.Event
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.Promise
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.Deferred
  * @mixins jQuery.Promise
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.jqXHR
- * @source 
  * @alternateClassName jqXHR
  */
 
 /**
+ * Source: 
  * @class mw.Api
- * @source 
  */
 
 /**
+ * Source: 

  * @class mw.Title
- * @source 
  */
diff --git a/jsduck_custom_tags.rb b/jsduck_custom_tags.rb
index 083f45a..6a4da00 100644
--- a/jsduck_custom_tags.rb
+++ b/jsduck_custom_tags.rb
@@ -31,23 +31,6 @@
   end
 end
 
-class SourceTag < CommonTag
-  def initialize
-@tagname = :source
-@pattern = 'source'
-super
-  end
-
-  def to_html(context)
-context[@tagname].map do |source|
-  <<-EOHTML
-Source
-#{source[:doc]}
-  EOHTML
-end.join
-  end
-end
-
 class SeeTag < CommonTag
   def initialize
 @tagname = :see

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Mention the lock name in DatabaseMysqlBase lock() errors

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

Change subject: Mention the lock name in DatabaseMysqlBase lock() errors
..


Mention the lock name in DatabaseMysqlBase lock() errors

Also use warning() instead of debug()

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

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



diff --git a/includes/libs/rdbms/database/DatabaseMysqlBase.php 
b/includes/libs/rdbms/database/DatabaseMysqlBase.php
index 9be3ede..7abfb17 100644
--- a/includes/libs/rdbms/database/DatabaseMysqlBase.php
+++ b/includes/libs/rdbms/database/DatabaseMysqlBase.php
@@ -991,7 +991,7 @@
return true;
}
 
-   $this->queryLogger->debug( __METHOD__ . " failed to acquire 
lock\n" );
+   $this->queryLogger->warning( __METHOD__ . " failed to acquire 
lock '$lockName'\n" );
 
return false;
}
@@ -1013,7 +1013,7 @@
return true;
}
 
-   $this->queryLogger->debug( __METHOD__ . " failed to release 
lock\n" );
+   $this->queryLogger->warning( __METHOD__ . " failed to release 
lock '$lockName'\n" );
 
return false;
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove Database clone call from DatabaseTests.php

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

Change subject: Remove Database clone call from DatabaseTests.php
..


Remove Database clone call from DatabaseTests.php

Change-Id: I60a22de9ccc7253abc9bbefe2a4f38675655ee4f
---
M includes/libs/rdbms/database/Database.php
M tests/phpunit/includes/db/DatabaseTest.php
2 files changed, 17 insertions(+), 15 deletions(-)

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



diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index deaa396..9993277 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -3525,7 +3525,7 @@
 * @throws DBConnectionError
 */
public function __clone() {
-   $this->connLogger->debug(
+   $this->connLogger->warning(
"Cloning " . get_class( $this ) . " is not recomended; 
forking connection:\n" .
( new RuntimeException() )->getTraceAsString()
);
diff --git a/tests/phpunit/includes/db/DatabaseTest.php 
b/tests/phpunit/includes/db/DatabaseTest.php
index 846509c..48dc332 100644
--- a/tests/phpunit/includes/db/DatabaseTest.php
+++ b/tests/phpunit/includes/db/DatabaseTest.php
@@ -359,24 +359,26 @@
$origTrx = $db->getFlag( DBO_TRX );
$origSsl = $db->getFlag( DBO_SSL );
 
-   if ( $origTrx ) {
-   $db->clearFlag( DBO_TRX, $db::REMEMBER_PRIOR );
-   } else {
-   $db->setFlag( DBO_TRX, $db::REMEMBER_PRIOR );
-   }
+   $origTrx
+   ? $db->clearFlag( DBO_TRX, $db::REMEMBER_PRIOR )
+   : $db->setFlag( DBO_TRX, $db::REMEMBER_PRIOR );
$this->assertEquals( !$origTrx, $db->getFlag( DBO_TRX ) );
 
-   if ( $origSsl ) {
-   $db->clearFlag( DBO_SSL, $db::REMEMBER_PRIOR );
-   } else {
-   $db->setFlag( DBO_SSL, $db::REMEMBER_PRIOR );
-   }
+   $origSsl
+   ? $db->clearFlag( DBO_SSL, $db::REMEMBER_PRIOR )
+   : $db->setFlag( DBO_SSL, $db::REMEMBER_PRIOR );
$this->assertEquals( !$origSsl, $db->getFlag( DBO_SSL ) );
 
-   $db2 = clone $db;
-   $db2->restoreFlags( $db::RESTORE_INITIAL );
-   $this->assertEquals( $origTrx, $db2->getFlag( DBO_TRX ) );
-   $this->assertEquals( $origSsl, $db2->getFlag( DBO_SSL ) );
+   $db->restoreFlags( $db::RESTORE_INITIAL );
+   $this->assertEquals( $origTrx, $db->getFlag( DBO_TRX ) );
+   $this->assertEquals( $origSsl, $db->getFlag( DBO_SSL ) );
+
+   $origTrx
+   ? $db->clearFlag( DBO_TRX, $db::REMEMBER_PRIOR )
+   : $db->setFlag( DBO_TRX, $db::REMEMBER_PRIOR );
+   $origSsl
+   ? $db->clearFlag( DBO_SSL, $db::REMEMBER_PRIOR )
+   : $db->setFlag( DBO_SSL, $db::REMEMBER_PRIOR );
 
$db->restoreFlags();
$this->assertEquals( $origSsl, $db->getFlag( DBO_SSL ) );

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Test PayPal verified message transform

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

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

Change subject: Test PayPal verified message transform
..

Test PayPal verified message transform

This will probably need to change depending on what an actually valid
message looks like

Change-Id: I67f5a3fbea48a04cdf910fc317d750b3d9c142e0
---
A PaymentProviders/PayPal/Tests/Data/web_accept.transformed.json
M PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
2 files changed, 36 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/74/311874/1

diff --git a/PaymentProviders/PayPal/Tests/Data/web_accept.transformed.json 
b/PaymentProviders/PayPal/Tests/Data/web_accept.transformed.json
new file mode 100644
index 000..780cc22
--- /dev/null
+++ b/PaymentProviders/PayPal/Tests/Data/web_accept.transformed.json
@@ -0,0 +1,21 @@
+{
+"correlationId": "",
+"date": 1471069727,
+"txn_type": "web_accept",
+"payment_status": "Completed",
+"gateway_refund_id": "J",
+"gross_currency": "USD",
+"contribution_tracking_id": "",
+"email": "no...@example.com",
+"first_name": "thanks",
+"last_name": "bobby",
+"supplemental_address_1": "hell no",
+"city_2": "Zurich",
+"state_province_2": "",
+"country_2": "CH",
+"postal_code_2": "8032",
+"supplemental_address_2": "where indeed",
+"gross": "7.00",
+"fee": "0.44",
+"gateway": "paypal"
+}
diff --git 
a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 
b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
index 740acdf..e04d02d 100644
--- a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
+++ b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
@@ -22,6 +22,7 @@
 */
public $config;
static $verified_msg;
+   static $transformed_msg;
 
public function setUp() {
parent::setUp();
@@ -31,18 +32,19 @@
file_get_contents( __DIR__ . '/../Data/web_accept.json' 
),
true
);
-   }
-
-   private function capture ( $msg ) {
-   $request = new Request( $msg );
-   $response = new Response;
-   $listener = new Listener;
-   $listener->execute( $request, $response );
+   self::$transformed_msg = json_decode(
+   file_get_contents(
+   __DIR__ . 
'/../Data/web_accept.transformed.json' ),
+   true
+   );
}
 
public function testCapture() {
 
-   $this->capture( self::$verified_msg );
+   $request = new Request( self::$verified_msg );
+   $response = new Response;
+   $listener = new Listener;
+   $listener->execute( $request, $response );
 
// TODO why get it from BaseQueueConsumer instead of config?
$jobQueue = BaseQueueConsumer::getQueue( 'jobs-paypal' );
@@ -57,15 +59,12 @@
 
public function testConsume () {
 
-   $this->capture( self::$verified_msg );
-
-   // TODO DRY?
-   $jobQueue = BaseQueueConsumer::getQueue( 'jobs-paypal' );
-   $jobMessage = $jobQueue->pop();
+   $msg = array();
+   $msg['payload'] = self::$verified_msg;
 
$job = KeyedOpaqueStorableObject::fromJsonProxy(
-   $jobMessage['php-message-class'],
-   json_encode( $jobMessage )
+   'SmashPig\PaymentProviders\PayPal\Job',
+   json_encode( $msg )
);
 
$job->execute();
@@ -73,7 +72,7 @@
$verifiedQueue = $this->config->object( 'data-store/verified' );
$verifiedMessage = $verifiedQueue->pop();
 
-   $this->assertNotEmpty( $verifiedMessage );
+   $this->assertEquals( $verifiedMessage, self::$transformed_msg );
 
}
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: jsduck: Remove custom @source tag

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

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

Change subject: jsduck: Remove custom @source tag
..

jsduck: Remove custom @source tag

Only used in external.js to render a simple link. These methods
don't have a regular description and as such the link renders
effectively the same way in the same place without `@source`.

Change-Id: I83cd524b6b53e67c5c2d18258c804ebd49a29b74
---
M .jscsrc
M maintenance/jsduck/custom_tags.rb
M maintenance/jsduck/external.js
3 files changed, 8 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/73/311873/1

diff --git a/.jscsrc b/.jscsrc
index f3db218..3f7e90d 100644
--- a/.jscsrc
+++ b/.jscsrc
@@ -10,7 +10,6 @@
"preset": "jsduck5",
"extra": {
"context": "some",
-   "source": "some",
"see": "some"
}
},
diff --git a/maintenance/jsduck/custom_tags.rb 
b/maintenance/jsduck/custom_tags.rb
index 33008d1..21cb658 100644
--- a/maintenance/jsduck/custom_tags.rb
+++ b/maintenance/jsduck/custom_tags.rb
@@ -30,23 +30,6 @@
   end
 end
 
-class SourceTag < CommonTag
-  def initialize
-@tagname = :source
-@pattern = 'source'
-super
-  end
-
-  def to_html(context)
-context[@tagname].map do |source|
-  <<-EOHTML
-Source
-#{source[:doc]}
-  EOHTML
-end.join
-  end
-end
-
 class SeeTag < CommonTag
   def initialize
 @tagname = :see
diff --git a/maintenance/jsduck/external.js b/maintenance/jsduck/external.js
index c901240..1613111 100644
--- a/maintenance/jsduck/external.js
+++ b/maintenance/jsduck/external.js
@@ -1,43 +1,43 @@
 /**
+ * Source: 
  * @class jQuery
- * @source 
  */
 
 /**
+ * Source: 
  * @method ajax
  * @static
- * @source 
  * @return {jqXHR}
  */
 
 /**
+ * Source: 
  * @class jQuery.Event
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.Callbacks
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.Promise
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.Deferred
  * @mixins jQuery.Promise
- * @source 
  */
 
 /**
+ * Source: 
  * @class jQuery.jqXHR
- * @source 
  * @alternateClassName jqXHR
  */
 
 /**
+ * Source: 
  * @class QUnit
- * @source 
  */

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Update for primaries not set.

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

Change subject: Update for primaries not set.
..


Update for primaries not set.

Bug: T143062
Change-Id: I863d09ea41fc2768901624ba3c0693c6106ac4c0
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 25 insertions(+), 0 deletions(-)

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



diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index 1d84e5b..9aeb973 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -2188,3 +2188,28 @@
   civicrm_initialize();
   CRM_Core_DAO::executeQuery("DELETE FROM civicrm_email WHERE email = 
'nob...@wikimedia.org'");
 }
+
+/**
+ * Fix contacts who have no primary - this has arisen from the dedupes.
+ *
+ * I'll probably run this again once I've fixed dedupe to stop creating them
+ * but this fixes the ~1 contacts who currently don't have an address 
marked as primary.
+ *
+ * Staging : (9 min 16.83 sec)
+ *
+ * Bug: T143062
+ */
+function wmf_civicrm_update_7250() {
+  civicrm_initialize();
+  CRM_Core_DAO::executeQuery("
+UPDATE civicrm_email SET is_primary = 1
+WHERE id IN (SELECT id FROM
+  (
+SELECT contact_id, sum(is_primary) as c, e.id
+FROM civicrm_email e
+INNER JOIN civicrm_contact c ON c.id = contact_id AND is_deleted = 0
+GROUP BY contact_id HAVING c = 0
+  ) as i
+)
+  ");
+}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...AntiSpoof[master]: Update Makefile

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

Change subject: Update Makefile
..


Update Makefile

Don't copy files before generating them and change
 svn to git and url from http:// to https://

Change-Id: Id87fd5f0491a73dba5f94778d715fb791865cc79
---
M maintenance/Makefile
1 file changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/maintenance/Makefile b/maintenance/Makefile
index b061987..6d6b958 100644
--- a/maintenance/Makefile
+++ b/maintenance/Makefile
@@ -1,16 +1,16 @@
 
 equivset.txt equivset.php equivset.ser: equivset.in
php generateEquivset.php
+   cp equivset.ser ../equivset.ser
+   cp equivset.php ../equivset.php
 
 equivset.in: equivset.head equivset_1 equivset_2 equivset_3
cat equivset.head > equivset.in
grep -v -h "^" equivset_1 equivset_2 equivset_3 >> equivset.in
-   echo "Regenerated $@. Remember to run 'svn diff equivset.in' before 
commiting"
-   cp equivset.ser ../equivset.ser
-   cp equivset.php ../equivset.php
+   echo "Regenerated $@. Remember to run 'git diff equivset.in' before 
commiting"
 
 equivset_%:
-   wget --user-agent="Extension AntiSpoof equivset.in rebuild" -O $@ 
"http://www.mediawiki.org/w/index.php?action=raw=Extension:AntiSpoof/Equivalence_sets/$@;
+   wget --user-agent="Extension AntiSpoof equivset.in rebuild" -O $@ 
"https://www.mediawiki.org/w/index.php?action=raw=Extension:AntiSpoof/Equivalence_sets/$@;
 
 clean:
rm -f equivset.in equivset_1 equivset_2 equivset_3 equivset.txt 
equivset.php equivset.ser

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id87fd5f0491a73dba5f94778d715fb791865cc79
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AntiSpoof
Gerrit-Branch: master
Gerrit-Owner: Platonides 
Gerrit-Reviewer: Kaldari 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Mention the lock name in DatabaseMysqlBase lock() errors

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

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

Change subject: Mention the lock name in DatabaseMysqlBase lock() errors
..

Mention the lock name in DatabaseMysqlBase lock() errors

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/72/311872/1

diff --git a/includes/libs/rdbms/database/DatabaseMysqlBase.php 
b/includes/libs/rdbms/database/DatabaseMysqlBase.php
index 9be3ede..c025ec4 100644
--- a/includes/libs/rdbms/database/DatabaseMysqlBase.php
+++ b/includes/libs/rdbms/database/DatabaseMysqlBase.php
@@ -991,7 +991,7 @@
return true;
}
 
-   $this->queryLogger->debug( __METHOD__ . " failed to acquire 
lock\n" );
+   $this->queryLogger->debug( __METHOD__ . " failed to acquire 
lock '$lockName'\n" );
 
return false;
}
@@ -1013,7 +1013,7 @@
return true;
}
 
-   $this->queryLogger->debug( __METHOD__ . " failed to release 
lock\n" );
+   $this->queryLogger->debug( __METHOD__ . " failed to release 
lock '$lockName'\n" );
 
return false;
}

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Update for primaries not set.

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

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

Change subject: Update for primaries not set.
..

Update for primaries not set.

Bug: T143062
Change-Id: I863d09ea41fc2768901624ba3c0693c6106ac4c0
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 25 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/71/311871/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index 1d84e5b..9aeb973 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -2188,3 +2188,28 @@
   civicrm_initialize();
   CRM_Core_DAO::executeQuery("DELETE FROM civicrm_email WHERE email = 
'nob...@wikimedia.org'");
 }
+
+/**
+ * Fix contacts who have no primary - this has arisen from the dedupes.
+ *
+ * I'll probably run this again once I've fixed dedupe to stop creating them
+ * but this fixes the ~1 contacts who currently don't have an address 
marked as primary.
+ *
+ * Staging : (9 min 16.83 sec)
+ *
+ * Bug: T143062
+ */
+function wmf_civicrm_update_7250() {
+  civicrm_initialize();
+  CRM_Core_DAO::executeQuery("
+UPDATE civicrm_email SET is_primary = 1
+WHERE id IN (SELECT id FROM
+  (
+SELECT contact_id, sum(is_primary) as c, e.id
+FROM civicrm_email e
+INNER JOIN civicrm_contact c ON c.id = contact_id AND is_deleted = 0
+GROUP BY contact_id HAVING c = 0
+  ) as i
+)
+  ");
+}

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Update for primaries not set.

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

Change subject: Update for primaries not set.
..


Update for primaries not set.

Bug: T143062
Change-Id: I863d09ea41fc2768901624ba3c0693c6106ac4c0
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 25 insertions(+), 0 deletions(-)

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



diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index 1d84e5b..9aeb973 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -2188,3 +2188,28 @@
   civicrm_initialize();
   CRM_Core_DAO::executeQuery("DELETE FROM civicrm_email WHERE email = 
'nob...@wikimedia.org'");
 }
+
+/**
+ * Fix contacts who have no primary - this has arisen from the dedupes.
+ *
+ * I'll probably run this again once I've fixed dedupe to stop creating them
+ * but this fixes the ~1 contacts who currently don't have an address 
marked as primary.
+ *
+ * Staging : (9 min 16.83 sec)
+ *
+ * Bug: T143062
+ */
+function wmf_civicrm_update_7250() {
+  civicrm_initialize();
+  CRM_Core_DAO::executeQuery("
+UPDATE civicrm_email SET is_primary = 1
+WHERE id IN (SELECT id FROM
+  (
+SELECT contact_id, sum(is_primary) as c, e.id
+FROM civicrm_email e
+INNER JOIN civicrm_contact c ON c.id = contact_id AND is_deleted = 0
+GROUP BY contact_id HAVING c = 0
+  ) as i
+)
+  ");
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I863d09ea41fc2768901624ba3c0693c6106ac4c0
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Eileen 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Cdentinger 
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] apps...wikipedia[master]: Hygiene: treat FeedView like an AdapterView

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

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

Change subject: Hygiene: treat FeedView like an AdapterView
..

Hygiene: treat FeedView like an AdapterView

FeedView is now a plain RecyclerView. It seems clearer to interact with
adapters conventionally than to invoke helper methods. Remove update().

Change-Id: I89092221fd3e2ca76aa20e66698d42b09b6a25fb
---
M app/src/main/java/org/wikipedia/feed/FeedFragment.java
M app/src/main/java/org/wikipedia/feed/view/FeedView.java
2 files changed, 4 insertions(+), 9 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/feed/FeedFragment.java 
b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
index 674401e..058eb55 100644
--- a/app/src/main/java/org/wikipedia/feed/FeedFragment.java
+++ b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
@@ -112,7 +112,9 @@
 public void update(List cards) {
 if (isAdded()) {
 swipeRefreshLayout.setRefreshing(false);
-feedView.update();
+if (feedView.getAdapter() != null) {
+feedView.getAdapter().notifyDataSetChanged();
+}
 }
 }
 });
diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedView.java 
b/app/src/main/java/org/wikipedia/feed/view/FeedView.java
index 812a134..e7f1931 100644
--- a/app/src/main/java/org/wikipedia/feed/view/FeedView.java
+++ b/app/src/main/java/org/wikipedia/feed/view/FeedView.java
@@ -16,7 +16,6 @@
 
 public class FeedView extends AutoFitRecyclerView {
 private StaggeredGridLayoutManager recyclerLayoutManager;
-@Nullable private FeedAdapter adapter;
 @Nullable private ItemTouchHelper itemTouchHelper;
 
 public FeedView(Context context) {
@@ -35,7 +34,7 @@
 }
 
 public void set(@NonNull FeedCoordinatorBase coordinator, @Nullable 
FeedViewCallback callback) {
-adapter = new FeedAdapter(coordinator, callback);
+FeedAdapter adapter = new FeedAdapter(coordinator, callback);
 setAdapter(adapter);
 
 if (itemTouchHelper != null) {
@@ -46,12 +45,6 @@
 if (callback != null) {
 itemTouchHelper = new ItemTouchHelper(new 
ItemTouchHelperSwipeAdapter(callback));
 itemTouchHelper.attachToRecyclerView(this);
-}
-}
-
-public void update() {
-if (adapter != null) {
-adapter.notifyDataSetChanged();
 }
 }
 

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

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

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: make feed cards branch polymorphically

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

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

Change subject: Hygiene: make feed cards branch polymorphically
..

Hygiene: make feed cards branch polymorphically

Feed card types were encapsulated in a few large switches. This works
well enough but since similar functionality is expected of each
specialization, formalizing differences in a custom CardType seems less
error prone and more flexible.

Change-Id: I5e9480a8c5cd11485f068719bff689e6abb03366
---
M app/src/main/java/org/wikipedia/analytics/FeedFunnel.java
M app/src/main/java/org/wikipedia/feed/FeedFragment.java
M app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCard.java
M 
app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadItemCard.java
M app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCard.java
M app/src/main/java/org/wikipedia/feed/featured/FeaturedArticleCard.java
M app/src/main/java/org/wikipedia/feed/image/FeaturedImageCard.java
M app/src/main/java/org/wikipedia/feed/mainpage/MainPageCard.java
M app/src/main/java/org/wikipedia/feed/model/Card.java
A app/src/main/java/org/wikipedia/feed/model/CardType.java
M app/src/main/java/org/wikipedia/feed/mostread/MostReadItemCard.java
M app/src/main/java/org/wikipedia/feed/mostread/MostReadListCard.java
M app/src/main/java/org/wikipedia/feed/news/NewsItemCard.java
M app/src/main/java/org/wikipedia/feed/news/NewsListCard.java
M app/src/main/java/org/wikipedia/feed/progress/ProgressCard.java
M app/src/main/java/org/wikipedia/feed/random/RandomCard.java
M app/src/main/java/org/wikipedia/feed/searchbar/SearchCard.java
M app/src/main/java/org/wikipedia/feed/view/FeedAdapter.java
M app/src/main/java/org/wikipedia/news/NewsLinkCard.java
19 files changed, 186 insertions(+), 71 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/analytics/FeedFunnel.java 
b/app/src/main/java/org/wikipedia/analytics/FeedFunnel.java
index 9870231..b3fb63e 100644
--- a/app/src/main/java/org/wikipedia/analytics/FeedFunnel.java
+++ b/app/src/main/java/org/wikipedia/analytics/FeedFunnel.java
@@ -1,6 +1,9 @@
 package org.wikipedia.analytics;
 
+import android.support.annotation.NonNull;
+
 import org.wikipedia.WikipediaApp;
+import org.wikipedia.feed.model.CardType;
 
 public class FeedFunnel extends Funnel {
 private static final String SCHEMA_NAME = "MobileWikiAppFeed";
@@ -24,10 +27,10 @@
 );
 }
 
-public void dismissCard(int cardType, int position) {
+public void dismissCard(@NonNull CardType cardType, int position) {
 log(
 "action", "dismiss",
-"cardType", cardType,
+"cardType", cardType.code(),
 "position", position
 );
 }
diff --git a/app/src/main/java/org/wikipedia/feed/FeedFragment.java 
b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
index 472e094..83cedd1 100644
--- a/app/src/main/java/org/wikipedia/feed/FeedFragment.java
+++ b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
@@ -239,7 +239,7 @@
 @Override
 public boolean onRequestDismissCard(@NonNull Card card) {
 int position = coordinator.dismissCard(card);
-funnel.dismissCard(FeedAdapter.getCardType(card), position);
+funnel.dismissCard(card.type(), position);
 showDismissCardUndoSnackbar(card, position);
 return true;
 }
diff --git 
a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCard.java 
b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCard.java
index a980dab..fcf926b 100644
--- 
a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCard.java
+++ 
b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCard.java
@@ -7,6 +7,7 @@
 
 import org.wikipedia.R;
 import org.wikipedia.WikipediaApp;
+import org.wikipedia.feed.model.CardType;
 import org.wikipedia.feed.model.ListCard;
 import org.wikipedia.history.HistoryEntry;
 import org.wikipedia.page.PageTitle;
@@ -35,6 +36,10 @@
 return TextUtils.isEmpty(entry.getTitle().getThumbUrl()) ? null : 
Uri.parse(entry.getTitle().getThumbUrl());
 }
 
+@NonNull @Override public CardType type() {
+return CardType.BECAUSE_YOU_READ_LIST;
+}
+
 public String pageTitle() {
 return entry.getTitle().getDisplayText();
 }
diff --git 
a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadItemCard.java
 
b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadItemCard.java
index dfe3580..1c67709 100644
--- 
a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadItemCard.java
+++ 
b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadItemCard.java
@@ -6,6 +6,7 @@
 import android.text.TextUtils;
 
 import 

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Workaround ItemTouchHelper NPE

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

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

Change subject: Workaround ItemTouchHelper NPE
..

Workaround ItemTouchHelper NPE

This issue occurs with "don't keep activities" enabled while quickly
tapping a news item.

Change-Id: Idaed5f133806ad3d70cae3039e2f445c7b98159b
---
M app/src/main/java/org/wikipedia/feed/view/FeedView.java
1 file changed, 33 insertions(+), 1 deletion(-)


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

diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedView.java 
b/app/src/main/java/org/wikipedia/feed/view/FeedView.java
index 4749803..a97716a 100644
--- a/app/src/main/java/org/wikipedia/feed/view/FeedView.java
+++ b/app/src/main/java/org/wikipedia/feed/view/FeedView.java
@@ -2,11 +2,15 @@
 
 import android.content.Context;
 import android.support.annotation.Nullable;
+import android.support.v7.widget.RecyclerView;
 import android.support.v7.widget.StaggeredGridLayoutManager;
 import android.support.v7.widget.helper.ItemTouchHelper;
 import android.util.AttributeSet;
+import android.view.View;
 
 import org.wikipedia.R;
+import org.wikipedia.crash.RemoteLogException;
+import org.wikipedia.util.log.L;
 import org.wikipedia.views.AutoFitRecyclerView;
 import org.wikipedia.views.HeaderMarginItemDecoration;
 import org.wikipedia.views.ItemTouchHelperSwipeAdapter;
@@ -33,7 +37,7 @@
 
 public void callback(@Nullable ItemTouchHelperSwipeAdapter.Callback 
callback) {
 if (itemTouchHelper != null) {
-itemTouchHelper.attachToRecyclerView(null);
+itemTouchHelper.attachToRecyclerView(new DummyView(getContext()));
 itemTouchHelper = null;
 }
 
@@ -64,6 +68,34 @@
 callback(new RecyclerViewColumnCallback());
 }
 
+/* Workaround for 
https://code.google.com/p/android/issues/detail?id=205947.
+   ItemTouchHelper.attachToRecyclerView(null) should remove its gesture 
callback before nulling
+   its RecyclerView:
+java.lang.NullPointerException: Attempt to invoke virtual method 
'android.view.View 
android.support.v7.widget.RecyclerView.findChildViewUnder(float, float)' on a 
null object reference
+at 
android.support.v7.widget.helper.ItemTouchHelper.findChildView(ItemTouchHelper.java:1024)
+at 
android.support.v7.widget.helper.ItemTouchHelper.access$2400(ItemTouchHelper.java:76)
+at 
android.support.v7.widget.helper.ItemTouchHelper$ItemTouchHelperGestureListener.onLongPress(ItemTouchHelper.java:2265)
+at 
android.view.GestureDetector.dispatchLongPress(GestureDetector.java:770)
+at android.view.GestureDetector.-wrap0(GestureDetector.java)
+at 
android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:293)
+at android.os.Handler.dispatchMessage(Handler.java:102)
+at android.os.Looper.loop(Looper.java:154)
+at android.app.ActivityThread.main(ActivityThread.java:6077)
+at java.lang.reflect.Method.invoke(Native Method)
+at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
+at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
+ */
+private static class DummyView extends RecyclerView {
+DummyView(Context context) {
+super(context);
+}
+
+@Override public View findChildViewUnder(float x, float y) {
+L.logRemoteError(new 
RemoteLogException("ItemTouchHelper.attachToRecyclerView(null)"));
+return super.findChildViewUnder(x, y);
+}
+}
+
 private class RecyclerViewColumnCallback implements 
AutoFitRecyclerView.Callback {
 @Override public void onColumns(int columns) {
 // todo: when there is only one element, should we setSpanCount to 
1? e.g.:

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

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

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: move FeedView Adapter config to client

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

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

Change subject: Hygiene: move FeedView Adapter config to client
..

Hygiene: move FeedView Adapter config to client

Focus FeedView on presentation and exposing user interaction callbacks
by moving adapter logic to the client.

Change-Id: I1f03b48cde5ef7c7a694426688a97693f8273231
---
M app/src/main/java/org/wikipedia/feed/FeedFragment.java
M app/src/main/java/org/wikipedia/feed/view/FeedView.java
2 files changed, 4 insertions(+), 7 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/feed/FeedFragment.java 
b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
index 058eb55..472e094 100644
--- a/app/src/main/java/org/wikipedia/feed/FeedFragment.java
+++ b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
@@ -94,7 +94,8 @@
 View view = inflater.inflate(R.layout.fragment_feed, container, false);
 
 unbinder = ButterKnife.bind(this, view);
-feedView.set(coordinator, feedCallback);
+feedView.setAdapter(new FeedAdapter(coordinator, feedCallback));
+feedView.callback(feedCallback);
 feedView.addOnScrollListener(feedScrollListener);
 
 swipeRefreshLayout.setColorSchemeResources(R.color.foundation_blue);
@@ -133,6 +134,7 @@
 coordinator.setFeedUpdateListener(null);
 swipeRefreshLayout.setOnRefreshListener(null);
 feedView.removeOnScrollListener(feedScrollListener);
+feedView.callback((FeedViewCallback) null);
 unbinder.unbind();
 unbinder = null;
 super.onDestroyView();
diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedView.java 
b/app/src/main/java/org/wikipedia/feed/view/FeedView.java
index e7f1931..4749803 100644
--- a/app/src/main/java/org/wikipedia/feed/view/FeedView.java
+++ b/app/src/main/java/org/wikipedia/feed/view/FeedView.java
@@ -1,14 +1,12 @@
 package org.wikipedia.feed.view;
 
 import android.content.Context;
-import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
 import android.support.v7.widget.StaggeredGridLayoutManager;
 import android.support.v7.widget.helper.ItemTouchHelper;
 import android.util.AttributeSet;
 
 import org.wikipedia.R;
-import org.wikipedia.feed.FeedCoordinatorBase;
 import org.wikipedia.views.AutoFitRecyclerView;
 import org.wikipedia.views.HeaderMarginItemDecoration;
 import org.wikipedia.views.ItemTouchHelperSwipeAdapter;
@@ -33,10 +31,7 @@
 init();
 }
 
-public void set(@NonNull FeedCoordinatorBase coordinator, @Nullable 
FeedViewCallback callback) {
-FeedAdapter adapter = new FeedAdapter(coordinator, callback);
-setAdapter(adapter);
-
+public void callback(@Nullable ItemTouchHelperSwipeAdapter.Callback 
callback) {
 if (itemTouchHelper != null) {
 itemTouchHelper.attachToRecyclerView(null);
 itemTouchHelper = null;

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...PageTriage[master]: Improve JSDuck

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

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

Change subject: Improve JSDuck
..

Improve JSDuck

Import tags and externals from Echo.

Change-Id: I788275e5d26652f23665c9d1a27a9a457780386b
---
A jsduck.external.js
A jsduck.json
A jsduck_custom_tags.rb
3 files changed, 160 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageTriage 
refs/changes/66/311866/1

diff --git a/jsduck.external.js b/jsduck.external.js
new file mode 100644
index 000..907869c
--- /dev/null
+++ b/jsduck.external.js
@@ -0,0 +1,47 @@
+/**
+ * @class jQuery
+ * 
+ */
+
+/**
+ * @method ajax
+ * @source 
+ * @return {jqXHR}
+ */
+
+/**
+ * @class jQuery.Event
+ * @source 
+ */
+
+/**
+ * @class jQuery.Promise
+ * @source 
+ */
+
+/**
+ * @class jQuery.Deferred
+ * @mixins jQuery.Promise
+ * @source 
+ */
+
+/**
+ * @class jQuery.jqXHR
+ * @source 
+ * @alternateClassName jqXHR
+ */
+
+/**
+ * @class mw.Api
+ * @source 
+ */
+
+/**
+ * @class mw.Message
+ * @source 

+ */
diff --git a/jsduck.json b/jsduck.json
new file mode 100644
index 000..04fede7
--- /dev/null
+++ b/jsduck.json
@@ -0,0 +1,13 @@
+{
+   "--title": "PageTriage - Documentation",
+   "--processes": "0",
+   "--warnings-exit-nonzero": true,
+   "--external": "OO.*",
+   "--output": "docs",
+   "--tags": "jsduck_custom_tags.rb",
+   "--": [
+   "jsduck.external.js",
+   "modules",
+   "tests"
+   ]
+}
diff --git a/jsduck_custom_tags.rb b/jsduck_custom_tags.rb
new file mode 100644
index 000..083f45a
--- /dev/null
+++ b/jsduck_custom_tags.rb
@@ -0,0 +1,100 @@
+# Custom tags for JSDuck 5.x
+# See also:
+# - https://github.com/senchalabs/jsduck/wiki/Tags
+# - https://github.com/senchalabs/jsduck/wiki/Custom-tags
+# - 
https://github.com/senchalabs/jsduck/wiki/Custom-tags/7f5c32e568eab9edc8e3365e935bcb836cb11f1d
+require 'jsduck/tag/tag'
+
+class CommonTag < JsDuck::Tag::Tag
+  def initialize
+@html_position = POS_DOC + 0.1
+@repeatable = true
+  end
+
+  def parse_doc(scanner, _position)
+if @multiline
+  return { tagname: @tagname, doc: :multiline }
+else
+  text = scanner.match(/.*$/)
+  return { tagname: @tagname, doc: text }
+end
+  end
+
+  def process_doc(context, tags, _position)
+context[@tagname] = tags
+  end
+
+  def format(context, formatter)
+context[@tagname].each do |tag|
+  tag[:doc] = formatter.format(tag[:doc])
+end
+  end
+end
+
+class SourceTag < CommonTag
+  def initialize
+@tagname = :source
+@pattern = 'source'
+super
+  end
+
+  def to_html(context)
+context[@tagname].map do |source|
+  <<-EOHTML
+Source
+#{source[:doc]}
+  EOHTML
+end.join
+  end
+end
+
+class SeeTag < CommonTag
+  def initialize
+@tagname = :see
+@pattern = 'see'
+super
+  end
+
+  def format(context, formatter)
+position = context[:files][0]
+context[@tagname].each do |tag|
+  tag[:doc] = '' + render_long_see(tag[:doc], formatter, position) + 
''
+end
+  end
+
+  def to_html(context)
+<<-EOHTML
+  Related
+  
+  #{context[@tagname].map {|tag| tag[:doc]}.join("\n")}
+  
+EOHTML
+  end
+
+  def render_long_see(tag, formatter, position)
+match = tag.match(/\A([^\s]+)( .*)?\Z/m)
+if match
+  name = match[1]
+  doc = match[2] ? ': ' + match[2] : ''
+  return formatter.format("{@link #{name}} #{doc}")
+else
+  JsDuck::Logger.warn(nil, 'Unexpected @see argument: "' + tag + '"', 
position)
+  return tag
+end
+  end
+end
+
+class TodoTag < CommonTag
+  def initialize
+@tagname = :todo
+@pattern = 'todo'
+super
+  end
+
+  def to_html(context)
+<<-EOHTML
+  TODO
+  #{context[@tagname].last[:doc]}
+EOHTML
+  end
+end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I788275e5d26652f23665c9d1a27a9a457780386b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTriage
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 

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


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Introduce map sidebar, for displaying map details and extern...

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

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

Change subject: Introduce map sidebar, for displaying map details and external 
map services.
..

Introduce map sidebar, for displaying map details
and external map services.

Bug: T131907
Change-Id: I6224ffb2ef2444fc32d4c801c262f5fae14690f8
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/DataModuleLinks.php
A lib/wmui-base.less
M modules/dialog/dialog.js
A modules/dialog/sidebar.js
M styles/kartographer.less
A templates/dialog-sidebar-globalservices.mustache
A templates/dialog-sidebar-mapdetails.mustache
10 files changed, 476 insertions(+), 5 deletions(-)


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

diff --git a/extension.json b/extension.json
index 969f7ec..e47c2b8 100644
--- a/extension.json
+++ b/extension.json
@@ -195,16 +195,34 @@
"dependencies": [
"oojs-ui-windows",
"mediawiki.router",
-   "ext.kartographer.box"
+   "ext.kartographer.box",
+   "ext.kartographer.extlinks"
],
"scripts": [
"modules/dialog/closefullscreen_control.js",
+   "modules/dialog/sidebar.js",
"modules/dialog/dialog.js",
"modules/dialog/index.js"
],
"messages": [
-   "kartographer-fullscreen-close"
+   "kartographer-fullscreen-close",
+   "kartographer-linktype-map",
+   "kartographer-linktype-satellite",
+   "kartographer-linktype-topo",
+   "kartographer-linktype-other",
+   "kartographer-sidebar-coordinates",
+   "kartographer-sidebar-description",
+   "kartographer-sidebar-geo-uri",
+   "kartographer-sidebar-globalservices",
+   "kartographer-sidebar-latitude",
+   "kartographer-sidebar-longitude",
+   "kartographer-sidebar-mapdetails",
+   "kartographer-sidebar-service"
],
+   "templates": {
+   "dialog-sidebar-mapdetails.mustache": 
"templates/dialog-sidebar-mapdetails.mustache",
+   "dialog-sidebar-globalservices.mustache": 
"templates/dialog-sidebar-globalservices.mustache"
+   },
"targets": [
"mobile",
"desktop"
diff --git a/i18n/en.json b/i18n/en.json
index cf69512..fa73c40 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -71,6 +71,14 @@
"kartographer-link-wikimapia": "Wikimapia",
"kartographer-link-wikiminiatlas": "WikiMiniAtlas",
"kartographer-link-yandex-maps": "Yandex.Maps",
+   "kartographer-sidebar-coordinates": "Coordinates",
+   "kartographer-sidebar-description": "View this location in one of the 
services listed below. You can filter the list by map type:",
+   "kartographer-sidebar-geo-uri": "Geo URI",
+   "kartographer-sidebar-globalservices": "Global services",
+   "kartographer-sidebar-latitude": "Latitude",
+   "kartographer-sidebar-longitude": "Longitude",
+   "kartographer-sidebar-mapdetails": "Map details",
+   "kartographer-sidebar-service": "Service",
"leafletdraw-draw-handlers-circle-radius": "Radius",
"leafletdraw-draw-handlers-circle-tooltip-start": "Click and drag to 
draw a circle",
"leafletdraw-draw-handlers-marker-tooltip-start": "Click map to place a 
marker",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 7b01d9c..7916fe7 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -74,6 +74,14 @@
"kartographer-link-wikimapia": "{{optional}}Full screen map info 
sidebar - external service name",
"kartographer-link-wikiminiatlas": "{{optional}}Full screen map info 
sidebar - external service name",
"kartographer-link-yandex-maps": "{{optional}}Full screen map info 
sidebar - external service name",
+   "kartographer-sidebar-coordinates": "Full screen map info sidebar - 
Coordinates label",
+   "kartographer-sidebar-description": "Full screen map info sidebar - 
Text to indicate the links are external map services, at the same location, and 
the dropdown is to filter the list by map type.",
+   "kartographer-sidebar-geo-uri": "Full screen map info sidebar - Geo URI 
label",
+   

[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.18]: Always use the requestIdleCallback polyfill for batchEval

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

Change subject: Always use the requestIdleCallback polyfill for batchEval
..


Always use the requestIdleCallback polyfill for batchEval

Bug: T146099
Change-Id: I10fd6d47cb2ecc5fb8f3f761fbe727f7c0a9faab
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index db5a4fb..9fd8fb5 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -1680,7 +1680,7 @@
if ( !implementations.length ) {
return;
}
-   mw.requestIdleCallback( function iterate( 
deadline ) {
+   mw.requestIdleCallbackInternal( function 
iterate( deadline ) {
while ( implementations[ 0 ] && 
deadline.timeRemaining() > 5 ) {
try {
$.globalEval( 
implementations.shift() );
@@ -1690,7 +1690,7 @@
}
}
if ( implementations[ 0 ] ) {
-   mw.requestIdleCallback( iterate 
);
+   mw.requestIdleCallbackInternal( 
iterate );
}
} );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I10fd6d47cb2ecc5fb8f3f761fbe727f7c0a9faab
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.18
Gerrit-Owner: Gilles 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove Database clone call from DatabaseTests.php

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

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

Change subject: Remove Database clone call from DatabaseTests.php
..

Remove Database clone call from DatabaseTests.php

Change-Id: I60a22de9ccc7253abc9bbefe2a4f38675655ee4f
---
M includes/libs/rdbms/database/Database.php
M tests/phpunit/includes/db/DatabaseTest.php
2 files changed, 17 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/65/311865/1

diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index deaa396..9993277 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -3525,7 +3525,7 @@
 * @throws DBConnectionError
 */
public function __clone() {
-   $this->connLogger->debug(
+   $this->connLogger->warning(
"Cloning " . get_class( $this ) . " is not recomended; 
forking connection:\n" .
( new RuntimeException() )->getTraceAsString()
);
diff --git a/tests/phpunit/includes/db/DatabaseTest.php 
b/tests/phpunit/includes/db/DatabaseTest.php
index 846509c..48dc332 100644
--- a/tests/phpunit/includes/db/DatabaseTest.php
+++ b/tests/phpunit/includes/db/DatabaseTest.php
@@ -359,24 +359,26 @@
$origTrx = $db->getFlag( DBO_TRX );
$origSsl = $db->getFlag( DBO_SSL );
 
-   if ( $origTrx ) {
-   $db->clearFlag( DBO_TRX, $db::REMEMBER_PRIOR );
-   } else {
-   $db->setFlag( DBO_TRX, $db::REMEMBER_PRIOR );
-   }
+   $origTrx
+   ? $db->clearFlag( DBO_TRX, $db::REMEMBER_PRIOR )
+   : $db->setFlag( DBO_TRX, $db::REMEMBER_PRIOR );
$this->assertEquals( !$origTrx, $db->getFlag( DBO_TRX ) );
 
-   if ( $origSsl ) {
-   $db->clearFlag( DBO_SSL, $db::REMEMBER_PRIOR );
-   } else {
-   $db->setFlag( DBO_SSL, $db::REMEMBER_PRIOR );
-   }
+   $origSsl
+   ? $db->clearFlag( DBO_SSL, $db::REMEMBER_PRIOR )
+   : $db->setFlag( DBO_SSL, $db::REMEMBER_PRIOR );
$this->assertEquals( !$origSsl, $db->getFlag( DBO_SSL ) );
 
-   $db2 = clone $db;
-   $db2->restoreFlags( $db::RESTORE_INITIAL );
-   $this->assertEquals( $origTrx, $db2->getFlag( DBO_TRX ) );
-   $this->assertEquals( $origSsl, $db2->getFlag( DBO_SSL ) );
+   $db->restoreFlags( $db::RESTORE_INITIAL );
+   $this->assertEquals( $origTrx, $db->getFlag( DBO_TRX ) );
+   $this->assertEquals( $origSsl, $db->getFlag( DBO_SSL ) );
+
+   $origTrx
+   ? $db->clearFlag( DBO_TRX, $db::REMEMBER_PRIOR )
+   : $db->setFlag( DBO_TRX, $db::REMEMBER_PRIOR );
+   $origSsl
+   ? $db->clearFlag( DBO_SSL, $db::REMEMBER_PRIOR )
+   : $db->setFlag( DBO_SSL, $db::REMEMBER_PRIOR );
 
$db->restoreFlags();
$this->assertEquals( $origSsl, $db->getFlag( DBO_SSL ) );

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Convert 'seenTime' to a global property

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

Change subject: Convert 'seenTime' to a global property
..


Convert 'seenTime' to a global property

This transforms seenTime concept to a global property for all wikis
and sources, and updates the global seen time on opening the popup.

Bug: T134855
Change-Id: I67bcc4b346237317c7a9204dd43cd0e9ee02792f
---
M includes/SeenTime.php
M modules/api/mw.echo.api.EchoApi.js
M modules/controller/mw.echo.Controller.js
M modules/model/mw.echo.dm.BundleNotificationItem.js
M modules/model/mw.echo.dm.CrossWikiNotificationItem.js
M modules/model/mw.echo.dm.ModelManager.js
M modules/model/mw.echo.dm.NotificationItem.js
M modules/model/mw.echo.dm.NotificationsList.js
M modules/model/mw.echo.dm.SeenTimeModel.js
M modules/ui/mw.echo.ui.CrossWikiNotificationItemWidget.js
M modules/ui/mw.echo.ui.NotificationBadgeWidget.js
M modules/ui/mw.echo.ui.NotificationsInboxWidget.js
12 files changed, 115 insertions(+), 103 deletions(-)

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



diff --git a/includes/SeenTime.php b/includes/SeenTime.php
index 4a33720..687613c 100644
--- a/includes/SeenTime.php
+++ b/includes/SeenTime.php
@@ -41,12 +41,12 @@
private static function cache() {
static $c = null;
 
-   // Use db-replicated for persistent storage, and
+   // Use main stash for persistent storage, and
// wrap it with CachedBagOStuff for an in-process
// cache. (T144534)
if ( $c === null ) {
$c = new CachedBagOStuff(
-   ObjectCache::getInstance( 'db-replicated' )
+   ObjectCache::getMainStashInstance()
);
}
 
@@ -75,9 +75,8 @@
return false;
}
 
-   $key = wfMemcKey( 'echo', 'seen', $type, 'time', 
$this->user->getId() );
$cas = 0; // Unused, but we have to pass something by reference
-   $data = self::cache()->get( $key, $cas, $flags );
+   $data = self::cache()->get( $this->getMemcKey( $type ), $cas, 
$flags );
 
if ( $data === false ) {
// Check if the user still has it set in their 
preferences
@@ -108,9 +107,7 @@
}
} else {
if ( $this->validateType( $type ) ) {
-   $key = wfMemcKey( 'echo', 'seen', $type, 
'time', $this->user->getId() );
-
-   return self::cache()->set( $key, $time );
+   return self::cache()->set( $this->getMemcKey( 
$type ), $time );
}
}
}
@@ -124,4 +121,28 @@
private function validateType( $type ) {
return in_array( $type, self::$allowedTypes );
}
+
+   /**
+* Build a memcached key.
+*
+* @param string $type Given notification type
+* @return string Memcached key
+*/
+   protected function getMemcKey( $type = 'all' ) {
+   $localKey = wfMemcKey( 'echo', 'seen', $type, 'time', 
$this->user->getId() );
+
+   if ( !$this->user->getOption( 'echo-cross-wiki-notifications' ) 
) {
+   return $localKey;
+   }
+
+   $lookup = CentralIdLookup::factory();
+   $globalId = $lookup->centralIdFromLocalUser( $this->user, 
CentralIdLookup::AUDIENCE_RAW );
+
+   if ( !$globalId ) {
+   return $localKey;
+   }
+
+   return wfGlobalCacheKey( 'echo', 'seen', $type, 'time', 
$globalId );
+
+   }
 }
diff --git a/modules/api/mw.echo.api.EchoApi.js 
b/modules/api/mw.echo.api.EchoApi.js
index 3ea96b7..ebf4d2a 100644
--- a/modules/api/mw.echo.api.EchoApi.js
+++ b/modules/api/mw.echo.api.EchoApi.js
@@ -271,7 +271,10 @@
};
 
/**
-* Update the seenTime property for the given type and source.
+* Update the seenTime property for the given type.
+* We only need to update this in a single source for the seenTime
+* to be updated globally - but we will let the consumer of
+* this method override the choice of which source to update.
 *
 * @param {string} [type='alert,message'] Notification type
 * @param {string} [source='local'] Notification source
@@ -280,6 +283,7 @@
mw.echo.api.EchoApi.prototype.updateSeenTime = function ( type, source 
) {
source = source || 'local';
type = type || [ 'alert', 'message' ];
+
return this.network.getApiHandler( source ).updateSeenTime( 
type );
};
 
diff --git a/modules/controller/mw.echo.Controller.js 
b/modules/controller/mw.echo.Controller.js
index 59cb771..0945e64 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: FSFile and TempFSFile cleanups

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

Change subject: FSFile and TempFSFile cleanups
..


FSFile and TempFSFile cleanups

* Remove wf* function dependencies. This includes wfTempDir().
  Callers now should specify the directory, though it will try to do
  most of the wfTempDir() logic anyway if they do not.
* Update callers to inject wfTempDir() so $wgTmpDirectory is used by
  TempFSFile instead of it probing to find a valid directory itself.
* Move most of the wfTempDir() logic to TempFSFile::getUsableTempDirectory().
* Remove unused getMimeType() method.

Change-Id: Idd55936b07f9448a6c90577708722b7b52b8fe66
---
M includes/GlobalFunctions.php
M includes/api/ApiImageRotate.php
M includes/filebackend/FSFile.php
M includes/filebackend/TempFSFile.php
M includes/filerepo/file/File.php
M includes/upload/UploadFromChunks.php
M includes/upload/UploadFromUrl.php
M tests/phpunit/includes/filebackend/FileBackendTest.php
M tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php
M tests/phpunit/mocks/filebackend/MockFSFile.php
10 files changed, 57 insertions(+), 62 deletions(-)

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



diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 90bba53..e5f518f 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -2078,35 +2078,7 @@
return $wgTmpDirectory;
}
 
-   $tmpDir = array_map( "getenv", [ 'TMPDIR', 'TMP', 'TEMP' ] );
-   $tmpDir[] = sys_get_temp_dir();
-   $tmpDir[] = ini_get( 'upload_tmp_dir' );
-
-   foreach ( $tmpDir as $tmp ) {
-   if ( $tmp && file_exists( $tmp ) && is_dir( $tmp ) && 
is_writable( $tmp ) ) {
-   return $tmp;
-   }
-   }
-
-   /**
-* PHP on Windows will detect C:\Windows\Temp as not writable even 
though PHP can write to it
-* so create a directory within that called 'mwtmp' with a suffix of 
the user running the
-* current process.
-* The user is included as if various scripts are run by different 
users they will likely
-* not be able to access each others temporary files.
-*/
-   if ( wfIsWindows() ) {
-   $tmp = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'mwtmp' . '-' 
. get_current_user();
-   if ( !file_exists( $tmp ) ) {
-   mkdir( $tmp );
-   }
-   if ( file_exists( $tmp ) && is_dir( $tmp ) && is_writable( $tmp 
) ) {
-   return $tmp;
-   }
-   }
-
-   throw new MWException( 'No writable temporary directory could be found. 
' .
-   'Please set $wgTmpDirectory to a writable directory.' );
+   return TempFSFile::getUsableTempDirectory();
 }
 
 /**
diff --git a/includes/api/ApiImageRotate.php b/includes/api/ApiImageRotate.php
index 2b99353..966bcbf 100644
--- a/includes/api/ApiImageRotate.php
+++ b/includes/api/ApiImageRotate.php
@@ -108,7 +108,7 @@
continue;
}
$ext = strtolower( pathinfo( "$srcPath", 
PATHINFO_EXTENSION ) );
-   $tmpFile = TempFSFile::factory( 'rotate_', $ext );
+   $tmpFile = TempFSFile::factory( 'rotate_', $ext, 
wfTempDir() );
$dstPath = $tmpFile->getPath();
$err = $handler->rotate( $file, [
'srcPath' => $srcPath,
diff --git a/includes/filebackend/FSFile.php b/includes/filebackend/FSFile.php
index 8aa11b6..221fe9f 100644
--- a/includes/filebackend/FSFile.php
+++ b/includes/filebackend/FSFile.php
@@ -86,15 +86,6 @@
}
 
/**
-* Guess the MIME type from the file contents alone
-*
-* @return string
-*/
-   public function getMimeType() {
-   return MimeMagic::singleton()->guessMimeType( $this->path, 
false );
-   }
-
-   /**
 * Get an associative array containing information about
 * a file with the given storage path.
 *
@@ -117,8 +108,6 @@
 * @return array
 */
public function getProps( $ext = true ) {
-   wfDebug( __METHOD__ . ": Getting file info for $this->path\n" );
-
$info = self::placeholderProps();
$info['fileExists'] = $this->exists();
 
@@ -131,7 +120,7 @@
}
 
# MIME type according to file contents
-   $info['file-mime'] = $this->getMimeType();
+   $info['file-mime'] = $magic->guessMimeType( 
$this->path, false );
# logical MIME type
$info['mime'] = $magic->improveTypeFromExtension( 
$info['file-mime'], $ext );
 
@@ -145,17 +134,15 @@
$handler = MediaHandler::getHandler( 

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Split isAvailable from visual-specific checks

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

Change subject: Split isAvailable from visual-specific checks
..


Split isAvailable from visual-specific checks

Not fully tested

Bug: T146182
Change-Id: I5d7ae6e49991660ecdc2daf46b319947f83a1018
---
M ApiVisualEditor.php
M ApiVisualEditorEdit.php
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
3 files changed, 36 insertions(+), 42 deletions(-)

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



diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php
index 1e047b5..0cf9198 100644
--- a/ApiVisualEditor.php
+++ b/ApiVisualEditor.php
@@ -11,12 +11,6 @@
 use \MediaWiki\Logger\LoggerFactory;
 
 class ApiVisualEditor extends ApiBase {
-   // These are safe even if VE is not enabled on the page.
-   // This is intended for other VE interfaces, such as Flow's.
-   protected static $SAFE_ACTIONS = [
-   'parsefragment',
-   ];
-
/**
 * @var Config
 */
@@ -293,12 +287,6 @@
$title = Title::newFromText( $params['page'] );
if ( !$title ) {
$this->dieUsageMsg( 'invalidtitle', $params['page'] );
-   }
-
-   $isSafeAction = in_array( $params['paction'], 
self::$SAFE_ACTIONS, true );
-
-   if ( !$isSafeAction ) {
-   $this->checkAllowedNamespace( $title->getNamespace() );
}
 
$parserParams = [];
@@ -667,19 +655,6 @@
}
 
$this->getResult()->addValue( null, $this->getModuleName(), 
$result );
-   }
-
-   /**
-* Check if the request is allowed to proceed in the current namespace, 
and abort if not
-*
-* @param int $namespaceId Namespace ID
-*/
-   public function checkAllowedNamespace( $namespaceId ) {
-   if ( !self::isAllowedNamespace( $this->veConfig, $namespaceId ) 
) {
-   $this->dieUsage( "VisualEditor is not enabled in '" .
-   MWNamespace::getCanonicalName( $namespaceId ) . 
"' namespace ",
-   'novenamespace' );
-   }
}
 
/**
diff --git a/ApiVisualEditorEdit.php b/ApiVisualEditorEdit.php
index 01cdb7a..d7bee07 100644
--- a/ApiVisualEditorEdit.php
+++ b/ApiVisualEditorEdit.php
@@ -119,8 +119,6 @@
$this->dieUsageMsg( 'invalidtitle', $params['page'] );
}
 
-   $this->checkAllowedNamespace( $title->getNamespace() );
-
$parserParams = [];
if ( isset( $params['oldid'] ) ) {
$parserParams['oldid'] = $params['oldid'];
diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index e7a207e..e1d6aee 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -455,7 +455,7 @@
}
 
// If the edit tab is hidden, remove it.
-   if ( !( init.isAvailable && userPrefPreferShow ) ) {
+   if ( !( init.isVisualAvailable && userPrefPreferShow ) 
) {
$caVeEdit.remove();
} else if ( pageCanLoadVE ) {
// Allow instant switching to edit mode, 
without refresh
@@ -476,7 +476,7 @@
}
}
 
-   if ( init.isAvailable ) {
+   if ( init.isVisualAvailable ) {
if ( conf.tabPosition === 'before' ) {
$caEdit.addClass( 'collapsible' );
} else {
@@ -724,11 +724,14 @@
// Only in supported skins
conf.skins.indexOf( mw.config.get( 'skin' ) ) !== -1 &&
 
+   // Not on pages like Special:RevisionDelete
+   mw.config.get( 'wgNamespaceNumber' ) !== -1
+   );
+   init.isVisualAvailable = (
+   init.isAvailable &&
+
// Only in enabled namespaces
conf.namespaces.indexOf( new mw.Title( mw.config.get( 
'wgRelevantPageName' ) ).getNamespaceId() ) !== -1 &&
-
-   // Not on pages like Special:RevisionDelete
-   mw.config.get( 'wgNamespaceNumber' ) !== -1 &&
 
// Not on pages which are outputs of the Page Translation 
feature
mw.config.get( 'wgTranslatePageTranslation' ) !== 'translation' 
&&
@@ -747,12 +750,12 @@
// The VE global was once available always, but now that platform 
integration initialisation
// is properly separated, it doesn't exist until the platform loads 
VisualEditor 

  1   2   3   4   5   >