[MediaWiki-commits] [Gerrit] Rewrote RepoApi tests - change (mediawiki...WikibaseJavaScriptApi)

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

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

Change subject: Rewrote RepoApi tests
..

Rewrote RepoApi tests

Implemented mocking/spying using SinonJS. No actual API request are triggered 
anymore.

Change-Id: I3d1d3af84cf8924115ef38ef319ae09b51bd0ddf
---
M .jshintrc
M tests/RepoApi.tests.js
2 files changed, 218 insertions(+), 495 deletions(-)


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

diff --git a/.jshintrc b/.jshintrc
index 832d316..09f9407 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -57,6 +57,7 @@
jQuery,
mediaWiki,
QUnit,
+   sinon,
util,
wikibase
]
diff --git a/tests/RepoApi.tests.js b/tests/RepoApi.tests.js
index e59aa83..cde2b2f 100644
--- a/tests/RepoApi.tests.js
+++ b/tests/RepoApi.tests.js
@@ -1,520 +1,242 @@
 /**
- * QUnit tests for wikibase.api.RepoApi
- * @see https://www.mediawiki.org/wiki/Extension:Wikibase
- *
  * @licence GNU GPL v2+
  * @author H. Snater  mediaw...@snater.com 
  */
-
-( function( mw, wb, $, QUnit, undefined ) {
+( function( mw, wb, QUnit, sinon ) {
'use strict';
 
-   var mwApi = new mw.Api();
+QUnit.module( 'wikibase.api.RepoApi' );
 
-   /**
-* wikibase.api.RepoApi object
-* @var {Object}
-*/
-   var api = new wb.api.RepoApi( mwApi );
+/**
+ * Instantiates a `wikibase.api.RepoApi` object with the relevant method being 
overwritten and
+ * having applied a SinonJS spy.
+ *
+ * @param {string} [getOrPost='post'] Whether to mock/spy the `get` or `post` 
request.
+ * @return {Object}
+ */
+function mockApi( getOrPost ) {
+   var spyPost = getOrPost !== 'get',
+   api = new mw.Api();
 
-   /**
-* Queue used run asynchronous tests synchronously.
-* @var {jQuery}
-*/
-   var testrun = $( {} );
+   api.postWithToken = function() {};
+   api.get= function() {};
 
-   /**
-* Queue key naming the queue that all tests are appended to.
-* @var {String}
-*/
-   var qkey = 'asyncTests';
-
-   /**
-* Since jQuery.queue does not allow passing parameters, this variable 
will cache the data
-* structures of entities.
-* @var {Object}
-*/
-   var entityStack = [];
-
-   /**
-* Triggers running the tests attached to the test queue.
-*/
-   var runTest = function() {
-   QUnit.stop();
-   testrun.queue( qkey, function() {
-   QUnit.start(); // finish test run
-   } );
-   testrun.dequeue( qkey ); // start tests
+   return {
+   spy: sinon.spy( api, spyPost ? 'postWithToken' : 'get' ),
+   api: new wb.api.RepoApi( api )
};
+}
 
-   /**
-* Handles a failing API request. (The details get logged in the 
console by mw.Api.)
-*
-* @param {String} code
-* @param {Object} details
-*/
-   var onFail = function( code, details ) {
-   QUnit.assert.ok(
-   false,
-   'API request failed returning code: ' + code + '. See 
console for details.'
+/**
+ * Returns all request parameters submitted to the function performing the 
`get` or `post` request.
+ *
+ * @param {Object} spy The SinonJS spy to extract the parameters from.
+ * @param [callIndex=0] The call index if multiple API calls have been 
performed on the same spy.
+ * @return {Object}
+ */
+function getParams( spy, callIndex ) {
+   callIndex = callIndex || 0;
+   return spy.displayName === 'postWithToken' ? spy.args[callIndex][1] : 
spy.args[callIndex][0];
+}
+
+/**
+ * Returns a specific parameter submitted to the function performing the `get` 
or `post` request.
+ *
+ * @param {Object} spy The SinonJS spy to extract the parameters from.
+ * @param {string} paramName
+ * @param [callIndex=0] The call index if multiple API calls have been 
performed on the same spy.
+ * @return {string}
+ */
+function getParam( spy, paramName, callIndex ) {
+   return getParams( spy, callIndex || 0 )[paramName];
+}
+
+QUnit.test( 'createEntity()', function( assert ) {
+   var mock = mockApi();
+
+   mock.api.createEntity( 'item' );
+   mock.api.createEntity( 'property', {
+   datatype: 'string'
+   } );
+
+   assert.ok( mock.spy.calledTwice, 'Triggered API calls.' );
+
+   assert.equal(
+   getParam( mock.spy, 'action' ),
+   'wbeditentity',
+   'Verified API module being called.'
+   );
+
+   assert.equal(
+   getParam( mock.spy, 'new' ),
+   'item',
+   'Verified submitting entity type.'
+   );
+
+   assert.equal(
+   getParam( mock.spy, 

[MediaWiki-commits] [Gerrit] Fixed creating an empty entity - change (mediawiki...WikibaseJavaScriptApi)

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

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

Change subject: Fixed creating an empty entity
..

Fixed creating an empty entity

Change-Id: Ib26abf43cd8edf5412c9867d2fc30fded850d162
---
M src/RepoApi.js
1 file changed, 5 insertions(+), 4 deletions(-)


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

diff --git a/src/RepoApi.js b/src/RepoApi.js
index 29f0161..30ce7c8 100644
--- a/src/RepoApi.js
+++ b/src/RepoApi.js
@@ -45,7 +45,7 @@
 * @see wikibase.api.RepoApi._post
 *
 * @param {string} type The type of the `Entity` that should be created.
-* @param {Object} [data] The `Entity` data (may be omitted to create 
an empty `Entity`).
+* @param {Object} [data={}] The `Entity` data (may be omitted to 
create an empty `Entity`).
 * @return {Object} jQuery.Promise
 * @return {Function} return.done
 * @return {*} return.done.result
@@ -57,9 +57,10 @@
createEntity: function( type, data ) {
var params = {
action: 'wbeditentity',
-   data: JSON.stringify( data ),
-   'new': type
+   'new': type,
+   data: JSON.stringify( data || {} )
};
+
return this._post( params );
},
 
@@ -439,7 +440,7 @@
 * @param {string} [claimGuid] GUID of the `Claim` to return. Either 
`claimGuid` or `entityID`
 *has to be provided.
 * @param {string} [rank] Only return `Claim`s of this `rank`.
-* @param {string} [props] Parts of the `Claim`s to return.
+* @param {string} [props] Specific parts of the `Claim`s to include in 
the response.
 * @return {Object} jQuery.Promise
 * @return {Function} return.done
 * @return {*} return.done.result

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib26abf43cd8edf5412c9867d2fc30fded850d162
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseJavaScriptApi
Gerrit-Branch: master
Gerrit-Owner: Henning Snater henning.sna...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] Make LocalisationCache::getMessagesDirs() public - change (mediawiki/core)

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

Change subject: Make LocalisationCache::getMessagesDirs() public
..


Make LocalisationCache::getMessagesDirs() public

So it can be used inside LocalisationUpdate

Change-Id: I2399ddd7fd4462f2c6d1bf81036af451a67c58b1
---
M includes/cache/LocalisationCache.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/cache/LocalisationCache.php 
b/includes/cache/LocalisationCache.php
index 2c908af..7d5450e 100644
--- a/includes/cache/LocalisationCache.php
+++ b/includes/cache/LocalisationCache.php
@@ -799,7 +799,7 @@
 * @since 1.25
 * @return array
 */
-   protected function getMessagesDirs() {
+   public function getMessagesDirs() {
global $wgMessagesDirs, $IP;
return array(
'core' = $IP/languages/i18n,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2399ddd7fd4462f2c6d1bf81036af451a67c58b1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org
Gerrit-Reviewer: Nikerabbit niklas.laxst...@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] Use LocalisationCache::getMessagesDirs() - change (mediawiki...LocalisationUpdate)

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

Change subject: Use LocalisationCache::getMessagesDirs()
..


Use LocalisationCache::getMessagesDirs()

Depends on I2399ddd7fd in mediawiki/core which makes the method
public.

Change-Id: Ic8fb0b2ab127c20518a055c0b4f8bc28980c9123
---
M update.php
1 file changed, 10 insertions(+), 2 deletions(-)

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



diff --git a/update.php b/update.php
index 1f66e73..bb94980 100644
--- a/update.php
+++ b/update.php
@@ -25,7 +25,7 @@
ini_set( max_execution_time, 0 );
ini_set( 'memory_limit', -1 );
 
-   global $wgExtensionMessagesFiles, $wgMessagesDirs, $IP;
+   global $wgExtensionMessagesFiles, $IP;
global $wgLocalisationUpdateRepositories;
global $wgLocalisationUpdateRepository;
 
@@ -35,7 +35,15 @@
return;
}
 
-   $finder = new LU_Finder( $wgExtensionMessagesFiles, 
$wgMessagesDirs, $IP );
+   $lc = Language::getLocalisationCache();
+   if ( is_callable( array( $lc, 'getMessagesDirs' ) ) ) { // 
Introduced in 1.25
+   $messagesDirs = $lc-getMessagesDirs();
+   } else {
+   global $wgMessagesDirs;
+   $messagesDirs = $wgMessagesDirs;
+   }
+
+   $finder = new LU_Finder( $wgExtensionMessagesFiles, 
$messagesDirs, $IP );
$readerFactory = new LU_ReaderFactory();
$fetcherFactory = new LU_FetcherFactory();
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic8fb0b2ab127c20518a055c0b4f8bc28980c9123
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LocalisationUpdate
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org
Gerrit-Reviewer: Nikerabbit niklas.laxst...@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] Partitioning scheme for cassandra hosts - change (operations/puppet)

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

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

Change subject: Partitioning scheme for cassandra hosts
..

Partitioning scheme for cassandra hosts

Cassandra hosts have 2 spinning disks and 2 SSDs. Partman should be
instructed to create a /boot partition on the spinning disks. The rest
should be RAID1 LVM root and swap
The SSDs neeed to be RAID0 with a single partition

Change-Id: I2c165028c617a2e875fd25291d49512ebba3a95b
---
M modules/install-server/files/autoinstall/netboot.cfg
A modules/install-server/files/autoinstall/partman/cassandrahosts.cfg
M modules/install-server/files/autoinstall/partman/raid0-lvm.cfg
3 files changed, 83 insertions(+), 2 deletions(-)


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

diff --git a/modules/install-server/files/autoinstall/netboot.cfg 
b/modules/install-server/files/autoinstall/netboot.cfg
index fe79b39..f16d268 100755
--- a/modules/install-server/files/autoinstall/netboot.cfg
+++ b/modules/install-server/files/autoinstall/netboot.cfg
@@ -83,7 +83,7 @@
snapshot[1-4]|snapshot100[1-4]) echo partman/snapshot.cfg ;; \
stat1002) echo partman/lvm-noraid-large.a.cfg ;; \

argon|bast4001|copper|neon|ruthenium|ssl[1-3]0[0-9][0-9]|ssl[0-9]|titanium|ytterbium|zirconium)
 echo partman/raid1-lvm.cfg ;; \
-   cerium|praseodymium|xenon) echo partman/raid0-lvm.cfg ;; \
+   cerium|praseodymium|xenon) echo partman/cassandrahosts.cfg ;; \
virt[5-9]|virt1[0-1]) echo partman/virt-raid10-cisco.cfg ;; \
virt100[1-9]) echo partman/virt-raid10-cisco.cfg ;; \
labnet1001) echo partman/lvm.cfg ;; \
diff --git 
a/modules/install-server/files/autoinstall/partman/cassandrahosts.cfg 
b/modules/install-server/files/autoinstall/partman/cassandrahosts.cfg
new file mode 100644
index 000..4abe188
--- /dev/null
+++ b/modules/install-server/files/autoinstall/partman/cassandrahosts.cfg
@@ -0,0 +1,81 @@
+# Automatic software RAID partitioning
+#
+# * 4 disks, sda, sdb, sdc, sdd
+# * 2 Spinning disks sda/sdb, 2 SSDs sdc/sdd
+# * LVM
+# * layout:
+#   - /boot:  RAID1, 500MB on spinning disks
+#   - /:   ext3, RAID1, 50GB on LVM on spinning disks
+#   - swap:  RAID1, 1G on LVM on spinning disks
+#   - rest is lvm RAID1, on spinning disks
+#   - SSDs as a single RAID0 unpartioned drive
+
+d-ipartman-auto/method string  raid
+d-ipartman-md/device_remove_md boolean true
+d-ipartman-lvm/device_remove_lvm   boolean true
+d-ipartman/alignment   select  optimal
+
+# Use the first two disks
+d-ipartman-auto/disk   string  /dev/sda /dev/sdb
+d-ipartman-auto/choose_recipe select boot-root
+
+# Define physical partitions
+d-ipartman-auto/expert_recipe  string  \
+   raid1-boot-root ::  \
+   500 1   500 raid\
+   $primary{ } method{ raid }  \
+   $lvmignore{ }   \
+   .   \
+   500 2   -1  raid\
+   $primary{ } method{ raid }  \
+   $lvmignore{ }   \
+   .   \
+   5   4   5  ext3 \
+   $lvmok{ }   \
+   $defaultignore{ }   \
+   lv_name{ root } \
+   method{ format }\
+   format{ }   \
+   use_filesystem{ }   \
+   filesystem{ ext3 }  \
+   mountpoint{ / } \
+   .   \
+   10003   1000linux-swap  \
+   $defaultignore{ }   \
+   $lvmok{ }   \
+   lv_name{ swap } \
+   method{ swap }  \
+   format{ }   \
+   .\
+   raid0-srv ::\
+   500 1   -   raid\
+   $primary{ } method{ raid }  \
+   $lvmignore{ }   \
+   .
+
+# Parameters are:
+# raidtype devcount sparecount fstype mountpoint \
+#  devices sparedevices
+d-i

[MediaWiki-commits] [Gerrit] Fixed error when image cannot be found locally - change (mediawiki...BlueSpiceFoundation)

2014-12-04 Thread Mglaser (Code Review)
Mglaser has uploaded a new change for review.

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

Change subject: Fixed error when image cannot be found locally
..

Fixed error when image cannot be found locally

When an image cannot be found locally, no image object is instantiated.
However, the method tried to access a method of this object, resulting in
an error. Now, in this case an empty string is returned.

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


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/05/177505/1

diff --git a/includes/CommonAJAXInterface.php b/includes/CommonAJAXInterface.php
index af92914..8cc321b 100644
--- a/includes/CommonAJAXInterface.php
+++ b/includes/CommonAJAXInterface.php
@@ -507,6 +507,9 @@
if ( !$image ) {
$image = wfLocalFile( $name );
}
+   if ( !$image ) {
+   return $image;
+   }
return $image-getUrl();
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b10d278485b88af2ea15f7a48996f5cf7ba4a20
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Mglaser gla...@hallowelt.biz

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


[MediaWiki-commits] [Gerrit] Move thumbnail preview handling to UWU - change (mediawiki...UploadWizard)

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

Change subject: Move thumbnail preview handling to UWU
..


Move thumbnail preview handling to UWU

Just another step towards less passing of parent objects...

Change-Id: I3c42f4d5758d820b88142e104793a4fd922e883e
---
M resources/mw.UploadWizard.js
M resources/mw.UploadWizardUpload.js
M resources/mw.UploadWizardUploadInterface.js
3 files changed, 128 insertions(+), 113 deletions(-)

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



diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js
index 0742bfe..d59f99b 100644
--- a/resources/mw.UploadWizard.js
+++ b/resources/mw.UploadWizard.js
@@ -387,11 +387,9 @@
 *   and UI for the upload itself and the details at the 
second step of the wizard.
 *   we don't yet add it to the list of uploads; that only 
happens when it gets a real file.
 *
-* @param providedFile  Existing File object, typically from a 
multi-select operation
-*
 * @return the new upload
 */
-   newUpload: function ( providedFile ) {
+   newUpload: function () {
var upload,
wizard = this;
 
@@ -439,11 +437,13 @@
.on( 'extra-files', function ( files, toobig ) {
$.each( files, function ( i, file ) {
// NOTE: By running newUpload 
we will end up calling checkfile() again.
-   var newUpload = 
wizard.newUpload( file );
+   var newUpload = 
wizard.newUpload();
 
if ( toobig ) {

newUpload.disablePreview();
}
+
+   newUpload.fill( file );
} );
 
wizard.updateFileCounts();
@@ -452,10 +452,6 @@
.on( 'error', function ( code, message ) {
uw.eventFlowLogger.logError( 'file', { 
code: code, message: message } );
} );
-
-   if ( providedFile ) {
-   upload.fill( providedFile );
-   }
 
// we explicitly move the file input to cover the 
upload button
upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file', 
'poll' );
diff --git a/resources/mw.UploadWizardUpload.js 
b/resources/mw.UploadWizardUpload.js
index f486d28..7b09ea0 100644
--- a/resources/mw.UploadWizardUpload.js
+++ b/resources/mw.UploadWizardUpload.js
@@ -46,6 +46,8 @@
this.file = undefined;
this.ignoreWarning = {};
this.fromURL = false;
+   this.previewLoaded = false;
+   this.generatePreview = true;
 
this.fileKey = undefined;
 
@@ -57,7 +59,8 @@
this.ui = new mw.UploadWizardUploadInterface( this, filesDiv )
.connect( this, {
'file-changed': [ 'emit', 'file-changed', 
upload ],
-   'filename-accepted': [ 'emit', 
'filename-accepted' ]
+   'filename-accepted': [ 'emit', 
'filename-accepted' ],
+   'show-preview': 'makePreview'
} )
 
.on( 'upload-filled', function () {
@@ -407,7 +410,7 @@
// Local previews are slow due to the data URI 
insertion into the DOM; for batches we
// don't generate them if the size of the batch exceeds 
10 MB
if ( toobig ) {
-   this.ui.disablePreview();
+   this.disablePreview();
}
}
 
@@ -549,6 +552,13 @@
}
}
}
+   };
+
+   /**
+* Disable preview thumbnail for this upload.
+*/
+   UWUP.disablePreview = function () {
+   this.generatePreview = false;
};
 
/**
@@ -1149,6 +1159,106 @@
 */
UWUP.fileChangedOk = function () {
this.ui.fileChangedOk( this.imageinfo, this.file, this.fromURL 
);
+
+   if ( this.generatePreview ) {
+   this.makePreview();
+   } else {
+   this.ui.makeShowThumbCtrl();
+   }
+   };
+
+   /**
+* Make a preview for the file.
+*/
+   UWUP.makePreview 

[MediaWiki-commits] [Gerrit] changed icomoon inlusion, needs to have the skin name for ex... - change (mediawiki...BlueSpiceSkin)

2014-12-04 Thread Tweichart (Code Review)
Tweichart has uploaded a new change for review.

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

Change subject: changed icomoon inlusion, needs to have the skin name for 
extending the skin
..

changed icomoon inlusion, needs to have the skin name for extending the skin

Change-Id: Ieb7282de3b08b219548ebeca368f9fa124576d38
---
M BlueSpiceSkin.skin.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/BlueSpiceSkin 
refs/changes/06/177506/1

diff --git a/BlueSpiceSkin.skin.php b/BlueSpiceSkin.skin.php
index e20d8d1..cdf932a 100644
--- a/BlueSpiceSkin.skin.php
+++ b/BlueSpiceSkin.skin.php
@@ -42,13 +42,13 @@
'icomoon-style',
\nlink rel=\stylesheet\ href=\ .
htmlspecialchars( $wgLocalStylePath ) .
-   
/{$this-stylename}/resources/icomoon/icomoon.icons.css\\n
+   
/BlueSpiceSkin/resources/icomoon/icomoon.icons.css\\n
.!--[if lt IE 8]\nlink rel=\stylesheet\ href=\ .
htmlspecialchars( $wgLocalStylePath ) .
-   
/{$this-stylename}/resources/icomoon/icomoon.icons.ie7.css\\n![endif]--\n
+   
/BlueSpiceSkin/resources/icomoon/icomoon.icons.ie7.css\\n![endif]--\n
. !--[if lt IE 8]\nscript src=\ .
htmlspecialchars( $wgLocalStylePath ) .
-   
/{$this-stylename}/resources/icomoon/icomoon.icons.ie7.js\/script\n![endif]--\n
+   
/BlueSpiceSkin/resources/icomoon/icomoon.icons.ie7.js\/script\n![endif]--\n
);
 
$out-addModules('skins.bluespiceskin.scripts');

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb7282de3b08b219548ebeca368f9fa124576d38
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSpiceSkin
Gerrit-Branch: master
Gerrit-Owner: Tweichart weich...@hallowelt.biz

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


[MediaWiki-commits] [Gerrit] moved code to method for better overwriting - change (mediawiki...BlueSpiceFoundation)

2014-12-04 Thread Tweichart (Code Review)
Tweichart has uploaded a new change for review.

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

Change subject: moved code to method for better overwriting
..

moved code to method for better overwriting

Change-Id: I6c88d384ac0688cbaa52b39da573287fcf2ebfc1
---
M includes/BsBaseTemplate.php
1 file changed, 18 insertions(+), 13 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/07/177507/1

diff --git a/includes/BsBaseTemplate.php b/includes/BsBaseTemplate.php
index 14580e9..0063b1e 100644
--- a/includes/BsBaseTemplate.php
+++ b/includes/BsBaseTemplate.php
@@ -530,6 +530,23 @@
else
$aOut[] = span class='bs-personal-not-loggedin' . 
Linker::link(SpecialPage::getTitleFor('login'), wfMessage(login)-plain()) . 
/span;
 
+   $this-printPersonalInfo($aOut);
+
+   $personalTools = $this-getPersonalTools();
+   $aOut[] = 'div id=bs-personal-menu-container';
+   $aOut[] = '  ul id=bs-personal-menu 
'.$this-data['userlangattributes'].'';
+   foreach ( $personalTools as $key = $item ) {
+   $aOut[] = $this-makeListItem( $key, $item );
+   }
+   $aOut[] = '  /ul';
+   $aOut[] = '/div';
+   $aOut[] = '  /div';
+   $aOut[] = '/div';
+
+   echo implode(\n, $aOut);
+   }
+
+   protected function printPersonalInfo($aOut){
$aOut[] = 'ul id=bs-personal-info';
foreach( $this-data['bs_personal_info'] as $item ) {
$sActiveClass = $item['active'] ? 'active' : '';
@@ -550,19 +567,7 @@
);
}
$aOut[] = '/ul';
-
-   $personalTools = $this-getPersonalTools();
-   $aOut[] = 'div id=bs-personal-menu-container';
-   $aOut[] = '  ul id=bs-personal-menu 
'.$this-data['userlangattributes'].'';
-   foreach ( $personalTools as $key = $item ) {
-   $aOut[] = $this-makeListItem( $key, $item );
-   }
-   $aOut[] = '  /ul';
-   $aOut[] = '/div';
-   $aOut[] = '  /div';
-   $aOut[] = '/div';
-
-   echo implode(\n, $aOut);
+   return true;
}
 
protected function printSkyScraper() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c88d384ac0688cbaa52b39da573287fcf2ebfc1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Tweichart weich...@hallowelt.biz

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


[MediaWiki-commits] [Gerrit] Import stdlib from operations/puppet - change (mediawiki/vagrant)

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

Change subject: Import stdlib from operations/puppet
..


Import stdlib from operations/puppet

Change-Id: I1d2b3a1e3c6598693a902d0a2c856d45f3b48be6
---
A puppet/modules/stdlib/CHANGELOG.md
A puppet/modules/stdlib/LICENSE
A puppet/modules/stdlib/Modulefile
A puppet/modules/stdlib/README.markdown
A puppet/modules/stdlib/README_DEVELOPER.markdown
A puppet/modules/stdlib/RELEASE_PROCESS.markdown
A puppet/modules/stdlib/Rakefile
A puppet/modules/stdlib/lib/facter/facter_dot_d.rb
A puppet/modules/stdlib/lib/facter/pe_version.rb
A puppet/modules/stdlib/lib/facter/puppet_vardir.rb
A puppet/modules/stdlib/lib/facter/root_home.rb
A puppet/modules/stdlib/lib/facter/util/puppet_settings.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/abs.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/bool2num.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/capitalize.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/chomp.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/chop.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/defined_with_params.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/delete.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/delete_at.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/downcase.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/empty.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/ensure_packages.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/ensure_resource.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/flatten.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/floor.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/fqdn_rotate.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/get_module_path.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/getvar.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/grep.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/has_interface_with.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/has_ip_address.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/has_ip_network.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/has_key.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/hash.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/is_array.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/is_domain_name.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/is_float.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/is_hash.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/is_integer.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/is_ip_address.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/is_mac_address.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/is_numeric.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/is_string.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/join.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/join_keys_to_values.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/keys.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/loadyaml.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/lstrip.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/max.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/member.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/merge.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/min.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/num2bool.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/parsejson.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/parseyaml.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/pick.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/prefix.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/range.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/reject.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/reverse.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/rstrip.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/shuffle.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/size.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/sort.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/squeeze.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/str2bool.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/str2saltedsha512.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/strftime.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/strip.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/swapcase.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/time.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/to_bytes.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/type.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/unique.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/upcase.rb
A puppet/modules/stdlib/lib/puppet/parser/functions/uriescape.rb
A 

[MediaWiki-commits] [Gerrit] Improve pr_quality CSS - change (mediawiki...ProofreadPage)

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

Change subject: Improve pr_quality CSS
..


Improve pr_quality CSS

Bug: T76284
Change-Id: I057ec61ac21fcc32184ffe09f55c2b04ad52dca1
---
M ProofreadPage.body.php
M modules/article/ext.proofreadpage.article.css
2 files changed, 13 insertions(+), 13 deletions(-)

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



diff --git a/ProofreadPage.body.php b/ProofreadPage.body.php
index 1f255f7..a2dce50 100644
--- a/ProofreadPage.body.php
+++ b/ProofreadPage.body.php
@@ -567,15 +567,17 @@
$q3 = $n3 * 100 / $n;
$q4 = $n4 * 100 / $n;
$qe = $ne * 100 / $n;
-   $void_cell = $ne ? 'td style=width:' . $qe . 'px;/td' : 
'';
-   $output = 'table class=pr_qualitytr
-td class=quality4 style=width:' . $q4 . 'px;/td
-td class=quality3 style=width:' . $q3 . 'px;/td
-td class=quality2 style=width:' . $q2 . 'px;/td
-td class=quality1 style=width:' . $q1 . 'px;/td
-td class=quality0 style=width:' . $q0 . 'px;/td
+   $void_cell = $ne ? 'td class=qualitye style=width:' . $qe . 
'%;/td' : '';
+   $output = 'table class=pr_quality
+tr
+td class=quality4 style=width:' . $q4 . '%;/td
+td class=quality3 style=width:' . $q3 . '%;/td
+td class=quality2 style=width:' . $q2 . '%;/td
+td class=quality1 style=width:' . $q1 . '%;/td
+td class=quality0 style=width:' . $q0 . '%;/td
 ' . $void_cell . '
-/tr/table';
+/tr
+/table';
$out-setSubtitle( $out-getSubtitle() . $output );
return true;
}
diff --git a/modules/article/ext.proofreadpage.article.css 
b/modules/article/ext.proofreadpage.article.css
index 6a04abd..38a9ff1 100644
--- a/modules/article/ext.proofreadpage.article.css
+++ b/modules/article/ext.proofreadpage.article.css
@@ -1,14 +1,12 @@
 .pr_quality {
border-collapse: separate;
border-spacing: 0px 0px;
-   border-width: 1px;
-   border-style: dotted;
-   line-height: 2em;
-   margin: -0.45em 0.00em 0.00em 0.01em;
+   border: 1px dotted #B8B8B8;
text-align: center;
+   width: 100px;
 }
 
 .pr_quality td {
padding: 0;
-   height: 0.2em;
+   height: 0.4em;
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I057ec61ac21fcc32184ffe09f55c2b04ad52dca1
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Tpt thomaspe...@gmail.com
Gerrit-Reviewer: GOIII george.orwell@outlook.com
Gerrit-Reviewer: Tpt thomaspe...@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] changed icomoon inlusion, needs to have the skin name for ex... - change (mediawiki...BlueSpiceSkin)

2014-12-04 Thread Mglaser (Code Review)
Mglaser has submitted this change and it was merged.

Change subject: changed icomoon inlusion, needs to have the skin name for 
extending the skin
..


changed icomoon inlusion, needs to have the skin name for extending the skin

Change-Id: Ieb7282de3b08b219548ebeca368f9fa124576d38
---
M BlueSpiceSkin.skin.php
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/BlueSpiceSkin.skin.php b/BlueSpiceSkin.skin.php
index e20d8d1..cdf932a 100644
--- a/BlueSpiceSkin.skin.php
+++ b/BlueSpiceSkin.skin.php
@@ -42,13 +42,13 @@
'icomoon-style',
\nlink rel=\stylesheet\ href=\ .
htmlspecialchars( $wgLocalStylePath ) .
-   
/{$this-stylename}/resources/icomoon/icomoon.icons.css\\n
+   
/BlueSpiceSkin/resources/icomoon/icomoon.icons.css\\n
.!--[if lt IE 8]\nlink rel=\stylesheet\ href=\ .
htmlspecialchars( $wgLocalStylePath ) .
-   
/{$this-stylename}/resources/icomoon/icomoon.icons.ie7.css\\n![endif]--\n
+   
/BlueSpiceSkin/resources/icomoon/icomoon.icons.ie7.css\\n![endif]--\n
. !--[if lt IE 8]\nscript src=\ .
htmlspecialchars( $wgLocalStylePath ) .
-   
/{$this-stylename}/resources/icomoon/icomoon.icons.ie7.js\/script\n![endif]--\n
+   
/BlueSpiceSkin/resources/icomoon/icomoon.icons.ie7.js\/script\n![endif]--\n
);
 
$out-addModules('skins.bluespiceskin.scripts');

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ieb7282de3b08b219548ebeca368f9fa124576d38
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSpiceSkin
Gerrit-Branch: master
Gerrit-Owner: Tweichart weich...@hallowelt.biz
Gerrit-Reviewer: Mglaser gla...@hallowelt.biz
Gerrit-Reviewer: Pigpen reym...@hallowelt.biz
Gerrit-Reviewer: Robert Vogel vo...@hallowelt.biz
Gerrit-Reviewer: Smuggli mug...@hallowelt.biz
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] moved code to method for better overwriting - change (mediawiki...BlueSpiceFoundation)

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

Change subject: moved code to method for better overwriting
..


moved code to method for better overwriting

Change-Id: I6c88d384ac0688cbaa52b39da573287fcf2ebfc1
---
M includes/BsBaseTemplate.php
1 file changed, 18 insertions(+), 13 deletions(-)

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



diff --git a/includes/BsBaseTemplate.php b/includes/BsBaseTemplate.php
index 14580e9..0063b1e 100644
--- a/includes/BsBaseTemplate.php
+++ b/includes/BsBaseTemplate.php
@@ -530,6 +530,23 @@
else
$aOut[] = span class='bs-personal-not-loggedin' . 
Linker::link(SpecialPage::getTitleFor('login'), wfMessage(login)-plain()) . 
/span;
 
+   $this-printPersonalInfo($aOut);
+
+   $personalTools = $this-getPersonalTools();
+   $aOut[] = 'div id=bs-personal-menu-container';
+   $aOut[] = '  ul id=bs-personal-menu 
'.$this-data['userlangattributes'].'';
+   foreach ( $personalTools as $key = $item ) {
+   $aOut[] = $this-makeListItem( $key, $item );
+   }
+   $aOut[] = '  /ul';
+   $aOut[] = '/div';
+   $aOut[] = '  /div';
+   $aOut[] = '/div';
+
+   echo implode(\n, $aOut);
+   }
+
+   protected function printPersonalInfo($aOut){
$aOut[] = 'ul id=bs-personal-info';
foreach( $this-data['bs_personal_info'] as $item ) {
$sActiveClass = $item['active'] ? 'active' : '';
@@ -550,19 +567,7 @@
);
}
$aOut[] = '/ul';
-
-   $personalTools = $this-getPersonalTools();
-   $aOut[] = 'div id=bs-personal-menu-container';
-   $aOut[] = '  ul id=bs-personal-menu 
'.$this-data['userlangattributes'].'';
-   foreach ( $personalTools as $key = $item ) {
-   $aOut[] = $this-makeListItem( $key, $item );
-   }
-   $aOut[] = '  /ul';
-   $aOut[] = '/div';
-   $aOut[] = '  /div';
-   $aOut[] = '/div';
-
-   echo implode(\n, $aOut);
+   return true;
}
 
protected function printSkyScraper() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6c88d384ac0688cbaa52b39da573287fcf2ebfc1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Tweichart weich...@hallowelt.biz
Gerrit-Reviewer: Mglaser gla...@hallowelt.biz
Gerrit-Reviewer: Pigpen reym...@hallowelt.biz
Gerrit-Reviewer: Robert Vogel vo...@hallowelt.biz
Gerrit-Reviewer: Smuggli mug...@hallowelt.biz
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] getEntitiesByPage: Always submit normalize parameter if sp... - change (mediawiki...WikibaseJavaScriptApi)

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

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

Change subject: getEntitiesByPage: Always submit normalize parameter if 
specified
..

getEntitiesByPage: Always submit normalize parameter if specified

Change-Id: I316f1b6f2aa30510c0ac84e85c25ba28144ed49f
---
M src/RepoApi.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/src/RepoApi.js b/src/RepoApi.js
index 584b4df..e2fd225 100644
--- a/src/RepoApi.js
+++ b/src/RepoApi.js
@@ -196,7 +196,7 @@
languages: this._normalizeParam( languages ),
sort: this._normalizeParam( sort ),
dir: dir || undefined,
-   normalize: normalize || undefined
+   normalize: typeof normalize === 'boolean' ? normalize : 
undefined
};
 
return this._api.get( params );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I316f1b6f2aa30510c0ac84e85c25ba28144ed49f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseJavaScriptApi
Gerrit-Branch: master
Gerrit-Owner: Henning Snater henning.sna...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] Added RepoApi tests for functions not yet tested - change (mediawiki...WikibaseJavaScriptApi)

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

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

Change subject: Added RepoApi tests for functions not yet tested
..

Added RepoApi tests for functions not yet tested

Change-Id: I2e45bbfdcae0cb378a376dd9ff635e1fe080378f
---
M tests/RepoApi.tests.js
1 file changed, 311 insertions(+), 48 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseJavaScriptApi 
refs/changes/09/177509/1

diff --git a/tests/RepoApi.tests.js b/tests/RepoApi.tests.js
index cde2b2f..2c5e7fc 100644
--- a/tests/RepoApi.tests.js
+++ b/tests/RepoApi.tests.js
@@ -112,6 +112,143 @@
assert.equal( getParam( mock.spy, 'data' ), JSON.stringify( data ) );
 } );
 
+QUnit.test( 'formatValue()', function( assert ) {
+   var mock = mockApi( 'get' );
+
+   mock.api.formatValue(
+   { datavalue: 'serialization' },
+   { option: 'option value'},
+   'data type id',
+   'output format'
+   );
+
+   assert.ok( mock.spy.calledOnce, 'Triggered API call.' );
+
+   assert.equal(
+   getParam( mock.spy, 'action' ),
+   'wbformatvalue',
+   'Verified API module being called.'
+   );
+
+   assert.equal(
+   getParam( mock.spy, 'datavalue' ),
+   JSON.stringify( { datavalue: 'serialization' } )
+   );
+   assert.equal( getParam( mock.spy, 'options' ), JSON.stringify( { 
option: 'option value'} ) );
+   assert.equal( getParam( mock.spy, 'datatype' ), 'data type id' );
+   assert.equal( getParam( mock.spy, 'generate' ), 'output format' );
+} );
+
+QUnit.test( 'getEntities()', function( assert ) {
+   var mock = mockApi( 'get' );
+
+   mock.api.getEntities(
+   ['entity id 1', 'entity id 2'],
+   ['property1', 'property2'],
+   ['language code 1', 'language code 2'],
+   ['sort property 1', 'sort property 2'],
+   'sort direction'
+   );
+
+   mock.api.getEntities(
+   'entity id',
+   'property',
+   'language code',
+   'sort property',
+   'sort direction'
+   );
+
+   assert.ok( mock.spy.calledTwice, 'Triggered API calls.' );
+
+   assert.equal(
+   getParam( mock.spy, 'action' ),
+   'wbgetentities',
+   'Verified API module being called.'
+   );
+
+   assert.equal( getParam( mock.spy, 'ids' ), 'entity id 1|entity id 2' );
+   assert.equal( getParam( mock.spy, 'props' ), 'property1|property2' );
+   assert.equal( getParam( mock.spy, 'languages' ), 'language code 
1|language code 2' );
+   assert.equal( getParam( mock.spy, 'sort' ), 'sort property 1|sort 
property 2' );
+   assert.equal( getParam( mock.spy, 'dir' ), 'sort direction' );
+
+   assert.equal( getParam( mock.spy, 'ids', 1 ), 'entity id' );
+   assert.equal( getParam( mock.spy, 'props', 1 ), 'property' );
+   assert.equal( getParam( mock.spy, 'languages', 1 ), 'language code' );
+   assert.equal( getParam( mock.spy, 'sort', 1 ), 'sort property' );
+   assert.equal( getParam( mock.spy, 'dir', 1 ), 'sort direction' );
+} );
+
+QUnit.test( 'getEntitiesByPage()', function( assert ) {
+   var mock = mockApi( 'get' );
+
+   mock.api.getEntitiesByPage(
+   ['site id 1', 'site id 2'],
+   ['title1', 'title2'],
+   ['property1', 'property2'],
+   ['language code 1', 'language code 2'],
+   ['sort property 1', 'sort property 2'],
+   'sort direction',
+   true
+   );
+
+   mock.api.getEntitiesByPage(
+   'site id',
+   'title',
+   'property',
+   'language code',
+   'sort property',
+   'sort direction',
+   false
+   );
+
+   assert.ok( mock.spy.calledTwice, 'Triggered API calls.' );
+
+   assert.equal(
+   getParam( mock.spy, 'action' ),
+   'wbgetentities',
+   'Verified API module being called.'
+   );
+
+   assert.equal( getParam( mock.spy, 'sites' ), 'site id 1|site id 2' );
+   assert.equal( getParam( mock.spy, 'titles' ), 'title1|title2' );
+   assert.equal( getParam( mock.spy, 'props' ), 'property1|property2' );
+   assert.equal( getParam( mock.spy, 'languages' ), 'language code 
1|language code 2' );
+   assert.equal( getParam( mock.spy, 'sort' ), 'sort property 1|sort 
property 2' );
+   assert.equal( getParam( mock.spy, 'dir' ), 'sort direction' );
+   assert.strictEqual( getParam( mock.spy, 'normalize' ), true );
+
+   assert.equal( getParam( mock.spy, 'sites', 1 ), 'site id' );
+   assert.equal( getParam( mock.spy, 'titles', 1 ), 'title' );
+   assert.equal( getParam( mock.spy, 'props', 1 ), 

[MediaWiki-commits] [Gerrit] Fixed error when image cannot be found locally - change (mediawiki...BlueSpiceFoundation)

2014-12-04 Thread Smuggli (Code Review)
Smuggli has submitted this change and it was merged.

Change subject: Fixed error when image cannot be found locally
..


Fixed error when image cannot be found locally

When an image cannot be found locally, no image object is instantiated.
However, the method tried to access a method of this object, resulting in
an error. Now, in this case an empty string is returned.

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

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



diff --git a/includes/CommonAJAXInterface.php b/includes/CommonAJAXInterface.php
index af92914..8cc321b 100644
--- a/includes/CommonAJAXInterface.php
+++ b/includes/CommonAJAXInterface.php
@@ -507,6 +507,9 @@
if ( !$image ) {
$image = wfLocalFile( $name );
}
+   if ( !$image ) {
+   return $image;
+   }
return $image-getUrl();
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5b10d278485b88af2ea15f7a48996f5cf7ba4a20
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Mglaser gla...@hallowelt.biz
Gerrit-Reviewer: Pigpen reym...@hallowelt.biz
Gerrit-Reviewer: Robert Vogel vo...@hallowelt.biz
Gerrit-Reviewer: Smuggli mug...@hallowelt.biz
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Correct return type for getConnection - change (mediawiki...ContentTranslation)

2014-12-04 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review.

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

Change subject: Correct return type for getConnection
..

Correct return type for getConnection

Use IDatabase
Followup: I70211187c7

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


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

diff --git a/includes/Database.php b/includes/Database.php
index ccbc183..0ad39af 100644
--- a/includes/Database.php
+++ b/includes/Database.php
@@ -8,7 +8,7 @@
/**
 * Gets a database connection to the ContentTranslation database
 * @param int $type Either DB_SLAVE or DB_MASTER
-* @return DBConnRef
+* @return IDatabase
 */
public static function getConnection( $type ) {
global $wgContentTranslationDatabase, 
$wgContentTranslationCluster;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If76eb4276d514439a6f88b9cd0fd3fb4caac86e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh santhosh.thottin...@gmail.com

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


[MediaWiki-commits] [Gerrit] Delete the draft translation after publish - change (mediawiki...ContentTranslation)

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

Change subject: Delete the draft translation after publish
..


Delete the draft translation after publish

Drafts can not be further edited after publishing. So delete them
once published.

Bug: T75986
Change-Id: I82df741a934bbd6ac5a6392f2ba8151b86e42fc8
---
M api/ApiContentTranslationPublish.php
M includes/Draft.php
2 files changed, 18 insertions(+), 0 deletions(-)

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



diff --git a/api/ApiContentTranslationPublish.php 
b/api/ApiContentTranslationPublish.php
index c6128dc..2fab165 100644
--- a/api/ApiContentTranslationPublish.php
+++ b/api/ApiContentTranslationPublish.php
@@ -195,7 +195,11 @@
$translationId = $translation-getTranslationId();
$translator-addTranslation(  $translationId );
if ( $params['status'] === 'draft' ) {
+   // Save the draft
ContentTranslation\Draft::save( $translationId, 
$params['html'] );
+   } else {
+   // Delete the draft
+   ContentTranslation\Draft::delete( $translationId );
}
}
 
diff --git a/includes/Draft.php b/includes/Draft.php
index 9ee9923..c20d772 100644
--- a/includes/Draft.php
+++ b/includes/Draft.php
@@ -22,4 +22,18 @@
);
}
 
+   /**
+* Delete the draft for the given draftId
+* @param {int} $draftId
+*/
+   public static function delete( $draftId ) {
+   $dbw = Database::getConnection( DB_MASTER );
+   $dbw-delete(
+   'cx_drafts',
+   array(
+   'draft_id' = $draftId,
+   ),
+   __METHOD__
+   );
+   }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I82df741a934bbd6ac5a6392f2ba8151b86e42fc8
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh santhosh.thottin...@gmail.com
Gerrit-Reviewer: KartikMistry kartik.mis...@gmail.com
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: Santhosh santhosh.thottin...@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] Enable ContentTranslation shared database on labs - change (operations/mediawiki-config)

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

Change subject: Enable ContentTranslation shared database on labs
..


Enable ContentTranslation shared database on labs

Bug: T1254
Change-Id: Ia1151462fcf2d4831ffef5146dd90573cc0b831f
---
M wmf-config/CommonSettings-labs.php
M wmf-config/InitialiseSettings-labs.php
2 files changed, 11 insertions(+), 1 deletion(-)

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



diff --git a/wmf-config/CommonSettings-labs.php 
b/wmf-config/CommonSettings-labs.php
index fc8a106..322ff18 100644
--- a/wmf-config/CommonSettings-labs.php
+++ b/wmf-config/CommonSettings-labs.php
@@ -89,7 +89,7 @@
 }
 
 if ( $wmgUseContentTranslation ) {
-   require_once( 
$IP/extensions/ContentTranslation/ContentTranslation.php );
+   require_once $IP/extensions/ContentTranslation/ContentTranslation.php;
$wgContentTranslationServerURL = 'https://cxserver-beta.wmflabs.org';
$wgContentTranslationSiteTemplates['cx'] = 
'https://cxserver-beta.wmflabs.org/page/$1/$2';
// Used for html2wikitext when publishing
@@ -101,6 +101,12 @@
 
$wgContentTranslationEventLogging = $wmgContentTranslationEventLogging;
 
+
+   if ( $wmgUseContentTranslationCluster ) {
+   $wgContentTranslationCluster = $wmgContentTranslationCluster;
+   }
+
+   $wgContentTranslationDatabase = 'wikishared';
 }
 
 if ( $wmgUseCentralNotice ) {
diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index fbb0736..9ab7f98 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -358,6 +358,10 @@
'default' = true,
),
 
+   'wmgContentTranslationCluster' = array(
+   'default' = 'extension1',
+   ),
+
'wmgUseNavigationTiming' = array(
'default' = true,
),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia1151462fcf2d4831ffef5146dd90573cc0b831f
Gerrit-PatchSet: 10
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: KartikMistry kartik.mis...@gmail.com
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: Reedy re...@wikimedia.org
Gerrit-Reviewer: Springle sprin...@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] Keep data-mw attributes for references to avoid parsoid error - change (mediawiki...ContentTranslation)

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

Change subject: Keep data-mw attributes for references to avoid parsoid error
..


Keep data-mw attributes for references to avoid parsoid error

Bug: T75119
Change-Id: I86596da48ba9396a565095271b470f3511975549
---
M modules/tools/ext.cx.tools.reference.js
1 file changed, 12 insertions(+), 1 deletion(-)

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



diff --git a/modules/tools/ext.cx.tools.reference.js 
b/modules/tools/ext.cx.tools.reference.js
index 7084659..47244fb 100644
--- a/modules/tools/ext.cx.tools.reference.js
+++ b/modules/tools/ext.cx.tools.reference.js
@@ -215,7 +215,9 @@
};
 
function processReferences( $section ) {
-   var referenceAdaptor = new ReferenceCard();
+   var $sourceSection, referenceAdaptor;
+
+   referenceAdaptor = new ReferenceCard();
$section.find( '[typeof*=mw:Extension/ref]' ).each( function 
() {
var $reference = $( this ),
referenceId = $reference.prop( 'id' );
@@ -231,6 +233,15 @@
// Adapt references.
referenceAdaptor.adaptReference( referenceId );
} );
+
+   if ( $section.is( '[typeof=mw:Extension/references]' ) ) {
+   // It is references listing. Copy data-mw that we strip 
before MT.
+   // See https://phabricator.wikimedia.org/T75121 and
+   // 
https://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Ref_and_References
+   $sourceSection = $( '#' + $section.data( 'source' ) );
+   $section.attr( 'data-mw', JSON.stringify( 
$sourceSection.data( 'mw' ) ) );
+   }
+
}
 
mw.cx.tools.reference = ReferenceCard;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I86596da48ba9396a565095271b470f3511975549
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh santhosh.thottin...@gmail.com
Gerrit-Reviewer: KartikMistry kartik.mis...@gmail.com
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: Santhosh santhosh.thottin...@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] MT: Subsequence extraction and mapping - change (mediawiki...cxserver)

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

Change subject: MT: Subsequence extraction and mapping
..


MT: Subsequence extraction and mapping

This is a new algorithm to map the annotations from source text
to translated text when the machine translation engine does not
support HTML translation (Example: Apertium)

This replaces the upper casing algorithm used for the same purpose.

A brief explanation of the algorithm is given below.

1 For the text to translate, find the text of inline annotations like
  bold, italics, links etc. We call it subsequences
2 Pass the full text and subsequences to the plain text machine translation
  engine. Use some delimiter so that we can do the array mapping between
  source items (full text and subsequences) and translated items.
3 The translated full text will have the subsequences somewhere in the text.
  To locate the subsequence translation in full text translation, use an
  approximate search algorithm
4 The approximate search algorithm will return the start position of
  match and length of match. To that range we map the annotation from the
  source html.
5 The approximate match involves calculating the edit distance between
  words in translated full text and translated subsequence. It is not strings
  being searched, but ngrams with n=number of words in subsequence. Each
  word in ngram will be matched independently.

LinearDoc version of the source and translated html is used heavily to
work with HTML structure and to apply annotations.

The approximate match algorithm is tailorable per language. Currently there
is only a generic matching implementation. Future commits will introduce 
language
specific matching algorithms

Depending on the capability of machine translation engines, the clients can
inherit the MTClient and override any of the following methods.
* translate - If the MT engine support html and text translations
* translateHTML - if the MT engine support html translations
* translateText - if the MT engine support plain text translations-which all 
machine
  translation engines do and hence need to be written per MT client. If MT 
engine
  support HTML translation, it is implied that it will support plain text too.

Existing MT unit tests should pass. More tests will follow after some more 
refactoring
in follow up patches

Bug: T76189
Change-Id: I5b97362d1bd75f7719eabd85bea19169ef3bc230
---
M Gruntfile.js
M index.js
M lineardoc/LinearDoc.js
M mt/Apertium.js
M mt/MTClient.js
M mt/Yandex.js
A mt/annotationmapper/LevenshteinDistance.js
A mt/annotationmapper/SubsequenceMatcher.js
M tests/mt/Apertium.test.js
9 files changed, 590 insertions(+), 393 deletions(-)

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



diff --git a/Gruntfile.js b/Gruntfile.js
index 239832b..67ba8b3 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -9,7 +9,7 @@
options: {
jshintrc: true
},
-   all: [ '*.js', 
'{models,mt,pageloader,public,segmentation,tests}/**/*.js' ]
+   all: [ '*.js', 
'{lineardoc,models,mt,pageloader,public,segmentation,tests}/**/*.js' ]
},
jscs: {
src: '%= jshint.all %'
diff --git a/index.js b/index.js
index f955bdb..167639e 100644
--- a/index.js
+++ b/index.js
@@ -1,6 +1,8 @@
 module.exports = {
Segmenter: require( './segmentation/CXSegmenter.js' ).CXSegmenter,
Apertium: require( './mt/Apertium.js' ),
+   Yandex: require( './mt/Yandex.js' ),
+   MTClient: require( './mt/MTClient.js' ),
LinearDoc: require( './lineardoc/LinearDoc.js' ),
Dictionary: require( './dictionary' )
 };
diff --git a/lineardoc/LinearDoc.js b/lineardoc/LinearDoc.js
index 3144bad..9d36744 100644
--- a/lineardoc/LinearDoc.js
+++ b/lineardoc/LinearDoc.js
@@ -1,8 +1,7 @@
 'use strict';
 
 var SAXParser = require( 'sax' ).SAXParser,
-   util = require( 'util' ),
-   isInlineAnnotationTag;
+   util = require( 'util' );
 
 /**
  * Find all matches of regex in text, calling callback with each match object
@@ -67,7 +66,7 @@
}
attributes.sort();
for ( i = 0, len = attributes.length; i  len; i++ ) {
-   attr = attributes[i];
+   attr = attributes[ i ];
html.push( ' ' + esc( attr ) + '=' + escAttr( tag.attributes[ 
attr ] ) + '' );
}
if ( tag.isSelfClosing ) {
@@ -84,9 +83,12 @@
  * @return {Object} Cloned tag
  */
 function cloneOpenTag( tag ) {
-   var attr, newTag = { name: tag.name, attributes: {} };
+   var attr, newTag = {
+   name: tag.name,
+   attributes: {}
+   };
for ( attr in tag.attributes ) {
-   newTag.attributes[attr] = tag.attributes[attr];
+   newTag.attributes[ attr ] = tag.attributes[ attr ];
   

[MediaWiki-commits] [Gerrit] Update from upstream jquery.uls - change (mediawiki...UniversalLanguageSelector)

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

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

Change subject: Update from upstream jquery.uls
..

Update from upstream jquery.uls

Allow configurable panel width instead of
hardcoded 4 columns of languages.

Change-Id: I163d7501598bdf6098a00432f53d56babe10a1a9
---
M lib/jquery.uls/css/jquery.uls.css
M lib/jquery.uls/src/jquery.uls.core.js
M lib/jquery.uls/src/jquery.uls.lcd.js
3 files changed, 70 insertions(+), 10 deletions(-)


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

diff --git a/lib/jquery.uls/css/jquery.uls.css 
b/lib/jquery.uls/css/jquery.uls.css
index 4e80c6b..6074e60 100644
--- a/lib/jquery.uls/css/jquery.uls.css
+++ b/lib/jquery.uls/css/jquery.uls.css
@@ -31,6 +31,26 @@
width: 45%;
 }
 
+.uls-medium {
+   min-width: 360px;
+   width: 30%;
+}
+
+/* Override the grid */
+.uls-medium.grid .row {
+   min-width: 300px;
+}
+
+.uls-narrow {
+   min-width: 180px;
+   width: 20%;
+}
+
+/* Override the grid */
+.uls-narrow.grid .row {
+   min-width: 150px;
+}
+
 .uls-title-region a {
padding-left: 15px;
 }
@@ -221,6 +241,10 @@
float: right;
 }
 
+.uls-menu.uls-narrow .uls-search-label {
+   background-size: 20px;
+}
+
 .uls-menu .uls-languagefilter-clear {
/* @embed */
background: transparent url('../images/clear.png') no-repeat scroll 
left center;
diff --git a/lib/jquery.uls/src/jquery.uls.core.js 
b/lib/jquery.uls/src/jquery.uls.core.js
index 8852d59..e259728 100644
--- a/lib/jquery.uls/src/jquery.uls.core.js
+++ b/lib/jquery.uls/src/jquery.uls.core.js
@@ -25,7 +25,7 @@
 
// Region numbers in id attributes also appear in the langdb.
/*jshint multistr:true */
-   template = 'div class=grid uls-menu uls-wide \
+   template = 'div class=grid uls-menu \
div class=row \
span id=uls-close 
class=uls-icon-close/span \
/div \
@@ -144,9 +144,12 @@
 * @returns {Object}
 */
position: function () {
-   var pos = $.extend( {}, this.$element.offset(), {
+   var pos;
+
+   pos = $.extend( {}, this.$element.offset(), {
height: this.$element[0].offsetHeight
} );
+
return {
top: this.top !== undefined ? this.top : 
pos.top + pos.height,
left: this.left !== undefined ? this.left : 
'25%'
@@ -157,6 +160,13 @@
 * Show the ULS window
 */
show: function () {
+   var widthClasses = {
+   wide: 'uls-wide',
+   medium: 'uls-medium',
+   narrow: 'uls-narrow'
+   };
+
+   this.$menu.addClass( 
widthClasses[this.options.menuWidth] );
this.$menu.css( this.position() );
 
if ( this.options.compact ) {
@@ -237,8 +247,14 @@
 * Bind the UI elements with their event listeners
 */
listen: function () {
-   var lcd,
+   var lcd, columnsOptions,
uls = this;
+
+   columnsOptions = {
+   wide: 4,
+   medium: 2,
+   narrow: 1
+   };
 
// Register all event listeners to the ULS here.
this.$element.on( 'click', $.proxy( this.click, this ) 
);
@@ -264,6 +280,7 @@
 
lcd = this.$resultsView.lcd( {
languages: this.languages,
+   columns: columnsOptions[this.options.menuWidth],
quickList: this.options.quickList,
clickhandler: $.proxy( this.select, this ),
source: this.$languageFilter,
@@ -401,6 +418,7 @@
languages: $.uls.data.getAutonyms(), // Languages to be used 
for ULS, default is all languages
quickList: null, // Array of language codes or function that 
returns such
compact: false, // Show ULS in compact mode
+   menuWidth: 'wide', // The options are wide (4 columns), medium 
(2 columns), and narrow (1 column)
showRegions: [ 'WW', 'AM', 'EU', 'ME', 'AF', 'AS', 'PA' ],
languageDecorator: null // Callback function to be called when 
a language link is prepared - for custom decoration.
};
diff --git a/lib/jquery.uls/src/jquery.uls.lcd.js 

[MediaWiki-commits] [Gerrit] Correct return type for getConnection - change (mediawiki...ContentTranslation)

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

Change subject: Correct return type for getConnection
..


Correct return type for getConnection

Use IDatabase
Followup: I70211187c7

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

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



diff --git a/includes/Database.php b/includes/Database.php
index ccbc183..0ad39af 100644
--- a/includes/Database.php
+++ b/includes/Database.php
@@ -8,7 +8,7 @@
/**
 * Gets a database connection to the ContentTranslation database
 * @param int $type Either DB_SLAVE or DB_MASTER
-* @return DBConnRef
+* @return IDatabase
 */
public static function getConnection( $type ) {
global $wgContentTranslationDatabase, 
$wgContentTranslationCluster;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If76eb4276d514439a6f88b9cd0fd3fb4caac86e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh santhosh.thottin...@gmail.com
Gerrit-Reviewer: KartikMistry kartik.mis...@gmail.com
Gerrit-Reviewer: Nikerabbit niklas.laxst...@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] add static function WPage::AddCategory() (v 1.5.2) - change (mediawiki...PhpTagsWiki)

2014-12-04 Thread Pastakhov (Code Review)
Pastakhov has uploaded a new change for review.

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

Change subject: add static function WPage::AddCategory() (v 1.5.2)
..

add static function WPage::AddCategory() (v 1.5.2)

Change-Id: I8cf0f860aad9c85e5a98f5f67807f6d0ba41f51c
---
M PhpTagsWiki.php
M includes/WikiWPage.php
M tests/parser/PhpTagsWikiTests.txt
3 files changed, 73 insertions(+), 4 deletions(-)


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

diff --git a/PhpTagsWiki.php b/PhpTagsWiki.php
index da2f176..72af4de 100644
--- a/PhpTagsWiki.php
+++ b/PhpTagsWiki.php
@@ -33,7 +33,7 @@
);
 }
 
-define( 'PHPTAGS_WIKI_VERSION' , '1.5.1' );
+define( 'PHPTAGS_WIKI_VERSION' , '1.5.2' );
 
 // Register this extension on Special:Version
 $wgExtensionCredits['phptags'][] = array(
diff --git a/includes/WikiWPage.php b/includes/WikiWPage.php
index a7845ab..24974e4 100644
--- a/includes/WikiWPage.php
+++ b/includes/WikiWPage.php
@@ -12,6 +12,24 @@
$this-value['name'] = $name;
}
 
+   public static function checkArguments( $object, $method, $arguments, 
$expects = false ) {
+   switch ( strtolower( $method ) ) {
+   case '__construct':
+   $expects = array(
+   \PhpTags\Hooks::TYPE_MIXED,
+   
\PhpTags\Hooks::EXPECTS_MAXIMUM_PARAMETERS = 1,
+   );
+   break;
+   case 'addcategory':
+   $expects = array(
+   \PhpTags\Hooks::TYPE_MIXED,
+   
\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 1,
+   );
+   break;
+   }
+   return parent::checkArguments( $object, $method, $arguments, 
$expects );
+   }
+
public static function q_ID() {
$parser = \PhpTags\Runtime::getParser();
$pageid = $parser-getTitle()-getArticleID();
@@ -42,5 +60,35 @@
return $parser-setDefaultSort( (string)$value );
}
 
-}
+   public static function s_AddCategory( $category ) {
+   if ( is_array( $category ) ) {
+   $return = true;
+   foreach ( $category as $c ) {
+   $return = self::s_AddCategory( $c )  $return;
+   }
+   return $return;
+   }
 
+   if ( is_string( $category ) ) {
+   $titleCategory = \Title::makeTitleSafe( NS_CATEGORY, 
$category );
+   } else {
+   $wcat = \PhpTags\Hooks::createObject( array($category), 
'WCategory' );
+   if ( $wcat  $wcat-value instanceof \Category ) {
+   $titleCategory = $wcat-value-getTitle();
+   } else {
+   $titleCategory = false;
+   $category = '';
+   }
+   }
+   if ( $titleCategory ) {
+   $parser = \PhpTags\Runtime::getParser();
+   $parser-getOutput()-addCategory( 
$titleCategory-getDBkey(), $parser-getDefaultSort() );
+   return true;
+   } else {
+   \PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_EXCEPTION][] 
= new \PhpTags\HookException( \PhpTags\HookException::EXCEPTION_NOTICE, 
\PhpTags\Hooks::$objectName . ::AddCategory() \$category\ is not a valid 
title! );
+   wfDebug( __METHOD__ . : [[MediaWiki:$msg]] is not a 
valid title!\n );
+   return false;
+   }
+   }
+
+}
diff --git a/tests/parser/PhpTagsWikiTests.txt 
b/tests/parser/PhpTagsWikiTests.txt
index a755723..b4e7dee 100644
--- a/tests/parser/PhpTagsWikiTests.txt
+++ b/tests/parser/PhpTagsWikiTests.txt
@@ -82,7 +82,7 @@
 !! end
 
 !! test
-WCategory-pageCount
+WCategory-pageCount Test pages
 !! input
 phptag
 $c = new WCategory( 'Test pages' );
@@ -113,4 +113,25 @@
 pfalse
 true
 /p
-!! end
\ No newline at end of file
+!! end
+
+!! test
+WPage::addCategory foo
+!! input
+phptag WPage::addCategory( 'Foo' ); /phptag
+!! result
+!! end
+
+!! test
+WPage::addCategory foo bar
+!! input
+phptag WPage::addCategory( ['foo', 'bar'] ); /phptag
+!! result
+!! end
+
+!! test
+WPage::addCategory WCategory bar
+!! input
+phptag WPage::addCategory( new WCategory( 'bar' ) ); /phptag
+!! result
+!! end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8cf0f860aad9c85e5a98f5f67807f6d0ba41f51c
Gerrit-PatchSet: 1
Gerrit-Project: 

[MediaWiki-commits] [Gerrit] mediawiki-ruby-api-bundle-rubocop is now voting - change (integration/config)

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

Change subject: mediawiki-ruby-api-bundle-rubocop is now voting
..


mediawiki-ruby-api-bundle-rubocop is now voting

The mediawiki/ruby/api.git repository now pass rubocop and only has a
master branch.  Make the related job voting.

Change-Id: Ib64eccd4662e473acbf02e606db1dd184e73a2bb
---
M zuul/layout.yaml
1 file changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index aae495c..90943c3 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -1453,8 +1453,6 @@
   #
   - name: mediawiki-core-bundle-rubocop
 voting: false
-  - name: mediawiki-ruby-api-bundle-rubocop
-voting: false
   - name: mediawiki-selenium-bundle-rubocop
 voting: false
   - name: mwext-ArticleFeedbackv5-bundle-rubocop

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib64eccd4662e473acbf02e606db1dd184e73a2bb
Gerrit-PatchSet: 2
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Hashar has...@free.fr
Gerrit-Reviewer: Cmcmahon cmcma...@wikimedia.org
Gerrit-Reviewer: Dduvall dduv...@wikimedia.org
Gerrit-Reviewer: Hashar has...@free.fr
Gerrit-Reviewer: Stan tris...@saticed.me.uk
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] add static function WPage::AddCategory() (v 1.5.2) - change (mediawiki...PhpTagsWiki)

2014-12-04 Thread Pastakhov (Code Review)
Pastakhov has uploaded a new change for review.

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

Change subject: add static function WPage::AddCategory() (v 1.5.2)
..

add static function WPage::AddCategory() (v 1.5.2)

Change-Id: I8cf0f860aad9c85e5a98f5f67807f6d0ba41f51c
(cherry picked from commit b10b30e5015d03b087dbcf1af3f8e69ca45c40c8)
---
M PhpTagsWiki.php
M includes/WikiWPage.php
M tests/parser/PhpTagsWikiTests.txt
3 files changed, 73 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PhpTagsWiki 
refs/changes/13/177513/1

diff --git a/PhpTagsWiki.php b/PhpTagsWiki.php
index da2f176..72af4de 100644
--- a/PhpTagsWiki.php
+++ b/PhpTagsWiki.php
@@ -33,7 +33,7 @@
);
 }
 
-define( 'PHPTAGS_WIKI_VERSION' , '1.5.1' );
+define( 'PHPTAGS_WIKI_VERSION' , '1.5.2' );
 
 // Register this extension on Special:Version
 $wgExtensionCredits['phptags'][] = array(
diff --git a/includes/WikiWPage.php b/includes/WikiWPage.php
index a7845ab..24974e4 100644
--- a/includes/WikiWPage.php
+++ b/includes/WikiWPage.php
@@ -12,6 +12,24 @@
$this-value['name'] = $name;
}
 
+   public static function checkArguments( $object, $method, $arguments, 
$expects = false ) {
+   switch ( strtolower( $method ) ) {
+   case '__construct':
+   $expects = array(
+   \PhpTags\Hooks::TYPE_MIXED,
+   
\PhpTags\Hooks::EXPECTS_MAXIMUM_PARAMETERS = 1,
+   );
+   break;
+   case 'addcategory':
+   $expects = array(
+   \PhpTags\Hooks::TYPE_MIXED,
+   
\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 1,
+   );
+   break;
+   }
+   return parent::checkArguments( $object, $method, $arguments, 
$expects );
+   }
+
public static function q_ID() {
$parser = \PhpTags\Runtime::getParser();
$pageid = $parser-getTitle()-getArticleID();
@@ -42,5 +60,35 @@
return $parser-setDefaultSort( (string)$value );
}
 
-}
+   public static function s_AddCategory( $category ) {
+   if ( is_array( $category ) ) {
+   $return = true;
+   foreach ( $category as $c ) {
+   $return = self::s_AddCategory( $c )  $return;
+   }
+   return $return;
+   }
 
+   if ( is_string( $category ) ) {
+   $titleCategory = \Title::makeTitleSafe( NS_CATEGORY, 
$category );
+   } else {
+   $wcat = \PhpTags\Hooks::createObject( array($category), 
'WCategory' );
+   if ( $wcat  $wcat-value instanceof \Category ) {
+   $titleCategory = $wcat-value-getTitle();
+   } else {
+   $titleCategory = false;
+   $category = '';
+   }
+   }
+   if ( $titleCategory ) {
+   $parser = \PhpTags\Runtime::getParser();
+   $parser-getOutput()-addCategory( 
$titleCategory-getDBkey(), $parser-getDefaultSort() );
+   return true;
+   } else {
+   \PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_EXCEPTION][] 
= new \PhpTags\HookException( \PhpTags\HookException::EXCEPTION_NOTICE, 
\PhpTags\Hooks::$objectName . ::AddCategory() \$category\ is not a valid 
title! );
+   wfDebug( __METHOD__ . : [[MediaWiki:$msg]] is not a 
valid title!\n );
+   return false;
+   }
+   }
+
+}
diff --git a/tests/parser/PhpTagsWikiTests.txt 
b/tests/parser/PhpTagsWikiTests.txt
index a755723..b4e7dee 100644
--- a/tests/parser/PhpTagsWikiTests.txt
+++ b/tests/parser/PhpTagsWikiTests.txt
@@ -82,7 +82,7 @@
 !! end
 
 !! test
-WCategory-pageCount
+WCategory-pageCount Test pages
 !! input
 phptag
 $c = new WCategory( 'Test pages' );
@@ -113,4 +113,25 @@
 pfalse
 true
 /p
-!! end
\ No newline at end of file
+!! end
+
+!! test
+WPage::addCategory foo
+!! input
+phptag WPage::addCategory( 'Foo' ); /phptag
+!! result
+!! end
+
+!! test
+WPage::addCategory foo bar
+!! input
+phptag WPage::addCategory( ['foo', 'bar'] ); /phptag
+!! result
+!! end
+
+!! test
+WPage::addCategory WCategory bar
+!! input
+phptag WPage::addCategory( new WCategory( 'bar' ) ); /phptag
+!! result
+!! end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: 

[MediaWiki-commits] [Gerrit] add static function WPage::AddCategory() (v 1.5.2) - change (mediawiki...PhpTagsWiki)

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

Change subject: add static function WPage::AddCategory() (v 1.5.2)
..


add static function WPage::AddCategory() (v 1.5.2)

Change-Id: I8cf0f860aad9c85e5a98f5f67807f6d0ba41f51c
---
M PhpTagsWiki.php
M includes/WikiWPage.php
M tests/parser/PhpTagsWikiTests.txt
3 files changed, 73 insertions(+), 4 deletions(-)

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



diff --git a/PhpTagsWiki.php b/PhpTagsWiki.php
index da2f176..72af4de 100644
--- a/PhpTagsWiki.php
+++ b/PhpTagsWiki.php
@@ -33,7 +33,7 @@
);
 }
 
-define( 'PHPTAGS_WIKI_VERSION' , '1.5.1' );
+define( 'PHPTAGS_WIKI_VERSION' , '1.5.2' );
 
 // Register this extension on Special:Version
 $wgExtensionCredits['phptags'][] = array(
diff --git a/includes/WikiWPage.php b/includes/WikiWPage.php
index a7845ab..24974e4 100644
--- a/includes/WikiWPage.php
+++ b/includes/WikiWPage.php
@@ -12,6 +12,24 @@
$this-value['name'] = $name;
}
 
+   public static function checkArguments( $object, $method, $arguments, 
$expects = false ) {
+   switch ( strtolower( $method ) ) {
+   case '__construct':
+   $expects = array(
+   \PhpTags\Hooks::TYPE_MIXED,
+   
\PhpTags\Hooks::EXPECTS_MAXIMUM_PARAMETERS = 1,
+   );
+   break;
+   case 'addcategory':
+   $expects = array(
+   \PhpTags\Hooks::TYPE_MIXED,
+   
\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 1,
+   );
+   break;
+   }
+   return parent::checkArguments( $object, $method, $arguments, 
$expects );
+   }
+
public static function q_ID() {
$parser = \PhpTags\Runtime::getParser();
$pageid = $parser-getTitle()-getArticleID();
@@ -42,5 +60,35 @@
return $parser-setDefaultSort( (string)$value );
}
 
-}
+   public static function s_AddCategory( $category ) {
+   if ( is_array( $category ) ) {
+   $return = true;
+   foreach ( $category as $c ) {
+   $return = self::s_AddCategory( $c )  $return;
+   }
+   return $return;
+   }
 
+   if ( is_string( $category ) ) {
+   $titleCategory = \Title::makeTitleSafe( NS_CATEGORY, 
$category );
+   } else {
+   $wcat = \PhpTags\Hooks::createObject( array($category), 
'WCategory' );
+   if ( $wcat  $wcat-value instanceof \Category ) {
+   $titleCategory = $wcat-value-getTitle();
+   } else {
+   $titleCategory = false;
+   $category = '';
+   }
+   }
+   if ( $titleCategory ) {
+   $parser = \PhpTags\Runtime::getParser();
+   $parser-getOutput()-addCategory( 
$titleCategory-getDBkey(), $parser-getDefaultSort() );
+   return true;
+   } else {
+   \PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_EXCEPTION][] 
= new \PhpTags\HookException( \PhpTags\HookException::EXCEPTION_NOTICE, 
\PhpTags\Hooks::$objectName . ::AddCategory() \$category\ is not a valid 
title! );
+   wfDebug( __METHOD__ . : [[MediaWiki:$msg]] is not a 
valid title!\n );
+   return false;
+   }
+   }
+
+}
diff --git a/tests/parser/PhpTagsWikiTests.txt 
b/tests/parser/PhpTagsWikiTests.txt
index a755723..b4e7dee 100644
--- a/tests/parser/PhpTagsWikiTests.txt
+++ b/tests/parser/PhpTagsWikiTests.txt
@@ -82,7 +82,7 @@
 !! end
 
 !! test
-WCategory-pageCount
+WCategory-pageCount Test pages
 !! input
 phptag
 $c = new WCategory( 'Test pages' );
@@ -113,4 +113,25 @@
 pfalse
 true
 /p
-!! end
\ No newline at end of file
+!! end
+
+!! test
+WPage::addCategory foo
+!! input
+phptag WPage::addCategory( 'Foo' ); /phptag
+!! result
+!! end
+
+!! test
+WPage::addCategory foo bar
+!! input
+phptag WPage::addCategory( ['foo', 'bar'] ); /phptag
+!! result
+!! end
+
+!! test
+WPage::addCategory WCategory bar
+!! input
+phptag WPage::addCategory( new WCategory( 'bar' ) ); /phptag
+!! result
+!! end

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8cf0f860aad9c85e5a98f5f67807f6d0ba41f51c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PhpTagsWiki
Gerrit-Branch: master
Gerrit-Owner: 

[MediaWiki-commits] [Gerrit] add static function WPage::AddCategory() (v 1.5.2) - change (mediawiki...PhpTagsWiki)

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

Change subject: add static function WPage::AddCategory() (v 1.5.2)
..


add static function WPage::AddCategory() (v 1.5.2)

Change-Id: I8cf0f860aad9c85e5a98f5f67807f6d0ba41f51c
(cherry picked from commit b10b30e5015d03b087dbcf1af3f8e69ca45c40c8)
---
M PhpTagsWiki.php
M includes/WikiWPage.php
M tests/parser/PhpTagsWikiTests.txt
3 files changed, 73 insertions(+), 4 deletions(-)

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



diff --git a/PhpTagsWiki.php b/PhpTagsWiki.php
index da2f176..72af4de 100644
--- a/PhpTagsWiki.php
+++ b/PhpTagsWiki.php
@@ -33,7 +33,7 @@
);
 }
 
-define( 'PHPTAGS_WIKI_VERSION' , '1.5.1' );
+define( 'PHPTAGS_WIKI_VERSION' , '1.5.2' );
 
 // Register this extension on Special:Version
 $wgExtensionCredits['phptags'][] = array(
diff --git a/includes/WikiWPage.php b/includes/WikiWPage.php
index a7845ab..24974e4 100644
--- a/includes/WikiWPage.php
+++ b/includes/WikiWPage.php
@@ -12,6 +12,24 @@
$this-value['name'] = $name;
}
 
+   public static function checkArguments( $object, $method, $arguments, 
$expects = false ) {
+   switch ( strtolower( $method ) ) {
+   case '__construct':
+   $expects = array(
+   \PhpTags\Hooks::TYPE_MIXED,
+   
\PhpTags\Hooks::EXPECTS_MAXIMUM_PARAMETERS = 1,
+   );
+   break;
+   case 'addcategory':
+   $expects = array(
+   \PhpTags\Hooks::TYPE_MIXED,
+   
\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 1,
+   );
+   break;
+   }
+   return parent::checkArguments( $object, $method, $arguments, 
$expects );
+   }
+
public static function q_ID() {
$parser = \PhpTags\Runtime::getParser();
$pageid = $parser-getTitle()-getArticleID();
@@ -42,5 +60,35 @@
return $parser-setDefaultSort( (string)$value );
}
 
-}
+   public static function s_AddCategory( $category ) {
+   if ( is_array( $category ) ) {
+   $return = true;
+   foreach ( $category as $c ) {
+   $return = self::s_AddCategory( $c )  $return;
+   }
+   return $return;
+   }
 
+   if ( is_string( $category ) ) {
+   $titleCategory = \Title::makeTitleSafe( NS_CATEGORY, 
$category );
+   } else {
+   $wcat = \PhpTags\Hooks::createObject( array($category), 
'WCategory' );
+   if ( $wcat  $wcat-value instanceof \Category ) {
+   $titleCategory = $wcat-value-getTitle();
+   } else {
+   $titleCategory = false;
+   $category = '';
+   }
+   }
+   if ( $titleCategory ) {
+   $parser = \PhpTags\Runtime::getParser();
+   $parser-getOutput()-addCategory( 
$titleCategory-getDBkey(), $parser-getDefaultSort() );
+   return true;
+   } else {
+   \PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_EXCEPTION][] 
= new \PhpTags\HookException( \PhpTags\HookException::EXCEPTION_NOTICE, 
\PhpTags\Hooks::$objectName . ::AddCategory() \$category\ is not a valid 
title! );
+   wfDebug( __METHOD__ . : [[MediaWiki:$msg]] is not a 
valid title!\n );
+   return false;
+   }
+   }
+
+}
diff --git a/tests/parser/PhpTagsWikiTests.txt 
b/tests/parser/PhpTagsWikiTests.txt
index a755723..b4e7dee 100644
--- a/tests/parser/PhpTagsWikiTests.txt
+++ b/tests/parser/PhpTagsWikiTests.txt
@@ -82,7 +82,7 @@
 !! end
 
 !! test
-WCategory-pageCount
+WCategory-pageCount Test pages
 !! input
 phptag
 $c = new WCategory( 'Test pages' );
@@ -113,4 +113,25 @@
 pfalse
 true
 /p
-!! end
\ No newline at end of file
+!! end
+
+!! test
+WPage::addCategory foo
+!! input
+phptag WPage::addCategory( 'Foo' ); /phptag
+!! result
+!! end
+
+!! test
+WPage::addCategory foo bar
+!! input
+phptag WPage::addCategory( ['foo', 'bar'] ); /phptag
+!! result
+!! end
+
+!! test
+WPage::addCategory WCategory bar
+!! input
+phptag WPage::addCategory( new WCategory( 'bar' ) ); /phptag
+!! result
+!! end

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

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

[MediaWiki-commits] [Gerrit] Darken the text color in successbox - change (mediawiki/core)

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

Change subject: Darken the text color in successbox
..


Darken the text color in successbox

A user mentioned that there isn't currently enough contrast in successbox,
which impairs accessibility. This fixes that.

Change-Id: Id819524377108ec04fe5f3faef7979bc22fbd891
---
M resources/src/mediawiki.legacy/shared.css
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Bartosz Dziewoński: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/src/mediawiki.legacy/shared.css 
b/resources/src/mediawiki.legacy/shared.css
index 0604773..02bae5a 100644
--- a/resources/src/mediawiki.legacy/shared.css
+++ b/resources/src/mediawiki.legacy/shared.css
@@ -584,7 +584,7 @@
 }
 
 .successbox {
-   color: #009000;
+   color: #008000;
border-color: #b7fdb5;
background-color: #e1fddf;
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id819524377108ec04fe5f3faef7979bc22fbd891
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jackmcbarn jackmcb...@gmail.com
Gerrit-Reviewer: Bartosz Dziewoński matma@gmail.com
Gerrit-Reviewer: Jack Phoenix j...@countervandalism.net
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] MediaWiki Theme: Reduce indentation in theme-oo-ui-checkboxI... - change (oojs/ui)

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

Change subject: MediaWiki Theme: Reduce indentation in 
theme-oo-ui-checkboxInputWidget
..


MediaWiki Theme: Reduce indentation in theme-oo-ui-checkboxInputWidget

Change-Id: I472283878f313a6b702ad4627c5765013c7292ca
---
M src/themes/mediawiki/widgets.less
1 file changed, 27 insertions(+), 37 deletions(-)

Approvals:
  Bartosz Dziewoński: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/themes/mediawiki/widgets.less 
b/src/themes/mediawiki/widgets.less
index 9afb131..b9a0672 100644
--- a/src/themes/mediawiki/widgets.less
+++ b/src/themes/mediawiki/widgets.less
@@ -159,54 +159,44 @@
 + span {
cursor: pointer;
margin: 0 0.4em;
+   }
 
-   ::before {
-   content: '';
-   position: absolute;
-   left: 0;
-   border-radius: @border-radius;
-   width: @checkbox-size;
-   height: @checkbox-size;
-   background-color: #fff;
-   border: 1px solid grey;
-   }
++ span::before {
+   content: '';
+   position: absolute;
+   left: 0;
+   border-radius: @border-radius;
+   width: @checkbox-size;
+   height: @checkbox-size;
+   background-color: #fff;
+   border: 1px solid grey;
}
 
// when the input is checked, style the span pseudo before 
element that followed as a checked checkbox
-   :checked {
-   + span {
-   ::before {
-   
.oo-ui-background-image('@{oo-ui-default-image-path}/icons/check-constructive.svg');
-   background-size: @checkbox-size, 
@checkbox-size;
-   background-repeat: no-repeat;
-   background-position: center top;
-   }
-   }
+   :checked + span::before  {
+   
.oo-ui-background-image('@{oo-ui-default-image-path}/icons/check-constructive.svg');
+   background-size: @checkbox-size, @checkbox-size;
+   background-repeat: no-repeat;
+   background-position: center top;
}
 
@focus-bottom-border-size: 0.2em;
-   :active,
-   :focus {
-   + span {
-   ::after {
-   content: '';
-   position: absolute;
-   width: @checkbox-size;
-   height: @checkbox-size - 
@focus-bottom-border-size + 0.1; // offset by bottom border
-   // offset from the checkbox by 1px to 
account for left border
-   left: 1px;
-   border-bottom: solid 
@focus-bottom-border-size lightgrey;
-   }
-   }
+
+   :active + span::after,
+   :focus + span::after {
+   content: '';
+   position: absolute;
+   width: @checkbox-size;
+   height: @checkbox-size - @focus-bottom-border-size + 
0.1; // offset by bottom border
+   // offset from the checkbox by 1px to account for left 
border
+   left: 1px;
+   border-bottom: solid @focus-bottom-border-size 
lightgrey;
}
 
// disabled checked boxes have a gray background
-   :disabled + span {
+   :disabled + span::before {
cursor: default;
-
-   ::before {
-   background-color: lightgrey;
-   }
+   background-color: lightgrey;
}
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I472283878f313a6b702ad4627c5765013c7292ca
Gerrit-PatchSet: 3
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Prtksxna psax...@wikimedia.org
Gerrit-Reviewer: Bartosz Dziewoński matma@gmail.com
Gerrit-Reviewer: Jforrester jforres...@wikimedia.org
Gerrit-Reviewer: Trevor Parscal tpars...@wikimedia.org
Gerrit-Reviewer: 

[MediaWiki-commits] [Gerrit] [WIP] Reuse page preview parses by using the edit stash system - change (mediawiki/core)

2014-12-04 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: [WIP] Reuse page preview parses by using the edit stash system
..

[WIP] Reuse page preview parses by using the edit stash system

Change-Id: Ic8fa87669106b960c76912b864788b781f6ee2e6
---
M includes/EditPage.php
M includes/api/ApiStashEdit.php
M includes/parser/ParserOptions.php
3 files changed, 143 insertions(+), 32 deletions(-)


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

diff --git a/includes/EditPage.php b/includes/EditPage.php
index 4a013ef..6361d2b 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -3515,12 +3515,15 @@
# For CSS/JS pages, we should have called the 
ShowRawCssJs hook here.
# But it's now deprecated, so never mind
 
-   $content = $content-preSaveTransform( $this-mTitle, 
$wgUser, $parserOptions );
-   $parserOutput = $content-getParserOutput(
-   $this-getArticle()-getTitle(),
-   null,
-   $parserOptions
-   );
+   $pstContent = $content-preSaveTransform( 
$this-mTitle, $wgUser, $parserOptions );
+   $parserOutput = $pstContent-getParserOutput( 
$this-mTitle, null, $parserOptions );
+
+   # Try to stash the edit for the final submission step
+   if ( $this-section === null ) {
+   ApiStashEdit::stashEditFromPreview( 
$this-getArticle(), $content,
+   $pstContent, $parserOutput, 
$parserOptions, $parserOptions, wfTimestampNow()
+   );
+   }
 
$previewHTML = $parserOutput-getText();
$this-mParserOutput = $parserOutput;
diff --git a/includes/api/ApiStashEdit.php b/includes/api/ApiStashEdit.php
index 00f6814..a9d9f6a 100644
--- a/includes/api/ApiStashEdit.php
+++ b/includes/api/ApiStashEdit.php
@@ -117,17 +117,10 @@
}
 
if ( $editInfo  $editInfo-output ) {
-   $parserOutput = $editInfo-output;
-   // If an item is renewed, mind the cache TTL determined 
by config and parser functions
-   $since = time() - wfTimestamp( TS_UNIX, 
$parserOutput-getTimestamp() );
-   $ttl = min( $parserOutput-getCacheExpiry() - $since, 5 
* 60 );
-   if ( $ttl  0  !$parserOutput-getFlag( 
'vary-revision' ) ) {
-   // Only store what is actually needed
-   $stashInfo = (object)array(
-   'pstContent' = $editInfo-pstContent,
-   'output' = $editInfo-output,
-   'timestamp' = $editInfo-timestamp
-   );
+   list( $stashInfo, $ttl ) = self::buildStashValue(
+   $editInfo-pstContent, $editInfo-output, 
$editInfo-timestamp
+   );
+   if ( $stashInfo ) {
$ok = $wgMemc-set( $key, $stashInfo, $ttl );
if ( $ok ) {
$status = 'stashed';
@@ -146,24 +139,52 @@
}
 
/**
-* Get the temporary prepared edit stash key for a user
+* Attempt to cache PST content and corresponding parser output in 
passing
 *
-* @param Title $title
-* @param Content $content
-* @param User $user User to get parser options from
-* @return string
+* This method can be called when the output was already generated for 
other
+* reasons. Parsing should not be done just to call this method, 
however.
+* $pstOpts must be that of the user doing the edit preview. If $pOpts 
does
+* not match the options of WikiPage::makeParserOptions( 'canonical' ), 
this
+* will do nothing. Provided the values are cacheable, they will be 
stored
+* in memcached so that final edit submission might make use of them.
+*
+* @param Article|WikiPage $page Page title
+* @param Content $content Proposed page content
+* @param Content $pstContent The result of preSaveTransform() on 
$content
+* @param ParserOutput $pOut The result of getParserOutput() on 
$pstContent
+* @param ParserOptions $pstOpts Options for $pstContent (MUST be for 
prospective author)
+* @param ParserOptions $pOpts Options for $pOut
+* @param string $timestamp TS_MW timestamp of parser output generation
+* @return boolean Success
 */
-   protected 

[MediaWiki-commits] [Gerrit] Add contributors field to package.json - change (mediawiki...citoid)

2014-12-04 Thread Mvolz (Code Review)
Mvolz has uploaded a new change for review.

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

Change subject: Add contributors field to package.json
..

Add contributors field to package.json

Add contributors field to package.json
as well as three contributors.

Change-Id: Id53d41f7f6eda4a98f028e72da2225df6ee94bde
---
M package.json
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/citoid 
refs/changes/16/177516/1

diff --git a/package.json b/package.json
index f427361..0807867 100644
--- a/package.json
+++ b/package.json
@@ -18,5 +18,17 @@
repository: {
type: git,
url: 
https://gerrit.wikimedia.org/r/mediawiki/services/citoid;
+   },
+   contributors: [
+   {
+   name: Marielle Volz,
+   email: marielle.v...@gmail.com
+   },
+   {
+   name: unicodesnowman
+   },
+   {
+   name: danmichaelo
}
+   ]
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id53d41f7f6eda4a98f028e72da2225df6ee94bde
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/citoid
Gerrit-Branch: master
Gerrit-Owner: Mvolz mv...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Delete unused TermMatchScoreCalculator - change (mediawiki...Wikibase)

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

Change subject: Delete unused TermMatchScoreCalculator
..


Delete unused TermMatchScoreCalculator

Change-Id: Id4dca502e0b5794029d88ebeae125c5ad965b274
---
D lib/includes/store/TermMatchScoreCalculator.php
1 file changed, 0 insertions(+), 61 deletions(-)

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



diff --git a/lib/includes/store/TermMatchScoreCalculator.php 
b/lib/includes/store/TermMatchScoreCalculator.php
deleted file mode 100644
index d0e7b62..000
--- a/lib/includes/store/TermMatchScoreCalculator.php
+++ /dev/null
@@ -1,61 +0,0 @@
-?php
-
-namespace Wikibase;
-
-/**
- * Calculates and stores score for term search
- *
- * @since 0.3
- *
- * @licence GNU GPL v2+
- * @author Jens Ohlig  jens.oh...@wikimedia.de 
- * @author John Erling Blad  jeb...@gmail.com 
- * @author Tobias Gritschacher  tobias.gritschac...@wikimedia.de 
- */
-
-class TermMatchScoreCalculator {
-
-   protected $entry;
-   protected $searchLength;
-
-   /**
-* Constructor
-*
-* @since 0.3
-*
-* @param array $entry
-* @param string $search
-*/
-   public function __construct( array $entry, $search ) {
-   $this-entry = $entry;
-   $this-searchLength = strlen( $search );
-   }
-
-   /**
-* Calculate score
-*
-* @since 0.3
-*
-* @return integer $score
-*/
-   public function calculateScore() {
-   $score = 0;
-
-   if ( isset( $this-entry['label'] ) ) {
-   $score = $this-searchLength / strlen( 
$this-entry['label'] );
-   }
-
-   if ( isset( $this-entry['aliases'] ) ) {
-   foreach ( $this-entry['aliases'] as $alias ) {
-   $aliasScore = $this-searchLength / strlen( 
$alias );
-
-   if ( $aliasScore  $score ) {
-   $score = $aliasScore;
-   }
-   }
-   }
-
-   return $score;
-   }
-
-}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id4dca502e0b5794029d88ebeae125c5ad965b274
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de
Gerrit-Reviewer: Jens Ohlig jens.oh...@wikimedia.de
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
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] Added type checks to wikibase.api.RepoApi functions - change (mediawiki...WikibaseJavaScriptApi)

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

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

Change subject: Added type checks to wikibase.api.RepoApi functions
..

Added type checks to wikibase.api.RepoApi functions

Actually reflecting parameter documentation in the code instead of relying on 
the back-end handling.
This resolves some wrong documentation as well.
Added tests testing the minimum of parameters required by each function.

Change-Id: I4d043f5cc43852970a489014bc5c106592ccfdc3
---
A .jshintignore
M README.md
M src/RepoApi.js
M tests/RepoApi.tests.js
4 files changed, 445 insertions(+), 94 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseJavaScriptApi 
refs/changes/17/177517/1

diff --git a/.jshintignore b/.jshintignore
new file mode 100644
index 000..711939d
--- /dev/null
+++ b/.jshintignore
@@ -0,0 +1 @@
+./tests
\ No newline at end of file
diff --git a/README.md b/README.md
index f2f54c4..0069924 100644
--- a/README.md
+++ b/README.md
@@ -8,10 +8,11 @@
 * Updated code documentation to be able to generate documentation using JSDuck.
 * `wikibase.api.RepoApi` QUnit tests have been rewritten to not execute actual 
API requests anymore.
 * Added `wikibase.api.RepoApi` QUnit tests for functions not yet tested.
+* Added type checks to `wikibase.api.RepoApi` functions to actually reflect 
parameter documentation in the code instead of relying on the back-end handling.
 
 ### Bugfixes
 * An empty `Entity` may be created by omitting the `data` parameter on 
`wikibase.api.RepoApi.createEntity()` again.
-* `wikibase.api.RepoApi` always submits `normalize` parameter if it is 
specified explicitly (before, `false` resolved to `undefined`).
+* `wikibase.api.RepoApi` functions explicitly submit default parameters if not 
set otherwise.
 
 ### 1.0.1 (2014-11-28)
 
diff --git a/src/RepoApi.js b/src/RepoApi.js
index 6306dce..7d1f97b 100644
--- a/src/RepoApi.js
+++ b/src/RepoApi.js
@@ -53,8 +53,14 @@
 * @return {Function} return.fail
 * @return {string} return.fail.code
 * @return {*} return.fail.error
+*
+* @throws {Error} if a parameter is not specified properly.
 */
createEntity: function( type, data ) {
+   if( typeof type !== 'string' || data  typeof data !== 
'object' ) {
+   throw new Error( 'Parameter not specified properly' );
+   }
+
var params = {
action: 'wbeditentity',
'new': type,
@@ -67,10 +73,10 @@
 * Edits an `Entity`.
 * @see wikibase.api.RepoApi._post
 *
-* @param {String} id `Entity` id.
-* @param {Number} baseRevId Revision id the edit shall be performed on.
-* @param {Object} data The `Entity`'s structure.
-* @param {Boolean} [clear=false] Whether to clear whole entity before 
editing.
+* @param {string} id `Entity` id.
+* @param {number} baseRevId Revision id the edit shall be performed on.
+* @param {Object} [data] The `Entity`'s structure.
+* @param {boolean} [clear] Whether to clear whole entity before 
editing.
 * @return {Object} jQuery.Promise
 * @return {Function} return.done
 * @return {*} return.done.result
@@ -78,17 +84,28 @@
 * @return {Function} return.fail
 * @return {string} return.fail.code
 * @return {*} return.fail.error
+*
+* @throws {Error} if a parameter is not specified properly.
 */
editEntity: function( id, baseRevId, data, clear ) {
+   if(
+   typeof id !== 'string'
+   || typeof baseRevId !== 'number'
+   || typeof data !== 'object'
+   || data  typeof data !== 'object'
+   ) {
+   throw new Error( 'Parameter not specified properly' );
+   }
+
var params = {
action: 'wbeditentity',
id: id,
baserevid: baseRevId,
-   data: JSON.stringify( data )
+   data: JSON.stringify( data || {} )
};
 
-   if ( clear ) {
-   params.clear = true;
+   if( typeof clear === 'boolean' ) {
+   params.clear = clear;
}
 
return this._post( params );
@@ -109,8 +126,19 @@
 * @return {Function} return.fail
 * @return {string} return.fail.code
 * @return {*} return.fail.error
+*
+* @throws {Error} if a parameter is not specified properly.
 */
formatValue: function( dataValue, options, dataType, outputFormat ) {
+   if(
+   typeof dataValue !== 'object'
+   || options  typeof 

[MediaWiki-commits] [Gerrit] Set normalizeItemByTitlePageNames to true per default - change (mediawiki...Wikibase)

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

Change subject: Set normalizeItemByTitlePageNames to true per default
..


Set normalizeItemByTitlePageNames to true per default

IMO a much saner default, as the behavior of the special
page is rather weird if this is false.

Not deploy relevant, as this has been true in production
since forever.

Change-Id: I24d7d08cbcb17c9b6dc2e48e8c2fcc36d18ce2e5
---
M repo/config/Wikibase.default.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Daniel Kinzler: Looks good to me, but someone else must approve
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/config/Wikibase.default.php b/repo/config/Wikibase.default.php
index 8187aa1..1018585 100644
--- a/repo/config/Wikibase.default.php
+++ b/repo/config/Wikibase.default.php
@@ -41,7 +41,7 @@
),
 
// Should the page names (titles) be normalized against the 
external site
-   'normalizeItemByTitlePageNames' = false,
+   'normalizeItemByTitlePageNames' = true,
 
// Items allowed to be used as badges pointing to their CSS 
class names
'badgeItems' = array(),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I24d7d08cbcb17c9b6dc2e48e8c2fcc36d18ce2e5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man h...@online.de
Gerrit-Reviewer: Aude aude.w...@gmail.com
Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@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] Remove alert for hhvm-appservers.svc.eqiad.wmnet - change (operations/puppet)

2014-12-04 Thread Faidon Liambotis (Code Review)
Faidon Liambotis has uploaded a new change for review.

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

Change subject: Remove alert for hhvm-appservers.svc.eqiad.wmnet
..

Remove alert for hhvm-appservers.svc.eqiad.wmnet

The separate pool was previously removed from puppet. The (paging) check
still exists and is down for 2d3h. Probably not coming back :)

Change-Id: I7173bee364e3bf2a384623a5188ba8edf4aaf7a9
---
M modules/lvs/manifests/monitor.pp
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/modules/lvs/manifests/monitor.pp b/modules/lvs/manifests/monitor.pp
index c7528e8..46bc224 100644
--- a/modules/lvs/manifests/monitor.pp
+++ b/modules/lvs/manifests/monitor.pp
@@ -8,7 +8,6 @@
 # INTERNAL EQIAD
 
 lvs::monitor_service_http { appservers.svc.eqiad.wmnet: ip_address = 
10.2.2.1, check_command = check_http_lvs!en.wikipedia.org!/wiki/Main_Page }
-lvs::monitor_service_http { hhvm-appservers.svc.eqiad.wmnet: ip_address 
= 10.2.2.2, check_command = 
check_http_lvs!en.wikipedia.org!/wiki/Main_Page }
 lvs::monitor_service_http { api.svc.eqiad.wmnet: ip_address = 
10.2.2.22, check_command = 
check_http_lvs!en.wikipedia.org!/w/api.php?action=querymeta=siteinfo }
 lvs::monitor_service_http { rendering.svc.eqiad.wmnet: ip_address = 
10.2.2.21, check_command = check_http_lvs!en.wikipedia.org!/wiki/Main_Page 
}
 lvs::monitor_service_http { ms-fe.eqiad.wmnet: ip_address = 
10.2.2.27, check_command = 
check_http_lvs!ms-fe.eqiad.wmnet!/monitoring/backend }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7173bee364e3bf2a384623a5188ba8edf4aaf7a9
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis fai...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Remove hhvm-appservers.svc.eqiad.wmnet service IP - change (operations/dns)

2014-12-04 Thread Faidon Liambotis (Code Review)
Faidon Liambotis has uploaded a new change for review.

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

Change subject: Remove hhvm-appservers.svc.eqiad.wmnet service IP
..

Remove hhvm-appservers.svc.eqiad.wmnet service IP

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


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/19/177519/1

diff --git a/templates/10.in-addr.arpa b/templates/10.in-addr.arpa
index 5e141c2..72933b3 100644
--- a/templates/10.in-addr.arpa
+++ b/templates/10.in-addr.arpa
@@ -25,7 +25,6 @@
 $ORIGIN 2.2.{{ zonename }}.
 
 1   1H  IN PTR  appservers.svc.eqiad.wmnet.
-2   1H  IN PTR  hhvm-appservers.svc.eqiad.wmnet.
 3   1H  IN PTR  hhvm-api.svc.eqiad.wmnet.
 
 11  1H  IN PTR  search-pool1.svc.eqiad.wmnet.
diff --git a/templates/wmnet b/templates/wmnet
index 278e555..ea76598 100644
--- a/templates/wmnet
+++ b/templates/wmnet
@@ -2868,7 +2868,6 @@
 $ORIGIN svc.eqiad.wmnet.
 
 appservers  1H  IN A10.2.2.1
-hhvm-appservers 1H  IN A10.2.2.2
 hhvm-api1H  IN A10.2.2.3
 search-pool11H  IN A10.2.2.11
 search-pool21H  IN A10.2.2.12

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic026549484f4a1478f573d0249afd02dc00852a2
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Faidon Liambotis fai...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Remove alert for hhvm-appservers.svc.eqiad.wmnet - change (operations/puppet)

2014-12-04 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has submitted this change and it was merged.

Change subject: Remove alert for hhvm-appservers.svc.eqiad.wmnet
..


Remove alert for hhvm-appservers.svc.eqiad.wmnet

The separate pool was previously removed from puppet. The (paging) check
still exists and is down for 2d3h. Probably not coming back :)

Change-Id: I7173bee364e3bf2a384623a5188ba8edf4aaf7a9
---
M modules/lvs/manifests/monitor.pp
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/modules/lvs/manifests/monitor.pp b/modules/lvs/manifests/monitor.pp
index c7528e8..46bc224 100644
--- a/modules/lvs/manifests/monitor.pp
+++ b/modules/lvs/manifests/monitor.pp
@@ -8,7 +8,6 @@
 # INTERNAL EQIAD
 
 lvs::monitor_service_http { appservers.svc.eqiad.wmnet: ip_address = 
10.2.2.1, check_command = check_http_lvs!en.wikipedia.org!/wiki/Main_Page }
-lvs::monitor_service_http { hhvm-appservers.svc.eqiad.wmnet: ip_address 
= 10.2.2.2, check_command = 
check_http_lvs!en.wikipedia.org!/wiki/Main_Page }
 lvs::monitor_service_http { api.svc.eqiad.wmnet: ip_address = 
10.2.2.22, check_command = 
check_http_lvs!en.wikipedia.org!/w/api.php?action=querymeta=siteinfo }
 lvs::monitor_service_http { rendering.svc.eqiad.wmnet: ip_address = 
10.2.2.21, check_command = check_http_lvs!en.wikipedia.org!/wiki/Main_Page 
}
 lvs::monitor_service_http { ms-fe.eqiad.wmnet: ip_address = 
10.2.2.27, check_command = 
check_http_lvs!ms-fe.eqiad.wmnet!/monitoring/backend }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7173bee364e3bf2a384623a5188ba8edf4aaf7a9
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis fai...@wikimedia.org
Gerrit-Reviewer: Giuseppe Lavagetto glavage...@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 all translations link on the translation view when dra... - change (mediawiki...ContentTranslation)

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

Change subject: Use all translations link on the translation view when drafts 
enabled
..


Use all translations link on the translation view when drafts enabled

Bug: T75976
Change-Id: I7e70d7941b3faf0a36ad4f960b9adebc89858e4f
---
M Resources.php
M i18n/en.json
M i18n/qqq.json
M modules/header/ext.cx.header.js
4 files changed, 9 insertions(+), 2 deletions(-)

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



diff --git a/Resources.php b/Resources.php
index 87f1323..e7123a0 100644
--- a/Resources.php
+++ b/Resources.php
@@ -99,6 +99,7 @@
'cx-error-server-connection',
'cx-error-page-not-found',
'cx-header-new-translation',
+   'cx-header-all-translations',
'cx-publish-button',
'cx-save-draft-button',
'cx-special-login-error',
diff --git a/i18n/en.json b/i18n/en.json
index d6a712e..3f9f26f 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -17,6 +17,7 @@
cx-header-progressbar-text-mt: ($1% from machine translation),
cx-header-translation-center: Translation center,
cx-header-new-translation: New translation,
+   cx-header-all-translations: All translations,
cx-source-view-page: view page,
cx-publish-page-success: Page published at $1,
cx-publish-page-error: Error while saving page.,
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 2c61b1b..66c2574 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -21,6 +21,7 @@
cx-header-progressbar-text-mt: Text to be shown with the progress 
bar in [[Special:ContentTranslation]]. $1 is the estimated percent of 
machine-translated text out of all the translation text that was written so 
far.,
cx-header-translation-center: Text for the translation center 
title.,
cx-header-new-translation: A link at the top of the translation 
interface to the main Special:ContentTranslation page that creates a new 
translation.\n{{Identical|New translation}},
+   cx-header-all-translations:  A link at the top of the translation 
interface to the main Special:ContentTranslation page that lists all 
translations by the user.\n{{Identical|New translation}},
cx-source-view-page: A link that points to the source page under the 
heading of the source article.\n{{Identical|View page}},
cx-publish-page-success: Message shown when page is published 
successfully. Parameters:\n* $1 - Link to the published page,
cx-publish-page-error: Error message to display when page saving 
fails.,
diff --git a/modules/header/ext.cx.header.js b/modules/header/ext.cx.header.js
index a3ce082..a5320b3 100644
--- a/modules/header/ext.cx.header.js
+++ b/modules/header/ext.cx.header.js
@@ -175,10 +175,14 @@
.append( $logo, $titleText );
 
$translationCenterLink = $( 'a' )
-   // TODO update the text when the dashboard is ready
-   .text( mw.msg( 'cx-header-new-translation' ) )
.attr( 'href', mw.util.getUrl( 
'Special:ContentTranslation' ) );
 
+   if ( mw.config.get( 'wgContentTranslationDatabase' ) !== null ) 
{
+   $translationCenterLink.text( mw.msg( 
'cx-header-all-translations' ) );
+   } else {
+   $translationCenterLink.text( mw.msg( 
'cx-header-new-translation' ) );
+   }
+
$translationCenter = $( 'div' )
.addClass( 'cx-header__translation-center' )
.append( $translationCenterLink );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7e70d7941b3faf0a36ad4f960b9adebc89858e4f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh santhosh.thottin...@gmail.com
Gerrit-Reviewer: Jsahleen jsahl...@wikimedia.org
Gerrit-Reviewer: Siebrand siebr...@kitano.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] Allow host-specific HHVM config overrides via Hiera - change (operations/puppet)

2014-12-04 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has submitted this change and it was merged.

Change subject: Allow host-specific HHVM config overrides via Hiera
..


Allow host-specific HHVM config overrides via Hiera

Change-Id: I5d70d3aaddded11ea73f9842ef9beb241a074678
Signed-off-by: Giuseppe Lavagetto glavage...@wikimedia.org
---
M modules/hhvm/manifests/init.pp
1 file changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/modules/hhvm/manifests/init.pp b/modules/hhvm/manifests/init.pp
index 9e889b6..bc83ca5 100644
--- a/modules/hhvm/manifests/init.pp
+++ b/modules/hhvm/manifests/init.pp
@@ -151,18 +151,21 @@
 }
 }
 
+$cli_hiera= hiera_hash('hhvm::extra::cli', {})
+$fcgi_hiera   = hiera_hash('hhvm::extra::fcgi', {})
+
 
 ## Config files
 
 file { '/etc/hhvm/php.ini':
-content = php_ini($common_defaults, $cli_defaults, $cli_settings),
+content = php_ini($common_defaults, $cli_defaults, $cli_settings, 
$cli_hiera),
 owner   = 'root',
 group   = 'root',
 mode= '0444',
 }
 
 file { '/etc/hhvm/fcgi.ini':
-content = php_ini($common_defaults, $fcgi_defaults, $fcgi_settings),
+content = php_ini($common_defaults, $fcgi_defaults, $fcgi_settings, 
$fcgi_hiera),
 owner   = 'root',
 group   = 'root',
 mode= '0444',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5d70d3aaddded11ea73f9842ef9beb241a074678
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto glavage...@wikimedia.org
Gerrit-Reviewer: Giuseppe Lavagetto glavage...@wikimedia.org
Gerrit-Reviewer: Ori.livneh o...@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] HAT: test hhvm.server.stat_cache on mw1081 - change (operations/puppet)

2014-12-04 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has uploaded a new change for review.

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

Change subject: HAT: test hhvm.server.stat_cache on mw1081
..

HAT: test hhvm.server.stat_cache on mw1081

Change-Id: Ifd6e1a79508cede158eef2b0d18308f40f4653b7
Signed-off-by: Giuseppe Lavagetto glavage...@wikimedia.org
---
A hieradata/hosts/mw1081.yaml
1 file changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/hieradata/hosts/mw1081.yaml b/hieradata/hosts/mw1081.yaml
new file mode 100644
index 000..a367bae
--- /dev/null
+++ b/hieradata/hosts/mw1081.yaml
@@ -0,0 +1,4 @@
+hhvm::extra::fcgi:
+  hhvm:
+server:
+  stat_cache: true

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd6e1a79508cede158eef2b0d18308f40f4653b7
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto glavage...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Remove hhvm-appservers.svc.eqiad.wmnet service IP - change (operations/dns)

2014-12-04 Thread Faidon Liambotis (Code Review)
Faidon Liambotis has submitted this change and it was merged.

Change subject: Remove hhvm-appservers.svc.eqiad.wmnet service IP
..


Remove hhvm-appservers.svc.eqiad.wmnet service IP

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

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



diff --git a/templates/10.in-addr.arpa b/templates/10.in-addr.arpa
index 5e141c2..72933b3 100644
--- a/templates/10.in-addr.arpa
+++ b/templates/10.in-addr.arpa
@@ -25,7 +25,6 @@
 $ORIGIN 2.2.{{ zonename }}.
 
 1   1H  IN PTR  appservers.svc.eqiad.wmnet.
-2   1H  IN PTR  hhvm-appservers.svc.eqiad.wmnet.
 3   1H  IN PTR  hhvm-api.svc.eqiad.wmnet.
 
 11  1H  IN PTR  search-pool1.svc.eqiad.wmnet.
diff --git a/templates/wmnet b/templates/wmnet
index 278e555..ea76598 100644
--- a/templates/wmnet
+++ b/templates/wmnet
@@ -2868,7 +2868,6 @@
 $ORIGIN svc.eqiad.wmnet.
 
 appservers  1H  IN A10.2.2.1
-hhvm-appservers 1H  IN A10.2.2.2
 hhvm-api1H  IN A10.2.2.3
 search-pool11H  IN A10.2.2.11
 search-pool21H  IN A10.2.2.12

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic026549484f4a1478f573d0249afd02dc00852a2
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Faidon Liambotis fai...@wikimedia.org
Gerrit-Reviewer: Faidon Liambotis fai...@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] Partitioning scheme for cassandra hosts - change (operations/puppet)

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

Change subject: Partitioning scheme for cassandra hosts
..


Partitioning scheme for cassandra hosts

Cassandra hosts have 2 spinning disks and 2 SSDs. Partman should be
instructed to create a /boot partition on the spinning disks. The rest
should be RAID1 LVM root and swap
The SSDs will be manually partitioned after installation

Change-Id: I2c165028c617a2e875fd25291d49512ebba3a95b
---
M modules/install-server/files/autoinstall/netboot.cfg
A modules/install-server/files/autoinstall/partman/cassandrahosts.cfg
M modules/install-server/files/autoinstall/partman/raid0-lvm.cfg
3 files changed, 75 insertions(+), 2 deletions(-)

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



diff --git a/modules/install-server/files/autoinstall/netboot.cfg 
b/modules/install-server/files/autoinstall/netboot.cfg
index fe79b39..f16d268 100755
--- a/modules/install-server/files/autoinstall/netboot.cfg
+++ b/modules/install-server/files/autoinstall/netboot.cfg
@@ -83,7 +83,7 @@
snapshot[1-4]|snapshot100[1-4]) echo partman/snapshot.cfg ;; \
stat1002) echo partman/lvm-noraid-large.a.cfg ;; \

argon|bast4001|copper|neon|ruthenium|ssl[1-3]0[0-9][0-9]|ssl[0-9]|titanium|ytterbium|zirconium)
 echo partman/raid1-lvm.cfg ;; \
-   cerium|praseodymium|xenon) echo partman/raid0-lvm.cfg ;; \
+   cerium|praseodymium|xenon) echo partman/cassandrahosts.cfg ;; \
virt[5-9]|virt1[0-1]) echo partman/virt-raid10-cisco.cfg ;; \
virt100[1-9]) echo partman/virt-raid10-cisco.cfg ;; \
labnet1001) echo partman/lvm.cfg ;; \
diff --git 
a/modules/install-server/files/autoinstall/partman/cassandrahosts.cfg 
b/modules/install-server/files/autoinstall/partman/cassandrahosts.cfg
new file mode 100644
index 000..70a86c5
--- /dev/null
+++ b/modules/install-server/files/autoinstall/partman/cassandrahosts.cfg
@@ -0,0 +1,73 @@
+# Automatic software RAID partitioning
+#
+# * 4 disks, sda, sdb, sdc, sdd
+# * 2 Spinning disks sda/sdb, 2 SSDs sdc/sdd
+# * LVM
+# * layout:
+#   - /boot:  RAID1, 500MB on spinning disks
+#   - /:   ext3, RAID1, 50GB on LVM on spinning disks
+#   - swap:  RAID1, 1G on LVM on spinning disks
+#   - rest is lvm RAID1, on spinning disks
+#   - SSDs to be manually partitioned after installation
+
+d-ipartman-auto/method string  raid
+d-ipartman-md/device_remove_md boolean true
+d-ipartman-lvm/device_remove_lvm   boolean true
+d-ipartman/alignment   select  optimal
+
+# Use the first two disks
+d-ipartman-auto/disk   string  /dev/sda /dev/sdb
+d-ipartman-auto/choose_recipe select raid1-boot-root
+
+# Define physical partitions
+d-ipartman-auto/expert_recipe  string  \
+   raid1-boot-root ::  \
+   500 1   500 raid\
+   $primary{ } method{ raid }  \
+   $lvmignore{ }   \
+   .   \
+   500 2   -1  raid\
+   $primary{ } method{ raid }  \
+   $lvmignore{ }   \
+   .   \
+   5   4   5  ext3 \
+   $lvmok{ }   \
+   $defaultignore{ }   \
+   lv_name{ root } \
+   method{ format }\
+   format{ }   \
+   use_filesystem{ }   \
+   filesystem{ ext3 }  \
+   mountpoint{ / } \
+   .   \
+   10003   1000linux-swap  \
+   $defaultignore{ }   \
+   $lvmok{ }   \
+   lv_name{ swap } \
+   method{ swap }  \
+   format{ }   \
+   .
+
+# Parameters are:
+# raidtype devcount sparecount fstype mountpoint \
+#  devices sparedevices
+d-ipartman-auto-raid/recipestring  \
+   1   2   0   ext3/boot   \
+   /dev/sda1#/dev/sdb1 \
+   .   \
+   1   2   0   lvm -   \
+  

[MediaWiki-commits] [Gerrit] HAT: test hhvm.server.stat_cache on mw1081 - change (operations/puppet)

2014-12-04 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has submitted this change and it was merged.

Change subject: HAT: test hhvm.server.stat_cache on mw1081
..


HAT: test hhvm.server.stat_cache on mw1081

Change-Id: Ifd6e1a79508cede158eef2b0d18308f40f4653b7
Signed-off-by: Giuseppe Lavagetto glavage...@wikimedia.org
---
A hieradata/hosts/mw1081.yaml
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/hieradata/hosts/mw1081.yaml b/hieradata/hosts/mw1081.yaml
new file mode 100644
index 000..a367bae
--- /dev/null
+++ b/hieradata/hosts/mw1081.yaml
@@ -0,0 +1,4 @@
+hhvm::extra::fcgi:
+  hhvm:
+server:
+  stat_cache: true

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd6e1a79508cede158eef2b0d18308f40f4653b7
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto glavage...@wikimedia.org
Gerrit-Reviewer: Giuseppe Lavagetto glavage...@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] Emit alert when Ori commits on a weekend - change (operations/puppet)

2014-12-04 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Emit alert when Ori commits on a weekend
..

Emit alert when Ori commits on a weekend

Provisions an Icinga check on palladium that issues an alert if the time is
between Friday 21:00 and Monday 01:00 and there exists a commit from me in the
last hour in operations/puppet.

Change-Id: I2c4fd0d6ef907e4afe91f0248e7039f31d70696c
---
A files/icinga/check-ori-commits
M manifests/misc/monitoring.pp
M manifests/site.pp
3 files changed, 37 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/21/177521/1

diff --git a/files/icinga/check-ori-commits b/files/icinga/check-ori-commits
new file mode 100755
index 000..d2d9552
--- /dev/null
+++ b/files/icinga/check-ori-commits
@@ -0,0 +1,20 @@
+#!/bin/bash
+# Icinga alert script for Ori weekend commits
+#
+# Alerts if the time is between 21:00 on Friday and 01:00 on Monday
+# (my time zone) and there exists a commit from me in the last hour.
+
+TZ=America/Los_Angeles
+  /usr/bin/git \
+  --git-dir=/var/lib/git/operations/puppet/.git log \
+  --author=o...@wikimedia.org \
+  --since=1hour \
+  --format=%cd | /bin/grep -Pq '(Fri .* 2.:|Sat|Sun)'
+
+if [ $? -eq 0 ]; then
+  echo CRITICAL: Ori committed a change on a weekend
+  exit 2
+else
+  echo OK: Ori is behaving himself
+  exit 0
+fi
diff --git a/manifests/misc/monitoring.pp b/manifests/misc/monitoring.pp
index b333799..baf49ad 100644
--- a/manifests/misc/monitoring.pp
+++ b/manifests/misc/monitoring.pp
@@ -613,3 +613,19 @@
 ],
 }
 }
+
+
+class misc::monitoring::ori_weekend_commits {
+file { '/usr/local/lib/nagios/plugins/check-ori-weekend-commits':
+source = 'puppet:///files/icinga/check-ori-weekend-commits',
+owner  = 'root',
+group  = 'root',
+mode   = '0555',
+}
+
+nrpe::monitor_service { 'ori_weekend_commits':
+description  = 'Ori committing changes on the weekend',
+nrpe_command = 
'/usr/local/lib/nagios/plugins/check-ori-weekend-commits',
+require  = 
File['/usr/local/lib/nagios/plugins/check-ori-weekend-commits'],
+}
+}
diff --git a/manifests/site.pp b/manifests/site.pp
index 688fa18..f3bf770 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2162,6 +2162,7 @@
 include role::access_new_install
 include role::puppetmaster::frontend
 include role::pybal_config
+include misc::monitoring::ori_weekend_commits
 
 $domain_search = [
 'wikimedia.org',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2c4fd0d6ef907e4afe91f0248e7039f31d70696c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh o...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] [DO NOT SUBMIT] First shot at deduping - change (analytics/refinery)

2014-12-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: [DO NOT SUBMIT] First shot at deduping
..

[DO NOT SUBMIT] First shot at deduping

Change-Id: I8f324be3a1d5176b893c574c979b2d7446f15caa
---
A hive/webrequest/dedupe.sh
A hive/webrequest/dedupe_partition.hql
2 files changed, 86 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/refinery 
refs/changes/22/177522/1

diff --git a/hive/webrequest/dedupe.sh b/hive/webrequest/dedupe.sh
new file mode 100644
index 000..a11d5bf
--- /dev/null
+++ b/hive/webrequest/dedupe.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+echo No way. Please rean $0 to understand how to dedupe
+exit 1
+
+# Make sure that qchris.webrequest is table that has the output format
+# set to write Sequence files. So something like “STORED AS
+# SequenceFile” in the CREATE TABLE statement.
+# wmf_raw.webrequest does currently not meet this criterion!
+
+# /home/qchris/my-hive-conf is just the /etc/hive/conf from stat1002, but 
without setting
+#   hive.insert.into.external.tables
+# to false
+
+export WEBREQUEST_SOURCE=bits
+export YEAR=2014
+export MONTH_PADDED=12
+export DAY_PADDED=03
+export HOUR_PADDED=17
+
+echo watch du -hs 
/mnt/hdfs/wmf/data/raw/webrequest/webrequest_${WEBREQUEST_SOURCE}/hourly/${YEAR}/${MONTH_PADDED}/${DAY_PADDED}/${HOUR_PADDED}
 
/mnt/hdfs/user/qchris/wmf_raw_webrequest/webrequest_${WEBREQUEST_SOURCE}/hourly/${YEAR}/${MONTH_PADDED}/${DAY_PADDED}/${HOUR_PADDED}
+hdfs dfs -rm -r -f 
/user/qchris/wmf_raw_webrequest/webrequest_${WEBREQUEST_SOURCE}/hourly/${YEAR}/${MONTH_PADDED}/${DAY_PADDED}/${HOUR_PADDED}
+hdfs dfs -mkdir -p 
/user/qchris/wmf_raw_webrequest/webrequest_${WEBREQUEST_SOURCE}/hourly/${YEAR}/${MONTH_PADDED}/${DAY_PADDED}
+hdfs dfs -cp 
/wmf/data/raw/webrequest/webrequest_${WEBREQUEST_SOURCE}/hourly/${YEAR}/${MONTH_PADDED}/${DAY_PADDED}/${HOUR_PADDED}
 
/user/qchris/wmf_raw_webrequest/webrequest_${WEBREQUEST_SOURCE}/hourly/${YEAR}/${MONTH_PADDED}/${DAY_PADDED}/${HOUR_PADDED}
+hive -e USE qchris; ALTER TABLE webrequest ADD IF NOT EXISTS PARTITION 
(webrequest_source='${WEBREQUEST_SOURCE}',year=${YEAR},month=${MONTH_PADDED##0},day=${DAY_PADDED##0},hour=${HOUR_PADDED##0})
 LOCATION 
'/user/qchris/wmf_raw_webrequest/webrequest_${WEBREQUEST_SOURCE}/hourly/${YEAR}/${MONTH_PADDED}/${DAY_PADDED}/${HOUR_PADDED}';
+hive --config /home/qchris/my-hive-conf -f 
~/refinery/hive/webrequest/dedupe_partition.hql -d table_name=qchris.webrequest 
-d webrequest_source=${WEBREQUEST_SOURCE} -d year=${YEAR} -d 
month=${MONTH_PADDED##0} -d day=${DAY_PADDED##0} -d hour=${HOUR_PADDED##0}
+hive -e SELECT hostname, MIN(sequence) AS sequence_min, MAX(sequence) AS 
sequence_max, COUNT(*) AS count_actual, MAX(sequence) - MIN(sequence) + 1 AS 
count_expected, MAX(sequence) - MIN(sequence) + 1 - COUNT(hostname) AS 
count_different, COUNT(*) - COUNT(DISTINCT sequence) AS count_duplicate, 
SUM(if(sequence IS NULL,1,0)) AS count_null_sequence, ((COUNT(*) / 
(MAX(sequence) - MIN(sequence) + 1)) - 1) * 100.0 AS percent_different, 
webrequest_source, year, month, day, hour FROM qchris.webrequest WHERE 
webrequest_source IN ( '${WEBREQUEST_SOURCE}' ) AND year=${YEAR} AND 
month=${MONTH_PADDED} AND day=${DAY_PADDED} AND hour=${HOUR_PADDED} GROUP BY 
hostname, webrequest_source, year, month, day, hour ORDER BY year, month, day, 
hour, hostname, webrequest_source LIMIT 5000;
diff --git a/hive/webrequest/dedupe_partition.hql 
b/hive/webrequest/dedupe_partition.hql
new file mode 100644
index 000..af480e9
--- /dev/null
+++ b/hive/webrequest/dedupe_partition.hql
@@ -0,0 +1,59 @@
+-- Dedupes a webrequest partition
+--
+-- Parameters:
+-- table_name-- Fully qualified table name to dedupe a webrequest
+--  partition for
+-- webrequest_source -- webrequest_source of partition to dedupe
+-- year  -- year of partition to dedupe
+-- month -- month of partition to dedupe
+-- day   -- day of partition to dedupe
+-- hour  -- hour of partition to dedupe
+--
+--
+-- Usage:
+-- hive -f dedupe_partition.hql   \
+-- -d table_name=qchris.webrequest  \
+-- -d webrequest_source=bits  \
+-- -d year=2014   \
+-- -d month=12\
+-- -d day=3   \
+-- -d hour=17
+--
+
+
+
+INSERT OVERWRITE TABLE ${table_name}
+PARTITION(
+webrequest_source='${webrequest_source}',
+year=${year},
+month=${month},
+day=${day},
+hour=${hour}
+)
+SELECT DISTINCT
+hostname,
+sequence,
+dt,
+time_firstbyte,
+ip,
+cache_status,
+http_status,
+response_size,
+http_method,
+uri_host,
+uri_path,
+uri_query,
+content_type,
+referer,
+

[MediaWiki-commits] [Gerrit] tiny cleaning (v 1.5.3) - change (mediawiki...PhpTagsWiki)

2014-12-04 Thread Pastakhov (Code Review)
Pastakhov has uploaded a new change for review.

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

Change subject: tiny cleaning (v 1.5.3)
..

tiny cleaning (v 1.5.3)

Change-Id: Ic32d402af9d96d4c58631b72fd2b94fff113029f
---
M PhpTagsWiki.php
M includes/WikiWCache.php
M includes/WikiWPage.php
3 files changed, 6 insertions(+), 4 deletions(-)


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

diff --git a/PhpTagsWiki.php b/PhpTagsWiki.php
index 72af4de..aa7c335 100644
--- a/PhpTagsWiki.php
+++ b/PhpTagsWiki.php
@@ -33,7 +33,7 @@
);
 }
 
-define( 'PHPTAGS_WIKI_VERSION' , '1.5.2' );
+define( 'PHPTAGS_WIKI_VERSION' , '1.5.3' );
 
 // Register this extension on Special:Version
 $wgExtensionCredits['phptags'][] = array(
diff --git a/includes/WikiWCache.php b/includes/WikiWCache.php
index 7dfafee..2c43628 100644
--- a/includes/WikiWCache.php
+++ b/includes/WikiWCache.php
@@ -11,12 +11,14 @@
public static function checkArguments( $object, $method, $arguments, 
$expects = false ) {
switch ( $method ) {
case 'updatecacheexpiry':
+   $method = 'updateCacheExpiry';
$expects = array(
\PhpTags\Hooks::TYPE_NUMBER,

\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 1,
);
break;
case 'disablecache':
+   $method = 'disableCache';
$expects = array(

\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 0,
);
diff --git a/includes/WikiWPage.php b/includes/WikiWPage.php
index 24974e4..b10e098 100644
--- a/includes/WikiWPage.php
+++ b/includes/WikiWPage.php
@@ -13,7 +13,7 @@
}
 
public static function checkArguments( $object, $method, $arguments, 
$expects = false ) {
-   switch ( strtolower( $method ) ) {
+   switch ( $method ) {
case '__construct':
$expects = array(
\PhpTags\Hooks::TYPE_MIXED,
@@ -21,6 +21,7 @@
);
break;
case 'addcategory':
+   $method = 'addCategory';
$expects = array(
\PhpTags\Hooks::TYPE_MIXED,

\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 1,
@@ -85,8 +86,7 @@
$parser-getOutput()-addCategory( 
$titleCategory-getDBkey(), $parser-getDefaultSort() );
return true;
} else {
-   \PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_EXCEPTION][] 
= new \PhpTags\HookException( \PhpTags\HookException::EXCEPTION_NOTICE, 
\PhpTags\Hooks::$objectName . ::AddCategory() \$category\ is not a valid 
title! );
-   wfDebug( __METHOD__ . : [[MediaWiki:$msg]] is not a 
valid title!\n );
+   \PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_EXCEPTION][] 
= new \PhpTags\HookException( \PhpTags\HookException::EXCEPTION_NOTICE, 
\PhpTags\Hooks::$objectName . ::addCategory() \$category\ is not a valid 
title! );
return false;
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic32d402af9d96d4c58631b72fd2b94fff113029f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PhpTagsWiki
Gerrit-Branch: master
Gerrit-Owner: Pastakhov pastak...@yandex.ru

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


[MediaWiki-commits] [Gerrit] tiny cleaning (v 1.5.3) - change (mediawiki...PhpTagsWiki)

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

Change subject: tiny cleaning (v 1.5.3)
..


tiny cleaning (v 1.5.3)

Change-Id: Ic32d402af9d96d4c58631b72fd2b94fff113029f
---
M PhpTagsWiki.php
M includes/WikiWCache.php
M includes/WikiWPage.php
3 files changed, 6 insertions(+), 4 deletions(-)

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



diff --git a/PhpTagsWiki.php b/PhpTagsWiki.php
index 72af4de..aa7c335 100644
--- a/PhpTagsWiki.php
+++ b/PhpTagsWiki.php
@@ -33,7 +33,7 @@
);
 }
 
-define( 'PHPTAGS_WIKI_VERSION' , '1.5.2' );
+define( 'PHPTAGS_WIKI_VERSION' , '1.5.3' );
 
 // Register this extension on Special:Version
 $wgExtensionCredits['phptags'][] = array(
diff --git a/includes/WikiWCache.php b/includes/WikiWCache.php
index 7dfafee..2c43628 100644
--- a/includes/WikiWCache.php
+++ b/includes/WikiWCache.php
@@ -11,12 +11,14 @@
public static function checkArguments( $object, $method, $arguments, 
$expects = false ) {
switch ( $method ) {
case 'updatecacheexpiry':
+   $method = 'updateCacheExpiry';
$expects = array(
\PhpTags\Hooks::TYPE_NUMBER,

\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 1,
);
break;
case 'disablecache':
+   $method = 'disableCache';
$expects = array(

\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 0,
);
diff --git a/includes/WikiWPage.php b/includes/WikiWPage.php
index 24974e4..b10e098 100644
--- a/includes/WikiWPage.php
+++ b/includes/WikiWPage.php
@@ -13,7 +13,7 @@
}
 
public static function checkArguments( $object, $method, $arguments, 
$expects = false ) {
-   switch ( strtolower( $method ) ) {
+   switch ( $method ) {
case '__construct':
$expects = array(
\PhpTags\Hooks::TYPE_MIXED,
@@ -21,6 +21,7 @@
);
break;
case 'addcategory':
+   $method = 'addCategory';
$expects = array(
\PhpTags\Hooks::TYPE_MIXED,

\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 1,
@@ -85,8 +86,7 @@
$parser-getOutput()-addCategory( 
$titleCategory-getDBkey(), $parser-getDefaultSort() );
return true;
} else {
-   \PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_EXCEPTION][] 
= new \PhpTags\HookException( \PhpTags\HookException::EXCEPTION_NOTICE, 
\PhpTags\Hooks::$objectName . ::AddCategory() \$category\ is not a valid 
title! );
-   wfDebug( __METHOD__ . : [[MediaWiki:$msg]] is not a 
valid title!\n );
+   \PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_EXCEPTION][] 
= new \PhpTags\HookException( \PhpTags\HookException::EXCEPTION_NOTICE, 
\PhpTags\Hooks::$objectName . ::addCategory() \$category\ is not a valid 
title! );
return false;
}
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic32d402af9d96d4c58631b72fd2b94fff113029f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PhpTagsWiki
Gerrit-Branch: master
Gerrit-Owner: Pastakhov pastak...@yandex.ru
Gerrit-Reviewer: Pastakhov pastak...@yandex.ru
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] tiny cleaning (v 1.5.3) - change (mediawiki...PhpTagsWiki)

2014-12-04 Thread Pastakhov (Code Review)
Pastakhov has uploaded a new change for review.

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

Change subject: tiny cleaning (v 1.5.3)
..

tiny cleaning (v 1.5.3)

Change-Id: Ic32d402af9d96d4c58631b72fd2b94fff113029f
(cherry picked from commit 86065072d823236f6970e510fd4911819efd3360)
---
M PhpTagsWiki.php
M includes/WikiWCache.php
M includes/WikiWPage.php
3 files changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PhpTagsWiki 
refs/changes/24/177524/1

diff --git a/PhpTagsWiki.php b/PhpTagsWiki.php
index 72af4de..aa7c335 100644
--- a/PhpTagsWiki.php
+++ b/PhpTagsWiki.php
@@ -33,7 +33,7 @@
);
 }
 
-define( 'PHPTAGS_WIKI_VERSION' , '1.5.2' );
+define( 'PHPTAGS_WIKI_VERSION' , '1.5.3' );
 
 // Register this extension on Special:Version
 $wgExtensionCredits['phptags'][] = array(
diff --git a/includes/WikiWCache.php b/includes/WikiWCache.php
index 7dfafee..2c43628 100644
--- a/includes/WikiWCache.php
+++ b/includes/WikiWCache.php
@@ -11,12 +11,14 @@
public static function checkArguments( $object, $method, $arguments, 
$expects = false ) {
switch ( $method ) {
case 'updatecacheexpiry':
+   $method = 'updateCacheExpiry';
$expects = array(
\PhpTags\Hooks::TYPE_NUMBER,

\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 1,
);
break;
case 'disablecache':
+   $method = 'disableCache';
$expects = array(

\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 0,
);
diff --git a/includes/WikiWPage.php b/includes/WikiWPage.php
index 24974e4..b10e098 100644
--- a/includes/WikiWPage.php
+++ b/includes/WikiWPage.php
@@ -13,7 +13,7 @@
}
 
public static function checkArguments( $object, $method, $arguments, 
$expects = false ) {
-   switch ( strtolower( $method ) ) {
+   switch ( $method ) {
case '__construct':
$expects = array(
\PhpTags\Hooks::TYPE_MIXED,
@@ -21,6 +21,7 @@
);
break;
case 'addcategory':
+   $method = 'addCategory';
$expects = array(
\PhpTags\Hooks::TYPE_MIXED,

\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 1,
@@ -85,8 +86,7 @@
$parser-getOutput()-addCategory( 
$titleCategory-getDBkey(), $parser-getDefaultSort() );
return true;
} else {
-   \PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_EXCEPTION][] 
= new \PhpTags\HookException( \PhpTags\HookException::EXCEPTION_NOTICE, 
\PhpTags\Hooks::$objectName . ::AddCategory() \$category\ is not a valid 
title! );
-   wfDebug( __METHOD__ . : [[MediaWiki:$msg]] is not a 
valid title!\n );
+   \PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_EXCEPTION][] 
= new \PhpTags\HookException( \PhpTags\HookException::EXCEPTION_NOTICE, 
\PhpTags\Hooks::$objectName . ::addCategory() \$category\ is not a valid 
title! );
return false;
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic32d402af9d96d4c58631b72fd2b94fff113029f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PhpTagsWiki
Gerrit-Branch: REL1_24
Gerrit-Owner: Pastakhov pastak...@yandex.ru

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


[MediaWiki-commits] [Gerrit] tiny cleaning (v 1.5.3) - change (mediawiki...PhpTagsWiki)

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

Change subject: tiny cleaning (v 1.5.3)
..


tiny cleaning (v 1.5.3)

Change-Id: Ic32d402af9d96d4c58631b72fd2b94fff113029f
(cherry picked from commit 86065072d823236f6970e510fd4911819efd3360)
---
M PhpTagsWiki.php
M includes/WikiWCache.php
M includes/WikiWPage.php
3 files changed, 6 insertions(+), 4 deletions(-)

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



diff --git a/PhpTagsWiki.php b/PhpTagsWiki.php
index 72af4de..aa7c335 100644
--- a/PhpTagsWiki.php
+++ b/PhpTagsWiki.php
@@ -33,7 +33,7 @@
);
 }
 
-define( 'PHPTAGS_WIKI_VERSION' , '1.5.2' );
+define( 'PHPTAGS_WIKI_VERSION' , '1.5.3' );
 
 // Register this extension on Special:Version
 $wgExtensionCredits['phptags'][] = array(
diff --git a/includes/WikiWCache.php b/includes/WikiWCache.php
index 7dfafee..2c43628 100644
--- a/includes/WikiWCache.php
+++ b/includes/WikiWCache.php
@@ -11,12 +11,14 @@
public static function checkArguments( $object, $method, $arguments, 
$expects = false ) {
switch ( $method ) {
case 'updatecacheexpiry':
+   $method = 'updateCacheExpiry';
$expects = array(
\PhpTags\Hooks::TYPE_NUMBER,

\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 1,
);
break;
case 'disablecache':
+   $method = 'disableCache';
$expects = array(

\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 0,
);
diff --git a/includes/WikiWPage.php b/includes/WikiWPage.php
index 24974e4..b10e098 100644
--- a/includes/WikiWPage.php
+++ b/includes/WikiWPage.php
@@ -13,7 +13,7 @@
}
 
public static function checkArguments( $object, $method, $arguments, 
$expects = false ) {
-   switch ( strtolower( $method ) ) {
+   switch ( $method ) {
case '__construct':
$expects = array(
\PhpTags\Hooks::TYPE_MIXED,
@@ -21,6 +21,7 @@
);
break;
case 'addcategory':
+   $method = 'addCategory';
$expects = array(
\PhpTags\Hooks::TYPE_MIXED,

\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS = 1,
@@ -85,8 +86,7 @@
$parser-getOutput()-addCategory( 
$titleCategory-getDBkey(), $parser-getDefaultSort() );
return true;
} else {
-   \PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_EXCEPTION][] 
= new \PhpTags\HookException( \PhpTags\HookException::EXCEPTION_NOTICE, 
\PhpTags\Hooks::$objectName . ::AddCategory() \$category\ is not a valid 
title! );
-   wfDebug( __METHOD__ . : [[MediaWiki:$msg]] is not a 
valid title!\n );
+   \PhpTags\Runtime::$transit[PHPTAGS_TRANSIT_EXCEPTION][] 
= new \PhpTags\HookException( \PhpTags\HookException::EXCEPTION_NOTICE, 
\PhpTags\Hooks::$objectName . ::addCategory() \$category\ is not a valid 
title! );
return false;
}
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic32d402af9d96d4c58631b72fd2b94fff113029f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PhpTagsWiki
Gerrit-Branch: REL1_24
Gerrit-Owner: Pastakhov pastak...@yandex.ru
Gerrit-Reviewer: Pastakhov pastak...@yandex.ru
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Refactor lineardoc module to multiple small files - change (mediawiki...cxserver)

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

Change subject: Refactor lineardoc module to multiple small files
..


Refactor lineardoc module to multiple small files

Bug: T76000
Change-Id: Ie32986ffcdaf84ef90c12a71f77c85f9d16a30ba
---
M bin/linearize
M index.js
A lineardoc/Builder.js
A lineardoc/Doc.js
D lineardoc/LinearDoc.js
A lineardoc/Normalizer.js
A lineardoc/Parser.js
A lineardoc/TextBlock.js
A lineardoc/TextChunk.js
A lineardoc/Utils.js
A lineardoc/index.js
M mt/MTClient.js
M mt/annotationmapper/SubsequenceMatcher.js
M segmentation/CXSegmenter.js
M segmentation/languages/SegmenterDefault.js
M segmentation/languages/SegmenterEn.js
M segmentation/languages/SegmenterHi.js
M tests/index.js
18 files changed, 1,301 insertions(+), 1,248 deletions(-)

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



diff --git a/bin/linearize b/bin/linearize
index 56c2cb3..c65b709 100755
--- a/bin/linearize
+++ b/bin/linearize
@@ -1,7 +1,7 @@
 #!/usr/bin/env node
 var script, xhtmlSource, xhtml, parser,
fs = require( 'fs' ),
-   LinearDoc = require( __dirname + '/../lineardoc/LinearDoc.js' );
+   LinearDoc = require( __dirname + '/../lineardoc' );
 
 script = process.argv[ 1 ];
 if ( process.argv.length !== 3 ) {
diff --git a/index.js b/index.js
index 167639e..4051b72 100644
--- a/index.js
+++ b/index.js
@@ -3,6 +3,6 @@
Apertium: require( './mt/Apertium.js' ),
Yandex: require( './mt/Yandex.js' ),
MTClient: require( './mt/MTClient.js' ),
-   LinearDoc: require( './lineardoc/LinearDoc.js' ),
+   LinearDoc: require( './lineardoc' ),
Dictionary: require( './dictionary' )
 };
diff --git a/lineardoc/Builder.js b/lineardoc/Builder.js
new file mode 100644
index 000..15f806c
--- /dev/null
+++ b/lineardoc/Builder.js
@@ -0,0 +1,135 @@
+var Doc = require( './Doc.js' ),
+   TextBlock = require( './TextBlock.js' ),
+   TextChunk = require( './TextChunk.js' );
+
+/**
+ * A document builder
+ * @class
+ *
+ * @constructor
+ * @param {Builder} [parent] Parent document builder
+ * @param {Object} [wrapperTag] tag that wraps document (if there is a parent)
+ */
+function Builder( parent, wrapperTag ) {
+   this.blockTags = [];
+   // Stack of annotation tags
+   this.inlineAnnotationTags = [];
+   // The height of the annotation tags that have been used, minus one
+   this.inlineAnnotationTagsUsed = 0;
+   this.doc = new Doc( wrapperTag || null );
+   this.textChunks = [];
+   this.parent = parent || null;
+}
+
+Builder.prototype.createChildBuilder = function ( wrapperTag ) {
+   return new Builder( this, wrapperTag );
+};
+
+Builder.prototype.pushBlockTag = function ( tag ) {
+   this.finishTextBlock();
+   this.blockTags.push( tag );
+   this.doc.addItem( 'open', tag );
+};
+
+Builder.prototype.popBlockTag = function ( tagName ) {
+   var tag = this.blockTags.pop();
+   if ( !tag || tag.name !== tagName ) {
+   throw new Error(
+   'Mismatched block tags: open=' + ( tag  tag.name ) + 
', close=' + tagName
+   );
+   }
+   this.finishTextBlock();
+   this.doc.addItem( 'close', tag );
+   return tag;
+};
+
+Builder.prototype.pushInlineAnnotationTag = function ( tag ) {
+   this.inlineAnnotationTags.push( tag );
+};
+
+Builder.prototype.popInlineAnnotationTag = function ( tagName ) {
+   var tag, textChunk, chunkTag, i, replace, whitespace;
+   tag = this.inlineAnnotationTags.pop();
+   if ( this.inlineAnnotationTagsUsed === this.inlineAnnotationTags.length 
) {
+   this.inlineAnnotationTagsUsed--;
+   }
+   if ( !tag || tag.name !== tagName ) {
+   throw new Error(
+   'Mismatched inline tags: open=' + ( tag  tag.name ) + 
', close=' + tagName
+   );
+   }
+   if ( tag.name !== 'span' || !tag.attributes[ 'data-mw' ] ) {
+   return tag;
+   }
+   // Check for empty/whitespace-only data span. Replace as inline content
+   replace = true;
+   whitespace = [];
+   for ( i = this.textChunks.length - 1; i = 0; i-- ) {
+   textChunk = this.textChunks[ i ];
+   chunkTag = textChunk.tags[ textChunk.tags.length - 1 ];
+   if ( !chunkTag || chunkTag !== tag ) {
+   break;
+   }
+   if ( textChunk.text.match( /\S/ ) || textChunk.inlineContent ) {
+   replace = false;
+   break;
+   }
+   whitespace.push( textChunk.text );
+   }
+   if ( replace ) {
+   // truncate list and add data span as new sub-Doc.
+   this.textChunks.length = i + 1;
+   whitespace.reverse();
+   this.addInlineContent(
+  

[MediaWiki-commits] [Gerrit] Make ElasticSearchTTMServer results consistent enough - change (mediawiki...Translate)

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

Change subject: Make ElasticSearchTTMServer results consistent enough
..


Make ElasticSearchTTMServer results consistent enough

Added secondary sort on _uid to enforce consistent order
of same-score results.

Implemented an algorithm which does second query to fetch
more source documents if the first query results many docs
with identical score. This should help in the cases the
translations are sparse, so we will return suggestions above
certain score by checking all documents above that score,
not just what we got in the first query. This also gives
more reliable used X times numbers in the UI.

Increased the default size from 50 to 100.

Here we assume that same score means that source text is
also the same, which is only guaranteed to be true if score
is 1. I use the score instead of the source text because it
makes the code simpler.

Bug: T76184
Change-Id: I269f849e6d398cbe140c41411a7b5eefd417c862
---
M ttmserver/ElasticSearchTTMServer.php
1 file changed, 51 insertions(+), 24 deletions(-)

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



diff --git a/ttmserver/ElasticSearchTTMServer.php 
b/ttmserver/ElasticSearchTTMServer.php
index a41a26b..6d0bc2b 100644
--- a/ttmserver/ElasticSearchTTMServer.php
+++ b/ttmserver/ElasticSearchTTMServer.php
@@ -85,35 +85,62 @@
$languageFilter-setTerm( 'language', $sourceLanguage );
$query-setFilter( $languageFilter );
 
-   /* The interface usually displays three best candidates. These 
might
-* come from more than three matches, if the translation is the 
same.
-* This might not find all suggestions, if the top N best 
matching
-* source texts don't have translations, but worse matches do. 
We
-* could loop with start parameter to fetch more until we have 
enough
-* suggestions or the quality drops below the cutoff point. */
-   $query-setSize( 25 );
+   // The interface usually displays three best candidates. These 
might
+   // come from more than three source things, if the translations 
are
+   // the same. In other words suggestions are grouped by the 
suggested
+   // translation. This algorithm might not find all suggestions, 
if the
+   // top N best matching source texts don't have equivalent 
translations
+   // in the target language, but worse matches which we did not 
fetch do.
+   // This code tries to balance between doing too many or too big 
queries
+   // and not fetching enough results to show all possible 
suggestions.
+   $sizeFirst = 100;
+   $sizeSecond = $sizeFirst * 5;
+
+   $query-setFrom( 0 );
+   $query-setSize( $sizeFirst );
$query-setParam( '_source', array( 'content' ) );
$query-setParam( 'min_score', $this-config['cutoff'] );
-   $resultset = $this-getType()-search( $query );
+   $query-setSort( array( '_score', '_uid' ) );
 
-   /* This query is doing two unrelated things:
-* 1) Collect the message contents and scores so that they can
-*be accessed later for the translations we found.
-* 2) Build the query string for the query that fetches the
-*translations.
-* This code is a bit uglier than I'd like it to be, since there
-* there is no field that globally identifies a message (message
-* definition and translations). */
+   // This query is doing two unrelated things:
+   // 1) Collect the message contents and scores so that they can
+   //be accessed later for the translations we found.
+   // 2) Build the query string for the query that fetches the 
translations.
$contents = $scores = $terms = array();
-   foreach ( $resultset-getResults() as $result ) {
-   $data = $result-getData();
-   $score = $result-getScore();
+   do {
+   $resultset = $this-getType()-search( $query );
+   foreach ( $resultset-getResults() as $result ) {
+   $data = $result-getData();
+   $score = $result-getScore();
 
-   $sourceId = preg_replace( '~/[^/]+$~', '', 
$result-getId() );
-   $contents[$sourceId] = $data['content'];
-   $scores[$sourceId] = $score;
-   $terms[] = $sourceId/$targetLanguage;
-   }
+   $sourceId = preg_replace( 

[MediaWiki-commits] [Gerrit] Ignore traffic from cache-local SSL terminators - change (analytics/refinery)

2014-12-04 Thread Ottomata (Code Review)
Ottomata has submitted this change and it was merged.

Change subject: Ignore traffic from cache-local SSL terminators
..


Ignore traffic from cache-local SSL terminators

Webstatscollector's C implementation also ignores traffic from
  10.20.0.0/24
  10.64.0.0/24
  10.64.32.0/24
since Ic6e1f8e6f58091b2274a3ab45ddfe38bc9489591.

In order to make them agree again, we also ignore traffic from those
nets.

Bug: T76390
Change-Id: I3ef0ef2a6bdd16c7f00f56216df47b18df2aa9df
---
M oozie/webstats/insert_hourly_pagecounts/insert_hourly_pagecounts.hql
1 file changed, 7 insertions(+), 2 deletions(-)

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



diff --git 
a/oozie/webstats/insert_hourly_pagecounts/insert_hourly_pagecounts.hql 
b/oozie/webstats/insert_hourly_pagecounts/insert_hourly_pagecounts.hql
index dd61ff9..e26a31e 100644
--- a/oozie/webstats/insert_hourly_pagecounts/insert_hourly_pagecounts.hql
+++ b/oozie/webstats/insert_hourly_pagecounts/insert_hourly_pagecounts.hql
@@ -52,8 +52,13 @@
 AND SUBSTR(uri_path, 1, 6) = '/wiki/'
 AND (
 (
-SUBSTR(ip, 1, 9) != '10.128.0.'
-AND SUBSTR(ip, 1, 11) NOT IN (
+SUBSTR(ip, 1, 8) NOT IN (
+'10.20.0.',
+'10.64.0.'
+) AND SUBSTR(ip, 1, 9) NOT IN (
+'10.128.0.',
+'10.64.32.'
+) AND SUBSTR(ip, 1, 11) NOT IN (
 '208.80.152.',
 '208.80.153.',
 '208.80.154.',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3ef0ef2a6bdd16c7f00f56216df47b18df2aa9df
Gerrit-PatchSet: 1
Gerrit-Project: analytics/refinery
Gerrit-Branch: master
Gerrit-Owner: QChris christ...@quelltextlich.at
Gerrit-Reviewer: Ottomata o...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] added Item to wikibase-item - change (mediawiki...Wikibase)

2014-12-04 Thread Lucie Kaffee (Code Review)
Lucie Kaffee has uploaded a new change for review.

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

Change subject: added Item to wikibase-item
..

added Item to wikibase-item

Change-Id: Idcc0b747f1998dd6638034f920baef63d41343cf
---
M client/config/WikibaseClient.default.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/client/config/WikibaseClient.default.php 
b/client/config/WikibaseClient.default.php
index 501160a..89f6daa 100644
--- a/client/config/WikibaseClient.default.php
+++ b/client/config/WikibaseClient.default.php
@@ -33,7 +33,7 @@
'showExternalRecentChanges' = true,
// default for repo items in main namespace
'repoNamespaces' = array(
-   'wikibase-item' = '',
+   'wikibase-item' = 'Item',
'wikibase-property' = 'Property'
),
'allowDataTransclusion' = true,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idcc0b747f1998dd6638034f920baef63d41343cf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Lucie Kaffee lucie.kaf...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] UniversalExport: Fixed permission error for special pages - change (mediawiki...BlueSpiceExtensions)

2014-12-04 Thread Pwirth (Code Review)
Pwirth has uploaded a new change for review.

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

Change subject: UniversalExport: Fixed permission error for special pages
..

UniversalExport: Fixed permission error for special pages

* Used isAllowed instead of userCan if requested title is a special page
* Added descriptiom

Change-Id: Idef3128d6dc9e297bedaa8324adfef6b076a7ccc
---
M UniversalExport/includes/specials/SpecialUniversalExport.class.php
1 file changed, 6 insertions(+), 1 deletion(-)


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

diff --git a/UniversalExport/includes/specials/SpecialUniversalExport.class.php 
b/UniversalExport/includes/specials/SpecialUniversalExport.class.php
index ae9e094..0c445c7 100644
--- a/UniversalExport/includes/specials/SpecialUniversalExport.class.php
+++ b/UniversalExport/includes/specials/SpecialUniversalExport.class.php
@@ -132,7 +132,12 @@

BsUniversalExportHelper::getParamsFromQueryString( 
$this-aParams );
 
-   if ( $this-oRequestedTitle-userCan( 
'universalexport-export' ) === false ) {
+   //Title::userCan always returns false on special pages 
(exept for createaccount action)
+   if( $this-oRequestedTitle-getNamespace() === 
NS_SPECIAL ) {
+   if( 
$this-getUser()-isAllowed('universalexport-export') !== true ){
+   throw new Exception( 
'bs-universalexport-error-permission');
+   }
+   } elseif( $this-oRequestedTitle-userCan( 
'universalexport-export' ) === false ) {
throw new Exception( 
'bs-universalexport-error-permission');
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idef3128d6dc9e297bedaa8324adfef6b076a7ccc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_22
Gerrit-Owner: Pwirth wi...@hallowelt.biz

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


[MediaWiki-commits] [Gerrit] Fix wrong SqlUsageTrackerSchemaUpdater filename - change (mediawiki...Wikibase)

2014-12-04 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review.

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

Change subject: Fix wrong SqlUsageTrackerSchemaUpdater filename
..

Fix wrong SqlUsageTrackerSchemaUpdater filename

Change-Id: Ib3782b787997ea9a858acb9b694d6e45955fc01a
---
R client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php
1 file changed, 0 insertions(+), 0 deletions(-)


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

diff --git a/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdate.php 
b/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php
similarity index 100%
rename from client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdate.php
rename to client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib3782b787997ea9a858acb9b694d6e45955fc01a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] Trim whitespace when annotating - change (VisualEditor/VisualEditor)

2014-12-04 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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

Change subject: Trim whitespace when annotating
..

Trim whitespace when annotating

We should assume that the user doesn't want to annotate trailing
whitespace, as we do with the link inspector.

Fix trimOuterSpaceFromRange to detect any whitespace character.

Fix getCharacterData to always return a string.

Fix various documentation lies and omissions.

Change-Id: I16488b1afada9e8dd41482ce5b6d186544a94040
---
M src/dm/lineardata/ve.dm.ElementLinearData.js
M src/ui/actions/ve.ui.AnnotationAction.js
M tests/ui/actions/ve.ui.AnnotationAction.test.js
3 files changed, 40 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/33/177533/1

diff --git a/src/dm/lineardata/ve.dm.ElementLinearData.js 
b/src/dm/lineardata/ve.dm.ElementLinearData.js
index 034607c..ffd213d 100644
--- a/src/dm/lineardata/ve.dm.ElementLinearData.js
+++ b/src/dm/lineardata/ve.dm.ElementLinearData.js
@@ -359,10 +359,16 @@
}
 };
 
-/** */
+/**
+ * Get character data at a specified offset
+ *
+ * @param {number} offset Offset to get character data from
+ * @return {string} Character data
+ */
 ve.dm.ElementLinearData.prototype.getCharacterData = function ( offset ) {
-   var item = this.getData( offset );
-   return Array.isArray( item ) ? item[0] : item;
+   var item = this.getData( offset ),
+   data = Array.isArray( item ) ? item[0] : item;
+   return typeof data === 'string' ? data : '';
 };
 
 /**
@@ -487,16 +493,16 @@
  * Get a range without any whitespace content at the beginning and end.
  *
  * @method
- * @param {ve.Range} [range] Range of data to get, all data will be given by 
default
- * @returns {Object} A new range if modified, otherwise returns passed range
+ * @param {ve.Range} range Range to trim
+ * @returns {Object} Trimmed range
  */
 ve.dm.ElementLinearData.prototype.trimOuterSpaceFromRange = function ( range ) 
{
var start = range.start,
end = range.end;
-   while ( this.getCharacterData( end - 1 ) === ' ' ) {
+   while ( this.getCharacterData( end - 1 ).match( /\s/ ) ) {
end--;
}
-   while ( start  end  this.getCharacterData( start ) === ' ' ) {
+   while ( start  end  this.getCharacterData( start ).match( /\s/ ) ) {
start++;
}
return range.to  range.end ? new ve.Range( end, start ) : new 
ve.Range( start, end );
diff --git a/src/ui/actions/ve.ui.AnnotationAction.js 
b/src/ui/actions/ve.ui.AnnotationAction.js
index f9a5cb6..76041a1 100644
--- a/src/ui/actions/ve.ui.AnnotationAction.js
+++ b/src/ui/actions/ve.ui.AnnotationAction.js
@@ -45,10 +45,17 @@
  * @return {boolean} Action was executed
  */
 ve.ui.AnnotationAction.prototype.set = function ( name, data ) {
-   var i,
+   var i, trimmedFragment,
fragment = this.surface.getModel().getFragment(),
annotationClass = ve.dm.annotationFactory.lookup( name ),
removes = annotationClass.static.removes;
+
+   if ( fragment.getSelection() instanceof ve.dm.LinearSelection ) {
+   trimmedFragment = fragment.trimLinearSelection();
+   if ( !trimmedFragment.getSelection().isCollapsed() ) {
+   fragment = trimmedFragment;
+   }
+   }
 
for ( i = removes.length - 1; i = 0; i-- ) {
fragment.annotateContent( 'clear', removes[i] );
@@ -82,7 +89,7 @@
  * @return {boolean} Action was executed
  */
 ve.ui.AnnotationAction.prototype.toggle = function ( name, data ) {
-   var i, existingAnnotations, insertionAnnotations, removesAnnotations,
+   var existingAnnotations, insertionAnnotations, removesAnnotations,
surfaceModel = this.surface.getModel(),
fragment = surfaceModel.getFragment(),
annotation = ve.dm.annotationFactory.create( name, data ),
@@ -90,10 +97,7 @@
 
if ( !fragment.getSelection().isCollapsed() ) {
if ( !fragment.getAnnotations().containsComparable( annotation 
) ) {
-   for ( i = removes.length - 1; i = 0; i-- ) {
-   fragment.annotateContent( 'clear', removes[i] );
-   }
-   fragment.annotateContent( 'set', name, data );
+   this.set( name, data );
} else {
fragment.annotateContent( 'clear', name );
}
diff --git a/tests/ui/actions/ve.ui.AnnotationAction.test.js 
b/tests/ui/actions/ve.ui.AnnotationAction.test.js
index 97a44c9..26762ca 100644
--- a/tests/ui/actions/ve.ui.AnnotationAction.test.js
+++ b/tests/ui/actions/ve.ui.AnnotationAction.test.js
@@ -24,7 +24,7 @@
 
 QUnit.test( 'toggle', function ( assert ) {
var i,
-   html 

[MediaWiki-commits] [Gerrit] Renamed wb.experts.EntityIdInput to wb.experts.EntityId - change (mediawiki...Wikibase)

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

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

Change subject: Renamed wb.experts.EntityIdInput to wb.experts.EntityId
..

Renamed wb.experts.EntityIdInput to wb.experts.EntityId

Change-Id: I0691153b60531125c360f8da3b952a17dd3e6e5f
---
R repo/resources/experts/Entity.js
M repo/resources/experts/getStore.js
M repo/resources/experts/resources.php
R repo/tests/qunit/experts/Entity.tests.js
M repo/tests/qunit/resources.php
5 files changed, 23 insertions(+), 31 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/27/177527/2

diff --git a/repo/resources/experts/EntityIdInput.js 
b/repo/resources/experts/Entity.js
similarity index 69%
rename from repo/resources/experts/EntityIdInput.js
rename to repo/resources/experts/Entity.js
index d2c8f1b..ceabd41 100644
--- a/repo/resources/experts/EntityIdInput.js
+++ b/repo/resources/experts/Entity.js
@@ -1,7 +1,3 @@
-/**
- * @licence GNU GPL v2+
- * @author Daniel Werner  daniel.wer...@wikimedia.de 
- */
 ( function( mw, wb, $, vv ) {
'use strict';
 
@@ -11,22 +7,20 @@
'P': 'property'
};
 
-   var MODULE = wb.experts;
-   var PARENT = vv.experts.StringValue;
+   var MODULE = wb.experts,
+   PARENT = vv.experts.StringValue;
 
/**
-* Valueview expert for wb.datamodel.EntityId. This is a simple expert, 
only handling the input,
-* based on the StringValue input but with the 
jQuery.wikibase.entityselector for convenience.
-*
-* @since 0.4
-*
-* @constructor
+* `valueview` `Expert` for specifying a reference to a Wikibase 
`Entity`.
+* @class wikibase.experts.Entity
 * @extends jQuery.valueview.experts.StringValue
+* @since 0.4
+* @licence GNU GPL v2+
+* @author Daniel Werner  daniel.wer...@wikimedia.de 
 */
-   MODULE.EntityIdInput = vv.expert( 'wikibaseentityidinput', PARENT, {
-
+   MODULE.Entity = vv.expert( 'wikibaseentity', PARENT, {
/**
-* @see Query.valueview.experts.StringValue._init
+* @inheritdoc
 */
_init: function() {
PARENT.prototype._init.call( this );
@@ -44,8 +38,8 @@
selectOnAutocomplete: true
} );
 
-   var value = this.viewState().value();
-   var entityId = value  value.getPrefixedId( 
WB_ENTITIES_PREFIXMAP );
+   var value = this.viewState().value(),
+   entityId = value  value.getPrefixedId( 
WB_ENTITIES_PREFIXMAP );
 
this.$input.data( 'entityselector' ).selectedEntity( 
entityId );
$input
@@ -59,7 +53,7 @@
},
 
/**
-* @see jQuery.valueview.Expert.destroy
+* @inheritdoc
 */
destroy: function() {
// Prevent error when issuing destroy twice:
@@ -75,9 +69,9 @@
},
 
/**
-* @see jQuery.valueview.Expert.rawValue
+* @inheritdoc
 *
-* @return string
+* @return {string}
 */
rawValue: function() {
var entitySelector = this.$input.data( 'entityselector' 
),
@@ -85,7 +79,6 @@
 
return selectedEntity ? selectedEntity.id : '';
}
-
} );
 
 }( mediaWiki, wikibase, jQuery, jQuery.valueview ) );
diff --git a/repo/resources/experts/getStore.js 
b/repo/resources/experts/getStore.js
index 02d933e..4e45357 100644
--- a/repo/resources/experts/getStore.js
+++ b/repo/resources/experts/getStore.js
@@ -14,7 +14,7 @@
var expertStore = new vv.ExpertStore( vv.experts.UnsupportedValue );
 
expertStore.registerDataValueExpert(
-   wb.experts.EntityIdInput,
+   wb.experts.Entity,
wb.datamodel.EntityId.TYPE
);
 
diff --git a/repo/resources/experts/resources.php 
b/repo/resources/experts/resources.php
index 6987418..d9d6871 100644
--- a/repo/resources/experts/resources.php
+++ b/repo/resources/experts/resources.php
@@ -40,13 +40,13 @@
'jquery.valueview.experts.UnsupportedValue',
'wikibase.datamodel.EntityId',
'wikibase.experts.__namespace',
-   'wikibase.experts.EntityIdInput',
+   'wikibase.experts.Entity',
),
),
 
-   'wikibase.experts.EntityIdInput' = $moduleTemplate + array(
+   'wikibase.experts.Entity' = $moduleTemplate + array(
 

[MediaWiki-commits] [Gerrit] Slimmed down Expert store initialization - change (mediawiki...Wikibase)

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

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

Change subject: Slimmed down Expert store initialization
..

Slimmed down Expert store initialization

Change-Id: Ief8668d6935b2149ebe6902a7ec97f0741515577
---
M repo/resources/experts/getStore.js
1 file changed, 15 insertions(+), 37 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/30/177530/2

diff --git a/repo/resources/experts/getStore.js 
b/repo/resources/experts/getStore.js
index 1d6a447..e88ae5d 100644
--- a/repo/resources/experts/getStore.js
+++ b/repo/resources/experts/getStore.js
@@ -36,44 +36,22 @@
// Register experts for data types defined in Wikibase. Since those 
data types are defined by a
// setting, it needs to be checked whether they are actually defined.
 
-   var commonsMediaType = dataTypeStore.getDataType( 'commonsMedia' );
-   if( commonsMediaType ) {
-   expertStore.registerDataTypeExpert(
-   vv.experts.CommonsMediaType,
-   commonsMediaType.getId()
-   );
-   }
+   var dataTypeIdToExpertConstructor = {
+   'commonsMedia': vv.experts.CommonsMediaType,
+   'monolingualtext': vv.experts.MonolingualText,
+   'url': vv.experts.StringValue,
+   'wikibase-item': wb.experts.Item,
+   'wikibase-property': wb.experts.Property
+   };
 
-   var monoTextType = dataTypeStore.getDataType( 'monolingualtext' );
-   if( monoTextType ) {
-   expertStore.registerDataTypeExpert(
-   vv.experts.MonolingualText,
-   monoTextType.getId()
-   );
-   }
-
-   var urlType = dataTypeStore.getDataType( 'url' );
-   if( urlType ) {
-   expertStore.registerDataTypeExpert(
-   vv.experts.StringValue,
-   urlType.getId()
-   );
-   }
-
-   var wikibaseItemType = dataTypeStore.getDataType( 'wikibase-item' );
-   if( wikibaseItemType ) {
-   expertStore.registerDataTypeExpert(
-   wb.experts.Item,
-   wikibaseItemType.getId()
-   );
-   }
-
-   var wikibasePropertyType = dataTypeStore.getDataType( 
'wikibase-property' );
-   if( wikibasePropertyType ) {
-   expertStore.registerDataTypeExpert(
-   wb.experts.Property,
-   wikibasePropertyType.getId()
-   );
+   for( var dataTypeId in dataTypeIdToExpertConstructor ) {
+   var dataType = dataTypeStore.getDataType( dataTypeId );
+   if( dataType ) {
+   expertStore.registerDataTypeExpert(
+   dataTypeIdToExpertConstructor[dataTypeId],
+   dataType.getId()
+   );
+   }
}
 
return expertStore;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief8668d6935b2149ebe6902a7ec97f0741515577
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater henning.sna...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] Spin off wb.experts.Item from wb.experts.Entity - change (mediawiki...Wikibase)

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

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

Change subject: Spin off wb.experts.Item from wb.experts.Entity
..

Spin off wb.experts.Item from wb.experts.Entity

Change-Id: I300a3abf0f10f0b3cf8048215ccd015e6e369fee
---
M repo/resources/experts/Entity.js
A repo/resources/experts/Item.js
M repo/resources/experts/getStore.js
M repo/resources/experts/resources.php
R repo/tests/qunit/experts/Item.tests.js
M repo/tests/qunit/resources.php
6 files changed, 94 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/28/177528/3

diff --git a/repo/resources/experts/Entity.js b/repo/resources/experts/Entity.js
index ceabd41..a6643d1 100644
--- a/repo/resources/experts/Entity.js
+++ b/repo/resources/experts/Entity.js
@@ -14,6 +14,8 @@
 * `valueview` `Expert` for specifying a reference to a Wikibase 
`Entity`.
 * @class wikibase.experts.Entity
 * @extends jQuery.valueview.experts.StringValue
+* @abstract
+* @uses jQuery.wikibase.entityselector
 * @since 0.4
 * @licence GNU GPL v2+
 * @author Daniel Werner  daniel.wer...@wikimedia.de 
@@ -21,28 +23,34 @@
MODULE.Entity = vv.expert( 'wikibaseentity', PARENT, {
/**
 * @inheritdoc
+*
+* @throws {Error} when called because this `Expert` is meant 
to be abstract.
 */
_init: function() {
+   throw new Error( 'Abstract Entity id expert cannot be 
instantiated directly' );
+   },
+
+   /**
+* @protected
+*/
+   _initEntityExpert: function() {
PARENT.prototype._init.call( this );
 
// FIXME: Use SuggestedStringValue
 
var notifier = this._viewNotifier,
-   $input = this.$input,
self = this,
repoConfig = mw.config.get( 'wbRepo' ),
repoApiUrl = repoConfig.url + 
repoConfig.scriptPath + '/api.php';
 
-   $input.entityselector( {
-   url: repoApiUrl,
-   selectOnAutocomplete: true
-   } );
+   this._initEntityselector( repoApiUrl );
 
var value = this.viewState().value(),
entityId = value  value.getPrefixedId( 
WB_ENTITIES_PREFIXMAP );
 
this.$input.data( 'entityselector' ).selectedEntity( 
entityId );
-   $input
+
+   this.$input
.on( 'eachchange.' + this.uiBaseClass, function( e ) {
$( this ).data( 'entityselector' 
).repositionMenu();
} )
@@ -53,6 +61,15 @@
},
 
/**
+* Initializes a `jQuery.wikibase.entityselector` instance on 
the `Expert`'s input element.
+* @abstract
+* @protected
+*
+* @param {string} repoApiUrl
+*/
+   _initEntityselector: util.abstractMember,
+
+   /**
 * @inheritdoc
 */
destroy: function() {
diff --git a/repo/resources/experts/Item.js b/repo/resources/experts/Item.js
new file mode 100644
index 000..de1aa37
--- /dev/null
+++ b/repo/resources/experts/Item.js
@@ -0,0 +1,40 @@
+( function( wb, vv ) {
+   'use strict';
+
+var MODULE = wb.experts,
+   PARENT = wb.experts.Entity;
+
+/**
+ * `valueview` `Expert` for specifying a reference to a Wikibase `Item`.
+ * @see jQuery.valueview.expert
+ * @see jQuery.valueview.Expert
+ * @class wikibase.experts.Item
+ * @extends wikibase.experts.Entity
+ * @uses jQuery.wikibase.entityselector
+ * @uses jQuery.valueview
+ * @since 0.5
+ * @licence GNU GPL v2+
+ * @author H. Snater  mediaw...@snater.com 
+ */
+MODULE.Item = vv.expert( 'wikibaseitem', PARENT, {
+   /**
+* @inheritdoc
+*/
+   _init: function() {
+   PARENT.prototype._initEntityExpert.call( this );
+   },
+
+   /**
+* @inheritdoc
+* @protected
+*/
+   _initEntityselector: function( repoApiUrl ) {
+   this.$input.entityselector( {
+   url: repoApiUrl,
+   type: 'item',
+   selectOnAutocomplete: true
+   } );
+   }
+} );
+
+}( wikibase, jQuery.valueview ) );
diff --git a/repo/resources/experts/getStore.js 
b/repo/resources/experts/getStore.js
index 4e45357..ef3a691 100644
--- a/repo/resources/experts/getStore.js
+++ b/repo/resources/experts/getStore.js
@@ -14,11 

[MediaWiki-commits] [Gerrit] Implemented wb.experts.Property - change (mediawiki...Wikibase)

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

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

Change subject: Implemented wb.experts.Property
..

Implemented wb.experts.Property

for referencing Wikibase Properties

Change-Id: I002bd7f50fc951838a97f473ac9e1207023e2064
---
A repo/resources/experts/Property.js
M repo/resources/experts/getStore.js
M repo/resources/experts/resources.php
A repo/tests/qunit/experts/Property.tests.js
M repo/tests/qunit/resources.php
5 files changed, 87 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/29/177529/3

diff --git a/repo/resources/experts/Property.js 
b/repo/resources/experts/Property.js
new file mode 100644
index 000..77b6897
--- /dev/null
+++ b/repo/resources/experts/Property.js
@@ -0,0 +1,40 @@
+( function( wb, vv ) {
+   'use strict';
+
+var MODULE = wb.experts,
+   PARENT = wb.experts.Entity;
+
+/**
+ * `valueview` `Expert` for specifying a reference to a Wikibase `Property`.
+ * @see jQuery.valueview.expert
+ * @see jQuery.valueview.Expert
+ * @class wikibase.experts.Property
+ * @extends wikibase.experts.Entity
+ * @uses jQuery.wikibase.entityselector
+ * @uses jQuery.valueview
+ * @since 0.5
+ * @licence GNU GPL v2+
+ * @author H. Snater  mediaw...@snater.com 
+ */
+MODULE.Property = vv.expert( 'wikibaseproperty', PARENT, {
+   /**
+* @inheritdoc
+*/
+   _init: function() {
+   PARENT.prototype._initEntityExpert.call( this );
+   },
+
+   /**
+* @inheritdoc
+* @protected
+*/
+   _initEntityselector: function( repoApiUrl ) {
+   this.$input.entityselector( {
+   url: repoApiUrl,
+   type: 'property',
+   selectOnAutocomplete: true
+   } );
+   }
+} );
+
+}( wikibase, jQuery.valueview ) );
diff --git a/repo/resources/experts/getStore.js 
b/repo/resources/experts/getStore.js
index ef3a691..1d6a447 100644
--- a/repo/resources/experts/getStore.js
+++ b/repo/resources/experts/getStore.js
@@ -68,6 +68,14 @@
);
}
 
+   var wikibasePropertyType = dataTypeStore.getDataType( 
'wikibase-property' );
+   if( wikibasePropertyType ) {
+   expertStore.registerDataTypeExpert(
+   wb.experts.Property,
+   wikibasePropertyType.getId()
+   );
+   }
+
return expertStore;
 
 };
diff --git a/repo/resources/experts/resources.php 
b/repo/resources/experts/resources.php
index c1d075c..8407599 100644
--- a/repo/resources/experts/resources.php
+++ b/repo/resources/experts/resources.php
@@ -41,6 +41,7 @@
'wikibase.datamodel.EntityId',
'wikibase.experts.__namespace',
'wikibase.experts.Item',
+   'wikibase.experts.Property',
),
),
 
@@ -69,6 +70,18 @@
'wikibase.experts.Entity',
),
),
+
+   'wikibase.experts.Property' = $moduleTemplate + array(
+   'scripts' = array(
+   'Property.js',
+   ),
+   'dependencies' = array(
+   'jquery.valueview.Expert',
+   'jquery.wikibase.entityselector',
+   'wikibase.experts.__namespace',
+   'wikibase.experts.Entity',
+   ),
+   ),
);
 
 } );
diff --git a/repo/tests/qunit/experts/Property.tests.js 
b/repo/tests/qunit/experts/Property.tests.js
new file mode 100644
index 000..7e1e144
--- /dev/null
+++ b/repo/tests/qunit/experts/Property.tests.js
@@ -0,0 +1,16 @@
+/**
+ * @licence GNU GPL v2+
+ * @author H. Snater  mediaw...@snater.com 
+ */
+( function( QUnit, valueview, wb ) {
+   'use strict';
+
+   var testExpert = valueview.tests.testExpert;
+
+   QUnit.module( 'wikibase.experts.Property' );
+
+   testExpert( {
+   expertConstructor: wb.experts.Property
+   } );
+
+}( QUnit, jQuery.valueview, wikibase ) );
diff --git a/repo/tests/qunit/resources.php b/repo/tests/qunit/resources.php
index 8334384..903193c 100644
--- a/repo/tests/qunit/resources.php
+++ b/repo/tests/qunit/resources.php
@@ -111,6 +111,16 @@
),
),
 
+   'wikibase.experts.Property.tests' = $moduleBase + array(
+   'scripts' = array(
+   'experts/Property.tests.js',
+   ),
+   'dependencies' = array(
+   'wikibase.experts.Property',
+   'wikibase.tests.qunit.testrunner',
+ 

[MediaWiki-commits] [Gerrit] Update cxserver on Beta - change (mediawiki...deploy)

2014-12-04 Thread KartikMistry (Code Review)
KartikMistry has uploaded a new change for review.

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

Change subject: Update cxserver on Beta
..

Update cxserver on Beta

Changes:
* 80dfe4d Refactor lineardoc module to multiple small files
* 918f51c MT: Subsequence extraction and mapping
*   6489523 Merge Add missing urd (Urdu) and hin (Hindi) mapping
|\
| * a41d053 Add missing urd (Urdu) and hin (Hindi) mapping
* |   8fbf85e Merge Fix registry/README.md
|\ \
| |/
|/|
| * 3b9424a Fix registry/README.md

Change-Id: I5126eee8a52ff0713475268fc180768818a1a3d5
---
M src
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/cxserver/deploy 
refs/changes/34/177534/1

diff --git a/src b/src
index 31d6559..80dfe4d 16
--- a/src
+++ b/src
-Subproject commit 31d6559bd993c32b81fb9dec8fe2d9dce044a017
+Subproject commit 80dfe4d426396704bcf1a4b6fb373878b5b7e33b

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5126eee8a52ff0713475268fc180768818a1a3d5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/cxserver/deploy
Gerrit-Branch: master
Gerrit-Owner: KartikMistry kartik.mis...@gmail.com

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


[MediaWiki-commits] [Gerrit] ULS width acccording to the number of languages - change (mediawiki...ContentTranslation)

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

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

Change subject: ULS width acccording to the number of languages
..

ULS width acccording to the number of languages

Change-Id: I369f879828315ca45c9fe9cf709ba6c81ae30ba0
---
M modules/source/ext.cx.source.selector.js
1 file changed, 19 insertions(+), 0 deletions(-)


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

diff --git a/modules/source/ext.cx.source.selector.js 
b/modules/source/ext.cx.source.selector.js
index 1b71fc5..7bbc243 100644
--- a/modules/source/ext.cx.source.selector.js
+++ b/modules/source/ext.cx.source.selector.js
@@ -51,6 +51,23 @@
}
 
/**
+* Return the appropriate menuWidth parameter for a given language count
+* @param {number} languagesCount Number of languages
+* return {string} wide, medium or narrow
+*/
+   function getUlsMenuWidth( languagesCount ) {
+   if ( languagesCount = 12 ) {
+   return 'narrow';
+   }
+
+   if ( languagesCount = 100 ) {
+   return 'medium';
+   }
+
+   return 'wide';
+   }
+
+   /**
 * Initialize the plugin.
 */
CXSourceSelector.prototype.init = function () {
@@ -147,6 +164,7 @@
// Create a new target ULS
this.$targetLanguage.uls( {
languages: getAutonyms( this.targetLanguages ),
+   menuWidth: getUlsMenuWidth( this.targetLanguages.length 
),
onSelect: function ( language ) {
cxSourceSelector.targetLanguageChangeHandler( 
language );
},
@@ -662,6 +680,7 @@
 
this.$sourceLanguage.uls( {
languages: getAutonyms( this.sourceLanguages ),
+   menuWidth: getUlsMenuWidth( this.sourceLanguages.length 
),
onSelect: function ( language ) {
cxSourceSelector.sourceLanguageChangeHandler( 
language );
},

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I369f879828315ca45c9fe9cf709ba6c81ae30ba0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
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] Bump version to 0.5-1 - change (analytics/webstatscollector)

2014-12-04 Thread Ottomata (Code Review)
Ottomata has uploaded a new change for review.

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

Change subject: Bump version to 0.5-1
..

Bump version to 0.5-1

Change-Id: Id2812b0db028ae3ba1424a389f2f66cc74e4c47a
---
M debian/changelog
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/webstatscollector 
refs/changes/35/177535/1

diff --git a/debian/changelog b/debian/changelog
index fd11ff0..f1988f2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+webstatscollector (0.5-1) precise-wikimedia; urgency=low
+
+  * Ignore traffic from cache-local SSL terminators.
+
+ -- Andrew Otto (WMF) o...@wikimedia.org  Wed, 03 Dec 2014 21:18:43 +
+
 webstatscollector (0.4-1) precise-wikimedia; urgency=low
 
   * Stop counting requests for undefined and Undefined.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2812b0db028ae3ba1424a389f2f66cc74e4c47a
Gerrit-PatchSet: 1
Gerrit-Project: analytics/webstatscollector
Gerrit-Branch: master
Gerrit-Owner: Ottomata o...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fix doc tags in EntityUsageTableBuilder - change (mediawiki...Wikibase)

2014-12-04 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review.

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

Change subject: Fix doc tags in EntityUsageTableBuilder
..

Fix doc tags in EntityUsageTableBuilder

Change-Id: Ib4fe26631aab3c7707e1f287f45f879ee656ab58
---
M client/includes/Usage/Sql/EntityUsageTableBuilder.php
M client/tests/phpunit/includes/Usage/Sql/EntityUsageTableBuilderTest.php
2 files changed, 7 insertions(+), 8 deletions(-)


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

diff --git a/client/includes/Usage/Sql/EntityUsageTableBuilder.php 
b/client/includes/Usage/Sql/EntityUsageTableBuilder.php
index c229794..25d73ed 100644
--- a/client/includes/Usage/Sql/EntityUsageTableBuilder.php
+++ b/client/includes/Usage/Sql/EntityUsageTableBuilder.php
@@ -89,7 +89,7 @@
/**
 * @param MessageReporter $progressReporter
 */
-   public function setProgressReporter( $progressReporter ) {
+   public function setProgressReporter( MessageReporter $progressReporter 
) {
$this-progressReporter = $progressReporter;
}
 
@@ -103,7 +103,7 @@
/**
 * @param ExceptionHandler $exceptionHandler
 */
-   public function setExceptionHandler( $exceptionHandler ) {
+   public function setExceptionHandler( ExceptionHandler $exceptionHandler 
) {
$this-exceptionHandler = $exceptionHandler;
}
 
@@ -224,8 +224,7 @@
$this-exceptionHandler-handleException(
$ex,
'badEntityId',
-   __METHOD__ .': ' .
-   'Failed to parse entity ID: ' .
+   __METHOD__ . ': ' . 'Failed to parse 
entity ID: ' .
$row-pp_value . ' at page ' .
$row-pp_page
);
diff --git 
a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableBuilderTest.php 
b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableBuilderTest.php
index 455e7f2..2a0d916 100644
--- a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableBuilderTest.php
+++ b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableBuilderTest.php
@@ -2,12 +2,12 @@
 
 namespace Wikibase\Client\Tests\Usage\Sql;
 
-use PHPUnit_Framework_MockObject_Matcher;
 use PHPUnit_Framework_MockObject_Matcher_Invocation;
 use Wikibase\Client\Usage\Sql\EntityUsageTableBuilder;
 use Wikibase\Client\WikibaseClient;
 use Wikibase\DataModel\Entity\BasicEntityIdParser;
 use Wikibase\Lib\Reporting\ExceptionHandler;
+use Wikibase\Lib\Reporting\MessageReporter;
 
 /**
  * @covers Wikibase\Client\Usage\Sql\EntityUsageTableBuilder
@@ -103,7 +103,7 @@
}
 
/**
-* @param PHPUnit_Framework_MockObject_Matcher $matcher
+* @param PHPUnit_Framework_MockObject_Matcher_Invocation $matcher
 *
 * @return ExceptionHandler
 */
@@ -116,9 +116,9 @@
}
 
/**
-* @param PHPUnit_Framework_MockObject_Matcher $matcher
+* @param PHPUnit_Framework_MockObject_Matcher_Invocation $matcher
 *
-* @return ExceptionHandler
+* @return MessageReporter
 */
private function getMessageReporter( 
PHPUnit_Framework_MockObject_Matcher_Invocation $matcher ) {
$mock = $this-getMock( 
'Wikibase\Lib\Reporting\MessageReporter' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4fe26631aab3c7707e1f287f45f879ee656ab58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] Bump version to 0.5-1 - change (analytics/webstatscollector)

2014-12-04 Thread QChris (Code Review)
QChris has submitted this change and it was merged.

Change subject: Bump version to 0.5-1
..


Bump version to 0.5-1

Change-Id: Id2812b0db028ae3ba1424a389f2f66cc74e4c47a
---
M debian/changelog
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  QChris: Looks good to me, approved



diff --git a/debian/changelog b/debian/changelog
index fd11ff0..f1988f2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+webstatscollector (0.5-1) precise-wikimedia; urgency=low
+
+  * Ignore traffic from cache-local SSL terminators.
+
+ -- Andrew Otto (WMF) o...@wikimedia.org  Wed, 03 Dec 2014 21:18:43 +
+
 webstatscollector (0.4-1) precise-wikimedia; urgency=low
 
   * Stop counting requests for undefined and Undefined.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id2812b0db028ae3ba1424a389f2f66cc74e4c47a
Gerrit-PatchSet: 1
Gerrit-Project: analytics/webstatscollector
Gerrit-Branch: master
Gerrit-Owner: Ottomata o...@wikimedia.org
Gerrit-Reviewer: QChris christ...@quelltextlich.at
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Render content of nowiki tags - change (mediawiki...BlueSpiceExtensions)

2014-12-04 Thread Mglaser (Code Review)
Mglaser has uploaded a new change for review.

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

Change subject: Render content of nowiki tags
..

Render content of nowiki tags

Content of nowiki tags is now rendered and editable. This is handled very
similar to pre tags, safe for lineendings. Selenium tests pass.

Bug: HW#201403121043
Change-Id: I89d355ef3795babdd4f1a282729e89547962903e
---
M VisualEditor/VisualEditor.class.php
M VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
2 files changed, 39 insertions(+), 3 deletions(-)


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

diff --git a/VisualEditor/VisualEditor.class.php 
b/VisualEditor/VisualEditor.class.php
index 0946a57..f002f97 100644
--- a/VisualEditor/VisualEditor.class.php
+++ b/VisualEditor/VisualEditor.class.php
@@ -296,6 +296,8 @@
if ($tag == 'pre')
continue;
$allowedTags .= $tag . '[*],';
+   if ($tag == 'nowiki')
+   continue;
$specialTags .= $tag . '|';
}
$allowedTags .= 'div[*],';
@@ -305,7 +307,7 @@
 
//TODO: There are duplicates!
$aDefaultTags = array(
-   syntaxhighlight, source, infobox, categorytree, 
nowiki,
+   syntaxhighlight, source, infobox, categorytree,
presentation, includeonly, onlyinclude, 
noinclude,
backlink, gallery, math, video, rss, 
tagcloud
);
diff --git a/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js 
b/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
index 083de05..7a36e45 100644
--- a/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
+++ b/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
@@ -35,6 +35,11 @@
 *
 * @type Array
 */
+   _nowikiTags,
+   /**
+*
+* @type Array
+*/
_templates,
/**
 *
@@ -1881,7 +1886,7 @@
 * @param {String} text
 * @returns {String}
 */
-   function _preservePres(text) {
+   function _preservePres(text, skipnowiki) {
var i;
 
_preTags = false;
@@ -1901,6 +1906,19 @@
text = text.replace(_preTagsSpace[i], 
@@@PRE_SPACE + i + @@@);
}
}
+
+   if ( skipnowiki ) return text;
+
+   _nowikiTags = false;
+   //
+   _nowikiTags = text.match(/nowiki([\S\s]*?)\/nowiki/gmi);
+   if (_nowikiTags) {
+   for (i = 0; i  _nowikiTags.length; i++) {
+   text = 
text.replace(_nowikiTags[i], @@@NOWIKI + i + @@@);
+   _nowikiTags[i] = 
_nowikiTags[i].replace( \n,  span class='single_linebreak' 
style='background-color:lightgray'para;\/span  );
+   }
+   }
+
 
return text;
}
@@ -1943,6 +1961,22 @@
}
}
_preTagsSpace = false;
+
+   //this is experimental support for nowiki
+   if (_nowikiTags) {
+   for (i = 0; i  _nowikiTags.length; i++) {
+   regex = '@@@NOWIKI' + i + '@@@';
+   replacer = new RegExp(regex, 
'gmi');
+
+   // \n works in IE. In FF, this 
is not neccessary.
+   if ( navigator.appName == 
'Microsoft Internet Explorer' ) {
+   text = 
text.replace(replacer, \n + _nowikiTags[i]);
+   } else {
+   text = 
text.replace(replacer, _nowikiTags[i]);
+   }
+   }
+   }
+   _nowikiTags = false;
 
return text;
}
@@ -2161,7 +2195,7 @@
}
 
text = _convertPreWithSpacesToTinyMce(text);
-   text = _preservePres(text);
+   text = _preservePres(text, false);
 
do {
_processFlag = false;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I89d355ef3795babdd4f1a282729e89547962903e
Gerrit-PatchSet: 1
Gerrit-Project: 

[MediaWiki-commits] [Gerrit] Update to Unicode 7.0.0 - change (unicodejs)

2014-12-04 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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

Change subject: Update to Unicode 7.0.0
..

Update to Unicode 7.0.0

Fix build script to match current output destination and format.

The rules for word break and grapheme break have not changed
since 6.3.0.

Change-Id: I061cbc2ebff60910b7eaf5dc3c796d5401e66cec
---
M src/unicodejs.graphemebreakproperties.js
M src/unicodejs.wordbreakproperties.js
M tools/unicodejs-properties.py
3 files changed, 9 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/unicodejs refs/changes/39/177539/1

diff --git a/src/unicodejs.graphemebreakproperties.js 
b/src/unicodejs.graphemebreakproperties.js
index 328cb91..c8c9724 100644
--- a/src/unicodejs.graphemebreakproperties.js
+++ b/src/unicodejs.graphemebreakproperties.js
@@ -3,10 +3,10 @@
 unicodeJS.graphemebreakproperties = {
CR: [0x000D],
LF: [0x000A],
-   Control: [[0x, 0x0009], [0x000B, 0x000C], [0x000E, 0x001F], 
[0x007F, 0x009F], 0x00AD, [0x0600, 0x0604], 0x061C, 0x06DD, 0x070F, 0x180E, 
0x200B, [0x200E, 0x200F], 0x2028, 0x2029, [0x202A, 0x202E], [0x2060, 0x2064], 
0x2065, [0x2066, 0x206F], 0xFEFF, [0xFFF0, 0xFFF8], [0xFFF9, 0xFFFB], 0x110BD, 
[0x1D173, 0x1D17A], 0xE, 0xE0001, [0xE0002, 0xE001F], [0xE0020, 0xE007F], 
[0xE0080, 0xE00FF], [0xE01F0, 0xE0FFF]],
-   Extend: [[0x0300, 0x036F], [0x0483, 0x0487], [0x0488, 0x0489], [0x0591, 
0x05BD], 0x05BF, [0x05C1, 0x05C2], [0x05C4, 0x05C5], 0x05C7, [0x0610, 0x061A], 
[0x064B, 0x065F], 0x0670, [0x06D6, 0x06DC], [0x06DF, 0x06E4], [0x06E7, 0x06E8], 
[0x06EA, 0x06ED], 0x0711, [0x0730, 0x074A], [0x07A6, 0x07B0], [0x07EB, 0x07F3], 
[0x0816, 0x0819], [0x081B, 0x0823], [0x0825, 0x0827], [0x0829, 0x082D], 
[0x0859, 0x085B], [0x08E4, 0x08FE], [0x0900, 0x0902], 0x093A, 0x093C, [0x0941, 
0x0948], 0x094D, [0x0951, 0x0957], [0x0962, 0x0963], 0x0981, 0x09BC, 0x09BE, 
[0x09C1, 0x09C4], 0x09CD, 0x09D7, [0x09E2, 0x09E3], [0x0A01, 0x0A02], 0x0A3C, 
[0x0A41, 0x0A42], [0x0A47, 0x0A48], [0x0A4B, 0x0A4D], 0x0A51, [0x0A70, 0x0A71], 
0x0A75, [0x0A81, 0x0A82], 0x0ABC, [0x0AC1, 0x0AC5], [0x0AC7, 0x0AC8], 0x0ACD, 
[0x0AE2, 0x0AE3], 0x0B01, 0x0B3C, 0x0B3E, 0x0B3F, [0x0B41, 0x0B44], 0x0B4D, 
0x0B56, 0x0B57, [0x0B62, 0x0B63], 0x0B82, 0x0BBE, 0x0BC0, 0x0BCD, 0x0BD7, 
[0x0C3E, 0x0C40], [0x0C46, 0x0C48], [0x0C4A, 0x0C4D], [0x0C55, 0x0C56], 
[0x0C62, 0x0C63], 0x0CBC, 0x0CBF, 0x0CC2, 0x0CC6, [0x0CCC, 0x0CCD], [0x0CD5, 
0x0CD6], [0x0CE2, 0x0CE3], 0x0D3E, [0x0D41, 0x0D44], 0x0D4D, 0x0D57, [0x0D62, 
0x0D63], 0x0DCA, 0x0DCF, [0x0DD2, 0x0DD4], 0x0DD6, 0x0DDF, 0x0E31, [0x0E34, 
0x0E3A], [0x0E47, 0x0E4E], 0x0EB1, [0x0EB4, 0x0EB9], [0x0EBB, 0x0EBC], [0x0EC8, 
0x0ECD], [0x0F18, 0x0F19], 0x0F35, 0x0F37, 0x0F39, [0x0F71, 0x0F7E], [0x0F80, 
0x0F84], [0x0F86, 0x0F87], [0x0F8D, 0x0F97], [0x0F99, 0x0FBC], 0x0FC6, [0x102D, 
0x1030], [0x1032, 0x1037], [0x1039, 0x103A], [0x103D, 0x103E], [0x1058, 
0x1059], [0x105E, 0x1060], [0x1071, 0x1074], 0x1082, [0x1085, 0x1086], 0x108D, 
0x109D, [0x135D, 0x135F], [0x1712, 0x1714], [0x1732, 0x1734], [0x1752, 0x1753], 
[0x1772, 0x1773], [0x17B4, 0x17B5], [0x17B7, 0x17BD], 0x17C6, [0x17C9, 0x17D3], 
0x17DD, [0x180B, 0x180D], 0x18A9, [0x1920, 0x1922], [0x1927, 0x1928], 0x1932, 
[0x1939, 0x193B], [0x1A17, 0x1A18], 0x1A1B, 0x1A56, [0x1A58, 0x1A5E], 0x1A60, 
0x1A62, [0x1A65, 0x1A6C], [0x1A73, 0x1A7C], 0x1A7F, [0x1B00, 0x1B03], 0x1B34, 
[0x1B36, 0x1B3A], 0x1B3C, 0x1B42, [0x1B6B, 0x1B73], [0x1B80, 0x1B81], [0x1BA2, 
0x1BA5], [0x1BA8, 0x1BA9], 0x1BAB, 0x1BE6, [0x1BE8, 0x1BE9], 0x1BED, [0x1BEF, 
0x1BF1], [0x1C2C, 0x1C33], [0x1C36, 0x1C37], [0x1CD0, 0x1CD2], [0x1CD4, 
0x1CE0], [0x1CE2, 0x1CE8], 0x1CED, 0x1CF4, [0x1DC0, 0x1DE6], [0x1DFC, 0x1DFF], 
[0x200C, 0x200D], [0x20D0, 0x20DC], [0x20DD, 0x20E0], 0x20E1, [0x20E2, 0x20E4], 
[0x20E5, 0x20F0], [0x2CEF, 0x2CF1], 0x2D7F, [0x2DE0, 0x2DFF], [0x302A, 0x302D], 
[0x302E, 0x302F], [0x3099, 0x309A], 0xA66F, [0xA670, 0xA672], [0xA674, 0xA67D], 
0xA69F, [0xA6F0, 0xA6F1], 0xA802, 0xA806, 0xA80B, [0xA825, 0xA826], 0xA8C4, 
[0xA8E0, 0xA8F1], [0xA926, 0xA92D], [0xA947, 0xA951], [0xA980, 0xA982], 0xA9B3, 
[0xA9B6, 0xA9B9], 0xA9BC, [0xAA29, 0xAA2E], [0xAA31, 0xAA32], [0xAA35, 0xAA36], 
0xAA43, 0xAA4C, 0xAAB0, [0xAAB2, 0xAAB4], [0xAAB7, 0xAAB8], [0xAABE, 0xAABF], 
0xAAC1, [0xAAEC, 0xAAED], 0xAAF6, 0xABE5, 0xABE8, 0xABED, 0xFB1E, [0xFE00, 
0xFE0F], [0xFE20, 0xFE26], [0xFF9E, 0xFF9F], 0x101FD, [0x10A01, 0x10A03], 
[0x10A05, 0x10A06], [0x10A0C, 0x10A0F], [0x10A38, 0x10A3A], 0x10A3F, 0x11001, 
[0x11038, 0x11046], [0x11080, 0x11081], [0x110B3, 0x110B6], [0x110B9, 0x110BA], 
[0x11100, 0x11102], [0x11127, 0x1112B], [0x1112D, 0x11134], [0x11180, 0x11181], 
[0x111B6, 0x111BE], 0x116AB, 0x116AD, [0x116B0, 0x116B5], 0x116B7, [0x16F8F, 
0x16F92], 0x1D165, [0x1D167, 0x1D169], [0x1D16E, 0x1D172], [0x1D17B, 0x1D182], 
[0x1D185, 0x1D18B], [0x1D1AA, 0x1D1AD], [0x1D242, 0x1D244], [0xE0100, 0xE01EF]],
+   Control: [[0x, 

[MediaWiki-commits] [Gerrit] $.wikibase.entityselector: Factored out _termMatchesLabel() - change (mediawiki...Wikibase)

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

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

Change subject: $.wikibase.entityselector: Factored out _termMatchesLabel()
..

$.wikibase.entityselector: Factored out _termMatchesLabel()

Change-Id: I92506c84238392c28b8f3109b88471ec718cbd8a
---
M lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
1 file changed, 15 insertions(+), 5 deletions(-)


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

diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
index 382b96e..99ac7fd 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
@@ -186,11 +186,7 @@
return;
}
 
-   var label = suggestions[0].label || 
suggestions[0].id;
-   if( label === requestTerm
-   || !self.options.caseSensitive
-label.toLowerCase() === 
requestTerm.toLowerCase()
-   ) {
+   if( self._termMatchesLabel( requestTerm, 
suggestions[0] ) ) {
self._select( suggestions[0] );
}
} );
@@ -198,6 +194,20 @@
},
 
/**
+* Determines whether a term matches a label considering the 
`caseSensitive` option.
+* @protected
+*
+* @param {string} term
+* @param {Object} suggestion
+* @return {boolean}
+*/
+   _termMatchesLabel: function( term, suggestion ) {
+   var label = suggestion.label || suggestion.id;
+   return label === term
+   || !this.options.caseSensitive  label.toLowerCase() 
=== term.toLowerCase();
+   },
+
+   /**
 * Create and return the data object for the api call.
 * @protected
 *

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I92506c84238392c28b8f3109b88471ec718cbd8a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater henning.sna...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] $.wikibase.entityselector: Updated code documentation - change (mediawiki...Wikibase)

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

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

Change subject: $.wikibase.entityselector: Updated code documentation
..

$.wikibase.entityselector: Updated code documentation

Change-Id: Id888b531b443b62fe58eedd5bf10d522581a4b2d
---
M lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
1 file changed, 106 insertions(+), 89 deletions(-)


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

diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
index f161f3a..382b96e 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
@@ -1,61 +1,3 @@
-/**
- * Wikibase entity selector
- * Enhances an input box with auto-complete and auto-suggestion functionality 
for Wikibase entities.
- * @since 0.2
- * @licence GNU GPL v2+
- * @author H. Snater  mediaw...@snater.com 
- *
- * @example $( 'input' ).entityselector( {
- *   url: {string} URL to the API of a MediaWiki instance running Wikibase 
repository,
- *   language: {string} language code of the language to fetch results in
- * } );
- *
- * @option {string} url (REQUIRED)
- * URL to retrieve results from.
- *
- * @option {string} language (REQUIRED, optional when in MediaWiki context)
- * Code of the language results shall be fetched in.
- * Default value: User language (when in MediaWiki context)
- *
- * @option {string} type
- * Entity type that will be queried for results.
- * Default value: 'item'
- *
- * @option {number|null} limit
- * Number of results to query the API for.
- * Default value: null (will pick limit specified server-side)
- *
- * @option {boolean} caseSensitive
- * Whether the widget shall consider letter case when determining if 
the first suggestion
- * matches with the current input triggering the select mechanism.
- * Default: false
- *
- * @option {number} timeout
- * Default AJAX timeout in milliseconds.
- * Default value: 8000
- *
- * @option messages {Object}
- * Strings used within the widget.
- * Messages should be specified using mwMsgOrString(resource loader 
module message key,
- * fallback message) in order to use the messages specified in the 
resource loader module
- * (if loaded).
- * - {string} messages['aliases-label']
- *   Label prepending the alias(es) if there is a search hit on at 
least one alias of an
- *   entity.
- *   Default value: 'also known as:'
- * - {string} messages['more']
- *   Label of the link to display more suggestions.
- *   Default value: 'more'
- *
- * @event selected
- *Triggered after having selected an entity.
- *Parameters: (1) {jQuery.Event}
- *(2) {string} Entity id
- *
- * @dependency jQuery.event.special.eachchange
- * @dependency jQuery.ui.ooMenu
- * @dependency jQuery.ui.suggester
- */
 ( function( $, util, mw ) {
'use strict';
 
@@ -63,13 +5,15 @@
 
 /**
  * Whether loaded in MediaWiki context.
- * @type {boolean}
+ * @property {boolean}
+ * @ignore
  */
 var IS_MW_CONTEXT = mw !== undefined  mw.msg;
 
 /**
- * Whether actual entity selector resource loader module is loaded.
- * @type {boolean}
+ * Whether actual `entityselector` resource loader module is loaded.
+ * @property {boolean}
+ * @ignore
  */
 var IS_MODULE_LOADED = (
IS_MW_CONTEXT
@@ -77,22 +21,76 @@
 );
 
 /**
- * Returns a message from the MediaWiki context if the entity selector module 
has been loaded.
+ * Returns a message from the MediaWiki context if the `entityselector` module 
has been loaded.
  * If it has not been loaded, the corresponding string defined in the options 
will be returned.
+ * @ignore
  *
- * @param {String} msgKey
- * @param {String} string
- * @return {String}
+ * @param {string} msgKey
+ * @param {string} string
+ * @return {string}
  */
 function mwMsgOrString( msgKey, string ) {
return IS_MODULE_LOADED ? mw.msg( msgKey ) : string;
 }
 
+/**
+ * Enhances an input box with auto-complete and auto-suggestion functionality 
for Wikibase entities.
+ *
+ * @example
+ * $( 'input' ).entityselector( {
+ * url: {string} URL to the API of a MediaWiki instance running 
Wikibase repository,
+ * language: {string} language code of the language to fetch results 
in
+ * } );
+ *
+ * @since 0.2
+ * @class jQuery.wikibase.entityselector
+ * @extends jQuery.ui.suggester
+ * @uses jQuery.event.special.eachchange
+ * @uses jQuery.ui.ooMenu
+ * @licence GNU GPL v2+
+ * @author H. Snater  mediaw...@snater.com 
+ *
+ * @constructor
+ *
+ * @param {Object} options
+ * @param {string} options.url
+ *

[MediaWiki-commits] [Gerrit] Ajax dispatcher methods need to return something - change (mediawiki...BlueSpiceExtensions)

2014-12-04 Thread Smuggli (Code Review)
Smuggli has uploaded a new change for review.

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

Change subject: Ajax dispatcher methods need to return something
..

Ajax dispatcher methods need to return something

Accidently removed return

Change-Id: I8dccc20fe003e5186a7ae1e25b386af446f90fe5
---
M ExtendedSearch/includes/ExtendedSearchAdmin.class.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/42/177542/1

diff --git a/ExtendedSearch/includes/ExtendedSearchAdmin.class.php 
b/ExtendedSearch/includes/ExtendedSearchAdmin.class.php
index 9b69a5d..b9592e7 100644
--- a/ExtendedSearch/includes/ExtendedSearchAdmin.class.php
+++ b/ExtendedSearch/includes/ExtendedSearchAdmin.class.php
@@ -67,7 +67,10 @@
case 'deleteLock':
$sOutput = 
ExtendedSearchAdmin::getInstance()-checkLockExistence( $sMode );
break;
+   default:
+   $sOutput = '';
}
+   return $sOutput;
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8dccc20fe003e5186a7ae1e25b386af446f90fe5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Smuggli mug...@hallowelt.biz

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


[MediaWiki-commits] [Gerrit] Use hasOwnProperty to check for existence of a property - change (mediawiki...Wikibase)

2014-12-04 Thread Gerrit Patch Uploader (Code Review)
Gerrit Patch Uploader has uploaded a new change for review.

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

Change subject: Use hasOwnProperty to check for existence of a property
..

Use hasOwnProperty to check for existence of a property

This avoids conflicts with predefined methods of objects.

Change-Id: I5e4b5121f59e68973875f1a4314be8bf71cec378
---
M repo/resources/wikibase.RevisionStore.js
1 file changed, 6 insertions(+), 6 deletions(-)


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

diff --git a/repo/resources/wikibase.RevisionStore.js 
b/repo/resources/wikibase.RevisionStore.js
index 504cf5d..ee30dac 100644
--- a/repo/resources/wikibase.RevisionStore.js
+++ b/repo/resources/wikibase.RevisionStore.js
@@ -57,20 +57,20 @@
 * Returns the sitelinks revision id.
 */
getSitelinksRevision: function( lang ) {
-   if( this._revisions.sitelinksRevision[lang] === undefined ) {
-   return this._revisions.baseRevision;
+   if( Object.prototype.hasOwnProperty.call( 
this._revisions.sitelinksRevision, lang ) ) {
+   return this._revisions.sitelinksRevision[lang];
}
-   return this._revisions.sitelinksRevision[lang];
+   return this._revisions.baseRevision;
},
 
/**
 * Returns the claim revision id.
 */
getClaimRevision: function( claimGuid ) {
-   if( this._revisions.claimRevisions[claimGuid] === undefined ) {
-   return this._revisions.baseRevision;
+   if( Object.prototype.hasOwnProperty.call( 
this._revisions.claimRevisions, claimGuid ) ) {
+   return this._revisions.claimRevisions[claimGuid];
}
-   return this._revisions.claimRevisions[claimGuid];
+   return this._revisions.baseRevision;
},
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e4b5121f59e68973875f1a4314be8bf71cec378
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader gerritpatchuploa...@gmail.com

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


[MediaWiki-commits] [Gerrit] Consume monotonic.py under GPLv2+ - change (mediawiki...EventLogging)

2014-12-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Consume monotonic.py under GPLv2+
..

Consume monotonic.py under GPLv2+

Ori aggreed that monotonic.py may be consumed under GPLv2+. This makes
licensing easier as it evades the Apache License 2.0 vs. GPLv2 issues.

Change-Id: Ie548fd77e8f05e659a99247e4de5d0bcc6034a39
---
M server/eventlogging/lib/monotonic.py
1 file changed, 11 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging 
refs/changes/44/177544/1

diff --git a/server/eventlogging/lib/monotonic.py 
b/server/eventlogging/lib/monotonic.py
index d6dff9f..bf1bdf6 100644
--- a/server/eventlogging/lib/monotonic.py
+++ b/server/eventlogging/lib/monotonic.py
@@ -25,17 +25,19 @@
 
   Copyright 2014 Ori Livneh o...@wikimedia.org
 
-  Licensed under the Apache License, Version 2.0 (the License);
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
 
-http://www.apache.org/licenses/LICENSE-2.0
+  This program 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.
 
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an AS IS BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
+  You should have received a copy of the GNU General Public License along
+  with this program; if not, write to the Free Software Foundation, Inc.,
+  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 
 from __future__ import absolute_import, division

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie548fd77e8f05e659a99247e4de5d0bcc6034a39
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: QChris christ...@quelltextlich.at

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


[MediaWiki-commits] [Gerrit] Avoid rehashing when building HashMaps in staticdata - change (apps...wikipedia)

2014-12-04 Thread Dbrant (Code Review)
Dbrant has submitted this change and it was merged.

Change subject: Avoid rehashing when building HashMaps in staticdata
..


Avoid rehashing when building HashMaps in staticdata

Setting load factor to 1, and capacity slightly larger than what we need.

Change-Id: Ifa6659306892415e4eb8dba934a5b00e1222d958
---
M scripts/templates/basichash.java.jinja
M wikipedia/src/main/java/org/wikipedia/staticdata/FileAliasData.java
M wikipedia/src/main/java/org/wikipedia/staticdata/MainPageNameData.java
M wikipedia/src/main/java/org/wikipedia/staticdata/SpecialAliasData.java
4 files changed, 276 insertions(+), 276 deletions(-)

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



diff --git a/scripts/templates/basichash.java.jinja 
b/scripts/templates/basichash.java.jinja
index bbb4440..652df98 100644
--- a/scripts/templates/basichash.java.jinja
+++ b/scripts/templates/basichash.java.jinja
@@ -11,8 +11,8 @@
 
 @SuppressWarnings({checkstyle:methodlength, SpellCheckingInspection})
 private static void setupData() {
-final int size = {{wikis|length}};
-DATA_MAP = new HashMapString, String(size);
+final int size = {{wikis|length + 1}};
+DATA_MAP = new HashMapString, String(size, 1.0f);
 
 {%- for wiki in wikis %}
 DATA_MAP.put({{wiki.lang}}, {{wiki.props[key]}});
diff --git 
a/wikipedia/src/main/java/org/wikipedia/staticdata/FileAliasData.java 
b/wikipedia/src/main/java/org/wikipedia/staticdata/FileAliasData.java
index 2ad4b11..242ef15 100644
--- a/wikipedia/src/main/java/org/wikipedia/staticdata/FileAliasData.java
+++ b/wikipedia/src/main/java/org/wikipedia/staticdata/FileAliasData.java
@@ -11,59 +11,59 @@
 
 @SuppressWarnings({checkstyle:methodlength, SpellCheckingInspection})
 private static void setupData() {
-final int size = 287;
-DATA_MAP = new HashMapString, String(size);
+final int size = 288;
+DATA_MAP = new HashMapString, String(size, 1.0f);
 DATA_MAP.put(en, File);
+DATA_MAP.put(sv, Fil);
 DATA_MAP.put(nl, Bestand);
 DATA_MAP.put(de, Datei);
-DATA_MAP.put(sv, Fil);
 DATA_MAP.put(fr, Fichier);
-DATA_MAP.put(it, File);
+DATA_MAP.put(war, Paypay);
+DATA_MAP.put(ceb, Payl);
 DATA_MAP.put(ru, Файл);
+DATA_MAP.put(it, File);
 DATA_MAP.put(es, Archivo);
 DATA_MAP.put(vi, Tập tin);
-DATA_MAP.put(war, Paypay);
 DATA_MAP.put(pl, Plik);
-DATA_MAP.put(ceb, Payl);
 DATA_MAP.put(ja, ファイル);
 DATA_MAP.put(pt, Ficheiro);
 DATA_MAP.put(zh, File);
 DATA_MAP.put(uk, Файл);
 DATA_MAP.put(ca, Fitxer);
-DATA_MAP.put(no, Fil);
 DATA_MAP.put(fa, پرونده);
+DATA_MAP.put(no, Fil);
 DATA_MAP.put(fi, Tiedosto);
 DATA_MAP.put(id, Berkas);
-DATA_MAP.put(cs, Soubor);
 DATA_MAP.put(ar, ملف);
+DATA_MAP.put(sr, Датотека);
+DATA_MAP.put(cs, Soubor);
 DATA_MAP.put(ko, 파일);
+DATA_MAP.put(sh, Datoteka);
 DATA_MAP.put(ms, Fail);
 DATA_MAP.put(hu, Fájl);
-DATA_MAP.put(sr, Датотека);
 DATA_MAP.put(ro, Fișier);
 DATA_MAP.put(tr, Dosya);
 DATA_MAP.put(min, Berkas);
 DATA_MAP.put(kk, Сурет);
 DATA_MAP.put(eo, Dosiero);
-DATA_MAP.put(sh, Datoteka);
+DATA_MAP.put(eu, Fitxategi);
 DATA_MAP.put(sk, Súbor);
 DATA_MAP.put(da, Fil);
-DATA_MAP.put(eu, Fitxategi);
-DATA_MAP.put(lt, Vaizdas);
 DATA_MAP.put(bg, Файл);
+DATA_MAP.put(lt, Vaizdas);
 DATA_MAP.put(he, קובץ);
 DATA_MAP.put(hr, Datoteka);
 DATA_MAP.put(sl, Slika);
-DATA_MAP.put(uz, Fayl);
-DATA_MAP.put(et, Pilt);
 DATA_MAP.put(hy, Պատկեր);
+DATA_MAP.put(et, Pilt);
+DATA_MAP.put(uz, Fayl);
 DATA_MAP.put(vo, Ragiv);
-DATA_MAP.put(nn, Fil);
-DATA_MAP.put(gl, Ficheiro);
 DATA_MAP.put(simple, File);
+DATA_MAP.put(gl, Ficheiro);
+DATA_MAP.put(nn, Fil);
 DATA_MAP.put(hi, चित्र);
-DATA_MAP.put(la, Fasciculus);
 DATA_MAP.put(el, Αρχείο);
+DATA_MAP.put(la, Fasciculus);
 DATA_MAP.put(az, Şəkil);
 DATA_MAP.put(th, ไฟล์);
 DATA_MAP.put(oc, Fichièr);
@@ -71,83 +71,83 @@
 DATA_MAP.put(mk, Податотека);
 DATA_MAP.put(be, Файл);
 DATA_MAP.put(new, किपा);
+DATA_MAP.put(ce, Файл);
+DATA_MAP.put(ta, படிமம்);
 DATA_MAP.put(tt, Файл);
 DATA_MAP.put(pms, Figura);
 DATA_MAP.put(tl, Talaksan);
-DATA_MAP.put(ta, படிமம்);
-DATA_MAP.put(te, దస్త్రం);
+DATA_MAP.put(ur, ملف);
 DATA_MAP.put(cy, Delwedd);
+DATA_MAP.put(te, దస్త్రం);
 DATA_MAP.put(lv, Attēls);
+DATA_MAP.put(bs, Datoteka);
 

[MediaWiki-commits] [Gerrit] UniversalExport: Fixed permission error for special pages - change (mediawiki...BlueSpiceExtensions)

2014-12-04 Thread Smuggli (Code Review)
Smuggli has submitted this change and it was merged.

Change subject: UniversalExport: Fixed permission error for special pages
..


UniversalExport: Fixed permission error for special pages

* Used isAllowed instead of userCan if requested title is a special page
* Added descriptiom

Change-Id: Idef3128d6dc9e297bedaa8324adfef6b076a7ccc
---
M UniversalExport/includes/specials/SpecialUniversalExport.class.php
1 file changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/UniversalExport/includes/specials/SpecialUniversalExport.class.php 
b/UniversalExport/includes/specials/SpecialUniversalExport.class.php
index ae9e094..0c445c7 100644
--- a/UniversalExport/includes/specials/SpecialUniversalExport.class.php
+++ b/UniversalExport/includes/specials/SpecialUniversalExport.class.php
@@ -132,7 +132,12 @@

BsUniversalExportHelper::getParamsFromQueryString( 
$this-aParams );
 
-   if ( $this-oRequestedTitle-userCan( 
'universalexport-export' ) === false ) {
+   //Title::userCan always returns false on special pages 
(exept for createaccount action)
+   if( $this-oRequestedTitle-getNamespace() === 
NS_SPECIAL ) {
+   if( 
$this-getUser()-isAllowed('universalexport-export') !== true ){
+   throw new Exception( 
'bs-universalexport-error-permission');
+   }
+   } elseif( $this-oRequestedTitle-userCan( 
'universalexport-export' ) === false ) {
throw new Exception( 
'bs-universalexport-error-permission');
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idef3128d6dc9e297bedaa8324adfef6b076a7ccc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_22
Gerrit-Owner: Pwirth wi...@hallowelt.biz
Gerrit-Reviewer: Mglaser gla...@hallowelt.biz
Gerrit-Reviewer: Pigpen reym...@hallowelt.biz
Gerrit-Reviewer: Robert Vogel vo...@hallowelt.biz
Gerrit-Reviewer: Smuggli mug...@hallowelt.biz
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Added new Maintenance base classes - change (mediawiki...BlueSpiceFoundation)

2014-12-04 Thread Smuggli (Code Review)
Smuggli has submitted this change and it was merged.

Change subject: Added new Maintenance base classes
..


Added new Maintenance base classes

* Also removed legacy Code

Change-Id: Ib49d6a6375204514eeac2b44517d157641ef8422
---
A maintenance/BSBatchFileProcessorBase.php
D maintenance/BSMigrationHelper.php
A maintenance/BSRemoteAPIBase.php
3 files changed, 253 insertions(+), 504 deletions(-)

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



diff --git a/maintenance/BSBatchFileProcessorBase.php 
b/maintenance/BSBatchFileProcessorBase.php
new file mode 100644
index 000..1dbdc86
--- /dev/null
+++ b/maintenance/BSBatchFileProcessorBase.php
@@ -0,0 +1,112 @@
+?php
+
+require_once( __DIR_.'/BSMaintenance.php' );
+
+abstract class BSBatchFileProcessorBase extends BSMaintenance {
+
+   protected $sSrc = '';
+   protected $sDest = __DIR__;
+   protected $oCurrentFile = null;
+   protected $aFiles = array();
+   protected $aFileExtensionWhitelist = array();
+   protected $aErrors = array();
+
+   public function __construct() {
+   parent::__construct();
+
+   $this-addOption('src', 'The path to the source directory', 
false, true);
+   $this-addOption('dest', 'The path to the destination 
directory', false, true);
+
+   $this-aFileExtensionWhitelist = array_map(
+   'strtoupper', $this-aFileExtensionWhitelist
+   );
+   }
+
+   public function execute() {
+   //wfCountDown( 5 );
+
+   $this-sSrc = $this-getOption( 'src', $this-sSrc );
+   $this-sDest = $this-getOption( 'dest', $this-sDest );
+
+   $aFiles = $this-getFileList();
+
+   $iProcessedFiles = 0;
+   foreach( $aFiles as $sFileName = $oFile ) {
+   if( $oFile instanceof SplFileInfo !== true ) {
+   $this-error( 'Could not process list item: '
+   . $sFileName . ' '
+   . var_export( $oFile, true )
+   );
+   continue;
+   }
+   $this-output( 'Processing ' . $oFile-getPathname().' 
...' );
+   $mResult = $this-processFile( $oFile );
+   if ( $mResult !== true ) {
+   $this-error( '... error:' . $mResult );
+   }
+   else {
+   $this-output( '... done.' );
+   $iProcessedFiles++;
+   }
+   }
+
+   $this-output( $iProcessedFiles.' file(s) processed.' );
+   $this-output( count($this-aErrors).' errors(s) occured.' );
+   if( count( $this-aErrors )  0 ) {
+   $this-output(
+   implode( \n, $this-aErrors )
+   );
+   }
+   }
+
+   /**
+* Throw an error to the user. Doesn't respect --quiet, so don't use
+* this for non-error output
+*
+* BSMaintenance: Public to allow hook callbacks to write output.
+* @param $err String: the error to display
+* @param $die Int: if  0, go ahead and die out using this int as the 
code
+*/
+   public function error( $err, $die = 0 ) {
+   $this-aErrors[] = $err;
+   parent::error( $err, $die );
+   }
+
+   /**
+*
+* @return array\RecursiveIteratorIterator
+*/
+   public function getFileList() {
+   $sPath = realpath( $this-sSrc );
+   $this-output( 'Fetching file list from '.$sPath.' ...' );
+
+   $oFiles = new RecursiveIteratorIterator(
+   new RecursiveDirectoryIterator( $sPath ),
+   RecursiveIteratorIterator::SELF_FIRST
+   );
+
+   $aFiles = array();
+   foreach ( $oFiles as $sPath = $oFile ) {
+   if( $oFile instanceof SplFileInfo === false ) {
+   $this-error( 'Not a valid SplFileInfo object: 
' . $sPath );
+   }
+   if( !empty( $this-aFileExtensionWhitelist ) ) {
+   $sFileExt = strtoupper( $oFile-getExtension() 
);
+   if( !in_array( $sFileExt, 
$this-aFileExtensionWhitelist ) ) {
+   continue;
+   }
+   }
+   $aFiles[$oFile-getFilename()] = $oFile;
+   }
+
+   ksort($aFiles, SORT_NATURAL);
+   $this-output( '... found ' . count( $aFiles ) . ' file(s).' );
+   return $aFiles;
+   }
+
+  

[MediaWiki-commits] [Gerrit] [WIP] Only return CORS headers in the response as required - change (mediawiki/core)

2014-12-04 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

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

Change subject: [WIP] Only return CORS headers in the response as required
..

[WIP] Only return CORS headers in the response as required

- Really, totally, Untested.
- Split out responses of preflight and actual CORS requests
- If the request is not CORS valid, don't set the CORS response headers

Note that invalid CORS requests should not actually throw error
responses, the client should simply not handle the response because the
response does not have the right headers (it's a client side policy
error not an http error). We do throw a 403 for a mismatch with the
queryparam, but since that is 'outside' of the spec, that might be
appropriate.

Bug: T76701
Change-Id: Ib296c68babe5c0b380268ee7793b3d6d35b9c3e3
---
M includes/api/ApiMain.php
1 file changed, 17 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/45/177545/1

diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php
index 3d04f95..d038fb2 100644
--- a/includes/api/ApiMain.php
+++ b/includes/api/ApiMain.php
@@ -498,12 +498,28 @@
 
$request = $this-getRequest();
$response = $request-response();
+
// Origin: header is a space-separated list of origins, check 
all of them
$originHeader = $request-getHeader( 'Origin' );
if ( $originHeader === false ) {
-   $origins = array();
+   // Origin header is required for any CORS headers on 
the response 
+   return true;
} else {
$origins = explode( ' ', $originHeader );
+   }
+
+   $requestedMethod = $request-getHeader( 
'Access-Control-Request-Method' );
+   if ( $request-getMethod() === 'OPTIONS'  $requestedMethod 
!== false ) {
+   // This is a CORS preflight request
+   if ( $requestedMethod === 'POST' || $requestedMethod 
=== 'GET' ) {
+   // We only allow the actual request to be GET 
or POST
+   $response-header( 
'Access-Control-Allow-Methods: POST, GET' );
+
+   // We allow the actual request to send the 
following headers
+   $response-header( 
'Access-Control-Allow-Headers: Api-User-Agent' );
+   } else {
+   return true;
+   }
}
 
if ( !in_array( $originParam, $origins ) ) {
@@ -527,7 +543,6 @@
if ( $matchOrigin ) {
$response-header( Access-Control-Allow-Origin: 
$originParam );
$response-header( 'Access-Control-Allow-Credentials: 
true' );
-   $response-header( 'Access-Control-Allow-Headers: 
Api-User-Agent' );
$this-getOutput()-addVaryHeader( 'Origin' );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib296c68babe5c0b380268ee7793b3d6d35b9c3e3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ hartman.w...@gmail.com

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


[MediaWiki-commits] [Gerrit] Rename all webrequest varnishkafka instances as 'webrequest' - change (operations/puppet)

2014-12-04 Thread Ottomata (Code Review)
Ottomata has uploaded a new change for review.

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

Change subject: Rename all webrequest varnishkafka instances as 'webrequest'
..

Rename all webrequest varnishkafka instances as 'webrequest'

This standardizes the varnishkafka conf and stats files to have the
same name across all webrequest (frontend + bits) instances.
Previously, frontend confs were named frontend.conf, and bits
confs were named $::hostname.conf.  This makes it easier to
know which varnish instance is logging 'webrequests' and
also which stats.json files one should look in for stats about
webrequest varnishkafkas.

Change-Id: I0337ede6cd9c9022a5f4d6ebc05f032ddb428bef
---
M manifests/role/cache.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/46/177546/1

diff --git a/manifests/role/cache.pp b/manifests/role/cache.pp
index 58bad22..29c2400 100644
--- a/manifests/role/cache.pp
+++ b/manifests/role/cache.pp
@@ -413,7 +413,7 @@
 $varnish_name = 'frontend'
 ) inherits role::cache::varnish::kafka
 {
-varnishkafka::instance { $varnish_name:
+varnishkafka::instance { 'webrequest':
 brokers  = $kafka_brokers,
 topic= $topic,
 format_type  = 'json',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0337ede6cd9c9022a5f4d6ebc05f032ddb428bef
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata o...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Added linkt to BlueSpice Shop - change (mediawiki...BlueSpiceExtensions)

2014-12-04 Thread Smuggli (Code Review)
Smuggli has uploaded a new change for review.

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

Change subject: Added linkt to BlueSpice Shop
..

Added linkt to BlueSpice Shop

* Removed some unreachable statements

Change-Id: I235db5e1f0da315ade25265f9c5a90d45159ec7b
---
M WikiAdmin/WikiAdmin.class.php
1 file changed, 19 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/47/177547/1

diff --git a/WikiAdmin/WikiAdmin.class.php b/WikiAdmin/WikiAdmin.class.php
index 4eaa0f4..fea9cc0 100644
--- a/WikiAdmin/WikiAdmin.class.php
+++ b/WikiAdmin/WikiAdmin.class.php
@@ -107,15 +107,10 @@
public static function get( $name ) {
switch ( $name ) {
case 'ExcludeGroups': return self::$prExcludeGroups;
-   break;
case 'ExcludeDeleteGroups': return 
self::$prExcludeDeleteGroups;
-   break;
case 'ExcludeRights': return self::$prExcludeRights;
-   break;
case 'CommonRights': return self::$prCommonRights;
-   break;
case 'HardPerms': return self::$prHardPerms;
-   break;
}
return null;
}
@@ -221,6 +216,8 @@
$aOutSortable[$sModulLabel] = 'li'.$sLink.'/li';
}
 
+   $aOutSortable['Shop'] = self::getShopLink();
+
ksort( $aOutSortable );
$aOut[] = implode( \n, $aOutSortable ).'/ul';
$aOut[] = '/ul';
@@ -237,4 +234,21 @@
}
return true;
}
+
+   /**
+* Returns a link to the BlueSpice shop
+* @return string Link to the shop
+*/
+   private static function getShopLink() {
+   $sLink = Html::element(
+   'a',
+   array(
+   'id' = 'bs-admin-shop',
+   'href' = 'http://shop.blue-spice.org/',
+   'title' = 'BlueSpice Shop'
+   ),
+   'Shop'
+   );
+   return $sLink;
+   }
 }
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I235db5e1f0da315ade25265f9c5a90d45159ec7b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Smuggli mug...@hallowelt.biz

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


[MediaWiki-commits] [Gerrit] Remove unnecessary indentation level in $.wikibase.entitysel... - change (mediawiki...Wikibase)

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

Change subject: Remove unnecessary indentation level in 
$.wikibase.entityselector
..


Remove unnecessary indentation level in $.wikibase.entityselector

Change-Id: I81130d7c823d39865cf7d9488e0bae36c737d15e
---
M lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
1 file changed, 339 insertions(+), 339 deletions(-)

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



diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
index 6acd6a2..f161f3a 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
@@ -59,383 +59,383 @@
 ( function( $, util, mw ) {
'use strict';
 
-   // TODO: Get rid of MediaWiki context detection by submitting a message 
provider as option.
+// TODO: Get rid of MediaWiki context detection by submitting a message 
provider as option.
+
+/**
+ * Whether loaded in MediaWiki context.
+ * @type {boolean}
+ */
+var IS_MW_CONTEXT = mw !== undefined  mw.msg;
+
+/**
+ * Whether actual entity selector resource loader module is loaded.
+ * @type {boolean}
+ */
+var IS_MODULE_LOADED = (
+   IS_MW_CONTEXT
+$.inArray( 'jquery.wikibase.entityselector', 
mw.loader.getModuleNames() ) !== -1
+);
+
+/**
+ * Returns a message from the MediaWiki context if the entity selector module 
has been loaded.
+ * If it has not been loaded, the corresponding string defined in the options 
will be returned.
+ *
+ * @param {String} msgKey
+ * @param {String} string
+ * @return {String}
+ */
+function mwMsgOrString( msgKey, string ) {
+   return IS_MODULE_LOADED ? mw.msg( msgKey ) : string;
+}
+
+$.widget( 'wikibase.entityselector', $.ui.suggester, {
 
/**
-* Whether loaded in MediaWiki context.
-* @type {boolean}
+* Options
+* @type {Object}
 */
-   var IS_MW_CONTEXT = mw !== undefined  mw.msg;
+   options: {
+   url: null,
+   language: ( IS_MW_CONTEXT ) ? mw.config.get( 'wgUserLanguage' ) 
: null,
+   type: 'item',
+   limit: null,
+   caseSensitive: false,
+   timeout: 8000,
+   messages: {
+   'aliases-label': mwMsgOrString( 
'wikibase-aliases-label', 'also known as:' ),
+   'more': mwMsgOrString( 'wikibase-entityselector-more', 
'more' )
+   }
+   },
 
/**
-* Whether actual entity selector resource loader module is loaded.
-* @type {boolean}
+* Caching the most current entity returned from the API.
+* @type {Object}
 */
-   var IS_MODULE_LOADED = (
-   IS_MW_CONTEXT
-$.inArray( 'jquery.wikibase.entityselector', 
mw.loader.getModuleNames() ) !== -1
-   );
+   _selectedEntity: null,
 
/**
-* Returns a message from the MediaWiki context if the entity selector 
module has been loaded.
-* If it has not been loaded, the corresponding string defined in the 
options will be returned.
-*
-* @param {String} msgKey
-* @param {String} string
-* @return {String}
+* Caches retrieved results.
+* @type {Object}
 */
-   function mwMsgOrString( msgKey, string ) {
-   return IS_MODULE_LOADED ? mw.msg( msgKey ) : string;
-   }
+   _cache: null,
 
-   $.widget( 'wikibase.entityselector', $.ui.suggester, {
+   /**
+* @see ui.suggester._create
+*/
+   _create: function() {
+   var self = this;
 
-   /**
-* Options
-* @type {Object}
-*/
-   options: {
-   url: null,
-   language: ( IS_MW_CONTEXT ) ? mw.config.get( 
'wgUserLanguage' ) : null,
-   type: 'item',
-   limit: null,
-   caseSensitive: false,
-   timeout: 8000,
-   messages: {
-   'aliases-label': mwMsgOrString( 
'wikibase-aliases-label', 'also known as:' ),
-   'more': mwMsgOrString( 
'wikibase-entityselector-more', 'more' )
+   this._cache = {};
+
+   if( !this.options.source ) {
+   if( this.options.url === null ) {
+   throw new Error( 'When not specifying a 
dedicated source, URL option needs to '
+   + 'be specified' );
+   } else if( this.options.language === null ) {
+   throw new Error( 'When not specifying a 
dedicated source, language option '
+ 

[MediaWiki-commits] [Gerrit] $.wikibase.entityselector: Updated code documentation - change (mediawiki...Wikibase)

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

Change subject: $.wikibase.entityselector: Updated code documentation
..


$.wikibase.entityselector: Updated code documentation

Change-Id: Id888b531b443b62fe58eedd5bf10d522581a4b2d
---
M lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
1 file changed, 106 insertions(+), 89 deletions(-)

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



diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
index f161f3a..382b96e 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
@@ -1,61 +1,3 @@
-/**
- * Wikibase entity selector
- * Enhances an input box with auto-complete and auto-suggestion functionality 
for Wikibase entities.
- * @since 0.2
- * @licence GNU GPL v2+
- * @author H. Snater  mediaw...@snater.com 
- *
- * @example $( 'input' ).entityselector( {
- *   url: {string} URL to the API of a MediaWiki instance running Wikibase 
repository,
- *   language: {string} language code of the language to fetch results in
- * } );
- *
- * @option {string} url (REQUIRED)
- * URL to retrieve results from.
- *
- * @option {string} language (REQUIRED, optional when in MediaWiki context)
- * Code of the language results shall be fetched in.
- * Default value: User language (when in MediaWiki context)
- *
- * @option {string} type
- * Entity type that will be queried for results.
- * Default value: 'item'
- *
- * @option {number|null} limit
- * Number of results to query the API for.
- * Default value: null (will pick limit specified server-side)
- *
- * @option {boolean} caseSensitive
- * Whether the widget shall consider letter case when determining if 
the first suggestion
- * matches with the current input triggering the select mechanism.
- * Default: false
- *
- * @option {number} timeout
- * Default AJAX timeout in milliseconds.
- * Default value: 8000
- *
- * @option messages {Object}
- * Strings used within the widget.
- * Messages should be specified using mwMsgOrString(resource loader 
module message key,
- * fallback message) in order to use the messages specified in the 
resource loader module
- * (if loaded).
- * - {string} messages['aliases-label']
- *   Label prepending the alias(es) if there is a search hit on at 
least one alias of an
- *   entity.
- *   Default value: 'also known as:'
- * - {string} messages['more']
- *   Label of the link to display more suggestions.
- *   Default value: 'more'
- *
- * @event selected
- *Triggered after having selected an entity.
- *Parameters: (1) {jQuery.Event}
- *(2) {string} Entity id
- *
- * @dependency jQuery.event.special.eachchange
- * @dependency jQuery.ui.ooMenu
- * @dependency jQuery.ui.suggester
- */
 ( function( $, util, mw ) {
'use strict';
 
@@ -63,13 +5,15 @@
 
 /**
  * Whether loaded in MediaWiki context.
- * @type {boolean}
+ * @property {boolean}
+ * @ignore
  */
 var IS_MW_CONTEXT = mw !== undefined  mw.msg;
 
 /**
- * Whether actual entity selector resource loader module is loaded.
- * @type {boolean}
+ * Whether actual `entityselector` resource loader module is loaded.
+ * @property {boolean}
+ * @ignore
  */
 var IS_MODULE_LOADED = (
IS_MW_CONTEXT
@@ -77,22 +21,76 @@
 );
 
 /**
- * Returns a message from the MediaWiki context if the entity selector module 
has been loaded.
+ * Returns a message from the MediaWiki context if the `entityselector` module 
has been loaded.
  * If it has not been loaded, the corresponding string defined in the options 
will be returned.
+ * @ignore
  *
- * @param {String} msgKey
- * @param {String} string
- * @return {String}
+ * @param {string} msgKey
+ * @param {string} string
+ * @return {string}
  */
 function mwMsgOrString( msgKey, string ) {
return IS_MODULE_LOADED ? mw.msg( msgKey ) : string;
 }
 
+/**
+ * Enhances an input box with auto-complete and auto-suggestion functionality 
for Wikibase entities.
+ *
+ * @example
+ * $( 'input' ).entityselector( {
+ * url: {string} URL to the API of a MediaWiki instance running 
Wikibase repository,
+ * language: {string} language code of the language to fetch results 
in
+ * } );
+ *
+ * @since 0.2
+ * @class jQuery.wikibase.entityselector
+ * @extends jQuery.ui.suggester
+ * @uses jQuery.event.special.eachchange
+ * @uses jQuery.ui.ooMenu
+ * @licence GNU GPL v2+
+ * @author H. Snater  mediaw...@snater.com 
+ *
+ * @constructor
+ *
+ * @param {Object} options
+ * @param {string} options.url
+ *URL to retrieve results from.
+ * @param {string} 

[MediaWiki-commits] [Gerrit] Address exceptions in computation logic - change (phabricator...Sprint)

2014-12-04 Thread Christopher Johnson (WMDE) (Code Review)
Christopher Johnson (WMDE) has uploaded a new change for review.

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

Change subject: Address exceptions in computation logic
..

Address exceptions in computation logic

Progress commit, still a few bugs left

Change-Id: I0cfedaac38fbc31c057583a1686195d4a9d7dbf7
---
M src/__phutil_library_map__.php
M src/storage/SprintBuildStats.php
M src/storage/SprintTransaction.php
M src/util/BurndownDataDate.php
M src/view/BurndownDataView.php
M src/view/EventTableView.php
A src/view/HistoryTableView.php
M src/view/SprintTableView.php
M src/view/TasksTableView.php
9 files changed, 361 insertions(+), 226 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/phabricator/extensions/Sprint 
refs/changes/48/177548/1

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
index e5cd7a1..ec29c2c 100644
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -20,6 +20,7 @@
 'CeleritySprintResources' = 'celerity/CeleritySprintResources.php',
 'DateIterator' = 'tests/DateIterator.php',
 'EventTableView' = 'view/EventTableView.php',
+'HistoryTableView' = 'view/HistoryTableView.php',
 'OpenTasksView' = 'view/OpenTasksView.php',
 'ProjectOpenTasksView' = 'view/ProjectOpenTasksView.php',
 'SprintApplication' = 'application/SprintApplication.php',
diff --git a/src/storage/SprintBuildStats.php b/src/storage/SprintBuildStats.php
index 5ae202f..2179447 100644
--- a/src/storage/SprintBuildStats.php
+++ b/src/storage/SprintBuildStats.php
@@ -2,14 +2,19 @@
 
 final class SprintBuildStats {
   private $timezone;
-  private $total_tasks_added;
   private $tasks_remaining;
-  private $total_points_added;
   private $points_remaining;
 
   public function setTimezone ($viewer) {
 $this-timezone = new DateTimeZone($viewer-getTimezoneIdentifier());
 return $this-timezone;
+  }
+
+  public function setSprintData($dates, $before) {
+$stats = id(new SprintBuildStats());
+$dates = $this-sumSprintStats($dates, $before);
+$sprint_data = $stats-computeIdealPoints($dates);
+return $sprint_data;
   }
 
   public function buildDateArray($start, $end, DateTimeZone $timezone) {
@@ -25,6 +30,11 @@
 }
 
 return $dates;
+  }
+
+  public function buildBefore($start, $timezone) {
+$before = id(new DateTime(@ . $start, $timezone))-modify('-1 
day')-setTime(2, 0);
+return $this-getBurndownDate($before-format('D M j'));
   }
 
   public function buildTimeSeries($start, $end) {
@@ -43,100 +53,80 @@
 
   // Now that we have the data for each day, we need to loop over and sum
   // up the relevant columns
-  public function sumSprintStats($dates) {
- $this-sumTasksTotal($dates);
- $this-calcTasksRemaining($dates);
- $this-sumPointsTotal($dates);
- $this-calcPointsRemaining($dates);
+  public function sumSprintStats($dates, $before) {
+ //$this-sumTasksTotal($dates, $before);
+ $this-calcTasksRemaining($dates, $before);
+ //$this-sumPointsTotal($dates, $before);
+ $this-calcPointsRemaining($dates, $before);
 return $dates;
 
   }
 
-  public function sumTasksTotal($dates) {
+  public function calcPointsRemaining($dates, $before) {
 $first = true;
 $previous = new BurndownDataDate($date=null);
+$points_added_before = null;
+$points_closed_before = null;
+$points_reopened_before = null;
+$points_added_today = null;
+$points_closed_today = null;
+$points_reopened_today = null;
+$points_remaining = null;
 foreach ($dates as $date) {
-  $this-total_tasks_added += $date-getTasksAddedToday();
+  $points_added_today = $date-getPointsAddedToday();
+  $points_closed_today = $date-getPointsClosedToday();
+  $points_reopened_today = $date-getPointsReopenedToday();
+  $points_today = $points_added_today + $points_reopened_today - 
$points_closed_today;
   if ($first) {
-$date-setTasksTotal($this-total_tasks_added);
-$tasks_total = $this-total_tasks_added;
+$points_added_before = $before-getPointsAddedBefore();
+$points_reopened_before = $before-getPointsAddedBefore();
+$points_closed_before = $before-getPointsClosedBefore();
+$points_before = $points_added_before + $points_reopened_before - 
$points_closed_before;
+$points_remaining = $points_today + $points_before;
   } else {
-$tasks_total = $date-sumTasksTotal($date, $previous);
-$date-setTasksTotal($tasks_total);
+$yesterday_points_remaining = $previous-getPointsRemaining();
+$date-setYesterdayPointsRemaining($yesterday_points_remaining);
+$points_remaining = $points_today + $yesterday_points_remaining;
   }
-  $this-total_tasks_added += $tasks_total;
-  $previous = $date;
-  $first = false;
-}
-return $dates;
-  }
-
-  public function sumPointsTotal($dates) {
-$first = true;
-

[MediaWiki-commits] [Gerrit] $.wikibase.entityselector: Factored out _termMatchesLabel() - change (mediawiki...Wikibase)

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

Change subject: $.wikibase.entityselector: Factored out _termMatchesLabel()
..


$.wikibase.entityselector: Factored out _termMatchesLabel()

Change-Id: I92506c84238392c28b8f3109b88471ec718cbd8a
---
M lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
1 file changed, 15 insertions(+), 5 deletions(-)

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



diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
index 382b96e..99ac7fd 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
@@ -186,11 +186,7 @@
return;
}
 
-   var label = suggestions[0].label || 
suggestions[0].id;
-   if( label === requestTerm
-   || !self.options.caseSensitive
-label.toLowerCase() === 
requestTerm.toLowerCase()
-   ) {
+   if( self._termMatchesLabel( requestTerm, 
suggestions[0] ) ) {
self._select( suggestions[0] );
}
} );
@@ -198,6 +194,20 @@
},
 
/**
+* Determines whether a term matches a label considering the 
`caseSensitive` option.
+* @protected
+*
+* @param {string} term
+* @param {Object} suggestion
+* @return {boolean}
+*/
+   _termMatchesLabel: function( term, suggestion ) {
+   var label = suggestion.label || suggestion.id;
+   return label === term
+   || !this.options.caseSensitive  label.toLowerCase() 
=== term.toLowerCase();
+   },
+
+   /**
 * Create and return the data object for the api call.
 * @protected
 *

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I92506c84238392c28b8f3109b88471ec718cbd8a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater henning.sna...@wikimedia.de
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] Address exceptions in computation logic - change (phabricator...Sprint)

2014-12-04 Thread Christopher Johnson (WMDE) (Code Review)
Christopher Johnson (WMDE) has submitted this change and it was merged.

Change subject: Address exceptions in computation logic
..


Address exceptions in computation logic

Progress commit, still a few bugs left

Change-Id: I0cfedaac38fbc31c057583a1686195d4a9d7dbf7
---
M src/__phutil_library_map__.php
M src/storage/SprintBuildStats.php
M src/storage/SprintTransaction.php
M src/util/BurndownDataDate.php
M src/view/BurndownDataView.php
M src/view/EventTableView.php
A src/view/HistoryTableView.php
M src/view/SprintTableView.php
M src/view/TasksTableView.php
9 files changed, 361 insertions(+), 226 deletions(-)

Approvals:
  Christopher Johnson (WMDE): Verified; Looks good to me, approved



diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
index e5cd7a1..ec29c2c 100644
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -20,6 +20,7 @@
 'CeleritySprintResources' = 'celerity/CeleritySprintResources.php',
 'DateIterator' = 'tests/DateIterator.php',
 'EventTableView' = 'view/EventTableView.php',
+'HistoryTableView' = 'view/HistoryTableView.php',
 'OpenTasksView' = 'view/OpenTasksView.php',
 'ProjectOpenTasksView' = 'view/ProjectOpenTasksView.php',
 'SprintApplication' = 'application/SprintApplication.php',
diff --git a/src/storage/SprintBuildStats.php b/src/storage/SprintBuildStats.php
index 5ae202f..2179447 100644
--- a/src/storage/SprintBuildStats.php
+++ b/src/storage/SprintBuildStats.php
@@ -2,14 +2,19 @@
 
 final class SprintBuildStats {
   private $timezone;
-  private $total_tasks_added;
   private $tasks_remaining;
-  private $total_points_added;
   private $points_remaining;
 
   public function setTimezone ($viewer) {
 $this-timezone = new DateTimeZone($viewer-getTimezoneIdentifier());
 return $this-timezone;
+  }
+
+  public function setSprintData($dates, $before) {
+$stats = id(new SprintBuildStats());
+$dates = $this-sumSprintStats($dates, $before);
+$sprint_data = $stats-computeIdealPoints($dates);
+return $sprint_data;
   }
 
   public function buildDateArray($start, $end, DateTimeZone $timezone) {
@@ -25,6 +30,11 @@
 }
 
 return $dates;
+  }
+
+  public function buildBefore($start, $timezone) {
+$before = id(new DateTime(@ . $start, $timezone))-modify('-1 
day')-setTime(2, 0);
+return $this-getBurndownDate($before-format('D M j'));
   }
 
   public function buildTimeSeries($start, $end) {
@@ -43,100 +53,80 @@
 
   // Now that we have the data for each day, we need to loop over and sum
   // up the relevant columns
-  public function sumSprintStats($dates) {
- $this-sumTasksTotal($dates);
- $this-calcTasksRemaining($dates);
- $this-sumPointsTotal($dates);
- $this-calcPointsRemaining($dates);
+  public function sumSprintStats($dates, $before) {
+ //$this-sumTasksTotal($dates, $before);
+ $this-calcTasksRemaining($dates, $before);
+ //$this-sumPointsTotal($dates, $before);
+ $this-calcPointsRemaining($dates, $before);
 return $dates;
 
   }
 
-  public function sumTasksTotal($dates) {
+  public function calcPointsRemaining($dates, $before) {
 $first = true;
 $previous = new BurndownDataDate($date=null);
+$points_added_before = null;
+$points_closed_before = null;
+$points_reopened_before = null;
+$points_added_today = null;
+$points_closed_today = null;
+$points_reopened_today = null;
+$points_remaining = null;
 foreach ($dates as $date) {
-  $this-total_tasks_added += $date-getTasksAddedToday();
+  $points_added_today = $date-getPointsAddedToday();
+  $points_closed_today = $date-getPointsClosedToday();
+  $points_reopened_today = $date-getPointsReopenedToday();
+  $points_today = $points_added_today + $points_reopened_today - 
$points_closed_today;
   if ($first) {
-$date-setTasksTotal($this-total_tasks_added);
-$tasks_total = $this-total_tasks_added;
+$points_added_before = $before-getPointsAddedBefore();
+$points_reopened_before = $before-getPointsAddedBefore();
+$points_closed_before = $before-getPointsClosedBefore();
+$points_before = $points_added_before + $points_reopened_before - 
$points_closed_before;
+$points_remaining = $points_today + $points_before;
   } else {
-$tasks_total = $date-sumTasksTotal($date, $previous);
-$date-setTasksTotal($tasks_total);
+$yesterday_points_remaining = $previous-getPointsRemaining();
+$date-setYesterdayPointsRemaining($yesterday_points_remaining);
+$points_remaining = $points_today + $yesterday_points_remaining;
   }
-  $this-total_tasks_added += $tasks_total;
-  $previous = $date;
-  $first = false;
-}
-return $dates;
-  }
-
-  public function sumPointsTotal($dates) {
-$first = true;
-$previous = new BurndownDataDate($date=null);
-foreach 

[MediaWiki-commits] [Gerrit] Use switch in EntityIdTitleFormatters - change (mediawiki...Wikibase)

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

Change subject: Use switch in EntityIdTitleFormatters
..


Use switch in EntityIdTitleFormatters

If it looks like a switch why not use a switch?

Change-Id: If5304b5e309ecf28a45d71c1e3839d487c76c55f
---
M lib/tests/phpunit/formatters/EntityIdLinkFormatterTest.php
M lib/tests/phpunit/formatters/EntityIdTitleFormatterTest.php
M repo/includes/store/sql/ItemsPerSiteBuilder.php
3 files changed, 17 insertions(+), 19 deletions(-)

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



diff --git a/lib/tests/phpunit/formatters/EntityIdLinkFormatterTest.php 
b/lib/tests/phpunit/formatters/EntityIdLinkFormatterTest.php
index 4c5ecc9..357c914 100644
--- a/lib/tests/phpunit/formatters/EntityIdLinkFormatterTest.php
+++ b/lib/tests/phpunit/formatters/EntityIdLinkFormatterTest.php
@@ -58,16 +58,15 @@
$this-assertEquals( $expected, $actual );
}
 
-   public function getTitleForId( EntityId $id ) {
-   if ( $id-getEntityType() === Item::ENTITY_TYPE ) {
-   $name = 'ITEM-TEST--' . $id-getSerialization();
-   } elseif ( $id-getEntityType() === Property::ENTITY_TYPE ) {
-   $name = 'PROPERTY-TEST--' . $id-getSerialization();
-   } else {
-   throw new LogicException( oops! );
+   public function getTitleForId( EntityId $entityId ) {
+   switch ( $entityId-getEntityType() ) {
+   case Item::ENTITY_TYPE:
+   return Title::makeTitle( NS_MAIN, 'ITEM-TEST--' 
. $entityId-getSerialization() );
+   case Property::ENTITY_TYPE:
+   return Title::makeTitle( NS_MAIN, 
'PROPERTY-TEST--' . $entityId-getSerialization() );
+   default:
+   throw new LogicException( oops! );
}
-
-   return Title::makeTitle( NS_MAIN, $name );
}
 
protected function newEntityIdLinkFormatter() {
diff --git a/lib/tests/phpunit/formatters/EntityIdTitleFormatterTest.php 
b/lib/tests/phpunit/formatters/EntityIdTitleFormatterTest.php
index 970adf0..6b14262 100644
--- a/lib/tests/phpunit/formatters/EntityIdTitleFormatterTest.php
+++ b/lib/tests/phpunit/formatters/EntityIdTitleFormatterTest.php
@@ -58,16 +58,15 @@
$this-assertEquals( $expected, $actual );
}
 
-   public function getTitleForId( EntityId $id ) {
-   if ( $id-getEntityType() === Item::ENTITY_TYPE ) {
-   $name = 'ITEM-TEST--' . $id-getSerialization();
-   } elseif ( $id-getEntityType() === Property::ENTITY_TYPE ) {
-   $name = 'PROPERTY-TEST--' . $id-getSerialization();
-   } else {
-   throw new LogicException( oops! );
+   public function getTitleForId( EntityId $entityId ) {
+   switch ( $entityId-getEntityType() ) {
+   case Item::ENTITY_TYPE:
+   return Title::makeTitle( NS_MAIN, 'ITEM-TEST--' 
. $entityId-getSerialization() );
+   case Property::ENTITY_TYPE:
+   return Title::makeTitle( NS_MAIN, 
'PROPERTY-TEST--' . $entityId-getSerialization() );
+   default:
+   throw new LogicException( oops! );
}
-
-   return Title::makeTitle( NS_MAIN, $name );
}
 
protected function newEntityIdTitleFormatter() {
diff --git a/repo/includes/store/sql/ItemsPerSiteBuilder.php 
b/repo/includes/store/sql/ItemsPerSiteBuilder.php
index bc789f9..aed1b17 100644
--- a/repo/includes/store/sql/ItemsPerSiteBuilder.php
+++ b/repo/includes/store/sql/ItemsPerSiteBuilder.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase\Repo\Store\SQL;
 
+use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\Item;
 use Wikibase\Lib\Reporting\MessageReporter;
 use Wikibase\Lib\Store\EntityLookup;
@@ -92,7 +93,6 @@
private function rebuildSiteLinks( array $entityIds ) {
$c = 0;
foreach ( $entityIds as $entityId ) {
-   /* @var $entityId EntityId */
if ( !$entityId-getEntityType() === Item::ENTITY_TYPE 
) {
// Just in case someone is using a 
EntityIdPager which doesn't filter non-Items
continue;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If5304b5e309ecf28a45d71c1e3839d487c76c55f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de
Gerrit-Reviewer: Daniel Kinzler 

[MediaWiki-commits] [Gerrit] Tool Labs: fix silly typo in bigbrother - change (operations/puppet)

2014-12-04 Thread coren (Code Review)
coren has uploaded a new change for review.

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

Change subject: Tool Labs: fix silly typo in bigbrother
..

Tool Labs: fix silly typo in bigbrother

Change-Id: I4ce7f71a4f21fec0f0b23e92988a59f660f79587
---
M modules/toollabs/files/bigbrother
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/toollabs/files/bigbrother 
b/modules/toollabs/files/bigbrother
index e53f9be..9edd396 100755
--- a/modules/toollabs/files/bigbrother
+++ b/modules/toollabs/files/bigbrother
@@ -86,7 +86,7 @@
 }
 $expect = $name-$1;
 $start = /usr/bin/webservice -$name start;
-] 
elsif(m/^webservice(:?\s+(--release\s+[a-z]+))?(:?\s+([a-z]+))?$/) {
+} 
elsif(m/^webservice(:?\s+(--release\s+[a-z]+))?(:?\s+([a-z]+))?$/) {
 my $rel = $2 // '';
 my $name = $3 // lighttpd;
 unless($username =~ m/^tools\.(.*)$/) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ce7f71a4f21fec0f0b23e92988a59f660f79587
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: coren mpellet...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Tool Labs: fix silly typo in bigbrother - change (operations/puppet)

2014-12-04 Thread coren (Code Review)
coren has submitted this change and it was merged.

Change subject: Tool Labs: fix silly typo in bigbrother
..


Tool Labs: fix silly typo in bigbrother

Change-Id: I4ce7f71a4f21fec0f0b23e92988a59f660f79587
---
M modules/toollabs/files/bigbrother
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/toollabs/files/bigbrother 
b/modules/toollabs/files/bigbrother
index e53f9be..9edd396 100755
--- a/modules/toollabs/files/bigbrother
+++ b/modules/toollabs/files/bigbrother
@@ -86,7 +86,7 @@
 }
 $expect = $name-$1;
 $start = /usr/bin/webservice -$name start;
-] 
elsif(m/^webservice(:?\s+(--release\s+[a-z]+))?(:?\s+([a-z]+))?$/) {
+} 
elsif(m/^webservice(:?\s+(--release\s+[a-z]+))?(:?\s+([a-z]+))?$/) {
 my $rel = $2 // '';
 my $name = $3 // lighttpd;
 unless($username =~ m/^tools\.(.*)$/) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4ce7f71a4f21fec0f0b23e92988a59f660f79587
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: coren mpellet...@wikimedia.org
Gerrit-Reviewer: coren mpellet...@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] More AppArmor fixes for OCG. - change (operations/puppet)

2014-12-04 Thread Cscott (Code Review)
Cscott has uploaded a new change for review.

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

Change subject: More AppArmor fixes for OCG.
..

More AppArmor fixes for OCG.

This follows up on I026c374eadfd2b3623d7d11b3a8d82d17bcac49b -- AppArmor
actually requires a trailing slash on directory names (!).

Also added rw permission to /dev/tty, since our helper scripts check
whether stdout is a TTY before emitting colorized output on console.

Change-Id: I9088e22988e854c9266459bf0cb63ceb01341749
---
M modules/ocg/templates/usr.bin.nodejs.apparmor.erb
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/50/177550/1

diff --git a/modules/ocg/templates/usr.bin.nodejs.apparmor.erb 
b/modules/ocg/templates/usr.bin.nodejs.apparmor.erb
index f368631..be9ff52 100644
--- a/modules/ocg/templates/usr.bin.nodejs.apparmor.erb
+++ b/modules/ocg/templates/usr.bin.nodejs.apparmor.erb
@@ -15,11 +15,11 @@
   /etc/ocg/mw-ocg-service.js r,
   /srv/deployment/ocg/ocg/** r,
   /srv/deployment/ocg/ocg/node_modules/**.node mr,
-  %= @temp_dir % r,
+  %= @temp_dir %/ r,
   %= @temp_dir %/** rwlk,
-  %= @output_dir % r,
+  %= @output_dir %/ r,
   %= @output_dir %/** rw,
-  %= @postmortem_dir % r,
+  %= @postmortem_dir %/ r,
   %= @postmortem_dir %/** rwk,
   /tmp/** rwk,
 
@@ -27,6 +27,8 @@
 
   /bin/dash ix,
 
+  /dev/tty rw,
+
   /usr/bin/rsvg-convert cx - imagetools,
   /usr/bin/*.im6 cx - imagetools,
   /usr/bin/pdfseparate cx - imagetools,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9088e22988e854c9266459bf0cb63ceb01341749
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Cscott canan...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Initial Debian packaging for apertium-urd-hin - change (operations...apertium-urd-hin)

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

Change subject: Initial Debian packaging for apertium-urd-hin
..


Initial Debian packaging for apertium-urd-hin

Bug: T76318
Change-Id: I37666c4fab4b5511ef7535c07ac2f7ec51ce8b99
---
A debian/changelog
A debian/compat
A debian/control
A debian/copyright
A debian/docs
A debian/rules
A debian/source/format
7 files changed, 122 insertions(+), 0 deletions(-)

Approvals:
  Alexandros Kosiaris: Verified; Looks good to me, approved



diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 000..23fd8c5
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,12 @@
+apertium-urd-hin (0.1.0+svn~57870-1) trusty; urgency=low
+
+  * Initial release based on Tino Didriksen's work.
+
+ -- Kartik Mistry kar...@debian.org  Tue, 02 Dec 2014 19:33:09 +0530
+
+apertium-urd-hin (0.1.0~r57554-1) experimental; urgency=low
+
+  * Initial release
+  * No tarball release, so taking directly from svn
+
+ -- Tino Didriksen m...@tinodidriksen.com  Mon, 13 Oct 2014 07:17:28 +
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 000..a147415
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,35 @@
+Source: apertium-urd-hin
+Section: science
+Priority: optional
+Maintainer: Debian Science Team 
debian-science-maintain...@lists.alioth.debian.org
+Uploaders: Tino Didriksen m...@tinodidriksen.com,
+   Kartik Mistry kar...@debian.org
+Build-Depends: apertium (= 3.3),
+   apertium-hin,
+   apertium-lex-tools,
+   apertium-urd,
+   autotools-dev,
+   cg3,
+   debhelper (= 9),
+   dh-autoreconf,
+   gawk,
+   libapertium3-3.3-dev,
+   locales,
+   pkg-config (= 0.21)
+Standards-Version: 3.9.6
+Homepage: http://apertium.org/
+Vcs-Git: git://anonscm.debian.org/debian-science/packages/apertium-urd-hin.git
+Vcs-Browser: 
https://anonscm.debian.org/cgit/debian-science/packages/apertium-urd-hin.git
+
+Package: apertium-urd-hin
+Architecture: all
+Depends: apertium (= 3.3),
+ apertium-lex-tools,
+ cg3,
+ ${misc:Depends},
+ ${shlibs:Depends}
+Provides: apertium-hin-urd
+Conflicts: apertium-hin-urd
+Description: Apertium translation data for the Urdu-Hindi pair
+ Data package providing Apertium language resources for translating
+ between the Urdu and Hindi languages.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 000..9ae1148
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,44 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Source: http://apertium.org/
+
+Files: *
+Copyright: 2010-2014, Francis M. Tyers fty...@prompsit.com
+2010, Eknath Venkataramani blah-sphe...@users.sourceforge.net
+2012, Jim O'Regan jore...@gmail.com
+2012, San_ sanam...@users.sourceforge.net
+2014, Kevin Brubeck Unhammer unham...@fsfe.org
+2014, Sudarsh Rathi sud1...@users.sourceforge.net
+License: GPL-3
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 3 of the License
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see http://www.gnu.org/licenses/.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in /usr/share/common-licenses/GPL-3.
+
+Files: debian/*
+Copyright: 2014, Apertium Project Management Committee 
apertium-...@dlsi.ua.es
+License: GPL-3+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see http://www.gnu.org/licenses/.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in /usr/share/common-licenses/GPL-3.
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 

[MediaWiki-commits] [Gerrit] Added initial Debian packaging for apertium-id-ms - change (operations...apertium-id-ms)

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

Change subject: Added initial Debian packaging for apertium-id-ms
..


Added initial Debian packaging for apertium-id-ms

Bug: T76318
Change-Id: I9bfd3d12339aff701f300df2acf4791d612ce143
---
A debian/changelog
A debian/compat
A debian/control
A debian/copyright
A debian/docs
A debian/rules
A debian/source/format
7 files changed, 116 insertions(+), 0 deletions(-)

Approvals:
  Alexandros Kosiaris: Verified; Looks good to me, approved



diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 000..004205b
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,12 @@
+apertium-id-ms (0.1.1+svn~57870-1) trusty; urgency=low
+
+  * Initial release based on Tino Didriksen's work.
+
+ -- Kartik Mistry kar...@debian.org  Tue, 02 Dec 2014 11:55:38 +0530
+
+apertium-id-ms (0.1.1~r57551-1) experimental; urgency=low
+
+  * Initial release
+  * No significant changes in svn since tarball, so taking directly from svn
+
+ -- Tino Didriksen m...@tinodidriksen.com  Mon, 13 Oct 2014 07:17:28 +
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 000..1f06bc8
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,27 @@
+Source: apertium-id-ms
+Section: science
+Priority: optional
+Maintainer: Debian Science Team 
debian-science-maintain...@lists.alioth.debian.org
+Uploaders: Tino Didriksen m...@tinodidriksen.com,
+   Kartik Mistry kar...@debian.org
+Build-Depends: apertium (= 3.3),
+   autotools-dev,
+   debhelper (= 9),
+   dh-autoreconf,
+   gawk,
+   libapertium3-3.3-dev,
+   locales,
+   pkg-config (= 0.21)
+Standards-Version: 3.9.6
+Homepage: http://apertium.org/
+Vcs-Git: git://anonscm.debian.org/debian-science/packages/apertium-id-ms.git
+Vcs-Browser: 
https://anonscm.debian.org/cgit/debian-science/packages/apertium-id-ms.git
+
+Package: apertium-id-ms
+Architecture: all
+Depends: apertium (= 3.3), ${misc:Depends}, ${shlibs:Depends}
+Provides: apertium-ms-id
+Conflicts: apertium-ms-id
+Description: Apertium translation data for the Indonesian-Malay pair
+ Data package providing Apertium language resources for translating
+ between the Indonesian and Malay languages.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 000..13ad7d6
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,46 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Source: http://apertium.org/
+
+Files: *
+Copyright: 2012-2014, Kevin Brubeck Unhammer unham...@fsfe.org
+2012, Francis M. Tyers fty...@prompsit.com
+2012, Raymond HS raymon...@users.sourceforge.net
+2012, Septina Dian Larasati slaras...@users.sourceforge.net
+License: GPL-2
+
+Files: autogen.sh
+Copyright: 2002, Daniel Elstner  daniel.elst...@gmx.net
+License: GPL-2
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see http://www.gnu.org/licenses/.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in /usr/share/common-licenses/GPL-2.
+
+Files: debian/*
+Copyright: 2014, Apertium Project Management Committee 
apertium-...@dlsi.ua.es
+License: GPL-2+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see http://www.gnu.org/licenses/.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in /usr/share/common-licenses/GPL-2.
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 000..6f12db5
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,2 @@
+AUTHORS
+README
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 000..11004df
--- /dev/null
+++ 

[MediaWiki-commits] [Gerrit] Ajax dispatcher methods need to return something - change (mediawiki...BlueSpiceExtensions)

2014-12-04 Thread Robert Vogel (Code Review)
Robert Vogel has submitted this change and it was merged.

Change subject: Ajax dispatcher methods need to return something
..


Ajax dispatcher methods need to return something

Accidently removed return

Change-Id: I8dccc20fe003e5186a7ae1e25b386af446f90fe5
---
M ExtendedSearch/includes/ExtendedSearchAdmin.class.php
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Robert Vogel: Verified; Looks good to me, approved



diff --git a/ExtendedSearch/includes/ExtendedSearchAdmin.class.php 
b/ExtendedSearch/includes/ExtendedSearchAdmin.class.php
index 9b69a5d..b9592e7 100644
--- a/ExtendedSearch/includes/ExtendedSearchAdmin.class.php
+++ b/ExtendedSearch/includes/ExtendedSearchAdmin.class.php
@@ -67,7 +67,10 @@
case 'deleteLock':
$sOutput = 
ExtendedSearchAdmin::getInstance()-checkLockExistence( $sMode );
break;
+   default:
+   $sOutput = '';
}
+   return $sOutput;
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8dccc20fe003e5186a7ae1e25b386af446f90fe5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Smuggli mug...@hallowelt.biz
Gerrit-Reviewer: Mglaser gla...@hallowelt.biz
Gerrit-Reviewer: Pigpen reym...@hallowelt.biz
Gerrit-Reviewer: Robert Vogel vo...@hallowelt.biz
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Added initial Debian packaging - change (operations...apertium-eo-en)

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

Change subject: Added initial Debian packaging
..


Added initial Debian packaging

Bug: T76318
Change-Id: I6d36e081b8acc609b7e18e288f9213807bc4886a
---
A debian/changelog
A debian/compat
A debian/control
A debian/copyright
A debian/docs
A debian/rules
A debian/source/format
7 files changed, 118 insertions(+), 0 deletions(-)

Approvals:
  Alexandros Kosiaris: Verified; Looks good to me, approved



diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 000..8a60a17
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,13 @@
+apertium-eo-en (1.0.0+svn~57870-1) trusty; urgency=low
+
+  * Initial release based on Tino Didriksen's work.
+
+ -- Kartik Mistry kar...@debian.org  Tue, 02 Dec 2014 11:20:15 +0530
+
+apertium-eo-en (1.0.0~r19299-1) unstable; urgency=low
+
+  * Initial release
+  * Significant changes in svn since tarball, so mixing new build scripts with
+old data files
+
+ -- Tino Didriksen m...@tinodidriksen.com  Mon, 13 Oct 2014 07:17:28 +
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 000..e16dc2a
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,28 @@
+Source: apertium-eo-en
+Section: science
+Priority: optional
+Maintainer: Debian Science Team 
debian-science-maintain...@lists.alioth.debian.org
+Uploaders: Tino Didriksen m...@tinodidriksen.com,
+   Kartik Mistry kar...@debian.org
+Build-Depends: apertium (= 3.3),
+   autotools-dev,
+   debhelper (= 9),
+   dh-autoreconf,
+   gawk,
+   libapertium3-3.3-dev,
+   locales,
+   pkg-config (= 0.21)
+Standards-Version: 3.9.6
+Homepage: http://apertium.org/
+Vcs-Git: git://anonscm.debian.org/debian-science/packages/apertium-eo-en.git
+Vcs-Browser: 
https://anonscm.debian.org/cgit/debian-science/packages/apertium-eo-en.git
+
+Package: apertium-eo-en
+Architecture: all
+Depends: apertium (= 3.3), ${misc:Depends}, ${shlibs:Depends}
+Provides: apertium-en-eo
+Conflicts: apertium-en-eo
+Description: Apertium linguistic data to translate between Esperanto and 
English
+ This is a linguistic package for the Apertium shallow-transfer
+ machine translation system. The package can be used to translate
+ between Esperanto and English.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 000..4e8371e
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,46 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Source: http://apertium.org/
+
+Files: *
+Copyright: 2008-2009, Jacob Nordfalk jacob.nordf...@gmail.com
+2009, Hèctor Alòs i Font hectora...@gmail.com
+   2005-2007, Universitat d'Alacant (Transducens group) - English data
+   2005-2007, Universitat Pompeu Fabra - English data
+License: GPL-2
+
+Files: autogen.sh
+Copyright: 2002, Daniel Elstner  daniel.elst...@gmx.net
+License: GPL-2
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see http://www.gnu.org/licenses/.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in /usr/share/common-licenses/GPL-2.
+
+Files: debian/*
+Copyright: 2014, Apertium Project Management Committee 
apertium-...@dlsi.ua.es
+License: GPL-2+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see http://www.gnu.org/licenses/.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in /usr/share/common-licenses/GPL-2.
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 000..6f12db5
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,2 @@
+AUTHORS
+README
diff --git a/debian/rules b/debian/rules
new file mode 

[MediaWiki-commits] [Gerrit] Move validateIndex code into separate class - change (mediawiki...CirrusSearch)

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

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

Change subject: Move validateIndex code into separate class
..

Move validateIndex code into separate class

Change-Id: Ifed68e99224c4765c02af724181d7a3f13a888e9
---
M CirrusSearch.php
A includes/Maintenance/Validators/IndexValidator.php
M maintenance/updateOneSearchIndexConfig.php
3 files changed, 128 insertions(+), 32 deletions(-)


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

diff --git a/CirrusSearch.php b/CirrusSearch.php
index 726c6eb..342339b 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -592,6 +592,7 @@
 $wgAutoloadClasses['CirrusSearch\Maintenance\Validators\MappingValidator'] = 
$maintenanceDir . '/Validators/MappingValidator.php';
 $wgAutoloadClasses['CirrusSearch\Maintenance\Validators\IndexAliasValidator'] 
= $maintenanceDir . '/Validators/IndexAliasValidator.php';
 
$wgAutoloadClasses['CirrusSearch\Maintenance\Validators\SpecificAliasValidator']
 = $maintenanceDir . '/Validators/SpecificAliasValidator.php';
+$wgAutoloadClasses['CirrusSearch\Maintenance\Validators\IndexValidator'] = 
$maintenanceDir . '/Validators/IndexValidator.php';
 $wgAutoloadClasses['CirrusSearch\Maintenance\UpdateVersionIndex'] = __DIR__ . 
'/maintenance/updateVersionIndex.php';
 $wgAutoloadClasses['CirrusSearch\NearMatchPicker'] = $includes . 
'NearMatchPicker.php';
 $wgAutoloadClasses['CirrusSearch\OtherIndexes'] = $includes . 
'OtherIndexes.php';
diff --git a/includes/Maintenance/Validators/IndexValidator.php 
b/includes/Maintenance/Validators/IndexValidator.php
new file mode 100644
index 000..d10260d
--- /dev/null
+++ b/includes/Maintenance/Validators/IndexValidator.php
@@ -0,0 +1,109 @@
+?php
+
+namespace CirrusSearch\Maintenance\Validators;
+
+use CirrusSearch\Maintenance\AnalysisConfigBuilder;
+use CirrusSearch\Maintenance\Maintenance;
+use Elastica\Index;
+use Status;
+
+class IndexValidator extends Validator {
+   /**
+* @var Index
+*/
+   private $index;
+
+   /**
+* @var bool
+*/
+   private $startOver;
+
+   /**
+* @var int
+*/
+   private $maxShardsPerNode;
+
+   /**
+* @var int
+*/
+   private $shardCount;
+
+   /**
+* @var string
+*/
+   private $replicaCount;
+
+   /**
+* @var AnalysisConfigBuilder
+*/
+   private $analysisConfigBuilder;
+
+   /**
+* @var array
+*/
+   private $mergeSettings;
+
+   /**
+* @param Index $index
+* @param bool $startOver
+* @param string $maxShardsPerNode
+* @param int $shardCount
+* @param string $replicaCount
+* @param int $refreshInterval
+* @param AnalysisConfigBuilder $analysisConfigBuilder
+* @param array $mergeSettings
+* @param Maintenance $out
+*/
+   public function __construct( Index $index, $startOver, 
$maxShardsPerNode, $shardCount, $replicaCount, $refreshInterval, 
AnalysisConfigBuilder $analysisConfigBuilder, array $mergeSettings, Maintenance 
$out = null ) {
+   parent::__construct( $out );
+
+   $this-index = $index;
+   $this-startOver = $startOver;
+   $this-maxShardsPerNode = $maxShardsPerNode;
+   $this-shardCount = $shardCount;
+   $this-replicaCount = $replicaCount;
+   $this-refreshInterval = $refreshInterval;
+   $this-analysisConfigBuilder = $analysisConfigBuilder;
+   $this-mergeSettings = $mergeSettings;
+   }
+
+   /**
+* @return Status
+*/
+   public function validate() {
+   if ( $this-startOver ) {
+   $this-outputIndented( Blowing away index to start 
over... );
+   $this-createIndex( true );
+   $this-output( ok\n );
+   return Status::newGood();
+   }
+   if ( !$this-index-exists() ) {
+   $this-outputIndented( Creating index... );
+   $this-createIndex( false );
+   $this-output( ok\n );
+   return Status::newGood();
+   }
+   $this-outputIndented( Index exists so validating...\n );
+
+   return Status::newGood();
+   }
+
+   /**
+* @param bool $rebuild
+*/
+   private function createIndex( $rebuild ) {
+   $maxShardsPerNode = $this-maxShardsPerNode === 'unlimited' ? 
-1 : $this-maxShardsPerNode;
+   $this-index-create( array(
+   'settings' = array(
+   'number_of_shards' = $this-shardCount,
+   'auto_expand_replicas' = $this-replicaCount,
+   

[MediaWiki-commits] [Gerrit] WIP Per user request limits - change (mediawiki...CirrusSearch)

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

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

Change subject: WIP Per user request limits
..

WIP Per user request limits

Change-Id: Iedda2d1f39bc70bb8103d0fdfb1297708c960766
---
M includes/Searcher.php
M includes/Util.php
M tests/jenkins/Jenkins.php
3 files changed, 65 insertions(+), 11 deletions(-)


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

diff --git a/includes/Searcher.php b/includes/Searcher.php
index ee10a7c..7a2e4af 100644
--- a/includes/Searcher.php
+++ b/includes/Searcher.php
@@ -843,6 +843,7 @@
$indexBaseName = $this-indexBaseName;
return Util::doPoolCounterWork(
'CirrusSearch-Search',
+   $this-user,
function() use ( $searcher, $pageIds, $sourceFiltering, 
$indexType, $indexBaseName ) {
try {
global 
$wgCirrusSearchClientSideSearchTimeout;
@@ -870,6 +871,7 @@
$indexBaseName = $this-indexBaseName;
return Util::doPoolCounterWork(
'CirrusSearch-NamespaceLookup',
+   $this-user,
function() use ( $searcher, $name, $indexBaseName ) {
try {
$searcher-start( lookup namespace for 
$name );
@@ -1100,6 +1102,7 @@
wfProfileIn( __METHOD__ . '-execute' );
$result = Util::doPoolCounterWork(
$poolCounterType,
+   $this-user,
function() use ( $searcher, $search, $description ) {
try {
$searcher-start( $description );
diff --git a/includes/Util.php b/includes/Util.php
index 0b7bf47..1e1e556 100644
--- a/includes/Util.php
+++ b/includes/Util.php
@@ -90,18 +90,22 @@
 * Wraps the complex pool counter interface to force the single call 
pattern
 * that Cirrus always uses.
 * @param $type same as type parameter on PoolCounter::factory
+* @param $user the user
 * @param $workCallback callback when pool counter is aquired.  Called 
with
 *   no parameters.
 * @param $errorCallback optional callback called on errors.  Called 
with
 *   the error string and the key as parameters.  If left undefined 
defaults
 *   to a function that returns a fatal status and logs an warning.
 */
-   public static function doPoolCounterWork( $type, $workCallback, 
$errorCallback = null ) {
+   public static function doPoolCounterWork( $type, $user, $workCallback, 
$errorCallback = null ) {
global $wgCirrusSearchPoolCounterKey;
 
// By default the pool counter allows you to lock the same key 
with
// multiple types.  That might be useful but it isn't how 
Cirrus thinks.
// Instead, all keys are scoped to their type.
+
+   $perUserKey = md5( $user-getName() );
+   $perUserKey = _per_user:$perUserKey;
$key = $type:$wgCirrusSearchPoolCounterKey;
if ( $errorCallback === null ) {
$errorCallback = function( $error, $key ) {
@@ -109,12 +113,21 @@
return Status::newFatal( 
'cirrussearch-backend-error' );
};
}
-   $work = new PoolCounterWorkViaCallback( $type, $key, array(
-   'doWork' = $workCallback,
-   'error' = function( $status ) use ( $errorCallback, 
$key ) {
-   $status = $status-getErrorsArray();
-   return $errorCallback( $status[ 0 ][ 0 ], $key 
);
-   }
+   $errorHandler = function( $status ) use ( $errorCallback, $key 
) {
+   $status = $status-getErrorsArray();
+   return $errorCallback( $status[ 0 ][ 0 ], $key );
+   }; 
+   $work = new PoolCounterWorkViaCallback( 'CirrusSearch-PerUser', 
$perUserKey, array(
+   'doWork' = function() use ( $type, $key, 
$workCallback, $errorHandler ) {
+   // Now that we have the per user lock lets get 
the operation lock.
+   // Note that this could block, causing the user 
to wait in line with their lock held.
+   $work = new PoolCounterWorkViaCallback( $type, 
$key, array(
+   'doWork' = $workCallback,
+   'error' = $errorHandler,
+   ) );
+   return $work-execute();
+  

[MediaWiki-commits] [Gerrit] Move validateAnalyzers code into separate class - change (mediawiki...CirrusSearch)

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

Change subject: Move validateAnalyzers code into separate class
..


Move validateAnalyzers code into separate class

Meanwhile also duplicated checkConfig  related in Validator.php
Meanwhile also removed getSettings method, which is no longer used

Change-Id: I22e132d6698f53c47a243d05141384a675dac7ad
---
M CirrusSearch.php
A includes/Maintenance/Validators/AnalyzersValidator.php
M includes/Maintenance/Validators/Validator.php
M maintenance/updateOneSearchIndexConfig.php
4 files changed, 139 insertions(+), 15 deletions(-)

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



diff --git a/CirrusSearch.php b/CirrusSearch.php
index 473e698..ff0e288 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -587,6 +587,7 @@
 
$wgAutoloadClasses['CirrusSearch\Maintenance\Validators\MaxShardsPerNodeValidator']
 = $maintenanceDir . '/Validators/MaxShardsPerNodeValidator.php';
 
$wgAutoloadClasses['CirrusSearch\Maintenance\Validators\NumberOfShardsValidator']
 = $maintenanceDir . '/Validators/NumberOfShardsValidator.php';
 
$wgAutoloadClasses['CirrusSearch\Maintenance\Validators\ReplicaRangeValidator'] 
= $maintenanceDir . '/Validators/ReplicaRangeValidator.php';
+$wgAutoloadClasses['CirrusSearch\Maintenance\Validators\AnalyzersValidator'] = 
$maintenanceDir . '/Validators/AnalyzersValidator.php';
 $wgAutoloadClasses['CirrusSearch\Maintenance\UpdateVersionIndex'] = __DIR__ . 
'/maintenance/updateVersionIndex.php';
 $wgAutoloadClasses['CirrusSearch\NearMatchPicker'] = $includes . 
'NearMatchPicker.php';
 $wgAutoloadClasses['CirrusSearch\OtherIndexes'] = $includes . 
'OtherIndexes.php';
diff --git a/includes/Maintenance/Validators/AnalyzersValidator.php 
b/includes/Maintenance/Validators/AnalyzersValidator.php
new file mode 100644
index 000..85cb59f
--- /dev/null
+++ b/includes/Maintenance/Validators/AnalyzersValidator.php
@@ -0,0 +1,45 @@
+?php
+
+namespace CirrusSearch\Maintenance\Validators;
+
+use CirrusSearch\Maintenance\AnalysisConfigBuilder;
+use CirrusSearch\Maintenance\Maintenance;
+use Elastica\Index;
+
+class AnalyzersValidator extends Validator {
+   /**
+* @var Index
+*/
+   private $index;
+
+   /**
+* @var AnalysisConfigBuilder
+*/
+   private $analysisConfigBuilder;
+
+   /**
+* @param Index $index
+* @param AnalysisConfigBuilder $analysisConfigBuilder
+* @param Maintenance $out
+*/
+   public function __construct( Index $index, AnalysisConfigBuilder 
$analysisConfigBuilder, Maintenance $out = null ) {
+   parent::__construct( $out );
+
+   $this-index = $index;
+   $this-analysisConfigBuilder = $analysisConfigBuilder;
+   }
+
+   public function validate() {
+   $this-outputIndented( Validating analyzers... );
+   $settings = $this-index-getSettings()-get();
+   $requiredAnalyzers = 
$this-analysisConfigBuilder-buildConfig();
+   if ( $this-checkConfig( $settings[ 'analysis' ], 
$requiredAnalyzers ) ) {
+   $this-output( ok\n );
+   } else {
+   $this-output( cannot correct\n );
+   return false;
+   }
+
+   return true;
+   }
+}
diff --git a/includes/Maintenance/Validators/Validator.php 
b/includes/Maintenance/Validators/Validator.php
index d209e76..1665863 100644
--- a/includes/Maintenance/Validators/Validator.php
+++ b/includes/Maintenance/Validators/Validator.php
@@ -11,6 +11,11 @@
protected $out;
 
/**
+* @var bool
+*/
+   protected $printDebugCheckConfig = false;
+
+   /**
 * @param Maintenance $out Maintenance object, to relay output to.
 */
public function __construct( Maintenance $out = null ) {
@@ -23,6 +28,83 @@
abstract public function validate();
 
/**
+* @param bool $print
+*/
+   public function printDebugCheckConfig( $print = true ) {
+   $this-printDebugCheckConfig = (bool) $print;
+   }
+
+   /**
+* @param $actual
+* @param $required array
+* @param string|null $indent
+* @return bool
+*/
+   protected function checkConfig( $actual, $required, $indent = null ) {
+   foreach( $required as $key = $value ) {
+   $this-debugCheckConfig( \n$indent$key:  );
+   if ( !array_key_exists( $key, $actual ) ) {
+   $this-debugCheckConfig( not found... );
+   if ( $key === '_all' ) {
+   // The _all field never comes back so 
we just have to assume it
+   // is set correctly.
+   

[MediaWiki-commits] [Gerrit] Move validateMapping code into separate class - change (mediawiki...CirrusSearch)

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

Change subject: Move validateMapping code into separate class
..


Move validateMapping code into separate class

Meanwhile removed the now unused checkConfig methods

Change-Id: I0c7192c59198a92d9ba3e22bf1b44db3522b2c24
---
M CirrusSearch.php
A includes/Maintenance/Validators/MappingValidator.php
M maintenance/updateOneSearchIndexConfig.php
3 files changed, 131 insertions(+), 120 deletions(-)

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



diff --git a/CirrusSearch.php b/CirrusSearch.php
index ff0e288..c0972b9 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -588,6 +588,7 @@
 
$wgAutoloadClasses['CirrusSearch\Maintenance\Validators\NumberOfShardsValidator']
 = $maintenanceDir . '/Validators/NumberOfShardsValidator.php';
 
$wgAutoloadClasses['CirrusSearch\Maintenance\Validators\ReplicaRangeValidator'] 
= $maintenanceDir . '/Validators/ReplicaRangeValidator.php';
 $wgAutoloadClasses['CirrusSearch\Maintenance\Validators\AnalyzersValidator'] = 
$maintenanceDir . '/Validators/AnalyzersValidator.php';
+$wgAutoloadClasses['CirrusSearch\Maintenance\Validators\MappingValidator'] = 
$maintenanceDir . '/Validators/MappingValidator.php';
 $wgAutoloadClasses['CirrusSearch\Maintenance\UpdateVersionIndex'] = __DIR__ . 
'/maintenance/updateVersionIndex.php';
 $wgAutoloadClasses['CirrusSearch\NearMatchPicker'] = $includes . 
'NearMatchPicker.php';
 $wgAutoloadClasses['CirrusSearch\OtherIndexes'] = $includes . 
'OtherIndexes.php';
diff --git a/includes/Maintenance/Validators/MappingValidator.php 
b/includes/Maintenance/Validators/MappingValidator.php
new file mode 100644
index 000..32a1fc0
--- /dev/null
+++ b/includes/Maintenance/Validators/MappingValidator.php
@@ -0,0 +1,119 @@
+?php
+
+namespace CirrusSearch\Maintenance\Validators;
+
+use CirrusSearch\ElasticsearchIntermediary;
+use CirrusSearch\Maintenance\Maintenance;
+use Elastica\Exception\ExceptionInterface;
+use Elastica\Index;
+use Elastica\Type;
+use Elastica\Type\Mapping;
+
+class MappingValidator extends Validator {
+   /**
+* @var Index
+*/
+   private $index;
+
+   /**
+* @var bool
+*/
+   private $optimizeIndexForExperimentalHighlighter;
+
+   /**
+* @var array
+*/
+   private $availablePlugins;
+
+   /**
+* @var array
+*/
+   private $mappingConfig;
+
+   /**
+* @var Type
+*/
+   private $pageType;
+
+   /**
+* @var Type
+*/
+   private $namespaceType;
+
+   /**
+* @todo: this constructor takes way too much arguments - refactor
+*
+* @param Index $index
+* @param bool $optimizeIndexForExperimentalHighlighter
+* @param array $availablePlugins
+* @param array $mappingConfig
+* @param Type $pageType
+* @param Type $namespaceType
+* @param Maintenance $out
+*/
+   public function __construct( Index $index, 
$optimizeIndexForExperimentalHighlighter, array $availablePlugins, array 
$mappingConfig, Type $pageType, Type $namespaceType, Maintenance $out = null ) {
+   parent::__construct( $out );
+
+   $this-index = $index;
+   $this-optimizeIndexForExperimentalHighlighter = 
$optimizeIndexForExperimentalHighlighter;
+   $this-availablePlugins = $availablePlugins;
+   $this-mappingConfig = $mappingConfig;
+   $this-pageType = $pageType;
+   $this-namespaceType = $namespaceType;
+   }
+
+   public function validate() {
+   $this-outputIndented( Validating mappings... );
+   if ( $this-optimizeIndexForExperimentalHighlighter 
+   !in_array( 'experimental highlighter', 
$this-availablePlugins ) ) {
+   $this-output( impossible!\n );
+   $this-error( 
wgCirrusSearchOptimizeIndexForExperimentalHighlighter is set to true but the  
.
+   'experimental highlighter' plugin is not 
installed on all hosts., 1 );
+   return false;
+   }
+
+   $requiredMappings = $this-mappingConfig;
+   if ( !$this-checkMapping( $requiredMappings ) ) {
+   // TODO Conflict resolution here might leave old 
portions of mappings
+   $pageAction = new Mapping( $this-pageType );
+   foreach ( $requiredMappings[ 'page' ] as $key = $value 
) {
+   $pageAction-setParam( $key, $value );
+   }
+   $namespaceAction = new Mapping( $this-namespaceType );
+   foreach ( $requiredMappings[ 'namespace' ] as $key = 
$value ) {
+   $namespaceAction-setParam( $key, $value );
+

[MediaWiki-commits] [Gerrit] Make Validator::validate methods return Status object - change (mediawiki...CirrusSearch)

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

Change subject: Make Validator::validate methods return Status object
..


Make Validator::validate methods return Status object

This makes it possible to return the exact error message at
that point, so we can remove the error() method in Validator.

Change-Id: I1e77ad5334938e312b2907542dce7046a7009db8
---
M includes/Maintenance/Validators/AnalyzersValidator.php
M includes/Maintenance/Validators/CacheWarmersValidator.php
M includes/Maintenance/Validators/MappingValidator.php
M includes/Maintenance/Validators/MaxShardsPerNodeValidator.php
M includes/Maintenance/Validators/NumberOfShardsValidator.php
M includes/Maintenance/Validators/ReplicaRangeValidator.php
M includes/Maintenance/Validators/ShardAllocationValidator.php
M includes/Maintenance/Validators/Validator.php
M maintenance/updateOneSearchIndexConfig.php
9 files changed, 85 insertions(+), 55 deletions(-)

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



diff --git a/includes/Maintenance/Validators/AnalyzersValidator.php 
b/includes/Maintenance/Validators/AnalyzersValidator.php
index 85cb59f..25f552a 100644
--- a/includes/Maintenance/Validators/AnalyzersValidator.php
+++ b/includes/Maintenance/Validators/AnalyzersValidator.php
@@ -5,6 +5,8 @@
 use CirrusSearch\Maintenance\AnalysisConfigBuilder;
 use CirrusSearch\Maintenance\Maintenance;
 use Elastica\Index;
+use RawMessage;
+use Status;
 
 class AnalyzersValidator extends Validator {
/**
@@ -29,6 +31,9 @@
$this-analysisConfigBuilder = $analysisConfigBuilder;
}
 
+   /**
+* @return Status
+*/
public function validate() {
$this-outputIndented( Validating analyzers... );
$settings = $this-index-getSettings()-get();
@@ -37,9 +42,12 @@
$this-output( ok\n );
} else {
$this-output( cannot correct\n );
-   return false;
+   return Status::newFatal( new RawMessage(
+   This script encountered an index difference 
that requires that the index be\n .
+   copied, indexed to, and then the old index 
removed. Re-run this script with the\n .
+   --reindexAndRemoveOk --indexIdentifier=now 
parameters to do this. ) );
}
 
-   return true;
+   return Status::newGood();
}
 }
diff --git a/includes/Maintenance/Validators/CacheWarmersValidator.php 
b/includes/Maintenance/Validators/CacheWarmersValidator.php
index 5204ab2..5a3e231 100644
--- a/includes/Maintenance/Validators/CacheWarmersValidator.php
+++ b/includes/Maintenance/Validators/CacheWarmersValidator.php
@@ -9,6 +9,8 @@
 use Elastica;
 use Elastica\Exception\ResponseException;
 use Elastica\Type;
+use RawMessage;
+use Status;
 use Title;
 
 class CacheWarmersValidator extends Validator {
@@ -35,7 +37,7 @@
}
 
/**
-* @return bool
+* @return Status
 */
public function validate() {
$this-outputIndented( Validating cache warmers...\n );
@@ -46,8 +48,11 @@
$warmersToUpdate = $this-diff( $expectedWarmers, 
$actualWarmers );
$warmersToDelete = array_diff_key( $actualWarmers, 
$expectedWarmers );
 
-   return $this-updateWarmers( $warmersToUpdate )
-$this-deleteWarmers( $warmersToDelete );
+   $status = $this-updateWarmers( $warmersToUpdate );
+   $status2 = $this-deleteWarmers( $warmersToDelete );
+
+   $status-merge( $status2 );
+   return $status;
}
 
private function buildExpectedWarmers() {
@@ -114,18 +119,18 @@
} catch ( ResponseException $e ) {
if ( preg_match( '/dynamic scripting for 
\\[.*\\] disabled/', $e-getResponse()-getError() ) ) {
$this-output( couldn't create dynamic 
script!\n );
-   $this-error( Couldn't create the 
dynamic script required for Cirrus to work properly.   .
+   return Status::newFatal( new RawMessage(
+   Couldn't create the dynamic 
script required for Cirrus to work properly.   .
For now, Cirrus requires 
dynamic scripting.  It'll switch to sandboxed Groovy when it  .
updates to support 
Elasticsearch 1.3.1 we promise.  For now enable dynamic scripting and  .
keep Elasticsearch safely not 
accessible to people you don't trust.  You should always  .
-   do that, but 

[MediaWiki-commits] [Gerrit] Move validateAllAlias code into separate class - change (mediawiki...CirrusSearch)

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

Change subject: Move validateAllAlias code into separate class
..


Move validateAllAlias code into separate class

This has a minor change in functionality:

It contains code from removeOldIndeciesIfRequired already, while that's
also still in the maintenance script. Goal is for validateSpecificAlias
to also move into a Validator class, that extends from this new
Validator class.
In maintenance script, both (AllAlias  SpecificAlias) were run, and
stuff in $this-removeIndecies was cleaned up after both were run. If
we move both into separate objects, the $this-removeIndecies alternative
will be run twice, right after each has run.

Change-Id: Idbbd403b8190ae832a6b15734adb25b71d43b534
---
M CirrusSearch.php
A includes/Maintenance/Validators/IndexAliasValidator.php
M maintenance/updateOneSearchIndexConfig.php
3 files changed, 139 insertions(+), 37 deletions(-)

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



diff --git a/CirrusSearch.php b/CirrusSearch.php
index c0972b9..6ca539f 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -589,6 +589,7 @@
 
$wgAutoloadClasses['CirrusSearch\Maintenance\Validators\ReplicaRangeValidator'] 
= $maintenanceDir . '/Validators/ReplicaRangeValidator.php';
 $wgAutoloadClasses['CirrusSearch\Maintenance\Validators\AnalyzersValidator'] = 
$maintenanceDir . '/Validators/AnalyzersValidator.php';
 $wgAutoloadClasses['CirrusSearch\Maintenance\Validators\MappingValidator'] = 
$maintenanceDir . '/Validators/MappingValidator.php';
+$wgAutoloadClasses['CirrusSearch\Maintenance\Validators\IndexAliasValidator'] 
= $maintenanceDir . '/Validators/IndexAliasValidator.php';
 $wgAutoloadClasses['CirrusSearch\Maintenance\UpdateVersionIndex'] = __DIR__ . 
'/maintenance/updateVersionIndex.php';
 $wgAutoloadClasses['CirrusSearch\NearMatchPicker'] = $includes . 
'NearMatchPicker.php';
 $wgAutoloadClasses['CirrusSearch\OtherIndexes'] = $includes . 
'OtherIndexes.php';
diff --git a/includes/Maintenance/Validators/IndexAliasValidator.php 
b/includes/Maintenance/Validators/IndexAliasValidator.php
new file mode 100644
index 000..9e9604a
--- /dev/null
+++ b/includes/Maintenance/Validators/IndexAliasValidator.php
@@ -0,0 +1,131 @@
+?php
+
+namespace CirrusSearch\Maintenance\Validators;
+
+use CirrusSearch\Maintenance\Maintenance;
+use Elastica\Client;
+use RawMessage;
+use Status;
+
+class IndexAliasValidator extends Validator {
+   /**
+* @var Client
+*/
+   protected $client;
+
+   /**
+* @var string
+*/
+   protected $aliasName;
+
+   /**
+* @var string
+*/
+   protected $specificIndexName;
+
+   /**
+* @var bool
+*/
+   private $startOver;
+
+   /**
+* @var array
+*/
+   protected $create = array();
+
+   /**
+* @var array
+*/
+   protected $remove = array();
+
+   /**
+* @param Client $client
+* @param string $aliasName
+* @param string $specificIndexName
+* @param bool $startOver
+* @param Maintenance $out
+*/
+   public function __construct( Client $client, $aliasName, 
$specificIndexName, $startOver, Maintenance $out = null ) {
+   parent::__construct( $out );
+
+   $this-client = $client;
+   $this-aliasName = $aliasName;
+   $this-specificIndexName = $specificIndexName;
+   $this-startOver = $startOver;
+   }
+
+   /**
+* @return Status
+*/
+   public function validate() {
+   // arrays of aliases to be added/removed
+   $add = $remove = array();
+
+   $this-outputIndented( \tValidating $this-aliasName alias... 
);
+   $status = $this-client-getStatus();
+   if ( $status-indexExists( $this-aliasName ) ) {
+   $this-output( is an index... );
+   if ( $this-startOver ) {
+   $this-client-getIndex( $this-aliasName 
)-delete();
+   $this-output( index removed... );
+
+   $add[] = $this-specificIndexName;
+   } else {
+   $this-output( cannot correct!\n );
+   return Status::newFatal( new RawMessage(
+   There is currently an index with the 
name of the alias.  Rerun this\n .
+   script with --startOver and it'll 
remove the index and continue.\n ) );
+   }
+   } else {
+   foreach ( $status-getIndicesWithAlias( 
$this-aliasName ) as $index ) {
+   if ( $index-getName() === 
$this-specificIndexName ) {
+   

[MediaWiki-commits] [Gerrit] fix ToC missing top-level entry - change (apps...wikipedia)

2014-12-04 Thread Brion VIBBER (Code Review)
Brion VIBBER has uploaded a new change for review.

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

Change subject: fix ToC missing top-level entry
..

fix ToC missing top-level entry

Change-Id: Ife31adfe528a095064a424671669e03b69b7434c
---
M wikipedia/View Controllers/TableOfContents/TOCViewController.m
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia 
refs/changes/53/177553/1

diff --git a/wikipedia/View Controllers/TableOfContents/TOCViewController.m 
b/wikipedia/View Controllers/TableOfContents/TOCViewController.m
index eaa8b2f..50faf42 100644
--- a/wikipedia/View Controllers/TableOfContents/TOCViewController.m
+++ b/wikipedia/View Controllers/TableOfContents/TOCViewController.m
@@ -596,13 +596,13 @@
 for (MWKSection *section in [sections copy]) {
 
 NSString *title = [section tocTitle];
-if (!section.sectionId || !section.level || !title) continue;
+//if (!section.sectionId || !section.level || !title) continue;
 
 NSDictionary *sectionDict =
 @{
   @id: @(section.sectionId),
   @isLead: @([section isLeadSection]),
-  @level: section.level,
+  @level: section.level ? section.level : @0,
   @title: title
 };
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ife31adfe528a095064a424671669e03b69b7434c
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER br...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Make ElasticaConnection a real singleton - change (mediawiki...Elastica)

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

Change subject: Make ElasticaConnection a real singleton
..


Make ElasticaConnection a real singleton

2 reasons to make it a real singleton:
* In code using this, I want less tight coupling. Instead of static function
  calls (like Connection::setTimeout or Connection::destroySingleton), I
  would prefer to be able to just pass it a certain (descendant of) an object
  where I can then -setTimeout on.
* This class is meant to be extended (it's abstract, needs getServerList)
  but it would currently only support 1 connection (regardless of however
  classes extend from this one, all will have the same self::$client of
  whichever class called that first.

I've kept all old methods for BC. New methods are horribly named (suffix '2')
so I'm open for suggestions there :)

I've also removed $options argument from getClient(). It wasn't used anywhere
in Elastica/CirrusSearch, and its implementation probably should've been
revisited anyway.

Change-Id: I5848fac3a79fc694875f5bc5ca3073d7a0190e55
---
M ElasticaConnection.php
1 file changed, 70 insertions(+), 19 deletions(-)

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



diff --git a/ElasticaConnection.php b/ElasticaConnection.php
index 8347203..696e3e2 100644
--- a/ElasticaConnection.php
+++ b/ElasticaConnection.php
@@ -20,10 +20,25 @@
  */
 abstract class ElasticaConnection {
/**
-* Singleton instance of the client
 * @var \Elastica\Client
 */
-   private static $client = null;
+   protected $client;
+
+   protected function __construct() {
+   // This is a singleton
+   }
+
+   /**
+* @return static
+*/
+   public static function getSingleton() {
+   static $instance;
+   if ( !$instance ) {
+   $instance = new static;
+   }
+
+   return $instance;
+   }
 
/**
 * @return array(string) server ips or hostnames
@@ -43,8 +58,8 @@
 * Set the client side timeout to be used for the rest of this process.
 * @param int $timeout timeout in seconds
 */
-   public static function setTimeout( $timeout ) {
-   $client = self::getClient();
+   public function setTimeout2( $timeout ) {
+   $client = $this-getClient2();
// Set the timeout for new connections
$client-setConfigValue( 'timeout', $timeout );
foreach ( $client-getConnections() as $connection ) {
@@ -54,26 +69,25 @@
 
/**
 * Fetch a connection.
-* @param array $options Passed to the constructor when creating the 
singleton.
 * @return \Elastica\Client
 */
-   public static function getClient( $options = null ) {
-   if ( self::$client === null ) {
+   public function getClient2() {
+   if ( $this-client === null ) {
// Setup the Elastica servers
$servers = array();
-   $me = new static( $options );
-   foreach ( $me-getServerList() as $server ) {
+   foreach ( $this-getServerList() as $server ) {
$servers[] = array( 'host' = $server );
}
 
-   self::$client = new \Elastica\Client( array( 'servers' 
= $servers ),
+   $self = $this;
+   $this-client = new \Elastica\Client( array( 'servers' 
= $servers ),
/**
 * Callback for \Elastica\Client on request 
failures.
 * @param \Elastica\Connection $connection The 
current connection to elasticasearch
 * @param \Elastica\Exception $e Exception to 
be thrown if we don't do anything
-* @param \ElasticaConnection $me Child class 
of us
+* @param \ElasticaConnection $self This class
 */
-   function( $connection, $e ) use ( $me ) {
+   function( $connection, $e ) use ( $self ) {
// We only want to try to reconnect on 
http connection errors
// Beyond that we want to give up fast. 
 Configuring a single connection
// through LVS accomplishes this.
@@ -104,7 +118,7 @@
? $connectionAttempts[ $host ] 
+ 1 : 1;
 
// Check if we've hit the host the max 
# of times. If not, try again
-   if ( 

  1   2   3   4   5   >