[MediaWiki-commits] [Gerrit] Fix error handling in File::createThumb. - change (mediawiki/core)

2013-12-13 Thread Brian Wolff (Code Review)
Brian Wolff has uploaded a new change for review.

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


Change subject: Fix error handling in File::createThumb.
..

Fix error handling in File::createThumb.

Was checking for null, but transform always returns either
false or an object.

createThumb isn't used in core, but some extensions use it.

Bug: 58436
Change-Id: Icaf5088a193dc1d9b9c365f92722bef1f9c1dba6
---
M includes/filerepo/file/File.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/79/101179/1

diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php
index 1c9d8aa..dc35016 100644
--- a/includes/filerepo/file/File.php
+++ b/includes/filerepo/file/File.php
@@ -904,7 +904,7 @@
$params['height'] = $height;
}
$thumb = $this-transform( $params );
-   if ( is_null( $thumb ) || $thumb-isError() ) {
+   if ( !$thumb || $thumb-isError() ) {
return '';
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icaf5088a193dc1d9b9c365f92722bef1f9c1dba6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff bawolff...@gmail.com

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


[MediaWiki-commits] [Gerrit] Fix getLongDesc if tif file is invalid or has invalid metadata - change (mediawiki...PagedTiffHandler)

2013-12-13 Thread Brian Wolff (Code Review)
Brian Wolff has uploaded a new change for review.

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


Change subject: Fix getLongDesc if tif file is invalid or has invalid metadata
..

Fix getLongDesc if tif file is invalid or has invalid metadata

Previously it was displaying as (1) i.e. the value true cast to
a string surounded by parenthesis, which was rather odd. Most
sane thing to do (imho) is just use the generic getLongDesc
from the parent class.

Change-Id: I8c7c8874c1caa6637d51907c4053dc9c4ecf10e3
---
M PagedTiffHandler_body.php
1 file changed, 4 insertions(+), 2 deletions(-)


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

diff --git a/PagedTiffHandler_body.php b/PagedTiffHandler_body.php
index c8a5eec..8b8734e 100644
--- a/PagedTiffHandler_body.php
+++ b/PagedTiffHandler_body.php
@@ -543,9 +543,11 @@
-params( $params['size'], $params['mime'] )
-numParams( $params['page_count'] )
-parse();
+   } else {
+   // If we have no metadata, we have no idea how many 
pages we
+   // have, so just fallback to the parent class.
+   return parent::getLongDesc( $image );
}
-
-   return true;
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c7c8874c1caa6637d51907c4053dc9c4ecf10e3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PagedTiffHandler
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff bawolff...@gmail.com

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


[MediaWiki-commits] [Gerrit] access to pdf1, 2, 3 for mwalker, rt #6468 - change (operations/puppet)

2013-12-13 Thread ArielGlenn (Code Review)
ArielGlenn has uploaded a new change for review.

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


Change subject: access to pdf1,2,3 for mwalker, rt #6468
..

access to pdf1,2,3 for mwalker, rt #6468

Change-Id: I18452f9efd1751876672d052db5093a6b7e8a323
---
M manifests/site.pp
1 file changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/81/101181/1

diff --git a/manifests/site.pp b/manifests/site.pp
index 057cf87..8dac784 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2216,7 +2216,8 @@
 
 include role::pdf,
 groups::wikidev,
-accounts::file_mover
+accounts::file_mover,
+accounts::mwalker #rt 6468
 }
 
 node pdf2.wikimedia.org {
@@ -2225,7 +2226,8 @@
 
 include role::pdf,
 groups::wikidev,
-accounts::file_mover
+accounts::file_mover,
+accounts::mwalker #rt 6468
 }
 
 node pdf3.wikimedia.org {
@@ -2233,7 +2235,8 @@
 
 include role::pdf,
 groups::wikidev,
-accounts::file_mover
+accounts::file_mover,
+accounts::mwalker #rt 6468
 }
 
 node professor.pmtpa.wmnet {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I18452f9efd1751876672d052db5093a6b7e8a323
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn ar...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] access to pdf1, 2, 3 for mwalker, rt #6468 - change (operations/puppet)

2013-12-13 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged.

Change subject: access to pdf1,2,3 for mwalker, rt #6468
..


access to pdf1,2,3 for mwalker, rt #6468

Change-Id: I18452f9efd1751876672d052db5093a6b7e8a323
---
M manifests/site.pp
1 file changed, 6 insertions(+), 3 deletions(-)

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



diff --git a/manifests/site.pp b/manifests/site.pp
index 057cf87..8dac784 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2216,7 +2216,8 @@
 
 include role::pdf,
 groups::wikidev,
-accounts::file_mover
+accounts::file_mover,
+accounts::mwalker #rt 6468
 }
 
 node pdf2.wikimedia.org {
@@ -2225,7 +2226,8 @@
 
 include role::pdf,
 groups::wikidev,
-accounts::file_mover
+accounts::file_mover,
+accounts::mwalker #rt 6468
 }
 
 node pdf3.wikimedia.org {
@@ -2233,7 +2235,8 @@
 
 include role::pdf,
 groups::wikidev,
-accounts::file_mover
+accounts::file_mover,
+accounts::mwalker #rt 6468
 }
 
 node professor.pmtpa.wmnet {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I18452f9efd1751876672d052db5093a6b7e8a323
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn ar...@wikimedia.org
Gerrit-Reviewer: ArielGlenn ar...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Migrate to new install-server module - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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


Change subject: Migrate to new install-server module
..

Migrate to new install-server module

carbon and brewster just migrate to the new role class, the rest use the
newly introduced role::install-server::tftp-server

Change-Id: I83f58e73a24eaf46fbdc48c4c1e23108e8d44e27
---
M manifests/role/install-server.pp
M manifests/site.pp
2 files changed, 36 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/82/101182/1

diff --git a/manifests/role/install-server.pp b/manifests/role/install-server.pp
index 6a34b81..4f4b03c 100644
--- a/manifests/role/install-server.pp
+++ b/manifests/role/install-server.pp
@@ -69,3 +69,35 @@
 check_command = 'check_http',
 }
 }
+
+# Class: role::install-server::tftp-server
+#
+# A WMF role class used to install all the install-server TFTP stuff
+#
+# Parameters:
+#
+# Actions:
+#   Install and configure all needed software to have an installation 
server
+#   TFTP server ready
+#
+# Requires:
+#
+#   Class['install-server::tftp-server']
+#   Class['ferm']
+#   Define['ferm::rule']
+#
+# Sample Usage:
+#   include role::install-server::tftp-server
+
+class role::install-server::tftp-server {
+system::role { 'role::install-server::tftp-server':
+description = 'WMF TFTP server',
+}
+
+include ferm
+include install-server::tftp-server
+
+ferm::rule { 'tftp':
+rule = 'proto tcp dport tftp { saddr $ALL_NETWORKS ACCEPT; }'
+}
+}
diff --git a/manifests/site.pp b/manifests/site.pp
index 8dac784..3145db3 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -290,7 +290,7 @@
 include standard,
 admins::roots,
 misc::management::ipmi,
-misc::install-server::tftp-server
+role::install-server::tftp-server
 
 }
 
@@ -307,7 +307,7 @@
 $tftpboot_server_type = 'master'
 
 include standard,
-misc::install-server,
+role::install-server,
 backup::client
 
 # set up brewster to use haproxy to proxy puppet
@@ -337,7 +337,7 @@
 
 include standard,
 backup::client,
-misc::install-server::tftp-server
+role::install-server
 }
 
 # cerium,praseodymium, ruthenium and xenon are cassandra test host
@@ -1135,7 +1135,7 @@
 $domain_search = esams.wikimedia.org wikimedia.org esams.wmnet
 
 include standard,
-misc::install-server::tftp-server,
+role::install-server::tftp-server,
 admins::roots,
 admins::mortals,
 admins::restricted

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83f58e73a24eaf46fbdc48c4c1e23108e8d44e27
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Migrate to new install-server module - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Migrate to new install-server module
..


Migrate to new install-server module

carbon and brewster just migrate to the new role class, the rest use the
newly introduced role::install-server::tftp-server

Change-Id: I83f58e73a24eaf46fbdc48c4c1e23108e8d44e27
---
M manifests/role/install-server.pp
M manifests/site.pp
2 files changed, 36 insertions(+), 4 deletions(-)

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



diff --git a/manifests/role/install-server.pp b/manifests/role/install-server.pp
index 6a34b81..4f4b03c 100644
--- a/manifests/role/install-server.pp
+++ b/manifests/role/install-server.pp
@@ -69,3 +69,35 @@
 check_command = 'check_http',
 }
 }
+
+# Class: role::install-server::tftp-server
+#
+# A WMF role class used to install all the install-server TFTP stuff
+#
+# Parameters:
+#
+# Actions:
+#   Install and configure all needed software to have an installation 
server
+#   TFTP server ready
+#
+# Requires:
+#
+#   Class['install-server::tftp-server']
+#   Class['ferm']
+#   Define['ferm::rule']
+#
+# Sample Usage:
+#   include role::install-server::tftp-server
+
+class role::install-server::tftp-server {
+system::role { 'role::install-server::tftp-server':
+description = 'WMF TFTP server',
+}
+
+include ferm
+include install-server::tftp-server
+
+ferm::rule { 'tftp':
+rule = 'proto tcp dport tftp { saddr $ALL_NETWORKS ACCEPT; }'
+}
+}
diff --git a/manifests/site.pp b/manifests/site.pp
index 8dac784..3145db3 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -290,7 +290,7 @@
 include standard,
 admins::roots,
 misc::management::ipmi,
-misc::install-server::tftp-server
+role::install-server::tftp-server
 
 }
 
@@ -307,7 +307,7 @@
 $tftpboot_server_type = 'master'
 
 include standard,
-misc::install-server,
+role::install-server,
 backup::client
 
 # set up brewster to use haproxy to proxy puppet
@@ -337,7 +337,7 @@
 
 include standard,
 backup::client,
-misc::install-server::tftp-server
+role::install-server
 }
 
 # cerium,praseodymium, ruthenium and xenon are cassandra test host
@@ -1135,7 +1135,7 @@
 $domain_search = esams.wikimedia.org wikimedia.org esams.wmnet
 
 include standard,
-misc::install-server::tftp-server,
+role::install-server::tftp-server,
 admins::roots,
 admins::mortals,
 admins::restricted

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I83f58e73a24eaf46fbdc48c4c1e23108e8d44e27
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Add i18n file - change (mediawiki...PageTools)

2013-12-13 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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


Change subject: Add i18n file
..

Add i18n file

Change-Id: I0d5e0a5c0bda8a605a1a77cb5102986a47fe1113
---
A PageTools.i18n.php
M PageTools.php
2 files changed, 45 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageTools 
refs/changes/83/101183/1

diff --git a/PageTools.i18n.php b/PageTools.i18n.php
new file mode 100644
index 000..0510680
--- /dev/null
+++ b/PageTools.i18n.php
@@ -0,0 +1,42 @@
+?php
+/**
+ * The i18n file of the PageTools extension
+ *
+ * @copyright (C) 2013, Jean-Lou Dupont, Stephan Gambke
+ * @license   http://www.gnu.org/licenses/gpl-3.0.html GNU General Public 
License, version 3 (or later)
+ *
+ * This file is part of the MediaWiki extension PageTools.
+ * The PageTools extension 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.
+ *
+ * The PageTools extension 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 http://www.gnu.org/licenses/.
+ *
+ * @file
+ * @ingroup   PageTools
+ */
+
+$messages = array();
+
+/**
+ * English
+ * @author Jean-Lou Dupont
+ * @author Stephan Gambke
+ */
+$messages['en'] = array(
+   'pagetools-desc' = 'Parser functions for handling of category 
information, page title and page subtitle',
+);
+
+/** Message documentation (Message documentation)
+ * @author Raimond Spekking
+ */
+$messages['qqq'] = array(
+   'pagetools-desc' = '{{desc|name=Page 
Tools|url=https://www.mediawiki.org/wiki/Extension:PageTools}}',
+);
diff --git a/PageTools.php b/PageTools.php
index 6c501eb..29b825c 100644
--- a/PageTools.php
+++ b/PageTools.php
@@ -69,10 +69,11 @@
'author'  = array( '[http://www.mediawiki.org/wiki/User:Jldupont 
Jean-Lou Dupont]', '[http://www.mediawiki.org/wiki/User:F.trott Stephan 
Gambke]' ),
'version' = PT_VERSION,
'url' = 'https://www.mediawiki.org/wiki/Extension:PageTools',
-   'description' = 'Parser functions for handling of category 
information, page title and page subtitle',
+   'descriptionmsg' = 'pagetools-desc',
 );
 
-$wgAutoloadClasses[ 'PageTools' ] = dirname( __FILE__ ) . 
'/PageTools.class.php';
+$wgExtensionMessagesFiles['PageTools'] = __DIR__ . '/PageTools.i18n.php';
+$wgAutoloadClasses[ 'PageTools' ] = __DIR__ . '/PageTools.class.php';
 
 // Specify the function that will initialize the parser functions
 $wgHooks[ 'ParserFirstCallInit' ][ ] = 'PageToolsSetupParserFunction';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0d5e0a5c0bda8a605a1a77cb5102986a47fe1113
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTools
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com

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


[MediaWiki-commits] [Gerrit] Fix group Database tests which derived from PHPUnit_Framewor... - change (mediawiki...Wikibase)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix group Database tests which derived from 
PHPUnit_Framework_TestCase
..


Fix group Database tests which derived from PHPUnit_Framework_TestCase

@group Database only works with MediaWikiTestCase as parent.
Removed @group Database from WikibaseClientTest as that doesn't
use the Database as far as I can tell.

Change-Id: I0c485aa7e7ec1259a6210d6a0bf94de904e6a112
---
M client/tests/phpunit/includes/ReferencedPagesFinderTest.php
M client/tests/phpunit/includes/WikibaseClientTest.php
M lib/tests/phpunit/SnakFactoryTest.php
3 files changed, 4 insertions(+), 5 deletions(-)

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



diff --git a/client/tests/phpunit/includes/ReferencedPagesFinderTest.php 
b/client/tests/phpunit/includes/ReferencedPagesFinderTest.php
index cd8dc44..aec2550 100644
--- a/client/tests/phpunit/includes/ReferencedPagesFinderTest.php
+++ b/client/tests/phpunit/includes/ReferencedPagesFinderTest.php
@@ -24,7 +24,7 @@
  * @licence GNU GPL v2+
  * @author Katie Filbert  aude.w...@gmail.com 
  */
-class ReferencedPagesFinderTest extends \PHPUnit_Framework_TestCase {
+class ReferencedPagesFinderTest extends \MediaWikiTestCase {
 
static protected $titles;
 
diff --git a/client/tests/phpunit/includes/WikibaseClientTest.php 
b/client/tests/phpunit/includes/WikibaseClientTest.php
index 87d2897..e52b46b 100644
--- a/client/tests/phpunit/includes/WikibaseClientTest.php
+++ b/client/tests/phpunit/includes/WikibaseClientTest.php
@@ -18,9 +18,6 @@
  * @group WikibaseClient
  * @group WikibaseClientTest
  *
- * @group Database
- *^ needed because we rely on Title objects internally
- *
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw  jeroended...@gmail.com 
  * @author Daniel Kinzler
diff --git a/lib/tests/phpunit/SnakFactoryTest.php 
b/lib/tests/phpunit/SnakFactoryTest.php
index 1d213c5..3d56316 100644
--- a/lib/tests/phpunit/SnakFactoryTest.php
+++ b/lib/tests/phpunit/SnakFactoryTest.php
@@ -22,9 +22,11 @@
  * @license GPL 2+
  * @author Daniel Kinzler
  */
-class SnakFactoryTest extends \PHPUnit_Framework_TestCase {
+class SnakFactoryTest extends \MediaWikiTestCase {
 
public function setUp() {
+   parent::setUp();
+
static $isInitialized = false;
 
if ( !class_exists( 'Wikibase\PropertyContent' ) ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0c485aa7e7ec1259a6210d6a0bf94de904e6a112
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man h...@online.de
Gerrit-Reviewer: Addshore addshorew...@gmail.com
Gerrit-Reviewer: Aude aude.w...@gmail.com
Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] On stash page, force helper links to open in new tab - change (mediawiki...Translate)

2013-12-13 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review.

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


Change subject: On stash page, force helper links to open in new tab
..

On stash page, force helper links to open in new tab

Also added documentation for the constructor params

Change-Id: I64f5cf88e532d53f93c6fb07a0bdd6c578d1191c
---
M resources/js/ext.translate.editor.js
M resources/js/ext.translate.special.translationstash.js
2 files changed, 18 insertions(+), 3 deletions(-)


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

diff --git a/resources/js/ext.translate.editor.js 
b/resources/js/ext.translate.editor.js
index 27fbe7f..cb20c39 100644
--- a/resources/js/ext.translate.editor.js
+++ b/resources/js/ext.translate.editor.js
@@ -11,9 +11,9 @@
 * but it is independent of messagetable.
 * Example usage:
 *
-* $( 'div.messageRow' ).translateeditor( {
-*  message: messageObject // Mandatory message object
-* } );
+* $( 'div.messageRow' ).translateeditor( {
+* message: messageObject // Mandatory message object
+* } );
 *
 * Assumptions: The jquery element to which translateeditor is applied 
will
 * internally contain the editor's generated UI. So it is going to have 
the same width
@@ -22,6 +22,14 @@
 * mandatory, but if found, when editor is opened the message item will 
be hidden
 * and the editor will appear as if the message is replaced by the 
editor.
 * See the UI of Translate messagetable for demo.
+* @param {HTMLElement} element
+* @param {Object} options
+* @param {Function} [options.beforeSave] Callback to call when 
translation is going to be saved.
+* @param {Function} [options.onReady] Callback to call when the editor 
is ready.
+* @param {Function} [options.onSave] Callback to call when translation 
has been saved.
+* @param {Function} [options.onSkip] Callback to call when a message 
is skipped.
+* @param {Object} options.message Object as returned by 
messagecollection api.
+* @param {TranslationApiStorage} [options.storage]
 */
function TranslateEditor( element, options ) {
this.$editTrigger = $( element );
diff --git a/resources/js/ext.translate.special.translationstash.js 
b/resources/js/ext.translate.special.translationstash.js
index 25da3c6..9aa4c81 100644
--- a/resources/js/ext.translate.special.translationstash.js
+++ b/resources/js/ext.translate.special.translationstash.js
@@ -191,6 +191,13 @@
var $messageTable = $( '.tux-messagelist' ),
$ulsTrigger = $( '.ext-translate-language-selector  
.uls' );
 
+   // Some links in helpers will navigate away by default. But 
since the messages
+   // will change on this page on every load, we want to avoid 
that. Force the
+   // links to open on new window/tab.
+   mw.translateHooks.add( 'showTranslationHelpers', function ( 
helpers, $editor ) {
+   $editor.find( 'a' ).prop( 'target', '_blank' );
+   } );
+
$ulsTrigger.uls( {
onSelect: function ( language ) {
var direction = $.uls.data.getDir( language ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I64f5cf88e532d53f93c6fb07a0bdd6c578d1191c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com

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


[MediaWiki-commits] [Gerrit] Style cleanup in scribunto code - change (mediawiki...Wikibase)

2013-12-13 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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


Change subject: Style cleanup in scribunto code
..

Style cleanup in scribunto code

Change-Id: Ia62819507fde9d576335353be8053e1d5a89ea2c
---
A client/includes/WikibaseLibrary.php
M client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php
2 files changed, 152 insertions(+), 1 deletion(-)


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

diff --git a/client/includes/WikibaseLibrary.php 
b/client/includes/WikibaseLibrary.php
new file mode 100644
index 000..3fda3f2
--- /dev/null
+++ b/client/includes/WikibaseLibrary.php
@@ -0,0 +1,146 @@
+?php
+
+use ValueParsers\ParseException;
+use Wikibase\Client\WikibaseClient;
+use Wikibase\Lib\Serializers\SerializationOptions;
+use Wikibase\Lib\Serializers\SerializerFactory;
+use Wikibase\LanguageFallbackChainFactory;
+use Wikibase\Utils;
+
+/**
+ * Registers and defines functions to access Wikibase through the Scribunto 
extension
+ *
+ * @since 0.4
+ *
+ * @licence GNU GPL v2+
+ * @author Jens Ohlig  jens.oh...@wikimedia.de 
+ */
+
+class Scribunto_LuaWikibaseLibrary extends Scribunto_LuaLibraryBase {
+
+   /**
+* Register mw.wikibase.lua library
+*
+* @since 0.4
+*/
+   public function register() {
+   $lib = array(
+   'getEntity' = array( $this, 'getEntity' ),
+   'getEntityId' = array( $this, 'getEntityId' ),
+   'getGlobalSiteId' = array( $this, 'getGlobalSiteId' )
+   );
+   $this-getEngine()-registerInterface( dirname( __FILE__ ) . 
'/../resources/' . 'mw.wikibase.lua', $lib, array() );
+   }
+
+   /**
+* Get entity from prefixed ID (e.g. Q23) and return it as serialized 
array.
+*
+* @since 0.4
+*
+* @param string $prefixedEntityId
+*
+* @throws ScribuntoException
+* @return array $entityArr
+*/
+   public function getEntity( $prefixedEntityId = null ) {
+   echo __METHOD__;
+   $this-checkType( 'getEntity', 1, $prefixedEntityId, 'string' );
+   $prefixedEntityId = trim( $prefixedEntityId );
+   echo $prefixedEntityId;
+   wfDebugLog( 'wikidata', var_export( $prefixedEntityId, true ) );
+   $entityIdParser = 
WikibaseClient::getDefaultInstance()-getEntityIdParser();
+
+   try {
+   $entityId = $entityIdParser-parse( $prefixedEntityId );
+   }
+   catch ( ParseException $parseException ) {
+   wfDebugLog( 'wikidata', 'invalid id' );
+   throw $this-getEngine()-newException( 
'wikibase-error-invalid-entity-id' );
+   }
+
+   $entityObject = 
WikibaseClient::getDefaultInstance()-getStore()-getEntityLookup()-getEntity(
+   $entityId
+   );
+
+   wfDebugLog( 'wikidata', var_export( $entityObject, true ) );
+
+   if ( $entityObject == null ) {
+   return array( null );
+   }
+
+   $opt = new SerializationOptions();
+   $serializerFactory = new SerializerFactory( $opt );
+
+   // Using ID_KEYS_BOTH here means that all lists of Snaks or 
Claims will be listed
+   // twice, once with a lower case key and once with an upper 
case key.
+   // This is a B/C hack to allow existing lua code to use 
hardcoded IDs
+   // in both lower (legacy) and upper case.
+   $opt-setIdKeyMode( SerializationOptions::ID_KEYS_BOTH );
+
+   // This is $wgContLang, not parser target language or anything 
else.
+   // See Scribunto_LuaLanguageLibrary::getContLangCode().
+   global $wgContLang;
+
+   // See mw.wikibase.lua. This is the only way to inject values 
into mw.wikibase.label( ),
+   // so any customized Lua modules can access labels of another 
entity written in another variant,
+   // unless we give them the ability to getEntity() any entity by 
specifying its ID, not just self.
+   $chain = 
WikibaseClient::getDefaultInstance()-getLanguageFallbackChainFactory()-newFromLanguage(
+   $wgContLang, 
LanguageFallbackChainFactory::FALLBACK_SELF | 
LanguageFallbackChainFactory::FALLBACK_VARIANTS
+   );
+   // SerializationOptions accepts mixed types of keys happily.
+   $opt-setLanguages( Utils::getLanguageCodes() + array( 
$wgContLang-getCode() = $chain ) );
+
+   $serializer = $serializerFactory-newSerializerForObject( 
$entityObject, $opt );
+
+   try {
+   $entityArr = $serializer-getSerialized( $entityObject 
);
+ 

[MediaWiki-commits] [Gerrit] Make it possible to run tests on Cloudbees using PhantomJS - change (mediawiki/selenium)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Make it possible to run tests on Cloudbees using PhantomJS
..


Make it possible to run tests on Cloudbees using PhantomJS

Bug: 58035
Change-Id: I66a0b51646cfa1c7cde43b3d9a9a4af0d93b74e6
---
M docs/job.md
M docs/template.md
M lib/mediawiki/selenium/env.rb
3 files changed, 10 insertions(+), 4 deletions(-)

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



diff --git a/docs/job.md b/docs/job.md
index 591fd92..5d595e4 100644
--- a/docs/job.md
+++ b/docs/job.md
@@ -11,16 +11,20 @@
 
 --
 
-export BROWSER_LABEL=(label)
-export MEDIAWIKI_URL=(url)
+export MEDIAWIKI_USER=${MEDIAWIKI_USER}
+export MEDIAWIKI_PASSWORD_VARIABLE=${MEDIAWIKI_PASSWORD_VARIABLE}
+
+export BROWSER_LABEL=${BROWSER_LABEL}
+export MEDIAWIKI_URL=http://${MEDIAWIKI_URL}/wiki/
 
 curl -s -o use-ruby 
https://repository-cloudbees.forge.cloudbees.com/distributions/ci-addons/ruby/use-ruby
 RUBY_VERSION=2.0.0-p247 \
   source ./use-ruby
 
 gem install bundler --no-ri --no-rdoc
+if [ -d ${FOLDER} ]; then cd ${FOLDER}; fi
 bundle install
-bundle exec cucumber
+bundle exec ${BUNDLE_EXEC}
 
 --
 
diff --git a/docs/template.md b/docs/template.md
index 7958822..c704ae6 100644
--- a/docs/template.md
+++ b/docs/template.md
@@ -30,6 +30,7 @@
 - internet_explorer_8
 - internet_explorer_9
 - internet_explorer_10
+- phantomjs
 
 ## bundle exec
 
diff --git a/lib/mediawiki/selenium/env.rb b/lib/mediawiki/selenium/env.rb
index 1d4f90d..e6a2f1a 100644
--- a/lib/mediawiki/selenium/env.rb
+++ b/lib/mediawiki/selenium/env.rb
@@ -27,7 +27,8 @@
   end
 end
 def environment
-  if ENV[BROWSER_LABEL] and ENV[SAUCE_ONDEMAND_USERNAME] and 
ENV[SAUCE_ONDEMAND_ACCESS_KEY]
+  if ENV[BROWSER_LABEL] and ENV[BROWSER_LABEL] != phantomjs and
+  ENV[SAUCE_ONDEMAND_USERNAME] and ENV[SAUCE_ONDEMAND_ACCESS_KEY]
 :saucelabs
   else
 :local

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I66a0b51646cfa1c7cde43b3d9a9a4af0d93b74e6
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/selenium
Gerrit-Branch: master
Gerrit-Owner: Zfilipin zfili...@wikimedia.org
Gerrit-Reviewer: Amire80 amir.ahar...@mail.huji.ac.il
Gerrit-Reviewer: Cmcmahon cmcma...@wikimedia.org
Gerrit-Reviewer: Hashar has...@free.fr
Gerrit-Reviewer: Jhall jh...@wikimedia.org
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: Zfilipin zfili...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Show view translations for anon and sandboxed users - change (mediawiki...TwnMainPage)

2013-12-13 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review.

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


Change subject: Show view translations for anon and sandboxed users
..

Show view translations for anon and sandboxed users

Also correct the message keys used for the links in the project tiles.

Change-Id: If8e44a8a18e752dfae1029a38299cce38a3ecd41
---
M MainPage.i18n.php
M specials/SpecialTwnMainPage.php
2 files changed, 43 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TwnMainPage 
refs/changes/86/101186/1

diff --git a/MainPage.i18n.php b/MainPage.i18n.php
index 2e17b11..87e33ca 100644
--- a/MainPage.i18n.php
+++ b/MainPage.i18n.php
@@ -32,9 +32,10 @@
'twnmp-search-choose-project' = 'Choose a project to translate',
'twnmp-translate-link' = 'Translate',
'twnmp-proofread-link' = 'Review',
+   'twnmp-view-link' = 'View translations',
'twnmp-translate-button' = 'Translate',
-   'twnmp-view-button' = 'View translations',
'twnmp-proofread-button' = 'Review',
+   'twnmp-view-button' = 'View translations',
 
'twnmp-your-translations-stats' = 'Your translation statistics',
'twnmp-your-translations-stats-all-languages' = 'For all languages',
@@ -132,6 +133,8 @@
 {{Identical|Translate}}',
'twnmp-proofread-link' = 'A link that appears at the bottom of a box 
with the project icon near {{msg-mw|twnmp-translate-link}}.
 {{Identical|Review}}',
+   'twnmp-view-link' = 'A link that appears at the bottom of a box with 
the project icon.
+{{Identical|View translation}}',
'twnmp-translate-button' = A label for the button that appears near 
the user's translation statistics.
 Pressing the button brings the user to the translation editor. Parallel to 
{{msg-mw|twnmp-proofread-button}}.
 {{Identical|Translate}},
diff --git a/specials/SpecialTwnMainPage.php b/specials/SpecialTwnMainPage.php
index bbdf744..1c17112 100644
--- a/specials/SpecialTwnMainPage.php
+++ b/specials/SpecialTwnMainPage.php
@@ -252,16 +252,6 @@
$image = Html::element( 'div', array( 'class' = $class ) );
$label = htmlspecialchars( $group-getLabel( 
$this-getContext() ) );
 
-   $title = SpecialPage::getTitleFor( 'Translate' );
-   $translate = Html::element( 'a', array(
-   'class' = 'translate',
-   'href' = $title-getLocalUrl( array( 'group' = $id ) )
-   ), $this-msg( 'twnmp-translate-button' )-text() );
-
-   $proofread = Html::element( 'a', array(
-   'class' = 'proofread',
-   'href' = $title-getLocalUrl( array( 'group' = $id, 
'action' = 'proofread' ) )
-   ), $this-msg( 'twnmp-proofread-button' )-text() );
$msggroupid = htmlspecialchars( $id );
$out = HTML
 div class=three columns twn-mainpage-project-tile
@@ -277,8 +267,7 @@
/div
/div
div class=row project-actions hide
-   div class=six columns action$translate/div
-   div class=six columns action$proofread/div
+   {$this-getProjectActions( $id )}
/div
/div
 /div
@@ -287,6 +276,44 @@
return $out;
}
 
+   /**
+* @param string $id Message group id
+* @return string HTML
+*/
+   protected function getProjectActions( $id ) {
+   $user = $this-getUser();
+   $title = SpecialPage::getTitleFor( 'Translate' );
+
+   $view = Html::element( 'a', array(
+   'class' = 'translate',
+   'href' = $title-getLocalUrl( array( 'group' = $id ) )
+   ), $this-msg( 'twnmp-view-link' )-text() );
+
+   $translate = Html::element( 'a', array(
+   'class' = 'translate',
+   'href' = $title-getLocalUrl( array( 'group' = $id ) )
+   ), $this-msg( 'twnmp-translate-link' )-text() );
+
+   $proofread = Html::element( 'a', array(
+   'class' = 'proofread',
+   'href' = $title-getLocalUrl( array( 'group' = $id, 
'action' = 'proofread' ) )
+   ), $this-msg( 'twnmp-proofread-link' )-text() );
+
+   if ( $user-isAnon() || TranslateSandbox::isSandboxed( $user ) 
) {
+   return HTML
+div class=twelve columns action$view/div
+
+HTML;
+
+   } else {
+   return HTML
+div class=six columns action$translate/div
+div class=six columns action$proofread/div
+
+HTML;
+   }
+   }
+
public function banner() {
global $wgMainPageImages;
 

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

[MediaWiki-commits] [Gerrit] Adding install-server::ubuntu-mirror class - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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


Change subject: Adding install-server::ubuntu-mirror class
..

Adding install-server::ubuntu-mirror class

Adding forgotten ubuntu-mirror class. Add tests and rspec tests for the
new class. Reorganize a bit the role class so that a needed user is
created before the ubuntu-mirror class is realized
In the process also rename role::install-server classes to
role::installserver to avoid any potential scoping problems

Change-Id: I382cb74b3405289613dd62481934e6d215618d73
---
M manifests/role/install-server.pp
M manifests/site.pp
R modules/install-server/files/update-ubuntu-mirror
A modules/install-server/manifests/ubuntu-mirror.pp
A modules/install-server/spec/classes/install_server_ubuntu_mirror_spec.rb
A modules/install-server/tests/ubuntu-mirror.pp
6 files changed, 92 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/87/101187/1

diff --git a/manifests/role/install-server.pp b/manifests/role/install-server.pp
index 4f4b03c..c315a92 100644
--- a/manifests/role/install-server.pp
+++ b/manifests/role/install-server.pp
@@ -1,4 +1,4 @@
-# Class: role::install-server
+# Class: role::installserver
 #
 # A WMF role class used to install all the install-server stuff
 #
@@ -23,9 +23,9 @@
 #   Define['apt::pin']
 #
 # Sample Usage:
-#   include role::install-server
+#   include role::installserver
 
-class role::install-server {
+class role::installserver {
 system::role { 'role::install-server':
 description = 'WMF Install server. APT repo, Forward Caching, TFTP, \
 DHCP and Web server',
@@ -40,6 +40,13 @@
 include install-server::caching-proxy
 include install-server::web-server
 include install-server::dhcp-server
+
+# System user and group for mirroring
+generic::systemuser { 'mirror':
+name = 'mirror',
+home = '/var/lib/mirror',
+before = Class['install-server::ubuntu-mirror'],
+}
 
 # Backup
 $sets = [ 'srv-autoinstall',
@@ -87,9 +94,9 @@
 #   Define['ferm::rule']
 #
 # Sample Usage:
-#   include role::install-server::tftp-server
+#   include role::installserver::tftp-server
 
-class role::install-server::tftp-server {
+class role::installserver::tftp-server {
 system::role { 'role::install-server::tftp-server':
 description = 'WMF TFTP server',
 }
diff --git a/manifests/site.pp b/manifests/site.pp
index 3145db3..75cd4ac 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -290,7 +290,7 @@
 include standard,
 admins::roots,
 misc::management::ipmi,
-role::install-server::tftp-server
+role::installserver::tftp-server
 
 }
 
@@ -307,7 +307,7 @@
 $tftpboot_server_type = 'master'
 
 include standard,
-role::install-server,
+role::installserver,
 backup::client
 
 # set up brewster to use haproxy to proxy puppet
@@ -337,7 +337,7 @@
 
 include standard,
 backup::client,
-role::install-server
+role::installserver
 }
 
 # cerium,praseodymium, ruthenium and xenon are cassandra test host
@@ -1135,7 +1135,7 @@
 $domain_search = esams.wikimedia.org wikimedia.org esams.wmnet
 
 include standard,
-role::install-server::tftp-server,
+role::installserver::tftp-server,
 admins::roots,
 admins::mortals,
 admins::restricted
diff --git a/files/misc/update-ubuntu-mirror 
b/modules/install-server/files/update-ubuntu-mirror
similarity index 100%
rename from files/misc/update-ubuntu-mirror
rename to modules/install-server/files/update-ubuntu-mirror
diff --git a/modules/install-server/manifests/ubuntu-mirror.pp 
b/modules/install-server/manifests/ubuntu-mirror.pp
new file mode 100644
index 000..fc8d72a
--- /dev/null
+++ b/modules/install-server/manifests/ubuntu-mirror.pp
@@ -0,0 +1,43 @@
+# Class: install-server::ubuntu-mirror
+#
+# This class populates ubuntu-mirror's configuration
+#
+# Parameters:
+#
+# Actions:
+#   Populate ubuntu-mirror configuration directory
+#
+# Requires:
+#
+# Sample Usage:
+#   include install-server::ubuntu-mirror
+
+class install-server::ubuntu-mirror {
+# Top level directory must exist
+file { '/srv/ubuntu/':
+ensure  = directory,
+owner   = 'mirror',
+group   = 'mirror',
+mode= '0755',
+}
+
+# Update script
+file { '/usr/local/sbin/update-ubuntu-mirror':
+ensure  = present,
+owner   = 'root',
+group   = 'root',
+mode= '0555',
+source  = 'puppet:///modules/install-server/update-ubuntu-mirror',
+}
+
+# Mirror update cron entry
+cron { 'update-ubuntu-mirror':
+ensure  = present,
+command = '/usr/local/sbin/update-ubuntu-mirror 1/dev/null 
2/var/lib/mirror/mirror.err.log',
+user= 

[MediaWiki-commits] [Gerrit] Fix covers tags - change (mediawiki...Wikibase)

2013-12-13 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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


Change subject: Fix covers tags
..

Fix covers tags

Change-Id: I86fd84f0a9ef6aaf5d0b3b00138dc7a93b7c0405
---
M client/tests/phpunit/includes/InterwikiSorterTest.php
M 
client/tests/phpunit/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementationTest.php
2 files changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/client/tests/phpunit/includes/InterwikiSorterTest.php 
b/client/tests/phpunit/includes/InterwikiSorterTest.php
index 16c7a62..6d4101f 100644
--- a/client/tests/phpunit/includes/InterwikiSorterTest.php
+++ b/client/tests/phpunit/includes/InterwikiSorterTest.php
@@ -4,7 +4,7 @@
 use Wikibase\InterwikiSorter;
 
 /**
- * @covers Wikibase\InterwikiSorter;
+ * @covers Wikibase\InterwikiSorter
  *
  * @since 0.4
  *
diff --git 
a/client/tests/phpunit/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementationTest.php
 
b/client/tests/phpunit/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementationTest.php
index 51b07bc..4a7c7ca 100644
--- 
a/client/tests/phpunit/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementationTest.php
+++ 
b/client/tests/phpunit/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementationTest.php
@@ -2,12 +2,12 @@
 
 namespace Wikibase\Test;
 
+use Language;
 use Scribunto_LuaWikibaseLibraryImplementation;
 use Wikibase\Client\WikibaseClient;
-use \Language;
 
 /**
- * @covers Wikibase\Scribunto_LuaWikibaseLibraryImplementation
+ * @covers Scribunto_LuaWikibaseLibraryImplementation
  *
  * @since 0.4
  *

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86fd84f0a9ef6aaf5d0b3b00138dc7a93b7c0405
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude aude.w...@gmail.com

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


[MediaWiki-commits] [Gerrit] Nicer Ruby gemset name - change (mediawiki...Wikibase)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Nicer Ruby gemset name
..


Nicer Ruby gemset name

See https://gerrit.wikimedia.org/r/#/c/98823/

Bug: 57100
Change-Id: I3aded7c6060f28ae8058c88139b415bbf87954fb
---
M tests/browser/Gemfile
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/tests/browser/Gemfile b/tests/browser/Gemfile
index 453e36e..373bdd4 100644
--- a/tests/browser/Gemfile
+++ b/tests/browser/Gemfile
@@ -1,5 +1,5 @@
 #ruby=ruby-2.0.0-p247
-#ruby-gemset=Wikibase-selenium_cuc
+#ruby-gemset=Wikibase
 
 source 'https://rubygems.org'
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3aded7c6060f28ae8058c88139b415bbf87954fb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Zfilipin zfili...@wikimedia.org
Gerrit-Reviewer: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Adding install-server::ubuntu-mirror class - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Adding install-server::ubuntu-mirror class
..


Adding install-server::ubuntu-mirror class

Adding forgotten ubuntu-mirror class. Add tests and rspec tests for the
new class. Reorganize a bit the role class so that a needed user is
created before the ubuntu-mirror class is realized
In the process also rename role::install-server classes to
role::installserver to avoid any potential scoping problems

Change-Id: I382cb74b3405289613dd62481934e6d215618d73
---
M manifests/role/install-server.pp
M manifests/site.pp
R modules/install-server/files/update-ubuntu-mirror
A modules/install-server/manifests/ubuntu-mirror.pp
A modules/install-server/spec/classes/install_server_ubuntu_mirror_spec.rb
A modules/install-server/tests/ubuntu-mirror.pp
6 files changed, 92 insertions(+), 9 deletions(-)

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



diff --git a/manifests/role/install-server.pp b/manifests/role/install-server.pp
index 4f4b03c..c315a92 100644
--- a/manifests/role/install-server.pp
+++ b/manifests/role/install-server.pp
@@ -1,4 +1,4 @@
-# Class: role::install-server
+# Class: role::installserver
 #
 # A WMF role class used to install all the install-server stuff
 #
@@ -23,9 +23,9 @@
 #   Define['apt::pin']
 #
 # Sample Usage:
-#   include role::install-server
+#   include role::installserver
 
-class role::install-server {
+class role::installserver {
 system::role { 'role::install-server':
 description = 'WMF Install server. APT repo, Forward Caching, TFTP, \
 DHCP and Web server',
@@ -40,6 +40,13 @@
 include install-server::caching-proxy
 include install-server::web-server
 include install-server::dhcp-server
+
+# System user and group for mirroring
+generic::systemuser { 'mirror':
+name = 'mirror',
+home = '/var/lib/mirror',
+before = Class['install-server::ubuntu-mirror'],
+}
 
 # Backup
 $sets = [ 'srv-autoinstall',
@@ -87,9 +94,9 @@
 #   Define['ferm::rule']
 #
 # Sample Usage:
-#   include role::install-server::tftp-server
+#   include role::installserver::tftp-server
 
-class role::install-server::tftp-server {
+class role::installserver::tftp-server {
 system::role { 'role::install-server::tftp-server':
 description = 'WMF TFTP server',
 }
diff --git a/manifests/site.pp b/manifests/site.pp
index 3145db3..75cd4ac 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -290,7 +290,7 @@
 include standard,
 admins::roots,
 misc::management::ipmi,
-role::install-server::tftp-server
+role::installserver::tftp-server
 
 }
 
@@ -307,7 +307,7 @@
 $tftpboot_server_type = 'master'
 
 include standard,
-role::install-server,
+role::installserver,
 backup::client
 
 # set up brewster to use haproxy to proxy puppet
@@ -337,7 +337,7 @@
 
 include standard,
 backup::client,
-role::install-server
+role::installserver
 }
 
 # cerium,praseodymium, ruthenium and xenon are cassandra test host
@@ -1135,7 +1135,7 @@
 $domain_search = esams.wikimedia.org wikimedia.org esams.wmnet
 
 include standard,
-role::install-server::tftp-server,
+role::installserver::tftp-server,
 admins::roots,
 admins::mortals,
 admins::restricted
diff --git a/files/misc/update-ubuntu-mirror 
b/modules/install-server/files/update-ubuntu-mirror
similarity index 100%
rename from files/misc/update-ubuntu-mirror
rename to modules/install-server/files/update-ubuntu-mirror
diff --git a/modules/install-server/manifests/ubuntu-mirror.pp 
b/modules/install-server/manifests/ubuntu-mirror.pp
new file mode 100644
index 000..fc8d72a
--- /dev/null
+++ b/modules/install-server/manifests/ubuntu-mirror.pp
@@ -0,0 +1,43 @@
+# Class: install-server::ubuntu-mirror
+#
+# This class populates ubuntu-mirror's configuration
+#
+# Parameters:
+#
+# Actions:
+#   Populate ubuntu-mirror configuration directory
+#
+# Requires:
+#
+# Sample Usage:
+#   include install-server::ubuntu-mirror
+
+class install-server::ubuntu-mirror {
+# Top level directory must exist
+file { '/srv/ubuntu/':
+ensure  = directory,
+owner   = 'mirror',
+group   = 'mirror',
+mode= '0755',
+}
+
+# Update script
+file { '/usr/local/sbin/update-ubuntu-mirror':
+ensure  = present,
+owner   = 'root',
+group   = 'root',
+mode= '0555',
+source  = 'puppet:///modules/install-server/update-ubuntu-mirror',
+}
+
+# Mirror update cron entry
+cron { 'update-ubuntu-mirror':
+ensure  = present,
+command = '/usr/local/sbin/update-ubuntu-mirror 1/dev/null 
2/var/lib/mirror/mirror.err.log',
+user= 'mirror',
+hour= '*/6',
+

[MediaWiki-commits] [Gerrit] Fix covers tags - change (mediawiki...Wikibase)

2013-12-13 Thread Addshore (Code Review)
Addshore has submitted this change and it was merged.

Change subject: Fix covers tags
..


Fix covers tags

Change-Id: I86fd84f0a9ef6aaf5d0b3b00138dc7a93b7c0405
---
M client/tests/phpunit/includes/InterwikiSorterTest.php
M 
client/tests/phpunit/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementationTest.php
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Addshore: Looks good to me, approved



diff --git a/client/tests/phpunit/includes/InterwikiSorterTest.php 
b/client/tests/phpunit/includes/InterwikiSorterTest.php
index 16c7a62..6d4101f 100644
--- a/client/tests/phpunit/includes/InterwikiSorterTest.php
+++ b/client/tests/phpunit/includes/InterwikiSorterTest.php
@@ -4,7 +4,7 @@
 use Wikibase\InterwikiSorter;
 
 /**
- * @covers Wikibase\InterwikiSorter;
+ * @covers Wikibase\InterwikiSorter
  *
  * @since 0.4
  *
diff --git 
a/client/tests/phpunit/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementationTest.php
 
b/client/tests/phpunit/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementationTest.php
index 51b07bc..4a7c7ca 100644
--- 
a/client/tests/phpunit/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementationTest.php
+++ 
b/client/tests/phpunit/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementationTest.php
@@ -2,12 +2,12 @@
 
 namespace Wikibase\Test;
 
+use Language;
 use Scribunto_LuaWikibaseLibraryImplementation;
 use Wikibase\Client\WikibaseClient;
-use \Language;
 
 /**
- * @covers Wikibase\Scribunto_LuaWikibaseLibraryImplementation
+ * @covers Scribunto_LuaWikibaseLibraryImplementation
  *
  * @since 0.4
  *

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I86fd84f0a9ef6aaf5d0b3b00138dc7a93b7c0405
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude aude.w...@gmail.com
Gerrit-Reviewer: Addshore addshorew...@gmail.com
Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Add admin links support for sandbox management - change (mediawiki...Translate)

2013-12-13 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review.

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


Change subject: Add admin links support for sandbox management
..

Add admin links support for sandbox management

Change-Id: I08f79f23ad3938e4c4a97298116660f68b3c6cb3
---
M Translate.php
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/89/101189/1

diff --git a/Translate.php b/Translate.php
index c624eb7..2729333 100644
--- a/Translate.php
+++ b/Translate.php
@@ -193,6 +193,18 @@
 $wgHooks['TranslateEventTranslationEdit'][] = 
'MessageGroupStatesUpdaterJob::onChange';
 $wgHooks['TranslateEventTranslationReview'][] = 
'MessageGroupStatesUpdaterJob::onChange';
 
+$wgHooks['AdminLinks'][] = function( $tree ) {
+   global $wgTranslateUseSandbox;
+
+   if ( $wgTranslateUseSandbox ) {
+   $sectionLabel = wfMessage( 'adminlinks_users' )-text();
+   $row = $tree-getSection( $sectionLabel )-getRow( 'main' );
+   $row-addItem( ALItem::newFromSpecialPage( 'TranslateSandbox' ) 
);
+   }
+
+   return true;
+};
+
 // New rights
 $wgAvailableRights[] = 'translate';
 $wgAvailableRights[] = 'translate-import';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I08f79f23ad3938e4c4a97298116660f68b3c6cb3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com

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


[MediaWiki-commits] [Gerrit] Style improvements in Scribunto_LuaWikibaseLibrary - change (mediawiki...Wikibase)

2013-12-13 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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


Change subject: Style improvements in Scribunto_LuaWikibaseLibrary
..

Style improvements in Scribunto_LuaWikibaseLibrary

Change-Id: If5d29bed24b80eccb859f646baa5527840ae18be
---
M client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php
1 file changed, 6 insertions(+), 1 deletion(-)


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

diff --git a/client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php 
b/client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php
index 007d5ef..2d7c373 100644
--- a/client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php
+++ b/client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php
@@ -46,7 +46,12 @@
 * @since 0.4
 */
public function register() {
-   $lib = array( 'getEntity' = array( $this, 'getEntity' ), 
'getEntityId' = array( $this, 'getEntityId' ), 'getGlobalSiteId' = array( 
$this, 'getGlobalSiteId' ) );
+   $lib = array(
+   'getEntity' = array( $this, 'getEntity' ),
+   'getEntityId' = array( $this, 'getEntityId' ),
+   'getGlobalSiteId' = array( $this, 'getGlobalSiteId' )
+   );
+
$this-getEngine()-registerInterface( dirname( __FILE__ ) . 
'/mw.wikibase.lua', $lib, array() );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5d29bed24b80eccb859f646baa5527840ae18be
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude aude.w...@gmail.com

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


[MediaWiki-commits] [Gerrit] Fix ferm rules for install-server, haproxy, backup - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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


Change subject: Fix ferm rules for install-server, haproxy, backup
..

Fix ferm rules for install-server, haproxy, backup

All of these are installed on brewster. So punching holes in the role
class to allow for 80, 8080, 8140 TCP ports and 67 UDP port. In the
process also fix backup rules to use the new defs

Change-Id: I41e2550a2094880821ea667cc24427d9b222a795
---
M manifests/backups.pp
M manifests/role/haproxy.pp
M manifests/role/install-server.pp
3 files changed, 27 insertions(+), 10 deletions(-)


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

diff --git a/manifests/backups.pp b/manifests/backups.pp
index 04e8977..cc522a4 100644
--- a/manifests/backups.pp
+++ b/manifests/backups.pp
@@ -39,7 +39,7 @@
 # TODO: Remove this after #96226 is resolved. It will allow for more
 # fine-grained filtering restricting specifically to director
 ferm::rule { 'bacula':
-rule = 'proto tcp dport 9102 { saddr $INTERNAL ACCEPT; }'
+rule = 'proto tcp dport 9102 { saddr $ALL_NETWORKS ACCEPT; }'
 }
 }
 
diff --git a/manifests/role/haproxy.pp b/manifests/role/haproxy.pp
index 9e5fb62..f0f5b15 100644
--- a/manifests/role/haproxy.pp
+++ b/manifests/role/haproxy.pp
@@ -1,9 +1,13 @@
 class role::puppetproxy {
-
 system::role { 'puppetproxy':
 description = 'Puppet proxying through haproxy host',
 }
 
+include base::firewall
+ferm::rule { 'puppet_haproxy':
+rule = 'proto tcp dport 8140 { saddr $ALL_NETWORKS ACCEPT; }'
+}
+
 class { 'haproxy':
 endpoint_hostname = 'palladium',
 endpoint_ip   = '10.64.16.160',
diff --git a/manifests/role/install-server.pp b/manifests/role/install-server.pp
index c315a92..091459e 100644
--- a/manifests/role/install-server.pp
+++ b/manifests/role/install-server.pp
@@ -18,7 +18,7 @@
 #   Class['install-server::web-server']
 #   Class['install-server::dhcp-server']
 #   Define['backup::set']
-#   Class['ferm']
+#   Class['base::firewall']
 #   Define['ferm::rule']
 #   Define['apt::pin']
 #
@@ -31,15 +31,32 @@
 DHCP and Web server',
 }
 
-include ferm
+include base::firewall
 include backup::host
 include install-server::ubuntu-mirror
 include install-server::apt-repository
 include install-server::preseed-server
+
 include install-server::tftp-server
+ferm::rule { 'tftp':
+rule = 'proto tcp dport tftp { saddr $ALL_NETWORKS ACCEPT; }'
+}
+
 include install-server::caching-proxy
+ferm::rule { 'proxy':
+rule = 'proto tcp dport 8080 { saddr $ALL_NETWORKS ACCEPT; }'
+}
+
 include install-server::web-server
+ferm::service { 'http':
+proto = 'tcp',
+port  = 'http'
+}
+
 include install-server::dhcp-server
+ferm::rule { 'dhcp':
+rule = 'proto udp dport dhcp { saddr $ALL_NETWORKS ACCEPT; }'
+}
 
 # System user and group for mirroring
 generic::systemuser { 'mirror':
@@ -54,10 +71,6 @@
   'srv-wikimedia',
 ]
 backup::set { $sets : }
-
-ferm::rule { 'tftp':
-rule = 'proto tcp dport tftp { saddr $ALL_NETWORKS ACCEPT; }'
-}
 
 # pin package to the default, Ubuntu version, instead of our own
 apt::pin { [ 'squid', 'squid-common', 'squid-langpack' ]:
@@ -90,7 +103,7 @@
 # Requires:
 #
 #   Class['install-server::tftp-server']
-#   Class['ferm']
+#   Class['base::firewall']
 #   Define['ferm::rule']
 #
 # Sample Usage:
@@ -101,7 +114,7 @@
 description = 'WMF TFTP server',
 }
 
-include ferm
+include base::firewall
 include install-server::tftp-server
 
 ferm::rule { 'tftp':

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41e2550a2094880821ea667cc24427d9b222a795
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Style improvements in Scribunto_LuaWikibaseLibrary - change (mediawiki...Wikibase)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Style improvements in Scribunto_LuaWikibaseLibrary
..


Style improvements in Scribunto_LuaWikibaseLibrary

Change-Id: If5d29bed24b80eccb859f646baa5527840ae18be
---
M client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php
1 file changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php 
b/client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php
index 007d5ef..2d7c373 100644
--- a/client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php
+++ b/client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php
@@ -46,7 +46,12 @@
 * @since 0.4
 */
public function register() {
-   $lib = array( 'getEntity' = array( $this, 'getEntity' ), 
'getEntityId' = array( $this, 'getEntityId' ), 'getGlobalSiteId' = array( 
$this, 'getGlobalSiteId' ) );
+   $lib = array(
+   'getEntity' = array( $this, 'getEntity' ),
+   'getEntityId' = array( $this, 'getEntityId' ),
+   'getGlobalSiteId' = array( $this, 'getGlobalSiteId' )
+   );
+
$this-getEngine()-registerInterface( dirname( __FILE__ ) . 
'/mw.wikibase.lua', $lib, array() );
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If5d29bed24b80eccb859f646baa5527840ae18be
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude aude.w...@gmail.com
Gerrit-Reviewer: Addshore addshorew...@gmail.com
Gerrit-Reviewer: Hoo man h...@online.de
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 ferm rules for install-server, haproxy, backup - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Fix ferm rules for install-server, haproxy, backup
..


Fix ferm rules for install-server, haproxy, backup

All of these are installed on brewster. So punching holes in the role
class to allow for 80, 8080, 8140 TCP ports and 67 UDP port. In the
process also fix backup rules to use the new defs

Change-Id: I41e2550a2094880821ea667cc24427d9b222a795
---
M manifests/backups.pp
M manifests/role/haproxy.pp
M manifests/role/install-server.pp
3 files changed, 27 insertions(+), 10 deletions(-)

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



diff --git a/manifests/backups.pp b/manifests/backups.pp
index 04e8977..cc522a4 100644
--- a/manifests/backups.pp
+++ b/manifests/backups.pp
@@ -39,7 +39,7 @@
 # TODO: Remove this after #96226 is resolved. It will allow for more
 # fine-grained filtering restricting specifically to director
 ferm::rule { 'bacula':
-rule = 'proto tcp dport 9102 { saddr $INTERNAL ACCEPT; }'
+rule = 'proto tcp dport 9102 { saddr $ALL_NETWORKS ACCEPT; }'
 }
 }
 
diff --git a/manifests/role/haproxy.pp b/manifests/role/haproxy.pp
index 9e5fb62..f0f5b15 100644
--- a/manifests/role/haproxy.pp
+++ b/manifests/role/haproxy.pp
@@ -1,9 +1,13 @@
 class role::puppetproxy {
-
 system::role { 'puppetproxy':
 description = 'Puppet proxying through haproxy host',
 }
 
+include base::firewall
+ferm::rule { 'puppet_haproxy':
+rule = 'proto tcp dport 8140 { saddr $ALL_NETWORKS ACCEPT; }'
+}
+
 class { 'haproxy':
 endpoint_hostname = 'palladium',
 endpoint_ip   = '10.64.16.160',
diff --git a/manifests/role/install-server.pp b/manifests/role/install-server.pp
index c315a92..091459e 100644
--- a/manifests/role/install-server.pp
+++ b/manifests/role/install-server.pp
@@ -18,7 +18,7 @@
 #   Class['install-server::web-server']
 #   Class['install-server::dhcp-server']
 #   Define['backup::set']
-#   Class['ferm']
+#   Class['base::firewall']
 #   Define['ferm::rule']
 #   Define['apt::pin']
 #
@@ -31,15 +31,32 @@
 DHCP and Web server',
 }
 
-include ferm
+include base::firewall
 include backup::host
 include install-server::ubuntu-mirror
 include install-server::apt-repository
 include install-server::preseed-server
+
 include install-server::tftp-server
+ferm::rule { 'tftp':
+rule = 'proto tcp dport tftp { saddr $ALL_NETWORKS ACCEPT; }'
+}
+
 include install-server::caching-proxy
+ferm::rule { 'proxy':
+rule = 'proto tcp dport 8080 { saddr $ALL_NETWORKS ACCEPT; }'
+}
+
 include install-server::web-server
+ferm::service { 'http':
+proto = 'tcp',
+port  = 'http'
+}
+
 include install-server::dhcp-server
+ferm::rule { 'dhcp':
+rule = 'proto udp dport dhcp { saddr $ALL_NETWORKS ACCEPT; }'
+}
 
 # System user and group for mirroring
 generic::systemuser { 'mirror':
@@ -54,10 +71,6 @@
   'srv-wikimedia',
 ]
 backup::set { $sets : }
-
-ferm::rule { 'tftp':
-rule = 'proto tcp dport tftp { saddr $ALL_NETWORKS ACCEPT; }'
-}
 
 # pin package to the default, Ubuntu version, instead of our own
 apt::pin { [ 'squid', 'squid-common', 'squid-langpack' ]:
@@ -90,7 +103,7 @@
 # Requires:
 #
 #   Class['install-server::tftp-server']
-#   Class['ferm']
+#   Class['base::firewall']
 #   Define['ferm::rule']
 #
 # Sample Usage:
@@ -101,7 +114,7 @@
 description = 'WMF TFTP server',
 }
 
-include ferm
+include base::firewall
 include install-server::tftp-server
 
 ferm::rule { 'tftp':

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I41e2550a2094880821ea667cc24427d9b222a795
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org
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 patch version to 0.1.14 - change (mediawiki/selenium)

2013-12-13 Thread Zfilipin (Code Review)
Zfilipin has uploaded a new change for review.

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


Change subject: Bump patch version to 0.1.14
..

Bump patch version to 0.1.14

Change-Id: Ib21f927217498ff69256a273ecf93c8f86c1057b
---
M lib/mediawiki/selenium/version.rb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium 
refs/changes/93/101193/1

diff --git a/lib/mediawiki/selenium/version.rb 
b/lib/mediawiki/selenium/version.rb
index cfb781e..409e06a 100644
--- a/lib/mediawiki/selenium/version.rb
+++ b/lib/mediawiki/selenium/version.rb
@@ -11,6 +11,6 @@
 
 module Mediawiki
   module Selenium
-VERSION = 0.1.13
+VERSION = 0.1.14
   end
 end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib21f927217498ff69256a273ecf93c8f86c1057b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/selenium
Gerrit-Branch: master
Gerrit-Owner: Zfilipin zfili...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] beta: public IP rewriting using DNAT - change (operations/puppet)

2013-12-13 Thread Hashar (Code Review)
Hashar has uploaded a new change for review.

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


Change subject: beta: public IP rewriting using DNAT
..

beta: public IP rewriting using DNAT

MediaWiki on the beta cluster would often attempt to query some API
using the DNS entry (ie: en.wikipedia.beta.wmflabs.org).  The DNS server
would serve the public IP address of another instance and NAT would not
let the instance communicates between each other.

The fix is to rewrite outgoing destination address from the public IP
address to the private IP address it is bound to.  The iptables rules
have been applied manually until then and disappeared whenever an
instance got rebooted.  That caused major headhaces to the Wikidata team
for a few months now.

We used to maintain iptables rules using Augeas, a system that nobody
understand.  Nowadays we are using ferm, a tiny wrapper around iptables
which make it way easier to add iptables rules.

I first define a list of hardcoded mappings then call a custom define
using the nice create_resources() puppet utility.  I did such a thing
previously for the protoproxy configuration on beta (see d0b881e6 /
https://gerrit.wikimedia.org/r/#/c/63431/ ).

Should be the equivalent of generating the following iptables rules:

  iptables -t nat -I OUTPUT --dest 208.80.153.219 \
-j DNAT --to-dest 10.4.1.133
  iptables -t nat -I OUTPUT --dest 208.80.153.242 \
-j DNAT --to-dest 10.4.0.211
  iptables -t nat -I OUTPUT --dest 208.80.153.243 \
-j DNAT --to-dest 10.4.0.51
  iptables -t nat -I OUTPUT --dest 208.80.153.244 \
-j DNAT --to-dest 10.4.0.48
  iptables -t nat -I OUTPUT --dest 208.80.153.243 \
-j DNAT --to-dest 10.4.1.82

RT #4824
bug: 45868

Change-Id: I958a6d4aa1fb701aaccb2e9622c5a71e0d3fd93b
---
M manifests/misc/beta.pp
M manifests/role/beta.pp
2 files changed, 51 insertions(+), 0 deletions(-)


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

diff --git a/manifests/misc/beta.pp b/manifests/misc/beta.pp
index 5655583..e4fde07 100644
--- a/manifests/misc/beta.pp
+++ b/manifests/misc/beta.pp
@@ -49,6 +49,48 @@
 
 }
 
+# Workaround NAT traversal issue when a beta cluster instance attempt to
+# connect to a beta public IP. The NAT would get the packet loss, instead
+# transparently destination IP of outgoing packets to point directly to the
+# private IP instance instead of the public IP.
+#
+# FIXME should probably be applied by default on ALL beta cluster instances.
+#
+# References:
+#
+# RT #4824   - https://rt.wikimedia.org/Ticket/Display.html?id=4824
+# bug #45868 - https://bugzilla.wikimedia.org/show_bug.cgi?id=45868
+class misc::beta::natfixup {
+
+   # List out the instance public IP and private IP as described in 
OpenStack
+   # manager interface
+   #
+   # FIXME ideally that should be fetched directly from OpenStack
+   # configuration to make sure the iptables revwrites are always in sync 
with
+   # the web interface :-D
+   #
+   $nat_mappings = {
+   'deployment-cache-text1'= { public_ip = '208.80.153.219', 
private_ip = '10.4.1.133' },
+   'deployment-cache-upload04' = { public_ip = '208.80.153.242', 
private_ip = '10.4.0.211' },
+   'deployment-cache-bits03'   = { public_ip = '208.80.153.243', 
private_ip = '10.4.0.51' },
+   'deployment-eventlogging'   = { public_ip = '208.80.153.244', 
private_ip = '10.4.0.48' },
+   'deployment-cache-mobile01' = { public_ip = '208.80.153.143', 
private_ip = '10.4.1.82' },
+   }
+   create_resources( 'misc::beta::natdestrewrite', $nat_mappings )
+}
+
+define misc::beta::natdestrewrite( $public_ip, $private_ip ) {
+
+   include base::firewall
+
+   ferm::rule { nat rewrite for ${name}:
+   # iptables -t nat -I OUTPUT --dest $public_ip -j DNAT --to-dest 
$private_ip
+   rule = table nat chain OUTPUT { dest ${public_ip} { DNAT to 
${private_ip} } },
+   }
+
+}
+
+
 class misc::beta::sync-site-resources {
file { /usr/local/bin/sync-site-resources:
ensure = present,
diff --git a/manifests/role/beta.pp b/manifests/role/beta.pp
index 49d24ed..8291113 100644
--- a/manifests/role/beta.pp
+++ b/manifests/role/beta.pp
@@ -15,6 +15,15 @@
 
 }
 
+class role::beta::natfixup {
+
+system::role { 'role::beta::natfix':
+description = 'Server has beta NAT fixup'
+}
+
+include misc::beta::natfixup
+}
+
 class role::beta::maintenance {
 class{ 'misc::maintenance::geodata': enabled = true }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I958a6d4aa1fb701aaccb2e9622c5a71e0d3fd93b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar has...@free.fr


[MediaWiki-commits] [Gerrit] Add linux-host-entries.ttyS1-9600 empty file - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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


Change subject: Add linux-host-entries.ttyS1-9600 empty file
..

Add linux-host-entries.ttyS1-9600 empty file

The configuration specifies it and we might need it so let's add an
empty file instead of removing it from the config

Change-Id: Icf8aa8543dfd24dcb39eb67ac749b5bb7c04a295
---
A modules/install-server/files/dhcpd/linux-host-entries.ttyS1-9600
1 file changed, 0 insertions(+), 0 deletions(-)


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

diff --git a/modules/install-server/files/dhcpd/linux-host-entries.ttyS1-9600 
b/modules/install-server/files/dhcpd/linux-host-entries.ttyS1-9600
new file mode 100644
index 000..e69de29
--- /dev/null
+++ b/modules/install-server/files/dhcpd/linux-host-entries.ttyS1-9600

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf8aa8543dfd24dcb39eb67ac749b5bb7c04a295
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fixes for the translate sandbox CSS - change (mediawiki...Translate)

2013-12-13 Thread Amire80 (Code Review)
Amire80 has uploaded a new change for review.

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


Change subject: Fixes for the translate sandbox CSS
..

Fixes for the translate sandbox CSS

Change-Id: I353887fa797be2b8fed1395123e853775cb04e3d
---
M resources/css/ext.translate.special.translatesandbox.css
1 file changed, 24 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/95/101195/1

diff --git a/resources/css/ext.translate.special.translatesandbox.css 
b/resources/css/ext.translate.special.translatesandbox.css
index a5ae94f..1ffaaec 100644
--- a/resources/css/ext.translate.special.translatesandbox.css
+++ b/resources/css/ext.translate.special.translatesandbox.css
@@ -85,7 +85,8 @@
font-size: 3em;
color: #96989A;
background-color: #f7f8f8;
-   padding: 20px;
+   padding: 20px 5px;
+   text-align: center;
 }
 
 .request .tsb-header,
@@ -106,6 +107,7 @@
 }
 
 .request .tsb-header,
+.request .username,
 .request .email {
padding-left: 10px;
overflow: ellipsis;
@@ -114,6 +116,11 @@
 .request .signup-age {
text-align: center;
overflow: hidden;
+}
+
+.request .request-info,
+.request .approval {
+   padding-top: 5px;
 }
 
 /* Details pane */
@@ -176,16 +183,31 @@
 
 .clear-language-selector,
 .language-selector {
-   margin-left: 10px;
+   margin: 10px 0;
border-radius: 3px;
background: #f8f8f8;
border: 1px solid #CC;
cursor: pointer;
font-size: 1em;
+   display: block;
+   float: left;
+   border-radius: 3px;
+}
+
+
+.clear-language-selector {
+   border-radius: 0 3px 3px 0;
+   border-left: none;
 }
 
 .language-selector.selected {
cursor: default;
+   border-radius: 3px 0 0 3px;
+   max-width: 80%;
+   max-height: 40px;
+   overflow: hidden;
+   text-overflow: ellipsis;
+   white-space: nowrap;
 }
 
 .language-selector:hover {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I353887fa797be2b8fed1395123e853775cb04e3d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Amire80 amir.ahar...@mail.huji.ac.il

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


[MediaWiki-commits] [Gerrit] Add linux-host-entries.ttyS1-9600 empty file - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Add linux-host-entries.ttyS1-9600 empty file
..


Add linux-host-entries.ttyS1-9600 empty file

The configuration specifies it and we might need it so let's add an
empty file instead of removing it from the config

Change-Id: Icf8aa8543dfd24dcb39eb67ac749b5bb7c04a295
---
A modules/install-server/files/dhcpd/linux-host-entries.ttyS1-9600
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/modules/install-server/files/dhcpd/linux-host-entries.ttyS1-9600 
b/modules/install-server/files/dhcpd/linux-host-entries.ttyS1-9600
new file mode 100644
index 000..e69de29
--- /dev/null
+++ b/modules/install-server/files/dhcpd/linux-host-entries.ttyS1-9600

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icf8aa8543dfd24dcb39eb67ac749b5bb7c04a295
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Toolbar edit group widget optimization - change (mediawiki...Wikibase)

2013-12-13 Thread Henning Snater (Code Review)
Henning Snater has uploaded a new change for review.

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


Change subject: Toolbar edit group widget optimization
..

Toolbar edit group widget optimization

The change applies some logic and performance improvement to the toolbar 
editgroup widget.
The edit group buttons' characteristics are moved to the options object. Except 
for the
edit button which is displayed initially, the other buttons will be created not 
before
they are needed for interaction. Additionally, the event handlers on each 
button have
been merged to a single event handler applied to the edit group node itself.

Change-Id: I80a5f17c24b20c230062630193b3d3360de77697
---
M lib/resources/jquery.wikibase/toolbar/edittoolbar.js
M lib/resources/jquery.wikibase/toolbar/toolbareditgroup.js
M lib/resources/wikibase.ui.PropertyEditTool.EditableAliases.js
M lib/resources/wikibase.ui.PropertyEditTool.EditableValue.js
M lib/tests/qunit/jquery.wikibase/toolbar/toolbareditgroup.tests.js
5 files changed, 275 insertions(+), 104 deletions(-)


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

diff --git a/lib/resources/jquery.wikibase/toolbar/edittoolbar.js 
b/lib/resources/jquery.wikibase/toolbar/edittoolbar.js
index 69d355f..408976e 100644
--- a/lib/resources/jquery.wikibase/toolbar/edittoolbar.js
+++ b/lib/resources/jquery.wikibase/toolbar/edittoolbar.js
@@ -199,9 +199,9 @@
 
self._interactionWidget.isInitialValue();
 
if ( self._interactionWidget.isValid()  
!isEmpty  !isInitial ) {
-   editGroup.$btnSave.data( 
'toolbarbutton' ).enable();
+   editGroup.enableButton( '$btnSave' );
} else {
-   editGroup.$btnSave.data( 
'toolbarbutton' ).disable();
+   editGroup.disableButton( '$btnSave' );
}
} )
.on( prefix + 'toggleerror', function( event, error ) {
diff --git a/lib/resources/jquery.wikibase/toolbar/toolbareditgroup.js 
b/lib/resources/jquery.wikibase/toolbar/toolbareditgroup.js
index cb4d831..e2bd735 100644
--- a/lib/resources/jquery.wikibase/toolbar/toolbareditgroup.js
+++ b/lib/resources/jquery.wikibase/toolbar/toolbareditgroup.js
@@ -1,10 +1,10 @@
 /**
- * @file
- * @ingroup WikibaseLib
- *
  * @licence GNU GPL v2+
  * @author H. Snater  mediaw...@snater.com 
  * @author Daniel Werner
+ *
+ * @option {Object} buttonCharacteristics The characteristics of the edit 
group's buttons.
+ * Default: Object containing basic information to initialize the 
buttons.
  *
  * @option {boolean} displayRemoveButton Whether to display a remove button.
  * Default: false
@@ -47,6 +47,32 @@
 * @type {Object}
 */
options: {
+   buttonCharacteristics: {
+   $btnEdit: {
+   label: mw.msg( 'wikibase-edit' ),
+   href: 'javascript:void(0);',
+   cssClassExt: 'editbutton',
+   disabled: false
+   },
+   $btnSave: {
+   label: mw.msg( 'wikibase-save' ),
+   href: 'javascript:void(0);',
+   cssClassExt: 'savebutton',
+   disabled: false
+   },
+   $btnRemove: {
+   label: mw.msg( 'wikibase-remove' ),
+   href: 'javascript:void(0);',
+   cssClassExt: 'removebutton',
+   disabled: false
+   },
+   $btnCancel: {
+   label: mw.msg( 'wikibase-cancel' ),
+   href: 'javascript:void(0);',
+   cssClassExt: 'cancelbutton',
+   disabled: false
+   }
+   },
displayRemoveButton: false
},
 
@@ -89,8 +115,21 @@
 
/**
 * @see jQuery.Widget._create
+*
+* @throws {Error} if any button characteristic is not defined.
 */
_create: function() {
+   var buttonCharacteristics = this.options.buttonCharacteristics;
+
+   if(
+   !buttonCharacteristics.$btnEdit
+   || !buttonCharacteristics.$btnSave
+   || !buttonCharacteristics.$btnRemove
+   || !buttonCharacteristics.$btnCancel
+   ) {
+   throw new Error( 'Incomplete button characteristics' );
+  

[MediaWiki-commits] [Gerrit] fix typo in one of the bastion host ips for labs - change (operations/puppet)

2013-12-13 Thread ArielGlenn (Code Review)
ArielGlenn has uploaded a new change for review.

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


Change subject: fix typo in one of the bastion host ips for labs
..

fix typo in one of the bastion host ips for labs

Change-Id: Iebfa2c4aa705fb8469484ac562eea4422796792f
---
M manifests/network.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/99/101199/1

diff --git a/manifests/network.pp b/manifests/network.pp
index f434b6d..83be4fe 100644
--- a/manifests/network.pp
+++ b/manifests/network.pp
@@ -47,7 +47,7 @@
'10.4.1.55',
'10.4.1.58',
'10.4.1.84',
-   '10.4.1.85',
+   '10.4.0.85',
],
'monitoring_hosts' = [
'208.80.153.210',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iebfa2c4aa705fb8469484ac562eea4422796792f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn ar...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Implementation of snakformatted property table in Lua - change (mediawiki...Wikibase)

2013-12-13 Thread Jens Ohlig (Code Review)
Jens Ohlig has uploaded a new change for review.

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


Change subject: Implementation of snakformatted property table in Lua
..

Implementation of snakformatted property table in Lua

Change-Id: I6db8dfcc999f05630ee9a82a67dfabc6f1693b06
---
M client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php
M client/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementation.php
M client/includes/scribunto/mw.wikibase.lua
M 
client/tests/phpunit/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementationTest.php
4 files changed, 100 insertions(+), 7 deletions(-)


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

diff --git a/client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php 
b/client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php
index b95df46..37d6105 100644
--- a/client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php
+++ b/client/includes/scribunto/Scribunto_LuaWikibaseLibrary.php
@@ -1,7 +1,10 @@
 ?php
 
+use ValueFormatters\FormatterOptions;
 use ValueParsers\ParseException;
 use Wikibase\Client\WikibaseClient;
+use Wikibase\DataModel\Entity\EntityId;
+use Wikibase\Lib\SnakFormatter;
 
 /**
  * Registers and defines functions to access Wikibase through the Scribunto 
extension
@@ -28,10 +31,12 @@
// See Scribunto_LuaLanguageLibrary::getContLangCode().
global $wgContLang;
$language = $wgContLang;
+   $formatterOptions = new FormatterOptions( array( language = 
$language ) );
$this-wbLibrary = new 
Scribunto_LuaWikibaseLibraryImplementation(

WikibaseClient::getDefaultInstance()-getEntityIdParser(), // EntityIdParser

WikibaseClient::getDefaultInstance()-getStore()-getEntityLookup(), // 
EntityLookup

WikibaseClient::getDefaultInstance()-getEntityIdFormatter(), // 
EntityIdFormatter
+   
WikibaseClient::getDefaultInstance()-getSnakFormatterFactory()-getSnakFormatter(
 SnakFormatter::FORMAT_WIKI, $formatterOptions ), // SnakFormatter

WikibaseClient::getDefaultInstance()-getStore()-getSiteLinkTable(), // 
SiteLinkLookup
$language, // language

WikibaseClient::getDefaultInstance()-getSettings()-getSetting( 'siteGlobalID' 
) // siteId
@@ -48,7 +53,8 @@
$lib = array(
'getEntity' = array( $this, 'getEntity' ),
'getEntityId' = array( $this, 'getEntityId' ),
-   'getGlobalSiteId' = array( $this, 'getGlobalSiteId' )
+   'getGlobalSiteId' = array( $this, 'getGlobalSiteId' ),
+   'renderForEntityId' = array( $this, 
'renderForEntityId' )
);
$this-getEngine()-registerInterface( dirname( __FILE__ ) . 
'/mw.wikibase.lua', $lib, array() );
}
@@ -92,6 +98,15 @@
}
 
/**
+* Wrapper for renderForEntityId in 
Scribunto_LuaWikibaseLibraryImplementation
+*
+* @since 0.5
+*
+*/
+   public function renderForEntityId( $entityId, $propertyId ) {
+   return $this-wbLibrary-renderForEntityId( $entityId, 
$propertyId );
+   }
+   /**
 * Wrapper for getGlobalSiteId in 
Scribunto_LuaWikibaseLibraryImplementation
 *
 * @since 0.5
diff --git 
a/client/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementation.php 
b/client/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementation.php
index 302619e..cf87a2b 100644
--- a/client/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementation.php
+++ b/client/includes/scribunto/Scribunto_LuaWikibaseLibraryImplementation.php
@@ -2,6 +2,9 @@
 
 use Wikibase\Item;
 use Wikibase\DataModel\Entity\EntityId;
+use Wikibase\Claims;
+use Wikibase\Entity;
+use Wikibase\Snak;
 use Wikibase\EntityLookup;
 use Wikibase\SiteLinkLookup;
 use Wikibase\Lib\Serializers\SerializationOptions;
@@ -10,7 +13,8 @@
 use Wikibase\Lib\EntityIdParser;
 use Wikibase\LanguageFallbackChainFactory;
 use Wikibase\Utils;
-use \Language;
+use Wikibase\Lib\SnakFormatter;
+
 
 /**
  * Actual implementations of the functions to access Wikibase through the 
Scribunto extension
@@ -40,6 +44,8 @@
/* @var mixed */
protected $siteId;
 
+   /* @var SnakFormatter */
+   protected $snaksFormatter;
 
/**
 * @param EntityIdParser $entityIdParser
@@ -47,6 +53,7 @@
public function __construct( EntityIdParser $entityIdParser,
 EntityLookup 
$entityLookup,
 
EntityIdFormatter $entityIdFormatter,
+SnakFormatter 
$snakFormatter,
   

[MediaWiki-commits] [Gerrit] fix typo in one of the bastion host ips for labs - change (operations/puppet)

2013-12-13 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged.

Change subject: fix typo in one of the bastion host ips for labs
..


fix typo in one of the bastion host ips for labs

Change-Id: Iebfa2c4aa705fb8469484ac562eea4422796792f
---
M manifests/network.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/manifests/network.pp b/manifests/network.pp
index f434b6d..83be4fe 100644
--- a/manifests/network.pp
+++ b/manifests/network.pp
@@ -47,7 +47,7 @@
'10.4.1.55',
'10.4.1.58',
'10.4.1.84',
-   '10.4.1.85',
+   '10.4.0.85',
],
'monitoring_hosts' = [
'208.80.153.210',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iebfa2c4aa705fb8469484ac562eea4422796792f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn ar...@wikimedia.org
Gerrit-Reviewer: ArielGlenn ar...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] tftp is udp not tcp - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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


Change subject: tftp is udp not tcp
..

tftp is udp not tcp

Wrong ferm rule all along

Change-Id: I6187acf53d737cee72d98f10c0f112b2ef6ef87b
---
M manifests/role/install-server.pp
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/00/101200/1

diff --git a/manifests/role/install-server.pp b/manifests/role/install-server.pp
index 091459e..e6e074e 100644
--- a/manifests/role/install-server.pp
+++ b/manifests/role/install-server.pp
@@ -39,7 +39,7 @@
 
 include install-server::tftp-server
 ferm::rule { 'tftp':
-rule = 'proto tcp dport tftp { saddr $ALL_NETWORKS ACCEPT; }'
+rule = 'proto udp dport tftp { saddr $ALL_NETWORKS ACCEPT; }'
 }
 
 include install-server::caching-proxy
@@ -118,6 +118,6 @@
 include install-server::tftp-server
 
 ferm::rule { 'tftp':
-rule = 'proto tcp dport tftp { saddr $ALL_NETWORKS ACCEPT; }'
+rule = 'proto udp dport tftp { saddr $ALL_NETWORKS ACCEPT; }'
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6187acf53d737cee72d98f10c0f112b2ef6ef87b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] tftp is udp not tcp - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: tftp is udp not tcp
..


tftp is udp not tcp

Wrong ferm rule all along

Change-Id: I6187acf53d737cee72d98f10c0f112b2ef6ef87b
---
M manifests/role/install-server.pp
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/manifests/role/install-server.pp b/manifests/role/install-server.pp
index 091459e..e6e074e 100644
--- a/manifests/role/install-server.pp
+++ b/manifests/role/install-server.pp
@@ -39,7 +39,7 @@
 
 include install-server::tftp-server
 ferm::rule { 'tftp':
-rule = 'proto tcp dport tftp { saddr $ALL_NETWORKS ACCEPT; }'
+rule = 'proto udp dport tftp { saddr $ALL_NETWORKS ACCEPT; }'
 }
 
 include install-server::caching-proxy
@@ -118,6 +118,6 @@
 include install-server::tftp-server
 
 ferm::rule { 'tftp':
-rule = 'proto tcp dport tftp { saddr $ALL_NETWORKS ACCEPT; }'
+rule = 'proto udp dport tftp { saddr $ALL_NETWORKS ACCEPT; }'
 }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6187acf53d737cee72d98f10c0f112b2ef6ef87b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Add i18n file - change (mediawiki...PageTools)

2013-12-13 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Add i18n file
..


Add i18n file

Change-Id: I0d5e0a5c0bda8a605a1a77cb5102986a47fe1113
---
A PageTools.i18n.php
M PageTools.php
2 files changed, 45 insertions(+), 2 deletions(-)

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



diff --git a/PageTools.i18n.php b/PageTools.i18n.php
new file mode 100644
index 000..0510680
--- /dev/null
+++ b/PageTools.i18n.php
@@ -0,0 +1,42 @@
+?php
+/**
+ * The i18n file of the PageTools extension
+ *
+ * @copyright (C) 2013, Jean-Lou Dupont, Stephan Gambke
+ * @license   http://www.gnu.org/licenses/gpl-3.0.html GNU General Public 
License, version 3 (or later)
+ *
+ * This file is part of the MediaWiki extension PageTools.
+ * The PageTools extension 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.
+ *
+ * The PageTools extension 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 http://www.gnu.org/licenses/.
+ *
+ * @file
+ * @ingroup   PageTools
+ */
+
+$messages = array();
+
+/**
+ * English
+ * @author Jean-Lou Dupont
+ * @author Stephan Gambke
+ */
+$messages['en'] = array(
+   'pagetools-desc' = 'Parser functions for handling of category 
information, page title and page subtitle',
+);
+
+/** Message documentation (Message documentation)
+ * @author Raimond Spekking
+ */
+$messages['qqq'] = array(
+   'pagetools-desc' = '{{desc|name=Page 
Tools|url=https://www.mediawiki.org/wiki/Extension:PageTools}}',
+);
diff --git a/PageTools.php b/PageTools.php
index 6c501eb..29b825c 100644
--- a/PageTools.php
+++ b/PageTools.php
@@ -69,10 +69,11 @@
'author'  = array( '[http://www.mediawiki.org/wiki/User:Jldupont 
Jean-Lou Dupont]', '[http://www.mediawiki.org/wiki/User:F.trott Stephan 
Gambke]' ),
'version' = PT_VERSION,
'url' = 'https://www.mediawiki.org/wiki/Extension:PageTools',
-   'description' = 'Parser functions for handling of category 
information, page title and page subtitle',
+   'descriptionmsg' = 'pagetools-desc',
 );
 
-$wgAutoloadClasses[ 'PageTools' ] = dirname( __FILE__ ) . 
'/PageTools.class.php';
+$wgExtensionMessagesFiles['PageTools'] = __DIR__ . '/PageTools.i18n.php';
+$wgAutoloadClasses[ 'PageTools' ] = __DIR__ . '/PageTools.class.php';
 
 // Specify the function that will initialize the parser functions
 $wgHooks[ 'ParserFirstCallInit' ][ ] = 'PageToolsSetupParserFunction';

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0d5e0a5c0bda8a605a1a77cb5102986a47fe1113
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTools
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: Foxtrott s7ep...@gmail.com
Gerrit-Reviewer: Siebrand siebr...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] PostgreSQL support for VoteNY - change (mediawiki...VoteNY)

2013-12-13 Thread Jack Phoenix (Code Review)
Jack Phoenix has submitted this change and it was merged.

Change subject: PostgreSQL support for VoteNY
..


PostgreSQL support for VoteNY

Use integer value for votes to count averages.

Initial contributor: Sebastian Fiedler ba...@unix-solution.de

Bug: 51441

Change-Id: I9c09b84d3652449d3328586332c636a7a676273a
---
M Vote.js
M VoteClass.php
M VoteHooks.php
R vote.mysql
A vote.postgres
5 files changed, 37 insertions(+), 10 deletions(-)

Approvals:
  Jack Phoenix: Verified; Looks good to me, approved



diff --git a/Vote.js b/Vote.js
index f1ca0bb..021e398 100644
--- a/Vote.js
+++ b/Vote.js
@@ -165,4 +165,4 @@
jQuery( this ).data( 'vote-id' )
);
} );
-} );
\ No newline at end of file
+} );
diff --git a/VoteClass.php b/VoteClass.php
index 60e4e7f..250c7c3 100644
--- a/VoteClass.php
+++ b/VoteClass.php
@@ -45,13 +45,13 @@
$vote_count = 0;
$res = $dbr-select(
'Vote',
-   'COUNT(*) AS VoteCount',
+   'COUNT(*) AS votecount',
array( 'vote_page_id' = $this-PageID ),
__METHOD__
);
$row = $dbr-fetchObject( $res );
if( $row ) {
-   $vote_count = $row-VoteCount;
+   $vote_count = $row-votecount;
}
$wgMemc-set( $key, $vote_count );
}
@@ -76,13 +76,13 @@
$dbr = wfGetDB( DB_SLAVE );
$res = $dbr-select(
'Vote',
-   'AVG(vote_value) AS VoteAvg',
+   'AVG(vote_value) AS voteavg',
array( 'vote_page_id' = $this-PageID ),
__METHOD__
);
$row = $dbr-fetchObject( $res );
if( $row ) {
-   $voteAvg = $row-VoteAvg;
+   $voteAvg = $row-voteavg;
}
$wgMemc-set( $key, $voteAvg );
}
@@ -120,6 +120,7 @@
 */
function delete() {
$dbw = wfGetDB( DB_MASTER );
+   $dbw-begin();
$dbw-delete(
'Vote',
array(
@@ -149,6 +150,7 @@
$voteDate = date( 'Y-m-d H:i:s' );
wfRestoreWarnings();
if( $this-UserAlreadyVoted() == false ) {
+   $dbw-begin();
$dbw-insert(
'Vote',
array(
@@ -276,7 +278,7 @@
$output .= 'div class=rating-section';
$output .= $this-displayStars( $id, $display_stars_rating, 
$voted );
$count = $this-count();
-   if( $count ) {
+   if( isset( $count ) ) {
$output .= ' span class=rating-total(' .
wfMsgExt( 'voteny-votes', 'parsemag', $count ) 
. ')/span';
}
diff --git a/VoteHooks.php b/VoteHooks.php
index eb69ae6..f028b57 100644
--- a/VoteHooks.php
+++ b/VoteHooks.php
@@ -149,9 +149,13 @@
 * @return Boolean: true
 */
public static function addTable( $updater ) {
-   $dir = dirname( __FILE__ );
-   $file = $dir/vote.sql;
-   $updater-addExtensionUpdate( array( 'addTable', 'Vote', $file, 
true ) );
+   $dbt = $updater-getDB()-getType();
+   $file = dirname( __FILE__ ) . /vote.$dbt;
+   if ( file_exists( $file ) ) {
+   $updater-addExtensionUpdate( array( 'addTable', 
'Vote', $file, true ) );
+   } else {
+   throw new MWException(VoteNY does not support $dbt.);
+   }
return true;
}
-}
\ No newline at end of file
+}
diff --git a/vote.sql b/vote.mysql
similarity index 100%
rename from vote.sql
rename to vote.mysql
diff --git a/vote.postgres b/vote.postgres
new file mode 100644
index 000..81f397f
--- /dev/null
+++ b/vote.postgres
@@ -0,0 +1,21 @@
+CREATE TABLE Vote (
+  -- Internal ID to identify between different vote tags on different pages
+  vote_id SERIAL NOT NULL PRIMARY KEY,
+  -- Username (if any) of the person who voted
+  username varchar(255) NOT NULL default '0',
+  -- User ID of the person who voted
+  vote_user_id integer NOT NULL default '0',
+  -- ID of the page where the vote tag is in
+  vote_page_id integer NOT NULL default '0',
+  -- Value of the vote (ranging from 1 to 5)
+  vote_value integer NOT NULL,
+  -- Timestamp when the vote was cast
+  

[MediaWiki-commits] [Gerrit] Create only one rank selector menu - change (mediawiki...Wikibase)

2013-12-13 Thread Henning Snater (Code Review)
Henning Snater has uploaded a new change for review.

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


Change subject: Create only one rank selector menu
..

Create only one rank selector menu

Since only one rank selector menu may be displayed at a time, there is no need 
to create
individual menus for each rank selector widget.

Change-Id: I002931069429c867bda51a25a975430f3b684900
---
M lib/resources/jquery.wikibase/jquery.wikibase.statementview.RankSelector.js
M 
lib/tests/qunit/jquery.wikibase/jquery.wikibase.statementview.RankSelector.tests.js
2 files changed, 114 insertions(+), 40 deletions(-)


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

diff --git 
a/lib/resources/jquery.wikibase/jquery.wikibase.statementview.RankSelector.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.statementview.RankSelector.js
index dfb35bb..e1b9b29 100644
--- 
a/lib/resources/jquery.wikibase/jquery.wikibase.statementview.RankSelector.js
+++ 
b/lib/resources/jquery.wikibase/jquery.wikibase.statementview.RankSelector.js
@@ -8,6 +8,12 @@
var PARENT = $.Widget;
 
/**
+* The node of the rank selector menu to select a rank from.
+* @type {jQuery}
+*/
+   var $menu = null;
+
+   /**
 * Selector for choosing a statement rank.
 * @since 0.5
 *
@@ -35,10 +41,11 @@
},
 
/**
-* The node of the menu to select the rank from.
-* @type {jQuery}
+* The rank currently featured by the rank selector.
+* @see wikibase.Statement.RANK
+* @type {number}
 */
-   $menu: null,
+   _rank: null,
 
/**
 * Icon node.
@@ -52,7 +59,18 @@
_create: function() {
var self = this;
 
-   this.$menu = this._buildMenu().appendTo( 'body' 
).hide();
+   if( !$menu ) {
+   $menu = this._buildMenu().appendTo( 'body' 
).hide();
+
+   $menu.on( 'click.' + this.widgetName, function( 
event ) {
+   var $li = $( event.target ).closest( 
'li' ),
+   rank = $li.data( 
self.widgetName + '-menuitem-rank' );
+
+   if( rank !== undefined ) {
+   $.data( this, self.widgetName 
).rank( rank );
+   }
+   } );
+   }
 
this.element
.addClass( this.widgetBaseClass )
@@ -67,12 +85,14 @@
}
} )
.on( 'click.' + this.widgetName, function( event ) {
-   if( self.isDisabled() || self.$menu.is( 
':visible' ) ) {
-   self.$menu.hide();
+   if( self.isDisabled() || $menu.is( ':visible' ) 
) {
+   $menu.hide();
return;
}
 
-   self.$menu.show();
+   $menu.data( self.widgetName, self );
+   $menu.show();
+   self._updateMenuCss();
self.repositionMenu();
 
self.element.addClass( 'ui-state-active' );
@@ -81,7 +101,7 @@
// menu itself or outside of it:
var degrade = function( event ) {
if ( event.target !== self.element.get( 
0 ) ) {
-   self.$menu.hide();
+   $menu.hide();
self.element.removeClass( 
'ui-state-active' );
}
self._unbindGlobalEventListeners();
@@ -93,15 +113,6 @@
 
this.$icon = mw.template( 'wb-rankselector', '', '' 
).appendTo( this.element );
 
-   self.$menu.on( 'click.' + this.widgetName, function( 
event ) {
-   var $li = $( event.target ).closest( 'li' ),
-   rank = $li.data( self.widgetName + 
'-menuitem-rank' );
-
-   if( rank !== undefined ) {
-   self.rank( rank );
-   }
-   } );
-
this._setRank( this.options.rank );
},
 
@@ -109,8 +120,11 @@
 * @see 

[MediaWiki-commits] [Gerrit] [SYNC] Synchronize code with compat branch - change (pywikibot/core)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: [SYNC] Synchronize code with compat branch
..


[SYNC] Synchronize code with compat branch

Change-Id: I9dd3536c997d0e8774f0e6c42ae2119d2c9d3fe4
---
M scripts/redirect.py
1 file changed, 14 insertions(+), 9 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/redirect.py b/scripts/redirect.py
index 9c96fad..8ece506 100755
--- a/scripts/redirect.py
+++ b/scripts/redirect.py
@@ -22,11 +22,13 @@
-xml:filename.xml. Cannot be used with -fullscan or -moves.
 
 -fullscan  Retrieve redirect pages from live wiki, not from a special page
+   Cannot be used with -xml.
 
 -moves Use the page move log to find double-redirect candidates. Only
works with action double, does not work with -xml.
 
-   NOTE: If neither of -xml -fullscan -moves is given, info will be
+   NOTE: You may use only one of these options above.
+   If neither of -xml -fullscan -moves is given, info will be
loaded from a special page of the live wiki.
 
 -namespace:n   Namespace to process. Can be given multiple times, for several
@@ -291,7 +293,7 @@
 gen = self.get_moved_pages_redirects()
 for redir_page in gen:
 yield redir_page.title()
-elif self.use_api and not self.use_move_log:
+elif self.use_api:
 count = 0
 for (pagetitle, type, target, final) \
 in self.get_redirects_via_api(maxlen=2):
@@ -407,9 +409,12 @@
 try:
 redir_page.delete(reason, prompt=False)
 except pywikibot.NoUsername:
-if ((i18n.twhas_key(targetPage.site.lang, 
'redirect-broken-redirect-template') and
- i18n.twhas_key(targetPage.site.lang, 
'redirect-remove-broken')
- ) or targetPage.site.lang == '-'):
+if ((i18n.twhas_key(
+ targetPage.site.lang,
+ 'redirect-broken-redirect-template') and
+ i18n.twhas_key(targetPage.site.lang,
+'redirect-remove-broken')) or \
+targetPage.site.lang == '-'):
 pywikibot.output(uNo sysop in user-config.py, 
  uput page to speedy deletion.)
 content = redir_page.get(get_redirect=True)
@@ -705,11 +710,11 @@
 pywikibot.output(u'Unknown argument: %s' % arg)
 
 if (
-(not action) or
-(xmlFilename and moved_pages) or
-(fullscan and xmlFilename)
+not action or
+xmlFilename and moved_pages or
+fullscan and xmlFilename
 ):
-pywikibot.showHelp('redirect')
+pywikibot.showHelp()
 else:
 gen = RedirectGenerator(xmlFilename, namespaces, offset, moved_pages,
 fullscan, start, until, number, step)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9dd3536c997d0e8774f0e6c42ae2119d2c9d3fe4
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Replace a deprecated method - change (mediawiki...Translate)

2013-12-13 Thread Amire80 (Code Review)
Amire80 has uploaded a new change for review.

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


Change subject: Replace a deprecated method
..

Replace a deprecated method

Change-Id: Ic8c769615fb00fb472bb8ac72767c3224a7379d0
---
M tests/browser/features/step_definitions/manage_translator_sandbox_steps.rb
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git 
a/tests/browser/features/step_definitions/manage_translator_sandbox_steps.rb 
b/tests/browser/features/step_definitions/manage_translator_sandbox_steps.rb
index ef9c4c9..dc5076e 100644
--- a/tests/browser/features/step_definitions/manage_translator_sandbox_steps.rb
+++ b/tests/browser/features/step_definitions/manage_translator_sandbox_steps.rb
@@ -95,11 +95,11 @@
 end
 
 Then(/^the direction of the users language filter button is '(.+)'$/) do 
|dir_value|
-   
on(ManageTranslatorSandboxPage).language_selector_button_element.attribute_value(dir).should
 == dir_value
+   
on(ManageTranslatorSandboxPage).language_selector_button_element.attribute(dir).should
 == dir_value
 end
 
 Then(/^the language code of the users language filter button is '(.+)'$/) do 
|lang_value|
-   
on(ManageTranslatorSandboxPage).language_selector_button_element.attribute_value(lang).should
 == lang_value
+   
on(ManageTranslatorSandboxPage).language_selector_button_element.attribute(lang).should
 == lang_value
 end
 
 Then(/^usernames are visible in the first column$/) do

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic8c769615fb00fb472bb8ac72767c3224a7379d0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Amire80 amir.ahar...@mail.huji.ac.il

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


[MediaWiki-commits] [Gerrit] dhcp is called bootps in /etc/services - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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


Change subject: dhcp is called bootps in /etc/services
..

dhcp is called bootps in /etc/services

Make ferm happy by using the in /etc/services defined named fo the DHCP
service

Change-Id: Ic599035bc8a4527267af1beaee9b2283d0925edb
---
M manifests/role/install-server.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/04/101204/1

diff --git a/manifests/role/install-server.pp b/manifests/role/install-server.pp
index e6e074e..7967f33 100644
--- a/manifests/role/install-server.pp
+++ b/manifests/role/install-server.pp
@@ -55,7 +55,7 @@
 
 include install-server::dhcp-server
 ferm::rule { 'dhcp':
-rule = 'proto udp dport dhcp { saddr $ALL_NETWORKS ACCEPT; }'
+rule = 'proto udp dport bootps { saddr $ALL_NETWORKS ACCEPT; }'
 }
 
 # System user and group for mirroring

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic599035bc8a4527267af1beaee9b2283d0925edb
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] dhcp is called bootps in /etc/services - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: dhcp is called bootps in /etc/services
..


dhcp is called bootps in /etc/services

Make ferm happy by using the in /etc/services defined named fo the DHCP
service

Change-Id: Ic599035bc8a4527267af1beaee9b2283d0925edb
---
M manifests/role/install-server.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/manifests/role/install-server.pp b/manifests/role/install-server.pp
index e6e074e..7967f33 100644
--- a/manifests/role/install-server.pp
+++ b/manifests/role/install-server.pp
@@ -55,7 +55,7 @@
 
 include install-server::dhcp-server
 ferm::rule { 'dhcp':
-rule = 'proto udp dport dhcp { saddr $ALL_NETWORKS ACCEPT; }'
+rule = 'proto udp dport bootps { saddr $ALL_NETWORKS ACCEPT; }'
 }
 
 # System user and group for mirroring

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic599035bc8a4527267af1beaee9b2283d0925edb
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] beta: public IP rewriting using DNAT - change (operations/puppet)

2013-12-13 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged.

Change subject: beta: public IP rewriting using DNAT
..


beta: public IP rewriting using DNAT

MediaWiki on the beta cluster would often attempt to query some API
using the DNS entry (ie: en.wikipedia.beta.wmflabs.org).  The DNS server
would serve the public IP address of another instance and NAT would not
let the instance communicates between each other.

The fix is to rewrite outgoing destination address from the public IP
address to the private IP address it is bound to.  The iptables rules
have been applied manually until then and disappeared whenever an
instance got rebooted.  That caused major headhaces to the Wikidata team
for a few months now.

We used to maintain iptables rules using Augeas, a system that nobody
understand.  Nowadays we are using ferm, a tiny wrapper around iptables
which make it way easier to add iptables rules.

I first define a list of hardcoded mappings then call a custom define
using the nice create_resources() puppet utility.  I did such a thing
previously for the protoproxy configuration on beta (see d0b881e6 /
https://gerrit.wikimedia.org/r/#/c/63431/ ).

Should be the equivalent of generating the following iptables rules:

  iptables -t nat -I OUTPUT --dest 208.80.153.219 \
-j DNAT --to-dest 10.4.1.133
  iptables -t nat -I OUTPUT --dest 208.80.153.242 \
-j DNAT --to-dest 10.4.0.211
  iptables -t nat -I OUTPUT --dest 208.80.153.243 \
-j DNAT --to-dest 10.4.0.51
  iptables -t nat -I OUTPUT --dest 208.80.153.244 \
-j DNAT --to-dest 10.4.0.48
  iptables -t nat -I OUTPUT --dest 208.80.153.143 \
-j DNAT --to-dest 10.4.1.82

RT #4824
bug: 45868

Change-Id: I958a6d4aa1fb701aaccb2e9622c5a71e0d3fd93b
---
M manifests/misc/beta.pp
M manifests/role/beta.pp
2 files changed, 54 insertions(+), 0 deletions(-)

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



diff --git a/manifests/misc/beta.pp b/manifests/misc/beta.pp
index 5655583..041850b 100644
--- a/manifests/misc/beta.pp
+++ b/manifests/misc/beta.pp
@@ -49,6 +49,51 @@
 
 }
 
+# Workaround NAT traversal issue when a beta cluster instance attempt to
+# connect to a beta public IP. The NAT would get the packet loss, instead
+# transparently destination IP of outgoing packets to point directly to the
+# private IP instance instead of the public IP.
+#
+# FIXME should probably be applied by default on ALL beta cluster instances.
+#
+# References:
+#
+# RT #4824   - https://rt.wikimedia.org/Ticket/Display.html?id=4824
+# bug #45868 - https://bugzilla.wikimedia.org/show_bug.cgi?id=45868
+class misc::beta::natfixup {
+
+   # List out the instance public IP and private IP as described in 
OpenStack
+   # manager interface
+   #
+   # FIXME ideally that should be fetched directly from OpenStack
+   # configuration to make sure the iptables revwrites are always in sync 
with
+   # the web interface :-D
+   #
+   $nat_mappings = {
+   'deployment-cache-text1'= { public_ip = '208.80.153.219', 
private_ip = '10.4.1.133' },
+   'deployment-cache-upload04' = { public_ip = '208.80.153.242', 
private_ip = '10.4.0.211' },
+   'deployment-cache-bits03'   = { public_ip = '208.80.153.243', 
private_ip = '10.4.0.51' },
+   'deployment-eventlogging'   = { public_ip = '208.80.153.244', 
private_ip = '10.4.0.48' },
+   'deployment-cache-mobile01' = { public_ip = '208.80.153.143', 
private_ip = '10.4.1.82' },
+   }
+   create_resources( 'misc::beta::natdestrewrite', $nat_mappings )
+}
+
+define misc::beta::natdestrewrite( $public_ip, $private_ip ) {
+
+   include base::firewall
+
+   # iptables -t nat -I OUTPUT --dest $public_ip -j DNAT --to-dest 
$private_ip
+   ferm::rule { nat_rewrite_for_${name}:
+   table  = 'nat',
+   chain  = 'OUTPUT',
+   domain = 'ip',
+   rule   = daddr ${public_ip} { DNAT to ${private_ip}; },
+   }
+
+}
+
+
 class misc::beta::sync-site-resources {
file { /usr/local/bin/sync-site-resources:
ensure = present,
diff --git a/manifests/role/beta.pp b/manifests/role/beta.pp
index 49d24ed..8291113 100644
--- a/manifests/role/beta.pp
+++ b/manifests/role/beta.pp
@@ -15,6 +15,15 @@
 
 }
 
+class role::beta::natfixup {
+
+system::role { 'role::beta::natfix':
+description = 'Server has beta NAT fixup'
+}
+
+include misc::beta::natfixup
+}
+
 class role::beta::maintenance {
 class{ 'misc::maintenance::geodata': enabled = true }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I958a6d4aa1fb701aaccb2e9622c5a71e0d3fd93b
Gerrit-PatchSet: 6
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar has...@free.fr

[MediaWiki-commits] [Gerrit] Disable $wgUseTidy: not working and we're not interested in it - change (translatewiki)

2013-12-13 Thread Nemo bis (Code Review)
Nemo bis has uploaded a new change for review.

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


Change subject: Disable $wgUseTidy: not working and we're not interested in it
..

Disable $wgUseTidy: not working and we're not interested in it

According to bawolff, this misleading HTML comment in all pages usually means
the binary is not found: Tidy found serious XHTML errors.
Probably due to what explained in [[mw:$wgTidyInternal]].
According to Nikerabbit, we're not interested in tidy.

Change-Id: Ib7e433297fde220b1c2605cd3ef90db8f53bf5cb
---
M TranslatewikiSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/05/101205/1

diff --git a/TranslatewikiSettings.php b/TranslatewikiSettings.php
index aa12d17..15f5d93 100644
--- a/TranslatewikiSettings.php
+++ b/TranslatewikiSettings.php
@@ -27,7 +27,7 @@
 $wgRightsText = ;
 $wgRightsIcon = ;
 
-$wgUseTidy = true;
+$wgUseTidy = false;
 $wgSVGConverter = 'rsvg';
 $wgMaxShellMemory = 1024 * 200;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7e433297fde220b1c2605cd3ef90db8f53bf5cb
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nemo bis federicol...@tiscali.it

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


[MediaWiki-commits] [Gerrit] History in '4 hours ago' should not be included in 'Today' - change (mediawiki...Flow)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: History in '4 hours ago' should not be included in 'Today'
..


History in '4 hours ago' should not be included in 'Today'

Change-Id: Iecfa74989cb409db799e500d701f29d06a40dd2e
---
M includes/View/History/HistoryRenderer.php
1 file changed, 7 insertions(+), 5 deletions(-)

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



diff --git a/includes/View/History/HistoryRenderer.php 
b/includes/View/History/HistoryRenderer.php
index 26ae4ba..57247f6 100644
--- a/includes/View/History/HistoryRenderer.php
+++ b/includes/View/History/HistoryRenderer.php
@@ -54,11 +54,13 @@
$timestampDay = new MWTimestamp( strtotime( date( 'Y-m-d' ) ) );
$timestampWeek = new MWTimestamp( strtotime( '1 week ago' ) );
 
-   $timespans = array(
-   wfMessage( 'flow-history-last4' )-escaped() = array( 
'from' = $timestampLast4, 'to' = null ),
-   wfMessage( 'flow-history-day' )-escaped() = array( 
'from' = $timestampDay, 'to' = $timestampLast4 ),
-   wfMessage( 'flow-history-week' )-escaped() = array( 
'from' = $timestampWeek, 'to' = $timestampDay ),
-   );
+   $timespans = array();
+   $timespans[wfMessage( 'flow-history-last4' )-escaped()] = 
array( 'from' = $timestampLast4, 'to' = null );
+   // if now is within first 4 hours of the day, all histories 
would be included in '4 hours ago'
+   if ( $timestampDay  $timestampLast4 ) {
+   $timespans[wfMessage( 'flow-history-day' )-escaped()] 
= array( 'from' = $timestampDay, 'to' = $timestampLast4 );
+   }
+   $timespans[wfMessage( 'flow-history-week' )-escaped()] = 
array( 'from' = $timestampWeek, 'to' = $timestampDay );
 
// Find last timestamp.
$history-seek( $history-numRows() - 1 );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iecfa74989cb409db799e500d701f29d06a40dd2e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Bsitu bs...@wikimedia.org
Gerrit-Reviewer: EBernhardson ebernhard...@wikimedia.org
Gerrit-Reviewer: Matthias Mullie mmul...@wikimedia.org
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 id and type params in wbeditentity data! - change (mediawiki...Wikibase)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Allow id and type params in wbeditentity data!
..


Allow id and type params in wbeditentity data!

Bug: 54146

Change-Id: I379b280bdf398c4cf35284469bbbfa9ee7877084
---
M repo/includes/api/EditEntity.php
M repo/tests/phpunit/includes/api/EditEntityTest.php
2 files changed, 88 insertions(+), 29 deletions(-)

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



diff --git a/repo/includes/api/EditEntity.php b/repo/includes/api/EditEntity.php
index 73e7da7..72ba60d 100644
--- a/repo/includes/api/EditEntity.php
+++ b/repo/includes/api/EditEntity.php
@@ -7,8 +7,8 @@
 use InvalidArgumentException;
 use MWException;
 use Revision;
+use Site;
 use SiteList;
-use SiteSQLStore;
 use Title;
 use Wikibase\ChangeOp\ChangeOp;
 use Wikibase\ChangeOp\ChangeOpAliases;
@@ -20,6 +20,7 @@
 use Wikibase\ChangeOp\ChangeOpSiteLink;
 use Wikibase\ChangeOp\ChangeOps;
 use Wikibase\Claim;
+use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\Entity;
 use Wikibase\EntityContent;
 use Wikibase\Item;
@@ -124,7 +125,7 @@
$entity = $entityContent-getEntity();
$this-validateDataParameter( $params );
$data = json_decode( $params['data'], true );
-   $this-validateDataProperties( $data, 
$entityContent-getWikiPage() );
+   $this-validateDataProperties( $data, $entityContent );
 
if ( $params['clear'] ) {
$entity-clear();
@@ -171,6 +172,12 @@
return $summary;
}
 
+   /**
+* @param array $data
+* @param Entity $entity
+*
+* @return ChangeOps
+*/
protected function getChangeOps( array $data, Entity $entity ) {
$changeOps = new ChangeOps();
 
@@ -306,6 +313,7 @@
$aliasesChangeOps = array();
foreach ( $indexedAliases as $langCode = $args ) {
$aliasesToSet = array();
+   $language = '';
 
foreach ( $args as $arg ) {
$this-validateMultilangArgs( $arg, $langCode );
@@ -334,7 +342,7 @@
 * @since 0.4
 *
 * @param array $siteLinks
-* @param Entity $entity
+* @param Entity|Item $entity
 *
 * @return ChangeOpSiteLink[]
 */
@@ -360,6 +368,7 @@
} else {
$this-dieUsage( There is no site for global 
site id '$globalSiteId', 'no-such-site' );
}
+   /** @var Site $linkSite */
 
if ( $shouldRemove ) {
$siteLinksChangeOps[] = new ChangeOpSiteLink( 
$globalSiteId );
@@ -373,7 +382,7 @@
 
if ( $linkPage === false ) {
$this-dieUsage(
-   The external client 
site did not provide page information for site '{$globalSiteId}' and title 
'{$pageTitle}',
+   The external client 
site did not provide page information for site '{$globalSiteId}',
'no-external-page' );
}
} else {
@@ -508,26 +517,33 @@
 
/**
 * @since 0.4
+*
 * @param array $data
-* @param WikiPage|bool $page
+* @param EntityContent $entityContent
 */
-   protected function validateDataProperties( $data, $page ) {
+   protected function validateDataProperties( $data, $entityContent ) {
$title = null;
$revision = null;
 
-   if ( $page ) {
-   $title = $page-getTitle();
-   $revision = $page-getRevision();
+   if ( $entityContent ) {
+   $wikiPage = $entityContent-getWikiPage();
+   $title = $wikiPage-getTitle();
+   $revision = $wikiPage-getTitle();
}
 
$allowedProps = array(
+   // ignored props
'length',
'count',
'touched',
+   // checked props
+   'id',
+   'type',
'pageid',
'ns',
'title',
'lastrevid',
+   // useful props
'labels',
'descriptions',
'aliases',
@@ -537,7 +553,9 @@
);
 
$this-checkValidJson( $data, $allowedProps );
-   

[MediaWiki-commits] [Gerrit] Derive the corresponding original URL and store it with the ... - change (operations/puppet)

2013-12-13 Thread Mark Bergsma (Code Review)
Mark Bergsma has uploaded a new change for review.

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


Change subject: Derive the corresponding original URL and store it with the 
thumb
..

Derive the corresponding original URL and store it with the thumb

Change-Id: I5c93e62aea4c1331e257bd0a9844ac8ed8f8a1ad
---
M templates/varnish/upload-backend.inc.vcl.erb
M templates/varnish/upload-frontend.inc.vcl.erb
2 files changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/07/101207/1

diff --git a/templates/varnish/upload-backend.inc.vcl.erb 
b/templates/varnish/upload-backend.inc.vcl.erb
index 3ffd411..56d30da 100644
--- a/templates/varnish/upload-backend.inc.vcl.erb
+++ b/templates/varnish/upload-backend.inc.vcl.erb
@@ -126,6 +126,11 @@
set beresp.http.X-Content-Range = beresp.http.Content-Range;
}
 
+   # Derive the corresponding original URL and store it with the object
+   if (!beresp.http.X-MediaWiki-Original  req.url ~ 
^/+[^/]+/[^/]+/thumb/[^/]+/[^/]+/[^/]+/[0-9]+px-) {
+   set beresp.http.X-MediaWiki-Original = regsub(req.url, 
^(/+[^/]+/[^/]+/)thumb/([^/]+/[^/]+/[^/]+).*$, \1\2);
+   }
+
return (deliver);
 }
 
diff --git a/templates/varnish/upload-frontend.inc.vcl.erb 
b/templates/varnish/upload-frontend.inc.vcl.erb
index 5ac95ab..574f033 100644
--- a/templates/varnish/upload-frontend.inc.vcl.erb
+++ b/templates/varnish/upload-frontend.inc.vcl.erb
@@ -76,6 +76,8 @@
 }
 
 sub vcl_deliver {
+   unset resp.http.X-MediaWiki-Original;
+
if (resp.http.X-Content-Range) {
set resp.http.Content-Range = resp.http.X-Content-Range;
remove resp.http.X-Content-Range;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c93e62aea4c1331e257bd0a9844ac8ed8f8a1ad
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Mark Bergsma m...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Derive the corresponding original URL and store it with the ... - change (operations/puppet)

2013-12-13 Thread Mark Bergsma (Code Review)
Mark Bergsma has submitted this change and it was merged.

Change subject: Derive the corresponding original URL and store it with the 
thumb
..


Derive the corresponding original URL and store it with the thumb

Change-Id: I5c93e62aea4c1331e257bd0a9844ac8ed8f8a1ad
---
M templates/varnish/upload-backend.inc.vcl.erb
M templates/varnish/upload-frontend.inc.vcl.erb
2 files changed, 7 insertions(+), 0 deletions(-)

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



diff --git a/templates/varnish/upload-backend.inc.vcl.erb 
b/templates/varnish/upload-backend.inc.vcl.erb
index 3ffd411..56d30da 100644
--- a/templates/varnish/upload-backend.inc.vcl.erb
+++ b/templates/varnish/upload-backend.inc.vcl.erb
@@ -126,6 +126,11 @@
set beresp.http.X-Content-Range = beresp.http.Content-Range;
}
 
+   # Derive the corresponding original URL and store it with the object
+   if (!beresp.http.X-MediaWiki-Original  req.url ~ 
^/+[^/]+/[^/]+/thumb/[^/]+/[^/]+/[^/]+/[0-9]+px-) {
+   set beresp.http.X-MediaWiki-Original = regsub(req.url, 
^(/+[^/]+/[^/]+/)thumb/([^/]+/[^/]+/[^/]+).*$, \1\2);
+   }
+
return (deliver);
 }
 
diff --git a/templates/varnish/upload-frontend.inc.vcl.erb 
b/templates/varnish/upload-frontend.inc.vcl.erb
index 5ac95ab..574f033 100644
--- a/templates/varnish/upload-frontend.inc.vcl.erb
+++ b/templates/varnish/upload-frontend.inc.vcl.erb
@@ -76,6 +76,8 @@
 }
 
 sub vcl_deliver {
+   unset resp.http.X-MediaWiki-Original;
+
if (resp.http.X-Content-Range) {
set resp.http.Content-Range = resp.http.X-Content-Range;
remove resp.http.X-Content-Range;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5c93e62aea4c1331e257bd0a9844ac8ed8f8a1ad
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Mark Bergsma m...@wikimedia.org
Gerrit-Reviewer: Mark Bergsma m...@wikimedia.org
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 tests; cache expects cachetime now - change (mediawiki...Flow)

2013-12-13 Thread Matthias Mullie (Code Review)
Matthias Mullie has uploaded a new change for review.

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


Change subject: Fix tests; cache expects cachetime now
..

Fix tests; cache expects cachetime now

Change-Id: I3f85daf0973c468686c07d26375c3a8dc242676d
---
M tests/IndexTest.php
1 file changed, 6 insertions(+), 2 deletions(-)


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

diff --git a/tests/IndexTest.php b/tests/IndexTest.php
index 17c1495..6c4a113 100644
--- a/tests/IndexTest.php
+++ b/tests/IndexTest.php
@@ -5,8 +5,10 @@
 class IndexTest extends \MediaWikiTestCase {
 
public function testShallow() {
+   global $wgFlowCacheTime;
+
$bag = new \HashBagOStuff;
-   $cache = new Data\BufferedCache( $bag );
+   $cache = new Data\BufferedCache( $bag, $wgFlowCacheTime );
 
// As we are only testing the cached result, storage should 
never be called
// not sure how to test that
@@ -47,8 +49,10 @@
}
 
public function testCompositeShallow() {
+   global $wgFlowCacheTime;
+
$bag = new \HashBagOStuff;
-   $cache = new \Flow\Data\BufferedCache( $bag );
+   $cache = new \Flow\Data\BufferedCache( $bag, $wgFlowCacheTime );
$storage = $this-getMock( 'Flow\\Data\\ObjectStorage' );
 
$unique = new \Flow\Data\UniqueFeatureIndex(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f85daf0973c468686c07d26375c3a8dc242676d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie mmul...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Several tweaks to the extension - change (mediawiki...SemanticWebBrowser)

2013-12-13 Thread bkaempgen (Code Review)
bkaempgen has submitted this change and it was merged.

Change subject: Several tweaks to the extension
..


Several tweaks to the extension

* added check for the call of the extension
* changed extension's URL to https

Change-Id: I1a53a7b45815f057a6e3bf2b4f849ccc5d01faff
---
M SWB_Settings.php
M SemanticWebBrowser.php
2 files changed, 15 insertions(+), 5 deletions(-)

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



diff --git a/SWB_Settings.php b/SWB_Settings.php
index d8ed203..c332836 100644
--- a/SWB_Settings.php
+++ b/SWB_Settings.php
@@ -21,10 +21,14 @@
 $wgExtensionCredits['semantic'][] = array(
'path'= __FILE__,
'name'= 'Semantic Web Browser',
-   'version' =  '0.4',
-   'author'  =  array( '[http://www.b-kaempgen.de 
Benedikt#160;Kämpgen]', 'Anna Kantorovitch', 'Andreas Adler' ),
-   'url' =  
'http://www.mediawiki.org/wiki/Extension:Semantic_Web_Browser',
-   'descriptionmsg' =  'swb_desc'
+   'version' = '0.4',
+   'author'  = array(
+   '[http://www.b-kaempgen.de Benedikt#160;Kämpgen]',
+   'Anna Kantorovitch',
+   'Andreas Adler'
+   ),
+   'url' = 
'https://www.mediawiki.org/wiki/Extension:Semantic_Web_Browser',
+   'descriptionmsg' = 'swb_desc'
 );
 
 /**
@@ -34,4 +38,4 @@
 $swbgToolboxBrowseSemWeb = true;
 
 // load global constants and setup functions
-require_once( $swbgIP . 'SemanticWebBrowser.php' );
\ No newline at end of file
+require_once( $swbgIP . 'SemanticWebBrowser.php' );
diff --git a/SemanticWebBrowser.php b/SemanticWebBrowser.php
index 136d2c1..cd8a79a 100644
--- a/SemanticWebBrowser.php
+++ b/SemanticWebBrowser.php
@@ -6,6 +6,12 @@
  * @ingroup SWB
  */
 
+// ask if we are being called directly
+if ( !defined( 'MEDIAWIKI' ) ) {
+die( 'Not an entry point.' );
+}
+
+// load settings file
 require_once dirname( __FILE__ ) . '/SWB_Settings.php';
 
 /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1a53a7b45815f057a6e3bf2b4f849ccc5d01faff
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SemanticWebBrowser
Gerrit-Branch: master
Gerrit-Owner: Kghbln mediaw...@kghoffmeyer.de
Gerrit-Reviewer: bkaempgen benedikt.kaemp...@kit.edu

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


[MediaWiki-commits] [Gerrit] Test case for redlink handling - change (mediawiki...Flow)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Test case for redlink handling
..


Test case for redlink handling

Change-Id: I7546e344d9d5b7844678c75ee891e29e76a305d7
---
M includes/ParsoidUtils.php
A tests/TemplatingTest.php
2 files changed, 79 insertions(+), 1 deletion(-)

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



diff --git a/includes/ParsoidUtils.php b/includes/ParsoidUtils.php
index 9e2bea9..ecab337 100644
--- a/includes/ParsoidUtils.php
+++ b/includes/ParsoidUtils.php
@@ -195,7 +195,7 @@
);
if ( $errors ) {
throw new \MWException(
-   implode( \n, array_map( $errors, function( 
$error ) { return $error-message; } ) )
+   implode( \n, array_map( function( $error ) { 
return $error-message; }, $errors ) )
);
}
 
diff --git a/tests/TemplatingTest.php b/tests/TemplatingTest.php
new file mode 100644
index 000..edc213e
--- /dev/null
+++ b/tests/TemplatingTest.php
@@ -0,0 +1,78 @@
+?php
+
+namespace Flow;
+
+use Title;
+
+class TemplatingTest extends \MediaWikiTestCase {
+
+   // Default values for PostRevision::newFromRow to work
+   static protected $postRow = array(
+   'rev_id' = null,
+   'rev_user_id' = null,
+   'rev_user_text' = null,
+   'rev_parent_id' = null,
+   'rev_change_type' = null,
+   'rev_flags' = null,
+   'rev_content' = null,
+   'rev_mod_state' = null,
+   'rev_mod_user_id' = null,
+   'rev_mod_user_text' = null,
+   'rev_mod_timestamp' = null,
+   'tree_parent_id' = null,
+   'tree_rev_id' = null,
+   'tree_rev_descendant_id' = null,
+   'tree_orig_create_time' = null,
+   'tree_orig_user_id' = null,
+   'tree_orig_user_text' = null,
+   );
+
+   static public function redLinkProvider() {
+   return array(
+   array(
+   'Basic redlink application',
+   // title text from parsoid
+   'Talk:Flow/Bugs',
+   // expect string
+   // @fixme easily breakable, depends on url order
+   htmlentities( 
'Talk:Flow/Bugsaction=editredlink=1' ),
+   ),
+
+   array(
+   'Subpage redlink application',
+   // title text from parsoid
+   '/SubPage',
+   // expect string
+   htmlentities( 
'Main_Page/SubPageaction=editredlink=1' ),
+   ),
+   );
+   }
+
+   /**
+* @dataProvider redLinkProvider
+*/
+   public function testRedLinks( $message, $saHref, $expect ) {
+   // needs a page to resolve subpage links against
+   $this-setMwGlobals( 'wgTitle', Title::newMainPage() );
+
+   $parsoid = htmlentities( json_encode( array( 'sa' = array( 
'href' = $saHref ) ) ) );
+   $rev = Model\PostRevision::fromStorageRow( array(
+   'rev_content' = 'a rel=mw:WikiLink data-parsoid=' 
. $parsoid . '/a',
+   'rev_flags' = 'html'
+   ) + self::$postRow );
+
+   $content = $this-mockTemplating()-getContent( $rev, 'html' );
+   $this-assertContains( $expect, $content, $message );
+   }
+
+   protected function mockTemplating() {
+   $urlGenerator = $this-getMockBuilder( 'Flow\UrlGenerator' )
+   -disableOriginalConstructor()
+   -getMock();
+   $output = $this-getMockBuilder( 'OutputPage' )
+   -disableOriginalConstructor()
+   -getMock();
+
+   return new Templating( $urlGenerator, $output );
+   }
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7546e344d9d5b7844678c75ee891e29e76a305d7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson ebernhard...@wikimedia.org
Gerrit-Reviewer: Matthias Mullie mmul...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Rename $wgCirrusSearchContentReplicaCount to $wgCirrusSearch... - change (mediawiki...CirrusSearch)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Rename $wgCirrusSearchContentReplicaCount to 
$wgCirrusSearchReplicaCount
..


Rename $wgCirrusSearchContentReplicaCount to $wgCirrusSearchReplicaCount

Bug: 58097
Change-Id: I89f3dedc127730d9698d134d9346252b4568931c
---
M CirrusSearch.php
M README
M maintenance/updateOneSearchIndexConfig.php
3 files changed, 8 insertions(+), 8 deletions(-)

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



diff --git a/CirrusSearch.php b/CirrusSearch.php
index e65aea0..8655f3c 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -49,7 +49,7 @@
 // The default of 0 is fine for single-node setups, but if this is
 // deployed to a multi-node setting you probably at least want these
 // set to 1 for some redundancy, if not 2 for more redundancy.
-$wgCirrusSearchContentReplicaCount = array( 'content' = 0, 'general' = 0 );
+$wgCirrusSearchReplicaCount = array( 'content' = 0, 'general' = 0 );
 
 // By default, Cirrus will organize pages into one of two indexes (general or
 // content) based on whether a page is in a content namespace. This should
@@ -58,7 +58,7 @@
 // the value is a string name of what index suffix to use. Changing this 
setting
 // requires a full reindex (not in-place) of the wiki.  If this setting 
contains
 // any values then the index names must also exist in $wgCirrusSearchShardCount
-// and $wgCirrusSearchContentReplicaCount.
+// and $wgCirrusSearchReplicaCount.
 $wgCirrusSearchNamespaceMappings = array();
 
 // Extra indexes (if any) you want to search, and for what namespaces?
diff --git a/README b/README
index 7e0a374..7589d1e 100644
--- a/README
+++ b/README
@@ -15,7 +15,7 @@
  $wgCirrusSearchServers = array( 'elasticsearch0', 'elasticsearch1', 
'elasticsearch2', 'elasticsearch3' );
 There are other $wgCirrusSearch variables that you might want to change from 
their defaults.
 In production setups, you will very likely want to increase the number of 
replicas using
-$wgCirrusSearchContentReplicaCount.
+$wgCirrusSearchReplicaCount.
 If you want to change them then set their new values with 
$wgCirrusSearchServers in LocalSettings.php.
 
 Now run this script to generate your elasticsearch index:
@@ -173,7 +173,7 @@
 during upgrades.  More replicas will help distribute queries across more 
nodes.  Having more
 replicas than nodes doesn't make sense and Elasticsearch will stay yellow if 
you do that.
 Anyway, you should add this to LocalSettings.php to change it:
- $wgCirrusSearchContentReplicaCount = array( 'content' = 2, 'general' = 2 );
+ $wgCirrusSearchReplicaCount = array( 'content' = 2, 'general' = 2 );
 
 
 Testing
diff --git a/maintenance/updateOneSearchIndexConfig.php 
b/maintenance/updateOneSearchIndexConfig.php
index af629ed..319fdab 100644
--- a/maintenance/updateOneSearchIndexConfig.php
+++ b/maintenance/updateOneSearchIndexConfig.php
@@ -682,12 +682,12 @@
}
 
private function getReplicaCount() {
-   global $wgCirrusSearchContentReplicaCount;
-   if ( !isset( $wgCirrusSearchContentReplicaCount[ 
$this-indexType ] ) ) {
+   global $wgCirrusSearchReplicaCount;
+   if ( !isset( $wgCirrusSearchReplicaCount[ $this-indexType ] ) 
) {
$this-error( 'Could not find a replica count for ' . 
$this-indexType . '.  Did you add an index to ' .
-   '$wgCirrusSearchNamespaceMappings but forget to 
add it to $wgCirrusSearchContentReplicaCount?', 1 );
+   '$wgCirrusSearchNamespaceMappings but forget to 
add it to $wgCirrusSearchReplicaCount?', 1 );
}
-   return $wgCirrusSearchContentReplicaCount[ $this-indexType ];
+   return $wgCirrusSearchReplicaCount[ $this-indexType ];
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I89f3dedc127730d9698d134d9346252b4568931c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Chad ch...@wikimedia.org
Gerrit-Reviewer: Manybubbles never...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] role::parsoid::beta must allow port 8080 - change (operations/puppet)

2013-12-13 Thread Hashar (Code Review)
Hashar has uploaded a new change for review.

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


Change subject: role::parsoid::beta must allow port 8080
..

role::parsoid::beta must allow port 8080

When adding role::beta:natfixup on parsoid2 instance, it started
refusing connection on port 8000. The reason being that the ferm rules
come with a default policy of DROP.

bug: 45868
Change-Id: I36f2bcbeacedf24aa6deaa9739669ca86cd8820c
---
M manifests/role/parsoid.pp
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/10/101210/1

diff --git a/manifests/role/parsoid.pp b/manifests/role/parsoid.pp
index cf34429..dcccff8 100644
--- a/manifests/role/parsoid.pp
+++ b/manifests/role/parsoid.pp
@@ -91,4 +91,12 @@
 group  = wikidev,
 mode   = '2775',
 }
+
+# Beta parsoid server has some ferm DNAT rewriting rules (bug 45868) so we
+# have to explicitly allow parsoid port 8000
+ferm::service { 'http':
+proto = 'tcp',
+port  = '8000'
+}
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I36f2bcbeacedf24aa6deaa9739669ca86cd8820c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar has...@free.fr

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


[MediaWiki-commits] [Gerrit] beta: ferm on appservers must allow port 80 - change (operations/puppet)

2013-12-13 Thread Hashar (Code Review)
Hashar has uploaded a new change for review.

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


Change subject: beta: ferm on appservers must allow port 80
..

beta: ferm on appservers must allow port 80

When adding role::beta::natfixup on beta Apache, they started refusing
connection on port 80. The reason being that the ferm rules come with a
default policy of DROP.

bug: 45868
Change-Id: I170d5e9b0f530086b93589295dd88018e274782c
---
M manifests/role/applicationserver.pp
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/09/101209/1

diff --git a/manifests/role/applicationserver.pp 
b/manifests/role/applicationserver.pp
index ea5c523..3520a77 100644
--- a/manifests/role/applicationserver.pp
+++ b/manifests/role/applicationserver.pp
@@ -169,6 +169,14 @@
include imagescaler::cron,
imagescaler::packages,
imagescaler::files
+
+   # Beta application servers have some ferm DNAT rewriting rules 
(bug
+   # 45868) so we have to explicitly allow http (port 80)
+   ferm::service { 'http':
+   proto = 'tcp',
+   port  = 'http'
+   }
+
}
class appserver::api{
system::role { role::applicationserver::appserver::api: 
description = Api Apache Application server }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I170d5e9b0f530086b93589295dd88018e274782c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar has...@free.fr

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


[MediaWiki-commits] [Gerrit] beta: ferm on appservers must allow port 80 - change (operations/puppet)

2013-12-13 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged.

Change subject: beta: ferm on appservers must allow port 80
..


beta: ferm on appservers must allow port 80

When adding role::beta::natfixup on beta Apache, they started refusing
connection on port 80. The reason being that the ferm rules come with a
default policy of DROP.

bug: 45868
Change-Id: I170d5e9b0f530086b93589295dd88018e274782c
---
M manifests/role/applicationserver.pp
1 file changed, 8 insertions(+), 0 deletions(-)

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



diff --git a/manifests/role/applicationserver.pp 
b/manifests/role/applicationserver.pp
index ea5c523..3520a77 100644
--- a/manifests/role/applicationserver.pp
+++ b/manifests/role/applicationserver.pp
@@ -169,6 +169,14 @@
include imagescaler::cron,
imagescaler::packages,
imagescaler::files
+
+   # Beta application servers have some ferm DNAT rewriting rules 
(bug
+   # 45868) so we have to explicitly allow http (port 80)
+   ferm::service { 'http':
+   proto = 'tcp',
+   port  = 'http'
+   }
+
}
class appserver::api{
system::role { role::applicationserver::appserver::api: 
description = Api Apache Application server }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I170d5e9b0f530086b93589295dd88018e274782c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar has...@free.fr
Gerrit-Reviewer: ArielGlenn ar...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] role::parsoid::beta must allow port 8000 - change (operations/puppet)

2013-12-13 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged.

Change subject: role::parsoid::beta must allow port 8000
..


role::parsoid::beta must allow port 8000

When adding role::beta:natfixup on parsoid2 instance, it started
refusing connection on port 8000. The reason being that the ferm rules
come with a default policy of DROP.

bug: 45868
Change-Id: I36f2bcbeacedf24aa6deaa9739669ca86cd8820c
---
M manifests/role/parsoid.pp
1 file changed, 8 insertions(+), 0 deletions(-)

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



diff --git a/manifests/role/parsoid.pp b/manifests/role/parsoid.pp
index cf34429..dcccff8 100644
--- a/manifests/role/parsoid.pp
+++ b/manifests/role/parsoid.pp
@@ -91,4 +91,12 @@
 group  = wikidev,
 mode   = '2775',
 }
+
+# Beta parsoid server has some ferm DNAT rewriting rules (bug 45868) so we
+# have to explicitly allow parsoid port 8000
+ferm::service { 'http':
+proto = 'tcp',
+port  = '8000'
+}
+
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I36f2bcbeacedf24aa6deaa9739669ca86cd8820c
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar has...@free.fr
Gerrit-Reviewer: ArielGlenn ar...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Filter the display of content via a hook - change (mediawiki...Flow)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Filter the display of content via a hook
..


Filter the display of content via a hook

This new hook, FlowCheckHtmlContentXss, allows for a callback
to easily be added which allows or rejects the display of
stored html content.  When we find the next xss in parsoid this
will allow preventing that html for exploting the next viewer.

Change-Id: I6587113073993b12c12499f896bd27501697d486
Mingle: 401
---
M includes/Model/AbstractRevision.php
M includes/ParsoidUtils.php
M includes/Templating.php
3 files changed, 41 insertions(+), 18 deletions(-)

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



diff --git a/includes/Model/AbstractRevision.php 
b/includes/Model/AbstractRevision.php
index c721484..e9c4ea6 100644
--- a/includes/Model/AbstractRevision.php
+++ b/includes/Model/AbstractRevision.php
@@ -68,6 +68,10 @@
protected $decompressedContent;
// Converted (wikitext|html) content, based off of 
$this-decompressedContent
protected $convertedContent = array();
+   // html content has been allowed by the xss check.  When we find the 
next xss
+   // in the parser this hook allows preventing any disply of hostile 
html. True
+   // means the content is allowed. False means not allowed. Null means 
unchecked
+   protected $xssCheck;
 
// moderation states for the revision.  This is technically 
denormalized data
// since it can be overwritten and does not provide a full history.
@@ -274,7 +278,7 @@
return $this-moderationState === self::MODERATED_HIDDEN;
}
 
-   public function getContentRaw() {
+   private function getContentRaw() {
if ( $this-decompressedContent === null ) {
$this-decompressedContent = 
\Revision::decompressRevisionText( $this-content, $this-flags );
}
@@ -291,13 +295,25 @@
 * @return string
 */
public function getContent( $format = 'html' ) {
+   if ( $this-xssCheck === false ) {
+   return '';
+   }
+   $raw = $this-getContentRaw();
+   $sourceFormat = in_array( 'html', $this-flags ) ? 'html' : 
'wikitext';
+   if ( $this-xssCheck === null  $sourceFormat === 'html' ) {
+   // returns true if no handler aborted the hook
+   $this-xssCheck = wfRunHooks( 
'FlowCheckHtmlContentXss', array( $raw ) );
+   if ( !$this-xssCheck ) {
+   return '';
+   }
+   }
+
if ( !$this-isFormatted() ) {
-   return $this-getContentRaw();
+   return $raw;
}
if ( !isset( $this-convertedContent[$format] ) ) {
-   // check how content is stored  convert to requested 
format
-   $sourceFormat = in_array( 'html', $this-flags ) ? 
'html' : 'wikitext';
-   $this-convertedContent[$format] = 
ParsoidUtils::convert( $sourceFormat, $format, $this-getContentRaw() );
+   // convert to requested format
+   $this-convertedContent[$format] = 
ParsoidUtils::convert( $sourceFormat, $format, $raw );
}
 
return $this-convertedContent[$format];
diff --git a/includes/ParsoidUtils.php b/includes/ParsoidUtils.php
index 9e2bea9..031124b 100644
--- a/includes/ParsoidUtils.php
+++ b/includes/ParsoidUtils.php
@@ -92,7 +92,8 @@
}
 
// HTML is wrapped in body tag, undo that.
-   if ( $to == 'html' ) {
+   // unless $response is empty
+   if ( $to == 'html'  $response ) {
/*
 * Workaround because DOMDocument can't guess charset.
 * Parsoid provides utf-8. Alternative workarounds 
would be to
diff --git a/includes/Templating.php b/includes/Templating.php
index fe6d51d..fccb688 100644
--- a/includes/Templating.php
+++ b/includes/Templating.php
@@ -378,6 +378,10 @@
 * @return string
 */
protected function applyRedlinks( $content ) {
+   if ( !$content ) {
+   return '';
+   }
+
/*
 * In order to efficiently replace redlinks, multiple recursive
 * functions (may) have been registered that fetch an array of 
linked-to
@@ -496,20 +500,22 @@
 
// find links in DOM
$content = $post-getContent( 'html' );
-   $dom = ParsoidUtils::createDOM( $content );
-   $xpath = new \DOMXPath( $dom );
-   $linkNodes = $xpath-query( 
'//a[@rel=mw:WikiLink][@data-parsoid]' );
+   if ( $content 

[MediaWiki-commits] [Gerrit] Move all CirrusSearch hooks into one file - change (mediawiki...CirrusSearch)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Move all CirrusSearch hooks into one file
..


Move all CirrusSearch hooks into one file

This will help keep the CirrusSearch class from getting bloated and
puts all of these static things in one single place.

Change-Id: Ie6cc4dfe71982c816fcef77a2e17e8009d9155d5
---
M CirrusSearch.php
M includes/CirrusSearch.body.php
A includes/CirrusSearchHooks.php
M includes/CirrusSearchUpdater.php
4 files changed, 153 insertions(+), 109 deletions(-)

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



diff --git a/CirrusSearch.php b/CirrusSearch.php
index af6602f..1e5b4c2 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -199,6 +199,7 @@
  */
 $wgAutoloadClasses['CirrusSearch'] = $includes . 'CirrusSearch.body.php';
 $wgAutoloadClasses['CirrusSearchAnalysisConfigBuilder'] = $includes . 
'CirrusSearchAnalysisConfigBuilder.php';
+$wgAutoloadClasses['CirrusSearchHooks'] = $includes . 'CirrusSearchHooks.php';
 $wgAutoloadClasses['CirrusSearchConnection'] = $includes . 
'CirrusSearchConnection.php';
 $wgAutoloadClasses['CirrusSearchDeletePagesJob'] = $includes . 
'CirrusSearchDeletePagesJob.php';
 $wgAutoloadClasses['CirrusSearchLinksUpdateJob'] = $includes . 
'CirrusSearchLinksUpdateJob.php';
@@ -220,13 +221,13 @@
 /**
  * Hooks
  */
-$wgHooks[ 'ApiBeforeMain' ][] = 'CirrusSearch::apiBeforeMainHook';
-$wgHooks[ 'ArticleDeleteComplete' ][] = 
'CirrusSearch::articleDeleteCompleteHook';
-$wgHooks[ 'BeforeInitialize' ][] = 'CirrusSearch::beforeInitializeHook';
-$wgHooks[ 'GetBetaFeaturePreferences' ][] = 'CirrusSearch::getPreferencesHook';
-$wgHooks[ 'LinksUpdateComplete' ][] = 
'CirrusSearchUpdater::linksUpdateCompletedHook';
-$wgHooks[ 'SoftwareInfo' ][] = 'CirrusSearch::softwareInfoHook';
-$wgHooks[ 'SpecialSearchResultsPrepend' ][] = 
'CirrusSearch::specialSearchResultsPrependHook';
+$wgHooks[ 'ApiBeforeMain' ][] = 'CirrusSearchHooks::apiBeforeMainHook';
+$wgHooks[ 'ArticleDeleteComplete' ][] = 
'CirrusSearchHooks::articleDeleteCompleteHook';
+$wgHooks[ 'BeforeInitialize' ][] = 'CirrusSearchHooks::beforeInitializeHook';
+$wgHooks[ 'GetBetaFeaturePreferences' ][] = 
'CirrusSearchHooks::getPreferencesHook';
+$wgHooks[ 'LinksUpdateComplete' ][] = 
'CirrusSearchHooks::linksUpdateCompletedHook';
+$wgHooks[ 'SoftwareInfo' ][] = 'CirrusSearchHooks::softwareInfoHook';
+$wgHooks[ 'SpecialSearchResultsPrepend' ][] = 
'CirrusSearchHooks::specialSearchResultsPrependHook';
 
 /**
  * i18n
diff --git a/includes/CirrusSearch.body.php b/includes/CirrusSearch.body.php
index 43da983..25bd867 100644
--- a/includes/CirrusSearch.body.php
+++ b/includes/CirrusSearch.body.php
@@ -104,92 +104,4 @@
}
return $term;
}
-
-   public static function articleDeleteCompleteHook( $page, $user, 
$reason, $id ) {
-   // Note that we must use the article id provided or it'll be 
lost in the ether.  The job can't
-   // load it from the title because the page row has already been 
deleted.
-   JobQueueGroup::singleton()-push( 
CirrusSearchDeletePagesJob::build(
-   $page-getTitle(), $id ) );
-   }
-
-
-   public static function softwareInfoHook( $software ) {
-   $version = CirrusSearchSearcher::getElasticsearchVersion();
-   if ( $version-isOk() ) {
-   // We've already logged if this isn't ok and there is 
no need to warn the user on this page.
-   $software[ '[http://www.elasticsearch.org/ 
Elasticsearch]' ] = $version-getValue();
-   }
-   }
-
-   public static function specialSearchResultsPrependHook( $specialSearch, 
$out, $term ) {
-   global $wgCirrusSearchShowNowUsing;
-   if ( $wgCirrusSearchShowNowUsing ) {
-   $out-addHtml( Xml::openElement( 'div', array( 'class' 
= 'cirrussearch-now-using' ) ) .
-   $specialSearch-msg( 'cirrussearch-now-using' 
)-parse() .
-   Xml::closeElement( 'div' ) );
-   }
-   return true;
-   }
-
-   /**
-* Adds using CirrusSearch as default as a BetaFeature
-* @param User $user
-* @param array $prefs
-* @return bool
-*/
-   public static function getPreferencesHook( $user, $prefs ) {
-   global $wgCirrusSearchEnablePref;
-
-   if ( $wgCirrusSearchEnablePref ) {
-   $prefs['cirrussearch-default'] = array(
-   'label-message' = 'cirrussearch-pref-label',
-   'desc-message' = 'cirrussearch-pref-desc',
-   'info-link' = 
'https://www.mediawiki.org/wiki/Search',
-   'discussion-link' = 
'https://www.mediawiki.org/wiki/Talk:Search',
-   

[MediaWiki-commits] [Gerrit] failing on Chrome, need some when_present statements - change (qa/browsertests)

2013-12-13 Thread Cmcmahon (Code Review)
Cmcmahon has uploaded a new change for review.

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


Change subject: failing on Chrome, need some when_present statements
..

failing on Chrome, need some when_present statements

Change-Id: I36ef567efa5aafdb356df76dbee55e50a3ec9768
---
M features/step_definitions/hotcat_steps.rb
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests 
refs/changes/11/101211/1

diff --git a/features/step_definitions/hotcat_steps.rb 
b/features/step_definitions/hotcat_steps.rb
index f864cae..728bd7f 100644
--- a/features/step_definitions/hotcat_steps.rb
+++ b/features/step_definitions/hotcat_steps.rb
@@ -14,15 +14,15 @@
 end
 
 When(/^I click the Categories link$/) do
-  on(HotcatPage).categories_link
+  on(HotcatPage).categories_link_element.when_present.click
 end
 
 When(/^I click the Modify several categories button$/) do
-  on(HotcatPage).modify_several_categories
+  on(HotcatPage).modify_several_categories_element.when_present.click
 end
 
 Then(/^a Save button is visible$/) do
-  on(HotcatPage).save_button_element.should be_visible
+  on(HotcatPage).save_button_element.when_present.should be_visible
 end
 
 Then(/^an Add new categories link is visible$/) do
@@ -34,11 +34,11 @@
 end
 
 Then(/^I can click Cancel and click Add new category$/) do
-  on(HotcatPage).cancel
+  on(HotcatPage).cancel_element.when_present.click
   step I click the Add a new category link
 end
 
 Then(/^I can click OK and click Add new category$/) do
-  on(HotcatPage).ok
+  on(HotcatPage).ok_element.when_present.click
   step I click the Add a new category link
 end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I36ef567efa5aafdb356df76dbee55e50a3ec9768
Gerrit-PatchSet: 1
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon cmcma...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] wait for login to finish, see https://wmf.ci.cloudbees.com/j... - change (qa/browsertests)

2013-12-13 Thread Cmcmahon (Code Review)
Cmcmahon has uploaded a new change for review.

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


Change subject: wait for login to finish, see 
https://wmf.ci.cloudbees.com/job/browsertests-test2.wikipedia.org-windows-internet_explorer_9/650/testReport/junit/(root)/Edit/Go_to_edit_page/
..

wait for login to finish, see 
https://wmf.ci.cloudbees.com/job/browsertests-test2.wikipedia.org-windows-internet_explorer_9/650/testReport/junit/(root)/Edit/Go_to_edit_page/

Change-Id: Ib228a2a71aacf80cbe385fe2c63f3cea5537352d
---
M features/step_definitions/upload_wizard_steps.rb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests 
refs/changes/12/101212/1

diff --git a/features/step_definitions/upload_wizard_steps.rb 
b/features/step_definitions/upload_wizard_steps.rb
index 64a2292..a93fff1 100644
--- a/features/step_definitions/upload_wizard_steps.rb
+++ b/features/step_definitions/upload_wizard_steps.rb
@@ -11,7 +11,7 @@
 #
 Given(/^I am logged in$/) do
   visit(LoginPage).login_with(ENV[MEDIAWIKI_USER], ENV[MEDIAWIKI_PASSWORD])
-  on(LoginPage).logout_link_element.when_present.should be_visible
+  on(LoginPage).logout_link_element.when_present(15).should be_visible
 end
 
 When(/^click button Continue$/) do

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib228a2a71aacf80cbe385fe2c63f3cea5537352d
Gerrit-PatchSet: 1
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon cmcma...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Disable external entity loading in libxml - change (mediawiki...Flow)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Disable external entity loading in libxml
..


Disable external entity loading in libxml

Per comments on https://gerrit.wikimedia.org/r/#/c/99164/ we
should be disabling entity loading via libxml_disable_entity_loader

Change-Id: I2d50c837e828808c572220a86d35f13f44022a7e
---
M includes/ParsoidUtils.php
1 file changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/includes/ParsoidUtils.php b/includes/ParsoidUtils.php
index 9e2bea9..1899a57 100644
--- a/includes/ParsoidUtils.php
+++ b/includes/ParsoidUtils.php
@@ -177,14 +177,17 @@
public static function createDOM( $content, $ignoreErrorCodes = array( 
801 ) ) {
$dom = new \DOMDocument();
 
-   // Otherwise the parser may attempt to load the dtd from an 
external source
-   $dom-resolveExternals = false;
+   // Otherwise the parser may attempt to load the dtd from an 
external source.
+   // See: 
https://www.mediawiki.org/wiki/XML_External_Entity_Processing
+   $loadEntities = libxml_disable_entity_loader( true );
 
// don't output warnings
$useErrors = libxml_use_internal_errors( true );
 
$dom-loadHTML( $content );
 
+   libxml_disable_entity_loader( $loadEntities );
+
// check error codes; if not in the supplied list of ignorable 
errors,
// throw an exception
$errors = array_filter(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2d50c837e828808c572220a86d35f13f44022a7e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson ebernhard...@wikimedia.org
Gerrit-Reviewer: CSteipp cste...@wikimedia.org
Gerrit-Reviewer: Matthias Mullie mmul...@wikimedia.org
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 Accept-Language feature[1] for PhantomJS - change (mediawiki/selenium)

2013-12-13 Thread Zfilipin (Code Review)
Zfilipin has uploaded a new change for review.

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


Change subject: Fix Accept-Language feature[1] for PhantomJS
..

Fix Accept-Language feature[1] for PhantomJS

1:
https://github.com/wikimedia/mediawiki-extensions-UniversalLanguageSelec
tor/blob/master/tests/browser/features/accept_language.feature

Bug: 49813
Change-Id: Ib398ef439fda4307b266de03493a8947695a95a4
---
M lib/mediawiki/selenium/env.rb
1 file changed, 9 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium 
refs/changes/13/101213/1

diff --git a/lib/mediawiki/selenium/env.rb b/lib/mediawiki/selenium/env.rb
index e6a2f1a..2ea9a22 100644
--- a/lib/mediawiki/selenium/env.rb
+++ b/lib/mediawiki/selenium/env.rb
@@ -46,13 +46,19 @@
   else
 if browser_label == :firefox
   profile = Selenium::WebDriver::Firefox::Profile.new
+  profile[intl.accept_languages] = language
+  Watir::Browser.new browser_label, profile: profile
 elsif browser_label == :chrome
   profile = Selenium::WebDriver::Chrome::Profile.new
+  profile[intl.accept_languages] = language
+  Watir::Browser.new browser_label, profile: profile
+elsif browser_label == :phantomjs
+  capabilities = Selenium::WebDriver::Remote::Capabilities.phantomjs
+  capabilities['phantomjs.page.customHeaders.Accept-Language'] = language
+  Watir::Browser.new browser_label, desired_capabilities: capabilities
 else
-  raise Changing default language is currently supported only for Firefox 
and Chrome!
+  raise Changing default language is currently supported only for Chrome, 
Firefox and PhantomJS!
 end
-profile[intl.accept_languages] = language
-Watir::Browser.new browser_label, :profile = profile
   end
 end
 def sauce_api(json)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib398ef439fda4307b266de03493a8947695a95a4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/selenium
Gerrit-Branch: master
Gerrit-Owner: Zfilipin zfili...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] user-job-throttle - change (mediawiki...GWToolset)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: user-job-throttle
..


user-job-throttle

the number of gwtoolsetUploadMediafileJobs allowed to be added by a
gwtoolsetUploadMetadataJob was throttled by a value the user had no
control over. while testing the extension we realized that this value
is too generic and that the end user should have some control over
its setting.

Bug: 58417
Change-Id: I8fc0850bdf7b65b9e7ef2dd41c1b96901fd91828
---
M GWToolset.i18n.php
M includes/Config.php
M includes/Forms/MetadataDetectForm.php
M includes/Forms/MetadataMappingForm.php
M includes/Handlers/Forms/MetadataDetectHandler.php
M includes/Handlers/Forms/MetadataMappingHandler.php
M includes/Handlers/UploadHandler.php
M includes/Handlers/Xml/XmlMappingHandler.php
M includes/Jobs/UploadMetadataJob.php
M includes/Utils.php
10 files changed, 176 insertions(+), 16 deletions(-)

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



diff --git a/GWToolset.i18n.php b/GWToolset.i18n.php
index 82484bc..9d16b66 100644
--- a/GWToolset.i18n.php
+++ b/GWToolset.i18n.php
@@ -41,6 +41,7 @@
'gwtoolset-no-accepted-types' = 'No accepted types provided',
'gwtoolset-no-callback' = 'No callback passed to this method.',
'gwtoolset-no-comment' = codeuser_options['comment']/code not 
set.,
+   'gwtoolset-no-default' = 'No default value provided.',
'gwtoolset-no-field-size' = 'No field size specified for the field 
$1.',
'gwtoolset-no-file-backend-name' = 'No file backend name provided.',
'gwtoolset-no-file-backend-container' = 'No file backend container 
name provided.',
@@ -48,7 +49,10 @@
'gwtoolset-no-form-handler' = 'No form handler created.',
'gwtoolset-no-mapping' = 'No codemapping_name/code provided.',
'gwtoolset-no-mapping-json' = 'No codemapping_json/code provided.',
+   'gwtoolset-no-max' = 'No maximum value provided.',
+   'gwtoolset-no-mediafile-throttle' = 'No mediafile job throttle 
provided.',
'gwtoolset-no-mediawiki-template' = 'No 
codemediawiki-template-name/code provided.',
+   'gwtoolset-no-min' = 'No minimum value provided.',
'gwtoolset-no-module' = 'No module name was specified.',
'gwtoolset-no-mwstore-complete-path' = 'No complete file path 
provided.',
'gwtoolset-no-mwstore-relative-path' = 'No relative path provided.',
@@ -136,6 +140,8 @@
'gwtoolset-accepted-file-types' = 'Accepted file 
{{PLURAL:$1|type|types}}:',
'gwtoolset-ensure-well-formed-xml' = 'Make sure the XML file is 
well-formed with this $1.',
'gwtoolset-file-url-invalid' = 'The file URL was invalid; The file 
does not yet exist in the wiki. You need to first upload the file from your 
computer if you want to use the file URL reference in the form.',
+   'gwtoolset-mediafile-throttle' = 'Mediafile throttle:',
+   'gwtoolset-mediafile-throttle-description' = 'The throttle controls 
the load Wikimedia Commons will put on your media server during the batch 
upload. You can set the throttle between 1-20 where the number corresponds to 
the number of media requests per minute.',
'gwtoolset-mediawiki-template-does-not-exist' = 'MediaWiki template 
strong$1/strong does not exist in the wiki.
 
 Either import the template or select another MediaWiki template to use for 
mapping.',
@@ -297,7 +303,9 @@
'gwtoolset-ignorewarnings' = 'Hint to the developer that appears when 
ignorewarnings is not set.',
'gwtoolset-incorrect-form-handler' = 'A developer message that appears 
when a module does not specify a form handler that extends 
GWToolset\\Handlers\\Forms\\FormHandler.',
'gwtoolset-job-throttle-exceeded' = 'Developer message that appears 
when the batch job throttle was exceeded.',
-   'gwtoolset-no-accepted-types' = 'Hint to the developer that appears 
when no accepted types are provided.
+   'gwtoolset-mediafile-throttle' = 'Mediafile throttle label for the 
HTML form.',
+   'gwtoolset-mediafile-throttle-description' = 'User description of the 
mediafile throttle.',
+'gwtoolset-no-accepted-types' = 'Hint to the developer that appears when no 
accepted types are provided.
 
 Used if code$accepted_metadata_types/code (metadata types the extension 
accepts) is empty.
 
@@ -305,6 +313,7 @@
 * $1 - (Unused) gwtoolset-no-accepted-types-provided (untranslatable)',
'gwtoolset-no-callback' = 'Hint to the developer that appears when no 
callback is given.',
'gwtoolset-no-comment' = Hint to the developer that appears when 
user_options['comment'] is not set.,
+   'gwtoolset-no-default' = 'Developer message that appears when no 
default value was provided.',
'gwtoolset-no-field-size' = 'Developer message that appears when no 
field size was specified for the field. Parameters:
 * $1 

[MediaWiki-commits] [Gerrit] Bump patch version to 0.1.15 - change (mediawiki/selenium)

2013-12-13 Thread Zfilipin (Code Review)
Zfilipin has uploaded a new change for review.

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


Change subject: Bump patch version to 0.1.15
..

Bump patch version to 0.1.15

Change-Id: Icc032d997281e99cecce60da03143d9c9cf30f95
---
M lib/mediawiki/selenium/version.rb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium 
refs/changes/14/101214/1

diff --git a/lib/mediawiki/selenium/version.rb 
b/lib/mediawiki/selenium/version.rb
index 409e06a..1782df4 100644
--- a/lib/mediawiki/selenium/version.rb
+++ b/lib/mediawiki/selenium/version.rb
@@ -11,6 +11,6 @@
 
 module Mediawiki
   module Selenium
-VERSION = 0.1.14
+VERSION = 0.1.15
   end
 end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc032d997281e99cecce60da03143d9c9cf30f95
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/selenium
Gerrit-Branch: master
Gerrit-Owner: Zfilipin zfili...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Put the submit button back inside the form - change (mediawiki...Flow)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Put the submit button back inside the form
..


Put the submit button back inside the form

Change-Id: Ie995890bb190b020f9ff4f09b11e309097be4c33
---
M includes/View/PostActionMenu.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/View/PostActionMenu.php b/includes/View/PostActionMenu.php
index 6350ee0..81d1fd8 100644
--- a/includes/View/PostActionMenu.php
+++ b/includes/View/PostActionMenu.php
@@ -136,7 +136,7 @@
'class' = $class,
'value' = $content,
'title' = strip_tags( $content ),
-   ) ) .
+   ) );
$output[] = Html::closeElement( 'form' );
 
return implode( '', $output );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie995890bb190b020f9ff4f09b11e309097be4c33
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson ebernhard...@wikimedia.org
Gerrit-Reviewer: Matthias Mullie mmul...@wikimedia.org
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 Accept-Language feature for PhantomJS - change (mediawiki...UniversalLanguageSelector)

2013-12-13 Thread Zfilipin (Code Review)
Zfilipin has uploaded a new change for review.

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


Change subject: Fix Accept-Language feature for PhantomJS
..

Fix Accept-Language feature for PhantomJS

mediawiki-selenium 0.1.15 is needed to make it work

Change-Id: I2e0e5d85e167e85262cb357f3a48f3336b848f6e
---
M tests/browser/Gemfile.lock
M tests/browser/features/accept_language.feature
2 files changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/tests/browser/Gemfile.lock b/tests/browser/Gemfile.lock
index 130bf90..e069435 100644
--- a/tests/browser/Gemfile.lock
+++ b/tests/browser/Gemfile.lock
@@ -21,7 +21,7 @@
   multi_json (~ 1.3)
 i18n (0.6.9)
 json (1.8.1)
-mediawiki-selenium (0.1.14)
+mediawiki-selenium (0.1.15)
   cucumber
   json
   net-http-persistent
@@ -49,7 +49,7 @@
   multi_json (~ 1.0)
   rubyzip (~ 1.0)
   websocket (~ 1.0.4)
-syntax (1.0.0)
+syntax (1.1.0)
 watir-webdriver (0.6.4)
   selenium-webdriver (= 2.18.0)
 websocket (1.0.7)
diff --git a/tests/browser/features/accept_language.feature 
b/tests/browser/features/accept_language.feature
index 7e7faaa..036a131 100644
--- a/tests/browser/features/accept_language.feature
+++ b/tests/browser/features/accept_language.feature
@@ -1,5 +1,5 @@
 # On phantomjs, we need to figure out a way to pass the accept language header.
-@language @phantomjs-bug @sandbox.translatewiki.net
+@language @sandbox.translatewiki.net
 Feature: Accept-Language
 
   Scenario Outline: Accept-Language

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e0e5d85e167e85262cb357f3a48f3336b848f6e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Zfilipin zfili...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Temporarily punch holes for hooft and bast4001 - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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


Change subject: Temporarily punch holes for hooft and bast4001
..

Temporarily punch holes for hooft and bast4001

hooft and bast4001 are technically bastion hosts however they do not
have that class applied to them. Moreover that class would not punch
holes right now cause it lacks the corresponding rules. An effort for
that is at gerrit #96424.
In the meantime punch holes directly in site.pp for this and two (2)
other 2 unpuppetized services (rsync/udpmcast). Finally create a virtual
resources for ganglia aggreator that will only be realized on hosts that
include base::firewall

Change-Id: I055e9b0bc1c7a0b5fc6a3d4f307aaa964060d08b
---
M manifests/site.pp
M modules/ganglia_new/manifests/monitor/aggregator/instance.pp
2 files changed, 32 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/16/101216/1

diff --git a/manifests/site.pp b/manifests/site.pp
index 75cd4ac..3cd2302 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -292,6 +292,14 @@
 misc::management::ipmi,
 role::installserver::tftp-server
 
+# TODO: should have bastionhost class and it should open ssh access
+# but it is ready yet. Fix and remove this. tftp-server includes
+# base::firewall and policy is set to DROP
+ferm::service { 'ssh':
+proto   = 'tcp',
+port= 'ssh',
+}
+
 }
 
 node beryllium.wikimedia.org {
@@ -1140,6 +1148,25 @@
 admins::mortals,
 admins::restricted
 
+# TODO: 2013-12-13. rsync is an unpuppetized service on hooft. Ferms is
+# applied through role::installserver::tftp-server and policy is DROP.
+# Temporarily opening access. Must puppetize properly
+ferm::service { 'rsync':
+proto = 'tcp',
+port  = '873',
+}
+# TODO: Same for udpmcast
+ferm::service { 'udpmcast':
+proto = 'udp',
+port  = '4827',
+}
+# TODO: should have bastionhost class and it should open ssh access
+# but it is ready yet. Fix and remove this
+ferm::service { 'ssh':
+proto   = 'tcp',
+port= 'ssh',
+}
+
 class { ganglia_new::monitor::aggregator: sites = [esams] }
 }
 
diff --git a/modules/ganglia_new/manifests/monitor/aggregator/instance.pp 
b/modules/ganglia_new/manifests/monitor/aggregator/instance.pp
index c0e217a..f758f98 100644
--- a/modules/ganglia_new/manifests/monitor/aggregator/instance.pp
+++ b/modules/ganglia_new/manifests/monitor/aggregator/instance.pp
@@ -25,6 +25,11 @@
$ensure = absent
}
 
+# This will only be realized if base::firewall (well ferm..) is included
+@ferm::rule {
+rule = proto udp dport ${gmond_port} { saddr \$ALL_NETWORKS ACCEPT; 
}
+}
+
file { /etc/ganglia/aggregators/${id}.conf:
require = File[/etc/ganglia/aggregators],
mode = 0444,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I055e9b0bc1c7a0b5fc6a3d4f307aaa964060d08b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Made RepoGroup use ProcessCacheLRU - change (mediawiki/core)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Made RepoGroup use ProcessCacheLRU
..


Made RepoGroup use ProcessCacheLRU

Change-Id: I322a6cf15566bde4fc5ee5bfa1be5fdc680cd763
---
M includes/cache/MapCacheLRU.php
M includes/filerepo/RepoGroup.php
2 files changed, 8 insertions(+), 39 deletions(-)

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



diff --git a/includes/cache/MapCacheLRU.php b/includes/cache/MapCacheLRU.php
index 3539d8f..26d3ec4 100644
--- a/includes/cache/MapCacheLRU.php
+++ b/includes/cache/MapCacheLRU.php
@@ -28,6 +28,7 @@
  *
  * @see ProcessCacheLRU
  * @ingroup Cache
+ * @since 1.23
  */
 class MapCacheLRU {
/** @var Array */
diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php
index 1a7ae34..039f435 100644
--- a/includes/filerepo/RepoGroup.php
+++ b/includes/filerepo/RepoGroup.php
@@ -38,7 +38,7 @@
protected $localInfo;
protected $foreignInfo;
 
-   /** @var array  */
+   /** @var ProcessCacheLRU  */
protected $cache;
 
/** @var RepoGroup */
@@ -94,7 +94,7 @@
function __construct( $localInfo, $foreignInfo ) {
$this-localInfo = $localInfo;
$this-foreignInfo = $foreignInfo;
-   $this-cache = array();
+   $this-cache = new ProcessCacheLRU( self::MAX_CACHE_SIZE );
}
 
/**
@@ -136,13 +136,8 @@
) {
$time = isset( $options['time'] ) ? $options['time'] : 
'';
$dbkey = $title-getDBkey();
-   if ( isset( $this-cache[$dbkey][$time] ) ) {
-   wfDebug( __METHOD__ . : got File:$dbkey from 
process cache\n );
-   # Move it to the end of the list so that we can 
delete the LRU entry later
-   $this-pingCache( $dbkey );
-
-   # Return the entry
-   return $this-cache[$dbkey][$time];
+   if ( $this-cache-has( $dbkey, $time, 60 ) ) {
+   return $this-cache-get( $dbkey, $time );
}
$useCache = true;
} else {
@@ -165,8 +160,7 @@
$image = $image ? $image : false; // type sanity
# Cache file existence or non-existence
if ( $useCache  ( !$image || $image-isCacheable() ) ) {
-   $this-trimCache();
-   $this-cache[$dbkey][$time] = $image;
+   $this-cache-set( $dbkey, $time, $image );
}
 
return $image;
@@ -435,40 +429,14 @@
}
 
/**
-* Move a cache entry to the top (such as when accessed)
-*/
-   protected function pingCache( $key ) {
-   if ( isset( $this-cache[$key] ) ) {
-   $tmp = $this-cache[$key];
-   unset( $this-cache[$key] );
-   $this-cache[$key] = $tmp;
-   }
-   }
-
-   /**
-* Limit cache memory
-*/
-   protected function trimCache() {
-   while ( count( $this-cache ) = self::MAX_CACHE_SIZE ) {
-   reset( $this-cache );
-   $key = key( $this-cache );
-   wfDebug( __METHOD__ . : evicting $key\n );
-   unset( $this-cache[$key] );
-   }
-   }
-
-   /**
 * Clear RepoGroup process cache used for finding a file
 * @param $title Title|null Title of the file or null to clear all files
 */
public function clearCache( Title $title = null ) {
if ( $title == null ) {
-   $this-cache = array();
+   $this-cache-clear();
} else {
-   $dbKey = $title-getDBkey();
-   if ( isset( $this-cache[$dbKey] ) ) {
-   unset( $this-cache[$dbKey] );
-   }
+   $this-cache-clear( $title-getDBkey() );
}
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I322a6cf15566bde4fc5ee5bfa1be5fdc680cd763
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz asch...@wikimedia.org
Gerrit-Reviewer: Brian Wolff bawolff...@gmail.com
Gerrit-Reviewer: BryanDavis bda...@wikimedia.org
Gerrit-Reviewer: IAlex coderev...@emsenhuber.ch
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Temporarily punch holes for hooft and bast4001 - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Temporarily punch holes for hooft and bast4001
..


Temporarily punch holes for hooft and bast4001

hooft and bast4001 are technically bastion hosts however they do not
have that class applied to them. Moreover that class would not punch
holes right now cause it lacks the corresponding rules. An effort for
that is at gerrit #96424.
In the meantime punch holes directly in site.pp for this and two (2)
other 2 unpuppetized services (rsync/udpmcast). Finally create
ferm::rule resources for ganglia aggreator that will only be realized
on hosts that include base::firewall

Change-Id: I055e9b0bc1c7a0b5fc6a3d4f307aaa964060d08b
---
M manifests/site.pp
M modules/ganglia_new/manifests/monitor/aggregator/instance.pp
2 files changed, 32 insertions(+), 0 deletions(-)

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



diff --git a/manifests/site.pp b/manifests/site.pp
index 75cd4ac..3cd2302 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -292,6 +292,14 @@
 misc::management::ipmi,
 role::installserver::tftp-server
 
+# TODO: should have bastionhost class and it should open ssh access
+# but it is ready yet. Fix and remove this. tftp-server includes
+# base::firewall and policy is set to DROP
+ferm::service { 'ssh':
+proto   = 'tcp',
+port= 'ssh',
+}
+
 }
 
 node beryllium.wikimedia.org {
@@ -1140,6 +1148,25 @@
 admins::mortals,
 admins::restricted
 
+# TODO: 2013-12-13. rsync is an unpuppetized service on hooft. Ferms is
+# applied through role::installserver::tftp-server and policy is DROP.
+# Temporarily opening access. Must puppetize properly
+ferm::service { 'rsync':
+proto = 'tcp',
+port  = '873',
+}
+# TODO: Same for udpmcast
+ferm::service { 'udpmcast':
+proto = 'udp',
+port  = '4827',
+}
+# TODO: should have bastionhost class and it should open ssh access
+# but it is ready yet. Fix and remove this
+ferm::service { 'ssh':
+proto   = 'tcp',
+port= 'ssh',
+}
+
 class { ganglia_new::monitor::aggregator: sites = [esams] }
 }
 
diff --git a/modules/ganglia_new/manifests/monitor/aggregator/instance.pp 
b/modules/ganglia_new/manifests/monitor/aggregator/instance.pp
index c0e217a..2e91e02 100644
--- a/modules/ganglia_new/manifests/monitor/aggregator/instance.pp
+++ b/modules/ganglia_new/manifests/monitor/aggregator/instance.pp
@@ -25,6 +25,11 @@
$ensure = absent
}
 
+   # This will only be realized if base::firewall (well ferm..) is included
+   ferm::rule { aggregator-${id}:
+   rule = proto udp dport ${gmond_port} { saddr \$ALL_NETWORKS 
ACCEPT; },
+   }
+
file { /etc/ganglia/aggregators/${id}.conf:
require = File[/etc/ganglia/aggregators],
mode = 0444,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I055e9b0bc1c7a0b5fc6a3d4f307aaa964060d08b
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Wait for login to finish - change (qa/browsertests)

2013-12-13 Thread Zfilipin (Code Review)
Zfilipin has submitted this change and it was merged.

Change subject: Wait for login to finish
..


Wait for login to finish

See 
https://wmf.ci.cloudbees.com/job/browsertests-test2.wikipedia.org-windows-internet_explorer_9/650/testReport/junit/(root)/Edit/Go_to_edit_page/

Change-Id: Ib228a2a71aacf80cbe385fe2c63f3cea5537352d
---
M features/step_definitions/upload_wizard_steps.rb
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/features/step_definitions/upload_wizard_steps.rb 
b/features/step_definitions/upload_wizard_steps.rb
index 64a2292..a93fff1 100644
--- a/features/step_definitions/upload_wizard_steps.rb
+++ b/features/step_definitions/upload_wizard_steps.rb
@@ -11,7 +11,7 @@
 #
 Given(/^I am logged in$/) do
   visit(LoginPage).login_with(ENV[MEDIAWIKI_USER], ENV[MEDIAWIKI_PASSWORD])
-  on(LoginPage).logout_link_element.when_present.should be_visible
+  on(LoginPage).logout_link_element.when_present(15).should be_visible
 end
 
 When(/^click button Continue$/) do

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib228a2a71aacf80cbe385fe2c63f3cea5537352d
Gerrit-PatchSet: 2
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon cmcma...@wikimedia.org
Gerrit-Reviewer: Jhall jh...@wikimedia.org
Gerrit-Reviewer: Zfilipin zfili...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] failing on Chrome, need some when_present statements - change (qa/browsertests)

2013-12-13 Thread Zfilipin (Code Review)
Zfilipin has submitted this change and it was merged.

Change subject: failing on Chrome, need some when_present statements
..


failing on Chrome, need some when_present statements

Change-Id: I36ef567efa5aafdb356df76dbee55e50a3ec9768
---
M features/step_definitions/hotcat_steps.rb
1 file changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Jhall: Looks good to me, but someone else must approve
  Zfilipin: Looks good to me, approved



diff --git a/features/step_definitions/hotcat_steps.rb 
b/features/step_definitions/hotcat_steps.rb
index f864cae..728bd7f 100644
--- a/features/step_definitions/hotcat_steps.rb
+++ b/features/step_definitions/hotcat_steps.rb
@@ -14,15 +14,15 @@
 end
 
 When(/^I click the Categories link$/) do
-  on(HotcatPage).categories_link
+  on(HotcatPage).categories_link_element.when_present.click
 end
 
 When(/^I click the Modify several categories button$/) do
-  on(HotcatPage).modify_several_categories
+  on(HotcatPage).modify_several_categories_element.when_present.click
 end
 
 Then(/^a Save button is visible$/) do
-  on(HotcatPage).save_button_element.should be_visible
+  on(HotcatPage).save_button_element.when_present.should be_visible
 end
 
 Then(/^an Add new categories link is visible$/) do
@@ -34,11 +34,11 @@
 end
 
 Then(/^I can click Cancel and click Add new category$/) do
-  on(HotcatPage).cancel
+  on(HotcatPage).cancel_element.when_present.click
   step I click the Add a new category link
 end
 
 Then(/^I can click OK and click Add new category$/) do
-  on(HotcatPage).ok
+  on(HotcatPage).ok_element.when_present.click
   step I click the Add a new category link
 end

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I36ef567efa5aafdb356df76dbee55e50a3ec9768
Gerrit-PatchSet: 1
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon cmcma...@wikimedia.org
Gerrit-Reviewer: Jhall jh...@wikimedia.org
Gerrit-Reviewer: Zfilipin zfili...@wikimedia.org
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 patch version to 0.1.14 - change (mediawiki/selenium)

2013-12-13 Thread Cmcmahon (Code Review)
Cmcmahon has submitted this change and it was merged.

Change subject: Bump patch version to 0.1.14
..


Bump patch version to 0.1.14

Change-Id: Ib21f927217498ff69256a273ecf93c8f86c1057b
---
M lib/mediawiki/selenium/version.rb
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Cmcmahon: Looks good to me, approved



diff --git a/lib/mediawiki/selenium/version.rb 
b/lib/mediawiki/selenium/version.rb
index cfb781e..409e06a 100644
--- a/lib/mediawiki/selenium/version.rb
+++ b/lib/mediawiki/selenium/version.rb
@@ -11,6 +11,6 @@
 
 module Mediawiki
   module Selenium
-VERSION = 0.1.13
+VERSION = 0.1.14
   end
 end

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib21f927217498ff69256a273ecf93c8f86c1057b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/selenium
Gerrit-Branch: master
Gerrit-Owner: Zfilipin zfili...@wikimedia.org
Gerrit-Reviewer: Cmcmahon cmcma...@wikimedia.org
Gerrit-Reviewer: Hashar has...@free.fr
Gerrit-Reviewer: Jhall jh...@wikimedia.org
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 patch version to 0.1.15 - change (mediawiki/selenium)

2013-12-13 Thread Cmcmahon (Code Review)
Cmcmahon has submitted this change and it was merged.

Change subject: Bump patch version to 0.1.15
..


Bump patch version to 0.1.15

Change-Id: Icc032d997281e99cecce60da03143d9c9cf30f95
---
M lib/mediawiki/selenium/version.rb
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/lib/mediawiki/selenium/version.rb 
b/lib/mediawiki/selenium/version.rb
index 409e06a..1782df4 100644
--- a/lib/mediawiki/selenium/version.rb
+++ b/lib/mediawiki/selenium/version.rb
@@ -11,6 +11,6 @@
 
 module Mediawiki
   module Selenium
-VERSION = 0.1.14
+VERSION = 0.1.15
   end
 end

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icc032d997281e99cecce60da03143d9c9cf30f95
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/selenium
Gerrit-Branch: master
Gerrit-Owner: Zfilipin zfili...@wikimedia.org
Gerrit-Reviewer: Cmcmahon cmcma...@wikimedia.org
Gerrit-Reviewer: Jhall jh...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Also open ganglia TCP ports - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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


Change subject: Also open ganglia TCP ports
..

Also open ganglia TCP ports

Forgotten in aa76364

Change-Id: I1a6ac915e739c3ea115462611feb2cf26b5d73d2
---
M modules/ganglia_new/manifests/monitor/aggregator/instance.pp
1 file changed, 5 insertions(+), 1 deletion(-)


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

diff --git a/modules/ganglia_new/manifests/monitor/aggregator/instance.pp 
b/modules/ganglia_new/manifests/monitor/aggregator/instance.pp
index 2e91e02..29c49b8 100644
--- a/modules/ganglia_new/manifests/monitor/aggregator/instance.pp
+++ b/modules/ganglia_new/manifests/monitor/aggregator/instance.pp
@@ -26,9 +26,13 @@
}
 
# This will only be realized if base::firewall (well ferm..) is included
-   ferm::rule { aggregator-${id}:
+   ferm::rule { aggregator-udp-${id}:
rule = proto udp dport ${gmond_port} { saddr \$ALL_NETWORKS 
ACCEPT; },
}
+   # This will only be realized if base::firewall (well ferm..) is included
+   ferm::rule { aggregator-tcp-${id}:
+   rule = proto tcp dport ${gmond_port} { saddr \$ALL_NETWORKS 
ACCEPT; },
+   }
 
file { /etc/ganglia/aggregators/${id}.conf:
require = File[/etc/ganglia/aggregators],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a6ac915e739c3ea115462611feb2cf26b5d73d2
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fix Accept-Language feature[1] for PhantomJS - change (mediawiki/selenium)

2013-12-13 Thread Cmcmahon (Code Review)
Cmcmahon has submitted this change and it was merged.

Change subject: Fix Accept-Language feature[1] for PhantomJS
..


Fix Accept-Language feature[1] for PhantomJS

1:
https://github.com/wikimedia/mediawiki-extensions-UniversalLanguageSelec
tor/blob/master/tests/browser/features/accept_language.feature

Bug: 49813
Change-Id: Ib398ef439fda4307b266de03493a8947695a95a4
---
M lib/mediawiki/selenium/env.rb
1 file changed, 9 insertions(+), 3 deletions(-)

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



diff --git a/lib/mediawiki/selenium/env.rb b/lib/mediawiki/selenium/env.rb
index e6a2f1a..2ea9a22 100644
--- a/lib/mediawiki/selenium/env.rb
+++ b/lib/mediawiki/selenium/env.rb
@@ -46,13 +46,19 @@
   else
 if browser_label == :firefox
   profile = Selenium::WebDriver::Firefox::Profile.new
+  profile[intl.accept_languages] = language
+  Watir::Browser.new browser_label, profile: profile
 elsif browser_label == :chrome
   profile = Selenium::WebDriver::Chrome::Profile.new
+  profile[intl.accept_languages] = language
+  Watir::Browser.new browser_label, profile: profile
+elsif browser_label == :phantomjs
+  capabilities = Selenium::WebDriver::Remote::Capabilities.phantomjs
+  capabilities['phantomjs.page.customHeaders.Accept-Language'] = language
+  Watir::Browser.new browser_label, desired_capabilities: capabilities
 else
-  raise Changing default language is currently supported only for Firefox 
and Chrome!
+  raise Changing default language is currently supported only for Chrome, 
Firefox and PhantomJS!
 end
-profile[intl.accept_languages] = language
-Watir::Browser.new browser_label, :profile = profile
   end
 end
 def sauce_api(json)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib398ef439fda4307b266de03493a8947695a95a4
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/selenium
Gerrit-Branch: master
Gerrit-Owner: Zfilipin zfili...@wikimedia.org
Gerrit-Reviewer: Amire80 amir.ahar...@mail.huji.ac.il
Gerrit-Reviewer: Cmcmahon cmcma...@wikimedia.org
Gerrit-Reviewer: Jhall jh...@wikimedia.org
Gerrit-Reviewer: KartikMistry kartik.mis...@gmail.com
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: Zfilipin zfili...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] comment out dysprosium in decomm list so configs cleanup won't - change (operations/puppet)

2013-12-13 Thread ArielGlenn (Code Review)
ArielGlenn has uploaded a new change for review.

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


Change subject: comment out dysprosium in decomm list so configs cleanup won't
..

comment out dysprosium in decomm list so configs cleanup won't

cut -d' -f 2 -s blah totally picks up the hostname as decommed
if you just slap a # in front

Change-Id: I7871d694af66467e469f45fad939fae1c96281be
---
M manifests/decommissioning.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/18/101218/1

diff --git a/manifests/decommissioning.pp b/manifests/decommissioning.pp
index ab24fcf..f64b114 100644
--- a/manifests/decommissioning.pp
+++ b/manifests/decommissioning.pp
@@ -39,7 +39,7 @@
 'db56',
 'db58',
 'db59',
-# 'dysprosium', add this back later when it's reclaimed
+#dysprosium -- add this back later when it is reclaimed
 'ms1',
 'ms2',#5994 decommed
 'ms3',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7871d694af66467e469f45fad939fae1c96281be
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn ar...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] comment out dysprosium in decomm list so configs cleanup won't - change (operations/puppet)

2013-12-13 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged.

Change subject: comment out dysprosium in decomm list so configs cleanup won't
..


comment out dysprosium in decomm list so configs cleanup won't

cut -d' -f 2 -s blah totally picks up the hostname as decommed
if you just slap a # in front

Change-Id: I7871d694af66467e469f45fad939fae1c96281be
---
M manifests/decommissioning.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/manifests/decommissioning.pp b/manifests/decommissioning.pp
index ab24fcf..f64b114 100644
--- a/manifests/decommissioning.pp
+++ b/manifests/decommissioning.pp
@@ -39,7 +39,7 @@
 'db56',
 'db58',
 'db59',
-# 'dysprosium', add this back later when it's reclaimed
+#dysprosium -- add this back later when it is reclaimed
 'ms1',
 'ms2',#5994 decommed
 'ms3',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7871d694af66467e469f45fad939fae1c96281be
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn ar...@wikimedia.org
Gerrit-Reviewer: ArielGlenn ar...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Cirrus config updates - change (operations/mediawiki-config)

2013-12-13 Thread Manybubbles (Code Review)
Manybubbles has uploaded a new change for review.

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


Change subject: Cirrus config updates
..

Cirrus config updates

* Set cirrus as secondary on all wikisources and commonswiki.
* Let all wiktionaries, wikimania, and wikimedia wikis have cirrus as a
beta feature.
* Rename $wgCirrusSearchContentReplicaCount to $wmgCirrusSearchReplicaCount
* Add support for setting $wgCirrusSearchNamespaceMappings and set it up
for commons.
* Add support for setting $wgCirrusSearchReplicaCount because it is required
for $wgCirrusSearchNamespaceMappings and set it for commons.
* Add support for settings $wgCirrusSearchShardCount because it is required
for $wgCirrusSearchNamespaceMappings and because we would like to change
the number of shards from Cirrus's defaults.
* Set number of shards for all wikis.  The default is a single shard.
Larger wikis will get more with the goal of each shard being about 2GB
with a bit of room to grow.
* Add warning to $wgContentNamespaces that changing it for Cirrus wikis
will remove the affected namespaces from search results until an full
reindex is completed.

Change-Id: If5e0f1bb4bb571a2ae5bb4bedfb52a2a7a10f706
---
M wmf-config/CirrusSearch-common.php
M wmf-config/InitialiseSettings.php
2 files changed, 104 insertions(+), 170 deletions(-)


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

diff --git a/wmf-config/CirrusSearch-common.php 
b/wmf-config/CirrusSearch-common.php
index 379c9f8..adba802 100644
--- a/wmf-config/CirrusSearch-common.php
+++ b/wmf-config/CirrusSearch-common.php
@@ -28,7 +28,8 @@
}
 }
 
-$wgCirrusSearchContentReplicaCount = array( 'content' = 2, 'general' = 2 );
+$wgCirrusSearchShardCount = $wmgCirrusSearchShardCount;
+$wgCirrusSearchReplicaCount = $wmgCirrusSearchReplicaCount;
 $wgCirrusSearchUseAggressiveSplitting = $wmgCirrusSearchUseAggressiveSplitting;
 
 # Load per realm specific configuration, either:
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 452bc11..0c0a3ab 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -9202,6 +9202,8 @@
'foundationwiki' = true, // whee restricted site
 ),
 
+// Note that changing this for wikis with CirrusSearch will remove pages in the
+// the affected namespace from search results until a full reindex is 
completed.
 'wgContentNamespaces' = array(
'default' = array( NS_MAIN ),
'+arwiki' = array( 104 ), // bug 20623
@@ -12705,184 +12707,78 @@
'frwikisource' = true,
'nlwiki' = true,
'itwiki' = true,
+   'commonswiki' = true,
'wikidatawiki' = true,
'wikimania' = true,
'wikimedia' = true,
+   'wikisource' = true,
'wikivoyage' = true,
'wiktionary' = true,
 ),
 
 'wmgCirrusIsBuilding' = array(
'default' = false,
-   'arwikimedia' = true,
-   'bdwikimedia' = true,
-   'bewikimedia' = true,
-   'brwikimedia' = true,
-   'cowikimedia' = true,
-   'dkwikimedia' = true,
-   'etwikimedia' = true,
-   'fiwikimedia' = true,
-   'ilwikimedia' = true,
-   'mkwikimedia' = true,
-   'mxwikimedia' = true,
-   'nlwikimedia' = true,
-   'noboard_chapterswikimedia' = true,
-   'nowikimedia' = true,
-   'nycwikimedia' = true,
-   'plwikimedia' = true,
-   'rswikimedia' = true,
-   'ruwikimedia' = true,
-   'trwikimedia' = true,
-   'uawikimedia' = true,
-   'ukwikimedia' = true,
-   'wikimania2013wiki' = true,
-   'wikimania2014wiki' = true,
-   'afwiktionary' = true,
-   'amwiktionary' = true,
-   'angwiktionary' = true,
-   'anwiktionary' = true,
-   'arwiktionary' = true,
-   'astwiktionary' = true,
-   'aywiktionary' = true,
-   'azwiktionary' = true,
-   'bewiktionary' = true,
-   'bgwiktionary' = true,
-   'bnwiktionary' = true,
-   'brwiktionary' = true,
-   'bswiktionary' = true,
-   'cawiktionary' = true,
-   'chrwiktionary' = true,
-   'cowiktionary' = true,
-   'csbwiktionary' = true,
-   'cswiktionary' = true,
-   'cywiktionary' = true,
-   'dawiktionary' = true,
-   'dewiktionary' = true,
-   'dvwiktionary' = true,
-   'elwiktionary' = true,
-   'enwiktionary' = true,
-   'eowiktionary' = true,
-   'eswiktionary' = true,
-   'etwiktionary' = true,
-   'euwiktionary' = true,
-   'fawiktionary' = true,
-   'fiwiktionary' = true,
-   'fjwiktionary' = true,
-   'fowiktionary' = true,
-   'frwiktionary' = true,
-   'fywiktionary' = true,
-   'gawiktionary' = true,
-   'gdwiktionary' = true,
-   'glwiktionary' = true,
-   'gnwiktionary' = true,
-   'guwiktionary' = true,
-   'gvwiktionary' = true,
-   'hawiktionary' = true,
-   'hewiktionary' = 

[MediaWiki-commits] [Gerrit] Also open ganglia TCP ports - change (operations/puppet)

2013-12-13 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Also open ganglia TCP ports
..


Also open ganglia TCP ports

Forgotten in aa76364

Change-Id: I1a6ac915e739c3ea115462611feb2cf26b5d73d2
---
M modules/ganglia_new/manifests/monitor/aggregator/instance.pp
1 file changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/modules/ganglia_new/manifests/monitor/aggregator/instance.pp 
b/modules/ganglia_new/manifests/monitor/aggregator/instance.pp
index 2e91e02..29c49b8 100644
--- a/modules/ganglia_new/manifests/monitor/aggregator/instance.pp
+++ b/modules/ganglia_new/manifests/monitor/aggregator/instance.pp
@@ -26,9 +26,13 @@
}
 
# This will only be realized if base::firewall (well ferm..) is included
-   ferm::rule { aggregator-${id}:
+   ferm::rule { aggregator-udp-${id}:
rule = proto udp dport ${gmond_port} { saddr \$ALL_NETWORKS 
ACCEPT; },
}
+   # This will only be realized if base::firewall (well ferm..) is included
+   ferm::rule { aggregator-tcp-${id}:
+   rule = proto tcp dport ${gmond_port} { saddr \$ALL_NETWORKS 
ACCEPT; },
+   }
 
file { /etc/ganglia/aggregators/${id}.conf:
require = File[/etc/ganglia/aggregators],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1a6ac915e739c3ea115462611feb2cf26b5d73d2
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Redirect kr.wikimedia - change (operations/apache-config)

2013-12-13 Thread John F. Lewis (Code Review)
John F. Lewis has uploaded a new change for review.

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


Change subject: Redirect kr.wikimedia
..

Redirect kr.wikimedia

Redirect kr.wikimedia.org to Chapter page on metawiki.

Bug: 54883
Change-Id: Id8b00e74065855bba195a3635a27e307267452cf
---
M redirects.dat
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/apache-config 
refs/changes/20/101220/1

diff --git a/redirects.dat b/redirects.dat
index 581d66b..a7547fe 100644
--- a/redirects.dat
+++ b/redirects.dat
@@ -460,3 +460,6 @@
 funnel mobile.wikipedia.org//m.wikipedia.org
 rewrite*.mobile.wikipedia.org  //*.m.wikipedia.org
 rewrite*.wap.wikipedia.org //*.m.wikipedia.org
+
+# kr.wikimedia redirect - bugzilla #54883
+funnel  kr.wikimedia.org//meta.wikimedia.org/wiki/위키미디어_대한민국

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8b00e74065855bba195a3635a27e307267452cf
Gerrit-PatchSet: 1
Gerrit-Project: operations/apache-config
Gerrit-Branch: master
Gerrit-Owner: John F. Lewis johnflewi...@gmail.com
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Adding tests for collapsing and expanding sidebar sections - change (qa/browsertests)

2013-12-13 Thread Zfilipin (Code Review)
Zfilipin has submitted this change and it was merged.

Change subject: Adding tests for collapsing and expanding sidebar sections
..


Adding tests for collapsing and expanding sidebar sections

Bug: 48449
Change-Id: I42f2d5d9ec0b26d4e39cbe8ef355b306a6b93f7b
---
A features/sidebar.feature
A features/step_definitions/sidebar_steps.rb
M features/support/pages/main_page.rb
M features/support/pages/random_page.rb
4 files changed, 111 insertions(+), 0 deletions(-)

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



diff --git a/features/sidebar.feature b/features/sidebar.feature
new file mode 100644
index 000..9132935
--- /dev/null
+++ b/features/sidebar.feature
@@ -0,0 +1,49 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2013 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+@en.wikipedia.beta.wmflabs.org
+Feature: Sidebar
+
+  Scenario: Go to a random page and interaction should be expanded
+Given I am at random page
+Then Interaction section should be expanded
+
+  Scenario: Go to a random page and click interaction and it should collapse
+Given I am at random page
+When I click the interaction section
+Then Interaction section should be collapsed
+
+  Scenario: Go to a random page and print/export section should be collapsed
+Given I am at random page
+Then Print export section should be collapsed
+
+  Scenario: Go to a random page and click print/export and it should expand
+Given I am at random page
+When I click print export section
+Then Print export section should be expanded
+
+  Scenario: Go to a random page and tools section should be collapsed
+Given I am at random page
+Then Tools section should be collapsed
+
+  Scenario: Go to a random page and click tools and it should expand
+Given I am at random page
+When I click tools section
+Then Tools section should be expanded
+
+  Scenario: Go to the main page and languages section should be expanded
+Given I am at main page
+Then Languages section should be expanded
+
+  Scenario: Go to the main page and click languages and it should collapse
+Given I am at main page
+When I click languages section
+Then Languages section should be collapsed
diff --git a/features/step_definitions/sidebar_steps.rb 
b/features/step_definitions/sidebar_steps.rb
new file mode 100644
index 000..06a3c63
--- /dev/null
+++ b/features/step_definitions/sidebar_steps.rb
@@ -0,0 +1,56 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2013 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+Given(/^I am at main page$/) do
+  visit MainPage
+end
+Then(/^Interaction section should be expanded$/) do
+  on(RandomPage).community_portal_element.when_present.should be_visible
+end
+When(/^I click the interaction section$/) do
+  on(RandomPage).interaction_section_element.click
+end
+Then(/^Interaction section should be collapsed$/) do
+  on(RandomPage) do |page|
+page.community_portal_element.element.wait_while_present
+page.community_portal_element.should_not be_visible
+  end
+end
+Then(/^Print export section should be collapsed$/) do
+  on(RandomPage).download_as_pdf_element.should_not be_visible
+end
+When(/^I click print export section$/) do
+  on(RandomPage).print_export_element.click
+end
+Then(/^Print export section should be expanded$/) do
+  on(RandomPage).download_as_pdf_element.when_present.should be_visible
+end
+Then(/^Tools section should be collapsed$/) do
+  on(RandomPage).upload_file_element.should_not be_visible
+end
+When(/^I click tools section$/) do
+  on(RandomPage).tools_element.click
+end
+Then(/^Tools section should be expanded$/) do
+  on(RandomPage).upload_file_element.when_present.should be_visible
+end
+Then(/^Languages section should be expanded$/) do
+  on(MainPage).simple_english_element.should be_visible
+end
+When(/^I click languages section$/) do
+  on(MainPage).languages_element.click
+end
+Then(/^Languages section should be collapsed$/) do
+  on(MainPage) do |page|

[MediaWiki-commits] [Gerrit] i18n: Native digits on user id on preference - change (mediawiki/core)

2013-12-13 Thread Ebrahim (Code Review)
Ebrahim has uploaded a new change for review.

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


Change subject: i18n: Native digits on user id on preference
..

i18n: Native digits on user id on preference

Change-Id: Ia6c4f05ff8fa3f513650744df297a25e1cd6d94f
---
M includes/Preferences.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/includes/Preferences.php b/includes/Preferences.php
index e4c7a81..080b92b 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -191,6 +191,8 @@
$wgEnotifWatchlist, $wgEnotifUserTalk, 
$wgEnotifRevealEditorAddress,
$wgSecureLogin;
 
+   $lang = $context-getLanguage();
+
// retrieving user name for GENDER and misc.
$userName = $user-getName();
 
@@ -206,7 +208,7 @@
$defaultPreferences['userid'] = array(
'type' = 'info',
'label-message' = array( 'uid', $userName ),
-   'default' = $user-getId(),
+   'default' = $lang-formatNum( $user-getId() ),
'section' = 'personal/info',
);
 
@@ -226,8 +228,6 @@
}
asort( $userGroups );
asort( $userMembers );
-
-   $lang = $context-getLanguage();
 
$defaultPreferences['usergroups'] = array(
'type' = 'info',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6c4f05ff8fa3f513650744df297a25e1cd6d94f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ebrahim ebra...@byagowi.com

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


[MediaWiki-commits] [Gerrit] Show different messages to blocked users and anons - change (mediawiki...MediaWikiChat)

2013-12-13 Thread UltrasonicNXT (Code Review)
UltrasonicNXT has uploaded a new change for review.

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


Change subject: Show different messages to blocked users and anons
..

Show different messages to blocked users and anons

The same message was being shown to users who were blocked as to users who
were anons, and simply not allowed to chat.

https://github.com/Brickimedia/brickimedia/issues/128

Change-Id: Ieb6ca5bff044d199e714f26952621b92b8fabcba
---
M MediaWikiChat.i18n.php
M SpecialChat.php
2 files changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiChat 
refs/changes/22/101222/1

diff --git a/MediaWikiChat.i18n.php b/MediaWikiChat.i18n.php
index 6b1a8e6..ac135bc 100644
--- a/MediaWikiChat.i18n.php
+++ b/MediaWikiChat.i18n.php
@@ -17,6 +17,7 @@
'chat-type-your-private-message' = 'Type your private message',
'chat-no-other-users' = 'No other users on chat',
'chat-blocked-from-chat' = 'You have been blocked from this chat.',
+   'chat-not-allowed' = 'You are not allowed to chat, try logging in 
first',
'chat-just-now' = 'just now',
'chat-a-minute-ago' = 'a minute ago',
'chat-quarter-of-an-hour-ago' = 'quarter of an hour ago',
@@ -69,6 +70,7 @@
 $messages['qqq'] = array(
'chat' = 'Important! This is the string that appears on 
Special:SpecialPages',
'chat-desc' = '{{desc}}',
+   'chat-not-allowed' = 'Message shown to users who are not in the groups 
required to chat (normally users who are not logged in)',
'log-name-chat' = 'Name of the chat log as it appears on the drop-down 
menu on [[Special:Log]]',
'log-show-hide-chat' = 'For [[Special:Log]]. Parameters:
 * $1 - {{int:show}} or {{int:hide}}',
diff --git a/SpecialChat.php b/SpecialChat.php
index 008ffe3..bff1272 100644
--- a/SpecialChat.php
+++ b/SpecialChat.php
@@ -21,7 +21,12 @@
$this-setHeaders();
 
if ( !$this-getUser()-isAllowed( 'chat' ) ) {
-   $out-addWikiMsg( 'chat-blocked-from-chat' );
+   $groups = $this-getUser-getGroups();
+   if ( in_array( 'blockedfromchat', $groups ) ) {
+   $out-addWikiMsg( 'chat-blocked-from-chat' );
+   } else {
+   $out-addWikiMsg( 'chat-not-allowed' );
+   }
 
} else {
// Load modules via ResourceLoader

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb6ca5bff044d199e714f26952621b92b8fabcba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MediaWikiChat
Gerrit-Branch: master
Gerrit-Owner: UltrasonicNXT adamr_car...@btinternet.com

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


[MediaWiki-commits] [Gerrit] Add $wgChatWikiText - change (mediawiki...MediaWikiChat)

2013-12-13 Thread UltrasonicNXT (Code Review)
UltrasonicNXT has uploaded a new change for review.

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


Change subject: Add $wgChatWikiText
..

Add $wgChatWikiText

Default true, whether or not to parse messages through the MediaWiki
WikiText parser.
Also clean up some variable names in MediaWikiChat::parseMessage

Change-Id: I9a492c03d083046b42b547ccd6d24c2b49565bfb
---
M MediaWikiChat.php
M MediaWikiChatClass.php
2 files changed, 27 insertions(+), 21 deletions(-)


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

diff --git a/MediaWikiChat.php b/MediaWikiChat.php
index 5a055fd..ae5a72e 100644
--- a/MediaWikiChat.php
+++ b/MediaWikiChat.php
@@ -61,6 +61,7 @@
 // Config vars
 $wgChatKicks = false; // allow 'kicking' of users?
 $wgChatSocialAvatars = true; // use SocialProfile avatars?
+$wgChatWikiText = true; // allow the use of wikitext in chat?
 
 // Hooks
 $wgHooks['ParserBeforeInternalParse'][] = 
'MediaWikiChatHooks::onParserBeforeInternalParse';
diff --git a/MediaWikiChatClass.php b/MediaWikiChatClass.php
index 6e548db..2c5013c 100644
--- a/MediaWikiChatClass.php
+++ b/MediaWikiChatClass.php
@@ -152,13 +152,15 @@
 * @return String
 */
static function parseMessage( $message ) {
-   $s2 = wfMessage( 'smileys' )-plain();
-   $sm2 = explode( '* ', $s2 );
+   global $wgChatWikiText;
+
+   $rawSmileyData = wfMessage( 'smileys' )-plain();
+   $smileyData = explode( '* ', $rawSmileyData );
 
$smileys = array();
 
-   if ( is_array( $sm2 ) ) {
-   foreach ( $sm2 as $line ) {
+   if ( is_array( $smileyData ) ) {
+   foreach ( $smileyData as $line ) {
$bits = explode( ' ', $line );
 
if ( count( $bits )  1 ) {
@@ -186,28 +188,31 @@
 
$message = trim( $message );
 
-   $message = str_ireplace( '[[File:', '[[:File:', $message );
+   $message = str_ireplace( '[[File:', '[[:File:', $message ); // 
prevent users showing huge local images in chat
$message = str_ireplace( '[[!File:', '[[File:', $message );
 
-   $message = MWCHAT $message;
+   if ( $wgChatWikiText ) {
+   $message = MWCHAT $message; // flag to show the 
parser this is a chat message
 
-   $opts = new ParserOptions();
-   $opts-setEditSection( false );
-   $opts-setExternalLinkTarget( '_blank' );
-   $opts-setAllowSpecialInclusion( false );
-   $opts-setAllowExternalImages( false );
+   $opts = new ParserOptions();
+   $opts-setEditSection( false );
+   $opts-setExternalLinkTarget( '_blank' );
+   $opts-setAllowSpecialInclusion( false );
+   $opts-setAllowExternalImages( false );
 
-   $parser = new Parser();
-   $parseOut = $parser-parse(
-   $message,
-   SpecialPage::getTitleFor( 'Chat' ),
-   $opts
-   );
+   $parser = new Parser();
+   $parseOut = $parser-parse(
+   $message,
+   SpecialPage::getTitleFor( 'Chat' ),
+   $opts
+   );
 
-   $text = $parseOut-getText();
-   $text = str_replace( 'MWCHAT', '', $text );
-   $text = ltrim( $text );
-   return $text;
+   $message = $parseOut-getText();
+   $message = str_replace( 'MWCHAT', '', $message );
+   $message = ltrim( $message );
+   }
+
+   return $message;
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a492c03d083046b42b547ccd6d24c2b49565bfb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MediaWikiChat
Gerrit-Branch: master
Gerrit-Owner: UltrasonicNXT adamr_car...@btinternet.com

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


[MediaWiki-commits] [Gerrit] Fix WikiPage::prepareContentForEdit's default format handling - change (mediawiki/core)

2013-12-13 Thread Anomie (Code Review)
Anomie has uploaded a new change for review.

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


Change subject: Fix WikiPage::prepareContentForEdit's default format handling
..

Fix WikiPage::prepareContentForEdit's default format handling

If some caller passes null for the $serialization_format parameter,
they're going to break the in-memory caching of the prepared edit even
though it's likely that the format being used is the same as the format
being used by everything else.

It seems sensible to cache null as the default format for the content
object to avoid this.

Bug: 57026
Change-Id: I4ddcf6e388636e6a6397b664b8683ad774a09a04
---
M includes/WikiPage.php
1 file changed, 5 insertions(+), 0 deletions(-)


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

diff --git a/includes/WikiPage.php b/includes/WikiPage.php
index 7afc65c..0d987aa 100644
--- a/includes/WikiPage.php
+++ b/includes/WikiPage.php
@@ -2017,6 +2017,11 @@
$user = is_null( $user ) ? $wgUser : $user;
//XXX: check $user-getId() here???
 
+   // Use a sane default for $serialization_format, see bug 57026
+   if ( $serialization_format === null ) {
+   $serialization_format = 
$content-getContentHandler()-getDefaultFormat();
+   }
+
if ( $this-mPreparedEdit
 $this-mPreparedEdit-newContent
 $this-mPreparedEdit-newContent-equals( $content )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ddcf6e388636e6a6397b664b8683ad774a09a04
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie bjor...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fix typo bug in ve.EventSequencer onLoop - change (mediawiki...VisualEditor)

2013-12-13 Thread Divec (Code Review)
Divec has uploaded a new change for review.

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


Change subject: Fix typo bug in ve.EventSequencer onLoop
..

Fix typo bug in ve.EventSequencer onLoop

Change-Id: I2102c7eb3f8865ef403b01d8975359a4a212bf6c
---
M modules/ve/ve.EventSequencer.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/ve/ve.EventSequencer.js b/modules/ve/ve.EventSequencer.js
index 652cc85..c95cb6c 100644
--- a/modules/ve/ve.EventSequencer.js
+++ b/modules/ve/ve.EventSequencer.js
@@ -152,7 +152,7 @@
  * @param {Function[]} listeners Listeners that take no arguments
  */
 ve.EventSequencer.prototype.onLoop = function ( listeners ) {
-   this.onLoopListeners.push.apply( this.onLoopListeners, listeners );
+   Array.push.apply( this.onLoopListeners, listeners );
 };
 
 /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2102c7eb3f8865ef403b01d8975359a4a212bf6c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Divec da...@sheetmusic.org.uk

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


[MediaWiki-commits] [Gerrit] Generate language list from Lang - change (wikimedia/wikimania-scholarships)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Generate language list from Lang
..


Generate language list from Lang

Use the languages that are actually found on disk to generate the
language selection list.

Change-Id: Ifcb4073ee0c42932df7f4b24a220be25c2596958
---
M data/templates/base.html
1 file changed, 3 insertions(+), 6 deletions(-)

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



diff --git a/data/templates/base.html b/data/templates/base.html
index 0c329b2..53db3af 100644
--- a/data/templates/base.html
+++ b/data/templates/base.html
@@ -20,12 +20,9 @@
 div class=container
   div id=langbar class=fifteen columns
 ul class=langlist
-  {# FIXME: generate from wgLang #}
-  lia href={{ app.request.getPath }}?uselang=dede/a/li
-  lia href={{ app.request.getPath }}?uselang=enen/a/li
-  lia href={{ app.request.getPath }}?uselang=jaja/a/li
-  lia href={{ app.request.getPath }}?uselang=plpl/a/li
-  lia href={{ app.request.getPath }}?uselang=zhzh/a/li
+  {% for lang in wgLang.getLangs %}
+  lia href={{ app.request.getPath }}?uselang={{ lang }}{{ lang 
}}/a/li
+  {% endfor %}
   li class=lasta href={{ urlFor( 'translate' ) }}{{ 
wgLang.message( 'help-translate' ) }}/a/li
 /ul
   /div

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifcb4073ee0c42932df7f4b24a220be25c2596958
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/wikimania-scholarships
Gerrit-Branch: master
Gerrit-Owner: BryanDavis bda...@wikimedia.org
Gerrit-Reviewer: BryanDavis bda...@wikimedia.org
Gerrit-Reviewer: Chad ch...@wikimedia.org
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 session to remember language selection - change (wikimedia/wikimania-scholarships)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use session to remember language selection
..


Use session to remember language selection

Persist the user's language selection in their session.

Change-Id: I6c7047bfd5e6241bac636f84971600c742aaae57
---
M data/templates/base.html
M src/Wikimania/Scholarship/App.php
M src/Wikimania/Scholarship/Lang.php
3 files changed, 31 insertions(+), 14 deletions(-)

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



diff --git a/data/templates/base.html b/data/templates/base.html
index 53db3af..bd65184 100644
--- a/data/templates/base.html
+++ b/data/templates/base.html
@@ -1,3 +1,4 @@
+{% set lang = wgLang.getLang %}
 !DOCTYPE html
 !--[if lt IE 7 ]html class=ie ie6 no-js xml:lang={{ lang }} lang={{ 
lang }}![endif]--
 !--[if IE 7 ]html class=ie ie7 no-js xml:lang={{ lang }} lang={{ lang 
}}![endif]--
diff --git a/src/Wikimania/Scholarship/App.php 
b/src/Wikimania/Scholarship/App.php
index cb10c79..dad920b 100644
--- a/src/Wikimania/Scholarship/App.php
+++ b/src/Wikimania/Scholarship/App.php
@@ -57,6 +57,7 @@
'smtp.host' = self::config( 'SMTP_HOST', 'localhost' ),
'templates.path' = {$this-deployDir}/data/templates,
'i18n.path' = {$this-deployDir}/data/i18n,
+   'i18n.default' = 'en',
));
 
$slim = $this-slim;
@@ -143,7 +144,7 @@
});
 
$container-singleton( 'wgLang', function ( $c ) {
-   return new Lang( $c-settings['i18n.path'] );
+   return new Lang( $c-settings['i18n.path'], 
$c-settings['i18n.default'] );
});
 
$container-singleton( 'applyForm', function ( $c ) {
@@ -205,7 +206,6 @@
$view-replace( array(
'app' = $this-slim,
'wgLang' = $this-slim-wgLang,
-   'lang' = $this-slim-wgLang-setLang( $_REQUEST ),
) );
}
 
diff --git a/src/Wikimania/Scholarship/Lang.php 
b/src/Wikimania/Scholarship/Lang.php
index da62c44..f6d59b3 100644
--- a/src/Wikimania/Scholarship/Lang.php
+++ b/src/Wikimania/Scholarship/Lang.php
@@ -47,12 +47,18 @@
protected $langDir;
 
/**
-* @param string $dir Directory containing language files
+* @param string $defaultLang
 */
-   public function __construct( $dir ) {
+   protected $defaultLang;
+
+   /**
+* @param string $dir Directory containing language files
+* @param string $default Default language
+*/
+   public function __construct( $dir, $default = 'en' ) {
// TODO: assert that the dir exists
$this-langDir = $dir;
-   $this-lang = 'en';
+   $this-defaultLang = $default;
 
$messages = array();
foreach ( glob( {$this-langDir}/*.php ) as $file ) {
@@ -72,20 +78,26 @@
}
 
/**
-* Set the active language.
-* @param array $req Request data
-* @param string $default Default language
+* Get the active language.
 * @return string Selected language
 */
-   public function setLang( $req, $default = 'en' ) {
-   if ( isset( $req['uselang'] ) 
-   in_array( $req['uselang'], $this-getLangs() )
-   ) {
-   $lang = $req['uselang'];
+   public function getLang() {
+   if ( isset( $_REQUEST['uselang'] ) ) {
+   $lang = $_REQUEST['uselang'];
+
+   } elseif ( isset( $_SESSION['uselang'] ) ) {
+   $lang = $_SESSION['uselang'];
 
} else {
-   $lang = $default;
+   $lang = $this-defaultLang;
}
+
+   if ( !in_array( $lang, $this-getLangs() ) ) {
+   $lang = $this-defaultLang;
+   }
+
+   // remember this language selection for future requests
+   $_SESSION['uselang'] = $lang;
 
$this-lang = $lang;
return $lang;
@@ -99,6 +111,10 @@
 * @return string Message
 */
public function message( $key, $params = array() ) {
+   if ( $this-lang === null ) {
+   $this-getLang();
+   }
+
// Try the language, then english, then fail
if ( isset( $this-messages[$this-lang][$key] ) ) {
$msg = $this-messages[$this-lang][$key];

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6c7047bfd5e6241bac636f84971600c742aaae57
Gerrit-PatchSet: 1
Gerrit-Project: 

[MediaWiki-commits] [Gerrit] Use select for language choice - change (wikimedia/wikimania-scholarships)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use select for language choice
..


Use select for language choice

Use progressive enhancement to convert the list of languages into
a select element. This should help reduce UI clutter as more
translations are added.

Change-Id: I38144d4bdcd6785caaa9074361cbed14807345c3
---
M data/i18n/en.php
M data/templates/apply.html
M data/templates/base.html
M data/templates/base_auth.html
M public/css/style.css
A public/js/site.js
6 files changed, 40 insertions(+), 4 deletions(-)

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



diff --git a/data/i18n/en.php b/data/i18n/en.php
index dbac130..815a410 100644
--- a/data/i18n/en.php
+++ b/data/i18n/en.php
@@ -3,6 +3,7 @@
'wikimania' = Wikimania,
'header-title' = Wikimania 2013 - Scholarship application,
'page-header' = Wikimania 2013 travel scholarships,
+   'language' = 'Language:',
'text-intro' = 
pThis is the application for sponsorship to attend a 
href='http://wikimania2013.wikimedia.org'Wikimania 2013/a, Wikimedia's 
international conference. Awardees will receive a scholarship to pay for 
registration, hotel, and roundtrip travel to Wikimania in Hong Kong, 7–11 
August 2013./p
pThis is strongnot/strong a scholarship for university study. 
Applications not obviously related to the conference will be discarded./p
diff --git a/data/templates/apply.html b/data/templates/apply.html
index 76998a3..10e63ad 100644
--- a/data/templates/apply.html
+++ b/data/templates/apply.html
@@ -18,7 +18,6 @@
 link rel=stylesheet type=text/css href={{ siteUrl( 'css/chosen.min.css' 
) }} /
 {% endblock css %}
 {% block javascript %}
-script src={{ siteUrl( 'js/jquery-1.7.1.min.js' ) }}/script
 script src={{ siteUrl( 'js/chosen.jquery.js' ) }}/script
 script type=text/javascript(function( $, document ) {
 $( document ).ready( function() { 
$('.chosen-select').chosen({'search_contains':true}); });
diff --git a/data/templates/base.html b/data/templates/base.html
index bd65184..06b9ae6 100644
--- a/data/templates/base.html
+++ b/data/templates/base.html
@@ -20,9 +20,10 @@
   body
 div class=container
   div id=langbar class=fifteen columns
+span class=langlabel{{ wgLang.message( 'language' ) }}/span
 ul class=langlist
-  {% for lang in wgLang.getLangs %}
-  lia href={{ app.request.getPath }}?uselang={{ lang }}{{ lang 
}}/a/li
+  {% for l in wgLang.getLangs %}
+  lia href={{ app.request.getPath }}?uselang={{ l }} {{ l == lang 
? 'class=selected' }}{{ l }}/a/li
   {% endfor %}
   li class=lasta href={{ urlFor( 'translate' ) }}{{ 
wgLang.message( 'help-translate' ) }}/a/li
 /ul
@@ -45,6 +46,8 @@
 /ul
   /div
 /div
+script src={{ siteUrl( 'js/jquery-1.7.1.min.js' ) }}/script
+script src={{ siteUrl( 'js/site.js' ) }}/script
 {% block javascript %}{% endblock javascript %}
   /body
 /html
diff --git a/data/templates/base_auth.html b/data/templates/base_auth.html
index 9528d01..0fd5284 100644
--- a/data/templates/base_auth.html
+++ b/data/templates/base_auth.html
@@ -42,7 +42,6 @@
 {% endblock post_content %}
 
 {% block javascript %}
-script src={{ siteUrl( 'js/jquery-1.7.1.min.js' ) }}/script
 script src={{ siteUrl( 'js/jquery-ui.min.js' ) }}/script
 script src={{ siteUrl( 'js/flexigrid.pack.js' ) }}/script
 script src={{ siteUrl( 'js/schols.js' ) }}/script
diff --git a/public/css/style.css b/public/css/style.css
index a6f07df..0657d18 100644
--- a/public/css/style.css
+++ b/public/css/style.css
@@ -120,6 +120,16 @@
   padding: 1em 1em 0 1em;
   border: none;
   text-align: right;
+  overflow: auto;
+  width: 100%;
+}
+
+.langlabel {
+  margin-right:.5em;
+  display: none;
+}
+.langselect {
+  float:right;
 }
 
 div#footer {
@@ -130,6 +140,7 @@
 ul.langlist {
   list-style: none;
   padding-left: 0;
+  display: inline;
 }
 
 ul#footerlinks li,
diff --git a/public/js/site.js b/public/js/site.js
new file mode 100644
index 000..a87f299
--- /dev/null
+++ b/public/js/site.js
@@ -0,0 +1,23 @@
+(function( $, document, window ) {
+  $(document).ready(function() {
+$('.langlist').each(function() {
+  var $list = $(this),
+$select = $(document.createElement('select'))
+  .addClass('langselect')
+  .insertBefore($list.hide());
+  $('li a', this).each(function() {
+var $this = $(this);
+$(document.createElement('option'))
+  .val(this.href)
+  .html($this.html())
+  .prop('selected',$this.attr('class')==='selected')
+  .click(function() {
+window.location.href = $(this).val();
+  })
+  .appendTo($select);
+  });
+  $list.remove();
+});
+$('.langlabel').show();
+  });
+})( jQuery, document, window );

-- 
To view, visit 

[MediaWiki-commits] [Gerrit] Show different messages to blocked users and anons - change (mediawiki...MediaWikiChat)

2013-12-13 Thread UltrasonicNXT (Code Review)
UltrasonicNXT has submitted this change and it was merged.

Change subject: Show different messages to blocked users and anons
..


Show different messages to blocked users and anons

The same message was being shown to users who were blocked as to users who
were anons, and simply not allowed to chat.

https://github.com/Brickimedia/brickimedia/issues/128

Change-Id: Ieb6ca5bff044d199e714f26952621b92b8fabcba
---
M MediaWikiChat.i18n.php
M SpecialChat.php
2 files changed, 8 insertions(+), 1 deletion(-)

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



diff --git a/MediaWikiChat.i18n.php b/MediaWikiChat.i18n.php
index 6b1a8e6..ac135bc 100644
--- a/MediaWikiChat.i18n.php
+++ b/MediaWikiChat.i18n.php
@@ -17,6 +17,7 @@
'chat-type-your-private-message' = 'Type your private message',
'chat-no-other-users' = 'No other users on chat',
'chat-blocked-from-chat' = 'You have been blocked from this chat.',
+   'chat-not-allowed' = 'You are not allowed to chat, try logging in 
first',
'chat-just-now' = 'just now',
'chat-a-minute-ago' = 'a minute ago',
'chat-quarter-of-an-hour-ago' = 'quarter of an hour ago',
@@ -69,6 +70,7 @@
 $messages['qqq'] = array(
'chat' = 'Important! This is the string that appears on 
Special:SpecialPages',
'chat-desc' = '{{desc}}',
+   'chat-not-allowed' = 'Message shown to users who are not in the groups 
required to chat (normally users who are not logged in)',
'log-name-chat' = 'Name of the chat log as it appears on the drop-down 
menu on [[Special:Log]]',
'log-show-hide-chat' = 'For [[Special:Log]]. Parameters:
 * $1 - {{int:show}} or {{int:hide}}',
diff --git a/SpecialChat.php b/SpecialChat.php
index 008ffe3..bff1272 100644
--- a/SpecialChat.php
+++ b/SpecialChat.php
@@ -21,7 +21,12 @@
$this-setHeaders();
 
if ( !$this-getUser()-isAllowed( 'chat' ) ) {
-   $out-addWikiMsg( 'chat-blocked-from-chat' );
+   $groups = $this-getUser-getGroups();
+   if ( in_array( 'blockedfromchat', $groups ) ) {
+   $out-addWikiMsg( 'chat-blocked-from-chat' );
+   } else {
+   $out-addWikiMsg( 'chat-not-allowed' );
+   }
 
} else {
// Load modules via ResourceLoader

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ieb6ca5bff044d199e714f26952621b92b8fabcba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MediaWikiChat
Gerrit-Branch: master
Gerrit-Owner: UltrasonicNXT adamr_car...@btinternet.com
Gerrit-Reviewer: UltrasonicNXT adamr_car...@btinternet.com

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


[MediaWiki-commits] [Gerrit] Replace a deprecated PageObject method - change (mediawiki...Translate)

2013-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Replace a deprecated PageObject method
..


Replace a deprecated PageObject method

Bug: 58385

Change-Id: Ic8c769615fb00fb472bb8ac72767c3224a7379d0
---
M tests/browser/features/step_definitions/manage_translator_sandbox_steps.rb
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git 
a/tests/browser/features/step_definitions/manage_translator_sandbox_steps.rb 
b/tests/browser/features/step_definitions/manage_translator_sandbox_steps.rb
index ef9c4c9..dc5076e 100644
--- a/tests/browser/features/step_definitions/manage_translator_sandbox_steps.rb
+++ b/tests/browser/features/step_definitions/manage_translator_sandbox_steps.rb
@@ -95,11 +95,11 @@
 end
 
 Then(/^the direction of the users language filter button is '(.+)'$/) do 
|dir_value|
-   
on(ManageTranslatorSandboxPage).language_selector_button_element.attribute_value(dir).should
 == dir_value
+   
on(ManageTranslatorSandboxPage).language_selector_button_element.attribute(dir).should
 == dir_value
 end
 
 Then(/^the language code of the users language filter button is '(.+)'$/) do 
|lang_value|
-   
on(ManageTranslatorSandboxPage).language_selector_button_element.attribute_value(lang).should
 == lang_value
+   
on(ManageTranslatorSandboxPage).language_selector_button_element.attribute(lang).should
 == lang_value
 end
 
 Then(/^usernames are visible in the first column$/) do

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic8c769615fb00fb472bb8ac72767c3224a7379d0
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Amire80 amir.ahar...@mail.huji.ac.il
Gerrit-Reviewer: KartikMistry kartik.mis...@gmail.com
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: Zfilipin zfili...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Localize base_auth form - change (wikimedia/wikimania-scholarships)

2013-12-13 Thread Chad (Code Review)
Chad has uploaded a new change for review.

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


Change subject: Localize base_auth form
..

Localize base_auth form

Change-Id: Ibf1d5a91465dc8aaf2981d364170968548af42ee
---
M data/i18n/en.php
M data/templates/base_auth.html
2 files changed, 27 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/wikimania-scholarships 
refs/changes/27/101227/1

diff --git a/data/i18n/en.php b/data/i18n/en.php
index 815a410..54f9294 100644
--- a/data/i18n/en.php
+++ b/data/i18n/en.php
@@ -169,4 +169,18 @@
'404-header' = Page not found,
'404-message' = The page you requested cannot be found. Please check 
the link/URL and try
   again.,
+
+   'phase-1' = Phase 1,
+   'phase-2' = Phase 2,
+   'phase-1-success' = Phase 1 success list,
+   'phase-1-fail' = Phase 1 fail list,
+   'phase-2-list' = Phase 2 list,
+   'final-full' = Final: Full,
+   'final-partial' = Final: Partial,
+   'review' = Review,
+   'search' = Search,
+   'by-country' = By country,
+   'by-region' = By region,
+   'change-password' = Change password,
+   'logout' = Logout,
 );
diff --git a/data/templates/base_auth.html b/data/templates/base_auth.html
index 0fd5284..23ad7f0 100644
--- a/data/templates/base_auth.html
+++ b/data/templates/base_auth.html
@@ -11,27 +11,27 @@
 div id=form-container class=fourteen columns
 div id=tabsnav class=clearfix
   ul id=review-tabs
-lia href={{ urlFor( 'review_phase1' ) }}Phase 1/a/li
-lia href={{ urlFor( 'review_phase2' ) }}Phase 2/a/li
+lia href={{ urlFor( 'review_phase1' ) }}{{ wgLang.message( 'phase-1' 
) }}/a/li
+lia href={{ urlFor( 'review_phase2' ) }}{{ wgLang.message( 'phase-2' 
) }}/a/li
 li|/li
-lia href={{ urlFor( 'review_p1_success' ) }}Phase 1 Success 
List/a/li
-lia href={{ urlFor( 'review_p1_fail' ) }}Phase 1 Fail List/a/li
-lia href={{ urlFor( 'review_p2_list' ) }}Phase 2 List/a/li
+lia href={{ urlFor( 'review_p1_success' ) }}{{ wgLang.message( 
'phase-1-success' ) }}/a/li
+lia href={{ urlFor( 'review_p1_fail' ) }}{{ wgLang.message( 
'phase-1-fail' ) }}/a/li
+lia href={{ urlFor( 'review_p2_list' ) }}{{ wgLang.message( 
'phase-2' ) }}/a/li
 {% if isadmin|default(true) %}
 {# FIXME: better auth integration #}
 li|/li
-lia href={{ urlFor( 'review_scores' ) }}?partial=0Final: 
Full/a/li
-lia href={{ urlFor( 'review_scores' ) }}?partial=1Final: 
Partial/a/li
+lia href={{ urlFor( 'review_scores' ) }}?partial=0{{ wgLang.message( 
'final-full' ) }}/a/li
+lia href={{ urlFor( 'review_scores' ) }}?partial=1{{ wgLang.message( 
'final-partial' ) }}/a/li
 {% endif %}
 li|/li
-lia href={{ urlFor( 'review_view' ) }}Review/a/li
+lia href={{ urlFor( 'review_view' ) }}{{ wgLang.message( 'review' ) 
}}/a/li
 li|/li
-lia href={{ urlFor( 'review_search' ) }}Search/a/li
-lia href={{ urlFor( 'review_countries' ) }}By Country/a/li
-lia href={{ urlFor( 'review_regions' ) }}By Region/a/li
+lia href={{ urlFor( 'review_search' ) }}{{ wgLang.message( 'search' 
) }}/a/li
+lia href={{ urlFor( 'review_countries' ) }}{{ wgLang.message( 
'by-country' ) }}/a/li
+lia href={{ urlFor( 'review_regions' ) }}{{ wgLang.message( 
'by-region' ) }}/a/li
 li|/li
-lia href={{ urlFor( 'user_changepassword' ) }}change 
password/a/li
-lia href={{ urlFor( 'logout' ) }}logout/a/li
+lia href={{ urlFor( 'user_changepassword' ) }}{{ wgLang.message( 
'change-password' ) }}/a/li
+lia href={{ urlFor( 'logout' ) }}{{ wgLang.message( 'logout' ) 
}}/a/li
   /ul
 /div
 {{ parent() }}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf1d5a91465dc8aaf2981d364170968548af42ee
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/wikimania-scholarships
Gerrit-Branch: master
Gerrit-Owner: Chad ch...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Add useful HTML in toDomElements for refs and templates. - change (mediawiki...VisualEditor)

2013-12-13 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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


Change subject: Add useful HTML in toDomElements for refs and templates.
..

Add useful HTML in toDomElements for refs and templates.

For the benefit of pasting out of VE.
Use data-ve-ignore where necessary to avoid the HTML being
used on the way back in to VE.

Change-Id: Iabe678c4246c1d1f51abb058b6e750811fdf9bea
---
M modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
M modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
2 files changed, 22 insertions(+), 7 deletions(-)


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

diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js 
b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
index adedc22..3ffd78e 100644
--- a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
+++ b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
@@ -187,6 +187,10 @@
}
} else {
el.setAttribute( 'data-mw', JSON.stringify( mwData ) );
+   // HTML for the external clipboard, it will be ignored by the 
converter
+   $( el ).append(
+   $( 'sup' ).text( this.getIndexLabel( dataElement, 
converter.internalList ) )
+   );
}
 
return [ el ];
diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js 
b/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
index f7e0733..52b7725 100644
--- a/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
+++ b/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
@@ -105,20 +105,31 @@
return ve.copyDomElements( 
dataElement.attributes.originalDomElements, doc );
} else {
if ( dataElement.attributes.originalDomElements ) {
-   el = doc.createElement( 
dataElement.attributes.originalDomElements[0].nodeName );
+   els = [ doc.createElement( 
dataElement.attributes.originalDomElements[0].nodeName ) ];
} else {
-   el = doc.createElement( 'span' );
+   els = [ doc.createElement( 'span' ) ];
+   // For the clipboard use the current DOM contents but 
mark is ignored
+   // for the converter
+   currentDom = converter.getStore().value( index );
+   if ( currentDom ) {
+   currentDom = ve.copyDomElements( currentDom, 
doc );
+   // i = 0 is the span
+   for ( i = 1, len = currentDom.length; i  len; 
i++ ) {
+   currentDom[i].setAttribute( 
'data-ve-ignore', 'true' );
+   els.push( currentDom[i] );
+   }
+   }
}
// All we need to send back to Parsoid is the original 
transclusion marker, with a
// reconstructed data-mw property.
-   el.setAttribute( 'typeof', 'mw:Transclusion' );
-   el.setAttribute( 'data-mw', JSON.stringify( 
dataElement.attributes.mw ) );
-   // Mark the element as not having a generated contents with it 
in case it is
+   els[0].setAttribute( 'typeof', 'mw:Transclusion' );
+   els[0].setAttribute( 'data-mw', JSON.stringify( 
dataElement.attributes.mw ) );
+   // Mark the element as not having valid generated contents with 
it in case it is
// inserted into another editor (e.g. via paste).
-   el.setAttribute( 'data-ve-no-generated-contents', true );
+   els[0].setAttribute( 'data-ve-no-generated-contents', true );
// TODO: Include last-known generated contents in the output 
for rich
// paste into a non-VE editor
-   return [ el ];
+   return els;
}
 };
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iabe678c4246c1d1f51abb058b6e750811fdf9bea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders esand...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fix hashes in MW toDomElement functions - change (mediawiki...VisualEditor)

2013-12-13 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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


Change subject: Fix hashes in MW toDomElement functions
..

Fix hashes in MW toDomElement functions

Hashes weren't using the new [ object, config ] set up so were
never matching the store. Also added a check to see if the
originalDomElements actually exists before trying to use them
(they may have been removed by a clone operation).

Change-Id: I886e369ced9a9d2e0e457ced9c21b2a7a8e55d58
---
M modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js
M modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
2 files changed, 7 insertions(+), 5 deletions(-)


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

diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js 
b/modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js
index 8f568da..fff60a7 100644
--- a/modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js
+++ b/modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js
@@ -74,7 +74,7 @@
 
 ve.dm.MWExtensionNode.static.toDomElements = function ( dataElement, doc, 
converter ) {
var el,
-   index = converter.getStore().indexOfHash( OO.getHash( 
this.getHashObject( dataElement ) ) ),
+   index = converter.getStore().indexOfHash( OO.getHash( [ 
this.getHashObject( dataElement ), undefined ] ) ),
originalMw = dataElement.attributes.originalMw;
 
// If the transclusion is unchanged just send back the
diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js 
b/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
index 1407c15..f7e0733 100644
--- a/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
+++ b/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
@@ -89,15 +89,17 @@
 };
 
 ve.dm.MWTransclusionNode.static.toDomElements = function ( dataElement, doc, 
converter ) {
-   var el,
-   index = converter.getStore().indexOfHash( OO.getHash( 
this.getHashObject( dataElement ) ) ),
+   var els, currentDom, i, len,
+   index = converter.getStore().indexOfHash( OO.getHash( [ 
this.getHashObject( dataElement ), undefined ] ) ),
originalMw = dataElement.attributes.originalMw;
 
// If the transclusion is unchanged just send back the
// original DOM elements so selser can skip over it
if (
-   index === dataElement.attributes.originalIndex ||
-   ( originalMw  ve.compare( dataElement.attributes.mw, 
JSON.parse( originalMw ) ) )
+   dataElement.attributes.originalDomElements  (
+   index === dataElement.attributes.originalIndex ||
+   ( originalMw  ve.compare( dataElement.attributes.mw, 
JSON.parse( originalMw ) ) )
+   )
) {
// The object in the store is also used for CE rendering so 
return a copy
return ve.copyDomElements( 
dataElement.attributes.originalDomElements, doc );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I886e369ced9a9d2e0e457ced9c21b2a7a8e55d58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders esand...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Move index label generation to the model - change (mediawiki...VisualEditor)

2013-12-13 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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


Change subject: Move index label generation to the model
..

Move index label generation to the model

Also make available as a static method so it can be used by the
converter. We will need this for generated HTML for the external
clipboard.

Change-Id: Ief843ac10cd6c6e4b25e09a007625d363792adff
---
M modules/ve-mw/ce/nodes/ve.ce.MWReferenceNode.js
M modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
2 files changed, 24 insertions(+), 6 deletions(-)


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

diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWReferenceNode.js 
b/modules/ve-mw/ce/nodes/ve.ce.MWReferenceNode.js
index c038d2a..08ac3fc 100644
--- a/modules/ve-mw/ce/nodes/ve.ce.MWReferenceNode.js
+++ b/modules/ve-mw/ce/nodes/ve.ce.MWReferenceNode.js
@@ -92,12 +92,7 @@
  * @method
  */
 ve.ce.MWReferenceNode.prototype.update = function () {
-   var listIndex = this.model.getAttribute( 'listIndex' ),
-   listGroup = this.model.getAttribute( 'listGroup' ),
-   refGroup = this.model.getAttribute( 'refGroup' ),
-   position = this.internalList.getIndexPosition( listGroup, 
listIndex );
-
-   this.$link.text( '[' + ( refGroup ? refGroup + ' ' : '' ) + ( position 
+ 1 ) + ']' );
+   this.$link.text( this.model.getIndexLabel() );
 };
 
 /** */
diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js 
b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
index 6ce194e..adedc22 100644
--- a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
+++ b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
@@ -215,6 +215,21 @@
}
 };
 
+/**
+ * Gets the index label for the reference
+ * @param {Object} dataElement Element data
+ * @param {ve.dm.InternalList} internalList Internal list
+ * @returns {string} Reference label
+ */
+ve.dm.MWReferenceNode.static.getIndexLabel = function ( dataElement, 
internalList ) {
+   var listIndex = dataElement.attributes.listIndex,
+   listGroup = dataElement.attributes.listGroup,
+   refGroup = dataElement.attributes.refGroup,
+   position = internalList.getIndexPosition( listGroup, listIndex 
);
+
+   return '[' + ( refGroup ? refGroup + ' ' : '' ) + ( position + 1 ) + 
']';
+};
+
 /* Methods */
 
 /**
@@ -237,6 +252,14 @@
 };
 
 /**
+ * Gets the index label for the reference
+ * @returns {string} Reference label
+ */
+ve.dm.MWReferenceNode.prototype.getIndexLabel = function () {
+   return this.constructor.static.getIndexLabel( this.element, 
this.getDocument().getInternalList() );
+};
+
+/**
  * Handle the node being attached to the root
  * @method
  */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief843ac10cd6c6e4b25e09a007625d363792adff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders esand...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] data-ve-ignore attribute for elements to be complete ignored... - change (mediawiki...VisualEditor)

2013-12-13 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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


Change subject: data-ve-ignore attribute for elements to be complete ignored by 
the converter
..

data-ve-ignore attribute for elements to be complete ignored by the converter

This is for HTML we generate for the benefit of the external clipboard
(i.e. pasting into other applications).

Change-Id: I1c5ff4760f17e1981a78a0bc44f8e296454bb065
---
M modules/ve/dm/ve.dm.Converter.js
1 file changed, 3 insertions(+), 0 deletions(-)


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

diff --git a/modules/ve/dm/ve.dm.Converter.js b/modules/ve/dm/ve.dm.Converter.js
index 9a5c222..4318487 100644
--- a/modules/ve/dm/ve.dm.Converter.js
+++ b/modules/ve/dm/ve.dm.Converter.js
@@ -613,6 +613,9 @@
childDomElement = domElement.childNodes[i];
switch ( childDomElement.nodeType ) {
case Node.ELEMENT_NODE:
+   if ( childDomElement.getAttribute( 
'data-ve-ignore' ) ) {
+   continue;
+   }
aboutGroup = getAboutGroup( childDomElement );
modelName = this.modelRegistry.matchElement( 
childDomElement, aboutGroup.length  1 );
modelClass = this.modelRegistry.lookup( 
modelName ) || ve.dm.AlienNode;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c5ff4760f17e1981a78a0bc44f8e296454bb065
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders esand...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Localize change password form - change (wikimedia/wikimania-scholarships)

2013-12-13 Thread Chad (Code Review)
Chad has uploaded a new change for review.

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


Change subject: Localize change password form
..

Localize change password form

Change-Id: I47351b3f431c318bc8e57c4a4e84d66352e29aa9
---
M data/i18n/en.php
M data/templates/user/changePassword.html
2 files changed, 10 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/wikimania-scholarships 
refs/changes/32/101232/1

diff --git a/data/i18n/en.php b/data/i18n/en.php
index 54f9294..044488b 100644
--- a/data/i18n/en.php
+++ b/data/i18n/en.php
@@ -183,4 +183,9 @@
'by-region' = By region,
'change-password' = Change password,
'logout' = Logout,
+
+   'old-password' = Old password:,
+   'new-password' = New password:,
+   'new-password-again' = New password (again):,
+   'save-password' = Save password,
 );
diff --git a/data/templates/user/changePassword.html 
b/data/templates/user/changePassword.html
index b9c477d..eb71880 100644
--- a/data/templates/user/changePassword.html
+++ b/data/templates/user/changePassword.html
@@ -5,21 +5,21 @@
 form action={{ urlFor( 'user_changepassword_post' ) }} method=post
   input type=hidden name=id value={{ user.id }} /
   fieldset
-legendChange Password/legend
+legend{{ wgLang.message( 'change-password' ) }}/legend
 pUsername: strong{{ user.username }}/strong/p
 ul
-  lilabel for=oldpwOld Password:/label
+  lilabel for=oldpw{{ wgLang.message( 'old-password' ) }}/label
 input type=password name=oldpw id=oldpw value= 
required=required/
   /li
-  lilabel for=newpw1New Password:/label
+  lilabel for=newpw1{{ wgLang.message( 'new-password' ) }}/label
 input type=password name=newpw1 id=newpw1 value= 
required=required/
   /li
-  lilabel for=newpw2New Password (again):/label
+  lilabel for=newpw2{{ wgLang.message( 'new-password-again' ) 
}}/label
 input type=password name=newpw2 id=newpw2 value= 
required=required/
   /li
 /ul
   /fieldset
-  pinput type=submit value=save /
+  pinput type=submit value={{ wgLang.message( 'save-password' ) }} /
 /form
 {% endspaceless %}
 {% endblock content %}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47351b3f431c318bc8e57c4a4e84d66352e29aa9
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/wikimania-scholarships
Gerrit-Branch: master
Gerrit-Owner: Chad ch...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Expand CleanupPreferences script to handle unused preferences - change (mediawiki/core)

2013-12-13 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review.

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


Change subject: Expand CleanupPreferences script to handle unused preferences
..

Expand CleanupPreferences script to handle unused preferences

Also added a check for preferences which are equal to the default value.
Adds a --delete param to avoid write actions on first run.

Script does a batched full table select to check each row against the
criteria (unused or removed preferences; hidden [optional]; equal to
default preference) and than deletes the found rows from the database

This can help by cleaning up user_properties table as single or montly
run, see bug 52777.
This is not equals to calling User::saveSettings on a full loaded user
object, but should be nearly the same.
Using the user object sounds expensiver, because the whole user object
is loaded for each user.

Must add 3 preferences to $wgDefaultUserOptions, because otherwise there
are not recognize as such and the rows where deleted.

Change-Id: Ia5d8d1a344a6846777ffda980f884cfc5cdd55e7
---
M includes/DefaultSettings.php
M maintenance/cleanupPreferences.php
2 files changed, 159 insertions(+), 9 deletions(-)


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

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 40f943f..54cb797 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -4012,6 +4012,7 @@
'math' = 1,
'minordefault' = 0,
'newpageshidepatrolled' = 0,
+   'nickname' = '',
'noconvertlink' = 0,
'norollbackdiff' = 0,
'numberheadings' = 0,
@@ -4028,6 +4029,7 @@
'showtoolbar' = 1,
'skin' = false,
'stubthreshold' = 0,
+   'timecorrection' = '',
'thumbsize' = 2,
'underline' = 2,
'uselivepreview' = 0,
@@ -4043,6 +4045,7 @@
'watchlisthideminor' = 0,
'watchlisthideown' = 0,
'watchlisthidepatrolled' = 0,
+   'watchlisttoken' = '',
'watchmoves' = 0,
'wllimit' = 250,
'useeditwarning' = 1,
diff --git a/maintenance/cleanupPreferences.php 
b/maintenance/cleanupPreferences.php
index 06ae17f..8345717 100644
--- a/maintenance/cleanupPreferences.php
+++ b/maintenance/cleanupPreferences.php
@@ -1,6 +1,6 @@
 ?php
 /**
- * Remove hidden preferences from the database.
+ * Remove hidden, unused or default preferences from the database.
  *
  * 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
@@ -31,20 +31,167 @@
  * @ingroup Maintenance
  */
 class CleanupPreferences extends Maintenance {
+   public function __construct() {
+   parent::__construct();
+   $this-mDescription = 'Delete hidden, unused or default 
preferences from database';
+   $this-addOption( 'delete', 'Perform the deletion' );
+   $this-addOption( 'start',
+   'Key to start the script from in format user or 
user,property', false, true );
+   $this-addOption( 'hidden', 'Remove also hidden prefs (from 
$wgHiddenPrefs)' );
+   $this-setBatchSize( 150 );
+   }
+
public function execute() {
global $wgHiddenPrefs;
 
$dbw = wfGetDB( DB_MASTER );
-   $dbw-begin( __METHOD__ );
-   foreach ( $wgHiddenPrefs as $item ) {
-   $dbw-delete(
+   $delete = $this-hasOption( 'delete' );
+   $hidden = $this-hasOption( 'hidden' );
+
+   $defaultOptions = User::getDefaultOptions();
+
+   $cond = array();
+   if ( $this-hasOption( 'start' ) ) {
+   $start = $this-getOption( 'start' );
+   $startArray = explode( ',', $start, 2 );
+   $cond = $this-buildSelectCond( $dbw, $startArray[0],
+   count( $startArray ) = 2 ? $startArray[1] : 
null );
+   $this-output( Start by   . $start . \n );
+   }
+
+   $countAll = 0;
+   $count = 0;
+   $deletedAll = 0;
+   $deleted = 0;
+   $statsDeletedProperty = array();
+   do {
+   // select next batch
+   $res = $dbw-select(
'user_properties',
-   array( 'up_property' = $item ),
-   __METHOD__
+   array( 'up_user', 'up_property', 'up_value' ),
+   $cond,
+   __METHOD__,
+   array( 'LIMIT' = $this-mBatchSize, 'ORDER BY' 
= array( 'up_user', 'up_property' ) )
);
-   };
-   

[MediaWiki-commits] [Gerrit] Localize admin pages - change (wikimedia/wikimania-scholarships)

2013-12-13 Thread Chad (Code Review)
Chad has uploaded a new change for review.

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


Change subject: Localize admin pages
..

Localize admin pages

Change-Id: I97ce973bcb88a2de4df2bcc8e8ccfdc0eac13f82
---
M data/i18n/en.php
M data/templates/admin/user.html
M data/templates/admin/users.html
3 files changed, 38 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/wikimania-scholarships 
refs/changes/34/101234/1

diff --git a/data/i18n/en.php b/data/i18n/en.php
index cf27aa1..2af8115 100644
--- a/data/i18n/en.php
+++ b/data/i18n/en.php
@@ -189,4 +189,21 @@
'new-password' = New password:,
'new-password-again' = New password (again):,
'save-password' = Save password,
+
+   'admin-user-id' = 'Id: $1',
+   'admin-user-email' = 'Email:',
+   'admin-user-reviewer' = Is reviewer:,
+   'admin-user-valid' = Is valid:,
+   'admin-user-admin' = Is admin:,
+   'admin-user-blocked' = Is blocked:,
+   'admin-user-save' = Save new user,
+   'admin-users-id' = id,
+   'admin-users-username' = username,
+   'admin-users-email' = email,
+   'admin-users-reviewer' = reviewer?,
+   'admin-users-admin' = admin?,
+   'admin-users-blocked' = blocked?,
+   'admin-users-yes' = yes,
+   'admin-users-no' = no,
+   'admin-users-add' = Add new user,
 );
diff --git a/data/templates/admin/user.html b/data/templates/admin/user.html
index 5ec3175..e7fa65e 100644
--- a/data/templates/admin/user.html
+++ b/data/templates/admin/user.html
@@ -10,34 +10,34 @@
 form method=post action={{ urlFor( 'admin_user_post' ) }}
   input type=hidden name=id value={{ id }}/
   fieldset
-legendId: {{ id }}/legend
+legend{{ wgLang.message( 'admin-user-id', [ id ] ) }}
 ul
-  li {{ 'username' in errors ? 'class=fieldWithErrors' }}label 
forusernameUsername:/label
+  li {{ 'username' in errors ? 'class=fieldWithErrors' }}label 
forusername{{ wgLang.message( 'username' ) }}/label
 input type=text name=username id=username value={{ u.username 
}} required=required/
   /li
   {% if id == 'new' %}
-  li {{ 'password' in errors ? 'class=fieldWithErrors' }}label 
for=passwordPassword:/label
+  li {{ 'password' in errors ? 'class=fieldWithErrors' }}label 
for=password{{ wgLang.message( 'password' ) }}/label
 input type=text name=password id=password value={{ u.password 
}} required=required/
   /li
   {% endif %}
-  li {{ 'email' in errors ? 'class=fieldWithErrors' }}label 
for=emailEmail:/label
+  li {{ 'email' in errors ? 'class=fieldWithErrors' }}label 
for=email{{ wgLang.message( 'admin-user-email' ) }}/label
 input type=text name=email id=email value={{ u.email }} 
required=required/
   /li
-  lilabel for=reviewer class=inlineIs Reviewer?:/label
+  lilabel for=reviewer class=inline{{ wgLang.message( 
'admin-user-reviewer' ) }}/label
 input type=checkbox name=reviewer id=reviewer value=1 {{ 
u.reviewer == 1 ? 'checked=checked' }}/
   /li
-  lilabel for=isvalid class=inlineIs Valid?:/label
+  lilabel for=isvalid class=inline{{ wgLang.message( 
'admin-user-valid' ) }}/label
 input type=checkbox name=isvalid id=isvalid value=1 {{ 
u.isvalid == 1 ? 'checked=checked' }}/
   /li
-  lilabel for=isadmin class=inlineIs Admin?:/label
+  lilabel for=isadmin class=inline{{ wgLang.message( 
'admin-user-admin' ) }}/label
 input type=checkbox name=isadmin id=isadmin value=1 {{ 
u.isadmin == 1 ? 'checked=checked' }}/
   /li
-  lilabel for=blocked class=inlineBlocked?:/label
+  lilabel for=blocked class=inline{{ wgLang.message( 
'admin-user-blocked' ) }}/label
 input type=checkbox name=blocked id=blocked value=1 {{ 
u.blocked == 1 ? 'checked=checked' }}/
   /li
 /ul
   /fieldset
-  input type=submit id=save name=save value=Save/
+  input type=submit id=save name=save value={{ wgLang.message( 
'admin-user-save' ) }}/
 /form
 {% endspaceless %}
 {% endblock content %}
diff --git a/data/templates/admin/users.html b/data/templates/admin/users.html
index 7c8f7c6..e932354 100644
--- a/data/templates/admin/users.html
+++ b/data/templates/admin/users.html
@@ -4,28 +4,28 @@
 {% spaceless %}
 table class=grid
   tr
-thid/th
-thusername/th
-themail/th
-threviewer?/th
-thvalid?/th
-thadmin?/th
-thblocked?/th
+th{{ wgLang.message( 'admin-users-id' ) }}/th
+th{{ wgLang.message( 'admin-users-username' ) }}/th
+th{{ wgLang.message( 'admin-users-email' ) }}/th
+th{{ wgLang.message( 'admin-users-reviewer' ) }}/th
+th{{ wgLang.message( 'admin-users-valid' ) }}/th
+th{{ wgLang.message( 'admin-users-admin' ) }}/th
+th{{ wgLang.message( 'admin-users-blocked' ) }}/th
   /tr
   {% for row in records %}
   tr class={{ cycle( [ 'oddrow', 'evenrow' ], loop.index ) }}
 td{{ row.id }}/td
 tda 

[MediaWiki-commits] [Gerrit] Localize part of login form that was missed - change (wikimedia/wikimania-scholarships)

2013-12-13 Thread Chad (Code Review)
Chad has uploaded a new change for review.

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


Change subject: Localize part of login form that was missed
..

Localize part of login form that was missed

Change-Id: I6137719b4704e0ec71168af0b75c8c24f5410bda
---
M data/templates/login.html
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/wikimania-scholarships 
refs/changes/35/101235/1

diff --git a/data/templates/login.html b/data/templates/login.html
index 311a3b8..2109861 100644
--- a/data/templates/login.html
+++ b/data/templates/login.html
@@ -11,7 +11,7 @@
   lilabel for=password{{ wgLang.message( 'password' ) }}/label 
input type=password id=password name=password required=required //li
 /ul
   /fieldset
-  pinput type=submit value=Log in /
+  pinput type=submit value={{ wgLang.message( 'log-in' ) }} /
 /form
 {% endspaceless %}
 {% endblock content %}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6137719b4704e0ec71168af0b75c8c24f5410bda
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/wikimania-scholarships
Gerrit-Branch: master
Gerrit-Owner: Chad ch...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Gracefully handle errors applying redlinks - change (mediawiki...Flow)

2013-12-13 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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


Change subject: Gracefully handle errors applying redlinks
..

Gracefully handle errors applying redlinks

An invalid wikilink like [[Foobar]], when it gets through to the
redlink handling, will error out because bar is not a valid html
entity.  This first repair sets up more gracefull error handling
for failures in redlinking(just show the content without redlinks
applied).  A future fix will also address the html entity in url
problem.

Change-Id: Iaa36485325668af4bb7b4556e6dedf9c9d3bf346
---
M includes/ParsoidUtils.php
M includes/Templating.php
2 files changed, 16 insertions(+), 8 deletions(-)


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

diff --git a/includes/ParsoidUtils.php b/includes/ParsoidUtils.php
index 9e2bea9..bcc2431 100644
--- a/includes/ParsoidUtils.php
+++ b/includes/ParsoidUtils.php
@@ -193,16 +193,17 @@
return !in_array( $error-code, 
$ignoreErrorCodes );
}
);
-   if ( $errors ) {
-   throw new \MWException(
-   implode( \n, array_map( $errors, function( 
$error ) { return $error-message; } ) )
-   );
-   }
 
-   // restore libxml error reporting
+   // restore libxml state before anything else
libxml_clear_errors();
libxml_use_internal_errors( $useErrors );
 
+   if ( $errors ) {
+   throw new \MWException(
+   implode( \n, array_map( function( $error ) { 
return $error-message; }, $errors ) )
+   );
+   }
+
return $dom;
}
 }
diff --git a/includes/Templating.php b/includes/Templating.php
index f02aa9c..b295dbb 100644
--- a/includes/Templating.php
+++ b/includes/Templating.php
@@ -276,7 +276,7 @@
 * RecentChanges pages.
 *
 * Moderation-aware.
-* 
+*
 * @param  AbstractRevision $revisionRevision to display
 * @param  User $permissionsUser The User to check 
permissions for
 * @return stringHTML
@@ -359,7 +359,14 @@
 
if ( $format === 'html' ) {
// Parsoid doesn't render redlinks
-   $content = $this-applyRedlinks( $content );
+   try {
+   $content = $this-applyRedlinks( 
$content );
+   } catch ( \MWException $e ) {
+   // @todo
+   wfDebugLog( __CLASS__, __METHOD__ . ': 
Failed applying redlinks for rev_id = ' . $revision-getRevisionId()-getHex() 
);
+   \MWExceptionHandler::logException( $e );
+   }
+
}
 
return $content;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa36485325668af4bb7b4556e6dedf9c9d3bf346
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson ebernhard...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Update and add to tests - change (wikimedia...crm)

2013-12-13 Thread Adamw (Code Review)
Adamw has uploaded a new change for review.

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


Change subject: Update and add to tests
..

Update and add to tests

Change-Id: I3478be6b7a1d7c8ddb92ccc47a01bc7af4e96dbc
---
M sites/all/modules/queue2civicrm/tests/simpletest/BaseTestCase.php
M sites/all/modules/queue2civicrm/tests/simpletest/PaypalRecurring.test
2 files changed, 71 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/37/101237/1

diff --git a/sites/all/modules/queue2civicrm/tests/simpletest/BaseTestCase.php 
b/sites/all/modules/queue2civicrm/tests/simpletest/BaseTestCase.php
index 628f53c..eb5d203 100644
--- a/sites/all/modules/queue2civicrm/tests/simpletest/BaseTestCase.php
+++ b/sites/all/modules/queue2civicrm/tests/simpletest/BaseTestCase.php
@@ -3,6 +3,8 @@
  * Set up schemas and constants.
  */
 class BaseTestCase extends DrupalWebTestCase {
+protected $profile = 'minimal';
+
 public function setUp() {
 // This is basically a terrible hack: we are using the development
 // civicrm database configured in civicrm.settings.php, and avoid the
diff --git 
a/sites/all/modules/queue2civicrm/tests/simpletest/PaypalRecurring.test 
b/sites/all/modules/queue2civicrm/tests/simpletest/PaypalRecurring.test
index ac59066..bc89224 100644
--- a/sites/all/modules/queue2civicrm/tests/simpletest/PaypalRecurring.test
+++ b/sites/all/modules/queue2civicrm/tests/simpletest/PaypalRecurring.test
@@ -58,18 +58,69 @@
 ) );
 
 //TODO: modification messages are not processed currently
+
+$this-existing_subscr_id = mt_rand();
+
+$this-existing_contrib_message_body = array(
+'subscr_id' = $this-existing_subscr_id,
+'payment_date' = wmf_common_date_unix_to_civicrm( time() ),
+'txn_type' = 'subscr_payment',
+);
+
+$api = civicrm_api_classapi();
+
+$api-Contact-Create( array(
+'contact_type' = 'Individual',
+'email' = 'f...@example.com',
+'version' = 3,
+) );
+$this-contact_id = $api-id;
+
+$api-ContributionRecur-Create( array(
+'contact_id' = $this-contact_id,
+'frequency_interval' = 1,
+'trxn_id' = $this-existing_subscr_id,
+'version' = 3,
+) );
+$this-existing_recur_id = $api-id;
+
+$api-Contribution-Create( array(
+'contact_id' = $this-contact_id,
+'contribution_type' = 'Cash',
+'contribution_recur_id' = $this-existing_recur_id,
+'total_amount' = '20.01',
+'version' = 3,
+) );
+$this-existing_contribution_id = $api-id;
+
+$this-ctid = wmf_civicrm_insert_contribution_tracking( 'foo', 'web', 
time(), $this-existing_contribution_id, true, true );
+}
+
+public function tearDown() {
+$api = civicrm_api_classapi();
+
+$api-ContributionRecur-Delete( array(
+'id' = $this-existing_recur_id,
+'version' = 3,
+) );
+
+$api-Contribution-Delete( array(
+'id' = $this-existing_contribution_id,
+'version' = 3,
+) );
+
+parent::tearDown();
 }
 
 public function testNormalPayment() {
 recurring_import( $this-subscription_message );
-$result = recurring_import( $this-payment_message );
-$this-assertEqual( 1, $result,
-Normal recurring payment processed successfully );
+recurring_import( $this-payment_message );
 
 $payment_data = $this-payment_message-getBody();
 
 $contributions = wmf_civicrm_get_contributions_from_gateway_id( 
$payment_data['gateway'], $payment_data['gateway_txn_id'] );
 $recur_record = recurring_get_recur_record( $this-subscr_id );
+//FIXME: convert to array
 
 $this-verbose( json_encode( $contributions ) );
 $this-assertSuperset( $contributions, array(
@@ -95,16 +146,17 @@
 }
 
 public function testNoSubscription() {
-$result = recurring_import( $this-payment_message );
-$this-assertEqual( 2, $result,
-Payment linking to an invalid subscription is rejected );
+try {
+recurring_import( $this-payment_message );
+$this-fail( should have gotten a RequeueError. );
+} catch ( RequeueError $ex ) {
+// good.
+}
 }
 
 public function testExpire() {
 recurring_import( $this-subscription_message );
-$result = recurring_import( $this-expire_message );
-$this-assertEqual( 1, $result,
-Expiry message processed );
+recurring_import( $this-expire_message );
 
 $recur_record = recurring_get_recur_record( $this-subscr_id );
 $this-assertNotNull( $recur_record-end_date );
@@ -112,9 +164,7 @@
 
 public function testCancel() 

  1   2   3   4   5   >