[MediaWiki-commits] [Gerrit] apertium-eo-ca: Rebuild for Jessie and fixed dependencies - change (operations...apertium-eo-ca)

2016-06-14 Thread KartikMistry (Code Review)
KartikMistry has uploaded a new change for review.

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

Change subject: apertium-eo-ca: Rebuild for Jessie and fixed dependencies
..

apertium-eo-ca: Rebuild for Jessie and fixed dependencies

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


  git pull 
ssh://gerrit.wikimedia.org:29418/operations/debs/contenttranslation/apertium-eo-ca
 refs/changes/32/294432/1

diff --git a/debian/changelog b/debian/changelog
index cb61e18..fd9a6fd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+apertium-eo-ca (0.9.1~r60655-1+wmf1) jessie; urgency=low
+
+  * Rebuild for Jessie.
+  * Fixed dependencies.
+
+ -- Kartik Mistry   Wed, 15 Jun 2016 11:24:33 +0530
+
 apertium-eo-ca (0.9.1~r60655-1) trusty; urgency=low
 
   [ Tino Didriksen ]
diff --git a/debian/control b/debian/control
index c99d13e..c00cae4 100644
--- a/debian/control
+++ b/debian/control
@@ -1,14 +1,14 @@
 Source: apertium-eo-ca
 Section: science
 Priority: optional
-Maintainer: Kartik Mistry 
-Build-Depends: apertium,
+Maintainer: Debian Science Team 

+Uploaders: Tino Didriksen ,
+   Kartik Mistry 
+Build-Depends: apertium-dev (>= 3.4),
autotools-dev,
debhelper (>= 9),
dh-autoreconf,
gawk,
-   libapertium3-3.3-dev,
-   liblttoolbox3-3.3-dev (>= 3.3),
locales,
pkg-config (>= 0.21)
 Standards-Version: 3.9.6
@@ -18,7 +18,7 @@
 
 Package: apertium-eo-ca
 Architecture: all
-Depends: apertium (>= 3.3), ${misc:Depends}, ${shlibs:Depends}
+Depends: apertium (>= 3.4), ${misc:Depends}, ${shlibs:Depends}
 Provides: apertium-ca-eo
 Conflicts: apertium-ca-eo
 Description: Apertium translation data for the Esperanto-Catalan pair

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iabcf9036d011cd5fb12dbd46ada99fc7c436e3fa
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/contenttranslation/apertium-eo-ca
Gerrit-Branch: master
Gerrit-Owner: KartikMistry 

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


[MediaWiki-commits] [Gerrit] apertium-es-pt: Rebuild for Jessie and other fixes - change (operations...apertium-es-pt)

2016-06-14 Thread KartikMistry (Code Review)
KartikMistry has uploaded a new change for review.

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

Change subject: apertium-es-pt: Rebuild for Jessie and other fixes
..

apertium-es-pt: Rebuild for Jessie and other fixes

* Use dh 9.
* Fixed dependencies.

Bug: T107306
Change-Id: If22d0c36554037147533b2b9db6155ad8655e877
---
M debian/changelog
M debian/compat
M debian/control
3 files changed, 12 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/operations/debs/contenttranslation/apertium-es-pt
 refs/changes/31/294431/1

diff --git a/debian/changelog b/debian/changelog
index e44db28..2da9644 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+apertium-es-pt (1.1.5+svn~57507-1+wmf1) jessie; urgency=low
+
+  * Rebuild for Jessie.
+  * Use debhelper 9.
+  * Fixed dependencies.
+
+ -- Kartik Mistry   Wed, 15 Jun 2016 11:18:38 +0530
+
 apertium-es-pt (1.1.5+svn~57507-1) trusty; urgency=low
 
   [ Tino Didriksen ]
diff --git a/debian/compat b/debian/compat
index ec63514..45a4fb7 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-9
+8
diff --git a/debian/control b/debian/control
index 8252d82..caf8218 100644
--- a/debian/control
+++ b/debian/control
@@ -4,12 +4,11 @@
 Maintainer: Debian Science Team 

 Uploaders: Tino Didriksen ,
Kartik Mistry 
-Build-Depends: apertium (>= 3.3),
+Build-Depends: apertium-dev (>= 3.4),
autotools-dev,
-   debhelper (>= 9.0),
+   debhelper (>= 8.0),
dh-autoreconf,
gawk,
-   libapertium3-3.3-dev,
locales,
pkg-config (>= 0.21)
 Standards-Version: 3.9.6
@@ -19,7 +18,7 @@
 
 Package: apertium-es-pt
 Architecture: all
-Depends: apertium (>= 3.3), ${misc:Depends}, ${shlibs:Depends}
+Depends: apertium (>= 3.4), ${misc:Depends}, ${shlibs:Depends}
 Provides: apertium-pt-es
 Conflicts: apertium-pt-es
 Description: Apertium translation data for the Spanish-Portuguese pair

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If22d0c36554037147533b2b9db6155ad8655e877
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/contenttranslation/apertium-es-pt
Gerrit-Branch: master
Gerrit-Owner: KartikMistry 

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


[MediaWiki-commits] [Gerrit] giella-sme: Initial Debian packaging - change (operations...giella-sme)

2016-06-14 Thread KartikMistry (Code Review)
KartikMistry has uploaded a new change for review.

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

Change subject: giella-sme: Initial Debian packaging
..

giella-sme: Initial Debian packaging

Bug: T120087
Change-Id: I9e5ab859aee223c5515f5b6ddde472f20cc4c547
---
A debian/changelog
A debian/compat
A debian/control
A debian/copyright
A debian/docs
A debian/giella-sme-dev.install
A debian/giella-sme.install
A debian/rules
A debian/source/format
A debian/watch
10 files changed, 141 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/operations/debs/contenttranslation/giella-sme 
refs/changes/30/294430/1

diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 000..97f9b74
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,12 @@
+giella-sme (0.0.20150917~r121176-1+wmf1) jessie; urgency=low
+
+  * Rebuild for Jessie
+
+ -- Kartik Mistry   Wed, 15 Jun 2016 10:52:06 +0530
+
+giella-sme (0.0.20150917~r121176-1) unstable; urgency=low
+
+  [ Tino Didriksen ]
+  * Initial release (Closes: #814400)
+
+ -- Kartik Mistry   Tue, 07 Jun 2016 13:55:55 +0530
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 000..950195a
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,38 @@
+Source: giella-sme
+Section: science
+Priority: optional
+Maintainer: Debian Science Team 

+Uploaders: Tino Didriksen ,
+   Kartik Mistry 
+Build-Depends: autotools-dev,
+   bc,
+   cg3,
+   debhelper (>= 9),
+   dh-autoreconf,
+   dh-exec,
+   foma-bin,
+   gawk,
+   giella-core,
+   hfst,
+   libhfst-dev,
+   pkg-config (>= 0.21),
+   python3 (>= 3.1),
+   zip
+Standards-Version: 3.9.8
+Homepage: http://giellatekno.uit.no/
+Vcs-Git: https://anonscm.debian.org/cgit/debian-science/packages/giella-sme.git
+Vcs-Browser: 
https://anonscm.debian.org/cgit/debian-science/packages/giella-sme.git
+
+Package: giella-sme
+Architecture: all
+Depends: cg3, hfst, ${misc:Depends}, ${shlibs:Depends}
+Description: Giellatekno single language data for North Saami
+ Data package providing Giellatekno language resources for North Saami.
+
+Package: giella-sme-dev
+Architecture: all
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: Giellatekno single language data for North Saami (dev extras)
+ Data package providing Giellatekno language resources for North Saami.
+ .
+ This package provides extra development files.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 000..5729791
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,58 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Source: http://giellatekno.uit.no/
+
+Files: *
+Copyright: 2005-2016, Giellatekno at The University of Tromsø 

+License: GPL-3+
+
+Files: m4/giellatekno.m4 m4/hfst.m4
+Copyright: 2011 Divvun/Samediggi/UiT 
+License: GPL-3+
+
+License: GPL-3+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
+
+Files: doc/newcg/*.jspwiki
+Copyright: 2005-2016, Giellatekno at The University of Tromsø 

+License: GFDL-1.3
+
+License: GFDL-1.3
+ On Debian systems, the complete text of the GNU Free Documentation License
+ version 1.3 can be found in "/usr/share/common-licenses/GFDL-1.3".
+
+Files: doc/newcg/*.xml
+Copyright: 2005-2016, Giellatekno at The University of Tromsø 

+License: Apache-2.0
+
+License: Apache-2.0
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a 

[MediaWiki-commits] [Gerrit] Allow anon users to use query API to find translation - change (mediawiki...ContentTranslation)

2016-06-14 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review.

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

Change subject: Allow anon users to use query API to find translation
..

Allow anon users to use query API to find translation

The ApiQueryContentTranslation can be used to find a translation
by language pair and source title. It does not return the translation
content, but just the translation information - whether anybody translating
it etc. It does not make sense to restrict this for logged in users.
This commit removes that restriction.

The fetch by translation id or fetch all translations by a user demands
logging in. No change to that part.

Change-Id: Ibd538d668ddc04f22098f8a9f7174521bb2b2721
---
M api/ApiQueryContentTranslation.php
1 file changed, 4 insertions(+), 4 deletions(-)


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

diff --git a/api/ApiQueryContentTranslation.php 
b/api/ApiQueryContentTranslation.php
index 06d3c83..98e15c2 100644
--- a/api/ApiQueryContentTranslation.php
+++ b/api/ApiQueryContentTranslation.php
@@ -40,10 +40,6 @@
$result = $this->getResult();
$user = $this->getUser();
 
-   if ( $user->isAnon() ) {
-   $this->dieUsage( 'To view your translations, you must 
log in', 'notloggedin' );
-   }
-
if ( $params['sourcetitle'] && $params['from'] && $params['to'] 
) {
return $this->find(
$params['sourcetitle'],
@@ -52,6 +48,10 @@
);
}
 
+   if ( $user->isAnon() ) {
+   $this->dieUsage( 'To view your translations, you must 
log in', 'notloggedin' );
+   }
+
if ( $params['translationid'] ) {
$translator = new Translator( $user );
$translation = $translator->getTranslation( 
$params['translationid'] );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd538d668ddc04f22098f8a9f7174521bb2b2721
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh 

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


[MediaWiki-commits] [Gerrit] Per merge connection id - change (wikimedia...crm)

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

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

Change subject: Per merge connection id
..

Per merge connection id

Bug: T135063

Change-Id: I4c7be2b235fbc28bd6c30abbdc91a8a7e2b78f49
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/28/294428/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 04d570a..a1cce3f 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -2031,6 +2031,7 @@
 function wmf_civicrm_civicrm_merge( $type, &$refs, $mainId, $otherId, $tables 
) {
 switch ( $type ) {
   case 'batch' :
+CRM_Core_DAO::executeQuery('SET @uniqueID = %1', array(1 => 
array(uniqid() . CRM_Utils_String::createRandom(CRM_Utils_String::ALPHANUMERIC, 
4), 'String')));
 if (isset($refs['fields_in_conflict'])){
   $wmfCalculatedFields = wmf_civicrm_get_calculated_fields();
   foreach ($wmfCalculatedFields as $wmfCalculatedField) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4c7be2b235fbc28bd6c30abbdc91a8a7e2b78f49
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] giella-core: Initial Debian packaging - change (operations...giella-core)

2016-06-14 Thread KartikMistry (Code Review)
KartikMistry has uploaded a new change for review.

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

Change subject: giella-core: Initial Debian packaging
..

giella-core: Initial Debian packaging

Bug: T120087
Change-Id: I55ff2ef744eb40f00114150fe4a4af1e42fe2d77
---
A debian/changelog
A debian/compat
A debian/control
A debian/copyright
A debian/docs
A debian/rules
A debian/source/format
A debian/watch
8 files changed, 115 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/operations/debs/contenttranslation/giella-core 
refs/changes/26/294426/1

diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 000..e0d9e01
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,18 @@
+giella-core (0.1.1~r129227+svn121148-1+wmf1) jessie; urgency=low
+
+  * Rebuilt for Jessie.
+
+ -- Kartik Mistry   Wed, 15 Jun 2016 10:25:23 +0530
+
+giella-core (0.1.1~r129227+svn121148-1) unstable; urgency=low
+
+  * Old upstream release - downgrading to the version giella-sme needs
+
+ -- Tino Didriksen   Thu, 03 Mar 2016 08:45:22 +
+
+giella-core (0.1.1~r129227-1) unstable; urgency=low
+
+  [ Tino Didriksen ]
+  * Initial release (Closes: #814398)
+
+ -- Kartik Mistry   Thu, 11 Feb 2016 13:57:29 +0530
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 000..f80f1e6
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,21 @@
+Source: giella-core
+Section: science
+Priority: optional
+Maintainer: Debian Science Team 

+Uploaders: Tino Didriksen ,
+   Kartik Mistry 
+Build-Depends: autoconf,
+   autotools-dev,
+   debhelper (>= 9.0),
+   dh-autoreconf,
+   dh-exec (>= 0.3)
+Standards-Version: 3.9.7
+Homepage: http://giellatekno.uit.no/
+Vcs-Git: 
https://anonscm.debian.org/cgit/debian-science/packages/giella-core.git
+Vcs-Browser: 
https://anonscm.debian.org/cgit/debian-science/packages/giella-core.git
+
+Package: giella-core
+Architecture: all
+Depends: python, python3 (>= 3.1), ${misc:Depends}, ${shlibs:Depends}
+Description: GTCORE files for building Giellatekno language packages
+ All Giellatekno language packages build-depends on this package.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 000..b47a418
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,58 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Source: http://giellatekno.uit.no/
+
+Files: *
+Copyright: 2005-2016, Giellatekno at The University of Tromsø 

+License: GPL-3+
+
+Files: keyboards-templates/und/m4/giellatekno.m4
+Copyright: 2011, Divvun/Samediggi/UiT 
+License: GPL-3+
+
+License: GPL-3+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
+
+Files: keyboards-templates/und/m4/externals.m4
+Copyright: 2008, Andrew Collier 
+License: Other
+
+License: Other
+ Copying and distribution of this file, with or without modification, are
+ permitted in any medium without royalty provided the copyright notice
+ and this notice are preserved. This file is offered as-is, without any
+ warranty.
+
+Files: langs-templates/und/doc/sitemap.xmap langs-templates/und/doc/index.xml
+   langs-templates/und/doc/skinconf.xml
+Copyright: 2005-2016, Giellatekno at The University of Tromsø 

+License: Apache-2.0
+
+License: Apache-2.0
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+ .
+ http://www.apache.org/licenses/LICENSE-2.0
+ .
+ Unless required by applicable law or agreed to in writing, software
+ distributed 

[MediaWiki-commits] [Gerrit] apertium-fra-cat: New upstream release, Rebuilt for Jessie - change (operations...apertium-fra-cat)

2016-06-14 Thread KartikMistry (Code Review)
KartikMistry has uploaded a new change for review.

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

Change subject: apertium-fra-cat: New upstream release, Rebuilt for Jessie
..

apertium-fra-cat: New upstream release, Rebuilt for Jessie

This is apertium-fr-ca package, renamed as per upstream naming policy.

Change-Id: Ie257f718cf814bbf7455d1a12eb96a048d02e0b6
---
A debian/apertium-fra-cat.install
A debian/changelog
A debian/compat
A debian/control
A debian/copyright
A debian/docs
A debian/rules
A debian/source/format
A debian/watch
9 files changed, 176 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/operations/debs/contenttranslation/apertium-fra-cat
 refs/changes/25/294425/1

diff --git a/debian/apertium-fra-cat.install b/debian/apertium-fra-cat.install
new file mode 100644
index 000..dd95e40
--- /dev/null
+++ b/debian/apertium-fra-cat.install
@@ -0,0 +1 @@
+debian/tmp/*
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 000..f8154ca
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,59 @@
+apertium-fra-cat (1.1.0~r64309-1+wmf1) jessie; urgency=low
+
+  * Rebuild for Jessie.
+
+ -- Kartik Mistry   Wed, 15 Jun 2016 10:07:04 +0530
+
+apertium-fra-cat (1.1.0~r64309-1) unstable; urgency=low
+
+  [ Tino Didriksen ]
+  * New upstream release
+  * Binary and source packages are renamed as per upstream naming scheme.
+
+  [ Kartik Mistry ]
+  * debian/control:
++ Updated Standards-Version to 3.9.7 (no changes)
+  * debian/rules:
++ Skip tests.
+
+ -- Kartik Mistry   Sat, 27 Feb 2016 12:34:18 +0530
+
+apertium-fr-ca (1.0.3~r61329-1) unstable; urgency=low
+
+  [ Tino Didriksen ]
+  * New upstream release
+  * Significant changes in svn since tarball, so mixing new build scripts with
+old data files
+  * Re-done packaging to take advantage of debhelper 9
+
+  [ Kartik Mistry ]
+  * Set debian/compat to 9. Bumped dh dependency.
+  * Fixed debian/copyright.
+
+ -- Kartik Mistry   Fri, 31 Jul 2015 09:28:37 +0530
+
+apertium-fr-ca (1.0.2-1) unstable; urgency=low
+
+  * New upstream release
+  * Added dependency on apertium-pcre2
+
+ -- Francis Tyers   Thu, 12 Mar 2009 20:31:32 +
+
+apertium-fr-ca (1.0.0-2) unstable; urgency=low
+
+  * Fixed Build-Depends (Closes: #446595)
+  * Upgrade to Apertium 3.0 (Closes: #445830)
+
+ -- Francis Tyers   Mon, 22 Oct 2007 16:30:23 +0100
+
+apertium-fr-ca (1.0.0-1) unstable; urgency=low
+
+  * Release requires Apertium 3
+
+ -- Francis Tyers   Fri,  5 Oct 2007 16:03:00 +0100
+
+apertium-fr-ca (0.7-1) unstable; urgency=low
+
+  * Initial release (Closes: #389229)
+
+ -- Francis Tyers   Sun, 24 Sep 2006 18:26:50 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 000..e09d24e
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,43 @@
+Source: apertium-fra-cat
+Section: science
+Priority: optional
+Maintainer: Debian Science Team 

+Uploaders: Tino Didriksen ,
+   Kartik Mistry 
+Build-Depends: apertium-cat,
+   apertium-dev (>= 3.4),
+   apertium-fra,
+   apertium-lex-tools,
+   autotools-dev,
+   cg3,
+   debhelper (>= 9),
+   dh-autoreconf,
+   gawk,
+   pkg-config (>= 0.21)
+Standards-Version: 3.9.7
+Homepage: http://apertium.org/
+Vcs-Git: 
https://anonscm.debian.org/cgit/debian-science/packages/apertium-fra-cat.git
+Vcs-Browser: 
https://anonscm.debian.org/cgit/debian-science/packages/apertium-fra-cat.git
+
+Package: apertium-fra-cat
+Architecture: all
+Depends: apertium (>= 3.4),
+ apertium-lex-tools,
+ cg3,
+ ${misc:Depends},
+ ${shlibs:Depends}
+Provides: apertium-cat-fra
+Replaces: apertium-fr-ca (<< 1.1.0~)
+Breaks: apertium-fr-ca (<< 1.1.0~)
+Description: Apertium translation data for the French-Catalan pair
+ Data package providing Apertium language resources for translating
+ between the French and Catalan languages.
+
+Package: apertium-fr-ca
+Architecture: all
+Depends: apertium-fra-cat (= ${binary:Version}), ${misc:Depends}
+Priority: extra
+Section: oldlibs
+Provides: apertium-ca-fr
+Description: Transitional dummy package for apertium-fra-cat
+ This is a transitional dummy package. It can safely be removed.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 000..11bf1dd
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,51 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Source: http://apertium.org/
+
+Files: *
+Copyright: 2005, Universitat d'Alacant, 

[MediaWiki-commits] [Gerrit] Simplify and cleanup maxIncludeCacheTime() code - change (mediawiki/core)

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

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

Change subject: Simplify and cleanup maxIncludeCacheTime() code
..

Simplify and cleanup maxIncludeCacheTime() code

* Follow-up to 7730dee6.
* Let subclasses avoid having to check $wgMiserMode themselves.
* Use the Config object instead of global variables.

Change-Id: Ic48f5f5a7ed8e1d04b13922375fb7873adfa0c60
---
M includes/specialpage/SpecialPage.php
M includes/specials/SpecialNewpages.php
M includes/specials/SpecialRecentchanges.php
3 files changed, 12 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/24/294424/1

diff --git a/includes/specialpage/SpecialPage.php 
b/includes/specialpage/SpecialPage.php
index 6624414..f478203 100644
--- a/includes/specialpage/SpecialPage.php
+++ b/includes/specialpage/SpecialPage.php
@@ -186,12 +186,14 @@
 *  false to use the parent page's cache settings
 */
public function maxIncludeCacheTime() {
-   global $wgMiserMode;
-   if ( !$wgMiserMode ) {
-   return 0;
-   } else {
-   return 60*60;
-   }
+   return $this->getConfig()->get( 'MiserMode' ) ? 
$this->getCacheTTL() : 0;
+   }
+
+   /**
+* @return int Seconds that this page can be cached
+*/
+   protected function getCacheTTL() {
+   return 60 * 60;
}
 
/**
diff --git a/includes/specials/SpecialNewpages.php 
b/includes/specials/SpecialNewpages.php
index ff9a899..4f02263 100644
--- a/includes/specials/SpecialNewpages.php
+++ b/includes/specials/SpecialNewpages.php
@@ -479,17 +479,7 @@
return 'changes';
}
 
-   /**
-* How long to cache page when it is being included.
-*
-* @return int Time in seconds, 0 to disable caching altogether
-*/
-   public function maxIncludeCacheTime() {
-   global $wgMiserMode;
-   if ( !$wgMiserMode ) {
-   return 0;
-   } else {
-   return 60*5;
-   }
+   public function getCacheTTL() {
+   return 60 * 5;
}
 }
diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index 36ccd4a..561bfa2 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -795,18 +795,8 @@
return true;
}
 
-   /**
-* How long to cache page when it is being included.
-*
-* @return int|bool Time in seconds, 0 to disable caching altogether
-*/
-   public function maxIncludeCacheTime() {
-   global $wgMiserMode;
-   if ( !$wgMiserMode ) {
-   return 0;
-   } else {
-   return 60*5;
-   }
+   public function getCacheTTL() {
+   return 60 * 50;
}
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic48f5f5a7ed8e1d04b13922375fb7873adfa0c60
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] Don't show blacklist warning for autoconfirmed protection - change (mediawiki...TitleBlacklist)

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

Change subject: Don't show blacklist warning for autoconfirmed protection
..


Don't show blacklist warning for autoconfirmed protection

Bug: T137369
Change-Id: Ia03c770143f14505df0d2bcf8febca6f32777e58
---
M TitleBlacklist.hooks.php
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/TitleBlacklist.hooks.php b/TitleBlacklist.hooks.php
index 0af5603..7d6d89b 100644
--- a/TitleBlacklist.hooks.php
+++ b/TitleBlacklist.hooks.php
@@ -97,6 +97,10 @@
}
 
$params = $blacklisted->getParams();
+   if ( isset( $params['autoconfirmed'] ) ) {
+   return true;
+   }
+
$msg = wfMessage( 'titleblacklist-warning' );
$notices['titleblacklist'] = $msg->rawParams(
htmlspecialchars( $blacklisted->getRaw() ) 
)->parseAsBlock();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia03c770143f14505df0d2bcf8febca6f32777e58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TitleBlacklist
Gerrit-Branch: master
Gerrit-Owner: Jackmcbarn 
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] Make transcluded special pages not disable cache in miser mode. - change (mediawiki/core)

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

Change subject: Make transcluded special pages not disable cache in miser mode.
..


Make transcluded special pages not disable cache in miser mode.

Previously {{Special:Foo}} would cause parser cache to be disabled,
now have a method in SpecialPage to control this behaviour and set
arbitrary caching times.

Note: This does not affect caching of direct views to the special page

The new default is now disabling cache if not in miser mode,
otherwise setting to 1 hour, except for Special:Recentchanges
and Special:Newpages which set to 5 minutes. These values are
possibly really low, but for now I think best to be close to the
old behaviour. We had 0 caching for these things for years, and
afaik it hasn't caused any big issues. Part of me wonders if
Special:Recentchanges should stay at 0, but that sounds crazy.

This change also causes transcluded special pages to not be
"per-user" if they are being cached (Specificly $wgUser et al
become 127.0.0.1).

Bug: 60561
Change-Id: Id9ce987adeaa69d886eb1c5cd74c01072583e84d
---
M includes/parser/Parser.php
M includes/specialpage/SpecialPage.php
M includes/specials/SpecialNewpages.php
M includes/specials/SpecialRecentchanges.php
4 files changed, 58 insertions(+), 3 deletions(-)

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



diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index b563613..6c84623 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -3125,6 +3125,7 @@
&& 
$this->mOptions->getAllowSpecialInclusion()
&& $this->ot['html']
) {
+   $specialPage = 
SpecialPageFactory::getPage( $title->getDBkey() );
// Pass the template arguments as URL 
parameters.
// "uselang" will have no effect since 
the Language object
// is forced to the one defined in 
ParserOptions.
@@ -3143,7 +3144,12 @@
$context = new RequestContext;
$context->setTitle( $title );
$context->setRequest( new FauxRequest( 
$pageArgs ) );
-   $context->setUser( $this->getUser() );
+   if ( $specialPage && 
$specialPage->maxIncludeCacheTime() === 0 ) {
+   $context->setUser( 
$this->getUser() );
+   } else {
+   // If this page is cached, then 
we better not be per user.
+   $context->setUser( 
User::newFromName( '127.0.0.1', false ) );
+   }
$context->setLanguage( 
$this->mOptions->getUserLangObj() );
$ret = SpecialPageFactory::capturePath( 
$title, $context );
if ( $ret ) {
@@ -3151,8 +3157,9 @@

$this->mOutput->addOutputPageMetadata( $context->getOutput() );
$found = true;
$isHTML = true;
-   // Severely reduce cache time 
to keep content dynamic
-   
$this->mOutput->updateCacheExpiry( 30 );
+   if ( $specialPage && 
$specialPage->maxIncludeCacheTime() !== false ) {
+   
$this->mOutput->updateCacheExpiry( $specialPage->maxIncludeCacheTime() );
+   }
}
} elseif ( MWNamespace::isNonincludable( 
$title->getNamespace() ) ) {
$found = false; # access denied
diff --git a/includes/specialpage/SpecialPage.php 
b/includes/specialpage/SpecialPage.php
index 408c726..6624414 100644
--- a/includes/specialpage/SpecialPage.php
+++ b/includes/specialpage/SpecialPage.php
@@ -176,6 +176,25 @@
}
 
/**
+* How long to cache page when it is being included.
+*
+* @note If cache time is not 0, then the current user becomes an anon
+*   if you want to do any per-user customizations, than this method
+*   must be overriden to return 0.
+* @since 1.26
+* @return int Time in seconds, 0 to disable caching altogether,
+*  false to use the parent page's cache settings
+*/
+   public function 

[MediaWiki-commits] [Gerrit] Remove "jshint evil:true" where not required - change (mediawiki/core)

2016-06-14 Thread PleaseStand (Code Review)
PleaseStand has uploaded a new change for review.

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

Change subject: Remove "jshint evil:true" where not required
..

Remove "jshint evil:true" where not required

* resources/src/startup.js: No more document.write() since
  d7905627fdc3b210.
* tests/qunit/data/testrunner.js: No more document.write()
  since 05f6edc903f81993, and the TestSwarm agent loading
  code was removed entirely in 0e9f24a169fdb9b9.

Change-Id: Iac61874e3ca04e1cad0d0fb2b7cebdc9fd4b237a
---
M resources/src/startup.js
M tests/qunit/data/testrunner.js
2 files changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/23/294423/1

diff --git a/resources/src/startup.js b/resources/src/startup.js
index 312e745..62ee94e 100644
--- a/resources/src/startup.js
+++ b/resources/src/startup.js
@@ -3,7 +3,7 @@
  *
  * This file is where we decide whether to initialise the modern run-time.
  */
-/*jshint unused: false, evil: true */
+/*jshint unused: false */
 /*globals mw, RLQ: true, NORLQ: true, $VARS, $CODE, performance */
 
 var mediaWikiLoadStart = ( new Date() ).getTime(),
diff --git a/tests/qunit/data/testrunner.js b/tests/qunit/data/testrunner.js
index 1091d09..79f37dc 100644
--- a/tests/qunit/data/testrunner.js
+++ b/tests/qunit/data/testrunner.js
@@ -1,5 +1,4 @@
 /*global CompletenessTest, sinon */
-/*jshint evil: true */
 ( function ( $, mw, QUnit ) {
'use strict';
 

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

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

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


[MediaWiki-commits] [Gerrit] Revert "Use a low TTL for parser output when special pages a... - change (mediawiki/core)

2016-06-14 Thread Aaron Schulz (Code Review)
Aaron Schulz has submitted this change and it was merged.

Change subject: Revert "Use a low TTL for parser output when special pages are 
included"
..


Revert "Use a low TTL for parser output when special pages are included"

Needs some follow up and does not have a huge impact.

This reverts commit 48652dfc27d1bbaab41b3a4d8f7d6be23e2da6b6.

Change-Id: I4408477a1bd212e514f7f19ce776bd142c4feb39
---
M includes/parser/Parser.php
1 file changed, 1 insertion(+), 2 deletions(-)

Approvals:
  Aaron Schulz: Verified; Looks good to me, approved



diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index b1c3efa..116b274 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -3155,8 +3155,7 @@

$this->mOutput->addOutputPageMetadata( $context->getOutput() );
$found = true;
$isHTML = true;
-   // Severely reduce cache time 
to keep content dynamic
-   
$this->mOutput->updateCacheExpiry( 30 );
+   $this->disableCache();
}
} elseif ( MWNamespace::isNonincludable( 
$title->getNamespace() ) ) {
$found = false; # access denied

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4408477a1bd212e514f7f19ce776bd142c4feb39
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.5
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Cscott 
Gerrit-Reviewer: Jackmcbarn 

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


[MediaWiki-commits] [Gerrit] Revert "Use a low TTL for parser output when special pages a... - change (mediawiki/core)

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

Change subject: Revert "Use a low TTL for parser output when special pages are 
included"
..


Revert "Use a low TTL for parser output when special pages are included"

Needs some follow up and does not have a huge impact.

This reverts commit 78de24a20c4662ea709e1f8af84bb5fae4aea2fa.

Change-Id: Iabd3459466fd65c208696b2cdff2842bfc2300df
---
M includes/parser/Parser.php
1 file changed, 1 insertion(+), 2 deletions(-)

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



diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index b563613..63a297b 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -3151,8 +3151,7 @@

$this->mOutput->addOutputPageMetadata( $context->getOutput() );
$found = true;
$isHTML = true;
-   // Severely reduce cache time 
to keep content dynamic
-   
$this->mOutput->updateCacheExpiry( 30 );
+   $this->disableCache();
}
} elseif ( MWNamespace::isNonincludable( 
$title->getNamespace() ) ) {
$found = false; # access denied

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iabd3459466fd65c208696b2cdff2842bfc2300df
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.6
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Cscott 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Revert "Use a low TTL for parser output when special pages a... - change (mediawiki/core)

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

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

Change subject: Revert "Use a low TTL for parser output when special pages are 
included"
..

Revert "Use a low TTL for parser output when special pages are included"

Needs some follow up and does not have a huge impact.

This reverts commit 48652dfc27d1bbaab41b3a4d8f7d6be23e2da6b6.

Change-Id: I4408477a1bd212e514f7f19ce776bd142c4feb39
---
M includes/parser/Parser.php
1 file changed, 1 insertion(+), 2 deletions(-)


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

diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index b1c3efa..116b274 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -3155,8 +3155,7 @@

$this->mOutput->addOutputPageMetadata( $context->getOutput() );
$found = true;
$isHTML = true;
-   // Severely reduce cache time 
to keep content dynamic
-   
$this->mOutput->updateCacheExpiry( 30 );
+   $this->disableCache();
}
} elseif ( MWNamespace::isNonincludable( 
$title->getNamespace() ) ) {
$found = false; # access denied

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

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

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


[MediaWiki-commits] [Gerrit] Revert "Use a low TTL for parser output when special pages a... - change (mediawiki/core)

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

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

Change subject: Revert "Use a low TTL for parser output when special pages are 
included"
..

Revert "Use a low TTL for parser output when special pages are included"

Needs some follow up and does not have a huge impact.

This reverts commit 78de24a20c4662ea709e1f8af84bb5fae4aea2fa.

Change-Id: Iabd3459466fd65c208696b2cdff2842bfc2300df
---
M includes/parser/Parser.php
1 file changed, 1 insertion(+), 2 deletions(-)


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

diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index b563613..63a297b 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -3151,8 +3151,7 @@

$this->mOutput->addOutputPageMetadata( $context->getOutput() );
$found = true;
$isHTML = true;
-   // Severely reduce cache time 
to keep content dynamic
-   
$this->mOutput->updateCacheExpiry( 30 );
+   $this->disableCache();
}
} elseif ( MWNamespace::isNonincludable( 
$title->getNamespace() ) ) {
$found = false; # access denied

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

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

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


[MediaWiki-commits] [Gerrit] CRM-18958 add limit to dedupe screen - change (wikimedia...civicrm)

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

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

Change subject: CRM-18958 add limit to dedupe screen
..

CRM-18958 add limit to dedupe screen

Bug: T135051

Change-Id: Id445faf27ef9ba42650c4350e42b12864442568e
---
M CRM/Contact/BAO/Group.php
M CRM/Contact/Form/DedupeFind.php
M CRM/Contact/Page/DedupeFind.php
M CRM/Dedupe/BAO/RuleGroup.php
M CRM/Dedupe/Finder.php
M templates/CRM/Contact/Form/DedupeFind.tpl
6 files changed, 42 insertions(+), 16 deletions(-)


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

diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php
index 075d926..4374681 100644
--- a/CRM/Contact/BAO/Group.php
+++ b/CRM/Contact/BAO/Group.php
@@ -197,10 +197,10 @@
* @return array
*   this array contains the list of members for this group id
*/
-  public static function ($groupID, $useCache = TRUE) {
+  public static function getMember($groupID, $useCache = TRUE, $limit) {
 $params = array(array('group', '=', $groupID, 0, 0));
 $returnProperties = array('contact_id');
-list($contacts, $_) = CRM_Contact_BAO_Query::apiQuery($params, 
$returnProperties, NULL, NULL, 0, 0, $useCache);
+list($contacts, $_) = CRM_Contact_BAO_Query::apiQuery($params, 
$returnProperties, NULL, NULL, 0, $limit, $useCache);
 
 $aMembers = array();
 foreach ($contacts as $contact) {
diff --git a/CRM/Contact/Form/DedupeFind.php b/CRM/Contact/Form/DedupeFind.php
index cf8bb23..f929082 100644
--- a/CRM/Contact/Form/DedupeFind.php
+++ b/CRM/Contact/Form/DedupeFind.php
@@ -51,6 +51,7 @@
 $groupList = array('' => ts('- All Contacts -')) + 
CRM_Core_PseudoConstant::nestedGroup();
 
 $this->add('select', 'group_id', ts('Select Group'), $groupList, FALSE, 
array('class' => 'crm-select2 huge'));
+$this->add('text', 'limit', ts('No of contacts to find matches for '));
 $this->addButtons(array(
 array(
   'type' => 'next',
@@ -69,6 +70,7 @@
   }
 
   public function setDefaultValues() {
+$this->_defaults['limit'] = 1000;
 return $this->_defaults;
   }
 
@@ -82,11 +84,13 @@
   
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/deduperules', 
'reset=1'));
   return;
 }
+$url = CRM_Utils_System::url('civicrm/contact/dedupefind', 
"reset=1=update={$this->rgid}");
 if ($values['group_id']) {
-  $url = CRM_Utils_System::url('civicrm/contact/dedupefind', 
"reset=1=update={$this->rgid}={$values['group_id']}");
+  $url .= CRM_Utils_System::url("={$values['group_id']}");
 }
-else {
-  $url = CRM_Utils_System::url('civicrm/contact/dedupefind', 
"reset=1=update={$this->rgid}");
+
+if ($values['limit']) {
+  $url .= '=' . $values['limit'];
 }
 
 CRM_Utils_System::redirect($url);
diff --git a/CRM/Contact/Page/DedupeFind.php b/CRM/Contact/Page/DedupeFind.php
index 498981e..4bc94a6 100644
--- a/CRM/Contact/Page/DedupeFind.php
+++ b/CRM/Contact/Page/DedupeFind.php
@@ -59,6 +59,7 @@
 $gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE, 0);
 $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 0);
 $context = CRM_Utils_Request::retrieve('context', 'String', $this);
+$limit = CRM_Utils_Request::retrieve('limit', 'Integer', $this);
 
 $session = CRM_Core_Session::singleton();
 $contactIds = $session->get('selectedSearchContactIds');
@@ -174,7 +175,7 @@
 if ($gid) {
   $foundDupes = $this->get("dedupe_dupes_$gid");
   if (!$foundDupes) {
-$foundDupes = CRM_Dedupe_Finder::dupesInGroup($rgid, $gid);
+$foundDupes = CRM_Dedupe_Finder::dupesInGroup($rgid, $gid, $limit);
   }
   $this->set("dedupe_dupes_$gid", $foundDupes);
 }
@@ -188,7 +189,7 @@
 else {
   $foundDupes = $this->get('dedupe_dupes');
   if (!$foundDupes) {
-$foundDupes = CRM_Dedupe_Finder::dupes($rgid);
+$foundDupes = CRM_Dedupe_Finder::dupes($rgid, array(), TRUE, 
$limit);
   }
   $this->set('dedupe_dupes', $foundDupes);
 }
@@ -225,8 +226,7 @@
   // (also, consider sorting by dupe count first)
   // lobo - change the sort to by threshold value
   // so the more likely dupes are sorted first
-  $session = CRM_Core_Session::singleton();
-  $userId = $session->get('userID');
+  $userId = CRM_Core_Session::singleton()->getLoggedInContactID();
   $mainContacts = $permission = array();
 
   foreach ($foundDupes as $dupes) {
diff --git a/CRM/Dedupe/BAO/RuleGroup.php b/CRM/Dedupe/BAO/RuleGroup.php
index dafa322..4e6d4e6 100644
--- a/CRM/Dedupe/BAO/RuleGroup.php
+++ b/CRM/Dedupe/BAO/RuleGroup.php
@@ -45,6 +45,15 @@
   var $contactIds = array();
 
   /**
+   * Set the contact IDs to restrict the dedupe to.
+   *
+   * @param array 

[MediaWiki-commits] [Gerrit] Don't show blacklist warning for autoconfirmed protection - change (mediawiki...TitleBlacklist)

2016-06-14 Thread Jackmcbarn (Code Review)
Jackmcbarn has uploaded a new change for review.

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

Change subject: Don't show blacklist warning for autoconfirmed protection
..

Don't show blacklist warning for autoconfirmed protection

Bug: T137369
Change-Id: Ia03c770143f14505df0d2bcf8febca6f32777e58
---
M TitleBlacklist.hooks.php
1 file changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/TitleBlacklist.hooks.php b/TitleBlacklist.hooks.php
index 0af5603..7d6d89b 100644
--- a/TitleBlacklist.hooks.php
+++ b/TitleBlacklist.hooks.php
@@ -97,6 +97,10 @@
}
 
$params = $blacklisted->getParams();
+   if ( isset( $params['autoconfirmed'] ) ) {
+   return true;
+   }
+
$msg = wfMessage( 'titleblacklist-warning' );
$notices['titleblacklist'] = $msg->rawParams(
htmlspecialchars( $blacklisted->getRaw() ) 
)->parseAsBlock();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia03c770143f14505df0d2bcf8febca6f32777e58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TitleBlacklist
Gerrit-Branch: master
Gerrit-Owner: Jackmcbarn 

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


[MediaWiki-commits] [Gerrit] Improve client-side edit stash change detection - change (mediawiki/core)

2016-06-14 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Improve client-side edit stash change detection
..


Improve client-side edit stash change detection

The keypress event does not fire for backspace or delete in IE, Chrome, or
Safari, which means we are missing out on stash opportunities when the last
action is to delete some text. Fix that by listening for the keyup event
instead.

Also add an isChanged() check before calling pending.abort(), because there are
a lot of special keys that don't modify the text, and not all of them are coded
consistently on different platforms (think volume up/down, mute, function keys,
etc.), so we can't be exhaustive, and should instead fall back to actually
checking for changes. Otherwise we risk aborting stash requests when the user
has not changed the text.

Lastly, rename 'onTextChanged' to 'onEditorIdle', which is more accurate.
On undo / rollback, onTextChanged will return true the first time it is called,
even though the text had not changed in that case.

Useful sources:

* Key codes of keydown and keyup events:
  http://www.javascripter.net/faq/keycodes.htm
* Quirksmode: detecting keystrokes
  http://www.quirksmode.org/js/keys.html
* Why isn't backspace being detected using jquery keypress event?
  http://stackoverflow.com/q/4418562

Change-Id: Idfad8407c8e905d8de80bc54379545f1b586fc88
(cherry picked from commit eca800c7f02023030a8e97bfc611d222f0edcdb3)
(cherry picked from commit 3e48c0ff370819a560f90b00f72b45c62ca2adf0)
---
M resources/src/mediawiki.action/mediawiki.action.edit.stash.js
1 file changed, 9 insertions(+), 12 deletions(-)

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



diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.stash.js 
b/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
index d354fc2..3288e1a 100644
--- a/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
+++ b/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
@@ -45,7 +45,7 @@
return newText !== data.wpTextbox1;
}
 
-   function onTextChanged() {
+   function onEditorIdle() {
if ( !isChanged() ) {
return;
}
@@ -53,20 +53,17 @@
stashEdit();
}
 
-   function onTextKeyPress( e ) {
+   function onTextKeyUp( e ) {
// Ignore keystrokes that don't modify text, like 
cursor movements.
-   // See .
-   if ( e.which === 0 ) {
+   // See  
and
+   // . We don't 
have to be
+   // exhaustive, because the cost of misfiring is low.
+   if ( ( e.which >= 33 && e.which <= 40 ) || ( e.which >= 
16 && e.which <= 18 ) ) {
return;
}
 
clearTimeout( timer );
-
-   if ( pending ) {
-   pending.abort();
-   }
-
-   timer = setTimeout( onTextChanged, idleTimeout );
+   timer = setTimeout( onEditorIdle, idleTimeout );
}
 
function onFormLoaded() {
@@ -84,8 +81,8 @@
return;
}
 
-   $text.on( { change: onTextChanged, keypress: onTextKeyPress } );
-   $summary.on( { focus: onTextChanged } );
+   $text.on( { change: onEditorIdle, keyup: onTextKeyUp } );
+   $summary.on( { focus: onEditorIdle } );
onFormLoaded();
 
} );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idfad8407c8e905d8de80bc54379545f1b586fc88
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.5
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Edokter 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Roundtrip 2.0.0 content - change (mediawiki...parsoid)

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

Change subject: Roundtrip 2.0.0 content
..


Roundtrip 2.0.0 content

 * This is a follow up to b692ba97.

 * Applies data-mw passed in a pagebundle, in a backwards compatible
   way.

 * Adds a mocha test that could have been part of 06e08a00, to emphasize
   when data-mw isn't being applied.

Change-Id: I834a6640eb982d760cdbba0c64d9ce48025bc65d
---
M bin/parse.js
M bin/roundtrip-test.js
M lib/api/apiUtils.js
M lib/api/routes.js
M tests/mocha/api.js
M tests/rttest.localsettings.js
6 files changed, 112 insertions(+), 20 deletions(-)

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



diff --git a/bin/parse.js b/bin/parse.js
index a326223..852cecd 100755
--- a/bin/parse.js
+++ b/bin/parse.js
@@ -102,7 +102,7 @@
'boolean': false,
'default': false,
},
-   'contentversion': {
+   'contentVersion': {
description: 'The acceptable content version.',
'boolean': false,
'default': ParserEnv.prototype.contentVersion,
@@ -219,8 +219,8 @@
env.pageBundle = argv.pagebundle;
 
// The content version to output
-   if (argv.contentversion) {
-   env.setContentVersion(argv.contentversion);
+   if (argv.contentVersion) {
+   env.setContentVersion(argv.contentVersion);
}
 
if (!argv.wt2html) {
diff --git a/bin/roundtrip-test.js b/bin/roundtrip-test.js
index 28c1d91..cc1aca2 100755
--- a/bin/roundtrip-test.js
+++ b/bin/roundtrip-test.js
@@ -8,10 +8,13 @@
 var Promise = require('../lib/utils/promise.js');
 var Util = require('../lib/utils/Util.js').Util;
 var DU = require('../lib/utils/DOMUtils.js').DOMUtils;
+var apiUtils = require('../lib/api/apiUtils');
 var ParsoidConfig = require('../lib/config/ParsoidConfig.js').ParsoidConfig;
 var Diff = require('../lib/utils/Diff.js').Diff;
 
 var gzip = Promise.promisify(require('zlib').gzip, false);
+
+var defaultContentVersion = '1.2.1';
 
 
 function displayDiff(type, count) {
@@ -382,8 +385,14 @@
var newBody = domino.createDocument(data.newHTML.body).body;
 
// Merge pagebundles so that HTML nodes can be compared and diff'ed.
-   DU.applyPageBundle(oldBody.ownerDocument, { parsoid: data.oldDp.body });
-   DU.applyPageBundle(newBody.ownerDocument, { parsoid: data.newDp.body });
+   DU.applyPageBundle(oldBody.ownerDocument, {
+   parsoid: data.oldDp.body,
+   mw: data.oldMw && data.oldMw.body,
+   });
+   DU.applyPageBundle(newBody.ownerDocument, {
+   parsoid: data.newDp.body,
+   mw: data.newMw && data.newMw.body,
+   });
 
// Strip 'mw..' ids from the DOMs. This matters for 2 scenarios:
// * reduces noise in visual diffs
@@ -477,6 +486,9 @@
httpOptions.body.scrub_wikitext = true;
} else {  // wt2html
uri += 'wikitext/to/pagebundle/' + options.title;
+   httpOptions.headers = {
+   Accept: apiUtils.pagebundleContentType(null, 
options.contentVersion),
+   };
}
httpOptions.uri = uri;
 
@@ -520,6 +532,7 @@
return parsoidPost(profile, options).then(function(body) {
data.newHTML = body.html;
data.newDp = body['data-parsoid'];
+   data.newMw = body['data-mw'];
return checkIfSignificant(offsets, data);
});
 }
@@ -573,6 +586,7 @@
var parsoidOptions = {
uri: uri + domain + '/v3/',
title: encodeURIComponent(title),
+   contentVersion: options.contentVersion || defaultContentVersion,
};
 
var data = {};
@@ -597,6 +611,7 @@
}).then(function(body) {
data.oldHTML = body.html;
data.oldDp = body['data-parsoid'];
+   data.oldMw = body['data-mw'];
// Now, request the wikitext for the obtained HTML
var opts = Object.assign({
html2wt: true,
@@ -605,6 +620,7 @@
html: data.oldHTML,
original: {
'data-parsoid': data.oldDp,
+   'data-mw': data.oldMw,
wikitext: { body: data.oldWt, },
},
},
@@ -630,6 +646,7 @@
html: newDocument.outerHTML,
original: {
'data-parsoid': data.oldDp,
+   'data-mw': data.oldMw,
wikitext: { body: data.oldWt },

[MediaWiki-commits] [Gerrit] Improve client-side edit stash change detection - change (mediawiki/core)

2016-06-14 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Improve client-side edit stash change detection
..

Improve client-side edit stash change detection

The keypress event does not fire for backspace or delete in IE, Chrome, or
Safari, which means we are missing out on stash opportunities when the last
action is to delete some text. Fix that by listening for the keyup event
instead.

Also add an isChanged() check before calling pending.abort(), because there are
a lot of special keys that don't modify the text, and not all of them are coded
consistently on different platforms (think volume up/down, mute, function keys,
etc.), so we can't be exhaustive, and should instead fall back to actually
checking for changes. Otherwise we risk aborting stash requests when the user
has not changed the text.

Lastly, rename 'onTextChanged' to 'onEditorIdle', which is more accurate.
On undo / rollback, onTextChanged will return true the first time it is called,
even though the text had not changed in that case.

Useful sources:

* Key codes of keydown and keyup events:
  http://www.javascripter.net/faq/keycodes.htm
* Quirksmode: detecting keystrokes
  http://www.quirksmode.org/js/keys.html
* Why isn't backspace being detected using jquery keypress event?
  http://stackoverflow.com/q/4418562

Change-Id: Idfad8407c8e905d8de80bc54379545f1b586fc88
(cherry picked from commit eca800c7f02023030a8e97bfc611d222f0edcdb3)
(cherry picked from commit 3e48c0ff370819a560f90b00f72b45c62ca2adf0)
---
M resources/src/mediawiki.action/mediawiki.action.edit.stash.js
1 file changed, 9 insertions(+), 12 deletions(-)


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

diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.stash.js 
b/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
index d354fc2..3288e1a 100644
--- a/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
+++ b/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
@@ -45,7 +45,7 @@
return newText !== data.wpTextbox1;
}
 
-   function onTextChanged() {
+   function onEditorIdle() {
if ( !isChanged() ) {
return;
}
@@ -53,20 +53,17 @@
stashEdit();
}
 
-   function onTextKeyPress( e ) {
+   function onTextKeyUp( e ) {
// Ignore keystrokes that don't modify text, like 
cursor movements.
-   // See .
-   if ( e.which === 0 ) {
+   // See  
and
+   // . We don't 
have to be
+   // exhaustive, because the cost of misfiring is low.
+   if ( ( e.which >= 33 && e.which <= 40 ) || ( e.which >= 
16 && e.which <= 18 ) ) {
return;
}
 
clearTimeout( timer );
-
-   if ( pending ) {
-   pending.abort();
-   }
-
-   timer = setTimeout( onTextChanged, idleTimeout );
+   timer = setTimeout( onEditorIdle, idleTimeout );
}
 
function onFormLoaded() {
@@ -84,8 +81,8 @@
return;
}
 
-   $text.on( { change: onTextChanged, keypress: onTextKeyPress } );
-   $summary.on( { focus: onTextChanged } );
+   $text.on( { change: onEditorIdle, keyup: onTextKeyUp } );
+   $summary.on( { focus: onEditorIdle } );
onFormLoaded();
 
} );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idfad8407c8e905d8de80bc54379545f1b586fc88
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.5
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Deprecate Parser::disableCache - change (mediawiki/core)

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

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

Change subject: Deprecate Parser::disableCache
..

Deprecate Parser::disableCache

Few maintained extensions still rely on this and it is
bad practice to use this for handling cache correctness.

Change-Id: I2de481198bbff5c4f3dd81fc6d1b137e4c37b93f
---
M includes/parser/CacheTime.php
M includes/parser/Parser.php
2 files changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/includes/parser/CacheTime.php b/includes/parser/CacheTime.php
index 2451390..05bcebe 100644
--- a/includes/parser/CacheTime.php
+++ b/includes/parser/CacheTime.php
@@ -79,12 +79,15 @@
 
/**
 * Sets the number of seconds after which this object should expire.
+*
 * This value is used with the ParserCache.
 * If called with a value greater than the value provided at any 
previous call,
 * the new call has no effect. The value returned by getCacheExpiry is 
smaller
 * or equal to the smallest number that was provided as an argument to
 * updateCacheExpiry().
 *
+* Avoid using 0 if at all possible. Consider JavaScript for highly 
dynamic content.
+*
 * @param int $seconds
 */
public function updateCacheExpiry( $seconds ) {
diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 63a297b..848c308 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -5294,6 +5294,7 @@
/**
 * Set a flag in the output object indicating that the content is 
dynamic and
 * shouldn't be cached.
+* @deprecated since 1.28; use getOutput()->updateCacheExpiry()
 */
public function disableCache() {
wfDebug( "Parser output marked as uncacheable.\n" );

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

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

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


[MediaWiki-commits] [Gerrit] Use a low TTL for parser output when special pages are included - change (mediawiki/core)

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

Change subject: Use a low TTL for parser output when special pages are included
..


Use a low TTL for parser output when special pages are included

Previously, no TTL at all was used, which is quite harsh on
performance and had downstream effects like disabling edit
stashing for affected pages.

Bug: T136678
Change-Id: I2462057aa189cfb05fe65d0b3c081a9fd10066a2
---
M includes/parser/Parser.php
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 63a297b..b563613 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -3151,7 +3151,8 @@

$this->mOutput->addOutputPageMetadata( $context->getOutput() );
$found = true;
$isHTML = true;
-   $this->disableCache();
+   // Severely reduce cache time 
to keep content dynamic
+   
$this->mOutput->updateCacheExpiry( 30 );
}
} elseif ( MWNamespace::isNonincludable( 
$title->getNamespace() ) ) {
$found = false; # access denied

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2462057aa189cfb05fe65d0b3c081a9fd10066a2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.6
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Cscott 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Use a low TTL for parser output when special pages are included - change (mediawiki/core)

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

Change subject: Use a low TTL for parser output when special pages are included
..


Use a low TTL for parser output when special pages are included

Previously, no TTL at all was used, which is quite harsh on
performance and had downstream effects like disabling edit
stashing for affected pages.

Bug: T136678
Change-Id: I2462057aa189cfb05fe65d0b3c081a9fd10066a2
---
M includes/parser/Parser.php
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 116b274..b1c3efa 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -3155,7 +3155,8 @@

$this->mOutput->addOutputPageMetadata( $context->getOutput() );
$found = true;
$isHTML = true;
-   $this->disableCache();
+   // Severely reduce cache time 
to keep content dynamic
+   
$this->mOutput->updateCacheExpiry( 30 );
}
} elseif ( MWNamespace::isNonincludable( 
$title->getNamespace() ) ) {
$found = false; # access denied

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2462057aa189cfb05fe65d0b3c081a9fd10066a2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.5
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Cscott 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Use a low TTL for parser output when special pages are included - change (mediawiki/core)

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

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

Change subject: Use a low TTL for parser output when special pages are included
..

Use a low TTL for parser output when special pages are included

Previously, no TTL at all was used, which is quite harsh on
performance and had downstream effects like disabling edit
stashing for affected pages.

Bug: T136678
Change-Id: I2462057aa189cfb05fe65d0b3c081a9fd10066a2
---
M includes/parser/Parser.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/16/294416/1

diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 116b274..b1c3efa 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -3155,7 +3155,8 @@

$this->mOutput->addOutputPageMetadata( $context->getOutput() );
$found = true;
$isHTML = true;
-   $this->disableCache();
+   // Severely reduce cache time 
to keep content dynamic
+   
$this->mOutput->updateCacheExpiry( 30 );
}
} elseif ( MWNamespace::isNonincludable( 
$title->getNamespace() ) ) {
$found = false; # access denied

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

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

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


[MediaWiki-commits] [Gerrit] Use a low TTL for parser output when special pages are included - change (mediawiki/core)

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

Change subject: Use a low TTL for parser output when special pages are included
..


Use a low TTL for parser output when special pages are included

Previously, no TTL at all was used, which is quite harsh on
performance and had downstream effects like disabling edit
stashing for affected pages.

Bug: T136678
Change-Id: I2462057aa189cfb05fe65d0b3c081a9fd10066a2
---
M includes/parser/Parser.php
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 63a297b..b563613 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -3151,7 +3151,8 @@

$this->mOutput->addOutputPageMetadata( $context->getOutput() );
$found = true;
$isHTML = true;
-   $this->disableCache();
+   // Severely reduce cache time 
to keep content dynamic
+   
$this->mOutput->updateCacheExpiry( 30 );
}
} elseif ( MWNamespace::isNonincludable( 
$title->getNamespace() ) ) {
$found = false; # access denied

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2462057aa189cfb05fe65d0b3c081a9fd10066a2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Cscott 
Gerrit-Reviewer: Jackmcbarn 
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] Use a low TTL for parser output when special pages are included - change (mediawiki/core)

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

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

Change subject: Use a low TTL for parser output when special pages are included
..

Use a low TTL for parser output when special pages are included

Previously, no TTL at all was used, which is quite harsh on
performance and had downstream effects like disabling edit
stashing for affected pages.

Bug: T136678
Change-Id: I2462057aa189cfb05fe65d0b3c081a9fd10066a2
---
M includes/parser/Parser.php
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 63a297b..b563613 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -3151,7 +3151,8 @@

$this->mOutput->addOutputPageMetadata( $context->getOutput() );
$found = true;
$isHTML = true;
-   $this->disableCache();
+   // Severely reduce cache time 
to keep content dynamic
+   
$this->mOutput->updateCacheExpiry( 30 );
}
} elseif ( MWNamespace::isNonincludable( 
$title->getNamespace() ) ) {
$found = false; # access denied

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

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

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


[MediaWiki-commits] [Gerrit] Use a low TTL for parser output when special pages are included - change (mediawiki/core)

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

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

Change subject: Use a low TTL for parser output when special pages are included
..

Use a low TTL for parser output when special pages are included

Previously, no TTL at all was used, which is quite harsh on
performance and had downstream effects like disabling edit
stashing for affected pages.

Bug: T136678
Change-Id: I2462057aa189cfb05fe65d0b3c081a9fd10066a2
---
M includes/parser/Parser.php
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 63a297b..b563613 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -3151,7 +3151,8 @@

$this->mOutput->addOutputPageMetadata( $context->getOutput() );
$found = true;
$isHTML = true;
-   $this->disableCache();
+   // Severely reduce cache time 
to keep content dynamic
+   
$this->mOutput->updateCacheExpiry( 30 );
}
} elseif ( MWNamespace::isNonincludable( 
$title->getNamespace() ) ) {
$found = false; # access denied

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2462057aa189cfb05fe65d0b3c081a9fd10066a2
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] Maintenance: Use __DIR__ instead of dirname( __FILE__ ) - change (mediawiki/core)

2016-06-14 Thread PleaseStand (Code Review)
PleaseStand has uploaded a new change for review.

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

Change subject: Maintenance: Use __DIR__ instead of dirname( __FILE__ )
..

Maintenance: Use __DIR__ instead of dirname( __FILE__ )

dirname( __FILE__ ) was used because it worked in PHP 5.2, allowing
the version check to function correctly. However, Maintenance.php
now uses the short array syntax, which is a parse error before 5.4:

> Parse error: syntax error, unexpected '[' in maintenance/Maintenance.php
> on line 66

Change-Id: I3373a02c684bb6cbde83d7bedc204818f3394602
---
M maintenance/Maintenance.php
1 file changed, 2 insertions(+), 4 deletions(-)


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

diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php
index a08297a..27d8161 100644
--- a/maintenance/Maintenance.php
+++ b/maintenance/Maintenance.php
@@ -21,10 +21,8 @@
  */
 
 // Bail on old versions of PHP, or if composer has not been run yet to install
-// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
-// @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound
-require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php';
-// @codingStandardsIgnoreEnd
+// dependencies.
+require_once __DIR__ . '/../includes/PHPVersionCheck.php';
 wfEntryPointCheck( 'cli' );
 
 /**

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

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

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


[MediaWiki-commits] [Gerrit] SECURITY: Fix XSS via __proto__ - change (mediawiki...Kartographer)

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

Change subject: SECURITY: Fix XSS via __proto__
..


SECURITY: Fix XSS via __proto__

Bug: T134719
Change-Id: I4b537f018c8d37491f46349ac9c764279123deb1
---
M includes/SimpleStyleParser.php
M tests/phpunit/KartographerTest.php
2 files changed, 42 insertions(+), 9 deletions(-)

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



diff --git a/includes/SimpleStyleParser.php b/includes/SimpleStyleParser.php
index 1157748..714ab27 100644
--- a/includes/SimpleStyleParser.php
+++ b/includes/SimpleStyleParser.php
@@ -14,8 +14,6 @@
 class SimpleStyleParser {
private static $parsedProps = [ 'title', 'description' ];
 
-   private static $recursedProps = [ 'geometry', 'geometries', 'features' 
];
-
/** @var Parser */
private $parser;
 
@@ -145,15 +143,18 @@
return;
}
 
-   if ( property_exists( $json, 'properties' ) && is_object( 
$json->properties ) ) {
-   $this->sanitizeProperties( $json->properties );
-   }
-
-   foreach ( self::$recursedProps as $prop ) {
-   if ( property_exists( $json, $prop ) ) {
+   foreach ( array_keys( get_object_vars( $json ) ) as $prop ) {
+   // https://phabricator.wikimedia.org/T134719
+   if ( $prop[0] === '_' ) {
+   unset( $json->$prop );
+   } else {
$this->sanitize( $json->$prop );
}
}
+
+   if ( property_exists( $json, 'properties' ) && is_object( 
$json->properties ) ) {
+   $this->sanitizeProperties( $json->properties );
+   }
}
 
/**
diff --git a/tests/phpunit/KartographerTest.php 
b/tests/phpunit/KartographerTest.php
index 4d5ad2e..47610c6 100644
--- a/tests/phpunit/KartographerTest.php
+++ b/tests/phpunit/KartographerTest.php
@@ -64,7 +64,37 @@
   "marker-size": "medium",
   "marker-color": "0050d0"
 }
-  }';
+ }';
+   /** @noinspection HtmlUnknownTarget */
+   $xssJson = '[
+  {
+   "__proto__": { "some": "bad stuff" },
+   "type": "Feature",
+   "geometry": {
+   "type": "Point",
+   "coordinates": [-122.3988, 37.8013]
+   },
+   "properties": {
+   "__proto__": { "foo": "bar" },
+   "title": "Foo bar"
+   }
+  },
+  {
+   "type": "GeometryCollection",
+   "geometries": [
+   {
+   "__proto__": "recurse me",
+   "type": "Point",
+   "coordinates": [ 0, 0 ],
+   "properties": { "__proto__": "is evil" }
+   }
+   ]
+  }
+]';
+   $xssJsonSanitized = 
'{"_a4d5387a1b7974bf854321421a36d913101f5724":[
+   
{"type":"Feature","geometry":{"type":"Point","coordinates":[-122.3988,37.8013]},"properties":{"title":"Foo
 bar"}},
+   
{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[0,0],"properties":{}}]}
+   ]}';
$wikitextJsonParsed = 
'{"_be34df99c99d1efd9eaa8eabc87a43f2541a67e5":[

{"type":"Feature","geometry":{"type":"Point","coordinates":[-122.3988,37.8013]},

"properties":{"title":"scriptalert(document.cookie);\/script",
@@ -79,8 +109,10 @@
[ 
"{\"_4622d19afa2e6480c327846395ed932ba6fa56d4\":[$validJson]}", "[$validJson]", ' with GeoJSON array' ],
[ $wikitextJsonParsed, "[{$this->wikitextJson}]", ' with parsable 
text and description' ],
[ $wikitextJsonParsed, "[{$this->wikitextJson}]", 
' with parsable text and description' ],
+
// Bugs
[ 'null', "\t\r\n ", 'T127345: whitespace-only tag content, 
' ],
+   [ $xssJsonSanitized, "$xssJson", 'T134719: XSS via __proto__' ],
];
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4b537f018c8d37491f46349ac9c764279123deb1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: REL1_27
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] SECURITY: Fix XSS via __proto__ - change (mediawiki...Kartographer)

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

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

Change subject: SECURITY: Fix XSS via __proto__
..

SECURITY: Fix XSS via __proto__

Bug: T134719
Change-Id: I4b537f018c8d37491f46349ac9c764279123deb1
---
M includes/SimpleStyleParser.php
M tests/phpunit/KartographerTest.php
2 files changed, 42 insertions(+), 9 deletions(-)


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

diff --git a/includes/SimpleStyleParser.php b/includes/SimpleStyleParser.php
index 1157748..714ab27 100644
--- a/includes/SimpleStyleParser.php
+++ b/includes/SimpleStyleParser.php
@@ -14,8 +14,6 @@
 class SimpleStyleParser {
private static $parsedProps = [ 'title', 'description' ];
 
-   private static $recursedProps = [ 'geometry', 'geometries', 'features' 
];
-
/** @var Parser */
private $parser;
 
@@ -145,15 +143,18 @@
return;
}
 
-   if ( property_exists( $json, 'properties' ) && is_object( 
$json->properties ) ) {
-   $this->sanitizeProperties( $json->properties );
-   }
-
-   foreach ( self::$recursedProps as $prop ) {
-   if ( property_exists( $json, $prop ) ) {
+   foreach ( array_keys( get_object_vars( $json ) ) as $prop ) {
+   // https://phabricator.wikimedia.org/T134719
+   if ( $prop[0] === '_' ) {
+   unset( $json->$prop );
+   } else {
$this->sanitize( $json->$prop );
}
}
+
+   if ( property_exists( $json, 'properties' ) && is_object( 
$json->properties ) ) {
+   $this->sanitizeProperties( $json->properties );
+   }
}
 
/**
diff --git a/tests/phpunit/KartographerTest.php 
b/tests/phpunit/KartographerTest.php
index 4d5ad2e..47610c6 100644
--- a/tests/phpunit/KartographerTest.php
+++ b/tests/phpunit/KartographerTest.php
@@ -64,7 +64,37 @@
   "marker-size": "medium",
   "marker-color": "0050d0"
 }
-  }';
+ }';
+   /** @noinspection HtmlUnknownTarget */
+   $xssJson = '[
+  {
+   "__proto__": { "some": "bad stuff" },
+   "type": "Feature",
+   "geometry": {
+   "type": "Point",
+   "coordinates": [-122.3988, 37.8013]
+   },
+   "properties": {
+   "__proto__": { "foo": "bar" },
+   "title": "Foo bar"
+   }
+  },
+  {
+   "type": "GeometryCollection",
+   "geometries": [
+   {
+   "__proto__": "recurse me",
+   "type": "Point",
+   "coordinates": [ 0, 0 ],
+   "properties": { "__proto__": "is evil" }
+   }
+   ]
+  }
+]';
+   $xssJsonSanitized = 
'{"_a4d5387a1b7974bf854321421a36d913101f5724":[
+   
{"type":"Feature","geometry":{"type":"Point","coordinates":[-122.3988,37.8013]},"properties":{"title":"Foo
 bar"}},
+   
{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[0,0],"properties":{}}]}
+   ]}';
$wikitextJsonParsed = 
'{"_be34df99c99d1efd9eaa8eabc87a43f2541a67e5":[

{"type":"Feature","geometry":{"type":"Point","coordinates":[-122.3988,37.8013]},

"properties":{"title":"scriptalert(document.cookie);\/script",
@@ -79,8 +109,10 @@
[ 
"{\"_4622d19afa2e6480c327846395ed932ba6fa56d4\":[$validJson]}", "[$validJson]", ' with GeoJSON array' ],
[ $wikitextJsonParsed, "[{$this->wikitextJson}]", ' with parsable 
text and description' ],
[ $wikitextJsonParsed, "[{$this->wikitextJson}]", 
' with parsable text and description' ],
+
// Bugs
[ 'null', "\t\r\n ", 'T127345: whitespace-only tag content, 
' ],
+   [ $xssJsonSanitized, "$xssJson", 'T134719: XSS via __proto__' ],
];
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b537f018c8d37491f46349ac9c764279123deb1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: REL1_27
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] Add nested field support - change (mediawiki...CirrusSearch)

2016-06-14 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review.

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

Change subject: Add nested field support
..

Add nested field support

Bug: T89733
Change-Id: I82a82526e2e254edc1fa7d861d7ac23d9cf07d1c
---
M CirrusSearch.php
M autoload.php
M includes/Search/CirrusIndexField.php
A includes/Search/NestedIndexField.php
M includes/Search/TextIndexField.php
A tests/unit/IndexFieldsTest.php
6 files changed, 66 insertions(+), 2 deletions(-)


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

diff --git a/CirrusSearch.php b/CirrusSearch.php
index 8d39bbe..7211a28 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -990,7 +990,7 @@
SearchIndexField::INDEX_TYPE_INTEGER => 
'CirrusSearch\\IntegerIndexField',
SearchIndexField::INDEX_TYPE_NUMBER => 'CirrusSearch\\NumberIndexField',
SearchIndexField::INDEX_TYPE_DATETIME => 
'CirrusSearch\\DatetimeIndexField',
-// SearchIndexField::INDEX_TYPE_NESTED => 'CirrusSearch\\NestedIndexField',
+   SearchIndexField::INDEX_TYPE_NESTED => 'CirrusSearch\\NestedIndexField',
 );
 
 /**
diff --git a/autoload.php b/autoload.php
index d8d3ad5..0591497 100644
--- a/autoload.php
+++ b/autoload.php
@@ -86,6 +86,7 @@
'CirrusSearch\\Maintenance\\Validators\\SpecificAliasValidator' => 
__DIR__ . '/includes/Maintenance/Validators/SpecificAliasValidator.php',
'CirrusSearch\\Maintenance\\Validators\\Validator' => __DIR__ . 
'/includes/Maintenance/Validators/Validator.php',
'CirrusSearch\\NearMatchPicker' => __DIR__ . 
'/includes/NearMatchPicker.php',
+   'CirrusSearch\\NestedIndexField' => __DIR__ . 
'/includes/Search/NestedIndexField.php',
'CirrusSearch\\NumberIndexField' => __DIR__ . 
'/includes/Search/NumberIndexField.php',
'CirrusSearch\\OtherIndexes' => __DIR__ . '/includes/OtherIndexes.php',
'CirrusSearch\\Saneitize' => __DIR__ . '/maintenance/saneitize.php',
diff --git a/includes/Search/CirrusIndexField.php 
b/includes/Search/CirrusIndexField.php
index e882094..a4421f0 100644
--- a/includes/Search/CirrusIndexField.php
+++ b/includes/Search/CirrusIndexField.php
@@ -1,7 +1,6 @@
 subfields[$name] = $subfield;
+   }
+
+   public function getMapping( SearchEngine $engine ) {
+   $fields = parent::getMapping( $engine );
+   foreach ( $this->subfields as $name => $sub ) {
+   $fields['properties'][$name] = $sub->getMapping( 
$engine );
+   }
+   return $fields;
+   }
+}
\ No newline at end of file
diff --git a/includes/Search/TextIndexField.php 
b/includes/Search/TextIndexField.php
index acf4584..5f12d8f 100644
--- a/includes/Search/TextIndexField.php
+++ b/includes/Search/TextIndexField.php
@@ -3,6 +3,7 @@
 
 use CirrusSearch\Maintenance\MappingConfigBuilder;
 use SearchIndexField;
+use SearchEngine;
 
 /**
  * Index field representing keyword.
diff --git a/tests/unit/IndexFieldsTest.php b/tests/unit/IndexFieldsTest.php
new file mode 100644
index 000..1ad16b6
--- /dev/null
+++ b/tests/unit/IndexFieldsTest.php
@@ -0,0 +1,37 @@
+getConfigFactory()->makeConfig( 
'CirrusSearch' );
+   $engine = new CirrusSearch();
+   /**
+* @var \CirrusSearch\CirrusIndexField $idxField
+*/
+   $idxField = new $klass( "test$typeName", $type, $config );
+   $map = $idxField->getMapping( $engine );
+   $this->assertEquals( $typeName, $map['type'] );
+   $this->assertEquals( $type, $idxField->getIndexType() );
+   $this->assertEquals( "test$typeName", $idxField->getName() );
+   }
+}
\ No newline at end of file

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

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

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


[MediaWiki-commits] [Gerrit] update.php: Don't check for mbstring extension - change (mediawiki/core)

2016-06-14 Thread PleaseStand (Code Review)
PleaseStand has uploaded a new change for review.

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

Change subject: update.php: Don't check for mbstring extension
..

update.php: Don't check for mbstring extension

This check is redundant to the one in PHPVersionCheck.php.

Change-Id: I32ab259939ca7e93ad6d08f2c04406ad8a973b5d
---
M maintenance/update.php
1 file changed, 0 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/08/294408/1

diff --git a/maintenance/update.php b/maintenance/update.php
index 0103189..b96e7eb 100755
--- a/maintenance/update.php
+++ b/maintenance/update.php
@@ -82,13 +82,6 @@
"ABORTING (see 
https://bugs.php.net/bug.php?id=45996).\n",
true );
}
-
-   if ( !function_exists( 'mb_strlen' ) ) {
-   $this->error(
-   "MediaWiki now requires the mbstring PHP 
extension, your system doesn't have it.\n"
-   . "ABORTING.\n",
-   true );
-   }
}
 
function execute() {

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

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

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


[MediaWiki-commits] [Gerrit] Enable test mode - change (mediawiki/vagrant)

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

Change subject: Enable test mode
..


Enable test mode

If Ingenico is still failing in test mode, fix it.

Change-Id: Icb04c86f4f638d2703f02659fcefd3fae6beba13
---
M puppet/modules/payments/manifests/donation_interface.pp
1 file changed, 1 insertion(+), 3 deletions(-)

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



diff --git a/puppet/modules/payments/manifests/donation_interface.pp 
b/puppet/modules/payments/manifests/donation_interface.pp
index 90d1906..ffb302b 100644
--- a/puppet/modules/payments/manifests/donation_interface.pp
+++ b/puppet/modules/payments/manifests/donation_interface.pp
@@ -20,9 +20,7 @@
   wgDonationInterfaceEnableReferrerFilter  => true,
   wgDonationInterfaceEnableSourceFilter=> true,
 
-  # FIXME: Causes failure to run GlobalCollect, because
-  # donation.api.php will rely on a test class.
-  wgDonationInterfaceTestMode  => false,
+  wgDonationInterfaceTest  => true,
 
   wgAdyenGatewayAccountInfo=> {
 'test' => {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icb04c86f4f638d2703f02659fcefd3fae6beba13
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Awight 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Dduvall 
Gerrit-Reviewer: Eileen 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: Katie Horn 
Gerrit-Reviewer: Pcoombe 
Gerrit-Reviewer: XenoRyet 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Upgrade Gradle to v2.14 - change (apps...wikipedia)

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

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

Change subject: Upgrade Gradle to v2.14
..

Upgrade Gradle to v2.14

Java 6 is deprecated[0].

[0] https://docs.gradle.org/2.14/release-notes

Change-Id: Iea8d9bf5767348aa5a1a4e1f0512965cd6129a0e
---
M gradle/wrapper/gradle-wrapper.jar
M gradle/wrapper/gradle-wrapper.properties
2 files changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/gradle/wrapper/gradle-wrapper.jar 
b/gradle/wrapper/gradle-wrapper.jar
index ca78035..d3b8398 100644
--- a/gradle/wrapper/gradle-wrapper.jar
+++ b/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/gradle/wrapper/gradle-wrapper.properties 
b/gradle/wrapper/gradle-wrapper.properties
index 648a876..f45c133 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Mon May 23 16:27:19 MDT 2016
+#Tue Jun 14 16:58:41 MDT 2016
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea8d9bf5767348aa5a1a4e1f0512965cd6129a0e
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] Remove kartotherian from monitor_services - change (operations/puppet)

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

Change subject: Remove kartotherian from monitor_services
..


Remove kartotherian from monitor_services

This seems like an inappropriate place for this, as it's specific
to services team/cluster.  Also, this check seems to try (and
fail) to parse the test PNG.

Partial revert of ac229e69a

Bug: T137851
Change-Id: Icc607270db466abec36036d53d9fc66a42735004
---
M modules/lvs/manifests/monitor_services.pp
1 file changed, 0 insertions(+), 8 deletions(-)

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



diff --git a/modules/lvs/manifests/monitor_services.pp 
b/modules/lvs/manifests/monitor_services.pp
index 991d93b..46f4d2e 100644
--- a/modules/lvs/manifests/monitor_services.pp
+++ b/modules/lvs/manifests/monitor_services.pp
@@ -101,12 +101,4 @@
 check_command => 
'check_wmf_service!http://cxserver.svc.codfw.wmnet:8080!15',
 }
 
-# Kartotherian
-monitoring::service { 'check_kartotherian_cluster_codfw':
-host  => 'kartotherian.svc.codfw.wmnet',
-group => 'lvs',
-description   => 'Kartotherian LVS codfw',
-check_command => 
'check_wmf_service!http://kartotherian.svc.codfw.wmnet:6533/osm-intl/6/23/24.png!5',
-}
-
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icc607270db466abec36036d53d9fc66a42735004
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack 
Gerrit-Reviewer: BBlack 

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


[MediaWiki-commits] [Gerrit] Remove kartotherian from monitor_services - change (operations/puppet)

2016-06-14 Thread BBlack (Code Review)
BBlack has uploaded a new change for review.

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

Change subject: Remove kartotherian from monitor_services
..

Remove kartotherian from monitor_services

This seems like an inappropriate place for this, as it's specific
to services team/cluster.  Also, this check seems to try (and
fail) to parse the test PNG.

Partial revert of ac229e69a

Bug: T137851
Change-Id: Icc607270db466abec36036d53d9fc66a42735004
---
M modules/lvs/manifests/monitor_services.pp
1 file changed, 0 insertions(+), 8 deletions(-)


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

diff --git a/modules/lvs/manifests/monitor_services.pp 
b/modules/lvs/manifests/monitor_services.pp
index 991d93b..46f4d2e 100644
--- a/modules/lvs/manifests/monitor_services.pp
+++ b/modules/lvs/manifests/monitor_services.pp
@@ -101,12 +101,4 @@
 check_command => 
'check_wmf_service!http://cxserver.svc.codfw.wmnet:8080!15',
 }
 
-# Kartotherian
-monitoring::service { 'check_kartotherian_cluster_codfw':
-host  => 'kartotherian.svc.codfw.wmnet',
-group => 'lvs',
-description   => 'Kartotherian LVS codfw',
-check_command => 
'check_wmf_service!http://kartotherian.svc.codfw.wmnet:6533/osm-intl/6/23/24.png!5',
-}
-
 }

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

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

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


[MediaWiki-commits] [Gerrit] Enable test mode - change (mediawiki/vagrant)

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

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

Change subject: Enable test mode
..

Enable test mode

If Ingenico is still failing in test mode, fix it.

Change-Id: Icb04c86f4f638d2703f02659fcefd3fae6beba13
---
M puppet/modules/payments/manifests/donation_interface.pp
1 file changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/05/294405/1

diff --git a/puppet/modules/payments/manifests/donation_interface.pp 
b/puppet/modules/payments/manifests/donation_interface.pp
index 90d1906..ffb302b 100644
--- a/puppet/modules/payments/manifests/donation_interface.pp
+++ b/puppet/modules/payments/manifests/donation_interface.pp
@@ -20,9 +20,7 @@
   wgDonationInterfaceEnableReferrerFilter  => true,
   wgDonationInterfaceEnableSourceFilter=> true,
 
-  # FIXME: Causes failure to run GlobalCollect, because
-  # donation.api.php will rely on a test class.
-  wgDonationInterfaceTestMode  => false,
+  wgDonationInterfaceTest  => true,
 
   wgAdyenGatewayAccountInfo=> {
 'test' => {

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

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

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


[MediaWiki-commits] [Gerrit] Improve client-side edit stash change detection - change (mediawiki/core)

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

Change subject: Improve client-side edit stash change detection
..


Improve client-side edit stash change detection

The keypress event does not fire for backspace or delete in IE, Chrome, or
Safari, which means we are missing out on stash opportunities when the last
action is to delete some text. Fix that by listening for the keyup event
instead.

Also add an isChanged() check before calling pending.abort(), because there are
a lot of special keys that don't modify the text, and not all of them are coded
consistently on different platforms (think volume up/down, mute, function keys,
etc.), so we can't be exhaustive, and should instead fall back to actually
checking for changes. Otherwise we risk aborting stash requests when the user
has not changed the text.

Lastly, rename 'onTextChanged' to 'onEditorIdle', which is more accurate.
On undo / rollback, onTextChanged will return true the first time it is called,
even though the text had not changed in that case.

Useful sources:

* Key codes of keydown and keyup events:
  http://www.javascripter.net/faq/keycodes.htm
* Quirksmode: detecting keystrokes
  http://www.quirksmode.org/js/keys.html
* Why isn't backspace being detected using jquery keypress event?
  http://stackoverflow.com/q/4418562

Change-Id: Idfad8407c8e905d8de80bc54379545f1b586fc88
(cherry picked from commit eca800c7f02023030a8e97bfc611d222f0edcdb3)
---
M resources/src/mediawiki.action/mediawiki.action.edit.stash.js
1 file changed, 9 insertions(+), 12 deletions(-)

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



diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.stash.js 
b/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
index 71ed44c..297f814 100644
--- a/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
+++ b/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
@@ -46,7 +46,7 @@
return newText !== data.wpTextbox1;
}
 
-   function onTextChanged() {
+   function onEditorIdle() {
if ( !isChanged() ) {
return;
}
@@ -54,20 +54,17 @@
stashEdit();
}
 
-   function onTextKeyPress( e ) {
+   function onTextKeyUp( e ) {
// Ignore keystrokes that don't modify text, like 
cursor movements.
-   // See .
-   if ( e.which === 0 ) {
+   // See  
and
+   // . We don't 
have to be
+   // exhaustive, because the cost of misfiring is low.
+   if ( ( e.which >= 33 && e.which <= 40 ) || ( e.which >= 
16 && e.which <= 18 ) ) {
return;
}
 
clearTimeout( timer );
-
-   if ( pending ) {
-   pending.abort();
-   }
-
-   timer = setTimeout( onTextChanged, idleTimeout );
+   timer = setTimeout( onEditorIdle, idleTimeout );
}
 
function onFormLoaded() {
@@ -90,8 +87,8 @@
return;
}
 
-   $text.on( { change: onTextChanged, keypress: onTextKeyPress } );
-   $summary.on( { focus: onTextChanged } );
+   $text.on( { change: onEditorIdle, keyup: onTextKeyUp } );
+   $summary.on( { focus: onEditorIdle } );
onFormLoaded();
 
} );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idfad8407c8e905d8de80bc54379545f1b586fc88
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.6
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Edokter 
Gerrit-Reviewer: Jack Phoenix 
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] Fix test mode typo - change (mediawiki...DonationInterface)

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

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

Change subject: Fix test mode typo
..

Fix test mode typo

Change-Id: I782ccd27a15d70c29a947a51b5392632023918c1
---
M amazon_gateway/amazon.adapter.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/amazon_gateway/amazon.adapter.php 
b/amazon_gateway/amazon.adapter.php
index b6cac0f..eee7234 100644
--- a/amazon_gateway/amazon.adapter.php
+++ b/amazon_gateway/amazon.adapter.php
@@ -159,7 +159,7 @@
'secret_key' => $this->account_config['MWSSecretKey'],
'client_id' => $this->account_config['ClientID'],
'region' => $this->account_config['Region'],
-   'sandbox' => $this->getGlobal( 'TestMode' ),
+   'sandbox' => $this->getGlobal( 'Test' ),
) );
}
 
@@ -420,7 +420,7 @@
parent::setClientVariables( $vars );
$vars['wgAmazonGatewayClientID'] = 
$this->account_config['ClientID'];
$vars['wgAmazonGatewaySellerID'] = 
$this->account_config['SellerID'];
-   $vars['wgAmazonGatewaySandbox'] = $this->getGlobal( 'TestMode' 
) ? true : false;
+   $vars['wgAmazonGatewaySandbox'] = $this->getGlobal( 'Test' ) ? 
true : false;
$vars['wgAmazonGatewayReturnURL'] = 
$this->account_config['ReturnURL'];
$vars['wgAmazonGatewayWidgetScript'] = 
$this->account_config['WidgetScriptURL'];
$vars['wgAmazonGatewayLoginScript'] = $this->getGlobal( 
'LoginScript' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I782ccd27a15d70c29a947a51b5392632023918c1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
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] Cleanup code that has been moved. - change (mediawiki...CirrusSearch)

2016-06-14 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review.

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

Change subject: Cleanup code that has been moved.
..

Cleanup code that has been moved.

Change-Id: Id284d253629be9639cd1476a7d87c8bef3345a86
Depends-On: Ie45de496ecc826211d98eea3a410c7639b4be0a4
Bug: T89733
---
M autoload.php
D includes/BuildDocument/FileDataBuilder.php
D includes/BuildDocument/PageDataBuilder.php
D includes/BuildDocument/PageTextBuilder.php
M includes/Maintenance/MappingConfigBuilder.php
M includes/Updater.php
6 files changed, 4 insertions(+), 425 deletions(-)


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

diff --git a/autoload.php b/autoload.php
index d8d3ad5..2488bc9 100644
--- a/autoload.php
+++ b/autoload.php
@@ -12,11 +12,8 @@
'CirrusSearch\\Api\\SettingsDump' => __DIR__ . 
'/includes/Api/SettingsDump.php',
'CirrusSearch\\Api\\SuggestIndex' => __DIR__ . 
'/includes/Api/SuggestIndex.php',
'CirrusSearch\\BuildDocument\\Builder' => __DIR__ . 
'/includes/BuildDocument/Builder.php',
-   'CirrusSearch\\BuildDocument\\FileDataBuilder' => __DIR__ . 
'/includes/BuildDocument/FileDataBuilder.php',
'CirrusSearch\\BuildDocument\\IncomingLinksScoringMethod' => __DIR__ . 
'/includes/BuildDocument/SuggestScoring.php',
'CirrusSearch\\BuildDocument\\PQScore' => __DIR__ . 
'/includes/BuildDocument/SuggestScoring.php',
-   'CirrusSearch\\BuildDocument\\PageDataBuilder' => __DIR__ . 
'/includes/BuildDocument/PageDataBuilder.php',
-   'CirrusSearch\\BuildDocument\\PageTextBuilder' => __DIR__ . 
'/includes/BuildDocument/PageTextBuilder.php',
'CirrusSearch\\BuildDocument\\ParseBuilder' => __DIR__ . 
'/includes/BuildDocument/Builder.php',
'CirrusSearch\\BuildDocument\\QualityScore' => __DIR__ . 
'/includes/BuildDocument/SuggestScoring.php',
'CirrusSearch\\BuildDocument\\RedirectsAndIncomingLinks' => __DIR__ . 
'/includes/BuildDocument/RedirectsAndIncomingLinks.php',
diff --git a/includes/BuildDocument/FileDataBuilder.php 
b/includes/BuildDocument/FileDataBuilder.php
deleted file mode 100644
index 5db95a3..000
--- a/includes/BuildDocument/FileDataBuilder.php
+++ /dev/null
@@ -1,52 +0,0 @@
-http://www.gnu.org/copyleft/gpl.html
- */
-
-class FileDataBuilder extends Builder {
-   /**
-* @var LocalFile
-*/
-   private $file;
-
-   /**
-* @return \Elastica\Document
-*/
-   public function build() {
-   $this->file = wfLocalFile( $this->title );
-   if ( $this->file && $this->file->exists() ) {
-   $this->fileText();
-   }
-
-   return $this->doc;
-   }
-
-   private function fileText() {
-   if ( $this->file->getHandler() ) {
-   $fileText = $this->file->getHandler()->getEntireText( 
$this->file );
-   if ( $fileText ) {
-   $this->doc->set( 'file_text', $fileText );
-   }
-   }
-   }
-}
diff --git a/includes/BuildDocument/PageDataBuilder.php 
b/includes/BuildDocument/PageDataBuilder.php
deleted file mode 100644
index 04a1e3d..000
--- a/includes/BuildDocument/PageDataBuilder.php
+++ /dev/null
@@ -1,160 +0,0 @@
-http://www.gnu.org/copyleft/gpl.html
- */
-
-class PageDataBuilder extends ParseBuilder {
-   /**
-* @return \Elastica\Document
-*/
-   public function build() {
-   switch ( $this->content->getModel() ) {
-   case CONTENT_MODEL_CSS:
-   case CONTENT_MODEL_JAVASCRIPT:
-   // Don't use parser output here. It's useless 
and leads
-   // to weird results. Instead, clear everything. 
See bug 61752.
-   $this->doc->set( 'category', array() );
-   $this->doc->set( 'external_link', array() );
-   $this->doc->set( 'heading', array() );
-   $this->doc->set( 'outgoing_link', array() );
-   $this->doc->set( 'template', array() );
-   break;
-   default:
-   $this->categories();
-   $this->externalLinks();
-   $this->headings();
-   $this->outgoingLinks();
-   $this->templates();
-   $this->setWikibaseItemId();
-   }
-
-   // All content types have a language
-   $this->doc->set( 'language',
-   $this->title->getPageLanguage()->getCode() );
-
-   return $this->doc;
-   }
-
-   private function categories() {
-   

[MediaWiki-commits] [Gerrit] Set import sources for pt.wikinews - change (operations/mediawiki-config)

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

Change subject: Set import sources for pt.wikinews
..


Set import sources for pt.wikinews

Portugese Wikinews contributor would like to allow imports from every
other wikinews project.

Bug: T137633
Change-Id: If66f307a2e7e446c9bb9fde3f265391d353281cc
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index afe9ff2..4e6cd4c 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -10562,7 +10562,7 @@
'plwiktionary' => [ 'w' ], // T12374
'pntwiki' => [ 'en', 'el', 'elwikiversity', 'incubator' ],
'ptwikibooks' => [ 'w', 'wikt', 's', 'q', 'n', 'v', 'en', 'es', 'fr', 
'it', 'de', 'ru', 'w:en' ], // T22552
-   'ptwikinews' => [ 'w', 'wikt', 's', 'v', 'b', 'q', 'meta', 'commons', 
'ca', 'de', 'en', 'eo', 'es', 'fr', 'it', 'ja', 'pl', 'ru', 'sr', 'tr', 'uk', 
'zh' ], // T93218
+   'ptwikinews' => [ 'w', 'wikt', 's', 'v', 'b', 'q', 'meta', 'commons', 
'ca', 'de', 'en', 'eo', 'es', 'fr', 'it', 'ja', 'pl', 'ru', 'sr', 'tr', 'uk', 
'zh', 'ar', 'bg', 'bs', 'cs', 'el', 'fa', 'fi', 'he', 'ko', 'no', 'ro', 'sq', 
'sv', 'ta' ], // T93218
'ptwikiversity' => [ 'incubator', 'w', 'b', ], // T16516
'rowikibooks' => [ 'w', 's' ],
'ruwikibooks' => [ 'w', 's', ],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If66f307a2e7e446c9bb9fde3f265391d353281cc
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Dereckson 
Gerrit-Reviewer: Florianschmidtwelzow 
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] Set import sources for he.wikipedia - change (operations/mediawiki-config)

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

Change subject: Set import sources for he.wikipedia
..


Set import sources for he.wikipedia

Bug: T137074
Change-Id: Id800a9d35bf1981bf75175b4e0bc1778ed6e76d3
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 2455749..afe9ff2 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -10473,7 +10473,7 @@
'guwiki' => [ 'en', 'commons', 'meta', 'species', 'gu:s', 'bh', 'en', 
'en:b', 'en:q', 'en:n', 'en:s', 'en:v', 'hi', 'ml', 'ne', 'pa', 'simple', 'te', 
'ta', 'ur', 'sa' ], // T39511, T120346
'guwikiquote' => [ 'w', 's', 'hi', 'hi:w', 'en', 'en:w', 'sa', 'meta'], 
// T122635
'hakwiki' => [ 'incubator' ],
-   'hewiki' => [ 'wikt', 'q', 'b', 's', 'n', 'commons' ],
+   'hewiki' => [ 'wikt', 'q', 'b', 's', 'n', 'commons', 'meta', 'en', 
'de', 'fr', 'es', 'ar', 'ru', 'it' ], // T137074
'hewikibooks' => [ 'w', 'wikt', 'q', 's', 'n' ],
'hewikinews' => [ 'w', 'wikt', 'q', 'b', 's' ],
'hewikiquote' => [ 'w', 'wikt', 'b', 's', 'n' ],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id800a9d35bf1981bf75175b4e0bc1778ed6e76d3
Gerrit-PatchSet: 5
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Eranroz 
Gerrit-Reviewer: Dereckson 
Gerrit-Reviewer: Eranroz 
Gerrit-Reviewer: Florianschmidtwelzow 
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] Revert "Make sure AntiSpoof mappings are mapping in the corr... - change (mediawiki...AntiSpoof)

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

Change subject: Revert "Make sure AntiSpoof mappings are mapping in the correct 
direction."
..


Revert "Make sure AntiSpoof mappings are mapping in the correct direction."

Breaks AbuseFilter normalization tests.

This reverts commit 5435e6313181cc8ef6f0bd4fd6d8061bb00aa494.

Change-Id: I2e407a3ac8b74e77bf88b1e34c1519f4dea63b80
---
M equivset.php
M equivset.ser
M maintenance/equivset.in
M maintenance/equivset.txt
M maintenance/generateEquivset.php
5 files changed, 94 insertions(+), 130 deletions(-)

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2e407a3ac8b74e77bf88b1e34c1519f4dea63b80
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AntiSpoof
Gerrit-Branch: wmf/1.28.0-wmf.6
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Aaron Schulz 
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] maps.wm.o monitoring - change (operations/puppet)

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

Change subject: maps.wm.o monitoring
..


maps.wm.o monitoring

Bug: T137851
Change-Id: I606577faabf8ca0d9e5fb8c9882f5fb10f5a0be5
---
M hieradata/common/lvs/configuration.yaml
1 file changed, 11 insertions(+), 0 deletions(-)

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



diff --git a/hieradata/common/lvs/configuration.yaml 
b/hieradata/common/lvs/configuration.yaml
index 0f8836f..85ed9f4 100644
--- a/hieradata/common/lvs/configuration.yaml
+++ b/hieradata/common/lvs/configuration.yaml
@@ -250,6 +250,17 @@
 conftool:
   cluster: cache_maps
   service: varnish-fe
+icinga:
+  uri: maps.wikimedia.org!/osm-intl/6/23/24.png
+  sites:
+eqiad:
+  hostname: maps-lb.eqiad.wikimedia.org
+codfw:
+  hostname: maps-lb.codfw.wikimedia.org
+esams:
+  hostname: maps-lb.esams.wikimedia.org
+ulsfo:
+  hostname: maps-lb.ulsfo.wikimedia.org
   maps-https:
 description: "Maps service maps-lb.%{::site}.wikimedia.org"
 class: high-traffic2

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I606577faabf8ca0d9e5fb8c9882f5fb10f5a0be5
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack 
Gerrit-Reviewer: BBlack 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: Yurik 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Revert "Make sure AntiSpoof mappings are mapping in the corr... - change (mediawiki...AntiSpoof)

2016-06-14 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Revert "Make sure AntiSpoof mappings are mapping in the correct 
direction."
..

Revert "Make sure AntiSpoof mappings are mapping in the correct direction."

Breaks AbuseFilter normalization tests.

This reverts commit 5435e6313181cc8ef6f0bd4fd6d8061bb00aa494.

Change-Id: I2e407a3ac8b74e77bf88b1e34c1519f4dea63b80
---
M equivset.php
M equivset.ser
M maintenance/equivset.in
M maintenance/equivset.txt
M maintenance/generateEquivset.php
5 files changed, 94 insertions(+), 130 deletions(-)


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


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e407a3ac8b74e77bf88b1e34c1519f4dea63b80
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AntiSpoof
Gerrit-Branch: wmf/1.28.0-wmf.6
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] kartotherian.svc.codfw monitoring - change (operations/puppet)

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

Change subject: kartotherian.svc.codfw monitoring
..


kartotherian.svc.codfw monitoring

Bug: T137851
Change-Id: Ica72d91c221649dfef4912fbc82393df6e1f839d
---
M hieradata/common/lvs/configuration.yaml
M modules/lvs/manifests/monitor_services.pp
2 files changed, 13 insertions(+), 0 deletions(-)

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



diff --git a/hieradata/common/lvs/configuration.yaml 
b/hieradata/common/lvs/configuration.yaml
index a846879..0f8836f 100644
--- a/hieradata/common/lvs/configuration.yaml
+++ b/hieradata/common/lvs/configuration.yaml
@@ -807,6 +807,11 @@
 conftool:
   cluster: maps
   service: kartotherian
+icinga:
+  check_command: 
"check_http_lvs_on_port!kartotherian.svc.%{::site}.wmnet!6533!/osm-intl/6/23/24.png"
+  sites:
+codfw:
+  hostname: kartotherian.svc.codfw.wmnet
   mobileapps:
 description: "A service for use by mobile apps. Provides DOM manipulation, 
aggregation, JSON flattening. mobileapps.svc.%{::site}.wmnet"
 class: low-traffic
diff --git a/modules/lvs/manifests/monitor_services.pp 
b/modules/lvs/manifests/monitor_services.pp
index 46f4d2e..991d93b 100644
--- a/modules/lvs/manifests/monitor_services.pp
+++ b/modules/lvs/manifests/monitor_services.pp
@@ -101,4 +101,12 @@
 check_command => 
'check_wmf_service!http://cxserver.svc.codfw.wmnet:8080!15',
 }
 
+# Kartotherian
+monitoring::service { 'check_kartotherian_cluster_codfw':
+host  => 'kartotherian.svc.codfw.wmnet',
+group => 'lvs',
+description   => 'Kartotherian LVS codfw',
+check_command => 
'check_wmf_service!http://kartotherian.svc.codfw.wmnet:6533/osm-intl/6/23/24.png!5',
+}
+
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ica72d91c221649dfef4912fbc82393df6e1f839d
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack 
Gerrit-Reviewer: BBlack 
Gerrit-Reviewer: Ema 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: Yurik 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Improve client-side edit stash change detection - change (mediawiki/core)

2016-06-14 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Improve client-side edit stash change detection
..

Improve client-side edit stash change detection

The keypress event does not fire for backspace or delete in IE, Chrome, or
Safari, which means we are missing out on stash opportunities when the last
action is to delete some text. Fix that by listening for the keyup event
instead.

Also add an isChanged() check before calling pending.abort(), because there are
a lot of special keys that don't modify the text, and not all of them are coded
consistently on different platforms (think volume up/down, mute, function keys,
etc.), so we can't be exhaustive, and should instead fall back to actually
checking for changes. Otherwise we risk aborting stash requests when the user
has not changed the text.

Lastly, rename 'onTextChanged' to 'onEditorIdle', which is more accurate.
On undo / rollback, onTextChanged will return true the first time it is called,
even though the text had not changed in that case.

Useful sources:

* Key codes of keydown and keyup events:
  http://www.javascripter.net/faq/keycodes.htm
* Quirksmode: detecting keystrokes
  http://www.quirksmode.org/js/keys.html
* Why isn't backspace being detected using jquery keypress event?
  http://stackoverflow.com/q/4418562

Change-Id: Idfad8407c8e905d8de80bc54379545f1b586fc88
(cherry picked from commit eca800c7f02023030a8e97bfc611d222f0edcdb3)
---
M resources/src/mediawiki.action/mediawiki.action.edit.stash.js
1 file changed, 9 insertions(+), 12 deletions(-)


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

diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.stash.js 
b/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
index 71ed44c..297f814 100644
--- a/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
+++ b/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
@@ -46,7 +46,7 @@
return newText !== data.wpTextbox1;
}
 
-   function onTextChanged() {
+   function onEditorIdle() {
if ( !isChanged() ) {
return;
}
@@ -54,20 +54,17 @@
stashEdit();
}
 
-   function onTextKeyPress( e ) {
+   function onTextKeyUp( e ) {
// Ignore keystrokes that don't modify text, like 
cursor movements.
-   // See .
-   if ( e.which === 0 ) {
+   // See  
and
+   // . We don't 
have to be
+   // exhaustive, because the cost of misfiring is low.
+   if ( ( e.which >= 33 && e.which <= 40 ) || ( e.which >= 
16 && e.which <= 18 ) ) {
return;
}
 
clearTimeout( timer );
-
-   if ( pending ) {
-   pending.abort();
-   }
-
-   timer = setTimeout( onTextChanged, idleTimeout );
+   timer = setTimeout( onEditorIdle, idleTimeout );
}
 
function onFormLoaded() {
@@ -90,8 +87,8 @@
return;
}
 
-   $text.on( { change: onTextChanged, keypress: onTextKeyPress } );
-   $summary.on( { focus: onTextChanged } );
+   $text.on( { change: onEditorIdle, keyup: onTextKeyUp } );
+   $summary.on( { focus: onEditorIdle } );
onFormLoaded();
 
} );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idfad8407c8e905d8de80bc54379545f1b586fc88
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.6
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Allow the primary link to set all bundled notifications as read - change (mediawiki...Echo)

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

Change subject: Allow the primary link to set all bundled notifications as read
..


Allow the primary link to set all bundled notifications as read

Bug: T136368
Change-Id: If07369cb168d1a085f297293e713d65e49997264
(cherry picked from commit b06b2294c9e7897ec709fb1c21a9be24b8b65a93)
---
M Hooks.php
M includes/formatters/EventPresentationModel.php
M includes/mapper/NotificationMapper.php
3 files changed, 54 insertions(+), 21 deletions(-)

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



diff --git a/Hooks.php b/Hooks.php
index 156c54b..e75f3f9 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -799,20 +799,37 @@
}
}
}
-   // Attempt to mark as read the event ID in the ?markasread= 
parameter, if present
-   $markAsReadId = $sk->getOutput()->getRequest()->getInt( 
'markasread' );
-   if ( $markAsReadId !== 0 && !in_array( $markAsReadId, $eventIds 
) ) {
-   $notifMapper = new EchoNotificationMapper();
-   $notif = $notifMapper->fetchByUserEvent( $user, 
$markAsReadId );
-   if ( $notif && !$notif->getReadTimestamp() ) {
-   if ( $notif->getEvent()->getSection() === 
EchoAttributeManager::MESSAGE ) {
-   $subtractMessages++;
-   } else {
-   $subtractAlerts++;
+
+   // Attempt to mark as read the event IDs in the ?markasread= 
parameter, if present
+   $markAsReadIds = explode( '|', 
$sk->getOutput()->getRequest()->getText( 'markasread' ) );
+   if ( $markAsReadIds ) {
+   // gather the IDs that we didn't already find with 
target_pages
+   $eventsToMarkAsRead = array();
+   foreach ( $markAsReadIds as $markAsReadId ) {
+   $markAsReadId = intval( $markAsReadId );
+   if ( $markAsReadId !== 0 && !in_array( 
$markAsReadId, $eventIds ) ) {
+   $eventsToMarkAsRead[] = $markAsReadId;
}
-   $eventIds[] = $markAsReadId;
+   }
+
+   if ( $eventsToMarkAsRead ) {
+   // fetch the notifications to adjust the 
counters
+   $notifMapper = new EchoNotificationMapper();
+   $notifs = $notifMapper->fetchByUserEvents( 
$user, $eventsToMarkAsRead );
+
+   foreach ( $notifs as $notif ) {
+   if ( !$notif->getReadTimestamp() ) {
+   if ( 
$notif->getEvent()->getSection() === EchoAttributeManager::MESSAGE ) {
+   $subtractMessages++;
+   } else {
+   $subtractAlerts++;
+   }
+   $eventIds[] = intval( 
$notif->getEvent()->getId() );
+   }
+   }
}
}
+
if ( $eventIds ) {
DeferredUpdates::addCallableUpdate( function () use ( 
$user, $eventIds ) {
$notifUser = MWEchoNotifUser::newFromUser( 
$user );
diff --git a/includes/formatters/EventPresentationModel.php 
b/includes/formatters/EventPresentationModel.php
index 691e013..7a95c9d 100644
--- a/includes/formatters/EventPresentationModel.php
+++ b/includes/formatters/EventPresentationModel.php
@@ -406,12 +406,20 @@
/**
 * Like getPrimaryLink(), but with the URL altered to add 
?markasread=XYZ. When this link is followed,
 * the notification is marked as read.
+*
+* When the notification is a bundle, the notification IDs are added to 
the parameter value
+* separated by a "|".
+*
 * @return array|bool
 */
public function getPrimaryLinkWithMarkAsRead() {
$primaryLink = $this->getPrimaryLink();
if ( $primaryLink ) {
-   $primaryLink['url'] = wfAppendQuery( 
$primaryLink['url'], array( 'markasread' => $this->event->getId() ) );
+   $eventIds = array( $this->event->getId() );
+   if ( $this->getBundledIds() ) {
+   $eventIds = array_merge( $eventIds, 
$this->getBundledIds() );
+   }
+   $primaryLink['url'] = wfAppendQuery( 
$primaryLink['url'], 

[MediaWiki-commits] [Gerrit] Set $wgAbuseFilterConditionLimit = 2000 for commonswiki - change (operations/mediawiki-config)

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

Change subject: Set $wgAbuseFilterConditionLimit = 2000 for commonswiki
..


Set $wgAbuseFilterConditionLimit = 2000 for commonswiki

The default value is 1000.

Bug: T132048
Change-Id: I4e5e4d227c064756597f471898bd848e5c8f6607
---
M wmf-config/abusefilter.php
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  Steinsplitter: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/wmf-config/abusefilter.php b/wmf-config/abusefilter.php
index 932a88a..81e129e 100644
--- a/wmf-config/abusefilter.php
+++ b/wmf-config/abusefilter.php
@@ -73,6 +73,7 @@
break;
case 'commonswiki':
$wgAbuseFilterProfile = true; // T132200
+   $wgAbuseFilterConditionLimit = 2000; // T132048
$wgGroupPermissions['sysop']['abusefilter-modify-restricted'] = 
true;
break;
case 'cswiktionary':

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4e5e4d227c064756597f471898bd848e5c8f6607
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: Steinsplitter 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Expand list of thumb sizes for feed responses - change (mediawiki...mobileapps)

2016-06-14 Thread Mholloway (Code Review)
Mholloway has uploaded a new change for review.

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

Change subject: Expand list of thumb sizes for feed responses
..

Expand list of thumb sizes for feed responses

The feed will need both small, list-item sized images and larger "hero"
images, depending on the card.  This updates the feed endpoint(s) to give
a wider variety of size URLs.

Bug: T129079
Change-Id: I4ae8e6bbaeb221872b1bc1d07be92f33002ff606
---
M lib/feed/featured.js
M lib/feed/most-read.js
M lib/mwapi.js
M test/features/featured/pagecontent.js
4 files changed, 9 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/99/294399/1

diff --git a/lib/feed/featured.js b/lib/feed/featured.js
index 8219335..79aee9d 100644
--- a/lib/feed/featured.js
+++ b/lib/feed/featured.js
@@ -79,7 +79,7 @@
 title: pageTitle,
 thumbnail: extractPageObj.thumbnail
&& extractPageObj.thumbnail.source
-   && 
mwapi.buildListThumbUrls(extractPageObj.thumbnail.source),
+   && 
mwapi.buildFeedThumbUrls(extractPageObj.thumbnail.source),
 description: extractPageObj.terms && 
extractPageObj.terms.description[0],
 extract: extractPageObj.extract
 };
diff --git a/lib/feed/most-read.js b/lib/feed/most-read.js
index 1ba978d..dd5a184 100644
--- a/lib/feed/most-read.js
+++ b/lib/feed/most-read.js
@@ -77,7 +77,7 @@
  && entry.terms.description[0],
 thumbnail: entry.thumbnail
  && entry.thumbnail.source
- ? mwapi.buildListThumbUrls(entry.thumbnail.source)
+ ? mwapi.buildFeedThumbUrls(entry.thumbnail.source)
  : undefined,
 article: undefined,
 ns: undefined,
diff --git a/lib/mwapi.js b/lib/mwapi.js
index 300d95e..7c37b67 100644
--- a/lib/mwapi.js
+++ b/lib/mwapi.js
@@ -159,7 +159,7 @@
 prop: 'pageimages|pageterms',
 piprop: 'thumbnail',
 pilimit: API_QUERY_MAX_TITLES,
-pithumbsize: DEFAULT_THUMB_WIDTH,
+pithumbsize: DEFAULT_LEAD_IMAGE_WIDTH,
 wbptterms: 'description',
 meta: 'siteinfo',
 siprop: 'general',
@@ -214,15 +214,15 @@
 /**
  * Builds a set of URLs for small thumbnails suitable for list items.
  */
-function buildListThumbUrls(initialUrl) {
-return buildImageUrlSet(initialUrl, [ 60, 120, 320 ]);
+function buildFeedThumbUrls(initialUrl) {
+return buildImageUrlSet(initialUrl, [ 60, 120, 320, 640, 800, 1024 ]);
 }
 
 module.exports = {
 getMetadata: getMetadata,
 getAllSections: getAllSections,
 buildLeadImageUrls: buildLeadImageUrls,
-buildListThumbUrls: buildListThumbUrls,
+buildFeedThumbUrls: buildFeedThumbUrls,
 checkForQueryPagesInResponse: checkForQueryPagesInResponse,
 requestExtract: requestExtract,
 requestExtractAndDescription: requestExtractAndDescription,
diff --git a/test/features/featured/pagecontent.js 
b/test/features/featured/pagecontent.js
index 9f2dde8..350e840 100644
--- a/test/features/featured/pagecontent.js
+++ b/test/features/featured/pagecontent.js
@@ -25,6 +25,9 @@
 assert.equal(res.body.thumbnail['60'], 
'https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/60px-Cosmic_Science-Fiction_May_1941.jpg');
 assert.equal(res.body.thumbnail['120'], 
'https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/120px-Cosmic_Science-Fiction_May_1941.jpg');
 assert.equal(res.body.thumbnail['320'], 
'https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/226px-Cosmic_Science-Fiction_May_1941.jpg');
+assert.equal(res.body.thumbnail['640'], 
'https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/226px-Cosmic_Science-Fiction_May_1941.jpg');
+assert.equal(res.body.thumbnail['800'], 
'https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/226px-Cosmic_Science-Fiction_May_1941.jpg');
+assert.equal(res.body.thumbnail['1024'], 
'https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/226px-Cosmic_Science-Fiction_May_1941.jpg');
 assert.ok(res.body.extract.indexOf('Cosmic Stories ') >= 0);
 });
 });

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ae8e6bbaeb221872b1bc1d07be92f33002ff606
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: Mholloway 


[MediaWiki-commits] [Gerrit] WIP: Rendering a quite static map on mobile instead of an in... - change (mediawiki...Kartographer)

2016-06-14 Thread JGirault (Code Review)
JGirault has uploaded a new change for review.

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

Change subject: WIP: Rendering a quite static map on mobile instead of an 
interactive map.
..

WIP: Rendering a quite static map on mobile
instead of an interactive map.

Todo(s):
* Disable click on markers and popups
* Wikivoyage implementation should hide WV controls if static

Bug: T137852
Change-Id: Ia488e629861f3faf64ec44fc9383275e159e551a
---
M modules/kartographer.js
1 file changed, 16 insertions(+), 2 deletions(-)


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

diff --git a/modules/kartographer.js b/modules/kartographer.js
index da4a055..66db5e9 100644
--- a/modules/kartographer.js
+++ b/modules/kartographer.js
@@ -93,12 +93,26 @@
var map,
$container = $( container ),
style = data.style || mw.config.get( 
'wgKartographerDfltStyle' ),
-   width, height;
+   width, height,
+   isMobile = mw.config.get( 'skin' ) === 'minerva',
+   wantsStatic = isMobile && data.enableFullScreenButton,
+   options = {};
 
$container.addClass( 'mw-kartographer-map' );
 
-   map = L.map( container );
+   if ( wantsStatic ) {
+   options.dragging = false;
+   options.touchZoom = false;
+   options.scrollWheelZoom = false;
+   options.doubleClickZoom = false;
+   options.sleep = false;
+   options.boxZoom = false;
+   options.tap = false;
+   options.keyboard = false;
+   options.zoomControl = false;
+   }
 
+   map = L.map( container, options );
if ( !container.clientWidth ) {
// Get `max` properties in case the container was 
wrapped
// with {@link #responsiveContainerWrap}.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia488e629861f3faf64ec44fc9383275e159e551a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: JGirault 

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


[MediaWiki-commits] [Gerrit] Detect scheme based on request domain - change (mediawiki...mobileapps)

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

Change subject: Detect scheme based on request domain
..


Detect scheme based on request domain

We need to start using HTTPS for all requests to prod endpoints (they've
started serving 403s to a percentage of non-HTTPS requests).  For now
let's detect whether we're requesting from a labs machine (which still use
http:) and adjust accordingly.

Change-Id: Id3896c9bda3a9a0172550c5d82deb0146c83f688
---
M config.dev.yaml
M lib/api-util.js
M test/features/featured/pagecontent.js
M test/features/media/pagecontent.js
M test/features/mobile-summary/pagecontent.js
5 files changed, 12 insertions(+), 9 deletions(-)

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



diff --git a/config.dev.yaml b/config.dev.yaml
index 6bc9d80..b3f0858 100644
--- a/config.dev.yaml
+++ b/config.dev.yaml
@@ -64,14 +64,14 @@
   # the template used for contacting the MW API
   mwapi_req:
 method: post
-uri: http://{{domain}}/w/api.php
+uri: '{{scheme}}://{{domain}}/w/api.php'
 headers:
   user-agent: '{{user-agent}}'
 body: '{{ default(request.query, {}) }}'
   # the template used for contacting RESTBase
   restbase_req:
 method: get
-uri: http://{{domain}}/api/rest_v1/{+path}
+uri: '{{scheme}}://{{domain}}/api/rest_v1/{+path}'
 query: '{{ default(request.query, {}) }}'
 headers: '{{request.headers}}'
 body: '{{request.body}}'
diff --git a/lib/api-util.js b/lib/api-util.js
index 998f2bd..c2b0755 100644
--- a/lib/api-util.js
+++ b/lib/api-util.js
@@ -23,7 +23,8 @@
 
 var request = app.mwapi_tpl.expand({
 request: {
-params: { domain: domain },
+params: { domain: domain,
+  scheme: domain.indexOf('beta.wmflabs.org') !== -1 ? 
'http' : 'https' },
 headers: { 'user-agent': app.conf.user_agent },
 query: query
 }
@@ -67,7 +68,9 @@
 var request = app.restbase_tpl.expand({
 request: {
 method: restReq.method,
-params: { domain: domain, path: path },
+params: { domain: domain, 
+  path: path,
+  scheme: domain.indexOf('beta.wmflabs.org') !== -1 ? 
'http' : 'https' },
 query: restReq.query,
 headers: Object.assign({ 'user-agent': app.conf.user_agent }, 
restReq.headers),
 body: restReq.body
diff --git a/test/features/featured/pagecontent.js 
b/test/features/featured/pagecontent.js
index f1a46c8..9f2dde8 100644
--- a/test/features/featured/pagecontent.js
+++ b/test/features/featured/pagecontent.js
@@ -22,9 +22,9 @@
 // the page id should be stable but not the revision:
 assert.ok(res.headers.etag.indexOf('50089449/') == 0);
 assert.equal(res.body.title, 'Cosmic Stories and Stirring 
Science Stories');
-assert.equal(res.body.thumbnail['60'], 
'http://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/60px-Cosmic_Science-Fiction_May_1941.jpg');
-assert.equal(res.body.thumbnail['120'], 
'http://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/120px-Cosmic_Science-Fiction_May_1941.jpg');
-assert.equal(res.body.thumbnail['320'], 
'http://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/226px-Cosmic_Science-Fiction_May_1941.jpg');
+assert.equal(res.body.thumbnail['60'], 
'https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/60px-Cosmic_Science-Fiction_May_1941.jpg');
+assert.equal(res.body.thumbnail['120'], 
'https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/120px-Cosmic_Science-Fiction_May_1941.jpg');
+assert.equal(res.body.thumbnail['320'], 
'https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/226px-Cosmic_Science-Fiction_May_1941.jpg');
 assert.ok(res.body.extract.indexOf('Cosmic Stories ') >= 0);
 });
 });
diff --git a/test/features/media/pagecontent.js 
b/test/features/media/pagecontent.js
index d7d38f2..0fc4fd7 100644
--- a/test/features/media/pagecontent.js
+++ b/test/features/media/pagecontent.js
@@ -12,7 +12,7 @@
 
 function checkItemHasExpectedProperties(item) {
 assert.ok(item.title.indexOf('File:') === 0, 'Expected title to start 
with "File:"');
-assert.ok(item.url.indexOf('http://upload.wikimedia.org/') === 0, 
'Expected url to start with certain text');
+assert.ok(item.url.indexOf('https://upload.wikimedia.org/') === 0, 
'Expected url to start with certain text');
 }
 
 it('should respond to GET request with expected headers, incl. 

[MediaWiki-commits] [Gerrit] maps.wm.o monitoring - change (operations/puppet)

2016-06-14 Thread BBlack (Code Review)
BBlack has uploaded a new change for review.

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

Change subject: maps.wm.o monitoring
..

maps.wm.o monitoring

Bug: T137851
Change-Id: I606577faabf8ca0d9e5fb8c9882f5fb10f5a0be5
---
M hieradata/common/lvs/configuration.yaml
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/97/294397/1

diff --git a/hieradata/common/lvs/configuration.yaml 
b/hieradata/common/lvs/configuration.yaml
index 0f8836f..85ed9f4 100644
--- a/hieradata/common/lvs/configuration.yaml
+++ b/hieradata/common/lvs/configuration.yaml
@@ -250,6 +250,17 @@
 conftool:
   cluster: cache_maps
   service: varnish-fe
+icinga:
+  uri: maps.wikimedia.org!/osm-intl/6/23/24.png
+  sites:
+eqiad:
+  hostname: maps-lb.eqiad.wikimedia.org
+codfw:
+  hostname: maps-lb.codfw.wikimedia.org
+esams:
+  hostname: maps-lb.esams.wikimedia.org
+ulsfo:
+  hostname: maps-lb.ulsfo.wikimedia.org
   maps-https:
 description: "Maps service maps-lb.%{::site}.wikimedia.org"
 class: high-traffic2

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

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

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


[MediaWiki-commits] [Gerrit] Skip when an edit is errored in PopulateDatabase.php - change (mediawiki...ORES)

2016-06-14 Thread Ladsgroup (Code Review)
Ladsgroup has uploaded a new change for review.

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

Change subject: Skip when an edit is errored in PopulateDatabase.php
..

Skip when an edit is errored in PopulateDatabase.php

Bug: T137854
Change-Id: I2e7d3bf1777c0cbdf2b9cae797c4b4b71f49d65f
---
M includes/Cache.php
M maintenance/PopulateDatabase.php
2 files changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ORES 
refs/changes/98/294398/1

diff --git a/includes/Cache.php b/includes/Cache.php
index 133e6b7..4c6071d 100644
--- a/includes/Cache.php
+++ b/includes/Cache.php
@@ -20,12 +20,15 @@
 *
 * @throws RuntimeException
 */
-   public function storeScores( $scores ) {
+   public function storeScores( $scores, $batch = false ) {
// Map to database fields.
$dbData = [];
foreach ( $scores as $revision => $revisionData ) {
foreach ( $revisionData as $model => $modelOutputs ) {
if ( isset( $modelOutputs['error'] ) ) {
+   if ( $batch ) {
+   continue;
+   }
throw new RuntimeException( 'Model 
contains an error: ' . $modelOutputs['error']['message'] );
}
 
diff --git a/maintenance/PopulateDatabase.php b/maintenance/PopulateDatabase.php
index 6bfb718..0f9b57d 100644
--- a/maintenance/PopulateDatabase.php
+++ b/maintenance/PopulateDatabase.php
@@ -102,7 +102,7 @@
$this->output( "Processing $size revsisions\n" );
 
$scores = $scoring->getScores( $revs );
-   $cache->storeScores( $scores );
+   $cache->storeScores( $scores, true );
}
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e7d3bf1777c0cbdf2b9cae797c4b4b71f49d65f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup 

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


[MediaWiki-commits] [Gerrit] kartotherian.svc.codfw monitoring - change (operations/puppet)

2016-06-14 Thread BBlack (Code Review)
BBlack has uploaded a new change for review.

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

Change subject: kartotherian.svc.codfw monitoring
..

kartotherian.svc.codfw monitoring

Bug: T137851
Change-Id: Ica72d91c221649dfef4912fbc82393df6e1f839d
---
M hieradata/common/lvs/configuration.yaml
M modules/lvs/manifests/monitor_services.pp
2 files changed, 13 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/96/294396/1

diff --git a/hieradata/common/lvs/configuration.yaml 
b/hieradata/common/lvs/configuration.yaml
index a846879..0f8836f 100644
--- a/hieradata/common/lvs/configuration.yaml
+++ b/hieradata/common/lvs/configuration.yaml
@@ -807,6 +807,11 @@
 conftool:
   cluster: maps
   service: kartotherian
+icinga:
+  check_command: 
"check_http_lvs_on_port!kartotherian.svc.%{::site}.wmnet!6533!/osm-intl/6/23/24.png"
+  sites:
+codfw:
+  hostname: kartotherian.svc.codfw.wmnet
   mobileapps:
 description: "A service for use by mobile apps. Provides DOM manipulation, 
aggregation, JSON flattening. mobileapps.svc.%{::site}.wmnet"
 class: low-traffic
diff --git a/modules/lvs/manifests/monitor_services.pp 
b/modules/lvs/manifests/monitor_services.pp
index 46f4d2e..991d93b 100644
--- a/modules/lvs/manifests/monitor_services.pp
+++ b/modules/lvs/manifests/monitor_services.pp
@@ -101,4 +101,12 @@
 check_command => 
'check_wmf_service!http://cxserver.svc.codfw.wmnet:8080!15',
 }
 
+# Kartotherian
+monitoring::service { 'check_kartotherian_cluster_codfw':
+host  => 'kartotherian.svc.codfw.wmnet',
+group => 'lvs',
+description   => 'Kartotherian LVS codfw',
+check_command => 
'check_wmf_service!http://kartotherian.svc.codfw.wmnet:6533/osm-intl/6/23/24.png!5',
+}
+
 }

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

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

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


[MediaWiki-commits] [Gerrit] Use the specified page ID for LinksDeletionUpdate - change (mediawiki/core)

2016-06-14 Thread Aaron Schulz (Code Review)
Aaron Schulz has submitted this change and it was merged.

Change subject: Use the specified page ID for LinksDeletionUpdate
..


Use the specified page ID for LinksDeletionUpdate

This makes LinksDeleteJob use the correct page ID when a new
page was later created at the title. The links and protection
rows to clear should always be for the ID of the actual page
being deleted.

This fixes a bug when pages are moved over redirects.

Bug: T128624
Change-Id: Id67a021539b97020e8dd32d56dba1b77c806f31c
---
M includes/deferred/LinksDeletionUpdate.php
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/includes/deferred/LinksDeletionUpdate.php 
b/includes/deferred/LinksDeletionUpdate.php
index b8bd747..c227ecd 100644
--- a/includes/deferred/LinksDeletionUpdate.php
+++ b/includes/deferred/LinksDeletionUpdate.php
@@ -37,10 +37,10 @@
parent::__construct( false ); // no implicit transaction
 
$this->page = $page;
-   if ( $page->exists() ) {
+   if ( $pageId ) {
+   $this->pageId = $pageId; // page ID at time of deletion
+   } elseif ( $page->exists() ) {
$this->pageId = $page->getId();
-   } elseif ( $pageId ) {
-   $this->pageId = $pageId;
} else {
throw new InvalidArgumentException( "Page ID not known. 
Page doesn't exist?" );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id67a021539b97020e8dd32d56dba1b77c806f31c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.6
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Apply variant C most read UI tweaks - change (apps...wikipedia)

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

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

Change subject: Apply variant C most read UI tweaks
..

Apply variant C most read UI tweaks

https://app.zeplin.io/project.html#pid=575030de30a17087229662e6=5756ffc19bf6204842c64ebf

Bug: T129082
Change-Id: I5a25213007c600be2882b38b3de425ca2c3c555f
---
M app/src/main/java/org/wikipedia/feed/mostread/MostReadCardView.java
M app/src/main/java/org/wikipedia/feed/mostread/MostReadListCard.java
M app/src/main/java/org/wikipedia/feed/view/CardHeaderView.java
M app/src/main/java/org/wikipedia/util/ResourceUtil.java
A app/src/main/res/drawable/ic_most_read.xml
M app/src/main/res/layout/view_card_header.xml
M app/src/main/res/values/strings_no_translate.xml
M app/src/test/java/org/wikipedia/feed/mostread/MostReadClientTest.java
8 files changed, 56 insertions(+), 22 deletions(-)


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

diff --git 
a/app/src/main/java/org/wikipedia/feed/mostread/MostReadCardView.java 
b/app/src/main/java/org/wikipedia/feed/mostread/MostReadCardView.java
index 081bc9b..fcb67d0 100644
--- a/app/src/main/java/org/wikipedia/feed/mostread/MostReadCardView.java
+++ b/app/src/main/java/org/wikipedia/feed/mostread/MostReadCardView.java
@@ -3,11 +3,13 @@
 import android.content.Context;
 import android.support.annotation.NonNull;
 
+import org.wikipedia.R;
 import org.wikipedia.feed.demo.IntegerListCard;
 import org.wikipedia.feed.view.CardFooterView;
 import org.wikipedia.feed.view.CardHeaderView;
 import org.wikipedia.feed.view.ListCardItemView;
 import org.wikipedia.feed.view.ListCardView;
+import org.wikipedia.util.ResourceUtil;
 import org.wikipedia.views.DefaultViewHolder;
 
 import java.util.List;
@@ -26,7 +28,8 @@
 private void header(@NonNull MostReadListCard card) {
 CardHeaderView header = new CardHeaderView(getContext())
 .setTitle(card.title())
-.setSubtitle(card.subtitle());
+.setSubtitle(card.subtitle())
+.setImage(ResourceUtil.uri(getContext(), 
R.drawable.ic_most_read));
 header(header);
 }
 
diff --git 
a/app/src/main/java/org/wikipedia/feed/mostread/MostReadListCard.java 
b/app/src/main/java/org/wikipedia/feed/mostread/MostReadListCard.java
index 212d769..723cea5 100644
--- a/app/src/main/java/org/wikipedia/feed/mostread/MostReadListCard.java
+++ b/app/src/main/java/org/wikipedia/feed/mostread/MostReadListCard.java
@@ -26,21 +26,23 @@
 }
 
 @NonNull @Override public String title() {
-return getString(R.string.most_read_list_card_title, date());
+return getString(R.string.most_read_list_card_title);
 }
 
 @Nullable @Override public String subtitle() {
-return date();
+// todo: consider allowing TWN date formats. It would be useful to 
have but might be
+//   difficult for translators to write correct format specifiers 
without being able to
+//   test them. We should investigate localization support in date 
libraries such as
+//   Joda-Time and how TWN solves this classic problem.
+DateFormat dateFormat = 
android.text.format.DateFormat.getDateFormat(context());
+return dateFormat.format(articles.date());
 }
 
 @Nullable @Override public String footer() {
-// todo: the mocks show a more terse date used here but this will 
probably require TWN
-//   support. We should investigate localization support in date 
libraries such as
-//   Joda-Time and how TWN solves this classic problem.
-return getString(R.string.most_read_list_card_footer, date());
+return getString(R.string.most_read_list_card_footer);
 }
 
-@VisibleForTesting @NonNull Date getDate() {
+@VisibleForTesting @NonNull Date date() {
 return articles.date();
 }
 
@@ -50,14 +52,6 @@
 cards.add(new MostReadItemCard(article));
 }
 return cards.subList(0, Math.min(cards.size(), MAX_SIZE));
-}
-
-@NonNull private String date() {
-// todo: consider allowing TWN date formats. It would be useful to 
have but might be
-//   difficult for translators to write correct format specifiers 
without being able to
-//   test them.
-DateFormat dateFormat = 
android.text.format.DateFormat.getDateFormat(context());
-return dateFormat.format(articles.date());
 }
 
 @NonNull private String getString(@StringRes int id, @Nullable Object... 
formatArgs) {
diff --git a/app/src/main/java/org/wikipedia/feed/view/CardHeaderView.java 
b/app/src/main/java/org/wikipedia/feed/view/CardHeaderView.java
index ca75f8c..3bc2ad2 100644
--- a/app/src/main/java/org/wikipedia/feed/view/CardHeaderView.java
+++ b/app/src/main/java/org/wikipedia/feed/view/CardHeaderView.java
@@ -26,7 +26,7 @@
 

[MediaWiki-commits] [Gerrit] Upgrade Robolectric to v3.1 and API to Marshmallow - change (apps...wikipedia)

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

Change subject: Upgrade Robolectric to v3.1 and API to Marshmallow
..


Upgrade Robolectric to v3.1 and API to Marshmallow

Upgrade Robolectric to v3.1[0]. Also, upgrade the test API to v23 since
that seems to be compatible with OkHttp v3.3.1[1].

[0] https://github.com/robolectric/robolectric/releases/tag/robolectric-3.1
[1] https://github.com/square/okhttp/issues/2533#issuecomment-222366551

Change-Id: I2920ea8368b35f06615d45536ce5c7b733234303
---
M app/build.gradle
M app/src/test/resources/robolectric.properties
2 files changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/app/build.gradle b/app/build.gradle
index 9b4c59d..0d132a4 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -194,7 +194,7 @@
 
 testCompile 'junit:junit:4.12'
 testCompile 'org.mockito:mockito-core:1.9.5'
-testCompile 'org.robolectric:robolectric:3.1-rc1'
+testCompile 'org.robolectric:robolectric:3.1'
 testCompile "com.squareup.okhttp3:mockwebserver:$okHttpVersion"
 
 // Required by Android JUnit Runner.
diff --git a/app/src/test/resources/robolectric.properties 
b/app/src/test/resources/robolectric.properties
index 7a38488..05431c7 100644
--- a/app/src/test/resources/robolectric.properties
+++ b/app/src/test/resources/robolectric.properties
@@ -1,3 +1,3 @@
 # suppress inspection "UnusedProperty" for whole file
-sdk=21
+sdk=23
 manifest=src/main/AndroidManifest.xml

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2920ea8368b35f06615d45536ce5c7b733234303
Gerrit-PatchSet: 2
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Niedzielski 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Adyen iframe hacks to fix CVV input - change (mediawiki...DonationInterface)

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

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

Change subject: Adyen iframe hacks to fix CVV input
..

Adyen iframe hacks to fix CVV input

This is version 24 of the skin, not yet live. Increases maxlength
of CVV input and adds autocomplete and inputmode hints.

Bug: T137811
Change-Id: I46da76e1565614eddc3e45a887fe7bb324e491e9
---
M adyen_gateway/forms/iframe/inc/cfooter.txt
1 file changed, 28 insertions(+), 0 deletions(-)


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

diff --git a/adyen_gateway/forms/iframe/inc/cfooter.txt 
b/adyen_gateway/forms/iframe/inc/cfooter.txt
index 04f5b84..0535de4 100644
--- a/adyen_gateway/forms/iframe/inc/cfooter.txt
+++ b/adyen_gateway/forms/iframe/inc/cfooter.txt
@@ -1 +1,29 @@
 
+
+
+var cvvInput = document.getElementById( 'card.cvcCode' ),
+   cardInput = document.getElementById( 'card.cardNumber' ),
+   expMonthSelect = document.getElementById( 'card.expiryMonth' ),
+   expYearSelect = document.getElementById( 'card.expiryYear' );
+
+if ( cvvInput ) {
+   cvvInput.setAttribute( 'maxlength', 4 );
+   cvvInput.setAttribute( 'inputmode', 'numeric' );
+   cvvInput.setAttribute( 'x-inputmode', 'numeric' );
+   cvvInput.setAttribute( 'autocomplete', 'cc-csc' );
+}
+
+if ( cardInput ) {
+   cardInput.setAttribute( 'inputmode', 'numeric' );
+   cardInput.setAttribute( 'x-inputmode', 'numeric' );
+   cardInput.setAttribute( 'autocomplete', 'cc-number' );
+}
+
+if ( expMonthSelect ) {
+   expMonthSelect.setAttribute( 'autocomplete', 'cc-exp-month' );
+}
+
+if ( expYearSelect ) {
+   expYearSelect.setAttribute( 'autocomplete', 'cc-exp-year' );
+}
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I46da76e1565614eddc3e45a887fe7bb324e491e9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
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] New decodeURIComponentIntoArticleTitle method - change (mediawiki...VisualEditor)

2016-06-14 Thread Divec (Code Review)
Divec has uploaded a new change for review.

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

Change subject: New decodeURIComponentIntoArticleTitle method
..

New decodeURIComponentIntoArticleTitle method

This replaces ve.safeDecodeURIComponent(...).replace( /_/g, ' ' ) . This action
is really specific to the quirks of mediawiki title processing.

Change-Id: Ia9e525c9340e6de9e48535586c97867ccb48
---
M extension.json
M modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js
M modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js
M modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js
M modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js
M modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js
A modules/ve-mw/ve.MWutils.js
7 files changed, 41 insertions(+), 9 deletions(-)


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

diff --git a/extension.json b/extension.json
index 810cb8c..7de529d 100644
--- a/extension.json
+++ b/extension.json
@@ -1109,6 +1109,7 @@
},
"ext.visualEditor.mwcore": {
"scripts": [
+   "modules/ve-mw/ve.MWutils.js",
"modules/ve-mw/dm/nodes/ve.dm.MWEntityNode.js",

"modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js",
"modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js",
diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js 
b/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js
index 64eb73e0..9fe764e 100644
--- a/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js
+++ b/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js
@@ -180,7 +180,7 @@
var targetData = 
ve.dm.MWInternalLinkAnnotation.static.getTargetDataFromHref(
this.href, 
transclusionNode.getModelHtmlDocument()
),
-   normalisedHref = 
ve.safeDecodeURIComponent( targetData.title );
+   normalisedHref = 
ve.decodeURIComponentIntoArticleTitle( targetData.title, false );
if ( mw.Title.newFromText( normalisedHref ) ) {
normalisedHref = mw.Title.newFromText( 
normalisedHref ).getPrefixedText();
}
diff --git a/modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js 
b/modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js
index fafa709..4807da9 100644
--- a/modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js
+++ b/modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js
@@ -42,7 +42,7 @@
type: this.name,
attributes: {
hrefPrefix: targetData.hrefPrefix,
-   title: ve.safeDecodeURIComponent( targetData.title 
).replace( /_/g, ' ' ),
+   title: ve.decodeURIComponentIntoArticleTitle( 
targetData.title ),
normalizedTitle: this.normalizeTitle( targetData.title 
),
lookupTitle: this.getLookupTitle( targetData.title ),
origTitle: targetData.title
@@ -130,7 +130,7 @@
var href,
title = dataElement.attributes.title,
origTitle = dataElement.attributes.origTitle;
-   if ( origTitle !== undefined && ve.safeDecodeURIComponent( origTitle 
).replace( /_/g, ' ' ) === title ) {
+   if ( origTitle !== undefined && ve.decodeURIComponentIntoArticleTitle( 
origTitle ) === title ) {
// Restore href from origTitle
href = origTitle;
// Only use hrefPrefix if restoring from origTitle
diff --git a/modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js 
b/modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js
index c978373..d04c55d 100644
--- a/modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js
+++ b/modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js
@@ -41,9 +41,9 @@
type: this.name,
attributes: {
hrefPrefix: matches[ 1 ],
-   category: ve.safeDecodeURIComponent( matches[ 2 ] 
).replace( /_/g, ' ' ),
+   category: ve.decodeURIComponentIntoArticleTitle( 
matches[ 2 ] ),
origCategory: matches[ 2 ],
-   sortkey: ve.safeDecodeURIComponent( rawSortkey 
).replace( /_/g, ' ' ),
+   sortkey: ve.decodeURIComponentIntoArticleTitle( 
rawSortkey ),
origSortkey: rawSortkey
}
};
@@ -57,8 +57,8 @@
sortkey = dataElement.attributes.sortkey || '',
origCategory = dataElement.attributes.origCategory || '',
origSortkey = dataElement.attributes.origSortkey || 

[MediaWiki-commits] [Gerrit] Check in Adyen iframe skin - change (mediawiki...DonationInterface)

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

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

Change subject: Check in Adyen iframe skin
..

Check in Adyen iframe skin

This is version 23, which is live right now, prior to CVV field
fixes.

Bug: T137811
Change-Id: Ia2f9f140f216e20587f213913037bde7317dc603
---
A adyen_gateway/forms/iframe/css/logo-gloss.css
A adyen_gateway/forms/iframe/css/print.css
R adyen_gateway/forms/iframe/css/screen.css
A adyen_gateway/forms/iframe/css/screen_ie6.css
A adyen_gateway/forms/iframe/img/Adyen_logo.png
A adyen_gateway/forms/iframe/img/favicon.ico
A adyen_gateway/forms/iframe/img/ideal-gloss.png
A adyen_gateway/forms/iframe/img/pm-gloss.png
A adyen_gateway/forms/iframe/img/top-background.png
A adyen_gateway/forms/iframe/inc/cfooter.txt
A adyen_gateway/forms/iframe/inc/cheader.txt
A adyen_gateway/forms/iframe/inc/pmfooter.txt
A adyen_gateway/forms/iframe/inc/pmheader.txt
13 files changed, 50 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/92/294392/1

diff --git a/adyen_gateway/forms/iframe/css/logo-gloss.css 
b/adyen_gateway/forms/iframe/css/logo-gloss.css
new file mode 100644
index 000..ddd7c43
--- /dev/null
+++ b/adyen_gateway/forms/iframe/css/logo-gloss.css
@@ -0,0 +1,21 @@
+.pmBcard { background: url(../img/pm-gloss.png) 0 -273px no-repeat !important; 
}
+.pmBamex { background: url(../img/pm-gloss.png) 0 0 no-repeat !important; }
+.pmBdiners { background: url(../img/pm-gloss.png)  0 -455px no-repeat 
!important; }
+.pmBdiscover { background: url(../img/pm-gloss.png) 0 -546px no-repeat 
!important; }
+.pmBideal { background: url(../img/pm-gloss.png) 0 -637px no-repeat 
!important; }
+.pmBjcb { background: url(../img/pm-gloss.png) 0 -728px no-repeat !important; }
+.pmBmaestro { background: url(../img/pm-gloss.png) 0 -819px no-repeat 
!important; }
+.pmBmc { background: url(../img/pm-gloss.png) 0 -910px no-repeat !important; }
+.pmBunionpay { background: url(../img/pm-gloss.png) 0 -1001px no-repeat 
!important; }
+.pmBvisa { background: url(../img/pm-gloss.png) 0 -1274px no-repeat 
!important; }
+
+.idealButton[value="0021"] { background: url(../img/ideal-gloss.png) 0 -450px 
!important; }
+.idealButton[value="0031"] { background: url(../img/ideal-gloss.png) 0 0 
!important; }
+.idealButton[value="0091"] { background: url(../img/ideal-gloss.png) 0 -180px 
!important; }
+.idealButton[value="0721"] { background: url(../img/ideal-gloss.png) 0 -270px 
!important; }
+.idealButton[value="0751"] { background: url(../img/ideal-gloss.png) 0 -630px 
!important; } 
+.idealButton[value="0161"] { background: url(../img/ideal-gloss.png) 0 -810px 
!important; }
+.idealButton[value="0511"] { background: url(../img/ideal-gloss.png) 0 -720px 
!important; }
+.idealButton[value="0761"] { background: url(../img/ideal-gloss.png) 0 -90px 
!important; }
+.idealButton[value="0771"] { background: url(../img/ideal-gloss.png) 0 -540px 
!important; }
+.idealButton[value="0801"] { background: url(../img/ideal-gloss.png) 0 -360px 
!important; }
\ No newline at end of file
diff --git a/adyen_gateway/forms/iframe/css/print.css 
b/adyen_gateway/forms/iframe/css/print.css
new file mode 100644
index 000..b717015
--- /dev/null
+++ b/adyen_gateway/forms/iframe/css/print.css
@@ -0,0 +1,17 @@
+html {
+   background: #fff;
+   color: #000;
+   font-size: 11pt;
+   font-family: arial, sans-serif;
+}
+
+.imgB {
+   background: #ccc !important;
+}
+.receiptNoPrint {
+   display: none;
+}
+
+.receiptPrint {
+   display: block;
+}
diff --git a/adyen_gateway/forms/css/iframe.screen.css 
b/adyen_gateway/forms/iframe/css/screen.css
similarity index 100%
rename from adyen_gateway/forms/css/iframe.screen.css
rename to adyen_gateway/forms/iframe/css/screen.css
diff --git a/adyen_gateway/forms/iframe/css/screen_ie6.css 
b/adyen_gateway/forms/iframe/css/screen_ie6.css
new file mode 100644
index 000..c264272
--- /dev/null
+++ b/adyen_gateway/forms/iframe/css/screen_ie6.css
@@ -0,0 +1,7 @@
+/* IE layout correction for the footer buttons */
+#footerb1div {
+   margin-left: 10px;
+}
+#footerb2div {
+   margin-right: 10px;
+}
\ No newline at end of file
diff --git a/adyen_gateway/forms/iframe/img/Adyen_logo.png 
b/adyen_gateway/forms/iframe/img/Adyen_logo.png
new file mode 100644
index 000..3f984b3
--- /dev/null
+++ b/adyen_gateway/forms/iframe/img/Adyen_logo.png
Binary files differ
diff --git a/adyen_gateway/forms/iframe/img/favicon.ico 
b/adyen_gateway/forms/iframe/img/favicon.ico
new file mode 100644
index 000..65455a8
--- /dev/null
+++ b/adyen_gateway/forms/iframe/img/favicon.ico
Binary files differ
diff --git a/adyen_gateway/forms/iframe/img/ideal-gloss.png 
b/adyen_gateway/forms/iframe/img/ideal-gloss.png
new file mode 100644
index 000..30d328d
--- /dev/null
+++ b/adyen_gateway/forms/iframe/img/ideal-gloss.png
Binary files 

[MediaWiki-commits] [Gerrit] Detect scheme based on request domain - change (mediawiki...mobileapps)

2016-06-14 Thread Mholloway (Code Review)
Mholloway has uploaded a new change for review.

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

Change subject: Detect scheme based on request domain
..

Detect scheme based on request domain

We need to start using HTTPS for all requests to prod endpoints (they've
started serving 403s to a percentage of non-HTTPS requests).  For now
let's detect whether we're requesting from a labs machine (which still use
https:) and adjust accordingly.

Change-Id: Id3896c9bda3a9a0172550c5d82deb0146c83f688
---
M config.dev.yaml
M lib/api-util.js
M test/features/featured/pagecontent.js
M test/features/media/pagecontent.js
M test/features/mobile-summary/pagecontent.js
5 files changed, 13 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/91/294391/1

diff --git a/config.dev.yaml b/config.dev.yaml
index 6bc9d80..b3f0858 100644
--- a/config.dev.yaml
+++ b/config.dev.yaml
@@ -64,14 +64,14 @@
   # the template used for contacting the MW API
   mwapi_req:
 method: post
-uri: http://{{domain}}/w/api.php
+uri: '{{scheme}}://{{domain}}/w/api.php'
 headers:
   user-agent: '{{user-agent}}'
 body: '{{ default(request.query, {}) }}'
   # the template used for contacting RESTBase
   restbase_req:
 method: get
-uri: http://{{domain}}/api/rest_v1/{+path}
+uri: '{{scheme}}://{{domain}}/api/rest_v1/{+path}'
 query: '{{ default(request.query, {}) }}'
 headers: '{{request.headers}}'
 body: '{{request.body}}'
diff --git a/lib/api-util.js b/lib/api-util.js
index 998f2bd..1377b4b 100644
--- a/lib/api-util.js
+++ b/lib/api-util.js
@@ -23,7 +23,8 @@
 
 var request = app.mwapi_tpl.expand({
 request: {
-params: { domain: domain },
+params: { domain: domain, 
+  scheme: domain.indexOf('beta.wmflabs.org') !== -1 ? 
'http' : 'https' },
 headers: { 'user-agent': app.conf.user_agent },
 query: query
 }
@@ -59,7 +60,7 @@
  * @return {Promise} a promise resolving as the response object from the REST 
API
  *
  */
-function restApiGet(app, domain, path, restReq) {
+function restApiGet(app, domain, path, restReq, scheme) {
 
 restReq = restReq || {};
 path = path[0] === '/' ? path.slice(1) : path;
@@ -67,7 +68,9 @@
 var request = app.restbase_tpl.expand({
 request: {
 method: restReq.method,
-params: { domain: domain, path: path },
+params: { domain: domain, 
+  path: path, 
+  scheme: domain.indexOf('beta.wmflabs.org') !== -1 ? 
'http' : 'https' },
 query: restReq.query,
 headers: Object.assign({ 'user-agent': app.conf.user_agent }, 
restReq.headers),
 body: restReq.body
diff --git a/test/features/featured/pagecontent.js 
b/test/features/featured/pagecontent.js
index f1a46c8..9f2dde8 100644
--- a/test/features/featured/pagecontent.js
+++ b/test/features/featured/pagecontent.js
@@ -22,9 +22,9 @@
 // the page id should be stable but not the revision:
 assert.ok(res.headers.etag.indexOf('50089449/') == 0);
 assert.equal(res.body.title, 'Cosmic Stories and Stirring 
Science Stories');
-assert.equal(res.body.thumbnail['60'], 
'http://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/60px-Cosmic_Science-Fiction_May_1941.jpg');
-assert.equal(res.body.thumbnail['120'], 
'http://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/120px-Cosmic_Science-Fiction_May_1941.jpg');
-assert.equal(res.body.thumbnail['320'], 
'http://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/226px-Cosmic_Science-Fiction_May_1941.jpg');
+assert.equal(res.body.thumbnail['60'], 
'https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/60px-Cosmic_Science-Fiction_May_1941.jpg');
+assert.equal(res.body.thumbnail['120'], 
'https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/120px-Cosmic_Science-Fiction_May_1941.jpg');
+assert.equal(res.body.thumbnail['320'], 
'https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/226px-Cosmic_Science-Fiction_May_1941.jpg');
 assert.ok(res.body.extract.indexOf('Cosmic Stories ') >= 0);
 });
 });
diff --git a/test/features/media/pagecontent.js 
b/test/features/media/pagecontent.js
index d7d38f2..0fc4fd7 100644
--- a/test/features/media/pagecontent.js
+++ b/test/features/media/pagecontent.js
@@ -12,7 +12,7 @@
 
 function checkItemHasExpectedProperties(item) {
 assert.ok(item.title.indexOf('File:') 

[MediaWiki-commits] [Gerrit] phab2001 install module updates - change (operations/puppet)

2016-06-14 Thread RobH (Code Review)
RobH has submitted this change and it was merged.

Change subject: phab2001 install module updates
..


phab2001 install module updates

setting dhcp lease info and netboot partitioning info

T137838

Change-Id: I441d08085e4baee5a106bb2f7815ac64d08ef04f
---
M modules/install_server/files/autoinstall/netboot.cfg
M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
2 files changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/modules/install_server/files/autoinstall/netboot.cfg 
b/modules/install_server/files/autoinstall/netboot.cfg
index 7a0d9c8..638f2db 100755
--- a/modules/install_server/files/autoinstall/netboot.cfg
+++ b/modules/install_server/files/autoinstall/netboot.cfg
@@ -83,7 +83,7 @@
 graphite200[12]) echo partman/graphite.cfg ;; \
 hydrogen) echo partman/raid1-1partition.cfg ;; \
 kafka1013|kafka1014|kafka1020) echo partman/raid1-30G.cfg ;; \
-kafka100[1-2]|kafka200[1-2]|stat1004) echo 
partman/raid10-gpt-srv-ext4.cfg ;; \
+phab2001|kafka100[1-2]|kafka200[1-2]|stat1004) echo 
partman/raid10-gpt-srv-ext4.cfg ;; \
 
auth[1-2]001|einsteinium|labcontrol100[1-2]|labnodepool1001|lead|mira|neodymium|oresrdb100[1-2]|rdb200[1-6])
 echo partman/raid1-lvm-ext4-srv.cfg ;; \
 labmon1001) echo partman/raid10-gpt-srv-lvm-ext4.cfg ;; \
 labnet100[1-2]) echo partman/lvm.cfg ;; \
diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 
b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
index 15220e6..ea3707c 100644
--- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
+++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
@@ -6137,6 +6137,11 @@
 fixed-address pc2006.codfw.wmnet;
 }
 
+host phab2001 {
+hardware ethernet 14:18:77:5B:0C:FA;
+fixed-address phab2001.codfw.wmnet;
+}
+
 host potassium {
 hardware ethernet 78:2b:cb:08:ac:78;
 fixed-address potassium.eqiad.wmnet;

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

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

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


[MediaWiki-commits] [Gerrit] maps caches: remove referrer checks - change (operations/puppet)

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

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

Change subject: maps caches: remove referrer checks
..

maps caches: remove referrer checks

Bug: T137848
Change-Id: I2a5ff946f3183c6f150aed67a53e5368acf31a0e
---
M templates/varnish/maps-frontend.inc.vcl.erb
1 file changed, 1 insertion(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/90/294390/1

diff --git a/templates/varnish/maps-frontend.inc.vcl.erb 
b/templates/varnish/maps-frontend.inc.vcl.erb
index 482fb4d..8430c93 100644
--- a/templates/varnish/maps-frontend.inc.vcl.erb
+++ b/templates/varnish/maps-frontend.inc.vcl.erb
@@ -2,19 +2,7 @@
 
 sub cluster_fe_recv_pre_purge { }
 
-sub cluster_fe_recv {
-   if (req.http.referer
-   && req.url != "/"
-   && req.http.referer !~ 
"(?i)^https?://([-a-zA-Z0-9.]+\.)?(mediawiki|wikivoyage|wikivoyage-ev|wmflabs|wikidata)\.org(/|$)"
-   && req.http.referer !~ 
"(?i)^https?://(maps|phabricator|wikitech|incubator|pl)\.(m\.)?wikimedia\.org(/|$)"
-   && req.http.referer !~ 
"(?i)^https?://test2?\.(m\.)?wikipedia\.org(/|$)"
-   // Vagrant support
-   && req.http.referer !~ 
"(?i)^https?://([-a-zA-Z0-9.]+\.)?wmftest\.net(:\d+)?(/|$)"
-   && req.http.referer !~ 
"(?i)^https?://(localhost|127\.0\.0\.1)(:\d+)?(/|$)"
-   ) {
-   return (synth(403, "Access Denied"));
-   }
-}
+sub cluster_fe_recv { }
 
 sub cluster_fe_hash { }
 sub cluster_fe_hit { }

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

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

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


[MediaWiki-commits] [Gerrit] Use https for tests - change (mediawiki...mobileapps)

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

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

Change subject: Use https for tests
..

Use https for tests

Have to skip the beta labs tests. This is a stop-gap measure to get us going 
again since now
HTTPS is enforced.

Change-Id: I61fade95f274bb19ee23be74b68c1e2cc4180ca8
---
M config.dev.yaml
M test/features/featured/pagecontent.js
M test/features/media/pagecontent.js
M test/features/mobile-sections/pagecontent.js
M test/features/mobile-summary/pagecontent.js
5 files changed, 9 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/89/294389/1

diff --git a/config.dev.yaml b/config.dev.yaml
index 6bc9d80..c04dde0 100644
--- a/config.dev.yaml
+++ b/config.dev.yaml
@@ -64,14 +64,14 @@
   # the template used for contacting the MW API
   mwapi_req:
 method: post
-uri: http://{{domain}}/w/api.php
+uri: https://{{domain}}/w/api.php
 headers:
   user-agent: '{{user-agent}}'
 body: '{{ default(request.query, {}) }}'
   # the template used for contacting RESTBase
   restbase_req:
 method: get
-uri: http://{{domain}}/api/rest_v1/{+path}
+uri: https://{{domain}}/api/rest_v1/{+path}
 query: '{{ default(request.query, {}) }}'
 headers: '{{request.headers}}'
 body: '{{request.body}}'
diff --git a/test/features/featured/pagecontent.js 
b/test/features/featured/pagecontent.js
index f1a46c8..9f2dde8 100644
--- a/test/features/featured/pagecontent.js
+++ b/test/features/featured/pagecontent.js
@@ -22,9 +22,9 @@
 // the page id should be stable but not the revision:
 assert.ok(res.headers.etag.indexOf('50089449/') == 0);
 assert.equal(res.body.title, 'Cosmic Stories and Stirring 
Science Stories');
-assert.equal(res.body.thumbnail['60'], 
'http://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/60px-Cosmic_Science-Fiction_May_1941.jpg');
-assert.equal(res.body.thumbnail['120'], 
'http://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/120px-Cosmic_Science-Fiction_May_1941.jpg');
-assert.equal(res.body.thumbnail['320'], 
'http://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/226px-Cosmic_Science-Fiction_May_1941.jpg');
+assert.equal(res.body.thumbnail['60'], 
'https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/60px-Cosmic_Science-Fiction_May_1941.jpg');
+assert.equal(res.body.thumbnail['120'], 
'https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/120px-Cosmic_Science-Fiction_May_1941.jpg');
+assert.equal(res.body.thumbnail['320'], 
'https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Cosmic_Science-Fiction_May_1941.jpg/226px-Cosmic_Science-Fiction_May_1941.jpg');
 assert.ok(res.body.extract.indexOf('Cosmic Stories ') >= 0);
 });
 });
diff --git a/test/features/media/pagecontent.js 
b/test/features/media/pagecontent.js
index d7d38f2..0fc4fd7 100644
--- a/test/features/media/pagecontent.js
+++ b/test/features/media/pagecontent.js
@@ -12,7 +12,7 @@
 
 function checkItemHasExpectedProperties(item) {
 assert.ok(item.title.indexOf('File:') === 0, 'Expected title to start 
with "File:"');
-assert.ok(item.url.indexOf('http://upload.wikimedia.org/') === 0, 
'Expected url to start with certain text');
+assert.ok(item.url.indexOf('https://upload.wikimedia.org/') === 0, 
'Expected url to start with certain text');
 }
 
 it('should respond to GET request with expected headers, incl. CORS and 
CSP headers', function() {
diff --git a/test/features/mobile-sections/pagecontent.js 
b/test/features/mobile-sections/pagecontent.js
index 07a5c29..a754391 100644
--- a/test/features/mobile-sections/pagecontent.js
+++ b/test/features/mobile-sections/pagecontent.js
@@ -85,7 +85,7 @@
 assert.deepEqual(res.status, 200);
 });
 });
-it('Beta cluster request should load successfully', function() {
+it.skip('Beta cluster request should load successfully', function() {
 return preq.get({ uri: server.config.uri + 
'en.wikipedia.beta.wmflabs.org/v1/page/mobile-sections/Foobar' })
 .then(function(res) {
 assert.deepEqual(res.status, 200);
@@ -107,7 +107,7 @@
 assert.deepEqual(res.body.lead.redirected, 'User:BSitzmann 
(WMF)/MCS/Test/A');
 });
 });
-it('Page with % in redirected page title should load', function() {
+it.skip('Page with % in redirected page title should load', function() {
 return preq.get({ uri: server.config.uri + 

[MediaWiki-commits] [Gerrit] Use the specified page ID for LinksDeletionUpdate - change (mediawiki/core)

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

Change subject: Use the specified page ID for LinksDeletionUpdate
..


Use the specified page ID for LinksDeletionUpdate

This makes LinksDeleteJob use the correct page ID when a new
page was later created at the title. The links and protection
rows to clear should always be for the ID of the actual page
being deleted.

This fixes a bug when pages are moved over redirects.

Bug: T128624
Change-Id: Id67a021539b97020e8dd32d56dba1b77c806f31c
---
M includes/deferred/LinksDeletionUpdate.php
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/includes/deferred/LinksDeletionUpdate.php 
b/includes/deferred/LinksDeletionUpdate.php
index b8bd747..c227ecd 100644
--- a/includes/deferred/LinksDeletionUpdate.php
+++ b/includes/deferred/LinksDeletionUpdate.php
@@ -37,10 +37,10 @@
parent::__construct( false ); // no implicit transaction
 
$this->page = $page;
-   if ( $page->exists() ) {
+   if ( $pageId ) {
+   $this->pageId = $pageId; // page ID at time of deletion
+   } elseif ( $page->exists() ) {
$this->pageId = $page->getId();
-   } elseif ( $pageId ) {
-   $this->pageId = $pageId;
} else {
throw new InvalidArgumentException( "Page ID not known. 
Page doesn't exist?" );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id67a021539b97020e8dd32d56dba1b77c806f31c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.5
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Cache AbuseFilter::checkAllFilters during edit stashing - change (mediawiki...AbuseFilter)

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

Change subject: Cache AbuseFilter::checkAllFilters during edit stashing
..


Cache AbuseFilter::checkAllFilters during edit stashing

This should improve page save times when manual edit summaries are
not used (and in a few cases, where they are).

Also fix a few annoying IDEA errors with block comments.

Bug: T137698
Depends-On: I2e407a3ac8b74e77bf88b1e34c1519f4dea63b80
Change-Id: I972e9147a5e52a941f478eaf1e96dc3ef8bdfe94
---
M AbuseFilter.class.php
M AbuseFilter.hooks.php
2 files changed, 136 insertions(+), 34 deletions(-)

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



diff --git a/AbuseFilter.class.php b/AbuseFilter.class.php
index 69715c1..032706e 100644
--- a/AbuseFilter.class.php
+++ b/AbuseFilter.class.php
@@ -1,5 +1,8 @@
 isOK() will 
return true if
 * there were no actions taken, false otherwise. 
$status->getValue() will return
 * an array listing the actions taken. $status-getErrors(), 
etc, will provide
@@ -865,9 +868,12 @@
 * @param $title Title
 * @param string $group The filter's group (as defined in 
$wgAbuseFilterValidGroups)
 * @param User $user The user performing the action; defaults to $wgUser
+* @param string $mode Use 'execute' to run filters and log or 'stash' 
to only cache matches
 * @return Status
 */
-   public static function filterAction( $vars, $title, $group = 'default', 
$user = null ) {
+   public static function filterAction(
+   $vars, $title, $group = 'default', $user = null, $mode = 
'execute'
+   ) {
global $wgUser, $wgTitle, $wgRequest;
 
$context = RequestContext::getMain();
@@ -884,24 +890,44 @@
 
// Add vars from extensions
Hooks::run( 'AbuseFilter-filterAction', array( &$vars, $title ) 
);
-
-   // Set context
$vars->setVar( 'context', 'filter' );
$vars->setVar( 'timestamp', time() );
+   // Get the stash key based on the relevant "input" variables
+   $cache = ObjectCache::getLocalClusterInstance();
+   $stashKey = self::getStashKey( $cache, $vars, $group );
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $filter_matched = false;
+   if ( $mode === 'execute' ) {
+   // Check the filter edit stash results first
+   $filter_matched = $cache->get( $stashKey );
+   }
 
-   $filter_matched = self::checkAllFilters( $vars, $group );
+   $logger = LoggerFactory::getInstance( 'StashEdit' );
+   $statsd = 
MediaWikiServices::getInstance()->getStatsdDataFactory();
+   if ( is_array( $filter_matched ) ) {
+   $logger->info( __METHOD__ . ": cache hit for '$title' 
(key $stashKey)." );
+   $statsd->increment( 'abusefilter.check-stash.hit' );
+   } else {
+   $filter_matched = self::checkAllFilters( $vars, $group 
);
+   $logger->info( __METHOD__ . ": cache miss for '$title' 
(key $stashKey)." );
+   $statsd->increment( 'abusefilter.check-stash.miss' );
+   }
+
+   if ( $mode === 'stash' ) {
+   // Save the filter stash result and do nothing further
+   $cache->set( $stashKey, $filter_matched, 
$cache::TTL_MINUTE );
+   $logger->info( __METHOD__ . ": cache store for '$title' 
(key $stashKey)." );
+   $statsd->increment( 'abusefilter.check-stash.store' );
+
+   return Status::newGood();
+   }
 
$matched_filters = array_keys( array_filter( $filter_matched ) 
);
 
if ( count( $matched_filters ) == 0 ) {
$status = Status::newGood();
} else {
-   wfProfileIn( __METHOD__ . '-block' );
-
-   $status = self::executeFilterActions(
-   $matched_filters, $title, $vars );
+   $status = self::executeFilterActions( $matched_filters, 
$title, $vars );
 
$actions_taken = $status->value; // getValue() was 
introduced only in 1.20
 
@@ -915,7 +941,7 @@
$log_template = array(
'afl_user' => $user->getId(),
'afl_user_text' => $user->getName(),
-   'afl_timestamp' => $dbr->timestamp( 
wfTimestampNow() ),
+   'afl_timestamp' => wfGetDB( DB_SLAVE 
)->timestamp( wfTimestampNow() ),
'afl_namespace' => $title->getNamespace(),
'afl_title' => 

[MediaWiki-commits] [Gerrit] Use the specified page ID for LinksDeletionUpdate - change (mediawiki/core)

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

Change subject: Use the specified page ID for LinksDeletionUpdate
..


Use the specified page ID for LinksDeletionUpdate

This makes LinksDeleteJob use the correct page ID when a new
page was later created at the title. The links and protection
rows to clear should always be for the ID of the actual page
being deleted.

This fixes a bug when pages are moved over redirects.

Bug: T128624
Change-Id: Id67a021539b97020e8dd32d56dba1b77c806f31c
---
M includes/deferred/LinksDeletionUpdate.php
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/includes/deferred/LinksDeletionUpdate.php 
b/includes/deferred/LinksDeletionUpdate.php
index b8bd747..c227ecd 100644
--- a/includes/deferred/LinksDeletionUpdate.php
+++ b/includes/deferred/LinksDeletionUpdate.php
@@ -37,10 +37,10 @@
parent::__construct( false ); // no implicit transaction
 
$this->page = $page;
-   if ( $page->exists() ) {
+   if ( $pageId ) {
+   $this->pageId = $pageId; // page ID at time of deletion
+   } elseif ( $page->exists() ) {
$this->pageId = $page->getId();
-   } elseif ( $pageId ) {
-   $this->pageId = $pageId;
} else {
throw new InvalidArgumentException( "Page ID not known. 
Page doesn't exist?" );
}

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

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

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


[MediaWiki-commits] [Gerrit] Improve client-side edit stash change detection - change (mediawiki/core)

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

Change subject: Improve client-side edit stash change detection
..


Improve client-side edit stash change detection

The keypress event does not fire for backspace or delete in IE, Chrome, or
Safari, which means we are missing out on stash opportunities when the last
action is to delete some text. Fix that by listening for the keyup event
instead.

Also add an isChanged() check before calling pending.abort(), because there are
a lot of special keys that don't modify the text, and not all of them are coded
consistently on different platforms (think volume up/down, mute, function keys,
etc.), so we can't be exhaustive, and should instead fall back to actually
checking for changes. Otherwise we risk aborting stash requests when the user
has not changed the text.

Lastly, rename 'onTextChanged' to 'onEditorIdle', which is more accurate.
On undo / rollback, onTextChanged will return true the first time it is called,
even though the text had not changed in that case.

Useful sources:

* Key codes of keydown and keyup events:
  http://www.javascripter.net/faq/keycodes.htm
* Quirksmode: detecting keystrokes
  http://www.quirksmode.org/js/keys.html
* Why isn't backspace being detected using jquery keypress event?
  http://stackoverflow.com/q/4418562

Change-Id: Idfad8407c8e905d8de80bc54379545f1b586fc88
---
M resources/src/mediawiki.action/mediawiki.action.edit.stash.js
1 file changed, 9 insertions(+), 12 deletions(-)

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



diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.stash.js 
b/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
index 71ed44c..297f814 100644
--- a/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
+++ b/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
@@ -46,7 +46,7 @@
return newText !== data.wpTextbox1;
}
 
-   function onTextChanged() {
+   function onEditorIdle() {
if ( !isChanged() ) {
return;
}
@@ -54,20 +54,17 @@
stashEdit();
}
 
-   function onTextKeyPress( e ) {
+   function onTextKeyUp( e ) {
// Ignore keystrokes that don't modify text, like 
cursor movements.
-   // See .
-   if ( e.which === 0 ) {
+   // See  
and
+   // . We don't 
have to be
+   // exhaustive, because the cost of misfiring is low.
+   if ( ( e.which >= 33 && e.which <= 40 ) || ( e.which >= 
16 && e.which <= 18 ) ) {
return;
}
 
clearTimeout( timer );
-
-   if ( pending ) {
-   pending.abort();
-   }
-
-   timer = setTimeout( onTextChanged, idleTimeout );
+   timer = setTimeout( onEditorIdle, idleTimeout );
}
 
function onFormLoaded() {
@@ -90,8 +87,8 @@
return;
}
 
-   $text.on( { change: onTextChanged, keypress: onTextKeyPress } );
-   $summary.on( { focus: onTextChanged } );
+   $text.on( { change: onEditorIdle, keyup: onTextKeyUp } );
+   $summary.on( { focus: onEditorIdle } );
onFormLoaded();
 
} );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idfad8407c8e905d8de80bc54379545f1b586fc88
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Edokter 
Gerrit-Reviewer: Jack Phoenix 
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] Use the specified page ID for LinksDeletionUpdate - change (mediawiki/core)

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

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

Change subject: Use the specified page ID for LinksDeletionUpdate
..

Use the specified page ID for LinksDeletionUpdate

This makes LinksDeleteJob use the correct page ID when a new
page was later created at the title. The links and protection
rows to clear should always be for the ID of the actual page
being deleted.

This fixes a bug when pages are moved over redirects.

Bug: T128624
Change-Id: Id67a021539b97020e8dd32d56dba1b77c806f31c
---
M includes/deferred/LinksDeletionUpdate.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/includes/deferred/LinksDeletionUpdate.php 
b/includes/deferred/LinksDeletionUpdate.php
index b8bd747..c227ecd 100644
--- a/includes/deferred/LinksDeletionUpdate.php
+++ b/includes/deferred/LinksDeletionUpdate.php
@@ -37,10 +37,10 @@
parent::__construct( false ); // no implicit transaction
 
$this->page = $page;
-   if ( $page->exists() ) {
+   if ( $pageId ) {
+   $this->pageId = $pageId; // page ID at time of deletion
+   } elseif ( $page->exists() ) {
$this->pageId = $page->getId();
-   } elseif ( $pageId ) {
-   $this->pageId = $pageId;
} else {
throw new InvalidArgumentException( "Page ID not known. 
Page doesn't exist?" );
}

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

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

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


[MediaWiki-commits] [Gerrit] setting/updating phab2001 dns entries - change (operations/dns)

2016-06-14 Thread RobH (Code Review)
RobH has submitted this change and it was merged.

Change subject: setting/updating phab2001 dns entries
..


setting/updating phab2001 dns entries

updating the mgmt entry to add in hostname, adding production dns entry

T137838

Change-Id: Id5c328a4fa848867f361d566ffc0a7563b5bcc58
---
M templates/10.in-addr.arpa
M templates/wmnet
2 files changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/templates/10.in-addr.arpa b/templates/10.in-addr.arpa
index 2e77ae0..d5f608b 100644
--- a/templates/10.in-addr.arpa
+++ b/templates/10.in-addr.arpa
@@ -3123,6 +3123,7 @@
 144 1H IN PTR   restbase2008-b.codfw.wmnet.
 145 1H IN PTR   restbase2008-c.codfw.wmnet.
 146 1H IN PTR   maps2003.codfw.wmnet.
+147 1H IN PTR   phab2001.codfw.wmnet.
 
 $ORIGIN 33.192.{{ zonename }}.
 1   1H IN PTR   vl2019-eth2.lvs2001.codfw.wmnet.
@@ -4148,6 +4149,7 @@
 250 1H IN PTR  wmf6404.mgmt.codfw.wmnet.
 251 1H IN PTR  graphite2002.mgmt.codfw.wmnet.
 251 1H IN PTR  wmf6403.mgmt.codfw.wmnet.
+252 1H IN PTR  phab2001.mgmt.codfw.wmnet.
 252 1H IN PTR  wmf6405.mgmt.codfw.wmnet.
 253 1H IN PTR  wmf6406.mgmt.codfw.wmnet.
 254 1H IN PTR  wmf6407.mgmt.codfw.wmnet.
diff --git a/templates/wmnet b/templates/wmnet
index e800473..af60f16 100644
--- a/templates/wmnet
+++ b/templates/wmnet
@@ -2760,6 +2760,7 @@
 pc2004  1H  IN A10.192.16.170
 pc2005  1H  IN A10.192.32.128
 pc2006  1H  IN A10.192.48.39
+phab20011H  IN A10.192.32.147
 pybal-test2001  1H  IN A10.192.16.139 ; VM on the ganeti01.svc.codfw.wmnet 
cluster
 pybal-test2002  1H  IN A10.192.16.140 ; VM on the ganeti01.svc.codfw.wmnet 
cluster
 pybal-test2003  1H  IN A10.192.16.141 ; VM on the ganeti01.svc.codfw.wmnet 
cluster
@@ -3418,6 +3419,7 @@
 pc2004  1H  IN A10.193.2.231
 pc2005  1H  IN A10.193.2.232
 pc2006  1H  IN A10.193.2.233
+phab20011H  IN A10.193.2.252
 procyon 1H  IN A10.193.2.117
 rdb2001 1H  IN A10.193.2.159
 rdb2002 1H  IN A10.193.2.160

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id5c328a4fa848867f361d566ffc0a7563b5bcc58
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: RobH 
Gerrit-Reviewer: RobH 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Use the specified page ID for LinksDeletionUpdate - change (mediawiki/core)

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

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

Change subject: Use the specified page ID for LinksDeletionUpdate
..

Use the specified page ID for LinksDeletionUpdate

This makes LinksDeleteJob use the correct page ID when a new
page was later created at the title. The links and protection
rows to clear should always be for the ID of the actual page
being deleted.

This fixes a bug when pages are moved over redirects.

Bug: T128624
Change-Id: Id67a021539b97020e8dd32d56dba1b77c806f31c
---
M includes/deferred/LinksDeletionUpdate.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/includes/deferred/LinksDeletionUpdate.php 
b/includes/deferred/LinksDeletionUpdate.php
index b8bd747..c227ecd 100644
--- a/includes/deferred/LinksDeletionUpdate.php
+++ b/includes/deferred/LinksDeletionUpdate.php
@@ -37,10 +37,10 @@
parent::__construct( false ); // no implicit transaction
 
$this->page = $page;
-   if ( $page->exists() ) {
+   if ( $pageId ) {
+   $this->pageId = $pageId; // page ID at time of deletion
+   } elseif ( $page->exists() ) {
$this->pageId = $page->getId();
-   } elseif ( $pageId ) {
-   $this->pageId = $pageId;
} else {
throw new InvalidArgumentException( "Page ID not known. 
Page doesn't exist?" );
}

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

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

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


[MediaWiki-commits] [Gerrit] Use the specified page ID for LinksDeletionUpdate - change (mediawiki/core)

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

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

Change subject: Use the specified page ID for LinksDeletionUpdate
..

Use the specified page ID for LinksDeletionUpdate

This makes LinksDeleteJob use the correct page ID when a new
page was later created at the title. The links and protection
rows to clear should always be for the ID of the actual page
being deleted.

This fixes a bug when pages are moved over redirects.

Bug: T128624
Change-Id: Id67a021539b97020e8dd32d56dba1b77c806f31c
---
M includes/deferred/LinksDeletionUpdate.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/includes/deferred/LinksDeletionUpdate.php 
b/includes/deferred/LinksDeletionUpdate.php
index b8bd747..c227ecd 100644
--- a/includes/deferred/LinksDeletionUpdate.php
+++ b/includes/deferred/LinksDeletionUpdate.php
@@ -37,10 +37,10 @@
parent::__construct( false ); // no implicit transaction
 
$this->page = $page;
-   if ( $page->exists() ) {
+   if ( $pageId ) {
+   $this->pageId = $pageId; // page ID at time of deletion
+   } elseif ( $page->exists() ) {
$this->pageId = $page->getId();
-   } elseif ( $pageId ) {
-   $this->pageId = $pageId;
} else {
throw new InvalidArgumentException( "Page ID not known. 
Page doesn't exist?" );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id67a021539b97020e8dd32d56dba1b77c806f31c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Brian Wolff 
Gerrit-Reviewer: Dpatrick 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] setting/updating phab2001 dns entries - change (operations/dns)

2016-06-14 Thread RobH (Code Review)
RobH has uploaded a new change for review.

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

Change subject: setting/updating phab2001 dns entries
..

setting/updating phab2001 dns entries

updating the mgmt entry to add in hostname, adding production dns entry

T137838

Change-Id: Id5c328a4fa848867f361d566ffc0a7563b5bcc58
---
M templates/10.in-addr.arpa
M templates/wmnet
2 files changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/86/294386/1

diff --git a/templates/10.in-addr.arpa b/templates/10.in-addr.arpa
index 2e77ae0..d5f608b 100644
--- a/templates/10.in-addr.arpa
+++ b/templates/10.in-addr.arpa
@@ -3123,6 +3123,7 @@
 144 1H IN PTR   restbase2008-b.codfw.wmnet.
 145 1H IN PTR   restbase2008-c.codfw.wmnet.
 146 1H IN PTR   maps2003.codfw.wmnet.
+147 1H IN PTR   phab2001.codfw.wmnet.
 
 $ORIGIN 33.192.{{ zonename }}.
 1   1H IN PTR   vl2019-eth2.lvs2001.codfw.wmnet.
@@ -4148,6 +4149,7 @@
 250 1H IN PTR  wmf6404.mgmt.codfw.wmnet.
 251 1H IN PTR  graphite2002.mgmt.codfw.wmnet.
 251 1H IN PTR  wmf6403.mgmt.codfw.wmnet.
+252 1H IN PTR  phab2001.mgmt.codfw.wmnet.
 252 1H IN PTR  wmf6405.mgmt.codfw.wmnet.
 253 1H IN PTR  wmf6406.mgmt.codfw.wmnet.
 254 1H IN PTR  wmf6407.mgmt.codfw.wmnet.
diff --git a/templates/wmnet b/templates/wmnet
index e800473..af60f16 100644
--- a/templates/wmnet
+++ b/templates/wmnet
@@ -2760,6 +2760,7 @@
 pc2004  1H  IN A10.192.16.170
 pc2005  1H  IN A10.192.32.128
 pc2006  1H  IN A10.192.48.39
+phab20011H  IN A10.192.32.147
 pybal-test2001  1H  IN A10.192.16.139 ; VM on the ganeti01.svc.codfw.wmnet 
cluster
 pybal-test2002  1H  IN A10.192.16.140 ; VM on the ganeti01.svc.codfw.wmnet 
cluster
 pybal-test2003  1H  IN A10.192.16.141 ; VM on the ganeti01.svc.codfw.wmnet 
cluster
@@ -3418,6 +3419,7 @@
 pc2004  1H  IN A10.193.2.231
 pc2005  1H  IN A10.193.2.232
 pc2006  1H  IN A10.193.2.233
+phab20011H  IN A10.193.2.252
 procyon 1H  IN A10.193.2.117
 rdb2001 1H  IN A10.193.2.159
 rdb2002 1H  IN A10.193.2.160

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5c328a4fa848867f361d566ffc0a7563b5bcc58
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: RobH 

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


[MediaWiki-commits] [Gerrit] phab2001 install module updates - change (operations/puppet)

2016-06-14 Thread RobH (Code Review)
RobH has uploaded a new change for review.

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

Change subject: phab2001 install module updates
..

phab2001 install module updates

setting dhcp lease info and netboot partitioning info

T137838

Change-Id: I441d08085e4baee5a106bb2f7815ac64d08ef04f
---
M modules/install_server/files/autoinstall/netboot.cfg
M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
2 files changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/85/294385/1

diff --git a/modules/install_server/files/autoinstall/netboot.cfg 
b/modules/install_server/files/autoinstall/netboot.cfg
index 7a0d9c8..638f2db 100755
--- a/modules/install_server/files/autoinstall/netboot.cfg
+++ b/modules/install_server/files/autoinstall/netboot.cfg
@@ -83,7 +83,7 @@
 graphite200[12]) echo partman/graphite.cfg ;; \
 hydrogen) echo partman/raid1-1partition.cfg ;; \
 kafka1013|kafka1014|kafka1020) echo partman/raid1-30G.cfg ;; \
-kafka100[1-2]|kafka200[1-2]|stat1004) echo 
partman/raid10-gpt-srv-ext4.cfg ;; \
+phab2001|kafka100[1-2]|kafka200[1-2]|stat1004) echo 
partman/raid10-gpt-srv-ext4.cfg ;; \
 
auth[1-2]001|einsteinium|labcontrol100[1-2]|labnodepool1001|lead|mira|neodymium|oresrdb100[1-2]|rdb200[1-6])
 echo partman/raid1-lvm-ext4-srv.cfg ;; \
 labmon1001) echo partman/raid10-gpt-srv-lvm-ext4.cfg ;; \
 labnet100[1-2]) echo partman/lvm.cfg ;; \
diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 
b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
index 15220e6..ea3707c 100644
--- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
+++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
@@ -6137,6 +6137,11 @@
 fixed-address pc2006.codfw.wmnet;
 }
 
+host phab2001 {
+hardware ethernet 14:18:77:5B:0C:FA;
+fixed-address phab2001.codfw.wmnet;
+}
+
 host potassium {
 hardware ethernet 78:2b:cb:08:ac:78;
 fixed-address potassium.eqiad.wmnet;

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

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

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


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 08437d3..c3f38c8 - change (mediawiki/extensions)

2016-06-14 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has submitted this change and it was merged.

Change subject: Syncronize VisualEditor: 08437d3..c3f38c8
..


Syncronize VisualEditor: 08437d3..c3f38c8

Change-Id: I813f328d907a4fe8e3ca5ed0ef6f0218f7d80072
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Jenkins-mwext-sync: Verified; Looks good to me, approved



diff --git a/VisualEditor b/VisualEditor
index 08437d3..c3f38c8 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit 08437d364c89cffccbd22fcb8397e737fcd3ffd5
+Subproject commit c3f38c8758f308f569d75bae747d14b502b2f432

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I813f328d907a4fe8e3ca5ed0ef6f0218f7d80072
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 
Gerrit-Reviewer: Jenkins-mwext-sync 

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


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 08437d3..c3f38c8 - change (mediawiki/extensions)

2016-06-14 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has uploaded a new change for review.

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

Change subject: Syncronize VisualEditor: 08437d3..c3f38c8
..

Syncronize VisualEditor: 08437d3..c3f38c8

Change-Id: I813f328d907a4fe8e3ca5ed0ef6f0218f7d80072
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions 
refs/changes/84/294384/1

diff --git a/VisualEditor b/VisualEditor
index 08437d3..c3f38c8 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit 08437d364c89cffccbd22fcb8397e737fcd3ffd5
+Subproject commit c3f38c8758f308f569d75bae747d14b502b2f432

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I813f328d907a4fe8e3ca5ed0ef6f0218f7d80072
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 

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


[MediaWiki-commits] [Gerrit] Decode encoded link titles when generating them from text - change (mediawiki...VisualEditor)

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

Change subject: Decode encoded link titles when generating them from text
..


Decode encoded link titles when generating them from text

Percent-encoded characters are forbidden in titles. Copying URLs around will
tend to wind up when them percent-encoded when you paste. Therefore, when
trying to build a title from a pasted link, decode it first.

Change-Id: Ia0abcb2d903b04d99c7db16eb0a5962480b138d5
---
M modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js
1 file changed, 9 insertions(+), 1 deletion(-)

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



diff --git a/modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js 
b/modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js
index fafa709..0be6180 100644
--- a/modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js
+++ b/modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js
@@ -117,7 +117,15 @@
// in which case it's preceded by one or more instances of "./" or 
"../", so strip those
matches = href.match( /^((?:\.\.?\/)*)(.*)$/ );
 
-   return { title: matches[ 2 ], hrefPrefix: matches[ 1 ], isInternal: 
isInternal };
+   // Percent-encoded characters are forbidden in titles... but if we're
+   // copy/pasting URLs around, they're likely to wind up encoded at this
+   // point. So decode them, otherwise this is going to cause failures
+   // elsewhere.
+   return {
+   title: ve.safeDecodeURIComponent( matches[ 2 ] ),
+   hrefPrefix: matches[ 1 ],
+   isInternal: isInternal
+   };
 };
 
 ve.dm.MWInternalLinkAnnotation.static.toDomElements = function () {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia0abcb2d903b04d99c7db16eb0a5962480b138d5
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: DLynch 
Gerrit-Reviewer: DLynch 
Gerrit-Reviewer: Divec 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: Jforrester 
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] Perform edit stashing when the edit preview or diff form is ... - change (mediawiki/core)

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

Change subject: Perform edit stashing when the edit preview or diff form is 
requested
..


Perform edit stashing when the edit preview or diff form is requested

* Users are likely to save after they inspect and review their changes.
  The buttons to do so are also located below the edit summary box.
* This obsoletes the backend stashing on preview. Most of those parses
  would have been useless due to being per-section only. Also, some
  extensions like the Graph extension disable stashing for "preview"
  output anyway. Simplify the code by removing that method.

Bug: T136678
Change-Id: Ied77bdbd191dd9267d4295b0fa7b942f65b062db
(cherry picked from commit 406d6a2b46fb4afcfae0840b7c6b5a346f3272c2)
---
M includes/EditPage.php
M includes/api/ApiStashEdit.php
M resources/src/mediawiki.action/mediawiki.action.edit.stash.js
3 files changed, 21 insertions(+), 84 deletions(-)

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



diff --git a/includes/EditPage.php b/includes/EditPage.php
index f2403fe..66ee161 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -2690,6 +2690,18 @@
}
}
 
+   // Set a hidden field so JS knows what edit form mode we are in
+   if ( $this->isConflict ) {
+   $mode = 'conflict';
+   } elseif ( $this->preview ) {
+   $mode = 'preview';
+   } elseif ( $this->diff ) {
+   $mode = 'diff';
+   } else {
+   $mode = 'text';
+   }
+   $wgOut->addHTML( Html::hidden( 'mode', $mode, [ 'id' => 
'mw-edit-mode' ] ) );
+
// Marker for detecting truncated form data.  This must be the 
last
// parameter sent in order to be of use, so do not move me.
$wgOut->addHTML( Html::hidden( 'wpUltimateParam', true ) );
@@ -3603,7 +3615,7 @@
 */
function getPreviewText() {
global $wgOut, $wgUser, $wgRawHtml, $wgLang;
-   global $wgAllowUserCss, $wgAllowUserJs, $wgAjaxEditStash;
+   global $wgAllowUserCss, $wgAllowUserJs;
 
$stats = $wgOut->getContext()->getStats();
 
@@ -3712,15 +3724,6 @@
$scopedCallback = $parserOptions->setupFakeRevision(
$this->mTitle, $pstContent, $wgUser );
$parserOutput = $pstContent->getParserOutput( 
$this->mTitle, null, $parserOptions );
-
-   # Try to stash the edit for the final submission step
-   # @todo: different date format preferences cause cache 
misses
-   if ( $wgAjaxEditStash ) {
-   ApiStashEdit::stashEditFromPreview(
-   $this->getArticle(), $content, 
$pstContent,
-   $parserOutput, $parserOptions, 
$parserOptions, wfTimestampNow()
-   );
-   }
 
$parserOutput->setEditSectionTokens( false ); // no 
section edit links
$previewHTML = $parserOutput->getText();
diff --git a/includes/api/ApiStashEdit.php b/includes/api/ApiStashEdit.php
index 08fd2fd..67939a0 100644
--- a/includes/api/ApiStashEdit.php
+++ b/includes/api/ApiStashEdit.php
@@ -182,77 +182,6 @@
}
 
/**
-* Attempt to cache PST content and corresponding parser output in 
passing
-*
-* This method can be called when the output was already generated for 
other
-* reasons. Parsing should not be done just to call this method, 
however.
-* $pstOpts must be that of the user doing the edit preview. If $pOpts 
does
-* not match the options of WikiPage::makeParserOptions( 'canonical' ), 
this
-* will do nothing. Provided the values are cacheable, they will be 
stored
-* in memcached so that final edit submission might make use of them.
-*
-* @param Page|Article|WikiPage $page Page title
-* @param Content $content Proposed page content
-* @param Content $pstContent The result of preSaveTransform() on 
$content
-* @param ParserOutput $pOut The result of getParserOutput() on 
$pstContent
-* @param ParserOptions $pstOpts Options for $pstContent (MUST be for 
prospective author)
-* @param ParserOptions $pOpts Options for $pOut
-* @param string $timestamp TS_MW timestamp of parser output generation
-* @return bool Success
-*/
-   public static function stashEditFromPreview(
-   Page $page, Content $content, Content $pstContent, ParserOutput 
$pOut,
-   ParserOptions $pstOpts, ParserOptions $pOpts, $timestamp
-   ) {
-   

[MediaWiki-commits] [Gerrit] [WIP] Introduce save query example - change (wikidata...gui)

2016-06-14 Thread Jonas Kress (WMDE) (Code Review)
Jonas Kress (WMDE) has uploaded a new change for review.

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

Change subject: [WIP] Introduce save query example
..

[WIP] Introduce save query example

Allows to save current query to the query example page.
Automatically generates tags and section.

Change-Id: Id92dc592c6b03c4e1acc33c7b4a3b7f02a96f2bc
---
M i18n/en.json
M i18n/qqq.json
M index.html
M style.css
M wikibase/queryService/api/QuerySamples.js
M wikibase/queryService/api/Wikibase.js
M wikibase/queryService/ui/App.js
7 files changed, 120 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui 
refs/changes/83/294383/1

diff --git a/i18n/en.json b/i18n/en.json
index 0d0ebc6..f7b49f2 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -15,6 +15,7 @@
 "wdqs-app-button-display": "Display",
 "wdqs-app-button-download": "Download",
 "wdqs-app-button-link": "Link",
+"wdqs-app-saveQuery-prompt": "Are you sure you want to save this query as 
an example?\nThe query will then be visible to all users!\nAlso your IP or 
username will be published!\n\nPlease provide a title:",
 "wdqs-ve-find": "Find",
 "wdqs-ve-show": "Show",
 "wdqs-ve-with": "with",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 725c7b1..addff01 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -16,6 +16,7 @@
"wdqs-app-button-display": "Button display result as table, image, 
...\n{{Identical|Display}}",
"wdqs-app-button-download": "Button download 
result\n{{Identical|Download}}",
"wdqs-app-button-link": "Button get link to query\n{{Identical|Link}}",
+"wdqs-app-saveQuery-prompt": "Message of prompt that is shown before 
saving a query",
"wdqs-ve-find": "Label to find some item\n{{Identical|Find}}",
"wdqs-ve-show": "Label to show some item\n{{Identical|Show}}",
"wdqs-ve-with": "Label item with property\n{{Identical|With}}",
diff --git a/index.html b/index.html
index 1948c8e..4ea3950 100644
--- a/index.html
+++ b/index.html
@@ -152,6 +152,7 @@


 

+



diff --git a/style.css b/style.css
index c153be1..6932897 100644
--- a/style.css
+++ b/style.css
@@ -104,6 +104,15 @@
background: rgba(255,255,255,0.5);
 }
 
+.saveQuery {
+   z-index: 100;
+   position: absolute;
+   top: 50px;
+   right: 10px;
+   font-size: 25px;
+   background: rgba(255,255,255,0.5);
+}
+
 .actionMessage .progress {
 height: 30px;
 font-size: 30px;
diff --git a/wikibase/queryService/api/QuerySamples.js 
b/wikibase/queryService/api/QuerySamples.js
index 042fe5b..88ec992 100644
--- a/wikibase/queryService/api/QuerySamples.js
+++ b/wikibase/queryService/api/QuerySamples.js
@@ -5,6 +5,10 @@
 wikibase.queryService.api.QuerySamples = ( function ( $ ) {
'use strict';
 
+// var API_ENDPOINT = 'https://www.mediawiki.org/w/api.php';
+   var API_ENDPOINT = 'http://localhost/mediawiki/api.php';
+   var PAGE_TITLE = 'Wikibase/Indexing/SPARQL_Query_Examples';
+
/**
 * QuerySamples API for the Wikibase query service
 *
@@ -28,8 +32,7 @@
 
$.ajax(
{
-   url: 
'https://www.mediawiki.org/w/api.php?action=query=revisions=Wikibase/'
 +
-   
'Indexing/SPARQL_Query_Examples=content',
+   url: API_ENDPOINT + 
'?action=query=revisions=' + encodeURIComponent( PAGE_TITLE ) + 
'=content',
data: {
format: 'json'
},
@@ -80,6 +83,61 @@
return deferred;
};
 
+   /**
+* Save an example query
+*
+* @param {string} title
+* @param {string} sparql query
+* @param {object.} tags 
+*/
+   SELF.prototype.saveExample = function ( title, sparql, tags ) {
+
+   var entites = 'Entities used:';
+
+   if ( tags ) {
+   $.each( tags, function( id, label ) {
+   entites += ' {{Q|' + id + '|' + label + '}}';
+   } );
+   }
+
+   var template = '{{SPARQL|query=\n' + sparql + '\n}}';
+
+   $.ajax( {
+   url: API_ENDPOINT,
+   data: {
+   action: 'query',
+   meta: 'tokens',
+   format: 'json',
+   origin: window.location.origin
+   },
+   xhrFields: {
+

[MediaWiki-commits] [Gerrit] Perform edit stashing when the edit preview or diff form is ... - change (mediawiki/core)

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

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

Change subject: Perform edit stashing when the edit preview or diff form is 
requested
..

Perform edit stashing when the edit preview or diff form is requested

* Users are likely to save after they inspect and review their changes.
  The buttons to do so are also located below the edit summary box.
* This obsoletes the backend stashing on preview. Most of those parses
  would have been useless due to being per-section only. Also, some
  extensions like the Graph extension disable stashing for "preview"
  output anyway. Simplify the code by removing that method.

Bug: T136678
Change-Id: Ied77bdbd191dd9267d4295b0fa7b942f65b062db
(cherry picked from commit 406d6a2b46fb4afcfae0840b7c6b5a346f3272c2)
---
M includes/EditPage.php
M includes/api/ApiStashEdit.php
M resources/src/mediawiki.action/mediawiki.action.edit.stash.js
3 files changed, 21 insertions(+), 84 deletions(-)


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

diff --git a/includes/EditPage.php b/includes/EditPage.php
index f2403fe..66ee161 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -2690,6 +2690,18 @@
}
}
 
+   // Set a hidden field so JS knows what edit form mode we are in
+   if ( $this->isConflict ) {
+   $mode = 'conflict';
+   } elseif ( $this->preview ) {
+   $mode = 'preview';
+   } elseif ( $this->diff ) {
+   $mode = 'diff';
+   } else {
+   $mode = 'text';
+   }
+   $wgOut->addHTML( Html::hidden( 'mode', $mode, [ 'id' => 
'mw-edit-mode' ] ) );
+
// Marker for detecting truncated form data.  This must be the 
last
// parameter sent in order to be of use, so do not move me.
$wgOut->addHTML( Html::hidden( 'wpUltimateParam', true ) );
@@ -3603,7 +3615,7 @@
 */
function getPreviewText() {
global $wgOut, $wgUser, $wgRawHtml, $wgLang;
-   global $wgAllowUserCss, $wgAllowUserJs, $wgAjaxEditStash;
+   global $wgAllowUserCss, $wgAllowUserJs;
 
$stats = $wgOut->getContext()->getStats();
 
@@ -3712,15 +3724,6 @@
$scopedCallback = $parserOptions->setupFakeRevision(
$this->mTitle, $pstContent, $wgUser );
$parserOutput = $pstContent->getParserOutput( 
$this->mTitle, null, $parserOptions );
-
-   # Try to stash the edit for the final submission step
-   # @todo: different date format preferences cause cache 
misses
-   if ( $wgAjaxEditStash ) {
-   ApiStashEdit::stashEditFromPreview(
-   $this->getArticle(), $content, 
$pstContent,
-   $parserOutput, $parserOptions, 
$parserOptions, wfTimestampNow()
-   );
-   }
 
$parserOutput->setEditSectionTokens( false ); // no 
section edit links
$previewHTML = $parserOutput->getText();
diff --git a/includes/api/ApiStashEdit.php b/includes/api/ApiStashEdit.php
index 08fd2fd..67939a0 100644
--- a/includes/api/ApiStashEdit.php
+++ b/includes/api/ApiStashEdit.php
@@ -182,77 +182,6 @@
}
 
/**
-* Attempt to cache PST content and corresponding parser output in 
passing
-*
-* This method can be called when the output was already generated for 
other
-* reasons. Parsing should not be done just to call this method, 
however.
-* $pstOpts must be that of the user doing the edit preview. If $pOpts 
does
-* not match the options of WikiPage::makeParserOptions( 'canonical' ), 
this
-* will do nothing. Provided the values are cacheable, they will be 
stored
-* in memcached so that final edit submission might make use of them.
-*
-* @param Page|Article|WikiPage $page Page title
-* @param Content $content Proposed page content
-* @param Content $pstContent The result of preSaveTransform() on 
$content
-* @param ParserOutput $pOut The result of getParserOutput() on 
$pstContent
-* @param ParserOptions $pstOpts Options for $pstContent (MUST be for 
prospective author)
-* @param ParserOptions $pOpts Options for $pOut
-* @param string $timestamp TS_MW timestamp of parser output generation
-* @return bool Success
-*/
-   public static function stashEditFromPreview(
-   Page $page, Content $content, Content $pstContent, ParserOutput 
$pOut,
-   ParserOptions $pstOpts, ParserOptions 

[MediaWiki-commits] [Gerrit] Move fatal PHP functions checks to initialization - change (mediawiki/core)

2016-06-14 Thread Chad (Code Review)
Chad has submitted this change and it was merged.

Change subject: Move fatal PHP functions checks to initialization
..


Move fatal PHP functions checks to initialization

The installer is far too late of a place to be checking if
a function does or doesn't exist if we require it for operation.
Functions can very easily (T137509) be called prior to ever
getting to the installer check page.

Also, an old installation could've gotten past the checks if
they ran update.php --skip-compat-checks. What a scary setting!

Instead, fail hard, fast and early along with PHP version checks.
All entry points are required to go through this.

While we're here, also remove the check for mbstring.func_overload
since we already would've failed at WebStart.php

Change-Id: Ib9727979af2a4741f3cd952d13a3bb350fad43e4
(cherry picked from commit 41d1fa1c3aa9d6e9e0e5f0c5455b9092833e9012)
---
M includes/PHPVersionCheck.php
M includes/Setup.php
M includes/installer/Installer.php
M includes/installer/i18n/en.json
M includes/installer/i18n/qqq.json
5 files changed, 60 insertions(+), 97 deletions(-)

Approvals:
  Chad: Verified
  Legoktm: Looks good to me, approved
  MaxSem: Looks good to me, approved



diff --git a/includes/PHPVersionCheck.php b/includes/PHPVersionCheck.php
index 1eafcfa..33fa95d 100644
--- a/includes/PHPVersionCheck.php
+++ b/includes/PHPVersionCheck.php
@@ -45,6 +45,29 @@
// @codingStandardsIgnoreEnd
wfMissingVendorError( $entryPoint, $mwVersion );
}
+
+   // List of functions and their associated PHP extension to check for
+   // @codingStandardsIgnoreStart Generic.Arrays.DisallowLongArraySyntax
+   $extensions = array(
+   'mb_substr'   => 'mbstring',
+   'utf8_encode' => 'xml',
+   'ctype_digit' => 'ctype',
+   'json_decode' => 'json',
+   'iconv'   => 'iconv',
+   );
+   // List of extensions we're missing
+   $missingExtensions = array();
+   // @codingStandardsIgnoreEnd
+
+   foreach ( $extensions as $function => $extension ) {
+   if ( !function_exists( $function ) ) {
+   $missingExtensions[] = $extension;
+   }
+   }
+
+   if ( $missingExtensions ) {
+   wfMissingExtensions( $entryPoint, $mwVersion, 
$missingExtensions );
+   }
 }
 
 /**
@@ -107,7 +130,7 @@
padding: 2em;
text-align: center;
}
-   p, img, h1, h2 {
+   p, img, h1, h2, ul  {
text-align: left;
margin: 0.5em 0 1em;
}
@@ -201,3 +224,38 @@
 
wfGenericError( $type, $mwVersion, 'External dependencies', $shortText, 
$longText, $longHtml );
 }
+
+/**
+ * Display an error for a PHP extension not existing.
+ *
+ * @param string $type See wfGenericError
+ * @param string $mwVersion See wfGenericError
+ * @param array $missingExts The extensions we're missing
+ */
+function wfMissingExtensions( $type, $mwVersion, $missingExts ) {
+   $shortText = "Installing some PHP extensions is required.";
+
+   $missingExtText = '';
+   $missingExtHtml = '';
+   $baseUrl = 'https://secure.php.net';
+   foreach ( $missingExts as $ext ) {
+   $missingExtText .= " * $ext <$baseUrl/$ext>\n";
+   $missingExtHtml .= "$ext "
+   . "(more 
information)";
+   }
+
+   $cliText = "Error: Missing one or more required components of PHP.\n"
+   . "You are missing a required extension to PHP that MediaWiki 
needs.\n"
+   . "Please install:\n" . $missingExtText;
+
+   $longHtml = <<
+   $missingExtHtml
+   
+HTML;
+
+   wfGenericError( $type, $mwVersion, 'Required components', $shortText,
+   $cliText, $longHtml );
+}
diff --git a/includes/Setup.php b/includes/Setup.php
index 7375987..3cb72f5 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -44,12 +44,7 @@
die( 1 );
 }
 
-if ( function_exists( 'mb_internal_encoding' ) ) {
-   mb_internal_encoding( 'UTF-8' );
-} elseif ( !defined( 'MEDIAWIKI_INSTALL' ) ) {
-   echo "Error: the mbstring PHP extension is required\n";
-   die( 1 );
-}
+mb_internal_encoding( 'UTF-8' );
 
 // Set various default paths sensibly...
 $ps_default = Profiler::instance()->scopedProfileIn( $fname . '-defaults' );
diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php
index 4c8e7e9..84a665d 100644
--- a/includes/installer/Installer.php
+++ b/includes/installer/Installer.php
@@ -120,8 +120,6 @@
protected $envChecks = [
'envCheckDB',
'envCheckBrokenXML',
-   'envCheckMbstring',
-   'envCheckXML',

[MediaWiki-commits] [Gerrit] Add search-ignored-headings string, copied from cirrus-searc... - change (mediawiki/core)

2016-06-14 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review.

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

Change subject: Add search-ignored-headings string, copied from 
cirrus-search-ignored-headings.
..

Add search-ignored-headings string, copied from cirrus-search-ignored-headings.

Change-Id: I4178f872996800379843301f7119840f4a4551df
---
M includes/content/WikiTextStructure.php
M languages/i18n/ar.json
M languages/i18n/ast.json
M languages/i18n/ba.json
M languages/i18n/bcl.json
M languages/i18n/be-tarask.json
M languages/i18n/bo.json
M languages/i18n/ca.json
M languages/i18n/cs.json
M languages/i18n/da.json
M languages/i18n/de.json
M languages/i18n/dsb.json
M languages/i18n/en-gb.json
M languages/i18n/en.json
M languages/i18n/es.json
M languages/i18n/fa.json
M languages/i18n/fi.json
M languages/i18n/fr.json
M languages/i18n/gl.json
M languages/i18n/he.json
M languages/i18n/hsb.json
M languages/i18n/hu.json
M languages/i18n/ia.json
M languages/i18n/ilo.json
M languages/i18n/it.json
M languages/i18n/ja.json
M languages/i18n/ko.json
M languages/i18n/ksh.json
M languages/i18n/lb.json
M languages/i18n/lki.json
M languages/i18n/lt.json
M languages/i18n/lv.json
M languages/i18n/mk.json
M languages/i18n/ml.json
M languages/i18n/ms.json
M languages/i18n/nap.json
M languages/i18n/nl.json
M languages/i18n/pl.json
M languages/i18n/pms.json
M languages/i18n/pt-br.json
M languages/i18n/pt.json
M languages/i18n/qqq.json
M languages/i18n/ro.json
M languages/i18n/roa-tara.json
M languages/i18n/ru.json
M languages/i18n/sco.json
M languages/i18n/so.json
M languages/i18n/sv.json
M languages/i18n/te.json
M languages/i18n/tr.json
M languages/i18n/uk.json
M languages/i18n/vi.json
M languages/i18n/zh-hans.json
M languages/i18n/zh-hant.json
M tests/phpunit/includes/content/WikitextStructureTest.php
55 files changed, 61 insertions(+), 4 deletions(-)


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

diff --git a/includes/content/WikiTextStructure.php 
b/includes/content/WikiTextStructure.php
index 057f42d..dbf75fe 100644
--- a/includes/content/WikiTextStructure.php
+++ b/includes/content/WikiTextStructure.php
@@ -162,9 +162,12 @@
private function getIgnoredHeadings() {
static $ignoredHeadings = null;
if ( $ignoredHeadings === null ) {
-   // FIXME: will be renamed in next patches to 
search-ignored-headings
-   $source = wfMessage( 'cirrussearch-ignored-headings' 
)->inContentLanguage();
$ignoredHeadings = [];
+   $source = wfMessage( 'search-ignored-headings' 
)->inContentLanguage();
+   if ( $source->isBlank() ) {
+   // Try old version too, just in case
+   $source = wfMessage( 
'cirrussearch-ignored-headings' )->inContentLanguage();
+   }
if ( !$source->isDisabled() ) {
$lines = self::parseSettingsInMessage( 
$source->plain() );
$ignoredHeadings = $lines;   // Now 
we just have headings!
diff --git a/languages/i18n/ar.json b/languages/i18n/ar.json
index 60e998c..9b30bc0 100644
--- a/languages/i18n/ar.json
+++ b/languages/i18n/ar.json
@@ -222,6 +222,7 @@
"tagline": "من {{SITENAME}}",
"help": "مساعدة",
"search": "بحث",
+   "search-ignored-headings": "#  \n# 
سيتم تجاهل الترويسات خلال عملية البحث\n#ا لتغييرات ستأخذ مجراها ما أن يتم فهرسة 
الصفحة التي تحتوي على ترويسات\n# يمكنك فرض عملية فهرسة الصفحة من خلال تعديل 
فارغ\n# الصيغة هي كالأتي:\n# * كل ما يكتب بعد \"#\" إلى آخر السطر يعتبر 
تعليق\n# * كل سطر غير فارغ سيكون العنوان الذي سيتم تجاهله (سيأخذ العنوان كما هو 
بالضبط بالتشكيل وخلافه)\nالمراجع\nالوصلات الخارجية\nأنظر أيضا\n#",
"searchbutton": "ابحث",
"go": "اذهب",
"searcharticle": "اذهب",
diff --git a/languages/i18n/ast.json b/languages/i18n/ast.json
index 6ee3dc7..c0c5ced 100644
--- a/languages/i18n/ast.json
+++ b/languages/i18n/ast.json
@@ -174,6 +174,7 @@
"tagline": "De {{SITENAME}}",
"help": "Ayuda",
"search": "Buscar",
+   "search-ignored-headings": " # \n# Testeres que nun se tendrán en cuenta na gueta.\n# Los cambios 
fechos equí son efeutivos nel momentu que s'indexa la páxina cola testera.\n# 
Pue forzar el reindexáu d'una páxina faciendo una edición nula.\n# La sintaxis 
ye la siguiente:\n#   * Tolo qu'hai dende un caráuter \"#\" al fin de llinia ye 
un comentariu\n#   * Cada llinia nun-balera ye'l títulu exactu a descartar, 
incluyendo mayúscules y demás\nReferencies\nEnllaces esternos\nVer tamién\n 
# ",
"searchbutton": "Guetar",
"go": "Dir",
"searcharticle": "Dir",
diff --git a/languages/i18n/ba.json b/languages/i18n/ba.json
index 19907c7..7aa291c 100644
--- a/languages/i18n/ba.json
+++ 

[MediaWiki-commits] [Gerrit] Add new maps servers to LVS - change (operations/puppet)

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

Change subject: Add new maps servers to LVS
..


Add new maps servers to LVS

New maps servers will be ready to handle user traffic very soon. This change
is about getting ready to send that traffic.

Documentation on how to deploy this change:
https://wikitech.wikimedia.org/wiki/LVS#Deploy_a_change_to_an_existing_service

Bug: T137620
Change-Id: I86bbe007ef91d77aefa800112add4e1e70d72571
---
M conftool-data/nodes/codfw.yaml
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/conftool-data/nodes/codfw.yaml b/conftool-data/nodes/codfw.yaml
index 3365b8e..08d553a 100644
--- a/conftool-data/nodes/codfw.yaml
+++ b/conftool-data/nodes/codfw.yaml
@@ -217,6 +217,10 @@
   acamar.wikimedia.org: [pdns_recursor]
   achernar.wikimedia.org: [pdns_recursor]
 maps:
+  maps2001.codfw.wmnet: [kartotherian]
+  maps2002.codfw.wmnet: [kartotherian]
+  maps2003.codfw.wmnet: [kartotherian]
+  maps2004.codfw.wmnet: [kartotherian]
   maps-test2001.codfw.wmnet: [kartotherian]
   maps-test2002.codfw.wmnet: [kartotherian]
   maps-test2003.codfw.wmnet: [kartotherian]

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

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

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


[MediaWiki-commits] [Gerrit] Allow FeedClients to return Card subclasses - change (apps...wikipedia)

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

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

Change subject: Allow FeedClients to return Card subclasses
..

Allow FeedClients to return Card subclasses

Change-Id: I039ba6291f90506f05eb74750084aedbcdcf9bda
---
M app/src/main/java/org/wikipedia/feed/FeedClient.java
M app/src/main/java/org/wikipedia/feed/FeedCoordinatorBase.java
2 files changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/feed/FeedClient.java 
b/app/src/main/java/org/wikipedia/feed/FeedClient.java
index 0834840..c7b9913 100644
--- a/app/src/main/java/org/wikipedia/feed/FeedClient.java
+++ b/app/src/main/java/org/wikipedia/feed/FeedClient.java
@@ -13,7 +13,7 @@
 void cancel();
 
 interface Callback {
-void success(@NonNull List cards);
+void success(@NonNull List cards);
 void error(@NonNull Throwable caught);
 }
 }
diff --git a/app/src/main/java/org/wikipedia/feed/FeedCoordinatorBase.java 
b/app/src/main/java/org/wikipedia/feed/FeedCoordinatorBase.java
index bedb9e3..16781b4 100644
--- a/app/src/main/java/org/wikipedia/feed/FeedCoordinatorBase.java
+++ b/app/src/main/java/org/wikipedia/feed/FeedCoordinatorBase.java
@@ -72,7 +72,7 @@
 
 private class ExhaustionClientCallback implements FeedClient.Callback {
 @Override
-public void success(@NonNull List cardList) {
+public void success(@NonNull List cardList) {
 cards.addAll(cardList);
 if (updateListener != null) {
 updateListener.update(cards);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I039ba6291f90506f05eb74750084aedbcdcf9bda
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] Integrate most read - change (apps...wikipedia)

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

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

Change subject: Integrate most read
..

Integrate most read

Bug: T129082
Change-Id: I688329f705646d917e00662be57385bc2cd4e50a
---
M app/src/main/java/org/wikipedia/feed/FeedCoordinator.java
M app/src/main/java/org/wikipedia/feed/demo/IntegerListCard.java
A app/src/main/java/org/wikipedia/feed/mostread/MostReadCardView.java
M app/src/main/java/org/wikipedia/feed/mostread/MostReadClient.java
A app/src/main/java/org/wikipedia/feed/mostread/MostReadItemCard.java
A app/src/main/java/org/wikipedia/feed/mostread/MostReadListCard.java
M app/src/main/java/org/wikipedia/feed/view/FeedRecyclerAdapter.java
M app/src/main/res/values/strings_no_translate.xml
M app/src/test/java/org/wikipedia/feed/mostread/MostReadClientTest.java
9 files changed, 212 insertions(+), 21 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java 
b/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java
index 03f3c8c..03bcbc4 100644
--- a/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java
+++ b/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java
@@ -6,6 +6,7 @@
 import org.wikipedia.feed.becauseyouread.BecauseYouReadClient;
 import org.wikipedia.feed.continuereading.ContinueReadingClient;
 import org.wikipedia.feed.demo.IntegerListClient;
+import org.wikipedia.feed.mostread.MostReadClient;
 
 public class FeedCoordinator extends FeedCoordinatorBase {
 
@@ -20,6 +21,7 @@
 addPendingClient(new BecauseYouReadClient());
 addPendingClient(new ContinueReadingClient());
 addPendingClient(new IntegerListClient());
+addPendingClient(new MostReadClient());
 
 }
 
diff --git a/app/src/main/java/org/wikipedia/feed/demo/IntegerListCard.java 
b/app/src/main/java/org/wikipedia/feed/demo/IntegerListCard.java
index c8e122f..70af63a 100644
--- a/app/src/main/java/org/wikipedia/feed/demo/IntegerListCard.java
+++ b/app/src/main/java/org/wikipedia/feed/demo/IntegerListCard.java
@@ -16,7 +16,7 @@
 }
 
 @NonNull @Override public String title() {
-return "Top read on English Wikipedia";
+return "In the news";
 }
 
 @Nullable @Override public String subtitle() {
@@ -24,7 +24,7 @@
 }
 
 @Nullable @Override public String footer() {
-return "All top read articles on Fri, April 08";
+return "More news from Fri, April 08";
 }
 
 private static List newItems() {
diff --git 
a/app/src/main/java/org/wikipedia/feed/mostread/MostReadCardView.java 
b/app/src/main/java/org/wikipedia/feed/mostread/MostReadCardView.java
new file mode 100644
index 000..081bc9b
--- /dev/null
+++ b/app/src/main/java/org/wikipedia/feed/mostread/MostReadCardView.java
@@ -0,0 +1,53 @@
+package org.wikipedia.feed.mostread;
+
+import android.content.Context;
+import android.support.annotation.NonNull;
+
+import org.wikipedia.feed.demo.IntegerListCard;
+import org.wikipedia.feed.view.CardFooterView;
+import org.wikipedia.feed.view.CardHeaderView;
+import org.wikipedia.feed.view.ListCardItemView;
+import org.wikipedia.feed.view.ListCardView;
+import org.wikipedia.views.DefaultViewHolder;
+
+import java.util.List;
+
+public class MostReadCardView extends ListCardView {
+public MostReadCardView(Context context) {
+super(context);
+}
+
+public void set(@NonNull MostReadListCard card) {
+header(card);
+footer(card);
+set(new RecyclerAdapter(card.items()));
+}
+
+private void header(@NonNull MostReadListCard card) {
+CardHeaderView header = new CardHeaderView(getContext())
+.setTitle(card.title())
+.setSubtitle(card.subtitle());
+header(header);
+}
+
+private void footer(@NonNull MostReadListCard card) {
+CardFooterView footer = new CardFooterView(getContext())
+.setText(card.footer());
+footer.setVisibility(card.items().size() > 2 ? VISIBLE : GONE);
+footer(footer);
+}
+
+private static class RecyclerAdapter extends 
ListCardView.RecyclerAdapter {
+RecyclerAdapter(@NonNull List items) {
+super(items);
+}
+
+@Override public void 
onBindViewHolder(DefaultViewHolder holder,
+   int position) {
+MostReadItemCard card = item(position);
+holder.getView().setTitle(card.title());
+holder.getView().setSubtitle(card.subtitle());
+holder.getView().setImage(card.image());
+}
+}
+}
\ No newline at end of file
diff --git a/app/src/main/java/org/wikipedia/feed/mostread/MostReadClient.java 
b/app/src/main/java/org/wikipedia/feed/mostread/MostReadClient.java
index b24c0cb..ad17bdc 100644
--- 

[MediaWiki-commits] [Gerrit] Prevent NPE - change (apps...wikipedia)

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

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

Change subject: Prevent NPE
..

Prevent NPE

FeedFragment unbinds (nulls) its Views in onDestroyView(). Check the
Fragment state before interacting with the Views in an asynchronous
callback.

Change-Id: I2a0507f4da82e76886589cbe490575c421182865
---
M app/src/main/java/org/wikipedia/feed/FeedFragment.java
1 file changed, 3 insertions(+), 5 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/feed/FeedFragment.java 
b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
index 1d84d45..9fa61f2 100644
--- a/app/src/main/java/org/wikipedia/feed/FeedFragment.java
+++ b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
@@ -50,17 +50,15 @@
 coordinator.setFeedUpdateListener(new 
FeedCoordinator.FeedUpdateListener() {
 @Override
 public void update(List cards) {
-feedView.update();
+if (isAdded()) {
+feedView.update();
+}
 }
 });
 
 coordinator.more(app.getSite());
 
 return view;
-}
-
-@Override public void onResume() {
-super.onResume();
 }
 
 @Override public void onDestroyView() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a0507f4da82e76886589cbe490575c421182865
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] Add Retrofit service cache - change (apps...wikipedia)

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

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

Change subject: Add Retrofit service cache
..

Add Retrofit service cache

• Add Retrofit service interface cache. The previous implementation in
  WikipediaApp did not work for multiple clients.

• Move Site parameter from construction to request time. This allows
  localizations to change between requests.

• The centralized place for generating Retrofits seems to be in
  *PageEndpointsCache. Expose a static method for non-page services and
  use it.

• Rename some of the "clients" to "services" to match Retrofit
  terminology.

Bug: T129082
Change-Id: I6413f34113b7d110202b2db9c288b6e1836c8da9
---
M app/src/main/java/org/wikipedia/WikipediaApp.java
A app/src/main/java/org/wikipedia/dataclient/retrofit/CachedService.java
A app/src/main/java/org/wikipedia/dataclient/retrofit/CsCachedService.java
A app/src/main/java/org/wikipedia/dataclient/retrofit/MwCachedService.java
A app/src/main/java/org/wikipedia/dataclient/retrofit/SiteCachedService.java
M app/src/main/java/org/wikipedia/feed/FeedClient.java
M app/src/main/java/org/wikipedia/feed/FeedCoordinator.java
M app/src/main/java/org/wikipedia/feed/FeedCoordinatorBase.java
M app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadClient.java
M 
app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingClient.java
M app/src/main/java/org/wikipedia/feed/demo/IntegerListClient.java
M app/src/main/java/org/wikipedia/feed/mostread/MostReadClient.java
M app/src/main/java/org/wikipedia/server/mwapi/MwPageEndpointsCache.java
M app/src/main/java/org/wikipedia/server/restbase/RbPageEndpointsCache.java
M app/src/test/java/org/wikipedia/feed/mostread/MostReadClientTest.java
M app/src/test/java/org/wikipedia/test/MockWebServerTest.java
16 files changed, 183 insertions(+), 63 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/WikipediaApp.java 
b/app/src/main/java/org/wikipedia/WikipediaApp.java
index 60d2d64..7e9ca3b 100644
--- a/app/src/main/java/org/wikipedia/WikipediaApp.java
+++ b/app/src/main/java/org/wikipedia/WikipediaApp.java
@@ -29,7 +29,6 @@
 import org.wikipedia.database.DatabaseClient;
 import org.wikipedia.database.contract.AppContentProviderContract;
 import org.wikipedia.database.contract.ReadingListPageContract;
-import org.wikipedia.dataclient.retrofit.RetrofitFactory;
 import org.wikipedia.editing.EditTokenStorage;
 import org.wikipedia.editing.summaries.EditSummary;
 import org.wikipedia.events.ChangeTextSizeEvent;
@@ -69,7 +68,6 @@
 
 import okhttp3.Headers;
 import okhttp3.Request;
-import retrofit2.Retrofit;
 
 import static org.wikipedia.util.DimenUtil.getFontSizeFromSp;
 import static org.wikipedia.util.ReleaseUtil.getChannel;
@@ -96,8 +94,6 @@
 private SharedPreferenceCookieManager cookieManager;
 private String userAgent;
 private Site site;
-@Nullable private Site retrofitSite;
-@Nullable private Retrofit retrofit;
 
 private CrashReporter crashReporter;
 
@@ -271,20 +267,6 @@
 site = Site.forLanguageCode(lang);
 }
 return site;
-}
-
-/** @return client if app site has not changed, a new client otherwise. */
-@NonNull public synchronized  T retrofitClient(Class clazz, 
@Nullable T client) {
-@SuppressWarnings("checkstyle:hiddenfield") Site site = getSite();
-if (!site.equals(retrofitSite)) {
-retrofitSite = site;
-retrofit = RetrofitFactory.newInstance(site);
-return retrofit.create(clazz);
-}
-// getSite() returns nonnull. If retrofitSite was null, it would have 
been unequal and
-// initialized in the preceding conditional.
-//noinspection ConstantConditions
-return client == null ? retrofit.create(clazz) : client;
 }
 
 /**
diff --git 
a/app/src/main/java/org/wikipedia/dataclient/retrofit/CachedService.java 
b/app/src/main/java/org/wikipedia/dataclient/retrofit/CachedService.java
new file mode 100644
index 000..57f1ea4
--- /dev/null
+++ b/app/src/main/java/org/wikipedia/dataclient/retrofit/CachedService.java
@@ -0,0 +1,35 @@
+package org.wikipedia.dataclient.retrofit;
+
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+
+import retrofit2.Retrofit;
+
+public abstract class CachedService {
+@NonNull private final Class clazz;
+@Nullable private Retrofit retrofit;
+@Nullable private T service;
+
+public CachedService(@NonNull Class clazz) {
+this.clazz = clazz;
+}
+
+@Nullable protected T service() {
+return service;
+}
+
+@Nullable protected Retrofit retrofit() {
+return retrofit;
+}
+
+protected void update() {
+retrofit = create();
+service = retrofit.create(clazz);
+}
+
+

[MediaWiki-commits] [Gerrit] Remove redundant null check - change (apps...wikipedia)

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

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

Change subject: Remove redundant null check
..

Remove redundant null check

Change-Id: I089b8032e4163b0e813daa17765505b27f10eed4
---
M 
app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java
1 file changed, 2 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/79/294379/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 119abe3..e1e0771 100644
--- 
a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java
+++ 
b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java
@@ -1,7 +1,6 @@
 package org.wikipedia.feed.becauseyouread;
 
 import android.content.Context;
-import android.net.Uri;
 import android.support.annotation.NonNull;
 
 import org.wikipedia.feed.view.CardHeaderView;
@@ -37,11 +36,7 @@
 BecauseYouReadItemCard card = item(i);
 holder.getView().setTitle(card.title());
 holder.getView().setSubtitle(card.subtitle());
-
-Uri imageUri = card.image();
-if (imageUri != null) {
-holder.getView().setImage(imageUri);
-}
+holder.getView().setImage(card.image());
 }
 }
-}
+}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I089b8032e4163b0e813daa17765505b27f10eed4
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] MySQL backend for storing roles / hiera data for labs - change (operations/puppet)

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

Change subject: MySQL backend for storing roles / hiera data for labs
..


MySQL backend for storing roles / hiera data for labs

TODO:
  - More error validation
  - A name that is clearer
  - Icinga checks

Bug: T133412
Change-Id: I49fd45c47e5f756a77b3429a6e5a671e328285d2
---
M hieradata/hosts/labtestcontrol2001.yaml
M manifests/site.pp
A modules/labspuppetbackend/files/.pep8
A modules/labspuppetbackend/files/labspuppetbackend.py
A modules/labspuppetbackend/files/schema.sql
A modules/labspuppetbackend/files/tox.ini
A modules/labspuppetbackend/manifests/init.pp
7 files changed, 292 insertions(+), 0 deletions(-)

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



diff --git a/hieradata/hosts/labtestcontrol2001.yaml 
b/hieradata/hosts/labtestcontrol2001.yaml
index d5a3997..58d1846 100644
--- a/hieradata/hosts/labtestcontrol2001.yaml
+++ b/hieradata/hosts/labtestcontrol2001.yaml
@@ -4,3 +4,9 @@
 value: standard
 
 puppetmaster::hiera_config: labtest
+
+labspuppetbackend::mysql_host: labtestcontrol2001.wikimedia.org
+labspuppetbackend::mysql_db:   labspuppet
+labspuppetbackend::mysql_username: labspuppet
+labspuppetbackend::statsd_host: labmon1001.eqiad.wmnet
+labspuppetbackend::statsd_prefix: labtest.puppetbackend
diff --git a/manifests/site.pp b/manifests/site.pp
index dc07df7..68c6cd7 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -1236,6 +1236,8 @@
 role labs::openstack::nova::controller,
   labs::puppetmaster
 
+include labspuppetbackend
+
 # Labtest is weird; the mysql server is on labtestcontrol2001.  So
 #  we need some special fw rules to allow that
 $designate = ipresolve(hiera('labs_designate_hostname'),4)
diff --git a/modules/labspuppetbackend/files/.pep8 
b/modules/labspuppetbackend/files/.pep8
new file mode 100644
index 000..da16ad3
--- /dev/null
+++ b/modules/labspuppetbackend/files/.pep8
@@ -0,0 +1,3 @@
+[pep8]
+# 80 cols is too short
+max-line-length=120
diff --git a/modules/labspuppetbackend/files/labspuppetbackend.py 
b/modules/labspuppetbackend/files/labspuppetbackend.py
new file mode 100644
index 000..45188ad
--- /dev/null
+++ b/modules/labspuppetbackend/files/labspuppetbackend.py
@@ -0,0 +1,216 @@
+from flask import Flask, request, g, Response
+from statsd.defaults.env import statsd
+import pymysql
+import os
+import json
+
+app = Flask(__name__)
+
+
+@app.before_request
+def before_request():
+g.db = pymysql.connect(
+host=os.environ['MYSQL_HOST'],
+db=os.environ['MYSQL_DB'],
+user=os.environ['MYSQL_USERNAME'],
+passwd=os.environ['MYSQL_PASSWORD']
+)
+
+
+@app.teardown_request
+def teardown_request(exception):
+db = getattr(g, 'db', None)
+if db is not None:
+db.close()
+
+
+@statsd.timer('get_roles')
+@app.route('/v1//prefix//roles', 
methods=['GET'])
+def get_roles(project, prefix):
+cur = g.db.cursor()
+try:
+cur.execute("""
+SELECT roleassignment.role FROM prefix, roleassignment
+WHERE prefix.project = %s AND prefix.prefix = %s AND
+  prefix.id = roleassignment.prefix_id
+""", (project, prefix))
+roles = [r[0] for r in cur.fetchall()]
+return Response(
+json.dumps({'roles': roles}),
+status=200,
+mimetype='application/json'
+)
+finally:
+cur.close()
+
+
+@statsd.timer('set_roles')
+@app.route('/v1//prefix//roles', 
methods=['POST'])
+def set_roles(project, prefix):
+roles = request.get_json()
+if type(roles) is not list:
+return "Body should be a JSON array of roles to set", 400
+# TODO: Add more validation for roles?
+cur = g.db.cursor()
+try:
+g.db.begin()
+# Create this prefix if it does not exist yet!
+# This monstrosity because http://stackoverflow.com/a/779252
+cur.execute("""
+INSERT INTO prefix (project, prefix) VALUES (%s, %s)
+ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id)
+""", (project, prefix))
+prefix_id = cur.lastrowid
+# We delete all the role associations for this prefix and then
+# re-insert the ones we have. This causes churn in the roleassignment
+# tables, but seems cleaner than the alternatives.
+cur.execute("""
+DELETE FROM roleassignment WHERE prefix_id = %s
+""", (prefix_id, ))
+# Add the new ones!
+cur.executemany("""
+INSERT INTO roleassignment (prefix_id, role) VALUES (%s, %s)
+""", [(prefix_id, role) for role in roles])
+g.db.commit()
+finally:
+cur.close()
+return Response(
+json.dumps({'status': 'ok'}),
+status=200,
+mimetype='application/json'
+)
+
+
+@statsd.timer('get_hiera')
+@app.route('/v1//prefix//hiera', 

[MediaWiki-commits] [Gerrit] labs: Don't have shinken do basic instance checks - change (operations/puppet)

2016-06-14 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: labs: Don't have shinken do basic instance checks
..


labs: Don't have shinken do basic instance checks

Temporary until we get new hardware

Bug: T137753

Change-Id: Ib58b610c7790d14536fb7ddf937363083f4405c3
---
M modules/role/manifests/labs/shinken.pp
1 file changed, 0 insertions(+), 3 deletions(-)

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



diff --git a/modules/role/manifests/labs/shinken.pp 
b/modules/role/manifests/labs/shinken.pp
index a5a5df7..175de75 100644
--- a/modules/role/manifests/labs/shinken.pp
+++ b/modules/role/manifests/labs/shinken.pp
@@ -17,9 +17,6 @@
 shinken::config { 'basic-infra-checks':
 source => 'puppet:///modules/shinken/labs/basic-infra-checks.cfg',
 }
-shinken::config { 'basic-instance-checks':
-source => 'puppet:///modules/shinken/labs/basic-instance-checks.cfg',
-}
 
 if $ircbot {
 include shinken::ircbot

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

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

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


[MediaWiki-commits] [Gerrit] labs: Don't have shinken do basic instance checks - change (operations/puppet)

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

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

Change subject: labs: Don't have shinken do basic instance checks
..

labs: Don't have shinken do basic instance checks

Temporary until we get new hardware

Bug: T137753

Change-Id: Ib58b610c7790d14536fb7ddf937363083f4405c3
---
M modules/role/manifests/labs/shinken.pp
1 file changed, 0 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/75/294375/1

diff --git a/modules/role/manifests/labs/shinken.pp 
b/modules/role/manifests/labs/shinken.pp
index a5a5df7..175de75 100644
--- a/modules/role/manifests/labs/shinken.pp
+++ b/modules/role/manifests/labs/shinken.pp
@@ -17,9 +17,6 @@
 shinken::config { 'basic-infra-checks':
 source => 'puppet:///modules/shinken/labs/basic-infra-checks.cfg',
 }
-shinken::config { 'basic-instance-checks':
-source => 'puppet:///modules/shinken/labs/basic-instance-checks.cfg',
-}
 
 if $ircbot {
 include shinken::ircbot

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

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

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


[MediaWiki-commits] [Gerrit] Add index on notification_event - change (mediawiki...Echo)

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

Change subject: Add index on notification_event
..


Add index on notification_event

So we can easily query the notification rows that belong to
a given event row. This is needed for the removeOrphanedEvents
maintenance script to run efficiently.

Change-Id: I99fc31a62b37259d7000577583c8e8a599e400f9
---
M Hooks.php
A db_patches/patch-add-notification_event-index.sql
M echo.sql
3 files changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/Hooks.php b/Hooks.php
index e75f3f9..5f90a31 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -165,6 +165,7 @@
$updater->addExtensionField( 'echo_event', 'event_page_id', 
"$dir/db_patches/patch-add-echo_event-event_page_id.sql" );
$updater->addExtensionIndex( 'echo_event', 'echo_event_type', 
"$dir/db_patches/patch-alter-event_type-index.sql" );
$updater->addExtensionIndex( 'echo_notification', 
'echo_user_timestamp', "$dir/db_patches/patch-alter-user_timestamp-index.sql" );
+   $updater->addExtensionIndex( 'echo_notification', 
'echo_notification_event', 
"$dir/db_patches/patch-add-notification_event-index.sql" );
$updater->addPostDatabaseUpdateMaintenance( 
'RemoveOrphanedEvents' );
}
 
diff --git a/db_patches/patch-add-notification_event-index.sql 
b/db_patches/patch-add-notification_event-index.sql
new file mode 100644
index 000..1243b80
--- /dev/null
+++ b/db_patches/patch-add-notification_event-index.sql
@@ -0,0 +1 @@
+CREATE INDEX /*i*/echo_notification_event ON /*_*/echo_notification 
(notification_event);
diff --git a/echo.sql b/echo.sql
index 910203a..392e1d0 100644
--- a/echo.sql
+++ b/echo.sql
@@ -30,6 +30,7 @@
 CREATE INDEX /*i*/echo_notification_user_base_timestamp ON 
/*_*/echo_notification (notification_user, notification_bundle_base, 
notification_timestamp, notification_event);
 CREATE INDEX /*i*/echo_notification_user_hash_timestamp ON 
/*_*/echo_notification (notification_user, notification_bundle_hash, 
notification_timestamp);
 CREATE INDEX /*i*/echo_notification_user_hash_base_timestamp ON 
/*_*/echo_notification (notification_user, notification_bundle_display_hash, 
notification_bundle_base, notification_timestamp);
+CREATE INDEX /*i*/echo_notification_event ON /*_*/echo_notification 
(notification_event);
 
 CREATE TABLE /*_*/echo_email_batch (
eeb_id int unsigned not null primary key auto_increment,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I99fc31a62b37259d7000577583c8e8a599e400f9
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Springle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Sync parserTests with core - change (mediawiki...parsoid)

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

Change subject: Sync parserTests with core
..


Sync parserTests with core

Change-Id: I714f87ad46d99aa9925ce0e654aa8da45cf08b73
---
M tests/parserTests-blacklist.js
M tests/parserTests.txt
M tools/fetch-parserTests.txt.js
3 files changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js
index 9f2973c..c302113 100644
--- a/tests/parserTests-blacklist.js
+++ b/tests/parserTests-blacklist.js
@@ -881,7 +881,7 @@
 add("html2wt", "Magic Word: {{TALKPAGENAMEE}}", 
"User_talk:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason\n");
 add("html2wt", "Magic Word: {{SUBJECTPAGENAME}}", "User:Ævar Arnfjörð 
Bjarmason\n");
 add("html2wt", "Magic Word: {{SUBJECTPAGENAMEE}}", 
"User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason\n");
-add("html2wt", "Magic Word: {{NUMBEROFFILES}}", "6\n");
+add("html2wt", "Magic Word: {{NUMBEROFFILES}}", "7\n");
 add("html2wt", "Magic Word: {{PAGENAME}}", "Ævar Arnfjörð Bjarmason\n");
 add("html2wt", "Magic Word: {{PAGENAME}} with metacharacters", 
"'''foo & bar = baz'''\n");
 add("html2wt", "Magic Word: {{PAGENAME}} with metacharacters (bug 26781)", 
"*RFC 1234 
http://example.com/\n");
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index afd06ca..2e059d7 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -9944,7 +9944,7 @@
 !! wikitext
 {{NUMBEROFFILES}}
 !! html
-6
+7
 
 !! end
 
diff --git a/tools/fetch-parserTests.txt.js b/tools/fetch-parserTests.txt.js
index 693b45a..c763927 100755
--- a/tools/fetch-parserTests.txt.js
+++ b/tools/fetch-parserTests.txt.js
@@ -12,9 +12,9 @@
 // and update these hashes automatically.
 //
 // You can use 'sha1sum -b tests/parser/parserTests.txt' to compute this value:
-var expectedSHA1 = "072f3924d1666914099d4a6bb88c2715f3184b7f";
+var expectedSHA1 = "4bdc214a83d57881c30c1a18f47fc85957f0059a";
 // git log --pretty=oneline -1 tests/parser/parserTests.txt
-var latestCommit = "35477b6e3aa156c99f9ed905e2b10a01de12267b";
+var latestCommit = "32a2661a56db1be717ce431c67260bbea771558f";
 
 var fs = require('fs');
 var path = require('path');

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

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

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


[MediaWiki-commits] [Gerrit] Bump version after release - change (mediawiki...parsoid)

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

Change subject: Bump version after release
..


Bump version after release

Change-Id: Iaed8279cb06c0c7b55940b1e4aed3f8b21262e79
---
M HISTORY.md
M lib/ext/Cite/index.js
M lib/ext/LST/index.js
M lib/ext/Translate/index.js
M npm-shrinkwrap.json
M package.json
M tests/parserTestsParserHook.js
7 files changed, 7 insertions(+), 7 deletions(-)

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



diff --git a/HISTORY.md b/HISTORY.md
index 65c91e6..76bd87c 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -10,7 +10,7 @@
   * T114413: Provide HTML2HTML endpoint in Parsoid
   * T137406: Emit |- between thead/tbody/tfoot
 
-0.4.1 / 2015-09-17
+0.5.1 / 2015-05-02
 ==
 
   * Thar be dragons
diff --git a/lib/ext/Cite/index.js b/lib/ext/Cite/index.js
index c2a7e47..6df728d 100644
--- a/lib/ext/Cite/index.js
+++ b/lib/ext/Cite/index.js
@@ -6,7 +6,7 @@
 
 var entities = module.parent.require('entities');
 
-var ParsoidExtApi = 
module.parent.require('./extapi.js').versionCheck('^0.4.1');
+var ParsoidExtApi = 
module.parent.require('./extapi.js').versionCheck('^0.5.1');
 var Util = ParsoidExtApi.Util;
 var DU = ParsoidExtApi.DOMUtils;
 var Promise = ParsoidExtApi.Promise;
diff --git a/lib/ext/LST/index.js b/lib/ext/LST/index.js
index 5657dad..53621ab 100644
--- a/lib/ext/LST/index.js
+++ b/lib/ext/LST/index.js
@@ -1,6 +1,6 @@
 'use strict';
 
-var ParsoidExtApi = 
module.parent.require('./extapi.js').versionCheck('^0.4.1');
+var ParsoidExtApi = 
module.parent.require('./extapi.js').versionCheck('^0.5.1');
 
 var DU = ParsoidExtApi.DOMUtils;
 var Promise = ParsoidExtApi.Promise;
diff --git a/lib/ext/Translate/index.js b/lib/ext/Translate/index.js
index 1aafd42..cdd8cce 100644
--- a/lib/ext/Translate/index.js
+++ b/lib/ext/Translate/index.js
@@ -1,7 +1,7 @@
 'use strict';
 
 /* exported ParsoidExtApi */ // suppress 'unused variable' warning
-var ParsoidExtApi = 
module.parent.require('./extapi.js').versionCheck('^0.4.1');
+var ParsoidExtApi = 
module.parent.require('./extapi.js').versionCheck('^0.5.1');
 
 // Translate constructor
 module.exports = function() {
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 4d6642f..c8b06f0 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,6 +1,6 @@
 {
   "name": "parsoid",
-  "version": "0.4.1-git",
+  "version": "0.5.1+git",
   "npm-shrinkwrap-version": "200.4.0",
   "node-version": "v0.10.26",
   "dependencies": {
diff --git a/package.json b/package.json
index 2f0d05e..d13191e 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
   "name": "parsoid",
   "description": "Mediawiki parser for the VisualEditor.",
-  "version": "0.4.1+git",
+  "version": "0.5.1+git",
   "license": "GPL-2.0+",
   "dependencies": {
 "async": "^0.9.0",
diff --git a/tests/parserTestsParserHook.js b/tests/parserTestsParserHook.js
index 68803eb..7213160 100644
--- a/tests/parserTestsParserHook.js
+++ b/tests/parserTestsParserHook.js
@@ -1,6 +1,6 @@
 'use strict';
 
-var ParsoidExtApi = 
module.parent.require('./extapi.js').versionCheck('^0.4.1');
+var ParsoidExtApi = 
module.parent.require('./extapi.js').versionCheck('^0.5.1');
 var Util = ParsoidExtApi.Util;
 var DU = ParsoidExtApi.DOMUtils;
 

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

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

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


[MediaWiki-commits] [Gerrit] labs: remove shinken monitoring for tools / deployment-prep - change (operations/puppet)

2016-06-14 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: labs: remove shinken monitoring for tools / deployment-prep
..


labs: remove shinken monitoring for tools / deployment-prep

Temporary until we get new hardware

Bug: T137753
Change-Id: Iacfa9b7c465beba0f4e484cdb8cec9aabc42b20e
---
M modules/role/manifests/labs/shinken.pp
1 file changed, 0 insertions(+), 3 deletions(-)

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



diff --git a/modules/role/manifests/labs/shinken.pp 
b/modules/role/manifests/labs/shinken.pp
index 8b31942..a5a5df7 100644
--- a/modules/role/manifests/labs/shinken.pp
+++ b/modules/role/manifests/labs/shinken.pp
@@ -24,7 +24,4 @@
 if $ircbot {
 include shinken::ircbot
 }
-
-include beta::monitoring::shinken
-include toollabs::monitoring::shinken
 }

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

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

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


[MediaWiki-commits] [Gerrit] SECURITY: Fix XSS via __proto__ - change (mediawiki...Kartographer)

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

Change subject: SECURITY: Fix XSS via __proto__
..


SECURITY: Fix XSS via __proto__

Bug: T134719
Change-Id: I4b537f018c8d37491f46349ac9c764279123deb1
---
M includes/SimpleStyleParser.php
M tests/phpunit/KartographerTest.php
2 files changed, 41 insertions(+), 9 deletions(-)

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



diff --git a/includes/SimpleStyleParser.php b/includes/SimpleStyleParser.php
index 5acca96..48deb2e 100644
--- a/includes/SimpleStyleParser.php
+++ b/includes/SimpleStyleParser.php
@@ -17,8 +17,6 @@
 class SimpleStyleParser {
private static $parsedProps = [ 'title', 'description' ];
 
-   private static $recursedProps = [ 'geometry', 'geometries', 'features' 
];
-
/** @var Parser */
private $parser;
 
@@ -153,15 +151,18 @@
return;
}
 
-   if ( property_exists( $json, 'properties' ) && is_object( 
$json->properties ) ) {
-   $this->sanitizeProperties( $json->properties );
-   }
-
-   foreach ( self::$recursedProps as $prop ) {
-   if ( property_exists( $json, $prop ) ) {
+   foreach ( array_keys( get_object_vars( $json ) ) as $prop ) {
+   // https://phabricator.wikimedia.org/T134719
+   if ( $prop[0] === '_' ) {
+   unset( $json->$prop );
+   } else {
$this->sanitize( $json->$prop );
}
}
+
+   if ( property_exists( $json, 'properties' ) && is_object( 
$json->properties ) ) {
+   $this->sanitizeProperties( $json->properties );
+   }
}
 
/**
diff --git a/tests/phpunit/KartographerTest.php 
b/tests/phpunit/KartographerTest.php
index 65c858e..8995c7c 100644
--- a/tests/phpunit/KartographerTest.php
+++ b/tests/phpunit/KartographerTest.php
@@ -67,8 +67,37 @@
   "marker-size": "medium",
   "marker-color": "0050d0"
 }
-  }';
+ }';
/** @noinspection HtmlUnknownTarget */
+   $xssJson = '[
+  {
+   "__proto__": { "some": "bad stuff" },
+   "type": "Feature",
+   "geometry": {
+   "type": "Point",
+   "coordinates": [-122.3988, 37.8013]
+   },
+   "properties": {
+   "__proto__": { "foo": "bar" },
+   "title": "Foo bar"
+   }
+  },
+  {
+   "type": "GeometryCollection",
+   "geometries": [
+   {
+   "__proto__": "recurse me",
+   "type": "Point",
+   "coordinates": [ 0, 0 ],
+   "properties": { "__proto__": "is evil" }
+   }
+   ]
+  }
+]';
+   $xssJsonSanitized = 
'{"_a4d5387a1b7974bf854321421a36d913101f5724":[
+   
{"type":"Feature","geometry":{"type":"Point","coordinates":[-122.3988,37.8013]},"properties":{"title":"Foo
 bar"}},
+   
{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[0,0],"properties":{}}]}
+   ]}';
$wikitextJsonParsed = 
'{"_be34df99c99d1efd9eaa8eabc87a43f2541a67e5":[

{"type":"Feature","geometry":{"type":"Point","coordinates":[-122.3988,37.8013]},

"properties":{"title":"scriptalert(document.cookie);\/script",
@@ -98,8 +127,10 @@
   }', 'Invalid JSON 6' ],
[ $wikitextJsonParsed, "[{$this->wikitextJson}]", ' with parsable 
text and description' ],
[ $wikitextJsonParsed, "[{$this->wikitextJson}]", 
' with parsable text and description' ],
+
// Bugs
[ 'null', "\t\r\n ", 'T127345: whitespace-only tag content, 
' ],
+   [ $xssJsonSanitized, "$xssJson", 'T134719: XSS via __proto__' ],
];
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4b537f018c8d37491f46349ac9c764279123deb1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Move fatal PHP functions checks to initialization - change (mediawiki/core)

2016-06-14 Thread Chad (Code Review)
Chad has uploaded a new change for review.

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

Change subject: Move fatal PHP functions checks to initialization
..

Move fatal PHP functions checks to initialization

The installer is far too late of a place to be checking if
a function does or doesn't exist if we require it for operation.
Functions can very easily (T137509) be called prior to ever
getting to the installer check page.

Also, an old installation could've gotten past the checks if
they ran update.php --skip-compat-checks. What a scary setting!

Instead, fail hard, fast and early along with PHP version checks.
All entry points are required to go through this.

While we're here, also remove the check for mbstring.func_overload
since we already would've failed at WebStart.php

Change-Id: Ib9727979af2a4741f3cd952d13a3bb350fad43e4
(cherry picked from commit 41d1fa1c3aa9d6e9e0e5f0c5455b9092833e9012)
---
M includes/PHPVersionCheck.php
M includes/Setup.php
M includes/installer/Installer.php
M includes/installer/i18n/en.json
M includes/installer/i18n/qqq.json
5 files changed, 60 insertions(+), 97 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/74/294374/1

diff --git a/includes/PHPVersionCheck.php b/includes/PHPVersionCheck.php
index 1eafcfa..33fa95d 100644
--- a/includes/PHPVersionCheck.php
+++ b/includes/PHPVersionCheck.php
@@ -45,6 +45,29 @@
// @codingStandardsIgnoreEnd
wfMissingVendorError( $entryPoint, $mwVersion );
}
+
+   // List of functions and their associated PHP extension to check for
+   // @codingStandardsIgnoreStart Generic.Arrays.DisallowLongArraySyntax
+   $extensions = array(
+   'mb_substr'   => 'mbstring',
+   'utf8_encode' => 'xml',
+   'ctype_digit' => 'ctype',
+   'json_decode' => 'json',
+   'iconv'   => 'iconv',
+   );
+   // List of extensions we're missing
+   $missingExtensions = array();
+   // @codingStandardsIgnoreEnd
+
+   foreach ( $extensions as $function => $extension ) {
+   if ( !function_exists( $function ) ) {
+   $missingExtensions[] = $extension;
+   }
+   }
+
+   if ( $missingExtensions ) {
+   wfMissingExtensions( $entryPoint, $mwVersion, 
$missingExtensions );
+   }
 }
 
 /**
@@ -107,7 +130,7 @@
padding: 2em;
text-align: center;
}
-   p, img, h1, h2 {
+   p, img, h1, h2, ul  {
text-align: left;
margin: 0.5em 0 1em;
}
@@ -201,3 +224,38 @@
 
wfGenericError( $type, $mwVersion, 'External dependencies', $shortText, 
$longText, $longHtml );
 }
+
+/**
+ * Display an error for a PHP extension not existing.
+ *
+ * @param string $type See wfGenericError
+ * @param string $mwVersion See wfGenericError
+ * @param array $missingExts The extensions we're missing
+ */
+function wfMissingExtensions( $type, $mwVersion, $missingExts ) {
+   $shortText = "Installing some PHP extensions is required.";
+
+   $missingExtText = '';
+   $missingExtHtml = '';
+   $baseUrl = 'https://secure.php.net';
+   foreach ( $missingExts as $ext ) {
+   $missingExtText .= " * $ext <$baseUrl/$ext>\n";
+   $missingExtHtml .= "$ext "
+   . "(more 
information)";
+   }
+
+   $cliText = "Error: Missing one or more required components of PHP.\n"
+   . "You are missing a required extension to PHP that MediaWiki 
needs.\n"
+   . "Please install:\n" . $missingExtText;
+
+   $longHtml = <<
+   $missingExtHtml
+   
+HTML;
+
+   wfGenericError( $type, $mwVersion, 'Required components', $shortText,
+   $cliText, $longHtml );
+}
diff --git a/includes/Setup.php b/includes/Setup.php
index 7375987..3cb72f5 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -44,12 +44,7 @@
die( 1 );
 }
 
-if ( function_exists( 'mb_internal_encoding' ) ) {
-   mb_internal_encoding( 'UTF-8' );
-} elseif ( !defined( 'MEDIAWIKI_INSTALL' ) ) {
-   echo "Error: the mbstring PHP extension is required\n";
-   die( 1 );
-}
+mb_internal_encoding( 'UTF-8' );
 
 // Set various default paths sensibly...
 $ps_default = Profiler::instance()->scopedProfileIn( $fname . '-defaults' );
diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php
index 4c8e7e9..84a665d 100644
--- a/includes/installer/Installer.php
+++ b/includes/installer/Installer.php
@@ -120,8 +120,6 @@
protected $envChecks = [
'envCheckDB',
'envCheckBrokenXML',
-   'envCheckMbstring',
-   'envCheckXML',
   

[MediaWiki-commits] [Gerrit] SECURITY: Fix XSS via __proto__ - change (mediawiki...Kartographer)

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

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

Change subject: SECURITY: Fix XSS via __proto__
..

SECURITY: Fix XSS via __proto__

Bug: T134719
Change-Id: I4b537f018c8d37491f46349ac9c764279123deb1
---
M includes/SimpleStyleParser.php
M tests/phpunit/KartographerTest.php
2 files changed, 41 insertions(+), 9 deletions(-)


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

diff --git a/includes/SimpleStyleParser.php b/includes/SimpleStyleParser.php
index 5acca96..48deb2e 100644
--- a/includes/SimpleStyleParser.php
+++ b/includes/SimpleStyleParser.php
@@ -17,8 +17,6 @@
 class SimpleStyleParser {
private static $parsedProps = [ 'title', 'description' ];
 
-   private static $recursedProps = [ 'geometry', 'geometries', 'features' 
];
-
/** @var Parser */
private $parser;
 
@@ -153,15 +151,18 @@
return;
}
 
-   if ( property_exists( $json, 'properties' ) && is_object( 
$json->properties ) ) {
-   $this->sanitizeProperties( $json->properties );
-   }
-
-   foreach ( self::$recursedProps as $prop ) {
-   if ( property_exists( $json, $prop ) ) {
+   foreach ( array_keys( get_object_vars( $json ) ) as $prop ) {
+   // https://phabricator.wikimedia.org/T134719
+   if ( $prop[0] === '_' ) {
+   unset( $json->$prop );
+   } else {
$this->sanitize( $json->$prop );
}
}
+
+   if ( property_exists( $json, 'properties' ) && is_object( 
$json->properties ) ) {
+   $this->sanitizeProperties( $json->properties );
+   }
}
 
/**
diff --git a/tests/phpunit/KartographerTest.php 
b/tests/phpunit/KartographerTest.php
index 65c858e..8995c7c 100644
--- a/tests/phpunit/KartographerTest.php
+++ b/tests/phpunit/KartographerTest.php
@@ -67,8 +67,37 @@
   "marker-size": "medium",
   "marker-color": "0050d0"
 }
-  }';
+ }';
/** @noinspection HtmlUnknownTarget */
+   $xssJson = '[
+  {
+   "__proto__": { "some": "bad stuff" },
+   "type": "Feature",
+   "geometry": {
+   "type": "Point",
+   "coordinates": [-122.3988, 37.8013]
+   },
+   "properties": {
+   "__proto__": { "foo": "bar" },
+   "title": "Foo bar"
+   }
+  },
+  {
+   "type": "GeometryCollection",
+   "geometries": [
+   {
+   "__proto__": "recurse me",
+   "type": "Point",
+   "coordinates": [ 0, 0 ],
+   "properties": { "__proto__": "is evil" }
+   }
+   ]
+  }
+]';
+   $xssJsonSanitized = 
'{"_a4d5387a1b7974bf854321421a36d913101f5724":[
+   
{"type":"Feature","geometry":{"type":"Point","coordinates":[-122.3988,37.8013]},"properties":{"title":"Foo
 bar"}},
+   
{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[0,0],"properties":{}}]}
+   ]}';
$wikitextJsonParsed = 
'{"_be34df99c99d1efd9eaa8eabc87a43f2541a67e5":[

{"type":"Feature","geometry":{"type":"Point","coordinates":[-122.3988,37.8013]},

"properties":{"title":"scriptalert(document.cookie);\/script",
@@ -98,8 +127,10 @@
   }', 'Invalid JSON 6' ],
[ $wikitextJsonParsed, "[{$this->wikitextJson}]", ' with parsable 
text and description' ],
[ $wikitextJsonParsed, "[{$this->wikitextJson}]", 
' with parsable text and description' ],
+
// Bugs
[ 'null', "\t\r\n ", 'T127345: whitespace-only tag content, 
' ],
+   [ $xssJsonSanitized, "$xssJson", 'T134719: XSS via __proto__' ],
];
}
 

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

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

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


[MediaWiki-commits] [Gerrit] Add Today's Featured Article card - change (apps...wikipedia)

2016-06-14 Thread Mholloway (Code Review)
Mholloway has uploaded a new change for review.

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

Change subject: Add Today's Featured Article card
..

Add Today's Featured Article card

This card adds a feed card for Today's Featured Article, and in doing so
adds some additional components:

* A BigPictureCard and associated View and layout files; and

* An aggregated feed endpoint client.

TODOs (in separate patches):

* Add gray, slightly larger bookmark and share drawables (make or get from
  designers)

* Add larger thumbnail URLs to the standard feed thumbnails generator in
  MCS, and use them in the BigPictureCard (don't want to hold up for this
  now since something we probably didn't do is causing seemingly random
  403s in beta at the moment)

Bug: 129079
Change-Id: I7e4ac7b2f2e81f8cdf40f9649daecb08db0cdfc1
---
M app/src/main/java/org/wikipedia/Constants.java
M app/src/main/java/org/wikipedia/feed/FeedCoordinator.java
A app/src/main/java/org/wikipedia/feed/UtcDate.java
A app/src/main/java/org/wikipedia/feed/aggregated/AggregatedFeedContent.java
A 
app/src/main/java/org/wikipedia/feed/aggregated/AggregatedFeedContentClient.java
A app/src/main/java/org/wikipedia/feed/featured/FeaturedArticleCard.java
A app/src/main/java/org/wikipedia/feed/featured/FeaturedArticleCardView.java
A app/src/main/java/org/wikipedia/feed/model/BigPictureCard.java
M app/src/main/java/org/wikipedia/feed/model/Card.java
A app/src/main/java/org/wikipedia/feed/model/CardPageItem.java
A app/src/main/java/org/wikipedia/feed/view/BigPictureCardView.java
A app/src/main/java/org/wikipedia/feed/view/FeaturedCardFooterView.java
M app/src/main/java/org/wikipedia/feed/view/FeedRecyclerAdapter.java
M app/src/main/java/org/wikipedia/util/DateUtil.java
A app/src/main/res/layout/view_big_picture_card.xml
A app/src/main/res/layout/view_card_featured_footer.xml
M app/src/main/res/values/strings_no_translate.xml
17 files changed, 537 insertions(+), 12 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/Constants.java 
b/app/src/main/java/org/wikipedia/Constants.java
index 0b87dee..b60ad20 100644
--- a/app/src/main/java/org/wikipedia/Constants.java
+++ b/app/src/main/java/org/wikipedia/Constants.java
@@ -13,6 +13,8 @@
 public static final int SUGGESTION_REQUEST_ITEMS = 5;
 
 public static final int PREFERRED_THUMB_SIZE = 320;
+public static final String PREFERRED_THUMBNAIL_KEY
+= Integer.toString(Constants.PREFERRED_THUMB_SIZE);
 
 private Constants() { }
 }
diff --git a/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java 
b/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java
index 40fbd8b..caefd4d 100644
--- a/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java
+++ b/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java
@@ -4,6 +4,7 @@
 import android.support.annotation.NonNull;
 
 import org.wikipedia.Site;
+import org.wikipedia.feed.aggregated.AggregatedFeedContentClient;
 import org.wikipedia.feed.becauseyouread.BecauseYouReadClient;
 import org.wikipedia.feed.continuereading.ContinueReadingClient;
 import org.wikipedia.feed.demo.IntegerListClient;
@@ -20,6 +21,7 @@
 // hard-coded list of card types to load when continuing the feed
 addPendingClient(new BecauseYouReadClient(site));
 addPendingClient(new ContinueReadingClient());
+addPendingClient(new AggregatedFeedContentClient());
 addPendingClient(new IntegerListClient());
 
 }
diff --git a/app/src/main/java/org/wikipedia/feed/UtcDate.java 
b/app/src/main/java/org/wikipedia/feed/UtcDate.java
new file mode 100644
index 000..3a6bfea
--- /dev/null
+++ b/app/src/main/java/org/wikipedia/feed/UtcDate.java
@@ -0,0 +1,49 @@
+package org.wikipedia.feed;
+
+import android.support.annotation.NonNull;
+
+import java.util.Calendar;
+
+import static java.util.TimeZone.getTimeZone;
+
+public class UtcDate {
+@NonNull private Calendar cal;
+@NonNull private String year;
+@NonNull private String month;
+@NonNull private String date;
+
+public UtcDate(int age) {
+this.cal = Calendar.getInstance(getTimeZone("UTC"));
+cal.add(Calendar.DATE, -age);
+this.year = Integer.toString(cal.get(Calendar.YEAR));
+this.month = pad(Integer.toString(cal.get(Calendar.MONTH) + 1));
+this.date = pad(Integer.toString(cal.get(Calendar.DATE)));
+}
+
+@NonNull
+public Calendar baseCalendar() {
+return cal;
+}
+
+@NonNull
+public String year() {
+return year;
+}
+
+@NonNull
+public String month() {
+return month;
+}
+
+@NonNull
+public String date() {
+return date;
+}
+
+private String pad(String value) {
+if (value.length() == 1) {
+return "0" + value;
+}
+return value;
+}
+}
diff --git 

  1   2   3   4   >