[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Change the punctuation of apierror-baddiff

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329658 )

Change subject: Change the punctuation of apierror-baddiff
..


Change the punctuation of apierror-baddiff

A comma implies that one of three different things happened.
A full stop makes it clear that one thing happened, and one of
the two reasons in the next sentence was the reason for it.

Change-Id: I79aa8222dd0f6f1af74bc2017c4e058a559ef719
---
M includes/api/i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json
index f6eeffe..bdc5c80 100644
--- a/includes/api/i18n/en.json
+++ b/includes/api/i18n/en.json
@@ -1553,7 +1553,7 @@
"apierror-autoblocked": "Your IP address has been blocked 
automatically, because it was used by a blocked user.",
"apierror-badconfig-resulttoosmall": "The value of 
$wgAPIMaxResultSize on this wiki is too small to hold basic result 
information.",
"apierror-badcontinue": "Invalid continue param. You should pass the 
original value returned by the previous query.",
-   "apierror-baddiff": "The diff cannot be retrieved, one or both 
revisions do not exist or you do not have permission to view them.",
+   "apierror-baddiff": "The diff cannot be retrieved. One or both 
revisions do not exist or you do not have permission to view them.",
"apierror-baddiffto": "$1diffto must be set to a 
non-negative number, prev, next or cur.",
"apierror-badformat-generic": "The requested format $1 is not supported 
for content model $2.",
"apierror-badformat": "The requested format $1 is not supported for 
content model $2 used by $3.",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I79aa8222dd0f6f1af74bc2017c4e058a559ef719
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Amire80 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Change the punctuation of apierror-baddiff

2016-12-29 Thread Amire80 (Code Review)
Amire80 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329658 )

Change subject: Change the punctuation of apierror-baddiff
..

Change the punctuation of apierror-baddiff

A comma implies that one of three different things happened.
A full stop makes it clear that one thing happened, and one of
the two reasons in the next sentence was the reason for it.

Change-Id: I79aa8222dd0f6f1af74bc2017c4e058a559ef719
---
M includes/api/i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/58/329658/1

diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json
index f6eeffe..bdc5c80 100644
--- a/includes/api/i18n/en.json
+++ b/includes/api/i18n/en.json
@@ -1553,7 +1553,7 @@
"apierror-autoblocked": "Your IP address has been blocked 
automatically, because it was used by a blocked user.",
"apierror-badconfig-resulttoosmall": "The value of 
$wgAPIMaxResultSize on this wiki is too small to hold basic result 
information.",
"apierror-badcontinue": "Invalid continue param. You should pass the 
original value returned by the previous query.",
-   "apierror-baddiff": "The diff cannot be retrieved, one or both 
revisions do not exist or you do not have permission to view them.",
+   "apierror-baddiff": "The diff cannot be retrieved. One or both 
revisions do not exist or you do not have permission to view them.",
"apierror-baddiffto": "$1diffto must be set to a 
non-negative number, prev, next or cur.",
"apierror-badformat-generic": "The requested format $1 is not supported 
for content model $2.",
"apierror-badformat": "The requested format $1 is not supported for 
content model $2 used by $3.",

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

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

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


[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Remove serialization test cheat; make tests actually pass

2016-12-29 Thread Divec (Code Review)
Divec has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329657 )

Change subject: Remove serialization test cheat; make tests actually pass
..

Remove serialization test cheat; make tests actually pass

The author of I1eccd4ef99d764911994d11d747f13ae42919eff is clearly a very shady 
character

Change-Id: I69038332adf57ce43edd85930028d337a4946356
---
M tests/dm/ve.dm.Change.test.js
1 file changed, 32 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/57/329657/1

diff --git a/tests/dm/ve.dm.Change.test.js b/tests/dm/ve.dm.Change.test.js
index ef67971..53e404e 100644
--- a/tests/dm/ve.dm.Change.test.js
+++ b/tests/dm/ve.dm.Change.test.js
@@ -269,28 +269,34 @@
serialized = {
start: 0,
transactions: [
-   [
-   { type: 'retain', length: 1 },
-   {
-   type: 'replace',
-   remove: [],
-   insert: [ [ 'f', bIndex ] ],
-   insertedDataOffset: 0,
-   insertedDataLength: 1
-   },
-   { type: 'retain', length: 4 }
-   ],
-   [
-   { type: 'retain', length: 2 },
-   {
-   type: 'replace',
-   remove: [],
-   insert: [ [ 'u', bIndex ] ],
-   insertedDataOffset: 0,
-   insertedDataLength: 1
-   },
-   { type: 'retain', length: 4 }
-   ]
+   {
+   author: null,
+   operations: [
+   { type: 'retain', length: 1 },
+   {
+   type: 'replace',
+   remove: [],
+   insert: [ [ 'f', bIndex 
] ],
+   insertedDataOffset: 0,
+   insertedDataLength: 1
+   },
+   { type: 'retain', length: 4 }
+   ]
+   },
+   {
+   author: null,
+   operations: [
+   { type: 'retain', length: 2 },
+   {
+   type: 'replace',
+   remove: [],
+   insert: [ [ 'u', bIndex 
] ],
+   insertedDataOffset: 0,
+   insertedDataLength: 1
+   },
+   { type: 'retain', length: 4 }
+   ]
+   }
],
stores: [
{
@@ -305,7 +311,10 @@
},
hashes: bIndex
},
-   {}
+   {
+   hashStore: {},
+   hashes: []
+   }
],
selections: {}
};
@@ -313,7 +322,6 @@
// Fixup second insert
change.transactions[ 1 ].operations[ 2 ].length += 1;
 
-   serialized = change.serialize();
assert.deepEqual( change.serialize(), serialized, 'Serialize' );
 
assert.deepEqual(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I69038332adf57ce43edd85930028d337a4946356
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerr

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: getCategoryLinks should catch invalid category title exceptions

2016-12-29 Thread Huji (Code Review)
Huji has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329656 )

Change subject: getCategoryLinks should catch invalid category title exceptions
..

getCategoryLinks should catch invalid category title exceptions

Bug: T154309
Change-Id: Id12ca20f7acbaac78bd3afe76970d3cd7631e1b1
---
M pywikibot/textlib.py
1 file changed, 11 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/56/329656/1

diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 9f7782e..3e4b765 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -1101,11 +1101,17 @@
 title, sortKey = rest.split('|', 1)
 else:
 title, sortKey = rest, None
-cat = pywikibot.Category(pywikibot.Link(
- '%s:%s' % (match.group('namespace'), title),
- site),
- sortKey=sortKey)
-result.append(cat)
+try:
+cat = pywikibot.Category(pywikibot.Link(
+ '%s:%s' % (match.group('namespace'), 
title),
+ site),
+ sortKey=sortKey)
+result.append(cat)
+except:
+# Category title extracted contains invalid characters
+# Likely due to on-the-fly category name creation, see T154309
+pywikibot.warning('Invalid category title extracted: %' % title)
+
 return result
 
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Make PropertyValueSnakFormatterTest compatible with DataType...

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329491 )

Change subject: Make PropertyValueSnakFormatterTest compatible with DataTypes 
master
..


Make PropertyValueSnakFormatterTest compatible with DataTypes master

This test fails with the current (unreleased) master of DataTypes, see
https://github.com/wmde/DataTypes/compare/0.5.2...master
Empty strings are forbidden now in the DataType class.

Change-Id: Ic46b5b910f5d4b1f5c8a6eeceac7b4fea1b9595f
---
M lib/tests/phpunit/Formatters/PropertyValueSnakFormatterTest.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Aude: Looks good to me, approved
  Aleksey Bekh-Ivanov (WMDE): Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/lib/tests/phpunit/Formatters/PropertyValueSnakFormatterTest.php 
b/lib/tests/phpunit/Formatters/PropertyValueSnakFormatterTest.php
index c6d8caf..02d2fee 100644
--- a/lib/tests/phpunit/Formatters/PropertyValueSnakFormatterTest.php
+++ b/lib/tests/phpunit/Formatters/PropertyValueSnakFormatterTest.php
@@ -207,7 +207,7 @@
'property not found, fail' => array(
new PropertyValueSnak( 7, new StringValue( 
'dummy' ) ),
'', // triggers an exception from the mock 
DataTypeFactory
-   'xxx', // should not be used
+   '', // should not be used
SnakFormatter::FORMAT_HTML,
$dispatchingFormatter,
null,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic46b5b910f5d4b1f5c8a6eeceac7b4fea1b9595f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: Aleksey Bekh-Ivanov (WMDE) 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: WMDE-leszek 
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...Cargo[master]: Improved RL loading of timeline JS

2016-12-29 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329655 )

Change subject: Improved RL loading of timeline JS
..


Improved RL loading of timeline JS

Change-Id: I033054d2c8519a6b7b6e6e91168c62ae231ced35
---
M Cargo.php
M extension.json
M libs/ext.cargo.timeline.js
3 files changed, 27 insertions(+), 15 deletions(-)

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



diff --git a/Cargo.php b/Cargo.php
index eccc8e9..50f1943 100644
--- a/Cargo.php
+++ b/Cargo.php
@@ -222,6 +222,17 @@
'localBasePath' => __DIR__,
'remoteExtPath' => 'Cargo'
),
+   'ext.cargo.timelinebase' => array(
+   'scripts' => array(
+   'libs/ext.cargo.timeline.js',
+   'libs/SimileTimeline/scripts/timeline.js',
+   'libs/SimileTimeline/scripts/util/platform.js',
+   'libs/SimileTimeline/scripts/util/xmlhttp.js',
+   'libs/SimileTimeline/scripts/util/data-structure.js',
+   'libs/SimileTimeline/scripts/units.js',
+   'libs/SimileTimeline/scripts/sources.js',
+   )
+   ),
'ext.cargo.timeline' => array(
'styles' => array(
'libs/SimileTimeline/styles/timeline.css',
@@ -229,25 +240,19 @@
'libs/SimileTimeline/styles/events.css',
),
'scripts' => array(
-   'libs/ext.cargo.timeline.js',
-   'libs/SimileTimeline/scripts/timeline.js',
-   'libs/SimileTimeline/scripts/util/platform.js',
'libs/SimileTimeline/scripts/util/debug.js',
-   'libs/SimileTimeline/scripts/util/xmlhttp.js',
'libs/SimileTimeline/scripts/util/dom.js',
'libs/SimileTimeline/scripts/util/graphics.js',
'libs/SimileTimeline/scripts/util/date-time.js',
-   'libs/SimileTimeline/scripts/util/data-structure.js',
-   'libs/SimileTimeline/scripts/units.js',
'libs/SimileTimeline/scripts/themes.js',
'libs/SimileTimeline/scripts/ethers.js',
'libs/SimileTimeline/scripts/ether-painters.js',
'libs/SimileTimeline/scripts/labellers.js',
-   'libs/SimileTimeline/scripts/sources.js',
'libs/SimileTimeline/scripts/layouts.js',
'libs/SimileTimeline/scripts/painters.js',
'libs/SimileTimeline/scripts/decorators.js',
),
+   'dependencies' => 'timelinebase',
'position' => 'top',
'localBasePath' => __DIR__,
'remoteExtPath' => 'Cargo'
diff --git a/extension.json b/extension.json
index e59f32a..58994da 100755
--- a/extension.json
+++ b/extension.json
@@ -159,6 +159,17 @@
],
"position": "top"
},
+   "ext.cargo.timelinebase": {
+   "scripts": [
+   "libs/ext.cargo.timeline.js",
+   "libs/SimileTimeline/scripts/timeline.js",
+   "libs/SimileTimeline/scripts/util/platform.js",
+   "libs/SimileTimeline/scripts/util/xmlhttp.js",
+   
"libs/SimileTimeline/scripts/util/data-structure.js",
+   "libs/SimileTimeline/scripts/units.js",
+   "libs/SimileTimeline/scripts/sources.js"
+   ]
+   },
"ext.cargo.timeline": {
"styles": [
"libs/SimileTimeline/styles/timeline.css",
@@ -166,25 +177,21 @@
"libs/SimileTimeline/styles/events.css"
],
"scripts": [
-   "libs/ext.cargo.timeline.js",
-   "libs/SimileTimeline/scripts/timeline.js",
-   "libs/SimileTimeline/scripts/util/platform.js",
"libs/SimileTimeline/scripts/util/debug.js",
-   "libs/SimileTimeline/scripts/util/xmlhttp.js",
"libs/SimileTimeline/scripts/util/dom.js",
"libs/SimileTimeline/scripts/util/graphics.js",
"libs/SimileTimeline/scripts/util/date-time.js",
-   
"libs/SimileTimeline/scripts/util/data-structure.js",
-   "libs/SimileTimeline/scripts/units.js",
"lib

[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Improved RL loading of timeline JS

2016-12-29 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329655 )

Change subject: Improved RL loading of timeline JS
..

Improved RL loading of timeline JS

Change-Id: I033054d2c8519a6b7b6e6e91168c62ae231ced35
---
M Cargo.php
M extension.json
M libs/ext.cargo.timeline.js
3 files changed, 27 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/55/329655/2

diff --git a/Cargo.php b/Cargo.php
index eccc8e9..50f1943 100644
--- a/Cargo.php
+++ b/Cargo.php
@@ -222,6 +222,17 @@
'localBasePath' => __DIR__,
'remoteExtPath' => 'Cargo'
),
+   'ext.cargo.timelinebase' => array(
+   'scripts' => array(
+   'libs/ext.cargo.timeline.js',
+   'libs/SimileTimeline/scripts/timeline.js',
+   'libs/SimileTimeline/scripts/util/platform.js',
+   'libs/SimileTimeline/scripts/util/xmlhttp.js',
+   'libs/SimileTimeline/scripts/util/data-structure.js',
+   'libs/SimileTimeline/scripts/units.js',
+   'libs/SimileTimeline/scripts/sources.js',
+   )
+   ),
'ext.cargo.timeline' => array(
'styles' => array(
'libs/SimileTimeline/styles/timeline.css',
@@ -229,25 +240,19 @@
'libs/SimileTimeline/styles/events.css',
),
'scripts' => array(
-   'libs/ext.cargo.timeline.js',
-   'libs/SimileTimeline/scripts/timeline.js',
-   'libs/SimileTimeline/scripts/util/platform.js',
'libs/SimileTimeline/scripts/util/debug.js',
-   'libs/SimileTimeline/scripts/util/xmlhttp.js',
'libs/SimileTimeline/scripts/util/dom.js',
'libs/SimileTimeline/scripts/util/graphics.js',
'libs/SimileTimeline/scripts/util/date-time.js',
-   'libs/SimileTimeline/scripts/util/data-structure.js',
-   'libs/SimileTimeline/scripts/units.js',
'libs/SimileTimeline/scripts/themes.js',
'libs/SimileTimeline/scripts/ethers.js',
'libs/SimileTimeline/scripts/ether-painters.js',
'libs/SimileTimeline/scripts/labellers.js',
-   'libs/SimileTimeline/scripts/sources.js',
'libs/SimileTimeline/scripts/layouts.js',
'libs/SimileTimeline/scripts/painters.js',
'libs/SimileTimeline/scripts/decorators.js',
),
+   'dependencies' => 'timelinebase',
'position' => 'top',
'localBasePath' => __DIR__,
'remoteExtPath' => 'Cargo'
diff --git a/extension.json b/extension.json
index e59f32a..58994da 100755
--- a/extension.json
+++ b/extension.json
@@ -159,6 +159,17 @@
],
"position": "top"
},
+   "ext.cargo.timelinebase": {
+   "scripts": [
+   "libs/ext.cargo.timeline.js",
+   "libs/SimileTimeline/scripts/timeline.js",
+   "libs/SimileTimeline/scripts/util/platform.js",
+   "libs/SimileTimeline/scripts/util/xmlhttp.js",
+   
"libs/SimileTimeline/scripts/util/data-structure.js",
+   "libs/SimileTimeline/scripts/units.js",
+   "libs/SimileTimeline/scripts/sources.js"
+   ]
+   },
"ext.cargo.timeline": {
"styles": [
"libs/SimileTimeline/styles/timeline.css",
@@ -166,25 +177,21 @@
"libs/SimileTimeline/styles/events.css"
],
"scripts": [
-   "libs/ext.cargo.timeline.js",
-   "libs/SimileTimeline/scripts/timeline.js",
-   "libs/SimileTimeline/scripts/util/platform.js",
"libs/SimileTimeline/scripts/util/debug.js",
-   "libs/SimileTimeline/scripts/util/xmlhttp.js",
"libs/SimileTimeline/scripts/util/dom.js",
"libs/SimileTimeline/scripts/util/graphics.js",
"libs/SimileTimeline/scripts/util/date-time.js",
-   
"libs/SimileTimeline/scripts/util/data-structure.js",
-   "libs/SimileTimeline/scripts/units.js",
 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix and add more missing PHPDoc lines

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329444 )

Change subject: Fix and add more missing PHPDoc lines
..


Fix and add more missing PHPDoc lines

I uploaded this as a separate patch instead of amending the following
one two have two that are easier to review.

Everything in this patch should be quite trivial and obvious. If you
disagree, then please tell me and I will split this patch into multiple
ones.

Change-Id: I7150d745e1e09ca6b36d502529e292f95f139d14
---
M client/WikibaseClient.hooks.php
M client/includes/Hooks/EchoNotificationsHandlers.php
M lib/includes/Store/GenericEntityInfoBuilder.php
M repo/includes/Api/EditEntity.php
M repo/includes/Api/LinkTitles.php
M repo/includes/Api/RemoveReferences.php
M repo/includes/Api/SetAliases.php
M repo/includes/Api/SetDescription.php
M repo/includes/Api/SetLabel.php
M repo/includes/Api/SetQualifier.php
M repo/includes/Api/SetReference.php
M repo/includes/Api/SetSiteLink.php
M repo/includes/ChangeOp/ChangeOpsMerge.php
M repo/includes/Content/EntityContent.php
M repo/includes/Specials/SpecialListProperties.php
M repo/includes/Specials/SpecialNewEntity.php
M repo/includes/Specials/SpecialNewItem.php
M repo/includes/Specials/SpecialNewProperty.php
18 files changed, 95 insertions(+), 5 deletions(-)

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



diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index 1151ce3..db5ddba 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -366,6 +366,10 @@
 
/**
 * Register the magic word.
+*
+* @param string[] &$aCustomVariableIds
+*
+* @return bool
 */
public static function onMagicWordwgVariableIDs( &$aCustomVariableIds ) 
{
$aCustomVariableIds[] = 'noexternallanglinks';
@@ -376,6 +380,13 @@
 
/**
 * Apply the magic word.
+*
+* @param Parser &$parser
+* @param array &$cache
+* @param string &$magicWordId
+* @param string &$ret
+*
+* @return bool
 */
public static function onParserGetVariableValueSwitch( Parser &$parser, 
&$cache, &$magicWordId, &$ret ) {
if ( $magicWordId === 'noexternallanglinks' ) {
diff --git a/client/includes/Hooks/EchoNotificationsHandlers.php 
b/client/includes/Hooks/EchoNotificationsHandlers.php
index 5419ff1..08b90dc 100644
--- a/client/includes/Hooks/EchoNotificationsHandlers.php
+++ b/client/includes/Hooks/EchoNotificationsHandlers.php
@@ -98,6 +98,10 @@
 * Handler for BeforeCreateEchoEvent hook
 * @see 
https://www.mediawiki.org/wiki/Extension:Echo/BeforeCreateEchoEvent
 * @see doBeforeCreateEchoEvent
+*
+* @param array[] &$notifications
+* @param array[] &$notificationCategories
+* @param array[] &$icons
 */
public static function onBeforeCreateEchoEvent(
array &$notifications,
diff --git a/lib/includes/Store/GenericEntityInfoBuilder.php 
b/lib/includes/Store/GenericEntityInfoBuilder.php
index 3396cc6..7379c42 100644
--- a/lib/includes/Store/GenericEntityInfoBuilder.php
+++ b/lib/includes/Store/GenericEntityInfoBuilder.php
@@ -287,6 +287,8 @@
 
/**
 * @see EntityInfoBuilder::removeMissing
+*
+* @param string $redirects A flag, either "keep-redirects" (default) 
or "remove-redirects".
 */
public function removeMissing( $redirects = 'keep-redirects' ) {
foreach ( array_keys( $this->entityInfo ) as $key ) {
diff --git a/repo/includes/Api/EditEntity.php b/repo/includes/Api/EditEntity.php
index 8d22edb..8b38869 100644
--- a/repo/includes/Api/EditEntity.php
+++ b/repo/includes/Api/EditEntity.php
@@ -163,6 +163,8 @@
 
/**
 * @see ModifyEntity::validateParameters
+*
+* @param array $params
 */
protected function validateParameters( array $params ) {
$hasId = isset( $params['id'] );
@@ -195,6 +197,12 @@
 
/**
 * @see ModifyEntity::modifyEntity
+*
+* @param EntityDocument &$entity
+* @param array $params
+* @param int $baseRevId
+*
+* @return Summary
 */
protected function modifyEntity( EntityDocument &$entity, array 
$params, $baseRevId ) {
$this->validateDataParameter( $params );
diff --git a/repo/includes/Api/LinkTitles.php b/repo/includes/Api/LinkTitles.php
index 2b09ae9..4448964 100644
--- a/repo/includes/Api/LinkTitles.php
+++ b/repo/includes/Api/LinkTitles.php
@@ -212,6 +212,8 @@
 
/**
 * @see ModifyEntity::validateParameters
+*
+* @param array $params
 */
protected function validateParameters( array $params ) {
if ( $params['fromsite'] === $params[

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Add datachecks extension.

2016-12-29 Thread Eileen (Code Review)
Eileen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329654 )

Change subject: Add datachecks extension.
..

Add datachecks extension.

This extension provides a drush action to find contacts with no primary address 
and
one to fix them:

drush cvapi Data.check check=PrimaryLocation
drush cvapi Data.fix check=PrimaryLocation

There are some instances of this currently on live so the thinking would be to 
run
the fix once & then scheduled the check about once a week or so to make sure
it stays fixed (since we've had a few instances of this.

The format is intended to allow other checks & fixes to be added (there is work 
towards
fixing the duplicate locations in it already per Bug: T152474) and things like
munged names are also candidates, and for the extension & fixes to be shareable
with the community.

I think at the moment running the check script via jenkins will probably not 
trigger an email
as the output is 'info-only' variety so possibly an extra drush wrapper will be 
needed.

Currently on staging the DB is clean of PrimaryLocation probs but running
drush cvapi Data.check

also shows some DuplicateLocation issues.

Bug: T145873
Change-Id: I3fcdb3ce19747ed2023ab24c46a31392c4addb43
---
A 
sites/default/civicrm/extensions/org.wikimedia.datachecks/CRM/Datachecks/DuplicateLocation.php
A 
sites/default/civicrm/extensions/org.wikimedia.datachecks/CRM/Datachecks/Hook.php
A 
sites/default/civicrm/extensions/org.wikimedia.datachecks/CRM/Datachecks/PrimaryLocation.php
A sites/default/civicrm/extensions/org.wikimedia.datachecks/LICENSE.txt
A sites/default/civicrm/extensions/org.wikimedia.datachecks/README.md
A 
sites/default/civicrm/extensions/org.wikimedia.datachecks/api/v3/Data/Check.php
A sites/default/civicrm/extensions/org.wikimedia.datachecks/api/v3/Data/Fix.php
A sites/default/civicrm/extensions/org.wikimedia.datachecks/datachecks.civix.php
A sites/default/civicrm/extensions/org.wikimedia.datachecks/datachecks.php
A sites/default/civicrm/extensions/org.wikimedia.datachecks/info.xml
10 files changed, 1,679 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/54/329654/1

diff --git 
a/sites/default/civicrm/extensions/org.wikimedia.datachecks/CRM/Datachecks/DuplicateLocation.php
 
b/sites/default/civicrm/extensions/org.wikimedia.datachecks/CRM/Datachecks/DuplicateLocation.php
new file mode 100644
index 000..a8206ce
--- /dev/null
+++ 
b/sites/default/civicrm/extensions/org.wikimedia.datachecks/CRM/Datachecks/DuplicateLocation.php
@@ -0,0 +1,136 @@
+entities as $entity) {
+  $this->createTemporaryTable($entity);
+
+  $count = CRM_Core_DAO::singleValueQuery("
+SELECT count(*)
+FROM $this->temporaryTable e
+LEFT JOIN civicrm_contact c ON e.contact_id = c.id
+WHERE c.is_deleted = 0
+  ");
+  if ($count) {
+$examples = array();
+$exampleContactsDAO = CRM_Core_DAO::executeQuery(
+  "SELECT contact_id
+  FROM $this->temporaryTable e
+  LEFT JOIN civicrm_contact c ON e.contact_id = c.id
+  WHERE c.is_deleted = 0 LIMIT 5
+");
+
+while ($exampleContactsDAO->fetch()) {
+  $examples[] = $exampleContactsDAO->contact_id;
+}
+// It would be interesting to use the api v3 style arrayobject return 
here.
+$result[$entity] = array(
+  'message' => ts('%1 contact/s have multiple %2 with the same 
location type', array($count, $entity)),
+  'example' => array('contact' => $examples),
+);
+  }
+  $this->dropTemporaryTable();
+}
+return $result;
+  }
+
+  /**
+   * Create a temporary table of all results.
+   *
+   * Filtering this against deleted contacts is more efficient on dbs
+   * with lots of deleted contacts than a single query.
+   *
+   * This query is much slower if you try to include location_type_id in
+   * the group by.
+   *
+   * @param string $entity
+   *
+   * @return string
+   */
+  protected function createTemporaryTable($entity) {
+
+CRM_Core_DAO::executeQuery("
+  CREATE TEMPORARY TABLE {$this->temporaryTable}(
+  SELECT contact_id,
+  IF(count(location_type_id) > COUNT(DISTINCT location_type_id), 1, 0) as 
is_duplicate
+  FROM civicrm_{$entity}
+  WHERE contact_id IS NOT NULL
+  GROUP BY contact_id
+  HAVING is_duplicate  = 1
+  )"
+);
+CRM_Core_DAO::executeQuery("
+  ALTER TABLE {$this->temporaryTable}
+  ADD INDEX contact_id(contact_id)"
+);
+return $this->temporaryTable;
+  }
+
+  /**
+   * Drop the temporary table.
+   *
+   * This would happen anyway but seems cleaner to drop & re-use.
+   */
+  protected function dropTemporaryTable() {
+CRM_Core_DAO::executeQuery("DROP TEMPORARY TABLE {$this->temporaryTable}");
+  }
+
+  /**
+   * Fix the lack of primaries.
+   *
+   * Use a temporary table as a

[MediaWiki-commits] [Gerrit] mediawiki...Wikidata[master]: New Wikidata Build - 2016-12-29T10:00:01+0000

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329594 )

Change subject: New Wikidata Build - 2016-12-29T10:00:01+
..


New Wikidata Build - 2016-12-29T10:00:01+

Change-Id: I1c62e28dd551d2d4a98332eaae1f3af1480010e1
---
M composer.lock
M extensions/Wikibase/client/i18n/atj.json
M extensions/Wikibase/client/i18n/es.json
M extensions/Wikibase/client/i18n/sty.json
M extensions/Wikibase/client/includes/DispatchingServiceFactory.php
M extensions/Wikibase/client/includes/Hooks/InterwikiSortingHookHandlers.php
M 
extensions/Wikibase/client/includes/Notifications/PageConnectionPresentationModel.php
M 
extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php
M 
extensions/Wikibase/client/tests/phpunit/includes/DispatchingServiceWiringTest.php
M 
extensions/Wikibase/client/tests/phpunit/includes/Hooks/EchoNotificationsHandlersTest.php
M 
extensions/Wikibase/client/tests/phpunit/includes/Store/RepositoryServiceWiringTest.php
M extensions/Wikibase/lib/includes/Store/PropertyInfoLookup.php
M extensions/Wikibase/lib/includes/Store/Sql/SqlEntityInfoBuilder.php
M extensions/Wikibase/lib/tests/phpunit/EntityTypesTest.php
M 
extensions/Wikibase/lib/tests/phpunit/Formatters/CommonsThumbnailFormatterTest.php
M extensions/Wikibase/lib/tests/phpunit/Store/DispatchingTermBufferTest.php
M 
extensions/Wikibase/lib/tests/phpunit/Store/HttpUrlPropertyOrderProviderTest.php
M extensions/Wikibase/lib/tests/phpunit/Store/MockPropertyInfoStoreTest.php
M 
extensions/Wikibase/lib/tests/phpunit/Store/WikiPagePropertyOrderProviderTest.php
M extensions/Wikibase/lib/tests/phpunit/Units/UnitStorageTest.php
M extensions/Wikibase/repo/i18n/lb.json
M extensions/Wikibase/repo/i18n/zh-hans.json
M extensions/Wikibase/repo/includes/Api/RemoveQualifiers.php
M extensions/Wikibase/repo/includes/Api/SetAliases.php
M extensions/Wikibase/repo/includes/Api/SetSiteLink.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpAliases.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpDescription.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpMainSnak.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpQualifier.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpQualifierRemove.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpReference.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpReferenceRemove.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpSiteLink.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpStatementRank.php
M extensions/Wikibase/repo/includes/MediaWikiLanguageDirectionalityLookup.php
M extensions/Wikibase/repo/includes/Parsers/MwTimeIsoParser.php
M extensions/Wikibase/repo/includes/Specials/SpecialNewProperty.php
M extensions/Wikibase/repo/includes/Store/Sql/EntityPerPageTable.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Actions/ViewEntityActionTest.php
M extensions/Wikibase/repo/tests/phpunit/includes/EntityTypesTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Specials/SpecialItemByTitleTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php
M extensions/Wikibase/view/resources/wikibase/view/ViewFactory.js
M vendor/composer/installed.json
44 files changed, 113 insertions(+), 55 deletions(-)

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



diff --git a/composer.lock b/composer.lock
index 90e6a18..7311cb0 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1585,12 +1585,12 @@
 "source": {
 "type": "git",
 "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
-"reference": "aeabf1549b026c49fdd872c1b066bd764357aa5b"
+"reference": "54e002bd93d17b90ae5cb78b868a97a926c55c00"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/aeabf1549b026c49fdd872c1b066bd764357aa5b";,
-"reference": "aeabf1549b026c49fdd872c1b066bd764357aa5b",
+"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/54e002bd93d17b90ae5cb78b868a97a926c55c00";,
+"reference": "54e002bd93d17b90ae5cb78b868a97a926c55c00",
 "shasum": ""
 },
 "require": {
@@ -1663,7 +1663,7 @@
 "wikibaserepo",
 "wikidata"
 ],
-"time": "2016-12-26 21:42:40"
+"time": "2016-12-29 09:25:42"
 },
 {
 "name": "wikibase/wikimedia-badges",
diff --git a/extensions/Wikibase/client/i18n/atj.json 
b/extensions/Wikibase/client/i18n/atj.json
index a7f406d..a40e888 100644
--- a/extensions/Wikibase/client/i18n/atj.json
+++ b/extensions/Wikibase/client/i18n/atj.json
@@ -8,6 +8,7 @@
 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add tags support to the following API modules

2016-12-29 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329653 )

Change subject: Add tags support to the following API modules
..

Add tags support to the following API modules

* imagerotate
* revisiondelete
* tag

Bug: T97720
Change-Id: I11418d22ee780944e92d82e32b271b8276c396bf
---
M includes/api/ApiImageRotate.php
M includes/api/ApiRevisionDelete.php
M includes/api/ApiTag.php
M includes/api/i18n/en.json
M includes/api/i18n/qqq.json
M includes/revisiondelete/RevDelList.php
6 files changed, 55 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/53/329653/1

diff --git a/includes/api/ApiImageRotate.php b/includes/api/ApiImageRotate.php
index 72fb16d..92ac745 100644
--- a/includes/api/ApiImageRotate.php
+++ b/includes/api/ApiImageRotate.php
@@ -42,6 +42,14 @@
'invalidTitles', 'special', 'missingIds', 
'missingRevIds', 'interwikiTitles',
] );
 
+   // Check if user can add tags
+   if ( count( $params['tags'] ) ) {
+   $ableToTag = ChangeTags::canAddTagsAccompanyingChange( 
$params['tags'], $this->getUser() );
+   if ( !$ableToTag->isOK() ) {
+   $this->dieStatus( $ableToTag );
+   }
+   }
+
foreach ( $pageSet->getTitles() as $title ) {
$r = [];
$r['id'] = $title->getArticleID();
@@ -105,7 +113,7 @@
'rotate-comment'
)->numParams( $rotation 
)->inContentLanguage()->text();
$status = $file->upload( $dstPath,
-   $comment, $comment, 0, false, false, 
$this->getUser() );
+   $comment, $comment, 0, false, false, 
$this->getUser(), $params['tags'] ?: [] );
if ( $status->isGood() ) {
$r['result'] = 'Success';
} else {
@@ -157,6 +165,10 @@
'continue' => [
ApiBase::PARAM_HELP_MSG => 
'api-help-param-continue',
],
+   'tags' => [
+   ApiBase::PARAM_TYPE => 'tags',
+   ApiBase::PARAM_ISMULTI => true,
+   ],
];
if ( $flags ) {
$result += $this->getPageSet()->getFinalParams( $flags 
);
diff --git a/includes/api/ApiRevisionDelete.php 
b/includes/api/ApiRevisionDelete.php
index 763aef5..1748eb9 100644
--- a/includes/api/ApiRevisionDelete.php
+++ b/includes/api/ApiRevisionDelete.php
@@ -46,6 +46,14 @@
$this->dieWithError( [ 'apierror-paramempty', 'ids' ], 
'paramempty_ids' );
}
 
+   // Check if user can add tags
+   if ( count( $params['tags'] ) ) {
+   $ableToTag = ChangeTags::canAddTagsAccompanyingChange( 
$params['tags'], $user );
+   if ( !$ableToTag->isOK() ) {
+   $this->dieStatus( $ableToTag );
+   }
+   }
+
$hide = $params['hide'] ?: [];
$show = $params['show'] ?: [];
if ( array_intersect( $hide, $show ) ) {
@@ -91,7 +99,7 @@
$params['type'], $this->getContext(), $targetObj, 
$params['ids']
);
$status = $list->setVisibility(
-   [ 'value' => $bitfield, 'comment' => $params['reason'], 
'perItemStatus' => true ]
+   [ 'value' => $bitfield, 'comment' => $params['reason'], 
'perItemStatus' => true, 'tags' => $params['tags'] ]
);
 
$result = $this->getResult();
@@ -165,6 +173,10 @@
ApiBase::PARAM_DFLT => 'nochange',
],
'reason' => null,
+   'tags' => [
+   ApiBase::PARAM_TYPE => 'tags',
+   ApiBase::PARAM_ISMULTI => true,
+   ],
];
}
 
diff --git a/includes/api/ApiTag.php b/includes/api/ApiTag.php
index b142900..7470ff3 100644
--- a/includes/api/ApiTag.php
+++ b/includes/api/ApiTag.php
@@ -36,6 +36,14 @@
$this->dieBlocked( $user->getBlock() );
}
 
+   // Check if user can add tags
+   if ( count( $params['tags'] ) ) {
+   $ableToTag = ChangeTags::canAddTagsAccompanyingChange( 
$params['tags'], $user );
+   if ( !$ableToTag->isOk() ) {
+   $this->dieStatus( $ableToTag );
+   }

[MediaWiki-commits] [Gerrit] mediawiki...FlaggedRevs[master]: Use 'wpUndidRevision' instead of 'undidRev', remove the latter

2016-12-29 Thread Cen.temp (Code Review)
Cen.temp has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329652 )

Change subject: Use 'wpUndidRevision' instead of 'undidRev', remove the latter
..

Use 'wpUndidRevision' instead of 'undidRev', remove the latter

This uses 'wpUndidRevision' instead of 'undidRev' to increment
reverts. They are the same, so 'undidRev' can be removed.

Change-Id: I25cae93d3be4d94d714f9b338da4087c94d2a6ee
---
M FlaggedRevs.php
M backend/FlaggedRevs.hooks.php
M frontend/FlaggablePageView.php
3 files changed, 1 insertion(+), 12 deletions(-)


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

diff --git a/FlaggedRevs.php b/FlaggedRevs.php
index 52041a8..af25ebb 100644
--- a/FlaggedRevs.php
+++ b/FlaggedRevs.php
@@ -558,7 +558,6 @@
 $wgHooks['EditPageBeforeEditButtons'][] = 
'FlaggedRevsUIHooks::onBeforeEditButtons';
 # Autoreview information from form
 $wgHooks['EditPageBeforeEditChecks'][] = 'FlaggedRevsUIHooks::addReviewCheck';
-$wgHooks['EditPage::showEditForm:fields'][] = 
'FlaggedRevsUIHooks::addRevisionIDField';
 # Add draft link to section edit error
 $wgHooks['EditPageNoSuchSection'][] = 'FlaggedRevsUIHooks::onNoSuchSection';
 # Page review on edit
diff --git a/backend/FlaggedRevs.hooks.php b/backend/FlaggedRevs.hooks.php
index 93b6756..600c15c 100755
--- a/backend/FlaggedRevs.hooks.php
+++ b/backend/FlaggedRevs.hooks.php
@@ -640,7 +640,7 @@
) {
global $wgRequest;
# Was this an edit by an auto-sighter that undid another edit?
-   $undid = $wgRequest->getInt( 'undidRev' );
+   $undid = $wgRequest->getInt( 'wpUndidRevision' );
if ( $rev && $undid && $user->isAllowed( 'autoreview' ) ) {
// Note: $rev->getTitle() might be undefined (no rev 
id?)
$badRev = Revision::newFromTitle( $article->getTitle(), 
$undid );
diff --git a/frontend/FlaggablePageView.php b/frontend/FlaggablePageView.php
index 174e1af..026cde5 100755
--- a/frontend/FlaggablePageView.php
+++ b/frontend/FlaggablePageView.php
@@ -1912,14 +1912,4 @@
return true;
}
 
-   /**
-* If an edit was undone, add a hidden field that has the rev ID of 
that edit.
-* Needed for user stats (for autopromote).
-*/
-   public function addRevisionIDField( EditPage $editPage, OutputPage $out 
) {
-   $out->addHTML( "\n" . Html::hidden( 'undidRev',
-   empty( $editPage->undidRev ) ? 0 : $editPage->undidRev )
-   );
-   }
-
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I25cae93d3be4d94d714f9b338da4087c94d2a6ee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: Cen.temp 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add wpBaseRevision to edit request from 'undoafter' param

2016-12-29 Thread Cen.temp (Code Review)
Cen.temp has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329651 )

Change subject: Add wpBaseRevision to edit request from 'undoafter' param
..

Add wpBaseRevision to edit request from 'undoafter' param

This adds wpBaseRevision to the edit request, retrieved from
the 'undoafter' param, and passes it to doEditContent as base
rev id. In addition, this passes the curent rev id as the
undone revision for rollbacks.
This will allow to notify users of multiple-revision reverts
and to deprecate the ArticleRollbackComplete hook.

Bug: T154263
Bug: T153570
Change-Id: I130d5b8104e5c794c246a769e26dc460bc45928c
---
M includes/EditPage.php
M includes/api/ApiEditPage.php
M includes/page/WikiPage.php
3 files changed, 23 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/329651/1

diff --git a/includes/EditPage.php b/includes/EditPage.php
index 1f871e1..fc2bd7c 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -389,6 +389,7 @@
/* $didSave should be set to true whenever an article was successfully 
altered. */
public $didSave = false;
public $undidRev = 0;
+   public $baseRev = 0;
 
public $suppressIntro = false;
 
@@ -574,13 +575,13 @@
&& $revision->getContentModel() !== $this->contentModel
) {
$prevRev = null;
-   if ( $this->undidRev ) {
+   if ( $this->undidRev && $this->baseRev ) {
$undidRevObj = Revision::newFromId( 
$this->undidRev );
-   $prevRev = $undidRevObj ? 
$undidRevObj->getPrevious() : null;
+   $baseRevObj = Revision::newFromId( 
$this->baseRev );
}
if ( !$this->undidRev
-   || !$prevRev
-   || $prevRev->getContentModel() !== 
$this->contentModel
+   || !$this->baseRev
+   || $baseRevObj->getContentModel() !== 
$this->contentModel
) {
$this->displayViewSourcePage(
$this->getContentObject(),
@@ -887,6 +888,11 @@
$undidRev = $request->getInt( 'wpUndidRevision' );
if ( $undidRev ) {
$this->undidRev = $undidRev;
+   }
+
+   $baseRev = $request->getInt( 'wpBaseRevision' );
+   if ( $baseRev ) {
+   $this->baseRev = $baseRev;
}
 
$this->scrolltop = $request->getIntOrNull( 
'wpScrolltop' );
@@ -1204,8 +1210,9 @@

$this->summary = $undoSummary . $this->context->msg( 'colon-separator' )

->inContentLanguage()->text() . $this->summary;
}
-   
$this->undidRev = $undo;
}
+   $this->undidRev 
= $undo;
+   $this->baseRev 
= $undoafter;
$this->formtype 
= 'diff';
}
}
@@ -1302,7 +1309,7 @@
$handler = ContentHandler::getForModelID( 
$this->contentModel );
 
return $handler->makeEmptyContent();
-   } elseif ( !$this->undidRev ) {
+   } elseif ( !$this->undidRev || !$this->baseRev ) {
// Content models should always be the same since we 
error
// out if they are different before this point (in 
->edit()).
// The exception being, during an undo, the current 
revision might
@@ -2143,7 +2150,7 @@
$content,
$this->summary,
$flags,
-   false,
+   $this->baseRev,
$wgUser,
$content->getDefaultFormat(),
$this->changeTags,
@@ -2723,6 +2730,10 @@
$wgOut->addHTML( Html::hidden( 'wpUndidRevision', 
$this->undidRev ) );
}
 
+   if ( $this->baseRev ) {
+   $wgOut->addHTML( Html::hidden( 'wpBaseRevision', 
$this->baseRev ) );
+   }
+
 

[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Replace misleading wikitext sytnax in LexemeViewTest

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329460 )

Change subject: Replace misleading wikitext sytnax in LexemeViewTest
..


Replace misleading wikitext sytnax in LexemeViewTest

Bug: T149495
Bug: T149494
Change-Id: Ide333a0479bb4936829c15678da5576dc8ec60ea
---
M tests/phpunit/mediawiki/View/LexemeViewTest.php
1 file changed, 5 insertions(+), 5 deletions(-)

Approvals:
  WMDE-leszek: Checked; Looks good to me, but someone else must approve
  Ladsgroup: Looks good to me, approved
  jenkins-bot: Verified

Objections:
  Aleksey Bekh-Ivanov (WMDE): There's a problem with this change, please improve



diff --git a/tests/phpunit/mediawiki/View/LexemeViewTest.php 
b/tests/phpunit/mediawiki/View/LexemeViewTest.php
index 076ceb6..5b3f451 100644
--- a/tests/phpunit/mediawiki/View/LexemeViewTest.php
+++ b/tests/phpunit/mediawiki/View/LexemeViewTest.php
@@ -57,7 +57,7 @@
if ( $itemId->getSerialization() === 
'Q1' ) {
return null;
}
-   return new Term( 'en', '[[' . 
$itemId->getSerialization() . ']]' );
+   return new Term( 'en', 'getSerialization() . '>' );
} )
);
 
@@ -236,19 +236,19 @@
],
[
new Lexeme( $lexemeId, null, $lexicalCategory ),
-   [ 'wb-lexeme', '[[Q3]]' ]
+   [ 'wb-lexeme', '

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Do not keep 'artificial' contribution_tracking record on fai...

2016-12-29 Thread Eileen (Code Review)
Eileen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329650 )

Change subject: Do not keep 'artificial' contribution_tracking record on 
failure.
..

Do not keep 'artificial' contribution_tracking record on failure.

If the contribution_tracking has just been created & the transaction fails 
let's delete it.

I have only added this to one place that I hit in testing & it perhaps warrants 
more thought - although the
general issue here is not new.

Bug: T153791
Change-Id: Ic2c1dda45b36cc424664b48d9d879676e21f832c
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
1 file changed, 20 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/50/329650/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 0103fd7..ff203db 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -885,6 +885,7 @@
 $settlement_convert = 
exchange_rate_convert($msg['original_currency'], 1, $msg['date']) / 
exchange_rate_convert($settlement_currency, 1, $msg['date']);
 }
 catch (ExchangeRatesException $ex) {
+wmf_civicrm_rollback_contribution_tracking($msg);
 throw new WmfException( 'INVALID_MESSAGE', "UNKNOWN_CURRENCY: 
'{$msg['original_currency']}': " . $ex->getMessage() );
 }
 
@@ -902,6 +903,23 @@
 $msg['net'] = round( $msg['net'], $significantDecimals );
 
 return $msg;
+}
+
+/**
+ * Remove the contribution tracking record.
+ *
+ * If we have only just created the contribution tracking record (e.g as part 
of an
+ * offline import) it makes sense to remove it again if the full transaction 
fails.
+ *
+ * @param array $msg
+ */
+function wmf_civicrm_rollback_contribution_tracking($msg) {
+  if (!empty($msg['contribution_tracking_is_new'])) {
+db_delete('contribution_tracking')
+  ->isNull('contribution_id')
+  ->condition('id', $msg['contribution_tracking_id'])
+  ->execute();
+  }
 }
 
 /**
@@ -1777,6 +1795,8 @@
 $contribution_tracking_id = 
wmf_civicrm_insert_contribution_tracking( $source, $medium, $campaign, 
wmf_common_date_unix_to_sql( $msg['date'] ), null, $optout, $anonymous ); 
//ACK! this should not be handled this way! should be dynamic!
 watchdog( 'wmf_civicrm', 'Newly inserted contribution tracking id: 
@id', array( '@id' => $contribution_tracking_id ), WATCHDOG_DEBUG );
 $msg['contribution_tracking_id'] = $contribution_tracking_id;
+// Denote that it has just been created so it can be deleted if 
there is a failure.
+$msg['contribution_tracking_is_new'] = TRUE;
 }
 }
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...FlaggedRevs[master]: Remove reliance on baseRevId and altBaseRevId for FlaggableP...

2016-12-29 Thread Cen.temp (Code Review)
Cen.temp has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329649 )

Change subject: Remove reliance on baseRevId and altBaseRevId for 
FlaggablePageView
..

Remove reliance on baseRevId and altBaseRevId for FlaggablePageView

This checks if there are pending changes instead of relying on
baseRevIds / altBaseRevIds to predict whether the edit will be
autoreviewed. This information is already fetched for the
"review this edit" form for reviewers, and it won't
significantly affect response time for non-reviewers.
They were already no longer needed to check if the edit should
be autoreviewed post-save, they are now completely unused, so
are removed altogether.

Change-Id: Ife46a74b0652c39cf65b70b9777853f583fee70c
---
M frontend/FlaggablePageView.php
1 file changed, 6 insertions(+), 82 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FlaggedRevs 
refs/changes/49/329649/1

diff --git a/frontend/FlaggablePageView.php b/frontend/FlaggablePageView.php
index 64941ec..174e1af 100755
--- a/frontend/FlaggablePageView.php
+++ b/frontend/FlaggablePageView.php
@@ -1855,18 +1855,10 @@
}
if ( $title->quickUserCan( 'autoreview' ) ) {
if ( FlaggedRevs::autoReviewNewPages() && 
!$this->article->exists() ) {
-   return true; // edit will be autoreviewed
+   return true; // new page, edit will be 
autoreviewed
}
-   if ( !isset( $editPage->fr_baseFRev ) ) {
-   $baseRevId = self::getBaseRevId( $editPage, 
$this->getRequest() );
-   $baseRevId2 = self::getAltBaseRevId( $editPage, 
$this->getRequest() );
-   $editPage->fr_baseFRev = 
FlaggedRevision::newFromTitle( $title, $baseRevId );
-   if ( !$editPage->fr_baseFRev && $baseRevId2 ) {
-   $editPage->fr_baseFRev = 
FlaggedRevision::newFromTitle( $title, $baseRevId2 );
-   }
-   }
-   if ( $editPage->fr_baseFRev ) {
-   return true; // edit will be autoreviewed
+   if ( $this->article->getStable() && 
!$this->article->revsArePending() ) {
+   return true; // edit to a page with no pending 
changes, edit will be autoreviewed
}
}
return false; // edit won't be autoreviewed
@@ -1886,7 +1878,7 @@
} elseif ( $this->editWillBeAutoreviewed( $editPage ) ) {
return true; // edit will be auto-reviewed
}
-   if ( self::getBaseRevId( $editPage, $request ) == 
$this->article->getLatest() ) {
+   if ( !$editPage->getArticle()->getOldID() ) {
# For pages with either no stable version, or an 
outdated one, let
# the user decide if he/she wants it reviewed on the 
spot. One might
# do this if he/she just saw the diff-to-stable and 
*then* decided to edit.
@@ -1921,81 +1913,13 @@
}
 
/**
-* (a) Add a hidden field that has the rev ID the text is based off.
-* (b) If an edit was undone, add a hidden field that has the rev ID of 
that edit.
-* Needed for autoreview and user stats (for autopromote).
-* Note: baseRevId trusted for Reviewers - text checked for others.
+* If an edit was undone, add a hidden field that has the rev ID of 
that edit.
+* Needed for user stats (for autopromote).
 */
public function addRevisionIDField( EditPage $editPage, OutputPage $out 
) {
-   $out->addHTML( "\n" . Html::hidden( 'baseRevId',
-   self::getBaseRevId( $editPage, $this->getRequest() ) ) 
);
-   $out->addHTML( "\n" . Html::hidden( 'altBaseRevId',
-   self::getAltBaseRevId( $editPage, $this->getRequest() ) 
) );
$out->addHTML( "\n" . Html::hidden( 'undidRev',
empty( $editPage->undidRev ) ? 0 : $editPage->undidRev )
);
}
 
-   /**
-* Guess the rev ID the text of this form is based off
-* Note: baseRevId trusted for Reviewers - check text for others.
-* @param EditPage $editPage
-* @param WebRequest $request
-* @return int
-*/
-   protected static function getBaseRevId( EditPage $editPage, WebRequest 
$request ) {
-   if ( $editPage->isConflict ) {
-   return 0; // throw away these values (bug 33481)
-   }
-   if ( !isset( $editPage->fr_baseRevId ) ) {
-   $article = $editPage->getArticle(); // convenience
-

[MediaWiki-commits] [Gerrit] mediawiki...MediaWikiChat[master]: Only show username & avatar once when a user sends multiple ...

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329648 )

Change subject: Only show username & avatar once when a user sends multiple 
messages
..


Only show username & avatar once when a user sends multiple messages

Bug:T146232
Change-Id: I35eac53c152b7fc6e31206581285b296409b8c25
---
M MediaWikiChat.js
M extension.json
2 files changed, 32 insertions(+), 28 deletions(-)

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



diff --git a/MediaWikiChat.js b/MediaWikiChat.js
index d53930b..2044f3c 100644
--- a/MediaWikiChat.js
+++ b/MediaWikiChat.js
@@ -283,46 +283,50 @@
},
 
addMessage: function( userId, message, timestamp ) {
+   var fromUser = MediaWikiChat.userData[userId];
+   var currentUser = MediaWikiChat.userData[mw.config.get( 
'wgUserId' )]
+
if ( message.substring( 0, 4 ) == '/me ' && mw.config.get( 
'wgChatMeCommand' ) ) {
-   return MediaWikiChat.addSystemMessage( '* ' + 
MediaWikiChat.userData[userId].name + message.substring( 3 ), timestamp );
+   return MediaWikiChat.addSystemMessage( '* ' + 
fromUser.name + message.substring( 3 ), timestamp );
}
 
-   var user = MediaWikiChat.userData[userId];
-   var html = '';
var mention = false;
-
-   if (
-   mw.config.get( 'wgUserId' ) != userId && // prevents 
flashing when you sent the message yourself
-   message.toLowerCase().indexOf( 
mw.user.getName().toLowerCase() ) != -1
-   ) {
-   mention = true;
-   MediaWikiChat.flashMention( mw.message( 
'chat-mentioned-by', user.name, user.gender ).text(), message );
-   } else {
-   if ( userId != mw.user.getId() ) { // don't flash if we 
sent the message
-   MediaWikiChat.flash( mw.message( 
'chat-message-from', user.name, user.gender ).text(), message );
+   if ( fromUser.name != currentUser.name ) { // prevents flashing 
when you sent the message yourself
+   if ( message.toLowerCase().indexOf( 
currentUser.name.toLowerCase() ) != -1) {
+   mention = true;
+   MediaWikiChat.flashMention( mw.message( 
'chat-mentioned-by', fromUser.name, fromUser.gender ).text(), message );
+   } else {
+   MediaWikiChat.flash( mw.message( 
'chat-message-from', fromUser.name, fromUser.gender ).text(), message );
}
}
+   var messages = $( '#mwchat-table tr.mwchat-parent' );
+   var lastParent = $( messages[messages.length - 1] );
+   
+   if ( lastParent.attr( 'data-username' ) == fromUser.name ) {
+   lastParent.children( '.mwchat-rowspan' ).attr( 
'rowspan', Number( lastParent.children( '.mwchat-rowspan' ).attr( 'rowspan' ) ) 
+ 1 ); // increment the rowspan
 
-   html += '';
-   if ( mw.config.get( 'wgChatLinkUsernames' ) ) {
-   var userURL = mw.config.get( 'wgScriptPath' ) + 
'/index.php?title=User:' + mw.html.escape( user.name );
-   var userTitle = mw.config.get( 'wgFormattedNamespaces' 
)[2] + ':' + mw.html.escape( user.name ); // @see T140546
-   html += '' + mw.html.escape( user.name ) + '';
+   var html = '';
} else {
-   html += mw.html.escape( user.name );
-   }
-   html += '';
-   html += '';
-   if ( mw.config.get( 'wgChatSocialAvatars' ) ) {
-   html += '';
+   var html = '';
+
+   html += '';
+   if ( mw.config.get( 'wgChatLinkUsernames' ) ) {
+   var userURL = mw.config.get( 'wgScriptPath' ) + 
'/index.php?title=User:' + mw.html.escape( fromUser.name );
+   var userTitle = mw.config.get( 
'wgFormattedNamespaces' )[2] + ':' + mw.html.escape( fromUser.name ); // @see 
T140546
+   html += '' + mw.html.escape( fromUser.name ) + '';
+   } else {
+   html += mw.html.escape( fromUser.name );
+   }
+   html += '';
+   if ( mw.config.get( 'wgChatSocialAvatars' ) ) {
+   html += '';
+   }
}
html += '';
html += MediaWikiChat.htmlTimestamp( timestamp );
html += '';
 
diff --git a/extension.json b/extension.json
index 41bb56c..52d5fd2 100644
--- a/extension.json
+++ b

[MediaWiki-commits] [Gerrit] mediawiki...MediaWikiChat[master]: Only show username & avatar once when a user sends multiple ...

2016-12-29 Thread UltrasonicNXT (Code Review)
UltrasonicNXT has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329648 )

Change subject: Only show username & avatar once when a user sends multiple 
messages
..

Only show username & avatar once when a user sends multiple messages

Bug:T146232
Change-Id: I35eac53c152b7fc6e31206581285b296409b8c25
---
M MediaWikiChat.js
M extension.json
2 files changed, 32 insertions(+), 28 deletions(-)


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

diff --git a/MediaWikiChat.js b/MediaWikiChat.js
index d53930b..2044f3c 100644
--- a/MediaWikiChat.js
+++ b/MediaWikiChat.js
@@ -283,46 +283,50 @@
},
 
addMessage: function( userId, message, timestamp ) {
+   var fromUser = MediaWikiChat.userData[userId];
+   var currentUser = MediaWikiChat.userData[mw.config.get( 
'wgUserId' )]
+
if ( message.substring( 0, 4 ) == '/me ' && mw.config.get( 
'wgChatMeCommand' ) ) {
-   return MediaWikiChat.addSystemMessage( '* ' + 
MediaWikiChat.userData[userId].name + message.substring( 3 ), timestamp );
+   return MediaWikiChat.addSystemMessage( '* ' + 
fromUser.name + message.substring( 3 ), timestamp );
}
 
-   var user = MediaWikiChat.userData[userId];
-   var html = '';
var mention = false;
-
-   if (
-   mw.config.get( 'wgUserId' ) != userId && // prevents 
flashing when you sent the message yourself
-   message.toLowerCase().indexOf( 
mw.user.getName().toLowerCase() ) != -1
-   ) {
-   mention = true;
-   MediaWikiChat.flashMention( mw.message( 
'chat-mentioned-by', user.name, user.gender ).text(), message );
-   } else {
-   if ( userId != mw.user.getId() ) { // don't flash if we 
sent the message
-   MediaWikiChat.flash( mw.message( 
'chat-message-from', user.name, user.gender ).text(), message );
+   if ( fromUser.name != currentUser.name ) { // prevents flashing 
when you sent the message yourself
+   if ( message.toLowerCase().indexOf( 
currentUser.name.toLowerCase() ) != -1) {
+   mention = true;
+   MediaWikiChat.flashMention( mw.message( 
'chat-mentioned-by', fromUser.name, fromUser.gender ).text(), message );
+   } else {
+   MediaWikiChat.flash( mw.message( 
'chat-message-from', fromUser.name, fromUser.gender ).text(), message );
}
}
+   var messages = $( '#mwchat-table tr.mwchat-parent' );
+   var lastParent = $( messages[messages.length - 1] );
+   
+   if ( lastParent.attr( 'data-username' ) == fromUser.name ) {
+   lastParent.children( '.mwchat-rowspan' ).attr( 
'rowspan', Number( lastParent.children( '.mwchat-rowspan' ).attr( 'rowspan' ) ) 
+ 1 ); // increment the rowspan
 
-   html += '';
-   if ( mw.config.get( 'wgChatLinkUsernames' ) ) {
-   var userURL = mw.config.get( 'wgScriptPath' ) + 
'/index.php?title=User:' + mw.html.escape( user.name );
-   var userTitle = mw.config.get( 'wgFormattedNamespaces' 
)[2] + ':' + mw.html.escape( user.name ); // @see T140546
-   html += '' + mw.html.escape( user.name ) + '';
+   var html = '';
} else {
-   html += mw.html.escape( user.name );
-   }
-   html += '';
-   html += '';
-   if ( mw.config.get( 'wgChatSocialAvatars' ) ) {
-   html += '';
+   var html = '';
+
+   html += '';
+   if ( mw.config.get( 'wgChatLinkUsernames' ) ) {
+   var userURL = mw.config.get( 'wgScriptPath' ) + 
'/index.php?title=User:' + mw.html.escape( fromUser.name );
+   var userTitle = mw.config.get( 
'wgFormattedNamespaces' )[2] + ':' + mw.html.escape( fromUser.name ); // @see 
T140546
+   html += '' + mw.html.escape( fromUser.name ) + '';
+   } else {
+   html += mw.html.escape( fromUser.name );
+   }
+   html += '';
+   if ( mw.config.get( 'wgChatSocialAvatars' ) ) {
+   html += '';
+   }
}
html += '';
html += MediaWikiChat.htmlTimestamp( timestamp );
html += '';
 
diff --git a/extension.json b/extension.json
index 41bb56c..52d5fd2 100644
--- a/e

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Add support for importing campaign source, medium for CoinBase.

2016-12-29 Thread Eileen (Code Review)
Eileen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329647 )

Change subject: Add support for importing campaign source, medium for CoinBase.
..

Add support for importing campaign source, medium for CoinBase.

Bug: T153791
Change-Id: I4ead63974309f149f63323d9bac663761a78687e
---
M sites/all/modules/offline2civicrm/CoinbaseFile.php
M sites/all/modules/offline2civicrm/tests/CoinBaseTest.php
M sites/all/modules/offline2civicrm/tests/data/coinbase.csv
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
4 files changed, 19 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/47/329647/1

diff --git a/sites/all/modules/offline2civicrm/CoinbaseFile.php 
b/sites/all/modules/offline2civicrm/CoinbaseFile.php
index 2bfe8c6..1f604f4 100644
--- a/sites/all/modules/offline2civicrm/CoinbaseFile.php
+++ b/sites/all/modules/offline2civicrm/CoinbaseFile.php
@@ -12,7 +12,6 @@
 return array(
 'BTC Price',
 'Currency',
-//'Custom',
 'Customer Email',
 'Native Price',
 'Phone Number',
@@ -41,6 +40,9 @@
 $msg['gateway'] = 'coinbase';
 $msg['contribution_type'] = 'cash';
 $msg['payment_instrument'] = 'Bitcoin';
+// It seems that payment_method is used for creating the 
contribution_tracking source
+// whereas payment_instrument is used for CiviCRM contributions 
payment_instrument_id field.
+$msg['payment_method'] = 'bitcoin';
 
 list($msg['first_name'], $msg['last_name']) = 
wmf_civicrm_janky_split_name( $msg['full_name'] );
 
@@ -71,10 +73,12 @@
 
 protected function getFieldMapping() {
 return array(
+'Banner' => 'utm_source',
+'Campaign' => 'utm_campaign',
 //'BTC Price' => 'original_gross',
 'Currency' => 'currency',
-//'Custom' => 'contribution_tracking', // TODO
 'Customer Email' => 'email',
+'Medium' => 'utm_medium',
 // FIXME: this will destroy recurring subscription import, for now.
 'Native Price' => 'gross',
 'Phone Number' => 'phone', // TODO: not stored
diff --git a/sites/all/modules/offline2civicrm/tests/CoinBaseTest.php 
b/sites/all/modules/offline2civicrm/tests/CoinBaseTest.php
index 91e1744..e7f9f78 100644
--- a/sites/all/modules/offline2civicrm/tests/CoinBaseTest.php
+++ b/sites/all/modules/offline2civicrm/tests/CoinBaseTest.php
@@ -24,8 +24,9 @@
 $importer->import();
 
 $contribution = 
wmf_civicrm_get_contributions_from_gateway_id($this->gateway, $this->trxn_id);
-$this->assertEquals( 1, count( $contribution ) );
-$this->assertEquals( 'COINBASE PLUTO', $contribution[0]['trxn_id'] );
+$this->assertEquals(1, count($contribution));
+$this->assertEquals('COINBASE PLUTO', $contribution[0]['trxn_id']);
+$this->assertEquals('online', db_query("SELECT {utm_medium} from 
{contribution_tracking} WHERE contribution_id = 
{$contribution[0]['id']}")->fetchField());
 }
 
 }
diff --git a/sites/all/modules/offline2civicrm/tests/data/coinbase.csv 
b/sites/all/modules/offline2civicrm/tests/data/coinbase.csv
index b336848..d0c8678 100644
--- a/sites/all/modules/offline2civicrm/tests/data/coinbase.csv
+++ b/sites/all/modules/offline2civicrm/tests/data/coinbase.csv
@@ -1,2 +1,2 @@
-BTC Price,Currency,Customer Email,Native Price,Phone Number,Recurring Payment 
ID,Refund Transaction ID,Shipping Address 1,Shipping Address 2,Shipping 
City,Shipping Country,Shipping Name,Shipping Postal Code,Shipping 
State,Status,Timestamp,Tracking Code
-5.0009,BTC,mic...@mouse.com,1,456 789,,,52 Disney Lane,,Disneyland,US,Mickey 
Mouse2016-09-15,Pluto
+BTC Price,Currency,Customer Email,Native Price,Phone Number,Recurring Payment 
ID,Refund Transaction ID,Shipping Address 1,Shipping Address 2,Shipping 
City,Shipping Country,Shipping Name,Shipping Postal Code,Shipping 
State,Status,Timestamp,Tracking Code,Campaign,Medium,Banner
+5.0009,BTC,mic...@mouse.com,1,456 789,,,52 Disney Lane,,Disneyland,US,Mickey 
Mouse2016-09-15,Pluto,Planet drive,online,mouse-drive
diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index a3e8b65..0103fd7 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -1755,9 +1755,15 @@
 
 // if we're missing a contrib id, insert new record to the table
 // this can happen if a user somehow makes a trxn from outside the normal 
workflow
-// checks are ignored as they were completely offline
+// Historically checks have been  ignored as they are completely offline.
+// T146295 has raised some questions about this.
+// code change respects previous recognition of 'payment_method' as being 
a little bit

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Fix test that was not running to run.

2016-12-29 Thread Eileen (Code Review)
Eileen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329646 )

Change subject: Fix test that was not running to run.
..

Fix test that was not running to run.

The naming convention on this test file meant it was not running. I got it to 
run,
although I hit some global wierdness & TBH I don't know what it actually tests 
:-)

Change-Id: Id86702c04a5d3d62271b303cb9b66e6d6a9fd714
---
R sites/all/modules/offline2civicrm/tests/ContributionConversionTest.php
1 file changed, 18 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/46/329646/1

diff --git 
a/sites/all/modules/offline2civicrm/tests/ContributionConversion.test 
b/sites/all/modules/offline2civicrm/tests/ContributionConversionTest.php
similarity index 61%
rename from sites/all/modules/offline2civicrm/tests/ContributionConversion.test
rename to sites/all/modules/offline2civicrm/tests/ContributionConversionTest.php
index 4b4a8fb..da00108 100644
--- a/sites/all/modules/offline2civicrm/tests/ContributionConversion.test
+++ b/sites/all/modules/offline2civicrm/tests/ContributionConversionTest.php
@@ -1,60 +1,45 @@
  'ContributionConversion',
-'group' => 'Wikimedia',
-'description' => 'Convert single contributions to recurring',
-);
-}
+class ContributionConversionTest extends BaseChecksFileTest {
 
 public function setUp() {
 parent::setUp();
+civicrm_initialize();
+// I'm slightly confused why this is required. phpunit is blowing away 
GLOBALS,
+// including the one holding the DB connection but civicrm_initialize 
is not
+// calling this on the second run due to the static being set.
+// The reason this is confusing is logically, but not in practice,
+// this test should be no more affected than other tests.
+CRM_Core_Config::singleton(TRUE, TRUE);
 
-$api = civicrm_api_classapi();
-$api->Contact->Create( array(
+$result = $this->callAPISuccess('Contact', 'create', array(
 'contact_type' => 'Individual',
 'email' => 'f...@example.com',
-'version' => 3,
-) );
-$this->contact_id = $api->id;
+));
+$this->contact_id = $result['id'];
 
 $this->gateway_txn_id = "NaN-" . mt_rand();
 $this->transaction = WmfTransaction::from_unique_id( "GLOBALCOLLECT 
{$this->gateway_txn_id}" );
 
-$api->Contribution->Create( array(
+$contributionResult = $this->callAPISuccess('Contribution', 'create', 
array(
 'contact_id' => $this->contact_id,
 'trxn_id' => $this->transaction->get_unique_id(),
 'contribution_type' => 'Cash',
 'total_amount' => '20.01',
 'receive_date' => wmf_common_date_unix_to_sql( time() ),
-'version' => 3,
-) );
-$this->contribution_id = $api->id;
+));
+$this->contribution_id = $contributionResult['id'];
 
-wmf_civicrm_set_custom_field_values( $this->contribution_id, array(
+wmf_civicrm_set_custom_field_values($this->contribution_id, array(
 'original_amount' => '20.01',
 'original_currency' => 'USD',
-) );
+));
 }
 
 public function tearDown() {
-$api = civicrm_api_classapi();
-
-$api->Contribution->Delete( array(
-'id' => $this->contribution_id,
-'version' => 3,
-) );
-
-$api->Contact->Delete( array(
-'id' => $this->contact_id,
-'version' => 3,
-) );
-
 parent::tearDown();
+$this->callAPISuccess('Contribution', 'delete', array('id' => 
$this->contribution_id));
+$this->callAPISuccess('Contact', 'delete', array('id' => 
$this->contact_id));
 }
 
 public function testMakeRecurring() {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Use class to set theme for CollaborationHub edit page.

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329645 )

Change subject: Use  class to set theme for CollaborationHub edit page.
..


Use  class to set theme for CollaborationHub edit page.

Possibly we should do something similar on normal page view(?)

Fixes issue with misnested  tag breaking the collapsible
footer js

Change-Id: I1b1330a257ba8365864c168917f689cf47a97a48
---
M extension.json
M includes/CollaborationHubContentEditor.php
2 files changed, 26 insertions(+), 2 deletions(-)

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



diff --git a/extension.json b/extension.json
index 1396ad9..0d2401d 100644
--- a/extension.json
+++ b/extension.json
@@ -75,6 +75,9 @@
],
"OutputPageParserOutput": [
"CollaborationKitHooks::onOutputPageParserOutput"
+   ],
+   "OutputPageBodyAttributes": [
+   "CollaborationHubContentEditor::setCollabkitTheme"
]
},
"@fixme": "Does having ext.CollaborationKit.list.styles as a dependency 
double load from addModuleStyles?",
diff --git a/includes/CollaborationHubContentEditor.php 
b/includes/CollaborationHubContentEditor.php
index f80de23..3dad151 100644
--- a/includes/CollaborationHubContentEditor.php
+++ b/includes/CollaborationHubContentEditor.php
@@ -117,9 +117,30 @@
$out = RequestContext::getMain()->getOutput();
 
$partFields = $this->getFormFields( $parts );
+   // See setCollabkitTheme for how the setProperty works.
+   $out->setProperty( 'collabkit-theme', $this->colour );
$out->addHtml( Html::rawElement( 'div', [ 'class' => 
'mw-collabkit-modifiededitform' ], $partFields ) );
-   $out->prependHtml( Html::openElement( 'div', [ 'class' => 
'mw-ck-theme-' . $this->colour ] ) );
-   $out->addHtml( Html::closeElement( 'div' ) );
+   }
+
+   /**
+* Hook handler for OutputPageBodyAttributes.
+*
+* Used to set the color theme for Hub edit pages.
+*
+* @param OutputPage $out
+* @param Skin $sk
+* @param array $bodyAttribs Attributes for the  element
+*/
+   public static function setCollabkitTheme( OutputPage $out, $skin, 
&$bodyAttribs ) {
+   $theme = $out->getProperty( 'collabkit-theme' );
+   if ( $theme ) {
+   $themeClass = 'mw-ck-theme-' . $theme;
+   if ( !isset( $bodyAttribs['class'] ) ) {
+   $bodyAttribs['class'] = $themeClass;
+   } else {
+   $bodyAttribs['class'] .= ' ' . $themeClass;
+   }
+   }
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1b1330a257ba8365864c168917f689cf47a97a48
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff 
Gerrit-Reviewer: Brian Wolff 
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...CollaborationKit[master]: Use class to set theme for CollaborationHub edit page.

2016-12-29 Thread Brian Wolff (Code Review)
Brian Wolff has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329645 )

Change subject: Use  class to set theme for CollaborationHub edit page.
..

Use  class to set theme for CollaborationHub edit page.

Possibly we should do something similar on normal page view(?)

Fixes issue with misnested  tag breaking the collapsible
footer js

Change-Id: I1b1330a257ba8365864c168917f689cf47a97a48
---
M extension.json
M includes/CollaborationHubContentEditor.php
2 files changed, 26 insertions(+), 2 deletions(-)


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

diff --git a/extension.json b/extension.json
index 1396ad9..0d2401d 100644
--- a/extension.json
+++ b/extension.json
@@ -75,6 +75,9 @@
],
"OutputPageParserOutput": [
"CollaborationKitHooks::onOutputPageParserOutput"
+   ],
+   "OutputPageBodyAttributes": [
+   "CollaborationHubContentEditor::setCollabkitTheme"
]
},
"@fixme": "Does having ext.CollaborationKit.list.styles as a dependency 
double load from addModuleStyles?",
diff --git a/includes/CollaborationHubContentEditor.php 
b/includes/CollaborationHubContentEditor.php
index f80de23..3dad151 100644
--- a/includes/CollaborationHubContentEditor.php
+++ b/includes/CollaborationHubContentEditor.php
@@ -117,9 +117,30 @@
$out = RequestContext::getMain()->getOutput();
 
$partFields = $this->getFormFields( $parts );
+   // See setCollabkitTheme for how the setProperty works.
+   $out->setProperty( 'collabkit-theme', $this->colour );
$out->addHtml( Html::rawElement( 'div', [ 'class' => 
'mw-collabkit-modifiededitform' ], $partFields ) );
-   $out->prependHtml( Html::openElement( 'div', [ 'class' => 
'mw-ck-theme-' . $this->colour ] ) );
-   $out->addHtml( Html::closeElement( 'div' ) );
+   }
+
+   /**
+* Hook handler for OutputPageBodyAttributes.
+*
+* Used to set the color theme for Hub edit pages.
+*
+* @param OutputPage $out
+* @param Skin $sk
+* @param array $bodyAttribs Attributes for the  element
+*/
+   public static function setCollabkitTheme( OutputPage $out, $skin, 
&$bodyAttribs ) {
+   $theme = $out->getProperty( 'collabkit-theme' );
+   if ( $theme ) {
+   $themeClass = 'mw-ck-theme-' . $theme;
+   if ( !isset( $bodyAttribs['class'] ) ) {
+   $bodyAttribs['class'] = $themeClass;
+   } else {
+   $bodyAttribs['class'] .= ' ' . $themeClass;
+   }
+   }
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b1330a257ba8365864c168917f689cf47a97a48
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff 

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Using pytest-httpbin

2016-12-29 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329644 )

Change subject: Using pytest-httpbin
..

Using pytest-httpbin

Now http_tests use pytest-httpbin if pytest is used to run the tests
Otherwise, http://httpbin.org is used

Bug: T153560
Change-Id: I2000fed5e5273dbfef5d51ac81698a32c7fc5676
---
M dev-requirements.txt
M tests/http_tests.py
2 files changed, 39 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/44/329644/1

diff --git a/dev-requirements.txt b/dev-requirements.txt
index edd5005..44a3038 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -7,6 +7,7 @@
 pytest-runner
 pytest-cov
 pytest-attrib
+pytest-httpbin
 
 six
 
diff --git a/tests/http_tests.py b/tests/http_tests.py
index e62b390..c059a45 100644
--- a/tests/http_tests.py
+++ b/tests/http_tests.py
@@ -27,6 +27,7 @@
 from tests import join_images_path
 from tests.aspects import unittest, TestCase, DeprecationTestCase, 
require_modules
 
+import pytest, pytest_httpbin
 
 class HttpTestCase(TestCase):
 
@@ -157,6 +158,7 @@
  'InsecureRequestWarning')
 
 
+@pytest_httpbin.use_class_based_httpbin
 class TestHttpStatus(TestCase):
 
 """Test HTTP status code handling and errors."""
@@ -175,9 +177,14 @@
 
 def test_http_504(self):
 """Test that a HTTP 504 raises the correct exception."""
+if hasattr(self, 'httpbin'):
+httpbinUrl = self.httpbin.url
+else:
+httpbinUrl = 'http://httpbin.org'
+
 self.assertRaises(pywikibot.Server504Error,
   http.fetch,
-  uri='http://httpbin.org/status/504')
+  uri=httpbinUrl + '/status/504')
 
 def test_server_not_found(self):
 """Test server not found exception."""
@@ -316,6 +323,7 @@
 self._test_fake_user_agent_randomness()
 
 
+@pytest_httpbin.use_class_based_httpbin
 class LiveFakeUserAgentTestCase(TestCase):
 
 """Test the usage of fake user agent."""
@@ -338,24 +346,29 @@
 
 def _test_fetch_use_fake_user_agent(self):
 """Test `use_fake_user_agent` argument of http.fetch."""
+if hasattr(self, 'httpbin'):
+httpbinUrl = self.httpbin.url
+else:
+httpbinUrl = 'http://httpbin.org'
+
 # Existing headers
 r = http.fetch(
-'http://httpbin.org/status/200', headers={'user-agent': 
'EXISTING'})
+httpbinUrl + '/status/200', headers={'user-agent': 'EXISTING'})
 self.assertEqual(r.headers['user-agent'], 'EXISTING')
 
 # Argument value changes
-r = http.fetch('http://httpbin.org/status/200', 
use_fake_user_agent=True)
+r = http.fetch(httpbinUrl + '/status/200', use_fake_user_agent=True)
 self.assertNotEqual(r.headers['user-agent'], http.user_agent())
-r = http.fetch('http://httpbin.org/status/200', 
use_fake_user_agent=False)
+r = http.fetch(httpbinUrl + '/status/200', use_fake_user_agent=False)
 self.assertEqual(r.headers['user-agent'], http.user_agent())
 r = http.fetch(
-'http://httpbin.org/status/200', use_fake_user_agent='ARBITRARY')
+httpbinUrl + '/status/200', use_fake_user_agent='ARBITRARY')
 self.assertEqual(r.headers['user-agent'], 'ARBITRARY')
 
 # Manually overridden domains
-config.fake_user_agent_exceptions = {'httpbin.org': 'OVERRIDDEN'}
+config.fake_user_agent_exceptions = {httpbinUrl[7:]: 'OVERRIDDEN'}
 r = http.fetch(
-'http://httpbin.org/status/200', use_fake_user_agent=False)
+httpbinUrl + '/status/200', use_fake_user_agent=False)
 self.assertEqual(r.headers['user-agent'], 'OVERRIDDEN')
 
 @require_modules('browseragents')
@@ -561,6 +574,7 @@
 self.assertIs(main_module_cookie_jar, http.cookie_jar)
 
 
+@pytest_httpbin.use_class_based_httpbin
 class QueryStringParamsTestCase(TestCase):
 
 """
@@ -576,9 +590,15 @@
 },
 }
 
+def getHttpbinUrl(self):
+if hasattr(self, 'httpbin'):
+return self.httpbin.url
+else:
+return 'https://httpbin.org'
+
 def test_no_params(self):
 """Test fetch method with no parameters."""
-r = http.fetch(uri='https://httpbin.org/get', params={})
+r = http.fetch(uri=self.getHttpbinUrl() + '/get', params={})
 self.assertEqual(r.status, 200)
 
 content = json.loads(r.content)
@@ -591,7 +611,7 @@
 HTTPBin returns the args in their urldecoded form, so what we put in 
should be
 the same as what we get out.
 """
-r = http.fetch(uri='https://httpbin.org/get', params={'fish&chips': 
'delicious'})
+r = http.fetch(uri=self.getHttpbinUrl() + '/get', 
params={'fish&chips': 'delicious'})
 self.assertEqual(r.status, 200)
 
 con

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Style custom edit forms a bit

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/325888 )

Change subject: Style custom edit forms a bit
..


Style custom edit forms a bit

Doesn't style around the js tools, but this layout should act as a
fallback either way.

Also does some magic to use the hub colour, if it's a hub, for the
borders.
Used zz as a prefix for the module name to ensure it loads last to
avoid need for stupid css overrides.

Put back @default.

Bug: T148943
Bug: T149031
Change-Id: I1593f6dc199e0f0f639c891436429443a6d1519d
---
M extension.json
M includes/CollaborationHubContentEditor.php
M includes/CollaborationListContentEditor.php
A modules/ext.CollaborationKit.edit.styles.less
M modules/ext.CollaborationKit.mixins.less
5 files changed, 119 insertions(+), 1 deletion(-)

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



diff --git a/extension.json b/extension.json
index ea49f1f..1396ad9 100644
--- a/extension.json
+++ b/extension.json
@@ -89,6 +89,9 @@
"ext.CollaborationKit.list.styles": {
"styles": "ext.CollaborationKit.list.styles.less"
},
+   "zzext.CollaborationKit.edit.styles": {
+   "styles": "ext.CollaborationKit.edit.styles.less"
+   },
"ext.CollaborationKit.iconbrowser.styles": {
"styles": "ext.CollaborationKit.iconbrowser.styles.less"
},
diff --git a/includes/CollaborationHubContentEditor.php 
b/includes/CollaborationHubContentEditor.php
index 66c7df9..f80de23 100644
--- a/includes/CollaborationHubContentEditor.php
+++ b/includes/CollaborationHubContentEditor.php
@@ -4,6 +4,9 @@
  */
 class CollaborationHubContentEditor extends EditPage {
 
+   /** @var string */
+   protected $colour;
+
function __construct( $page ) {
parent::__construct( $page );
// Make human readable the default format for editing, but still
@@ -14,6 +17,7 @@
$out = $this->getContext()->getOutput();
$out->addModules( 'ext.CollaborationKit.colour' );
$out->addModules( 'ext.CollaborationKit.hubimage' );
+   $out->addModuleStyles( 'zzext.CollaborationKit.edit.styles' );
$out->addModuleStyles( 
'ext.CollaborationKit.colourbrowser.styles' );
$out->addJsConfigVars( 'wgCollaborationKitColourList', 
CollaborationHubContent::getThemeColours() );
}
@@ -78,6 +82,8 @@
$colours
);
 
+   $this->colour = $selectedColour;
+
if ( $parts[5] == '' ) {
$includedContent = '';
} else {
@@ -110,7 +116,10 @@
 
$out = RequestContext::getMain()->getOutput();
 
-   $out->addHtml( Html::rawElement( 'div', [ 'class' => 
'mw-collabkit-modifiededitform' ], $this->getFormFields( $parts ) ) );
+   $partFields = $this->getFormFields( $parts );
+   $out->addHtml( Html::rawElement( 'div', [ 'class' => 
'mw-collabkit-modifiededitform' ], $partFields ) );
+   $out->prependHtml( Html::openElement( 'div', [ 'class' => 
'mw-ck-theme-' . $this->colour ] ) );
+   $out->addHtml( Html::closeElement( 'div' ) );
}
 
/**
diff --git a/includes/CollaborationListContentEditor.php 
b/includes/CollaborationListContentEditor.php
index 50ccf1f..3ed0977 100644
--- a/includes/CollaborationListContentEditor.php
+++ b/includes/CollaborationListContentEditor.php
@@ -11,6 +11,9 @@
if ( $this->getCurrentContent()->isValid() ) {
$this->contentFormat = 
CollaborationListContentHandler::FORMAT_WIKI;
}
+
+   $out = $this->getContext()->getOutput();
+   $out->addModuleStyles( 'zzext.CollaborationKit.edit.styles' );
}
 
protected function showContentForm() {
diff --git a/modules/ext.CollaborationKit.edit.styles.less 
b/modules/ext.CollaborationKit.edit.styles.less
new file mode 100644
index 000..3e7c207
--- /dev/null
+++ b/modules/ext.CollaborationKit.edit.styles.less
@@ -0,0 +1,101 @@
+@import "ext.CollaborationKit.mixins.less";
+
+.ck-customeditor-toolbars( @default );
+
+.mw-collabkit-modifiededitform > div {
+   margin-top: .5em;
+}
+.mw-collabkit-modifiededitform label {
+   font-weight: bold;
+}
+
+.mw-ck-displayinput label:after,
+.mw-ck-hubimageinput label:after,
+.mw-ck-colourinput label:after {
+   content: ':';
+   padding-right: .5em;
+}
+.mw-ck-displayinput,
+.mw-ck-hubimageinput {
+   input {
+   width: 40%;
+   }
+}
+
+.ck-customeditor-toolbars( @color ) {
+   .mw-collabkit-modifiededitform {
+   padding-bottom: .75em;
+   border-bottom: solid 4px @color;
+   }
+   #toolbar {
+   margin-b

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: newitem.py doesn't crash on LockedPage

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327740 )

Change subject: newitem.py doesn't crash on LockedPage
..


newitem.py doesn't crash on LockedPage

Also:
 * handle NoPage and PageNotSaved errors
 * lines length below 79 characters
 * fix pycodestyle (former PEP8) E402 error

Bug: T152996
Change-Id: Id0949dc9162be28fdc20b5afd9e630f7564ba074
---
M scripts/newitem.py
1 file changed, 29 insertions(+), 12 deletions(-)

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



diff --git a/scripts/newitem.py b/scripts/newitem.py
index c8f2700..9d83d45 100755
--- a/scripts/newitem.py
+++ b/scripts/newitem.py
@@ -20,20 +20,19 @@
 """
 #
 # (C) Multichill, 2014
-# (C) Pywikibot team, 2014
+# (C) Pywikibot team, 2014-2016
 #
 # Distributed under the terms of the MIT license.
 #
 from __future__ import absolute_import, unicode_literals
 
-__version__ = '$Id$'
-#
-
 from datetime import timedelta
 
 import pywikibot
-
 from pywikibot import pagegenerators, WikidataBot
+from pywikibot.exceptions import LockedPage, NoPage, PageNotSaved
+
+__version__ = '$Id$'
 
 
 class NewItemRobot(WikidataBot):
@@ -52,15 +51,32 @@
 self.generator = pagegenerators.PreloadingGenerator(generator)
 self.pageAge = self.getOption('pageage')
 self.lastEdit = self.getOption('lastedit')
-self.pageAgeBefore = self.repo.getcurrenttime() - 
timedelta(days=self.pageAge)
-self.lastEditBefore = self.repo.getcurrenttime() - 
timedelta(days=self.lastEdit)
+self.pageAgeBefore = self.repo.getcurrenttime() - timedelta(
+days=self.pageAge)
+self.lastEditBefore = self.repo.getcurrenttime() - timedelta(
+days=self.lastEdit)
 self.treat_missing_item = True
 pywikibot.output('Page age is set to %s days so only pages created'
  '\nbefore %s will be considered.'
  % (self.pageAge, self.pageAgeBefore.isoformat()))
-pywikibot.output('Last edit is set to %s days so only pages last 
edited'
- '\nbefore %s will be considered.'
- % (self.lastEdit, self.lastEditBefore.isoformat()))
+pywikibot.output(
+'Last edit is set to {0} days so only pages last edited'
+'\nbefore {1} will be considered.'.format(
+self.lastEdit, self.lastEditBefore.isoformat()))
+
+@staticmethod
+def _touch_page(page):
+try:
+page.touch()
+except NoPage:
+pywikibot.error('Page {0} does not exist.'.format(
+page.title(asLink=True)))
+except LockedPage:
+pywikibot.error('Page {0} is locked.'.format(
+page.title(asLink=True)))
+except PageNotSaved:
+pywikibot.error('Page {0} not saved.'.format(
+page.title(asLink=True)))
 
 def treat(self, page, item):
 """Treat page/item."""
@@ -68,7 +84,7 @@
 pywikibot.output(u'%s already has an item: %s.' % (page, item))
 if self.getOption('touch'):
 pywikibot.output(u'Doing a null edit on the page.')
-page.put(page.text)
+self._touch_page(page)
 return
 
 self.current_page = page
@@ -116,7 +132,7 @@
 item = pywikibot.ItemPage(page.site.data_repository())
 item.editEntity(data, summary=summary)
 # And do a null edit to force update
-page.put(page.text)
+self._touch_page(page)
 
 
 def main(*args):
@@ -153,5 +169,6 @@
 bot.run()
 return True
 
+
 if __name__ == "__main__":
 main()

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id0949dc9162be28fdc20b5afd9e630f7564ba074
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Magul 
Gerrit-Reviewer: Dalba 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Lokal Profil 
Gerrit-Reviewer: Magul 
Gerrit-Reviewer: Mpaa 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Fix edit and delete js on multicolumn

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329636 )

Change subject: Fix edit and delete js on multicolumn
..


Fix edit and delete js on multicolumn

The drag and drop still has to be done.

Bug: T149042
Change-Id: I81bc49a0eeb699a0e32ad8fb9e48d50f8f044e71
---
M includes/content/CollaborationListContent.php
M modules/ext.CollaborationKit.list.edit.js
2 files changed, 43 insertions(+), 24 deletions(-)

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



diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index 6a8012d..337ef22 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -243,8 +243,11 @@
$listclass = count( $columns ) > 1 ? 'mw-ck-multilist' : 
'mw-ck-singlelist';
$text .= '' . "\n";
$offset = $options['defaultSort'] === 'random' ? 0 : 
$options['offset'];
-   foreach ( $columns as $column ) {
-   $text .= '' . "\n";
+   foreach ( $columns as $colId => $column ) {
+   $text .= Html::openElement( 'div', [
+   'class' => 'mw-ck-list-column',
+   'data-collabkit-column-id' => $colId
+   ] ) . "\n";
if ( isset( $column->label ) && $column->label !== '' ) 
{
$text .= "=== {$column->label} ===\n";
}
diff --git a/modules/ext.CollaborationKit.list.edit.js 
b/modules/ext.CollaborationKit.list.edit.js
index 8c83a08..9f3aeaf 100644
--- a/modules/ext.CollaborationKit.list.edit.js
+++ b/modules/ext.CollaborationKit.list.edit.js
@@ -1,8 +1,19 @@
 ( function ( $, mw, OO ) {
-   var deleteItem, getCurrentJson, saveJson, addItem, reorderList, 
getListOfTitles, modifyItem, modifyExistingItem, addSelf, curUserIsInList;
+   var deleteItem, getCurrentJson, saveJson, addItem, reorderList, 
getListOfTitles, modifyItem, modifyExistingItem, addSelf, curUserIsInList, 
getCol;
 
addItem = function () {
modifyItem( {} );
+   };
+
+   getColId = function ( $item ) {
+   var $col, id;
+
+   $col = $item.closest( '.mw-ck-list-column' );
+   id = parseInt( $col.data( 'collabkit-column-id' ), 10 );
+   if ( $col.length === 0 || !isFinite( id ) ) {
+   throw new Error( 'Cannot find column' );
+   }
+   return id;
};
 
/**
@@ -34,17 +45,24 @@
return $( query ).length > 0;
};
 
-   modifyExistingItem = function ( itemName ) {
+   /**
+* Edit an existing item.
+*
+* @param {string} itemName The title of the item in question
+* @param {int} colId Which column the item is in
+*/
+   modifyExistingItem = function ( itemName, colId ) {
getCurrentJson( mw.config.get( 'wgArticleId' ), function ( res 
) {
var done = false;
-   $.each( res.content.columns[ 0 ].items, function ( 
index ) {
+   $.each( res.content.columns[ colId ].items, function ( 
index ) {
if ( this.title === itemName ) {
done = true;
modifyItem( {
itemTitle: this.title,
itemImage: this.image,
itemDescription: this.notes,
-   itemIndex: index
+   itemIndex: index,
+   itemColId: colId
} );
return false;
}
@@ -91,7 +109,8 @@
deleteItem = function ( $item ) {
var cur,
$spinner,
-   title = $item.data( 'collabkit-item-title' );
+   title = $item.data( 'collabkit-item-title' ),
+   colId = getColId( $item );
 
$spinner = $.createSpinner( {
size: 'small',
@@ -103,13 +122,13 @@
 
cur = getCurrentJson( mw.config.get( 'wgArticleId' ), function 
( res ) {
var newItems = [];
-   $.each( res.content.columns[ 0 ].items, function ( 
index ) {
+   $.each( res.content.columns[ colId ].items, function ( 
index ) {
if ( this.title === title ) {
return;
}
   

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Add support for importing campaign source, medium for CoinBase.

2016-12-29 Thread Eileen (Code Review)
Eileen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329642 )

Change subject: Add support for importing campaign source, medium for CoinBase.
..

Add support for importing campaign source, medium for CoinBase.

Bug: T153791
Change-Id: I74bf90ab001044e8b29ae87d2d4855bf9d934ac7
---
M sites/all/modules/offline2civicrm/CoinbaseFile.php
M sites/all/modules/offline2civicrm/tests/CoinBaseTest.php
R sites/all/modules/offline2civicrm/tests/ContributionConversionTest.php
M sites/all/modules/offline2civicrm/tests/data/coinbase.csv
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
5 files changed, 17 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/42/329642/1

diff --git a/sites/all/modules/offline2civicrm/CoinbaseFile.php 
b/sites/all/modules/offline2civicrm/CoinbaseFile.php
index 2bfe8c6..1f604f4 100644
--- a/sites/all/modules/offline2civicrm/CoinbaseFile.php
+++ b/sites/all/modules/offline2civicrm/CoinbaseFile.php
@@ -12,7 +12,6 @@
 return array(
 'BTC Price',
 'Currency',
-//'Custom',
 'Customer Email',
 'Native Price',
 'Phone Number',
@@ -41,6 +40,9 @@
 $msg['gateway'] = 'coinbase';
 $msg['contribution_type'] = 'cash';
 $msg['payment_instrument'] = 'Bitcoin';
+// It seems that payment_method is used for creating the 
contribution_tracking source
+// whereas payment_instrument is used for CiviCRM contributions 
payment_instrument_id field.
+$msg['payment_method'] = 'bitcoin';
 
 list($msg['first_name'], $msg['last_name']) = 
wmf_civicrm_janky_split_name( $msg['full_name'] );
 
@@ -71,10 +73,12 @@
 
 protected function getFieldMapping() {
 return array(
+'Banner' => 'utm_source',
+'Campaign' => 'utm_campaign',
 //'BTC Price' => 'original_gross',
 'Currency' => 'currency',
-//'Custom' => 'contribution_tracking', // TODO
 'Customer Email' => 'email',
+'Medium' => 'utm_medium',
 // FIXME: this will destroy recurring subscription import, for now.
 'Native Price' => 'gross',
 'Phone Number' => 'phone', // TODO: not stored
diff --git a/sites/all/modules/offline2civicrm/tests/CoinBaseTest.php 
b/sites/all/modules/offline2civicrm/tests/CoinBaseTest.php
index 91e1744..e7f9f78 100644
--- a/sites/all/modules/offline2civicrm/tests/CoinBaseTest.php
+++ b/sites/all/modules/offline2civicrm/tests/CoinBaseTest.php
@@ -24,8 +24,9 @@
 $importer->import();
 
 $contribution = 
wmf_civicrm_get_contributions_from_gateway_id($this->gateway, $this->trxn_id);
-$this->assertEquals( 1, count( $contribution ) );
-$this->assertEquals( 'COINBASE PLUTO', $contribution[0]['trxn_id'] );
+$this->assertEquals(1, count($contribution));
+$this->assertEquals('COINBASE PLUTO', $contribution[0]['trxn_id']);
+$this->assertEquals('online', db_query("SELECT {utm_medium} from 
{contribution_tracking} WHERE contribution_id = 
{$contribution[0]['id']}")->fetchField());
 }
 
 }
diff --git 
a/sites/all/modules/offline2civicrm/tests/ContributionConversion.test 
b/sites/all/modules/offline2civicrm/tests/ContributionConversionTest.php
similarity index 100%
rename from sites/all/modules/offline2civicrm/tests/ContributionConversion.test
rename to sites/all/modules/offline2civicrm/tests/ContributionConversionTest.php
diff --git a/sites/all/modules/offline2civicrm/tests/data/coinbase.csv 
b/sites/all/modules/offline2civicrm/tests/data/coinbase.csv
index b336848..d0c8678 100644
--- a/sites/all/modules/offline2civicrm/tests/data/coinbase.csv
+++ b/sites/all/modules/offline2civicrm/tests/data/coinbase.csv
@@ -1,2 +1,2 @@
-BTC Price,Currency,Customer Email,Native Price,Phone Number,Recurring Payment 
ID,Refund Transaction ID,Shipping Address 1,Shipping Address 2,Shipping 
City,Shipping Country,Shipping Name,Shipping Postal Code,Shipping 
State,Status,Timestamp,Tracking Code
-5.0009,BTC,mic...@mouse.com,1,456 789,,,52 Disney Lane,,Disneyland,US,Mickey 
Mouse2016-09-15,Pluto
+BTC Price,Currency,Customer Email,Native Price,Phone Number,Recurring Payment 
ID,Refund Transaction ID,Shipping Address 1,Shipping Address 2,Shipping 
City,Shipping Country,Shipping Name,Shipping Postal Code,Shipping 
State,Status,Timestamp,Tracking Code,Campaign,Medium,Banner
+5.0009,BTC,mic...@mouse.com,1,456 789,,,52 Disney Lane,,Disneyland,US,Mickey 
Mouse2016-09-15,Pluto,Planet drive,online,mouse-drive
diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index a3e8b65..c7ea3bc 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -1755,9 +1755,13 @@
 
 // if we're missing a cont

[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update eventstreams to cec9064

2016-12-29 Thread Ottomata (Code Review)
Ottomata has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329641 )

Change subject: Update eventstreams to cec9064
..


Update eventstreams to cec9064

List of changes:
cec9064 Properly use topic from kafkaMessage in meta

Change-Id: I75c1d9a1f2d21c593d8b662bcf76151041a5ff02
---
M src
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src b/src
index 0ca7329..cec9064 16
--- a/src
+++ b/src
@@ -1 +1 @@
-Subproject commit 0ca73294f3ad77c596c349e36545b426b081c20c
+Subproject commit cec90648f58383f40f0496da9af3dd7cd1a74b7d

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I75c1d9a1f2d21c593d8b662bcf76151041a5ff02
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/eventstreams/deploy
Gerrit-Branch: master
Gerrit-Owner: Ottomata 
Gerrit-Reviewer: Ottomata 

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


[MediaWiki-commits] [Gerrit] mediawiki...eventstreams[master]: Properly use topic from kafkaMessage in meta

2016-12-29 Thread Ottomata (Code Review)
Ottomata has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329640 )

Change subject: Properly use topic from kafkaMessage in meta
..


Properly use topic from kafkaMessage in meta

Change-Id: Ibe4ed3a6bd46c7310a6ddc5a74f7cbe1e66935b9
---
M lib/eventstreams-util.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/lib/eventstreams-util.js b/lib/eventstreams-util.js
index 2c5eb7c..828e472 100644
--- a/lib/eventstreams-util.js
+++ b/lib/eventstreams-util.js
@@ -45,7 +45,7 @@
 if (!kafkaMessage.message.meta) {
 kafkaMessage.message.meta = {};
 }
-kafkaMessage.message.meta.topic = kafkaMessage.topic_name;
+kafkaMessage.message.meta.topic = kafkaMessage.topic;
 kafkaMessage.message.meta.partition = kafkaMessage.partition;
 kafkaMessage.message.meta.offset= kafkaMessage.offset;
 if (kafkaMessage.key) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe4ed3a6bd46c7310a6ddc5a74f7cbe1e66935b9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/eventstreams
Gerrit-Branch: master
Gerrit-Owner: Ottomata 
Gerrit-Reviewer: Ottomata 

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


[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update eventstreams to cec9064

2016-12-29 Thread Ottomata (Code Review)
Ottomata has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329641 )

Change subject: Update eventstreams to cec9064
..

Update eventstreams to cec9064

List of changes:
cec9064 Properly use topic from kafkaMessage in meta

Change-Id: I75c1d9a1f2d21c593d8b662bcf76151041a5ff02
---
M src
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/services/eventstreams/deploy 
refs/changes/41/329641/1

diff --git a/src b/src
index 0ca7329..cec9064 16
--- a/src
+++ b/src
@@ -1 +1 @@
-Subproject commit 0ca73294f3ad77c596c349e36545b426b081c20c
+Subproject commit cec90648f58383f40f0496da9af3dd7cd1a74b7d

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I75c1d9a1f2d21c593d8b662bcf76151041a5ff02
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/eventstreams/deploy
Gerrit-Branch: master
Gerrit-Owner: Ottomata 

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


[MediaWiki-commits] [Gerrit] mediawiki...eventstreams[master]: Properly use topic from kafkaMessage in meta

2016-12-29 Thread Ottomata (Code Review)
Ottomata has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329640 )

Change subject: Properly use topic from kafkaMessage in meta
..

Properly use topic from kafkaMessage in meta

Change-Id: Ibe4ed3a6bd46c7310a6ddc5a74f7cbe1e66935b9
---
M lib/eventstreams-util.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/eventstreams 
refs/changes/40/329640/1

diff --git a/lib/eventstreams-util.js b/lib/eventstreams-util.js
index 2c5eb7c..828e472 100644
--- a/lib/eventstreams-util.js
+++ b/lib/eventstreams-util.js
@@ -45,7 +45,7 @@
 if (!kafkaMessage.message.meta) {
 kafkaMessage.message.meta = {};
 }
-kafkaMessage.message.meta.topic = kafkaMessage.topic_name;
+kafkaMessage.message.meta.topic = kafkaMessage.topic;
 kafkaMessage.message.meta.partition = kafkaMessage.partition;
 kafkaMessage.message.meta.offset= kafkaMessage.offset;
 if (kafkaMessage.key) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe4ed3a6bd46c7310a6ddc5a74f7cbe1e66935b9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/eventstreams
Gerrit-Branch: master
Gerrit-Owner: Ottomata 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use \xc2\xa0 instead of   or  

2016-12-29 Thread Fomafix (Code Review)
Fomafix has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329639 )

Change subject: Use \xc2\xa0 instead of   or  
..

Use \xc2\xa0 instead of   or  

Directly use the UTF-8 encoding of the 'NO-BREAK SPACE' (U+00A0) instead of
the HTML/XML entities   or   or  .

With the UTF-8 character the generated HTML is shorter and better to read.
Developer tools like Firebug can show the HTML entities from UTF-8 characters
when necessary to debug.

Bug: T154300
Change-Id: I882599ac1120789bb4e524c4394870680caca4f4
---
M includes/CategoryViewer.php
M includes/EditPage.php
M includes/Html.php
M includes/Preferences.php
M includes/Xml.php
M includes/actions/HistoryAction.php
M includes/changes/ChangesList.php
M includes/changes/EnhancedChangesList.php
M includes/diff/DifferenceEngine.php
M includes/diff/TableDiffFormatter.php
M includes/diff/WordAccumulator.php
M includes/htmlform/HTMLForm.php
M includes/htmlform/HTMLFormField.php
M includes/htmlform/fields/HTMLButtonField.php
M includes/htmlform/fields/HTMLCheckField.php
M includes/htmlform/fields/HTMLCheckMatrix.php
M includes/htmlform/fields/HTMLFormFieldCloner.php
M includes/htmlform/fields/HTMLFormFieldWithButton.php
M includes/htmlform/fields/HTMLMultiSelectField.php
M includes/htmlform/fields/HTMLRadioField.php
M includes/htmlform/fields/HTMLSizeFilterField.php
M includes/installer/WebInstaller.php
M includes/installer/WebInstallerOptions.php
M includes/logging/LogEventsList.php
M includes/page/Article.php
M includes/pager/TablePager.php
M includes/specials/SpecialContributions.php
M includes/specials/SpecialEmailuser.php
M includes/specials/SpecialMergeHistory.php
M includes/specials/SpecialProtectedtitles.php
M includes/specials/SpecialUndelete.php
M includes/specials/SpecialWhatlinkshere.php
M includes/specials/pagers/AllMessagesTablePager.php
M includes/specials/pagers/UsersPager.php
M tests/phpunit/includes/HtmlTest.php
M tests/phpunit/includes/api/ApiOptionsTest.php
36 files changed, 74 insertions(+), 74 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/39/329639/1

diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php
index 4c4b8bb..e710799 100644
--- a/includes/CategoryViewer.php
+++ b/includes/CategoryViewer.php
@@ -582,7 +582,7 @@
 
foreach ( $colContents as $char => $articles ) {
# Change space to non-breaking space to keep headers 
aligned
-   $h3char = $char === ' ' ? ' ' : htmlspecialchars( 
$char );
+   $h3char = $char === ' ' ? "\xc2\xa0" : 
htmlspecialchars( $char );
 
$ret .= '' . $h3char;
$ret .= "\n";
diff --git a/includes/EditPage.php b/includes/EditPage.php
index c11df5d..efce335 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -4040,7 +4040,7 @@
];
$minorEditHtml =
Xml::check( 'wpMinoredit', 
$checked['minor'], $attribs ) .
-   "  
Linker::titleAttrib( 'minoredit', 'withaccess' ) ] ) .
">{$minorLabel}";
 
@@ -4064,7 +4064,7 @@
];
$watchThisHtml =
Xml::check( 'wpWatchthis', $checked['watch'], 
$attribs ) .
-   "  
Linker::titleAttrib( 'watch', 'withaccess' ) ] ) .
">{$watchLabel}";
if ( $wgUseMediaWikiUIEverywhere ) {
diff --git a/includes/Html.php b/includes/Html.php
index 0b6b655..65c5710 100644
--- a/includes/Html.php
+++ b/includes/Html.php
@@ -895,7 +895,7 @@
'label', [
'for' => isset( $selectAttribs['id'] ) 
? $selectAttribs['id'] : null,
], $params['label']
-   ) . ' ';
+   ) . "\xc2\xa0";
}
 
// Wrap options in a 
diff --git a/includes/Preferences.php b/includes/Preferences.php
index cf8e7b8..61931fe 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -589,7 +589,7 @@
$defaultPreferences['skin'] = [
'type' => 'radio',
'options' => $skinOptions,
-   'label' => ' ',
+   'label' => "\xc2\xa0",
'section' => 'rendering/skin',
];
}
@@ -659,7 +659,7 @@
$defaultPreferences['date'] = [
'type' => 'radio',
'options' => $dateOptions,
-   'label' => ' ',
+   'label' => "\xc2\xa0",

[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: ApiFlow: Determine write mode on a per-submodule basis

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327302 )

Change subject: ApiFlow: Determine write mode on a per-submodule basis
..


ApiFlow: Determine write mode on a per-submodule basis

We are getting lots of warnings like
[DBPerformance] Expectation (writes <= 0) by 
ApiMain::setRequestExpectations not met
in production, because some of ApiFlow's submodules are read-only
modules that allow GET, and others are write modules that require POST.
ApiFlow ensures internally that POST is required for write modules,
but ApiMain doesn't know that when setting its expectations.

To fix this, make the top-level module's isWriteMode() pass through
to the submodule's isWriteMode(). ApiQuery uses a similar trick
for isReadMode().

Bug: T120543
Change-Id: I577b5aa6f314808494e4090a5454b97330c0e520
---
M includes/Api/ApiFlow.php
1 file changed, 8 insertions(+), 0 deletions(-)

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



diff --git a/includes/Api/ApiFlow.php b/includes/Api/ApiFlow.php
index 282c2c9..6a10348 100644
--- a/includes/Api/ApiFlow.php
+++ b/includes/Api/ApiFlow.php
@@ -141,6 +141,14 @@
);
}
 
+   public function isWriteMode() {
+   // We can't use extractRequestParams() here because 
getHelpFlags() calls this function,
+   // and we'd error out because the submodule parameter isn't set.
+   $moduleName = $this->getMain()->getVal( 'submodule' );
+   $module = $this->moduleManager->getModule( $moduleName, 
'submodule' );
+   return $module ? $module->isWriteMode() : false;
+   }
+
public function getHelpUrls() {
return array(
'https://www.mediawiki.org/wiki/Extension:Flow/API',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I577b5aa6f314808494e4090a5454b97330c0e520
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: ApiFlow: Clean up submodule handling

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327301 )

Change subject: ApiFlow: Clean up submodule handling
..


ApiFlow: Clean up submodule handling

* Use dieWithErrorOrDebug() instead of dieWithError() for
  the mustBePosted check, in line with ApiMain. This ensures
  that GET requests to POST modules work when $wgDebugAPI = true;.
* Require the token parameter to be posted; this behavior was
  added to ApiMain in 6a068d18e.
* Remove b/c code for $module->validateToken(), it was introduced
  in 1.24 and master of Flow requires master of MW core anyway.
* Remove b/c code for type=>'submodule'

Ideally, submodule support in ApiMain/ApiBase would be such that
we (and ApiQuery) don't have to copy a bunch of its logic to
execute submodules.

Change-Id: I50c690af5c0d1c199baabd400f974403fe7fce45
---
M includes/Api/ApiFlow.php
1 file changed, 6 insertions(+), 22 deletions(-)

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



diff --git a/includes/Api/ApiFlow.php b/includes/Api/ApiFlow.php
index 7085226..282c2c9 100644
--- a/includes/Api/ApiFlow.php
+++ b/includes/Api/ApiFlow.php
@@ -75,7 +75,7 @@
// The checks for POST and tokens are the same as ApiMain.php
$wasPosted = $this->getRequest()->wasPosted();
if ( !$wasPosted && $module->mustBePosted() ) {
-   $this->dieWithError( [ 'apierror-mustbeposted', 
$params['submodule'] ] );
+   $this->dieWithErrorOrDebug( [ 'apierror-mustbeposted', 
$params['submodule'] ] );
}
 
if ( $module->needsToken() ) {
@@ -83,18 +83,10 @@
$this->dieWithError( [ 'apierror-missingparam', 
'token' ] );
}
 
-   if ( is_callable( array( $module, 'validateToken' ) ) ) 
{
-   if ( !$module->validateToken( $params['token'], 
$params ) ) {
-   $this->dieWithError( 
'apierror-badtoken' );
-   }
-   } else {
-   if ( !$this->getUser()->matchEditToken(
-   $params['token'],
-   $module->getTokenSalt(),
-   $this->getRequest() )
-   ) {
-   $this->dieWithError( 
'apierror-badtoken' );
-   }
+   $module->requirePostedParameters( [ 'token' ] );
+
+   if ( !$module->validateToken( $params['token'], $params 
) ) {
+   $this->dieWithError( 'apierror-badtoken' );
}
}
 
@@ -135,18 +127,10 @@
}
 
public function getAllowedParams() {
-   $mainParams = $this->getMain()->getAllowedParams();
-   if ( $mainParams['action'][ApiBase::PARAM_TYPE] === 'submodule' 
) {
-   $submodulesType = 'submodule';
-   } else {
-   /** @todo Remove this case once support for older 
MediaWiki is dropped */
-   $submodulesType = $this->moduleManager->getNames( 
'submodule' );
-   }
-
return array(
'submodule' => array(
ApiBase::PARAM_REQUIRED => true,
-   ApiBase::PARAM_TYPE => $submodulesType,
+   ApiBase::PARAM_TYPE => 'submodule',
),
'page' => array(
ApiBase::PARAM_REQUIRED => true,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I50c690af5c0d1c199baabd400f974403fe7fce45
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Sbisson 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Database: Avoid internal use of ignoreErrors()

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/239532 )

Change subject: Database: Avoid internal use of ignoreErrors()
..


Database: Avoid internal use of ignoreErrors()

* Use $tempIgnore in DatabaseBase::tableExists() instead of ignoreErrors().
* DatabasePostgres::reportQueryError(), since 419221e4a71b, calls
  ignoreErrors() before and after rollback(). This is probably not effective
  as a recursion guard (reportQueryError() would be called regardless), and
  for suppressing any log entry or exception, it is redundant (doRollback()
  already sets $tempIgnore when calling query()).
* ignoreErrors(), now unused, can be removed in a separate change set.

Change-Id: Iee768abf996ece213146ab8f64a15a2b407a2e5e
---
M includes/libs/rdbms/database/Database.php
M includes/libs/rdbms/database/DatabasePostgres.php
2 files changed, 2 insertions(+), 5 deletions(-)

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



diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index b9beac8..69cf1ac 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -1419,9 +1419,8 @@
}
 
$table = $this->tableName( $table );
-   $old = $this->ignoreErrors( true );
-   $res = $this->query( "SELECT 1 FROM $table LIMIT 1", $fname );
-   $this->ignoreErrors( $old );
+   $ignoreErrors = true;
+   $res = $this->query( "SELECT 1 FROM $table LIMIT 1", $fname, 
$ignoreErrors );
 
return (bool)$res;
}
diff --git a/includes/libs/rdbms/database/DatabasePostgres.php 
b/includes/libs/rdbms/database/DatabasePostgres.php
index cd02177..42113b0 100644
--- a/includes/libs/rdbms/database/DatabasePostgres.php
+++ b/includes/libs/rdbms/database/DatabasePostgres.php
@@ -243,9 +243,7 @@
}
/* Transaction stays in the ERROR state until rolled back */
if ( $this->mTrxLevel ) {
-   $ignore = $this->ignoreErrors( true );
$this->rollback( __METHOD__ );
-   $this->ignoreErrors( $ignore );
}
parent::reportQueryError( $error, $errno, $sql, $fname, false );
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Factor out preferred editor check

2016-12-29 Thread Esanders (Code Review)
Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329638 )

Change subject: Factor out preferred editor check
..

Factor out preferred editor check

Change-Id: Ic2e2e2e1d24dba8854315dff068ea9ce5d409c5a
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
1 file changed, 24 insertions(+), 27 deletions(-)


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

diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index 7c8b6d0..2260982 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -341,6 +341,20 @@
return editor;
}
 
+   function getPreferredEditor() {
+   switch ( tabPreference ) {
+   case 'remember-last':
+   return getLastEditor();
+   case 'prefer-ve':
+   return 'visualeditor';
+   case 'prefer-wt':
+   return 'wikitext';
+   default:
+   // Two tabs, no preference
+   return null;
+   }
+   }
+
conf = mw.config.get( 'wgVisualEditorConfig' );
tabMessages = conf.tabMessages;
uri = new mw.Uri();
@@ -707,21 +721,11 @@
init.isSingleEditTab = conf.singleEditTab && tabPreference !== 
'multi-tab';
 
function isOnlyTabVE() {
-   return conf.singleEditTab && (
-   tabPreference === 'prefer-ve' || (
-   tabPreference === 'remember-last' &&
-   getLastEditor() !== 'wikitext'
-   )
-   );
+   return conf.singleEditTab && getPreferredEditor() === 
'visualeditor';
}
 
function isOnlyTabWikitext() {
-   return conf.singleEditTab && (
-   tabPreference === 'prefer-wt' || (
-   tabPreference === 'remember-last' &&
-   getLastEditor() === 'wikitext'
-   )
-   );
+   return conf.singleEditTab && getPreferredEditor() === 
'wikitext';
}
 
// On a view page, extend the current URI so parameters like oldid are 
carried over
@@ -825,12 +829,12 @@
}
 
$( function () {
-   var showWikitextWelcome = true,
+   var mode,
+   showWikitextWelcome = true,
section = uri.query.section !== undefined ? 
parseSection( uri.query.section ) : null,
isLoggedIn = !mw.user.isAnon(),
prefSaysShowWelcome = isLoggedIn && 
!mw.user.options.get( 'visualeditor-hidebetawelcome' ),
urlSaysHideWelcome = 'hidewelcomedialog' in new mw.Uri( 
location.href ).query,
-   action = 'edit',
welcomeDialogLocalStorageValue = null;
 
if ( uri.query.action === 'edit' && $( '#wpTextbox1' ).length ) 
{
@@ -901,22 +905,15 @@
mechanism: 'url'
} );
if ( isViewPage && uri.query.veaction 
in editModes ) {
-   activateTarget( editModes[ 
uri.query.veaction ], section );
+   mode = editModes[ 
uri.query.veaction ];
} else {
-   if (
-   
init.isWikitextAvailable &&
-   (
-   tabPreference 
=== 'prefer-ve' ||
-   (
-   
tabPreference === 'remember-last' &&
-   
getLastEditor() === 'wikitext'
-   )
-   )
-   ) {
-   action = 'editsource';
+   if ( init.isWikitextAvailable 
&& getPreferredEditor() === 'wikitext' ) {
+   mode = 'source';
+   } else {
+   mode

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Use preferred number casting method

2016-12-29 Thread Esanders (Code Review)
Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329637 )

Change subject: Use preferred number casting method
..

Use preferred number casting method

Change-Id: I77215f2bdb6eb055375e5b803d23b6f26df2d8d1
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index 7c8b6d0..4ecf3b8 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -699,9 +699,9 @@
};
 
// Cast "0" (T89513)
-   enable = Number( mw.user.options.get( 'visualeditor-enable' ) );
-   tempdisable = Number( mw.user.options.get( 
'visualeditor-betatempdisable' ) );
-   autodisable = Number( mw.user.options.get( 'visualeditor-autodisable' ) 
);
+   enable = +mw.user.options.get( 'visualeditor-enable' );
+   tempdisable = +mw.user.options.get( 'visualeditor-betatempdisable' );
+   autodisable = +mw.user.options.get( 'visualeditor-autodisable' );
tabPreference = mw.user.options.get( 'visualeditor-tabs' );
 
init.isSingleEditTab = conf.singleEditTab && tabPreference !== 
'multi-tab';

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Fix edit and delete js on multicolumn

2016-12-29 Thread Brian Wolff (Code Review)
Brian Wolff has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329636 )

Change subject: Fix edit and delete js on multicolumn
..

Fix edit and delete js on multicolumn

The drag and drop still has to be done.

Bug: T149042
Change-Id: I81bc49a0eeb699a0e32ad8fb9e48d50f8f044e71
---
M includes/content/CollaborationListContent.php
M modules/ext.CollaborationKit.list.edit.js
2 files changed, 46 insertions(+), 17 deletions(-)


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

diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index 6a8012d..337ef22 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -243,8 +243,11 @@
$listclass = count( $columns ) > 1 ? 'mw-ck-multilist' : 
'mw-ck-singlelist';
$text .= '' . "\n";
$offset = $options['defaultSort'] === 'random' ? 0 : 
$options['offset'];
-   foreach ( $columns as $column ) {
-   $text .= '' . "\n";
+   foreach ( $columns as $colId => $column ) {
+   $text .= Html::openElement( 'div', [
+   'class' => 'mw-ck-list-column',
+   'data-collabkit-column-id' => $colId
+   ] ) . "\n";
if ( isset( $column->label ) && $column->label !== '' ) 
{
$text .= "=== {$column->label} ===\n";
}
diff --git a/modules/ext.CollaborationKit.list.edit.js 
b/modules/ext.CollaborationKit.list.edit.js
index 8c83a08..5473ec5 100644
--- a/modules/ext.CollaborationKit.list.edit.js
+++ b/modules/ext.CollaborationKit.list.edit.js
@@ -1,8 +1,19 @@
 ( function ( $, mw, OO ) {
-   var deleteItem, getCurrentJson, saveJson, addItem, reorderList, 
getListOfTitles, modifyItem, modifyExistingItem, addSelf, curUserIsInList;
+   var deleteItem, getCurrentJson, saveJson, addItem, reorderList, 
getListOfTitles, modifyItem, modifyExistingItem, addSelf, curUserIsInList, 
getCol;
 
addItem = function () {
modifyItem( {} );
+   };
+
+   getColId = function ( $item ) {
+   var $col, id;
+
+   $col = $item.closest( '.mw-ck-list-column' );
+   id = parseInt( $col.data( 'collabkit-column-id' ), 10 );
+   if ( $col.length === 0 || !isFinite( id ) ) {
+   throw new Error( "Cannot find column" );
+   }
+   return id;
};
 
/**
@@ -34,17 +45,24 @@
return $( query ).length > 0;
};
 
-   modifyExistingItem = function ( itemName ) {
+   /**
+* Edit an existing item.
+*
+* @param {string} itemName The title of the item in question
+* @param {int} colId Which column the item is in
+*/
+   modifyExistingItem = function ( itemName, colId ) {
getCurrentJson( mw.config.get( 'wgArticleId' ), function ( res 
) {
var done = false;
-   $.each( res.content.columns[ 0 ].items, function ( 
index ) {
+   $.each( res.content.columns[ colId ].items, function ( 
index ) {
if ( this.title === itemName ) {
done = true;
modifyItem( {
itemTitle: this.title,
itemImage: this.image,
itemDescription: this.notes,
-   itemIndex: index
+   itemIndex: index,
+   itemColId: colId
} );
return false;
}
@@ -91,7 +109,8 @@
deleteItem = function ( $item ) {
var cur,
$spinner,
-   title = $item.data( 'collabkit-item-title' );
+   title = $item.data( 'collabkit-item-title' ),
+   colId = getColId( $item );
 
$spinner = $.createSpinner( {
size: 'small',
@@ -103,13 +122,13 @@
 
cur = getCurrentJson( mw.config.get( 'wgArticleId' ), function 
( res ) {
var newItems = [];
-   $.each( res.content.columns[ 0 ].items, function ( 
index ) {
+   $.each( res.content.columns[ colId ].items, function ( 
index ) {
if ( this.title === title ) {
return;
  

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Made strings "name" and "badges" translatable

2016-12-29 Thread Subins2000 (Code Review)
Subins2000 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329635 )

Change subject: Made strings "name" and "badges" translatable
..

Made strings "name" and "badges" translatable

Strings "name" and "badges" has been made translatable in Item Diff page.

Bug: T111016
Change-Id: I2f53b0e99c72a066599c1117a29541606991930a
---
M repo/i18n/en.json
M repo/i18n/ml.json
M repo/includes/Diff/DiffView.php
3 files changed, 11 insertions(+), 1 deletion(-)


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

diff --git a/repo/i18n/en.json b/repo/i18n/en.json
index 2887a99..b66a139 100644
--- a/repo/i18n/en.json
+++ b/repo/i18n/en.json
@@ -59,6 +59,8 @@
"wikibase-diffview-alias": "aliases",
"wikibase-diffview-description": "description",
"wikibase-diffview-link": "links",
+   "wikibase-diffview-name": "name",
+   "wikibase-diffview-badges": "badges",
"wikibase-sitelink-site-edit-placeholder": "wiki",
"wikibase-sitelink-page-edit-placeholder": "page",
"wikibase-alias-edit-placeholder": "enter an alias",
diff --git a/repo/i18n/ml.json b/repo/i18n/ml.json
index 199e2fa..9d3406e 100644
--- a/repo/i18n/ml.json
+++ b/repo/i18n/ml.json
@@ -43,6 +43,8 @@
"wikibase-diffview-alias": "അപരനാമങ്ങൾ",
"wikibase-diffview-description": "വിവരണം",
"wikibase-diffview-link": "കണ്ണികൾ",
+   "wikibase-diffview-name": "പേര് ",
+   "wikibase-diffview-badges": "ബാഡ്ജുകൾ",
"wikibase-sitelink-site-edit-placeholder": "സൈറ്റ്",
"wikibase-sitelink-page-edit-placeholder": "താൾ",
"wikibase-alias-edit-placeholder": "ഒരു അപരനാമം നൽകുക",
diff --git a/repo/includes/Diff/DiffView.php b/repo/includes/Diff/DiffView.php
index b59d0ac..0e9d799 100644
--- a/repo/includes/Diff/DiffView.php
+++ b/repo/includes/Diff/DiffView.php
@@ -99,7 +99,13 @@
 */
private function generateOpHtml( array $path, DiffOp $op ) {
if ( $op->isAtomic() ) {
-   $html = $this->generateDiffHeaderHtml( implode( ' / ', 
$path ) );
+   $translatedPath = $path;
+
+   if($path[0] === $this->getLanguage()->getMessage( 
'wikibase-diffview-link' )){
+   $translatedPath[2] = 
$this->getLanguage()->getMessage( 'wikibase-diffview-' . $path[2] );
+   }
+
+   $html = $this->generateDiffHeaderHtml( implode( ' / ', 
$translatedPath ) );
 
//TODO: no path, but localized section title
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f53b0e99c72a066599c1117a29541606991930a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Subins2000 

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Fix NWE-only edit tab

2016-12-29 Thread Esanders (Code Review)
Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329634 )

Change subject: Fix NWE-only edit tab
..

Fix NWE-only edit tab

Change-Id: I5d08e30f43fbe08eb8809692728a8ab37f3a1491
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
2 files changed, 21 insertions(+), 23 deletions(-)


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

diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index 8324fb2..373c566 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -733,7 +733,7 @@
 
// On a view page, extend the current URI so parameters like oldid are 
carried over
// On a non-view page, use viewUri
-   if ( isOnlyTabVE() ) {
+   if ( init.isSingleEditTab ) {
veEditUri = viewUri.clone().extend( { action: 'edit' } );
delete veEditUri.query.veaction;
} else {
@@ -745,23 +745,6 @@
if ( oldid ) {
veEditUri.extend( { oldid: oldid } );
}
-
-   userPrefEnabled = (
-   // Allow disabling for anonymous users separately from changing 
the
-   // default preference (bug 5)
-   !( conf.disableForAnons && mw.config.get( 'wgUserName' ) === 
null ) &&
-
-   // User has 'visualeditor-enable' preference enabled (for alpha 
opt-in)
-   // User has 'visualeditor-betatempdisable' preference disabled
-   // User has 'visualeditor-autodisable' preference disabled
-   enable && !tempdisable && !autodisable
-   );
-   userPrefPreferShow = (
-   userPrefEnabled &&
-
-   // If in two-edit-tab mode, or the user doesn't prefer wikitext 
always
-   ( !conf.singleEditTab || tabPreference !== 'prefer-wt' )
-   );
 
// Whether VisualEditor should be available for the current user, page, 
wiki, mediawiki skin,
// browser etc.
@@ -807,6 +790,24 @@
if ( init.isWikitextAvailable ) {
editModes.editsource = 'source';
}
+
+   userPrefEnabled = (
+   // Allow disabling for anonymous users separately from changing 
the
+   // default preference (bug 5)
+   !( conf.disableForAnons && mw.config.get( 'wgUserName' ) === 
null ) &&
+
+   // User has 'visualeditor-enable' preference enabled (for alpha 
opt-in)
+   // User has 'visualeditor-betatempdisable' preference disabled
+   // User has 'visualeditor-autodisable' preference disabled
+   enable && !tempdisable && !autodisable
+   );
+   userPrefPreferShow = (
+   userPrefEnabled &&
+
+   // Except when single edit tab for old wikitext
+   !( conf.singleEditTab && tabPreference === 'prefer-wt' && 
!init.isWikitextAvailable )
+   );
+
 
// FIXME: We should do this more elegantly
init.setEditorPreference = setEditorPreference;
@@ -1052,7 +1053,7 @@
// Set up the tabs appropriately if the user has VE on
if ( init.isAvailable && userPrefPreferShow ) {
// … on two-edit-tab wikis, or single-edit-tab 
wikis, where the user wants both …
-   if ( !conf.singleEditTab || tabPreference === 
'multi-tab' ) {
+   if ( !init.isSingleEditTab ) {
// … set the skin up with both tabs and 
both section edit links.
init.setupMultiTabSkin();
} else if (
diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
index b88f920..77d9ed6 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
@@ -1318,10 +1318,7 @@
// Set the current URL
uri = this.currentUri;
 
-   if (
-   mw.config.get( 'wgVisualEditorConfig' ).singleEditTab &&
-   mw.user.options.get( 'visualeditor-tabs' ) !== 
'multi-tab'
-   ) {
+   if ( mw.libs.ve.isSingleEditTab ) {
uri.query.action = 'edit';
mw.config.set( 'wgAction', 'edit' );
} else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5d08e30f43fbe0

[MediaWiki-commits] [Gerrit] mediawiki...Dashiki[master]: Add empty @metadata to i18n file for banana check

2016-12-29 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329633 )

Change subject: Add empty @metadata to i18n file for banana check
..

Add empty @metadata to i18n file for banana check

Change-Id: I8fee864b29ae720f7a4a60b4d76c91371421807c
---
M i18n/en.json
M i18n/qqq.json
2 files changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/i18n/en.json b/i18n/en.json
index a676e3b..131b114 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -1,4 +1,5 @@
 {
+   "@metadata": {},
"dashiki-desc": "Dashiki is a dashboarding tool that uses wiki pages as 
configuration.  This extension helps Dashiki authors read and edit valid 
configuration pages on wiki.",
"dashiki-build": "Build a dashboard with this config using the command:"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b190771..9d2879c 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -1,4 +1,5 @@
 {
+   "@metadata": {},
"dashiki-desc": 
"{{desc|name=Dashiki|url=https://www.mediawiki.org/wiki/Extension:Dashiki}}";,
"dashiki-build": "Label shown next to the command used to build a 
Dashiki dashboard based on this configuration"
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8fee864b29ae720f7a4a60b4d76c91371421807c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Dashiki
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 

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


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Fix CodeEditor JS error on CollaborationHub edit page

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329632 )

Change subject: Fix CodeEditor JS error on CollaborationHub edit page
..


Fix CodeEditor JS error on CollaborationHub edit page

We were incorrectly telling CodeEditor this is JSON content when
it was actually are custom edit form, which was causing CodeEditor
to barf when WikiEditor extension was enabled.

Bug: T151701
Change-Id: I593f66582e9d50b1c3e5acfbc63ebceae1c6be3a
---
M CollaborationKit.hooks.php
1 file changed, 1 insertion(+), 5 deletions(-)

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



diff --git a/CollaborationKit.hooks.php b/CollaborationKit.hooks.php
index a1e16e1..cbabf2c 100644
--- a/CollaborationKit.hooks.php
+++ b/CollaborationKit.hooks.php
@@ -66,7 +66,7 @@
$ckitModels = [ 'CollaborationHubContent', 
'CollaborationListContent' ];
$req = RequestContext::getMain()->getRequest();
// Kind of hacky use of globals.
-   if ( $contentModel === 'CollaborationListContent' ) {
+   if ( in_array( $contentModel, $ckitModels ) ) {
if ( $req->getVal( 'format' ) === 'application/json' ) {
$lang = 'json';
return true;
@@ -77,10 +77,6 @@
$lang = null;
return false;
}
-   }
-   if ( $contentModel === 'CollaborationHubContent' ) {
-   $lang = 'json';
-   return true;
}
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I593f66582e9d50b1c3e5acfbc63ebceae1c6be3a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff 
Gerrit-Reviewer: Brian Wolff 
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...CollaborationKit[master]: Fix CodeEditor JS error on CollaborationHub edit page

2016-12-29 Thread Brian Wolff (Code Review)
Brian Wolff has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329632 )

Change subject: Fix CodeEditor JS error on CollaborationHub edit page
..

Fix CodeEditor JS error on CollaborationHub edit page

We were incorrectly telling CodeEditor this is JSON content when
it was actually are custom edit form, which was causing CodeEditor
to barf when WikiEditor extension was enabled.

Bug: T151701
Change-Id: I593f66582e9d50b1c3e5acfbc63ebceae1c6be3a
---
M CollaborationKit.hooks.php
1 file changed, 1 insertion(+), 5 deletions(-)


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

diff --git a/CollaborationKit.hooks.php b/CollaborationKit.hooks.php
index a1e16e1..cbabf2c 100644
--- a/CollaborationKit.hooks.php
+++ b/CollaborationKit.hooks.php
@@ -66,7 +66,7 @@
$ckitModels = [ 'CollaborationHubContent', 
'CollaborationListContent' ];
$req = RequestContext::getMain()->getRequest();
// Kind of hacky use of globals.
-   if ( $contentModel === 'CollaborationListContent' ) {
+   if ( in_array( $contentModel, $ckitModels ) ) {
if ( $req->getVal( 'format' ) === 'application/json' ) {
$lang = 'json';
return true;
@@ -77,10 +77,6 @@
$lang = null;
return false;
}
-   }
-   if ( $contentModel === 'CollaborationHubContent' ) {
-   $lang = 'json';
-   return true;
}
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I593f66582e9d50b1c3e5acfbc63ebceae1c6be3a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff 

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


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Fix function documentation

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329631 )

Change subject: Fix function documentation
..


Fix function documentation

Change-Id: I5ca915815901cb18201ee624f8eb25cd0126561f
---
M CollaborationKit.hooks.php
1 file changed, 7 insertions(+), 1 deletion(-)

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



diff --git a/CollaborationKit.hooks.php b/CollaborationKit.hooks.php
index a1e16e1..9e2b41e 100644
--- a/CollaborationKit.hooks.php
+++ b/CollaborationKit.hooks.php
@@ -43,7 +43,13 @@
}
 
/**
-* TODO DOCUMENT I'M SURE THIS IS IMPORTANT, BUT I HAVE NO IDEA WHY OR 
WHAT FOR
+* Register the {{#transcludelist:...}} and 
 hooks
+*
+* #transcludelist is to allow users to transclude a CollaborationList 
with
+* custom options.  allows enabling our 
style
+* modules directly from wikitext, so we can do plain wikitext 
transclusions of
+* lists and have them work properly, since ContentHandler does not 
provide access
+* to the parser when doing plain wikitext transclusion.
 *
 * @param $parser Parser
 */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5ca915815901cb18201ee624f8eb25cd0126561f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff 
Gerrit-Reviewer: Brian Wolff 
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...CollaborationKit[master]: Fix function documentation

2016-12-29 Thread Brian Wolff (Code Review)
Brian Wolff has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329631 )

Change subject: Fix function documentation
..

Fix function documentation

Change-Id: I5ca915815901cb18201ee624f8eb25cd0126561f
---
M CollaborationKit.hooks.php
1 file changed, 7 insertions(+), 1 deletion(-)


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

diff --git a/CollaborationKit.hooks.php b/CollaborationKit.hooks.php
index a1e16e1..9e2b41e 100644
--- a/CollaborationKit.hooks.php
+++ b/CollaborationKit.hooks.php
@@ -43,7 +43,13 @@
}
 
/**
-* TODO DOCUMENT I'M SURE THIS IS IMPORTANT, BUT I HAVE NO IDEA WHY OR 
WHAT FOR
+* Register the {{#transcludelist:...}} and 
 hooks
+*
+* #transcludelist is to allow users to transclude a CollaborationList 
with
+* custom options.  allows enabling our 
style
+* modules directly from wikitext, so we can do plain wikitext 
transclusions of
+* lists and have them work properly, since ContentHandler does not 
provide access
+* to the parser when doing plain wikitext transclusion.
 *
 * @param $parser Parser
 */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5ca915815901cb18201ee624f8eb25cd0126561f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: calico: Expose puppet keys as well

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329630 )

Change subject: calico: Expose puppet keys as well
..


calico: Expose puppet keys as well

Calico CNI plugins need the key to the puppet cert as well, otherwise we
get

Failed to setup network for pod
using network plugins \"cni\": open /etc/calico/ssl/server.key: no such
file or directory; Skipping pod

Change-Id: I382e97fc4f568945b6b59138ff6eb7371a0df15c
---
M modules/calico/manifests/init.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/calico/manifests/init.pp b/modules/calico/manifests/init.pp
index 5b30f3a..c885cce 100644
--- a/modules/calico/manifests/init.pp
+++ b/modules/calico/manifests/init.pp
@@ -17,7 +17,7 @@
 
 base::expose_puppet_certs { '/etc/calico':
 ensure  => present,
-provide_private => false,
+provide_private => true,
 require => File['/etc/calico'],
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I382e97fc4f568945b6b59138ff6eb7371a0df15c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 
Gerrit-Reviewer: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: calico: Expose puppet keys as well

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329630 )

Change subject: calico: Expose puppet keys as well
..

calico: Expose puppet keys as well

Calico CNI plugins need the key to the puppet cert as well, otherwise we
get

Failed to setup network for pod
using network plugins \"cni\": open /etc/calico/ssl/server.key: no such
file or directory; Skipping pod

Change-Id: I382e97fc4f568945b6b59138ff6eb7371a0df15c
---
M modules/calico/manifests/init.pp
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/calico/manifests/init.pp b/modules/calico/manifests/init.pp
index 5b30f3a..c885cce 100644
--- a/modules/calico/manifests/init.pp
+++ b/modules/calico/manifests/init.pp
@@ -17,7 +17,7 @@
 
 base::expose_puppet_certs { '/etc/calico':
 ensure  => present,
-provide_private => false,
+provide_private => true,
 require => File['/etc/calico'],
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I382e97fc4f568945b6b59138ff6eb7371a0df15c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Enable CNI plugin on kubernetes::node profile

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329607 )

Change subject: Enable CNI plugin on kubernetes::node profile
..


Enable CNI plugin on kubernetes::node profile

We want to enable the kubernetes node CNI functionality for our Calico
experiments.

Change-Id: Ia2eefedce81caa5d8534be1f6f35b637aec2f32f
---
M modules/profile/manifests/kubernetes/node.pp
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/modules/profile/manifests/kubernetes/node.pp 
b/modules/profile/manifests/kubernetes/node.pp
index 920271d..9cf0331 100644
--- a/modules/profile/manifests/kubernetes/node.pp
+++ b/modules/profile/manifests/kubernetes/node.pp
@@ -15,6 +15,7 @@
 listen_address=> '0.0.0.0',
 cluster_dns_ip=> '192.168.0.100',
 use_package   => true,
+cni   => true,
 pod_infra_container_image => $infra_pod,
 cluster_domain=> undef,
 tls_cert  => '/etc/kubernetes/ssl/cert.pem',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia2eefedce81caa5d8534be1f6f35b637aec2f32f
Gerrit-PatchSet: 7
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 
Gerrit-Reviewer: Alexandros Kosiaris 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: Fix description for mwgithub-finnframenet

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329629 )

Change subject: Fix description for mwgithub-finnframenet
..


Fix description for mwgithub-finnframenet

Change-Id: I38672802a7123a3fd954ef5874d0255fa9d5fa49
---
M groups/MediaWiki/mwgithub.yaml
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/groups/MediaWiki/mwgithub.yaml b/groups/MediaWiki/mwgithub.yaml
index e80f025..de18d46 100644
--- a/groups/MediaWiki/mwgithub.yaml
+++ b/groups/MediaWiki/mwgithub.yaml
@@ -319,7 +319,7 @@
 BASIC:
   id: mwgithub-finnframenet
   label: FinnFrameNet
-  description: "{{INT:ffn-desc}}"
+  description: "{{Special:MyLanguage/MediaWiki:Ffn-desc/en}}"
 
 FILES:
   class: JsonFFS

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I38672802a7123a3fd954ef5874d0255fa9d5fa49
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: Fix description for mwgithub-finnframenet

2016-12-29 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329629 )

Change subject: Fix description for mwgithub-finnframenet
..

Fix description for mwgithub-finnframenet

Change-Id: I38672802a7123a3fd954ef5874d0255fa9d5fa49
---
M groups/MediaWiki/mwgithub.yaml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/29/329629/1

diff --git a/groups/MediaWiki/mwgithub.yaml b/groups/MediaWiki/mwgithub.yaml
index e80f025..de18d46 100644
--- a/groups/MediaWiki/mwgithub.yaml
+++ b/groups/MediaWiki/mwgithub.yaml
@@ -319,7 +319,7 @@
 BASIC:
   id: mwgithub-finnframenet
   label: FinnFrameNet
-  description: "{{INT:ffn-desc}}"
+  description: "{{Special:MyLanguage/MediaWiki:Ffn-desc/en}}"
 
 FILES:
   class: JsonFFS

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I38672802a7123a3fd954ef5874d0255fa9d5fa49
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit 

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: Add support for new translatewiki github account and one rep...

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329628 )

Change subject: Add support for new translatewiki github account and one repo 
using it
..


Add support for new translatewiki github account and one repo using it

Change-Id: Ifcffd29eb7f9a8ab039261b2afed4783d60f710c
---
M bin/clupdate-git-repo
A bin/clupdate-github-repo
M groups/MediaWiki/mwgithub.yaml
M repoconfig.commit.json
M repoconfig.json
M repong/repong.php
6 files changed, 31 insertions(+), 5 deletions(-)

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



diff --git a/bin/clupdate-git-repo b/bin/clupdate-git-repo
index 4d57bc8..143e1df 100755
--- a/bin/clupdate-git-repo
+++ b/bin/clupdate-git-repo
@@ -26,5 +26,10 @@
git config gitreview.username 'l10n-bot'
 
git review -r origin -s
+   elif [ "$ME" = 'clupdate-github-repo' ]
+   then
+   cd "$DIR"
+   git config user.name 'translatewiki.net'
+   git config user.email 'l10n-...@translatewiki.net'
fi
 fi
diff --git a/bin/clupdate-github-repo b/bin/clupdate-github-repo
new file mode 12
index 000..184ea4f
--- /dev/null
+++ b/bin/clupdate-github-repo
@@ -0,0 +1 @@
+clupdate-git-repo
\ No newline at end of file
diff --git a/groups/MediaWiki/mwgithub.yaml b/groups/MediaWiki/mwgithub.yaml
index 3601e22..e80f025 100644
--- a/groups/MediaWiki/mwgithub.yaml
+++ b/groups/MediaWiki/mwgithub.yaml
@@ -314,3 +314,13 @@
 FILES:
   class: JsonFFS
   sourcePattern: 
"%GROUPROOT%/mwgithub/cmln/Chameleon/resources/i18n/%CODE%.json"
+
+---
+BASIC:
+  id: mwgithub-finnframenet
+  label: FinnFrameNet
+  description: "{{INT:ffn-desc}}"
+
+FILES:
+  class: JsonFFS
+  sourcePattern: 
"%GROUPROOT%/mwgithub/Nikerabbit/mediawiki-extensions-FinnFrameNet/i18n/%CODE%.json"
diff --git a/repoconfig.commit.json b/repoconfig.commit.json
index 7f4e858..f879625 100644
--- a/repoconfig.commit.json
+++ b/repoconfig.commit.json
@@ -275,6 +275,10 @@
"type": "git",
"url": 
"g...@github.com:JeroenDeDauw/Validator.git"
},
+   
"mwgithub/Nikerabbit/mediawiki-extensions-FinnFrameNet": {
+   "type": "github",
+   "url": 
"g...@github.com:Nikerabbit/mediawiki-extensions-FinnFrameNet.git"
+   },
"mwgithub/SemanticMediaWiki/SemanticBreadcrumbLinks": {
"type": "git",
"url": 
"g...@github.com:SemanticMediaWiki/SemanticBreadcrumbLinks.git"
diff --git a/repoconfig.json b/repoconfig.json
index 4c3283c..cf6924d 100644
--- a/repoconfig.json
+++ b/repoconfig.json
@@ -270,6 +270,10 @@
"type": "git",
"url": 
"https://github.com/JeroenDeDauw/Validator.git";
},
+   
"mwgithub/Nikerabbit/mediawiki-extensions-FinnFrameNet": {
+   "type": "github",
+   "url": 
"https://github.com/Nikerabbit/mediawiki-extensions-FinnFrameNet.git";
+   },
"mwgithub/SemanticMediaWiki/SemanticBreadcrumbLinks": {
"type": "git",
"url": 
"https://github.com/SemanticMediaWiki/SemanticBreadcrumbLinks.git";
diff --git a/repong/repong.php b/repong/repong.php
index 8262942..5525b1d 100644
--- a/repong/repong.php
+++ b/repong/repong.php
@@ -27,9 +27,10 @@
$base = $this->meta['basepath'];
 
foreach ( $this->config['repos'] as $name => $repo ) {
-   if ( $repo['type'] === 'git' ) {
-   $branch = isset( $repo['branch'] ) ? 
$repo['branch'] : 'master';
+   $type = $repo['type'];
+   $branch = isset( $repo['branch'] ) ? $repo['branch'] : 
'master';
 
+   if ( $type === 'git' ) {
$userName = get_current_user();
if ( isset( 
$this->usernameConversion[$userName] ) ) {
$userName = 
$this->usernameConversion[$userName];
@@ -39,8 +40,9 @@
$repoUrl = str_replace( 'USERNAME', $userName, 
$repoUrl );
 
$command = $this->bindir . "/clupdate-git-repo 
'$repoUrl' '$base/$name' '$branch'";
-   } elseif ( $repo['type'] === 'wmgerrit' ) {
-   $branch = isset( $repo['branch'] ) ? 
$repo['branch'] : 'master';
+   } elseif ( $type === 'github' ) {
+   $command = $this->bindir . 
"/clupdate-github-repo '{$repo['url']}' '$base/$name' '$branch'";
+ 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Allow BGP between kubernetes workers

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329627 )

Change subject: Allow BGP between kubernetes workers
..


Allow BGP between kubernetes workers

Calico uses BGP (via bird) to advertiste the IP addresses of the
workloads. Allow it between the hosts and also allow BGP sessions from
the core eqiad routers

Change-Id: I6f675fdc2f329102ce2e38721c35153463575229
---
M hieradata/role/common/kubernetes/worker.yaml
M modules/profile/manifests/calico/kubernetes.pp
2 files changed, 15 insertions(+), 0 deletions(-)

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



diff --git a/hieradata/role/common/kubernetes/worker.yaml 
b/hieradata/role/common/kubernetes/worker.yaml
index 47bcfca..1d8b5d8 100644
--- a/hieradata/role/common/kubernetes/worker.yaml
+++ b/hieradata/role/common/kubernetes/worker.yaml
@@ -19,3 +19,10 @@
 - https://etcd1002.eqiad.wmnet:2379
 - https://etcd1003.eqiad.wmnet:2379
 profile::calico::kubernetes::docker::registry: darmstadtium.eqiad.wmnet
+profile::calico::kubernetes::bgp_peers:
+- kubernetes1001.eqiad.wmnet
+- kubernetes1002.eqiad.wmnet
+- kubernetes1003.eqiad.wmnet
+- kubernetes1004.eqiad.wmnet
+- cr1-eqiad.wikimedia.org
+- cr2-eqiad.wikimedia.org
diff --git a/modules/profile/manifests/calico/kubernetes.pp 
b/modules/profile/manifests/calico/kubernetes.pp
index 0b89733..78abebb 100644
--- a/modules/profile/manifests/calico/kubernetes.pp
+++ b/modules/profile/manifests/calico/kubernetes.pp
@@ -5,6 +5,7 @@
 
 class profile::calico::kubernetes {
 $etcd_endpoints = hiera('profile::calico::kubernetes::etcd_endpoints')
+$bgp_peers = hiera('profile::calico::kubernetes::bgp_peers')
 $calico_version = hiera('profile::calico::kubernetes::calico_version')
 $registry = hiera('profile::calico::kubernetes::docker::registry')
 
@@ -16,4 +17,11 @@
 
 class { '::calico::cni':
 }
+
+$bgp_peers_ferm = join($bgp_peers, ' ')
+ferm::service { 'calico-bird':
+proto  => 'tcp',
+port   => '179', # BGP
+srange => "(@resolve((${bgp_peers_ferm})))",
+}
 }

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

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

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: Add support for new translatewiki github account and one rep...

2016-12-29 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329628 )

Change subject: Add support for new translatewiki github account and one repo 
using it
..

Add support for new translatewiki github account and one repo using it

Change-Id: Ifcffd29eb7f9a8ab039261b2afed4783d60f710c
---
M bin/clupdate-git-repo
A bin/clupdate-github-repo
M groups/MediaWiki/mwgithub.yaml
M repoconfig.commit.json
M repoconfig.json
M repong/repong.php
6 files changed, 31 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/28/329628/1

diff --git a/bin/clupdate-git-repo b/bin/clupdate-git-repo
index 4d57bc8..143e1df 100755
--- a/bin/clupdate-git-repo
+++ b/bin/clupdate-git-repo
@@ -26,5 +26,10 @@
git config gitreview.username 'l10n-bot'
 
git review -r origin -s
+   elif [ "$ME" = 'clupdate-github-repo' ]
+   then
+   cd "$DIR"
+   git config user.name 'translatewiki.net'
+   git config user.email 'l10n-...@translatewiki.net'
fi
 fi
diff --git a/bin/clupdate-github-repo b/bin/clupdate-github-repo
new file mode 12
index 000..184ea4f
--- /dev/null
+++ b/bin/clupdate-github-repo
@@ -0,0 +1 @@
+clupdate-git-repo
\ No newline at end of file
diff --git a/groups/MediaWiki/mwgithub.yaml b/groups/MediaWiki/mwgithub.yaml
index 3601e22..2c69cc7 100644
--- a/groups/MediaWiki/mwgithub.yaml
+++ b/groups/MediaWiki/mwgithub.yaml
@@ -314,3 +314,13 @@
 FILES:
   class: JsonFFS
   sourcePattern: 
"%GROUPROOT%/mwgithub/cmln/Chameleon/resources/i18n/%CODE%.json"
+
+---
+BASIC:
+  id: mwgithub-finnframenet
+  label: FinnFrameNet
+  description: "{{INT:ffn-desc}}"
+
+FILES:
+  class: JsonFFS
+  sourcePattern: 
"%GROUPROOT%/mwgithub/Nikerabbit/FinnFrameNet/i18n/%CODE%.json"
diff --git a/repoconfig.commit.json b/repoconfig.commit.json
index 7f4e858..f879625 100644
--- a/repoconfig.commit.json
+++ b/repoconfig.commit.json
@@ -275,6 +275,10 @@
"type": "git",
"url": 
"g...@github.com:JeroenDeDauw/Validator.git"
},
+   
"mwgithub/Nikerabbit/mediawiki-extensions-FinnFrameNet": {
+   "type": "github",
+   "url": 
"g...@github.com:Nikerabbit/mediawiki-extensions-FinnFrameNet.git"
+   },
"mwgithub/SemanticMediaWiki/SemanticBreadcrumbLinks": {
"type": "git",
"url": 
"g...@github.com:SemanticMediaWiki/SemanticBreadcrumbLinks.git"
diff --git a/repoconfig.json b/repoconfig.json
index 4c3283c..cf6924d 100644
--- a/repoconfig.json
+++ b/repoconfig.json
@@ -270,6 +270,10 @@
"type": "git",
"url": 
"https://github.com/JeroenDeDauw/Validator.git";
},
+   
"mwgithub/Nikerabbit/mediawiki-extensions-FinnFrameNet": {
+   "type": "github",
+   "url": 
"https://github.com/Nikerabbit/mediawiki-extensions-FinnFrameNet.git";
+   },
"mwgithub/SemanticMediaWiki/SemanticBreadcrumbLinks": {
"type": "git",
"url": 
"https://github.com/SemanticMediaWiki/SemanticBreadcrumbLinks.git";
diff --git a/repong/repong.php b/repong/repong.php
index 8262942..5525b1d 100644
--- a/repong/repong.php
+++ b/repong/repong.php
@@ -27,9 +27,10 @@
$base = $this->meta['basepath'];
 
foreach ( $this->config['repos'] as $name => $repo ) {
-   if ( $repo['type'] === 'git' ) {
-   $branch = isset( $repo['branch'] ) ? 
$repo['branch'] : 'master';
+   $type = $repo['type'];
+   $branch = isset( $repo['branch'] ) ? $repo['branch'] : 
'master';
 
+   if ( $type === 'git' ) {
$userName = get_current_user();
if ( isset( 
$this->usernameConversion[$userName] ) ) {
$userName = 
$this->usernameConversion[$userName];
@@ -39,8 +40,9 @@
$repoUrl = str_replace( 'USERNAME', $userName, 
$repoUrl );
 
$command = $this->bindir . "/clupdate-git-repo 
'$repoUrl' '$base/$name' '$branch'";
-   } elseif ( $repo['type'] === 'wmgerrit' ) {
-   $branch = isset( $repo['branch'] ) ? 
$repo['branch'] : 'master';
+   } elseif ( $type === 'github' ) {
+   $command = $this->bindir . 
"/clupdate-github-repo '{$repo['url']}' '$base/$name' '$branch'";
+   } els

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Allow BGP between kubernetes workers

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329627 )

Change subject: Allow BGP between kubernetes workers
..

Allow BGP between kubernetes workers

Calico uses BGP (via bird) to advertiste the IP addresses of the
workloads. Allow it between the hosts and also allow BGP sessions from
the core eqiad routers

Change-Id: I6f675fdc2f329102ce2e38721c35153463575229
---
M hieradata/role/common/kubernetes/worker.yaml
M modules/profile/manifests/calico/kubernetes.pp
2 files changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/27/329627/1

diff --git a/hieradata/role/common/kubernetes/worker.yaml 
b/hieradata/role/common/kubernetes/worker.yaml
index 47bcfca..1d8b5d8 100644
--- a/hieradata/role/common/kubernetes/worker.yaml
+++ b/hieradata/role/common/kubernetes/worker.yaml
@@ -19,3 +19,10 @@
 - https://etcd1002.eqiad.wmnet:2379
 - https://etcd1003.eqiad.wmnet:2379
 profile::calico::kubernetes::docker::registry: darmstadtium.eqiad.wmnet
+profile::calico::kubernetes::bgp_peers:
+- kubernetes1001.eqiad.wmnet
+- kubernetes1002.eqiad.wmnet
+- kubernetes1003.eqiad.wmnet
+- kubernetes1004.eqiad.wmnet
+- cr1-eqiad.wikimedia.org
+- cr2-eqiad.wikimedia.org
diff --git a/modules/profile/manifests/calico/kubernetes.pp 
b/modules/profile/manifests/calico/kubernetes.pp
index 0b89733..78abebb 100644
--- a/modules/profile/manifests/calico/kubernetes.pp
+++ b/modules/profile/manifests/calico/kubernetes.pp
@@ -5,6 +5,7 @@
 
 class profile::calico::kubernetes {
 $etcd_endpoints = hiera('profile::calico::kubernetes::etcd_endpoints')
+$bgp_peers = hiera('profile::calico::kubernetes::bgp_peers')
 $calico_version = hiera('profile::calico::kubernetes::calico_version')
 $registry = hiera('profile::calico::kubernetes::docker::registry')
 
@@ -16,4 +17,11 @@
 
 class { '::calico::cni':
 }
+
+$bgp_peers_ferm = join($bgp_peers, ' ')
+ferm::service { 'calico-bird':
+proto  => 'tcp',
+port   => '179', # BGP
+srange => "(@resolve((${bgp_peers_ferm})))",
+}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f675fdc2f329102ce2e38721c35153463575229
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Add Citolytics query prefix

2016-12-29 Thread Mschwarzer (Code Review)
Mschwarzer has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329626 )

Change subject: Add Citolytics query prefix
..

Add Citolytics query prefix

Additional query prefix (citolytics:) allows retrieval of link-based article 
recommendations via Citolytics. Recommendations are stored in a separate 
Elasticsearch index (citolytics_content). New class 
CirrusSearch\Search\CitolyticsResultsType handles transformation to article 
result sets.

The Citolytics project should improve the mobile recommendations.

Issue: T142477
Change-Id: I7525eef60c60ce747d194321c552a3df22d96d8f
---
M autoload.php
A includes/Query/CitolyticsFeature.php
M includes/Query/FullTextQueryStringQueryBuilder.php
M includes/Search/ResultsType.php
M includes/Search/SearchContext.php
M includes/Searcher.php
A tests/unit/Query/CitolyticsFeatureTest.php
7 files changed, 302 insertions(+), 2 deletions(-)


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

diff --git a/autoload.php b/autoload.php
index 33c806c..6d838ad 100644
--- a/autoload.php
+++ b/autoload.php
@@ -186,4 +186,7 @@
'CirrusSearch\\UserTesting' => __DIR__ . '/includes/UserTesting.php',
'CirrusSearch\\Util' => __DIR__ . '/includes/Util.php',
'CirrusSearch\\Version' => __DIR__ . '/includes/Version.php',
+   'CirrusSearch\\Search\\CitolyticsResultsType' => __DIR__ . 
'/includes/Search/ResultsType.php',
+   'CirrusSearch\\Query\\CitolyticsFeature' => __DIR__ . 
'/includes/Query/CitolyticsFeature.php',
+
 ];
diff --git a/includes/Query/CitolyticsFeature.php 
b/includes/Query/CitolyticsFeature.php
new file mode 100644
index 000..f230daa
--- /dev/null
+++ b/includes/Query/CitolyticsFeature.php
@@ -0,0 +1,37 @@
+setExtraIndexBaseName( 
self::CITOLYTICS_INDEX_BASE );
+   $context->setExtraResultsType( new 
CitolyticsResultsType() );
+
+   $query = new \Elastica\Query\Match( 
self::CITOLYTICS_FIELD, $term );
+   $context->setMainQuery( $query );
+
+   return '';
+   }
+
+   return $term;
+   }
+}
\ No newline at end of file
diff --git a/includes/Query/FullTextQueryStringQueryBuilder.php 
b/includes/Query/FullTextQueryStringQueryBuilder.php
index 2374fca..789d667 100644
--- a/includes/Query/FullTextQueryStringQueryBuilder.php
+++ b/includes/Query/FullTextQueryStringQueryBuilder.php
@@ -53,6 +53,11 @@
$term = $feature->apply( $searchContext, $term );
}
 
+   // Skip if query was already set by a feature
+   if ( !$searchContext->getQuery() instanceof 
\Elastica\Query\MatchAll ) {
+   return;
+   }
+
if ( !$searchContext->areResultsPossible() ) {
return;
}
diff --git a/includes/Search/ResultsType.php b/includes/Search/ResultsType.php
index 38780a3..33aff08 100644
--- a/includes/Search/ResultsType.php
+++ b/includes/Search/ResultsType.php
@@ -640,3 +640,70 @@
return new EmptyResultSet();
}
 }
+
+/**
+ * Result type for a Citolytics search.
+ */
+class CitolyticsResultsType implements ResultsType {
+   /**
+* @return false|string|array corresponding to Elasticsearch source 
filtering syntax
+*/
+   public function getSourceFiltering() {
+   return [ 'id', 'title', 'namespace', 'redirect.*', 'timestamp', 
'text_bytes', 'related_content' ];
+   }
+
+   /**
+* @return string
+*/
+   public function getFields() {
+   return array(); // all data is stored in source field.
+   }
+
+   /**
+* @param array $highlightSource
+* @return array|null
+*/
+   public function getHighlightingConfiguration( array $highlightSource ) {
+   return null;
+   }
+
+   /**
+* Citolytics recommendations are stored as array in the 
citolytics_content index. Array elements need to be transformed
+* to regular ES result set to be accessible via CirrusSearch as 
individual search results.
+*
+* @param SearchContext $context
+* @param \Elastica\ResultSet $result
+* @return ResultSet
+*/
+   public function transformElasticsearchResult( SearchContext $context, 
\Elastica\ResultSet $result ) {
+   $docs = $result->getDocuments();
+   $key_value_index = 0; // If multiple-index queries are used
+
+   // Check for empty results
+   if ( count( $docs ) < 1 || !isset( $docs[$key_value_index] ) || 
!isset( $docs[$key_value_index]->getData()['related_content'] ) || count( 
$docs[$key_value_index]->getData()['related_content'] ) < 1 ) {
+   return new EmptyResultSet();
+   }
+
+   $relatedContent = 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: calico/node needs certs bind mounted in namespace

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329622 )

Change subject: calico/node needs certs bind mounted in namespace
..


calico/node needs certs bind mounted in namespace

Use the standard docker mechanism to effectively bind mount a few
directories containing the puppet certs since calico/node needs them

Change-Id: Icaf3106a36b205866d5c0877c2fe4bd974235f4d
---
M modules/calico/templates/initscripts/calico-node.systemd.erb
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/modules/calico/templates/initscripts/calico-node.systemd.erb 
b/modules/calico/templates/initscripts/calico-node.systemd.erb
index 72b6898..dfd5c74 100644
--- a/modules/calico/templates/initscripts/calico-node.systemd.erb
+++ b/modules/calico/templates/initscripts/calico-node.systemd.erb
@@ -30,6 +30,8 @@
   -v /lib/modules:/lib/modules \
   -v /run/docker/plugins:/run/docker/plugins \
   -v /var/run/docker.sock:/var/run/docker.sock \
+  -v /etc/ssl/certs:/etc/ssl/certs \
+  -v /usr/local/share/ca-certificates:/usr/local/share/ca-certificates \
   -v /var/log/calico:/var/log/calico \
   <%= @registry %>/calico/node:<%= @calico_node_version %>
 ExecStop=/usr/bin/docker rm -f calico-node

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icaf3106a36b205866d5c0877c2fe4bd974235f4d
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 
Gerrit-Reviewer: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: calico/node needs certs bind mounted in namespace

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329622 )

Change subject: calico/node needs certs bind mounted in namespace
..

calico/node needs certs bind mounted in namespace

Use the standard docker mechanism to effectively bind mount a few
directories containing the puppet certs since calico/node needs them

Change-Id: Icaf3106a36b205866d5c0877c2fe4bd974235f4d
---
M modules/calico/templates/initscripts/calico-node.systemd.erb
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/22/329622/1

diff --git a/modules/calico/templates/initscripts/calico-node.systemd.erb 
b/modules/calico/templates/initscripts/calico-node.systemd.erb
index 72b6898..dfd5c74 100644
--- a/modules/calico/templates/initscripts/calico-node.systemd.erb
+++ b/modules/calico/templates/initscripts/calico-node.systemd.erb
@@ -30,6 +30,8 @@
   -v /lib/modules:/lib/modules \
   -v /run/docker/plugins:/run/docker/plugins \
   -v /var/run/docker.sock:/var/run/docker.sock \
+  -v /etc/ssl/certs:/etc/ssl/certs \
+  -v /usr/local/share/ca-certificates:/usr/local/share/ca-certificates \
   -v /var/log/calico:/var/log/calico \
   <%= @registry %>/calico/node:<%= @calico_node_version %>
 ExecStop=/usr/bin/docker rm -f calico-node

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icaf3106a36b205866d5c0877c2fe4bd974235f4d
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Update calico/node version

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329621 )

Change subject: Update calico/node version
..


Update calico/node version

For now, test with the upstream calino/node version. We should rebuild
that though and rely on a wmf build

Change-Id: I8fd059a4f085312d72f2d4c83fc56162affde417
---
M modules/calico/manifests/init.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/calico/manifests/init.pp b/modules/calico/manifests/init.pp
index 58509b0..5b30f3a 100644
--- a/modules/calico/manifests/init.pp
+++ b/modules/calico/manifests/init.pp
@@ -33,7 +33,7 @@
 case $calico_version {
 '2.0': {
 $calicoctl_version = '1.0.0-betarc5-1~wmf1'
-$calico_node_version = '1.0.0-beta-rc5'
+$calico_node_version = '1.0.0-5' # NOTE: Fetched from upstream, 
should be rebuilt
 $calico_cni_version = '1.5.1-1~wmf1'
 $cni_version = '0.3.0-1~wmf1'
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8fd059a4f085312d72f2d4c83fc56162affde417
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 
Gerrit-Reviewer: Alexandros Kosiaris 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Update calico/node version

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329621 )

Change subject: Update calico/node version
..

Update calico/node version

For now, test with the upstream calino/node version. We should rebuild
that though and rely on a wmf build

Change-Id: I8fd059a4f085312d72f2d4c83fc56162affde417
---
M modules/calico/manifests/init.pp
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/calico/manifests/init.pp b/modules/calico/manifests/init.pp
index 58509b0..5b30f3a 100644
--- a/modules/calico/manifests/init.pp
+++ b/modules/calico/manifests/init.pp
@@ -33,7 +33,7 @@
 case $calico_version {
 '2.0': {
 $calicoctl_version = '1.0.0-betarc5-1~wmf1'
-$calico_node_version = '1.0.0-beta-rc5'
+$calico_node_version = '1.0.0-5' # NOTE: Fetched from upstream, 
should be rebuilt
 $calico_cni_version = '1.5.1-1~wmf1'
 $cni_version = '0.3.0-1~wmf1'
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8fd059a4f085312d72f2d4c83fc56162affde417
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Make UnitConverterTest compatible with non-BC floating point...

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329490 )

Change subject: Make UnitConverterTest compatible with non-BC floating point 
math
..


Make UnitConverterTest compatible with non-BC floating point math

This code uses the DecimalMath class, which supports both BC and
floating point arithmetics. The class under test does not care. Why
should the test be limited then?

This is the most minimal patch I could think of to make it compatible
with both modes. This patch adds a bit of complexity because I'm using
regular expressions now.

Change-Id: Ie97e2fca2f55b2390d166ed072ced40a15f4ef14
---
M lib/tests/phpunit/Units/UnitConverterTest.php
1 file changed, 3 insertions(+), 13 deletions(-)

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



diff --git a/lib/tests/phpunit/Units/UnitConverterTest.php 
b/lib/tests/phpunit/Units/UnitConverterTest.php
index f3af232..7e61297 100644
--- a/lib/tests/phpunit/Units/UnitConverterTest.php
+++ b/lib/tests/phpunit/Units/UnitConverterTest.php
@@ -17,16 +17,6 @@
  */
 class UnitConverterTest extends PHPUnit_Framework_TestCase {
 
-   public function setUp() {
-   parent::setUp();
-
-   if ( !function_exists( 'bcscale' ) ) {
-   $this->markTestSkipped(
-   'Missing bcmath: This test needs arbitrary 
precision math.'
-   );
-   }
-   }
-
public function getConverterPairs() {
return [
[ 'Q1', '+16', 'http://acme.test/Q2', '+1975.2' ],
@@ -39,7 +29,7 @@
'Q1',

'+16',
'http://acme.test/Q2',
-   
'+19752000.00'
+   '+19752000\d{32}\b'
],
[ 'Q1', '+160', 'http://acme.test/Q2', '+19752' ],
[ 'Q1', '+1600', 'http://acme.test/Q2', '+197520' ],
@@ -70,7 +60,7 @@
$q = new QuantityValue( $decimal, $fromUnit, $decimal, $decimal 
);
$qConverted = $uc->toStandardUnits( $q );
 
-   $this->assertEquals( $toValue, 
$qConverted->getAmount()->getValue(), 'Wrong amount' );
+   $this->assertRegExp( "/^\\$toValue/", 
$qConverted->getAmount()->getValue(), 'Wrong amount' );
$this->assertEquals( $toUnit, $qConverted->getUnit(), 'Wrong 
unit' );
}
 
@@ -80,7 +70,7 @@
$q = new QuantityValue( $decimal, 'http://acme.test/Q123', 
$decimal, $decimal );
$qConverted = $uc->toStandardUnits( $q );
 
-   $this->assertEquals( '+13.70295', 
$qConverted->getAmount()->getValue(), 'Wrong amount' );
+   $this->assertStringStartsWith( '+13.70295', 
$qConverted->getAmount()->getValue(), 'Wrong amount' );
$this->assertEquals( 'http://acme.test/Q345', 
$qConverted->getUnit(), 'Wrong unit' );
 
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie97e2fca2f55b2390d166ed072ced40a15f4ef14
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Daniel Kinzler 
Gerrit-Reviewer: Smalyshev 
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...Wikibase[master]: Remove ApiUsageException related dead code from EntityLoadin...

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/328153 )

Change subject: Remove ApiUsageException related dead code from 
EntityLoadingHelperTest
..


Remove ApiUsageException related dead code from EntityLoadingHelperTest

I hope it's obvious what I do here. I removed as much as I could without
breaking any expections.

The two expected codes are already checked via with().

Bug: T153359
Change-Id: I4c82436a71e47bab4868727832fc99dff3c88a57
---
M repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
1 file changed, 6 insertions(+), 14 deletions(-)

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



diff --git a/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php 
b/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
index 494f30b..6140681 100644
--- a/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
+++ b/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
@@ -98,15 +98,11 @@
->with( $this->isInstanceOf( Exception::class 
), $expectedExceptionCode )
->will( $this->throwException( 
ApiUsageException::newWithMessage(
null,
-   'mockUsageException',
-   $expectedExceptionCode
+   'mockApiUsageException'
) ) );
} else {
-   $mock->expects( $this->any() )
-   ->method( 'dieException' )
-   ->will( $this->returnCallback( function( 
Exception $ex, $code ) {
-   throw 
ApiUsageException::newWithMessage( null, $ex->getMessage(), $code );
-   } ) );
+   $mock->expects( $this->never() )
+   ->method( 'dieException' );
}
 
if ( $expectedErrorCode ) {
@@ -115,15 +111,11 @@
->with( $this->isType( 'string' ), 
$expectedErrorCode )
->will( $this->throwException( 
ApiUsageException::newWithMessage(
null,
-   'mockUsageException',
-   $expectedErrorCode
+   'mockApiUsageException'
) ) );
} else {
-   $mock->expects( $this->any() )
-   ->method( 'dieError' )
-   ->will( $this->returnCallback( function( $msg, 
$code ) {
-   throw 
ApiUsageException::newWithMessage( null, $msg, $code );
-   } ) );
+   $mock->expects( $this->never() )
+   ->method( 'dieError' );
}
 
return $mock;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4c82436a71e47bab4868727832fc99dff3c88a57
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Aleksey Bekh-Ivanov (WMDE) 
Gerrit-Reviewer: Daniel Kinzler 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
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...Wikibase[master]: Inject ApiBase into ItemByTitleHelper for proper error repor...

2016-12-29 Thread Daniel Kinzler (Code Review)
Daniel Kinzler has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/328151 )

Change subject: Inject ApiBase into ItemByTitleHelper for proper error reporting
..


Inject ApiBase into ItemByTitleHelper for proper error reporting

This fixes the TODO added in I7c01e3f.

Bug: T153359
Change-Id: I4ca0613c953fcf28912f7a5658e2aab4a3d51eb8
---
M repo/includes/Api/GetEntities.php
M repo/includes/Api/ItemByTitleHelper.php
M repo/tests/phpunit/includes/Api/ItemByTitleHelperTest.php
3 files changed, 27 insertions(+), 2 deletions(-)

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



diff --git a/repo/includes/Api/GetEntities.php 
b/repo/includes/Api/GetEntities.php
index 02c8891..f9c7cd1 100644
--- a/repo/includes/Api/GetEntities.php
+++ b/repo/includes/Api/GetEntities.php
@@ -193,6 +193,7 @@
$wikibaseRepo = WikibaseRepo::getDefaultInstance();
$siteLinkStore = $wikibaseRepo->getStore()->newSiteLinkStore();
return new ItemByTitleHelper(
+   $this,
$this->resultBuilder,
$siteLinkStore,
$wikibaseRepo->getSiteLookup(),
diff --git a/repo/includes/Api/ItemByTitleHelper.php 
b/repo/includes/Api/ItemByTitleHelper.php
index 7b18296..a18219c 100644
--- a/repo/includes/Api/ItemByTitleHelper.php
+++ b/repo/includes/Api/ItemByTitleHelper.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase\Repo\Api;
 
+use ApiBase;
 use Profiler;
 use Site;
 use SiteLookup;
@@ -20,6 +21,11 @@
  * @author Addshore
  */
 class ItemByTitleHelper {
+
+   /**
+* @var ApiBase
+*/
+   private $apiModule;
 
/**
 * @var ResultBuilder
@@ -42,17 +48,20 @@
private $stringNormalizer;
 
/**
+* @param ApiBase $apiModule
 * @param ResultBuilder $resultBuilder
 * @param SiteLinkLookup $siteLinkLookup
 * @param SiteLookup $siteLookup
 * @param StringNormalizer $stringNormalizer
 */
public function __construct(
+   ApiBase $apiModule,
ResultBuilder $resultBuilder,
SiteLinkLookup $siteLinkLookup,
SiteLookup $siteLookup,
StringNormalizer $stringNormalizer
) {
+   $this->apiModule = $apiModule;
$this->resultBuilder = $resultBuilder;
$this->siteLinkLookup = $siteLinkLookup;
$this->siteLookup = $siteLookup;
@@ -164,8 +173,7 @@
 */
private function throwUsageException( $message, $code ) {
Profiler::instance()->close();
-   // TODO: The API module responsible for the error should be 
passed in here.
-   throw ApiUsageException::newWithMessage( null, $message, $code 
);
+   throw ApiUsageException::newWithMessage( $this->apiModule, 
$message, $code );
}
 
 }
diff --git a/repo/tests/phpunit/includes/Api/ItemByTitleHelperTest.php 
b/repo/tests/phpunit/includes/Api/ItemByTitleHelperTest.php
index 1253fad..7a9da5d 100644
--- a/repo/tests/phpunit/includes/Api/ItemByTitleHelperTest.php
+++ b/repo/tests/phpunit/includes/Api/ItemByTitleHelperTest.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase\Repo\Tests\Api;
 
+use ApiBase;
 use MediaWikiSite;
 use SiteLookup;
 use Title;
@@ -23,6 +24,15 @@
  * @author Addshore
  */
 class ItemByTitleHelperTest extends \PHPUnit_Framework_TestCase {
+
+   /**
+* @return ApiBase
+*/
+   private function getApiBaseMock() {
+   return $this->getMockBuilder( ApiBase::class )
+   ->disableOriginalConstructor()
+   ->getMock();
+   }
 
/**
 * @return SiteLookup
@@ -79,6 +89,7 @@
$expectedEntityId = $expectedEntityId->getSerialization();
 
$itemByTitleHelper = new ItemByTitleHelper(
+   $this->getApiBaseMock(),
$this->getResultBuilderMock(),
$this->getSiteLinkLookupMock( new ItemId( 'Q123' ) ),
$this->getSiteLookupMock(),
@@ -100,6 +111,7 @@
 */
public function testGetEntityIdNormalized() {
$itemByTitleHelper = new ItemByTitleHelper(
+   $this->getApiBaseMock(),
// Two values should be added: The normalization and the 
failure to find an entity
$this->getResultBuilderMock( 1 ),
$this->getSiteLinkLookupMock( null ),
@@ -122,6 +134,7 @@
 */
public function testGetEntityIdsNotFound() {
$itemByTitleHelper = new ItemByTitleHelper(
+   $this->getApiBaseMock(),
// Two result values should be added (for both titles which 
wont be found)
$this->getResultBuilderMock(),

[MediaWiki-commits] [Gerrit] wikidata...gui[master]: Fix indentation (spaces to tabs)

2016-12-29 Thread Lucas Werkmeister (Code Review)
Lucas Werkmeister has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329620 )

Change subject: Fix indentation (spaces to tabs)
..

Fix indentation (spaces to tabs)

Change-Id: I43ac3bb3d16a8fa740fb3c075353e72ff7556a8d
---
M wikibase/queryService/ui/resultBrowser/BubbleChartResultBrowser.js
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/wikibase/queryService/ui/resultBrowser/BubbleChartResultBrowser.js 
b/wikibase/queryService/ui/resultBrowser/BubbleChartResultBrowser.js
index 913590a..d94122d 100644
--- a/wikibase/queryService/ui/resultBrowser/BubbleChartResultBrowser.js
+++ b/wikibase/queryService/ui/resultBrowser/BubbleChartResultBrowser.js
@@ -57,8 +57,8 @@
url = null;
prevRow = row;
 
-if ( row.rgb && self._getFormatter().isColor( row.rgb ) ) {
-item.color = self._getFormatter().getColorForHtml( row.rgb 
);
+   if ( row.rgb && self._getFormatter().isColor( 
row.rgb ) ) {
+   item.color = 
self._getFormatter().getColorForHtml( row.rgb );
}
 
if ( row[labelKey] && row[numberKey] ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I43ac3bb3d16a8fa740fb3c075353e72ff7556a8d
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: [throttle] Rule for maiwiki - December 30th

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329597 )

Change subject: [throttle] Rule for maiwiki - December 30th
..


[throttle] Rule for maiwiki - December 30th

Bug: T154278
Change-Id: I91d2e547cddc5377e309390fab0a06088a2df005
---
M wmf-config/throttle.php
1 file changed, 8 insertions(+), 0 deletions(-)

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



diff --git a/wmf-config/throttle.php b/wmf-config/throttle.php
index abf5a70..2d65c09 100644
--- a/wmf-config/throttle.php
+++ b/wmf-config/throttle.php
@@ -36,6 +36,14 @@
'value' => 50 // 40 expected
 ];
 
+$wmgThrottlingExceptions[] = [ // T154278
+   'from' => '2016-12-30T08:00 +5:45',
+   'to' => '2016-12-30T16:00 +5:45',
+   'IP' => [ '49.244.190.255', '49.244.160.201' ],
+   'dbname' => 'maiwiki',
+   'value' => 30 // 20 expected
+];
+
 ## Add throttling definitions above.
 
 /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I91d2e547cddc5377e309390fab0a06088a2df005
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Urbanecm 
Gerrit-Reviewer: Alexandros Kosiaris 
Gerrit-Reviewer: Florianschmidtwelzow 
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/vagrant[jessie-migration]: Update ::browsertests for Jessie

2016-12-29 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329618 )

Change subject: Update ::browsertests for Jessie
..

Update ::browsertests for Jessie

Debain and Mozilla had a disagreement over licensing and thus was born
the "iceweasel" fork of Firefox.

Bug: T154273
Change-Id: Ie6a11e2e8fb9b5c7070a7c86bd3e49c9c83cca91
---
M puppet/modules/browsertests/manifests/init.pp
1 file changed, 4 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/18/329618/1

diff --git a/puppet/modules/browsertests/manifests/init.pp 
b/puppet/modules/browsertests/manifests/init.pp
index 6d0c6c7..5fae658 100644
--- a/puppet/modules/browsertests/manifests/init.pp
+++ b/puppet/modules/browsertests/manifests/init.pp
@@ -14,8 +14,8 @@
 # === Parameters
 #
 # [*default_browser*]
-#   Default browser used in browser tests. Possible values are 'firefox' or
-#   'phantomjs' (experimental). Default: 'firefox'.
+#   Default browser used in browser tests. Possible values are 'iceweasel' or
+#   'phantomjs' (experimental). Default: 'iceweasel'.
 #
 # [*selenium_user*]
 #   MediaWiki account name used when executing browser tests.
@@ -39,7 +39,7 @@
 #}
 #
 class browsertests(
-$default_browser   = 'firefox',
+$default_browser   = 'iceweasel',
 $selenium_user = 'Selenium_user',
 $selenium_password = 'vagrant',
 $mediawiki_url = 'http://127.0.0.1/wiki/',
@@ -89,7 +89,5 @@
 value => $selenium_password,
 }
 
-package { $default_browser:
-ensure => present,
-}
+require_package($default_browser)
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie6a11e2e8fb9b5c7070a7c86bd3e49c9c83cca91
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: jessie-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[jessie-migration]: Update ::ruby for Jessie

2016-12-29 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329617 )

Change subject: Update ::ruby for Jessie
..

Update ::ruby for Jessie

The default Ruby on a Jessie system is 2.1.5 and there is no ruby2.0
package.

Bug: T154273
Change-Id: I8a278a08c1073a382c9e2e6d274383e7b0103c8c
---
M puppet/modules/browsertests/manifests/bundle.pp
M puppet/modules/mwv/manifests/init.pp
M puppet/modules/ruby/manifests/bundle.pp
D puppet/modules/ruby/manifests/default.pp
M puppet/modules/ruby/manifests/gem.pp
M puppet/modules/ruby/manifests/init.pp
D puppet/modules/ruby/manifests/ruby.pp
7 files changed, 19 insertions(+), 94 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/17/329617/1

diff --git a/puppet/modules/browsertests/manifests/bundle.pp 
b/puppet/modules/browsertests/manifests/bundle.pp
index 6633be1..56647e3 100644
--- a/puppet/modules/browsertests/manifests/bundle.pp
+++ b/puppet/modules/browsertests/manifests/bundle.pp
@@ -15,8 +15,8 @@
 define browsertests::bundle(
 $directory = $title,
 ) {
-include browsertests
-include ruby::default
+include ::browsertests
+include ::ruby
 
 ruby::bundle { $title:
 directory  => $directory,
diff --git a/puppet/modules/mwv/manifests/init.pp 
b/puppet/modules/mwv/manifests/init.pp
index 9cac68f..4285f2a 100644
--- a/puppet/modules/mwv/manifests/init.pp
+++ b/puppet/modules/mwv/manifests/init.pp
@@ -71,7 +71,7 @@
 package { 'python-pip': } -> Package <| provider == pip |>
 
 # Install common development tools
-package { [ 'build-essential', 'python-dev', 'ruby-dev' ]: }
+require_package('build-essential', 'python-dev', 'ruby-dev')
 
 # Remove chef if it is installed in the base image
 # Bug: 67693
diff --git a/puppet/modules/ruby/manifests/bundle.pp 
b/puppet/modules/ruby/manifests/bundle.pp
index a47f52b..2db9405 100644
--- a/puppet/modules/ruby/manifests/bundle.pp
+++ b/puppet/modules/ruby/manifests/bundle.pp
@@ -13,9 +13,6 @@
 # [*missing_ok*]
 #   Don't fail on account of a missing Gemfile.
 #
-# [*ruby*]
-#   Version of Ruby. Default: $ruby::default_version
-#
 # [*user*]
 #   The user to run bundler commands as. Default: 'vagrant'.
 #
@@ -29,12 +26,11 @@
 $directory  = $title,
 $gemfile= undef,
 $missing_ok = false,
-$ruby   = $ruby::default_version,
 $user   = 'vagrant',
 ) {
-include ::ruby
+require ::ruby
 
-$bundle = "ruby${ruby} -- ${ruby::gem_bin_dir}/bundle"
+$bundle = "ruby -- ${ruby::gem_bin_dir}/bundle"
 $bundle_gemfile = $gemfile ? {
 undef   => "${directory}/Gemfile",
 default => $gemfile,
@@ -60,7 +56,6 @@
 timeout => 60 * 20,
 require => [
 File["${directory}/.bundle/config"],
-Ruby::Ruby[$ruby],
 ],
 }
 }
diff --git a/puppet/modules/ruby/manifests/default.pp 
b/puppet/modules/ruby/manifests/default.pp
deleted file mode 100644
index afcef7c..000
--- a/puppet/modules/ruby/manifests/default.pp
+++ /dev/null
@@ -1,10 +0,0 @@
-# == Define: ruby::default
-#
-# Ensures the default version of Ruby (as defined by $ruby::default_version)
-# is installed.
-#
-class ruby::default {
-include ruby
-
-ruby::ruby { $ruby::default_version: }
-}
diff --git a/puppet/modules/ruby/manifests/gem.pp 
b/puppet/modules/ruby/manifests/gem.pp
index 0ab186f..a54558b 100644
--- a/puppet/modules/ruby/manifests/gem.pp
+++ b/puppet/modules/ruby/manifests/gem.pp
@@ -7,10 +7,6 @@
 # [*gem*]
 #   The name of the gem, in case you need to scope the title. Default: $title.
 #
-# [*ruby*]
-#   The version of Ruby for which to install the gem. Default:
-#   $ruby::default_version.
-#
 # [*version*]
 #   A specific version requirement for the gem. Default: '>=0'.
 #
@@ -20,25 +16,18 @@
 #
 #   ruby::gem { 'nokogiri': }
 #
-# Make sure Nokogiri is installed for Ruby 1.9.3.
+# Make sure a version of Nokogiri greater than 1.0 is installed.
 #
-#   ruby::gem { 'nokogiri': ruby => '1.9.3' }
-#
-# Make sure a version of Nokogiri greater than 1.0 is installed for Ruby 1.9.3.
-#
-#   ruby::gem { 'nokogiri': version => '> 1.0', ruby => '1.9.3' }
+#   ruby::gem { 'nokogiri': version => '> 1.0' }
 #
 define ruby::gem(
 $gem = $title,
-$ruby= $ruby::default_version,
 $version = '>=0',
 ) {
-include ::ruby
-
-exec { "gem_install_${gem}_${ruby}_${version}":
-command => "gem${ruby} install ${gem} --version '${version}'",
-unless  => "gem${ruby} list ${gem} --installed --version '${version}'",
+exec { "gem_install_${gem}_${version}":
+command => "gem install ${gem} --version '${version}'",
+unless  => "gem list ${gem} --installed --version '${version}'",
 timeout => 600,
-require => Package["ruby${ruby}"],
+require => Package['ruby'],
 }
 }
diff --git a/puppet/modules/ruby/manifests/init.pp 
b/

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[jessie-migration]: Replace upstart with systemd unit in ::xvfb

2016-12-29 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329619 )

Change subject: Replace upstart with systemd unit in ::xvfb
..

Replace upstart with systemd unit in ::xvfb

Bug: T154273
Change-Id: I087ea936177eeca34df33fe1d25b4ac008c75908
---
M puppet/modules/xvfb/manifests/init.pp
D puppet/modules/xvfb/templates/xvfb.conf.erb
A puppet/modules/xvfb/templates/xvfb.systemd.erb
3 files changed, 28 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/19/329619/1

diff --git a/puppet/modules/xvfb/manifests/init.pp 
b/puppet/modules/xvfb/manifests/init.pp
index 02df16a..1639490 100644
--- a/puppet/modules/xvfb/manifests/init.pp
+++ b/puppet/modules/xvfb/manifests/init.pp
@@ -39,15 +39,24 @@
 system => true,
 }
 
-file { '/etc/init/xvfb.conf':
-content => template('xvfb/xvfb.conf.erb'),
-require => [ Package['xvfb'], User['xvfb'] ],
+file { '/lib/systemd/system/xvfb.service':
+content => template('xvfb/xvfb.systemd.erb'),
+require => [
+Package['xvfb'],
+User['xvfb'],
+],
+notify  => Service['xvfb'],
+}
+exec { 'systemd reload for xvfb':
+refreshonly => true,
+command => '/bin/systemctl daemon-reload',
+subscribe   => File['/lib/systemd/system/xvfb.service'],
+notify  => Service['xvfb'],
 }
 
 service { 'xvfb':
 ensure   => running,
 enable   => true,
-provider => 'upstart',
-require  => File['/etc/init/xvfb.conf'],
+provider => 'systemd',
 }
 }
diff --git a/puppet/modules/xvfb/templates/xvfb.conf.erb 
b/puppet/modules/xvfb/templates/xvfb.conf.erb
deleted file mode 100644
index 9d94c51..000
--- a/puppet/modules/xvfb/templates/xvfb.conf.erb
+++ /dev/null
@@ -1,16 +0,0 @@
-# xvfb - X virtual framebuffer
-#
-# Xvfb or X virtual framebuffer is an X11 server that performs all
-# graphical operations in memory, not showing any screen output.
-#
-description "X virtual framebuffer"
-
-start on (local-filesystems and net-device-up IFACE!=lo)
-
-setuid xvfb
-setgid xvfb
-
-respawn
-respawn limit 10 5
-
-exec Xvfb :<%= @display %> -screen 0 <%= @resolution %> -ac
diff --git a/puppet/modules/xvfb/templates/xvfb.systemd.erb 
b/puppet/modules/xvfb/templates/xvfb.systemd.erb
new file mode 100644
index 000..de61978
--- /dev/null
+++ b/puppet/modules/xvfb/templates/xvfb.systemd.erb
@@ -0,0 +1,14 @@
+[Unit]
+Description="X virtual framebuffer"
+
+[Service]
+Environment=NODE_PATH=<%= @dir %>/node_modules
+User=xvfb
+Group=xvfb
+SyslogIdentifier=xvfb
+ExecStart=/usr/bin/Xvfb :<%= @display %> -screen 0 <%= @resolution %> -ac
+Restart=on-failure
+RestartSec=30
+
+[Install]
+WantedBy=multi-user.target

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I087ea936177eeca34df33fe1d25b4ac008c75908
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: jessie-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseMediaInfo[master]: Remove unused getEntityTermsForLanguageListView mock

2016-12-29 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329616 )

Change subject: Remove unused getEntityTermsForLanguageListView mock
..

Remove unused getEntityTermsForLanguageListView mock

Change-Id: I466bd0c01daa9cb3c281a85d6e87127b7fbace35
---
M tests/phpunit/mediawiki/View/MediaInfoViewTest.php
1 file changed, 0 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseMediaInfo 
refs/changes/16/329616/1

diff --git a/tests/phpunit/mediawiki/View/MediaInfoViewTest.php 
b/tests/phpunit/mediawiki/View/MediaInfoViewTest.php
index 3f59b36..09373a9 100644
--- a/tests/phpunit/mediawiki/View/MediaInfoViewTest.php
+++ b/tests/phpunit/mediawiki/View/MediaInfoViewTest.php
@@ -145,9 +145,6 @@
)
->will( $this->returnValue( 'entityTermsView->getHtml' 
) );
 
-   $entityTermsView->expects( $this->never() )
-   ->method( 'getEntityTermsForLanguageListView' );
-
$statementSectionsView = $this->newStatementSectionsViewMock();
$statementSectionsView->expects( $this->once() )
->method( 'getHtml' )

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Fix assertions and reduce complexity of LexemeViewTest

2016-12-29 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329615 )

Change subject: Fix assertions and reduce complexity of LexemeViewTest
..

Fix assertions and reduce complexity of LexemeViewTest

Two main things are happening here:
* testGetHtml was not asserting anything.
* I'm reducing the complexity of
  provideTestGetHtmlForLexicalCategoryAndLanguage very much. The test
  does have a single (logical) assertion now: Is the rendered headline
  exactly the expected one?

Plus a lot of inlining and removing unused complexity. For example, the
alternative language did not do anything.

Change-Id: I1f567a36cd01992bdaa6ebad941b2ac3dccdab8f
---
M tests/phpunit/mediawiki/View/LexemeViewTest.php
1 file changed, 49 insertions(+), 116 deletions(-)


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

diff --git a/tests/phpunit/mediawiki/View/LexemeViewTest.php 
b/tests/phpunit/mediawiki/View/LexemeViewTest.php
index 5b3f451..ebdc07b 100644
--- a/tests/phpunit/mediawiki/View/LexemeViewTest.php
+++ b/tests/phpunit/mediawiki/View/LexemeViewTest.php
@@ -31,16 +31,26 @@
  *
  * @license GPL-2.0+
  * @author Amir Sarabadani 
+ * @author Thiemo Mättig
  */
 class LexemeViewTest extends PHPUnit_Framework_TestCase {
 
/**
+* @param StatementList|null $expectedStatements
+*
 * @return StatementSectionsView
 */
-   private function newStatementSectionsViewMock() {
-   return $this->getMockBuilder( StatementSectionsView::class )
+   private function newStatementSectionsViewMock( StatementList 
$expectedStatements = null ) {
+   $statementSectionsView = $this->getMockBuilder( 
StatementSectionsView::class )
->disableOriginalConstructor()
->getMock();
+
+   $statementSectionsView->expects( $expectedStatements ? 
$this->once() : $this->never() )
+   ->method( 'getHtml' )
+   ->with( $expectedStatements )
+   ->will( $this->returnValue( 
'statementSectionsView->getHtml' ) );
+
+   return $statementSectionsView;
}
 
/**
@@ -57,7 +67,7 @@
if ( $itemId->getSerialization() === 
'Q1' ) {
return null;
}
-   return new Term( 'en', 'getSerialization() . '>' );
+   return new Term( 'en', 'getSerialization() . '>' );
} )
);
 
@@ -68,9 +78,17 @@
 * @return EntityTermsView
 */
private function newEntityTermsViewMock() {
-   return $this->getMockBuilder( EntityTermsView::class )
+   $entityTermsView = $this->getMockBuilder( 
EntityTermsView::class )
->disableOriginalConstructor()
->getMock();
+
+   $entityTermsView->expects( $this->never() )
+   ->method( 'getHtml' );
+
+   $entityTermsView->expects( $this->never() )
+   ->method( 'getTitleHtml' );
+
+   return $entityTermsView;
}
 
/**
@@ -84,37 +102,22 @@
return $languageDirectionalityLookup;
}
 
-   private function newLexemeView(
-   $contentLanguageCode = 'en',
-   EntityTermsView $entityTermsView = null,
-   StatementSectionsView $statementSectionsView = null
-   ) {
-   $templateFactory = TemplateFactory::getDefaultInstance();
-
-   if ( !$entityTermsView ) {
-   $entityTermsView = $this->newEntityTermsViewMock();
-   }
-
-   if ( !$statementSectionsView ) {
-   $statementSectionsView = 
$this->newStatementSectionsViewMock();
-   }
-
+   private function newLexemeView( StatementList $expectedStatements = 
null ) {
$languageDirectionalityLookup = 
$this->newLanguageDirectionalityLookupMock();
+
$htmlTermRenderer = new FallbackHintHtmlTermRenderer(
$languageDirectionalityLookup,
-   new LanguageNameLookup( $contentLanguageCode )
+   new LanguageNameLookup( 'en' )
);
 
-   $labelDescriptionLookup = $this->newLabelDescriptionLookup();
-
return new LexemeView(
-   $templateFactory,
-   $entityTermsView,
-   $statementSectionsView,
+   TemplateFactory::getDefaultInstance(),
+   $this->newEntityTermsViewMock(),
+   $this->newStatementSectionsViewMock( 
$expect

[MediaWiki-commits] [Gerrit] mediawiki...TemplateSandbox[master]: Introduce eslint and bump dependencies

2016-12-29 Thread Esanders (Code Review)
Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329614 )

Change subject: Introduce eslint and bump dependencies
..

Introduce eslint and bump dependencies

Change-Id: I1e6a8e606892e0bec033f62b59afb98fbb98aa5a
---
A .eslintrc.json
M Gruntfile.js
M modules/ext.TemplateSandbox.js
M package.json
4 files changed, 37 insertions(+), 16 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TemplateSandbox 
refs/changes/14/329614/1

diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 000..d3d79a4
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,10 @@
+{
+   "extends": "wikimedia",
+   "env": {
+   "browser": true,
+   "jquery": true
+   },
+   "globals": {
+   "mw": false
+   }
+}
diff --git a/Gruntfile.js b/Gruntfile.js
index 5a87e7b..ee66dca 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,10 +1,18 @@
-/*jshint node:true */
+/* eslint-env node */
 module.exports = function ( grunt ) {
+   var conf = grunt.file.readJSON( 'extension.json' );
+
grunt.loadNpmTasks( 'grunt-banana-checker' );
+   grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
 
-   var conf = grunt.file.readJSON( 'extension.json' );
grunt.initConfig( {
+   eslint: {
+   all: [
+   '**/*.js',
+   '!node_modules/**'
+   ]
+   },
banana: conf.MessagesDirs,
jsonlint: {
all: [
@@ -14,6 +22,6 @@
}
} );
 
-   grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+   grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
 };
diff --git a/modules/ext.TemplateSandbox.js b/modules/ext.TemplateSandbox.js
index 22f6507..cc61f6e 100644
--- a/modules/ext.TemplateSandbox.js
+++ b/modules/ext.TemplateSandbox.js
@@ -1,11 +1,13 @@
 /** extensions/TemplateSandbox/modules/ext.TemplateSandbox.js **/
-jQuery( function ( $ ) {
-   $( '#wpTemplateSandboxPage' ).keypress( function ( ev ) {
-   // On enter keypress, click the TemplateSandbox preview button
-   if ( ev.which === 13 ) {
-   $( '#wpTemplateSandboxPreview' ).click();
-   return false;
-   }
-   return true;
+( function ( $ ) {
+   $( function () {
+   $( '#wpTemplateSandboxPage' ).keypress( function ( e ) {
+   // On enter keypress, click the TemplateSandbox preview 
button
+   if ( e.which === 13 ) {
+   $( '#wpTemplateSandboxPreview' ).click();
+   return false;
+   }
+   return true;
+   } );
} );
-} );
+}( jQuery ) );
diff --git a/package.json b/package.json
index 72eb4aa..445f9cf 100644
--- a/package.json
+++ b/package.json
@@ -4,9 +4,10 @@
 "test": "grunt test"
   },
   "devDependencies": {
-"grunt": "0.4.5",
-"grunt-cli": "0.1.13",
-"grunt-banana-checker": "0.4.0",
-"grunt-jsonlint": "1.0.7"
+"eslint-config-wikimedia": "0.3.0",
+"grunt": "1.0.1",
+"grunt-banana-checker": "0.5.0",
+"grunt-eslint": "19.0.0",
+"grunt-jsonlint": "1.0.8"
   }
 }

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Fix ETCD_CA_CERT_FILE for calico/node

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329613 )

Change subject: Fix ETCD_CA_CERT_FILE for calico/node
..


Fix ETCD_CA_CERT_FILE for calico/node

It's ETCD_CA_CERT_FILE, not ETCD_CA

Change-Id: I7dbbae0712ad560b6bc7b7b9de28b7ca314a5728
---
M modules/calico/templates/initscripts/calico-node.systemd.erb
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/modules/calico/templates/initscripts/calico-node.systemd.erb 
b/modules/calico/templates/initscripts/calico-node.systemd.erb
index 0c8ebf7..72b6898 100644
--- a/modules/calico/templates/initscripts/calico-node.systemd.erb
+++ b/modules/calico/templates/initscripts/calico-node.systemd.erb
@@ -6,7 +6,7 @@
 [Service]
 User=root
 Environment="ETCD_ENDPOINTS=<%= @etcd_endpoints.join(',') %>"
-Environment="ETCD_CA=/etc/ssl/certs/Puppet_Internal_CA.pem"
+Environment="ETCD_CA_CERT_FILE=/etc/ssl/certs/Puppet_Internal_CA.pem"
 Environment="ETCD_KEY=/etc/calico/ssl/server.key"
 Environment="ETCD_CERT=/etc/calico/ssl/cert.pem"
 PermissionsStartOnly=true
@@ -20,7 +20,7 @@
   -e IP6= \
   -e NO_DEFAULT_POOLS= \
   -e AS= \
-  -e ETCD_CA \
+  -e ETCD_CA_CERT_FILE \
   -e ETCD_KEY \
   -e ETCD_CERT \
   -e ETCD_SCHEME=https \

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7dbbae0712ad560b6bc7b7b9de28b7ca314a5728
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 
Gerrit-Reviewer: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Fix ETCD_CA_CERT_FILE for calico/node

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329613 )

Change subject: Fix ETCD_CA_CERT_FILE for calico/node
..

Fix ETCD_CA_CERT_FILE for calico/node

It's ETCD_CA_CERT_FILE, not ETCD_CA

Change-Id: I7dbbae0712ad560b6bc7b7b9de28b7ca314a5728
---
M modules/calico/templates/initscripts/calico-node.systemd.erb
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/modules/calico/templates/initscripts/calico-node.systemd.erb 
b/modules/calico/templates/initscripts/calico-node.systemd.erb
index 0c8ebf7..72b6898 100644
--- a/modules/calico/templates/initscripts/calico-node.systemd.erb
+++ b/modules/calico/templates/initscripts/calico-node.systemd.erb
@@ -6,7 +6,7 @@
 [Service]
 User=root
 Environment="ETCD_ENDPOINTS=<%= @etcd_endpoints.join(',') %>"
-Environment="ETCD_CA=/etc/ssl/certs/Puppet_Internal_CA.pem"
+Environment="ETCD_CA_CERT_FILE=/etc/ssl/certs/Puppet_Internal_CA.pem"
 Environment="ETCD_KEY=/etc/calico/ssl/server.key"
 Environment="ETCD_CERT=/etc/calico/ssl/cert.pem"
 PermissionsStartOnly=true
@@ -20,7 +20,7 @@
   -e IP6= \
   -e NO_DEFAULT_POOLS= \
   -e AS= \
-  -e ETCD_CA \
+  -e ETCD_CA_CERT_FILE \
   -e ETCD_KEY \
   -e ETCD_CERT \
   -e ETCD_SCHEME=https \

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7dbbae0712ad560b6bc7b7b9de28b7ca314a5728
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Specify the registry as well for calico/node

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329612 )

Change subject: Specify the registry as well for calico/node
..


Specify the registry as well for calico/node

Leaving the registry out is clearly a mistake and docker decides to try
docker.io hub instead

Change-Id: I9abff7f0541a2a9ae468446fd513d929888b7645
---
M modules/calico/templates/initscripts/calico-node.systemd.erb
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/calico/templates/initscripts/calico-node.systemd.erb 
b/modules/calico/templates/initscripts/calico-node.systemd.erb
index e78382b..0c8ebf7 100644
--- a/modules/calico/templates/initscripts/calico-node.systemd.erb
+++ b/modules/calico/templates/initscripts/calico-node.systemd.erb
@@ -31,7 +31,7 @@
   -v /run/docker/plugins:/run/docker/plugins \
   -v /var/run/docker.sock:/var/run/docker.sock \
   -v /var/log/calico:/var/log/calico \
-  calico/node:<%= @calico_node_version %>
+  <%= @registry %>/calico/node:<%= @calico_node_version %>
 ExecStop=/usr/bin/docker rm -f calico-node
 Restart=always
 RestartSec=10

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9abff7f0541a2a9ae468446fd513d929888b7645
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 
Gerrit-Reviewer: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Specify the registry as well for calico/node

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329612 )

Change subject: Specify the registry as well for calico/node
..

Specify the registry as well for calico/node

Leaving the registry out is clearly a mistake and docker decides to try
docker.io hub instead

Change-Id: I9abff7f0541a2a9ae468446fd513d929888b7645
---
M modules/calico/templates/initscripts/calico-node.systemd.erb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/12/329612/1

diff --git a/modules/calico/templates/initscripts/calico-node.systemd.erb 
b/modules/calico/templates/initscripts/calico-node.systemd.erb
index e78382b..0c8ebf7 100644
--- a/modules/calico/templates/initscripts/calico-node.systemd.erb
+++ b/modules/calico/templates/initscripts/calico-node.systemd.erb
@@ -31,7 +31,7 @@
   -v /run/docker/plugins:/run/docker/plugins \
   -v /var/run/docker.sock:/var/run/docker.sock \
   -v /var/log/calico:/var/log/calico \
-  calico/node:<%= @calico_node_version %>
+  <%= @registry %>/calico/node:<%= @calico_node_version %>
 ExecStop=/usr/bin/docker rm -f calico-node
 Restart=always
 RestartSec=10

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9abff7f0541a2a9ae468446fd513d929888b7645
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Bump calico CNI plugin version

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329611 )

Change subject: Bump calico CNI plugin version
..


Bump calico CNI plugin version

We have 1.5.1-1~wmf1 and not 1.5.0-1~wmf1 in our repos

Change-Id: I8a9ac7ee921e3e659ed3e2193b8ab69a33fa9c9f
---
M modules/calico/manifests/init.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/calico/manifests/init.pp b/modules/calico/manifests/init.pp
index db3fad9..58509b0 100644
--- a/modules/calico/manifests/init.pp
+++ b/modules/calico/manifests/init.pp
@@ -34,7 +34,7 @@
 '2.0': {
 $calicoctl_version = '1.0.0-betarc5-1~wmf1'
 $calico_node_version = '1.0.0-beta-rc5'
-$calico_cni_version = '1.5.0-1~wmf1'
+$calico_cni_version = '1.5.1-1~wmf1'
 $cni_version = '0.3.0-1~wmf1'
 }
 default: { fail('Unsupported calico version') }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8a9ac7ee921e3e659ed3e2193b8ab69a33fa9c9f
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 
Gerrit-Reviewer: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Bump calico CNI plugin version

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329611 )

Change subject: Bump calico CNI plugin version
..

Bump calico CNI plugin version

We have 1.5.1-1~wmf1 and not 1.5.0-1~wmf1 in our repos

Change-Id: I8a9ac7ee921e3e659ed3e2193b8ab69a33fa9c9f
---
M modules/calico/manifests/init.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/11/329611/1

diff --git a/modules/calico/manifests/init.pp b/modules/calico/manifests/init.pp
index db3fad9..58509b0 100644
--- a/modules/calico/manifests/init.pp
+++ b/modules/calico/manifests/init.pp
@@ -34,7 +34,7 @@
 '2.0': {
 $calicoctl_version = '1.0.0-betarc5-1~wmf1'
 $calico_node_version = '1.0.0-beta-rc5'
-$calico_cni_version = '1.5.0-1~wmf1'
+$calico_cni_version = '1.5.1-1~wmf1'
 $cni_version = '0.3.0-1~wmf1'
 }
 default: { fail('Unsupported calico version') }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8a9ac7ee921e3e659ed3e2193b8ab69a33fa9c9f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Get conflict results from diff3

2016-12-29 Thread WMDE-Fisch (Code Review)
WMDE-Fisch has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329610 )

Change subject: Get conflict results from diff3
..

Get conflict results from diff3

This patch extends the global wfMerge function to also return the
result of the first merge attempt that detects merge conflicts.

The additional output explicitly names the conflicting lines and
could help when solving edit conflicts.

Bug: T151320
Change-Id: I97acebdc87b31779200c7fde4dd4449cd1ee8ead
---
M includes/GlobalFunctions.php
M tests/phpunit/includes/GlobalFunctions/GlobalTest.php
2 files changed, 28 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/10/329610/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 6549fdd..951a8df 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -2602,9 +2602,10 @@
  * @param string $mine
  * @param string $yours
  * @param string $result
+ * @param string $mergeAttemptResult
  * @return bool
  */
-function wfMerge( $old, $mine, $yours, &$result ) {
+function wfMerge( $old, $mine, $yours, &$result, &$mergeAttemptResult = null ) 
{
global $wgDiff3;
 
# This check may also protect against code injection in
@@ -2640,13 +2641,18 @@
$oldtextName, $yourtextName );
$handle = popen( $cmd, 'r' );
 
-   if ( fgets( $handle, 1024 ) ) {
-   $conflict = true;
-   } else {
-   $conflict = false;
-   }
+   $mergeAttemptResult = '';
+   do {
+   $data = fread( $handle, 8192 );
+   if ( strlen( $data ) == 0 ) {
+   break;
+   }
+   $mergeAttemptResult .= $data;
+   } while ( true );
pclose( $handle );
 
+   $conflict = $mergeAttemptResult !== '';
+
# Merge differences
$cmd = wfEscapeShellArg( $wgDiff3, '-a', '-e', '--merge', $mytextName,
$oldtextName, $yourtextName );
diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php 
b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php
index 1d48d08..6d299d4 100644
--- a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php
+++ b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php
@@ -463,20 +463,24 @@
 * @param string $yours Text submitted by the user
 * @param bool $expectedMergeResult Whether the merge should be a 
success
 * @param string $expectedText Text after merge has been completed
+* @param string $expectedMergeAttemptResult Diff3 output if conflicts 
occur
 *
 * @dataProvider provideMerge()
 * @group medium
 * @covers ::wfMerge
 */
-   public function testMerge( $old, $mine, $yours, $expectedMergeResult, 
$expectedText ) {
+   public function testMerge( $old, $mine, $yours, $expectedMergeResult, 
$expectedText,
+  
$expectedMergeAttemptResult ) {
$this->markTestSkippedIfNoDiff3();
 
$mergedText = null;
-   $isMerged = wfMerge( $old, $mine, $yours, $mergedText );
+   $attemptMergeResult = null;
+   $isMerged = wfMerge( $old, $mine, $yours, $mergedText, 
$mergeAttemptResult );
 
$msg = 'Merge should be a ';
$msg .= $expectedMergeResult ? 'success' : 'failure';
$this->assertEquals( $expectedMergeResult, $isMerged, $msg );
+   $this->assertEquals( $expectedMergeAttemptResult, 
$mergeAttemptResult );
 
if ( $isMerged ) {
// Verify the merged text
@@ -514,6 +518,9 @@
"one one one ONE ONE\n" .
"\n" .
"two two TWO TWO\n", // note: will 
always end in a newline
+
+   // mergeAttemptResult:
+   "",
],
 
// #1: conflict, fail
@@ -536,6 +543,13 @@
 
// result:
null,
+
+   // mergeAttemptResult:
+   "1,3c\n" .
+   "one one one\n" .
+   "\n" .
+   "two two\n" .
+   ".\n",
],
];
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I97acebdc87b31779200c7fde4dd4449cd1ee8ead
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: WMDE-Fisch 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Fix dependency to calico/node for systemd unit

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329608 )

Change subject: Fix dependency to calico/node for systemd unit
..


Fix dependency to calico/node for systemd unit

It's "${registry}/calico/node", not calico-node

Change-Id: Ifdd84c2591256f60cb00bcee2264e8a5a66a4276
---
M modules/calico/manifests/init.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/calico/manifests/init.pp b/modules/calico/manifests/init.pp
index 2206dc9..db3fad9 100644
--- a/modules/calico/manifests/init.pp
+++ b/modules/calico/manifests/init.pp
@@ -52,6 +52,6 @@
 base::service_unit { 'calico-node':
 ensure  => present,
 systemd => true,
-require => Package['calico-node']
+require => Package["${registry}/calico/node"]
 }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifdd84c2591256f60cb00bcee2264e8a5a66a4276
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 
Gerrit-Reviewer: Alexandros Kosiaris 
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...FlaggedRevs[master]: Truncate for whole multibyte characters

2016-12-29 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329609 )

Change subject: Truncate for whole multibyte characters
..

Truncate for whole multibyte characters

Also use strlen() to count a string, not count()

Change-Id: I22fac2be95c99fe7bfc161aa6268c9b72aaedd38
---
M business/RevisionReviewForm.php
M frontend/RejectConfirmationFormUI.php
2 files changed, 5 insertions(+), 2 deletions(-)


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

diff --git a/business/RevisionReviewForm.php b/business/RevisionReviewForm.php
index 2036b09..a902d6b 100644
--- a/business/RevisionReviewForm.php
+++ b/business/RevisionReviewForm.php
@@ -330,10 +330,13 @@
}
$baseRevId = $newRev->isCurrent() ? $oldRev->getId() : 
0;
 
+   # Truncate for whole multibyte characters
+   $comment = $wgContLang->truncate( $this->getComment(), 
255 );
+
# Actually make the edit...
$editStatus = $article->doEditContent(
$new_content,
-   $this->getComment(),
+   $comment,
0,
$baseRevId,
$this->user
diff --git a/frontend/RejectConfirmationFormUI.php 
b/frontend/RejectConfirmationFormUI.php
index 025b144..2429d0b 100755
--- a/frontend/RejectConfirmationFormUI.php
+++ b/frontend/RejectConfirmationFormUI.php
@@ -120,7 +120,7 @@
)->numParams( count( $rejectAuthors ) 
)->inContentLanguage()->text();
// If the message is too big, then fallback to the shorter one
$colonSeparator = wfMessage( 'colon-separator' )->text();
-   $maxLen = 255 - count( $colonSeparator ) - count( $comment );
+   $maxLen = 255 - count( $colonSeparator ) - strlen( $comment );
if ( strlen( $defaultSummary ) > $maxLen ) {
$msg = $newRev->isCurrent()
? 'revreview-reject-summary-cur-short' 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I22fac2be95c99fe7bfc161aa6268c9b72aaedd38
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Fix dependency to calico/node for systemd unit

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329608 )

Change subject: Fix dependency to calico/node for systemd unit
..

Fix dependency to calico/node for systemd unit

It's "${registry}/calico/node", not calico-node

Change-Id: Ifdd84c2591256f60cb00bcee2264e8a5a66a4276
---
M modules/calico/manifests/init.pp
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/calico/manifests/init.pp b/modules/calico/manifests/init.pp
index 2206dc9..db3fad9 100644
--- a/modules/calico/manifests/init.pp
+++ b/modules/calico/manifests/init.pp
@@ -52,6 +52,6 @@
 base::service_unit { 'calico-node':
 ensure  => present,
 systemd => true,
-require => Package['calico-node']
+require => Package["${registry}/calico/node"]
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifdd84c2591256f60cb00bcee2264e8a5a66a4276
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Enable the calico profile on kubernetes::worker

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329606 )

Change subject: Enable the calico profile on kubernetes::worker
..


Enable the calico profile on kubernetes::worker

Add the needed hiera keys and include the profile

Change-Id: Idb39a19afd2cdf3d48263d288307b5a0d9ad0d77
---
M hieradata/role/common/kubernetes/worker.yaml
M modules/k8s/manifests/kubelet.pp
M modules/k8s/templates/kubelet.default.erb
M modules/role/manifests/kubernetes/worker.pp
4 files changed, 16 insertions(+), 0 deletions(-)

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



diff --git a/hieradata/role/common/kubernetes/worker.yaml 
b/hieradata/role/common/kubernetes/worker.yaml
index 4de0f3f..47bcfca 100644
--- a/hieradata/role/common/kubernetes/worker.yaml
+++ b/hieradata/role/common/kubernetes/worker.yaml
@@ -13,3 +13,9 @@
iptables: false
ip-masq: false
 base::monitoring::host::nrpe_check_disk_options: -w 10% -c 5% -l -e -A -i 
/var/lib/docker/containers/* -i /run/docker/netns/* --exclude-type=tracefs
+profile::calico::kubernetes::calico_version: 2.0
+profile::calico::kubernetes::etcd_endpoints:
+- https://etcd1001.eqiad.wmnet:2379
+- https://etcd1002.eqiad.wmnet:2379
+- https://etcd1003.eqiad.wmnet:2379
+profile::calico::kubernetes::docker::registry: darmstadtium.eqiad.wmnet
diff --git a/modules/k8s/manifests/kubelet.pp b/modules/k8s/manifests/kubelet.pp
index 17cab67..2e65df4 100644
--- a/modules/k8s/manifests/kubelet.pp
+++ b/modules/k8s/manifests/kubelet.pp
@@ -8,6 +8,9 @@
 $cluster_domain = 'kube',
 $tls_cert = '/var/lib/kubernetes/ssl/certs/cert.pem',
 $tls_key = '/var/lib/kubernetes/ssl/private_keys/server.key',
+$cni=false,
+$cni_bin_dir='/opt/cni/bin',
+$cni_conf_dir='/etc/cni/net.d',
 ) {
 include ::k8s::infrastructure_config
 
diff --git a/modules/k8s/templates/kubelet.default.erb 
b/modules/k8s/templates/kubelet.default.erb
index fd51938..e2429c9 100644
--- a/modules/k8s/templates/kubelet.default.erb
+++ b/modules/k8s/templates/kubelet.default.erb
@@ -39,5 +39,11 @@
 if @cluster_domain
daemon_args.push("--cluster-domain=#{@cluster_domain}")
 end
+if @cni
+   daemon_args.push("--network-plugin=cni")
+   daemon_args.push("--cni-bin-dir=#{@cni_bin_dir}")
+   daemon_args.push("--cni-conf-dir=#{@cni_conf_dir}")
+end
+
 -%>
 DAEMON_ARGS="<%= daemon_args.join(' ') %>"
diff --git a/modules/role/manifests/kubernetes/worker.pp 
b/modules/role/manifests/kubernetes/worker.pp
index 580bb25..605b22f 100644
--- a/modules/role/manifests/kubernetes/worker.pp
+++ b/modules/role/manifests/kubernetes/worker.pp
@@ -6,4 +6,5 @@
 include ::profile::docker::storage
 include ::profile::docker::engine
 include ::profile::kubernetes::node
+include ::profile::calico::kubernetes
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idb39a19afd2cdf3d48263d288307b5a0d9ad0d77
Gerrit-PatchSet: 6
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 
Gerrit-Reviewer: Alexandros Kosiaris 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: calico: add module/profile to use as kubernetes networking

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/323816 )

Change subject: calico: add module/profile to use as kubernetes networking
..


calico: add module/profile to use as kubernetes networking

Change-Id: If5824a3c1014435aec2f44c1c245bdeb64a048ff
---
A modules/calico/manifests/cni.pp
A modules/calico/manifests/init.pp
A modules/calico/templates/cni.conf.erb
A modules/calico/templates/initscripts/calico-node.systemd.erb
A modules/profile/manifests/calico/kubernetes.pp
5 files changed, 166 insertions(+), 0 deletions(-)

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



diff --git a/modules/calico/manifests/cni.pp b/modules/calico/manifests/cni.pp
new file mode 100644
index 000..dc95510
--- /dev/null
+++ b/modules/calico/manifests/cni.pp
@@ -0,0 +1,32 @@
+# == Class calico::cni
+#
+# Installs and configure the cni plugins for calico.
+
+class calico::cni {
+require ::calico
+
+package { 'cni':
+ensure => $::calico::cni_version,
+}
+
+package { 'calico-cni':
+ensure => $::calico::calico_cni_version,
+}
+
+$etcd_endpoints = $::calico::etcd_endpoints
+
+file { ['/etc/cni', '/etc/cni/net.d']:
+ensure => directory,
+owner  => 'root',
+group  => 'root',
+mode   => '0755',
+}
+
+file { '/etc/cni/net.d/10-calico.conf':
+content => template('calico/cni.conf.erb'),
+owner   => 'root',
+group   => 'root',
+mode=> '0755',
+before  => Package['calico-cni'],
+}
+}
diff --git a/modules/calico/manifests/init.pp b/modules/calico/manifests/init.pp
new file mode 100644
index 000..2206dc9
--- /dev/null
+++ b/modules/calico/manifests/init.pp
@@ -0,0 +1,57 @@
+# == Class calico
+#
+# Installs and runs calico-node and calicoctl
+class calico(
+$etcd_endpoints,
+$registry,
+$calico_version='2.0',
+) {
+requires_os('debian >= jessie')
+
+file { '/etc/calico':
+ensure => directory,
+owner  => 'root',
+group  => 'root',
+mode   => '0755',
+}
+
+base::expose_puppet_certs { '/etc/calico':
+ensure  => present,
+provide_private => false,
+require => File['/etc/calico'],
+}
+
+# Needed for calicoctl
+apt::pin { 'go':
+package  => 'golang-go-linux-amd64 golang-src',
+pin  => 'release a=jessie-backports',
+priority => '1001',
+before   => Package['calicoctl'],
+}
+
+
+case $calico_version {
+'2.0': {
+$calicoctl_version = '1.0.0-betarc5-1~wmf1'
+$calico_node_version = '1.0.0-beta-rc5'
+$calico_cni_version = '1.5.0-1~wmf1'
+$cni_version = '0.3.0-1~wmf1'
+}
+default: { fail('Unsupported calico version') }
+}
+
+package { 'calicoctl':
+ensure => $calicoctl_version,
+}
+
+package { "${registry}/calico/node":
+ensure   => $calico_node_version,
+provider => 'docker',
+}
+
+base::service_unit { 'calico-node':
+ensure  => present,
+systemd => true,
+require => Package['calico-node']
+}
+}
diff --git a/modules/calico/templates/cni.conf.erb 
b/modules/calico/templates/cni.conf.erb
new file mode 100644
index 000..da75240
--- /dev/null
+++ b/modules/calico/templates/cni.conf.erb
@@ -0,0 +1,18 @@
+{
+"name": "calico-k8s-network",
+"type": "calico",
+"etcd_endpoints": "<%= @etcd_endpoints.join(',') %>",
+"etcd_ca_cert_file": "/etc/ssl/certs/Puppet_Internal_CA.pem",
+"etcd_key_file": "/etc/calico/ssl/server.key",
+"etcd_cert_file": "/etc/calico/ssl/cert.pem",
+"log_level": "info",
+"ipam": {
+"type": "calico-ipam"
+},
+"policy": {
+"type": "k8s"
+},
+"kubernetes": {
+"kubeconfig": "/etc/kubernetes/kubeconfig"
+}
+}
diff --git a/modules/calico/templates/initscripts/calico-node.systemd.erb 
b/modules/calico/templates/initscripts/calico-node.systemd.erb
new file mode 100644
index 000..e78382b
--- /dev/null
+++ b/modules/calico/templates/initscripts/calico-node.systemd.erb
@@ -0,0 +1,40 @@
+[Unit]
+Description=calico node
+After=docker.service
+Requires=docker.service
+
+[Service]
+User=root
+Environment="ETCD_ENDPOINTS=<%= @etcd_endpoints.join(',') %>"
+Environment="ETCD_CA=/etc/ssl/certs/Puppet_Internal_CA.pem"
+Environment="ETCD_KEY=/etc/calico/ssl/server.key"
+Environment="ETCD_CERT=/etc/calico/ssl/cert.pem"
+PermissionsStartOnly=true
+ExecStart=/usr/bin/docker run \
+  --net=host \
+  --privileged \
+  --name=calico-node \
+  -e ETCD_ENDPOINTS \
+  -e HOSTNAME=<%= @hostname %> \
+  -e IP= \
+  -e IP6= \
+  -e NO_DEFAULT_POOLS= \
+  -e AS= \
+  -e ETCD_CA \
+  -e ETCD_KEY \
+  -e ETCD_CERT \
+  -e ETCD_SCHEME=https \
+  -e CALICO_LIBNETWORK_ENABLED=true \
+  -e CALICO_NETWORKING_BA

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Enable CNI plugin on kubernetes::node profile

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329607 )

Change subject: Enable CNI plugin on kubernetes::node profile
..

Enable CNI plugin on kubernetes::node profile

We want to enable the kubernetes node CNI functionality for our Calico
experiments.

Change-Id: Ia2eefedce81caa5d8534be1f6f35b637aec2f32f
---
M modules/profile/manifests/kubernetes/node.pp
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/modules/profile/manifests/kubernetes/node.pp 
b/modules/profile/manifests/kubernetes/node.pp
index 920271d..9cf0331 100644
--- a/modules/profile/manifests/kubernetes/node.pp
+++ b/modules/profile/manifests/kubernetes/node.pp
@@ -15,6 +15,7 @@
 listen_address=> '0.0.0.0',
 cluster_dns_ip=> '192.168.0.100',
 use_package   => true,
+cni   => true,
 pod_infra_container_image => $infra_pod,
 cluster_domain=> undef,
 tls_cert  => '/etc/kubernetes/ssl/cert.pem',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2eefedce81caa5d8534be1f6f35b637aec2f32f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Enable the calico profile on kubernetes::worker

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329606 )

Change subject: Enable the calico profile on kubernetes::worker
..

Enable the calico profile on kubernetes::worker

Add the needed hiera keys and include the profile

Change-Id: Idb39a19afd2cdf3d48263d288307b5a0d9ad0d77
---
M hieradata/role/common/kubernetes/worker.yaml
M modules/k8s/manifests/kubelet.pp
M modules/k8s/templates/initscripts/kubelet.systemd.erb
M modules/k8s/templates/kubelet.default.erb
M modules/role/manifests/kubernetes/worker.pp
5 files changed, 16 insertions(+), 0 deletions(-)


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

diff --git a/hieradata/role/common/kubernetes/worker.yaml 
b/hieradata/role/common/kubernetes/worker.yaml
index 4de0f3f..7c8746a 100644
--- a/hieradata/role/common/kubernetes/worker.yaml
+++ b/hieradata/role/common/kubernetes/worker.yaml
@@ -13,3 +13,8 @@
iptables: false
ip-masq: false
 base::monitoring::host::nrpe_check_disk_options: -w 10% -c 5% -l -e -A -i 
/var/lib/docker/containers/* -i /run/docker/netns/* --exclude-type=tracefs
+profile::calico::kubernetes::etcd_endpoints:
+- https://etcd1001.eqiad.wmnet:2379
+- https://etcd1002.eqiad.wmnet:2379
+- https://etcd1003.eqiad.wmnet:2379
+profile::calico::kubernetes::docker::registry: darmstadtium.eqiad.wmnet
diff --git a/modules/k8s/manifests/kubelet.pp b/modules/k8s/manifests/kubelet.pp
index 17cab67..2e65df4 100644
--- a/modules/k8s/manifests/kubelet.pp
+++ b/modules/k8s/manifests/kubelet.pp
@@ -8,6 +8,9 @@
 $cluster_domain = 'kube',
 $tls_cert = '/var/lib/kubernetes/ssl/certs/cert.pem',
 $tls_key = '/var/lib/kubernetes/ssl/private_keys/server.key',
+$cni=false,
+$cni_bin_dir='/opt/cni/bin',
+$cni_conf_dir='/etc/cni/net.d',
 ) {
 include ::k8s::infrastructure_config
 
diff --git a/modules/k8s/templates/initscripts/kubelet.systemd.erb 
b/modules/k8s/templates/initscripts/kubelet.systemd.erb
index 311ac80..1d2f665 100644
--- a/modules/k8s/templates/initscripts/kubelet.systemd.erb
+++ b/modules/k8s/templates/initscripts/kubelet.systemd.erb
@@ -8,6 +8,7 @@
 Conflicts=cadvisor.service
 
 [Service]
+<<< HEAD
 WorkingDirectory=/var/lib/kubelet
 # The shared kubernetes configurations file
 EnvironmentFile=-/etc/kubernetes/config
diff --git a/modules/k8s/templates/kubelet.default.erb 
b/modules/k8s/templates/kubelet.default.erb
index fd51938..e2429c9 100644
--- a/modules/k8s/templates/kubelet.default.erb
+++ b/modules/k8s/templates/kubelet.default.erb
@@ -39,5 +39,11 @@
 if @cluster_domain
daemon_args.push("--cluster-domain=#{@cluster_domain}")
 end
+if @cni
+   daemon_args.push("--network-plugin=cni")
+   daemon_args.push("--cni-bin-dir=#{@cni_bin_dir}")
+   daemon_args.push("--cni-conf-dir=#{@cni_conf_dir}")
+end
+
 -%>
 DAEMON_ARGS="<%= daemon_args.join(' ') %>"
diff --git a/modules/role/manifests/kubernetes/worker.pp 
b/modules/role/manifests/kubernetes/worker.pp
index 580bb25..605b22f 100644
--- a/modules/role/manifests/kubernetes/worker.pp
+++ b/modules/role/manifests/kubernetes/worker.pp
@@ -6,4 +6,5 @@
 include ::profile::docker::storage
 include ::profile::docker::engine
 include ::profile::kubernetes::node
+include ::profile::calico::kubernetes
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb39a19afd2cdf3d48263d288307b5a0d9ad0d77
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Remove /* @noflip */ Leaflet's CSS fixes

2016-12-29 Thread Divadsn (Code Review)
Divadsn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329605 )

Change subject: Remove /* @noflip */ Leaflet's CSS fixes
..

Remove /* @noflip */ Leaflet's CSS fixes

Bug: T148695
Change-Id: I398ba8b294423d39b8ee94f4cc7c0b6ea140e461
---
M extension.json
M lib/mapbox-style-fixes.css
2 files changed, 2 insertions(+), 6 deletions(-)


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

diff --git a/extension.json b/extension.json
index 73935eb..5b48886 100644
--- a/extension.json
+++ b/extension.json
@@ -97,7 +97,8 @@
"targets": [
"mobile",
"desktop"
-   ]
+   ],
+   "noflip": true
},
"leaflet.draw": {
"dependencies": [
diff --git a/lib/mapbox-style-fixes.css b/lib/mapbox-style-fixes.css
index 19e3b78..a0af80c 100644
--- a/lib/mapbox-style-fixes.css
+++ b/lib/mapbox-style-fixes.css
@@ -1,8 +1,3 @@
-/**
- * Fix unwanted flipping of styles by CSS Janus (T127137)
- */
-
-/* @noflip */
 body.rtl .leaflet-map-pane,
 body.rtl .leaflet-tile,
 body.rtl .leaflet-marker-icon,

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Update all composer.json version numbers to "~x.x.x"

2016-12-29 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329604 )

Change subject: Update all composer.json version numbers to "~x.x.x"
..

Update all composer.json version numbers to "~x.x.x"

See https://getcomposer.org/doc/articles/versions.md#tilde

"~1.0" and "^1.0.0" both mean all 1.0.x bugfix releases *and* all 1.x.0
feature releases are pulled in automatically. This is a risk, because
every release can contain unexpected breaking changes. But what is the
benefit of pulling in feature releases automatically? The feature is not
used. It will become used with a patch that starts using it. That patch
can easily update the version number to "~1.1.0", when necesarry.

The only problem is when a feature release also contains critical
bugfixes. These bugfixes will not be pulled in automatically. I believe
the additional Gerrit patches we need to do in such cases is worth the
better stability.

Change-Id: I497fe7da8bcce0488d11a9c891a118570139e9b1
---
M composer.json
1 file changed, 9 insertions(+), 9 deletions(-)


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

diff --git a/composer.json b/composer.json
index ff6f467..7984a1b 100644
--- a/composer.json
+++ b/composer.json
@@ -22,26 +22,26 @@
},
"require": {
"php": ">=5.5.0",
-   "data-values/data-values": "~1.0",
+   "data-values/data-values": "~1.0.0",
"data-values/common": "~0.3.0",
-   "data-values/geo": "~1.0",
+   "data-values/geo": "~1.0.0",
"data-values/interfaces": "~0.2.0|~0.1.5",
"data-values/number": "~0.8.2",
"data-values/time": "~0.8.4",
"data-values/validators": "~0.1.0",
"data-values/data-types": "~0.5.0",
-   "data-values/serialization": "~1.1",
+   "data-values/serialization": "~1.1.0",
"data-values/javascript": "~0.8.3",
"data-values/value-view": "~0.18.0",
-   "wikibase/data-model": "^6.3.1",
-   "wikibase/data-model-serialization": "~2.2",
-   "wikibase/internal-serialization": "~2.3",
-   "wikibase/data-model-services": "~3.7",
+   "wikibase/data-model": "~6.3.1",
+   "wikibase/data-model-serialization": "~2.2.0",
+   "wikibase/internal-serialization": "~2.3.0",
+   "wikibase/data-model-services": "~3.7.0",
"wikibase/data-model-javascript": "~3.0.0",
"wikibase/javascript-api": "~2.2.0",
"wikibase/serialization-javascript": "~2.0.6",
-   "diff/diff": "~2.0",
-   "wikimedia/purtle": "~1.0"
+   "diff/diff": "~2.0.0",
+   "wikimedia/purtle": "~1.0.0"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Add README.md from the abandoned WikibaseBrowserTests reposi...

2016-12-29 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329603 )

Change subject: Add README.md from the abandoned WikibaseBrowserTests repository
..

Add README.md from the abandoned WikibaseBrowserTests repository

Change-Id: I092efe05cdfddfc195b62ce9e7fb79aeb64fd05b
---
A tests/browser/README.md
1 file changed, 42 insertions(+), 0 deletions(-)


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

diff --git a/tests/browser/README.md b/tests/browser/README.md
new file mode 100644
index 000..eb3a70a
--- /dev/null
+++ b/tests/browser/README.md
@@ -0,0 +1,42 @@
+Wikidata Browser Tests
+==
+
+This directory contains the browser tests for
+[Wikidata](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/Wikidata).
+
+## Executing tests
+
+Update/install gems:
+```shell
+bundle install
+```
+
+Switch to the `tests/browser/` directory to run all tests:
+```shell
+bundle exec cucumber
+```
+
+Run a specific feature:
+```shell
+bundle exec cucumber features/label.feature
+```
+
+Run a specific scenario:
+```shell
+bundle exec cucumber features/label.feature:17
+```
+
+Run only tests with a specific tag:
+```shell
+bundle exec cucumber --tag @ui_only
+```
+
+Run only tests that are supposed to be executed locally:
+```shell
+bundle exec cucumber --tag @local_config
+```
+
+## Configuration and setup
+
+For setup and configuration please see
+[Browser Testing for 
Wikidata](https://www.mediawiki.org/wiki/Wikibase/Programmer%27s_guide_to_Wikibase#Browser_Testing_for_Wikidata).

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...UniversalLanguageSelector[master]: Update jquery.uls from upstream

2016-12-29 Thread Amire80 (Code Review)
Amire80 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329602 )

Change subject: Update jquery.uls from upstream
..

Update jquery.uls from upstream

* Add localization for Fiji Hindi hif-latn.

Updating to
https://github.com/wikimedia/jquery.uls/commit/253fc61a9908a3b3f453545a108c8447074292fb

Change-Id: I7def3dcac478bb39d320145201c71c9daf3057b8
---
A lib/jquery.uls/i18n/hif-latn.json
1 file changed, 21 insertions(+), 0 deletions(-)


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

diff --git a/lib/jquery.uls/i18n/hif-latn.json 
b/lib/jquery.uls/i18n/hif-latn.json
new file mode 100644
index 000..908e6f7
--- /dev/null
+++ b/lib/jquery.uls/i18n/hif-latn.json
@@ -0,0 +1,21 @@
+{
+   "@metadata": {
+   "authors": [
+   "Girmitya"
+   ]
+   },
+   "uls-region-WW": "Duniya bhar",
+   "uls-region-SP": "Khaas",
+   "uls-region-AM": "America",
+   "uls-region-AF": "Africa",
+   "uls-region-EU": "Europe",
+   "uls-region-AS": "Asia",
+   "uls-region-ME": "Middle East",
+   "uls-region-PA": "Pacific",
+   "uls-region-all": "Sab bhaasa",
+   "uls-no-results-found": "Koi result nai milaa",
+   "uls-common-languages": "Suggested bhaasa",
+   "uls-no-results-suggestion-title": "Aap saait interested interested 
rahegaa:",
+   "uls-search-help": "Aap khoje saktaa hae bhaasa ke naam, script ke 
name, bhaasa ke ISO code, nai to, aap region se browse kare saktaa hai.",
+   "uls-search-placeholder": "Bhasa ke khojo"
+}

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Set $wgAbuseFilterNotificationsPrivate = true; for Meta-Wiki

2016-12-29 Thread MarcoAurelio (Code Review)
MarcoAurelio has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329600 )

Change subject: Set $wgAbuseFilterNotificationsPrivate = true; for Meta-Wiki
..

Set $wgAbuseFilterNotificationsPrivate = true; for Meta-Wiki

Will amend commit later.

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


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

diff --git a/wmf-config/abusefilter.php b/wmf-config/abusefilter.php
index 3c8e435..c971570 100644
--- a/wmf-config/abusefilter.php
+++ b/wmf-config/abusefilter.php
@@ -294,6 +294,7 @@
$wgAbuseFilterActions['block'] = true; // T54681
$wgAbuseFilterAnonBlockDuration = '31 hours'; // T76270
$wgAbuseFilterProfile = true; // T149901
+   $wgAbuseFilterNotificationsPrivate = true; // TBD
break;
case 'mrwiki':
$wgGroupPermissions['autoconfirmed']['abusefilter-log-detail'] 
= true; // T42611

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Drop unused paramaters from wikibase-sitelinkview template

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/196204 )

Change subject: Drop unused paramaters from wikibase-sitelinkview template
..


Drop unused paramaters from wikibase-sitelinkview template

The TODO is not relevant any more because the inner element does have
both lang="..." and dir="auto" attributes now. The browser calculates
the direction based on the language, which is fine and exactly what
should happen in that no-JS fallback.

Change-Id: I28f6db1a6065d9b8b147317a55e1cb1d950f4ea4
---
M view/resources/jquery/wikibase/jquery.wikibase.sitelinkview.js
M view/resources/templates.php
M view/src/SiteLinksView.php
M view/tests/phpunit/SiteLinksViewTest.php
4 files changed, 3 insertions(+), 10 deletions(-)

Approvals:
  WMDE-leszek: Looks good to me, approved
  Aleksey Bekh-Ivanov (WMDE): Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/view/resources/jquery/wikibase/jquery.wikibase.sitelinkview.js 
b/view/resources/jquery/wikibase/jquery.wikibase.sitelinkview.js
index 4a56e47..c3d2198 100644
--- a/view/resources/jquery/wikibase/jquery.wikibase.sitelinkview.js
+++ b/view/resources/jquery/wikibase/jquery.wikibase.sitelinkview.js
@@ -43,8 +43,6 @@
var site = this._getSite();
return site ? site.getId() : 'new';
},
-   '', // FIXME: Unused, drop.
-   '', // FIXME: Unused, drop.
function() {
var site = this._getSite();
return site ? site.getId() : '';
diff --git a/view/resources/templates.php b/view/resources/templates.php
index fc2da45..b0e5b86 100644
--- a/view/resources/templates.php
+++ b/view/resources/templates.php
@@ -251,8 +251,8 @@
 <<

-   $4
-   $6
+   $2
+   $4
 
 HTML;
 
diff --git a/view/src/SiteLinksView.php b/view/src/SiteLinksView.php
index 01d9924..29b10d4 100644
--- a/view/src/SiteLinksView.php
+++ b/view/src/SiteLinksView.php
@@ -307,13 +307,8 @@
$siteName = $this->languageNameLookup->getName( 
$languageCode );
}
 
-   // TODO: for non-JS, also set the dir attribute on the link 
cell;
-   // but do not build language objects for each site since it 
causes too much load
-   // and will fail when having too much site links
return $this->templateFactory->render( 'wikibase-sitelinkview',
htmlspecialchars( $siteId ), // ID used in classes
-   '', // FIXME: Unused, drop.
-   '', // FIXME: Unused, drop.
htmlspecialchars( $siteId ), // displayed site ID
htmlspecialchars( $siteName ),
$this->getHtmlForPage( $siteLink, $site )
diff --git a/view/tests/phpunit/SiteLinksViewTest.php 
b/view/tests/phpunit/SiteLinksViewTest.php
index e4d63a6..e10479f 100644
--- a/view/tests/phpunit/SiteLinksViewTest.php
+++ b/view/tests/phpunit/SiteLinksViewTest.php
@@ -132,7 +132,7 @@
'wikibase-listview' => '$1',
'wikibase-sitelinkgroupview' => '$2$3$6$4',
'wikibase-sitelinklistview' => '$1',
-   'wikibase-sitelinkview' => '$4: $6',
+   'wikibase-sitelinkview' => '$2: $4',
'wikibase-sitelinkview-pagename' => '$2$3',
'wikibase-badgeselector' => '$1',
'wb-badge' => '$2',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I28f6db1a6065d9b8b147317a55e1cb1d950f4ea4
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Adrian Heine 
Gerrit-Reviewer: Aleksey Bekh-Ivanov (WMDE) 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Ebrahim 
Gerrit-Reviewer: Henning Snater 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: WMDE-leszek 
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...Wikibase[master]: Move lang attribute from wikibase-sitelinkview to wikibase-s...

2016-12-29 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/196203 )

Change subject: Move lang attribute from wikibase-sitelinkview to 
wikibase-sitelinkview-pagename
..


Move lang attribute from wikibase-sitelinkview to wikibase-sitelinkview-pagename

The outer wikibase-sitelinkview container contains the page name and the badges.
The page name is always in it's own language, but the whitespace around and the
badges are in the interface language. Currently the order of page name and 
badges
switches in RTL languages.

Change-Id: Ic54101a6adb10ee1a9cde41e7d9409e8efb4e973
---
M phpcs.xml
M view/resources/jquery/wikibase/jquery.wikibase.sitelinkview.js
M view/resources/templates.php
M view/src/SiteLinksView.php
M view/tests/phpunit/SiteLinksViewTest.php
5 files changed, 10 insertions(+), 15 deletions(-)

Approvals:
  WMDE-leszek: Looks good to me, approved
  Aleksey Bekh-Ivanov (WMDE): Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/phpcs.xml b/phpcs.xml
index 5ffc2cc..dc9ff48 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -22,6 +22,7 @@


\.i18n\.magic\.php
+   view.resources.templates\.php



diff --git a/view/resources/jquery/wikibase/jquery.wikibase.sitelinkview.js 
b/view/resources/jquery/wikibase/jquery.wikibase.sitelinkview.js
index e739c3a..4a56e47 100644
--- a/view/resources/jquery/wikibase/jquery.wikibase.sitelinkview.js
+++ b/view/resources/jquery/wikibase/jquery.wikibase.sitelinkview.js
@@ -43,14 +43,8 @@
var site = this._getSite();
return site ? site.getId() : 'new';
},
-   function() {
-   var site = this._getSite();
-   return site ? site.getLanguageCode() : '';
-   },
-   function() {
-   var site = this._getSite();
-   return site ? site.getLanguageDirection() : '';
-   },
+   '', // FIXME: Unused, drop.
+   '', // FIXME: Unused, drop.
function() {
var site = this._getSite();
return site ? site.getId() : '';
diff --git a/view/resources/templates.php b/view/resources/templates.php
index 2b1fd34..fc2da45 100644
--- a/view/resources/templates.php
+++ b/view/resources/templates.php
@@ -252,13 +252,13 @@
 

$4
-   $6
+   $6
 
 HTML;
 
$templates['wikibase-sitelinkview-pagename'] =
 <<$2$3
+$2$3
 HTML;
 
$templates['wikibase-sitelinkview-unknown'] =
diff --git a/view/src/SiteLinksView.php b/view/src/SiteLinksView.php
index 33cd322..01d9924 100644
--- a/view/src/SiteLinksView.php
+++ b/view/src/SiteLinksView.php
@@ -312,8 +312,8 @@
// and will fail when having too much site links
return $this->templateFactory->render( 'wikibase-sitelinkview',
htmlspecialchars( $siteId ), // ID used in classes
-   $languageCode,
-   'auto',
+   '', // FIXME: Unused, drop.
+   '', // FIXME: Unused, drop.
htmlspecialchars( $siteId ), // displayed site ID
htmlspecialchars( $siteName ),
$this->getHtmlForPage( $siteLink, $site )
diff --git a/view/tests/phpunit/SiteLinksViewTest.php 
b/view/tests/phpunit/SiteLinksViewTest.php
index 20351e1..e4d63a6 100644
--- a/view/tests/phpunit/SiteLinksViewTest.php
+++ b/view/tests/phpunit/SiteLinksViewTest.php
@@ -64,7 +64,7 @@
. ''
. '(wikibase-sitelinks-wikipedia)'
. '(parentheses: (wikibase-sitelinks-counter: 1, 0, , 
))'
-   . ''
+   . ''
. 'enwiki: Title'
. ''
. '',
@@ -83,7 +83,7 @@
. ''
. '(wikibase-sitelinks-special)'
. '(parentheses: (wikibase-sitelinks-counter: 1, 0, , 
))'
-   . ''
+   . ''
. 'specialwiki: Title'
. ''
. '',
@@ -132,7 +132,7 @@
'wikibase-listview' => '$1',
'wikibase-sitelinkgroupview' => '$2$3$6$4',
'wikibase-sitelinklistview' => '$1',
-   'wikibase-sitelinkview' => '$4: $6',
+   'wikibase-sitelinkview' => '$4: $6',
'wikibase-sitelinkview-pagename' => '$2$3',
'wikibase-badg

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[jessie-migration]: Zotero: Migrate to SystemD

2016-12-29 Thread Mobrovac (Code Review)
Mobrovac has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329599 )

Change subject: Zotero: Migrate to SystemD
..

Zotero: Migrate to SystemD

Bug: T154274
Change-Id: I5bdc8f5c424412f49782897a4bbc084ef50964fc
---
M puppet/modules/zotero/manifests/init.pp
A puppet/modules/zotero/templates/systemd.service.erb
D puppet/modules/zotero/templates/upstart.conf.erb
3 files changed, 28 insertions(+), 39 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/99/329599/1

diff --git a/puppet/modules/zotero/manifests/init.pp 
b/puppet/modules/zotero/manifests/init.pp
index 139fd84..0fc2487 100644
--- a/puppet/modules/zotero/manifests/init.pp
+++ b/puppet/modules/zotero/manifests/init.pp
@@ -58,12 +58,12 @@
 group  => $::share_group,
 }
 
-file { '/etc/init/zotero.conf':
+file { '/lib/systemd/system/zotero.service':
 ensure  => present,
 owner   => 'root',
 group   => 'root',
 mode=> '0444',
-content => template('zotero/upstart.conf.erb'),
+content => template('zotero/systemd.service.erb'),
 notify  => Service['zotero'],
 }
 
@@ -84,7 +84,8 @@
 enable => true,
 hasstatus  => true,
 hasrestart => true,
-provider   => 'upstart',
-subscribe  => File['/etc/init/zotero.conf'],
+provider   => 'systemd',
+require=> File['/lib/systemd/system/zotero.service'],
+subscribe  => File['/lib/systemd/system/zotero.service'],
 }
 }
diff --git a/puppet/modules/zotero/templates/systemd.service.erb 
b/puppet/modules/zotero/templates/systemd.service.erb
new file mode 100644
index 000..d4f0ecb
--- /dev/null
+++ b/puppet/modules/zotero/templates/systemd.service.erb
@@ -0,0 +1,23 @@
+# NOTE: This file is managed by Puppet
+# Systemd unit for Zotero
+[Unit]
+Description="Zotero service"
+After=network.target
+
+[Service]
+# up ulimit -n a bit
+LimitNOFILE=1
+User=www-data
+Group=www-data
+Environment="LD_LIBRARY_PATH=/usr/lib/xulrunner-24.0/"
+Restart=always
+RestartSec=2s
+# wait 60 seconds for a graceful restart before killing the master
+TimeoutStopSec=60
+# The xulrunner-dev package installs a non-executable
+# /usr/lib/xulrunner-devel-24.0/sdk/bin/xpcshell
+# Work around that by invoking ld-linux-x86-64.so.2 first.
+ExecStart=/lib64/ld-linux-x86-64.so.2 
/usr/lib/xulrunner-devel-24.0/sdk/bin/xpcshell -g /usr/lib/xulrunner-24.0/ -a 
<%= @base_path %>/translation-server -mn -v 180 <%= @base_path 
%>/translation-server/translation-server/init.js >> <%= @log_file %> 2>&1
+
+[Install]
+WantedBy=multi-user.target
diff --git a/puppet/modules/zotero/templates/upstart.conf.erb 
b/puppet/modules/zotero/templates/upstart.conf.erb
deleted file mode 100644
index b92e516..000
--- a/puppet/modules/zotero/templates/upstart.conf.erb
+++ /dev/null
@@ -1,35 +0,0 @@
-# vim: set ft=upstart:
-
-# This file is managed by Puppet
-# Upstart init script for Zotero
-
-description "Zotero HTTP service (dependency of Citoid)"
-
-start on mediawiki-ready
-stop on runlevel [016]
-
-# up ulimit -n a bit
-limit nofile 1 1
-
-setuid "www-data"
-setgid "www-data"
-
-respawn
-respawn limit 5 10
-
-# wait 60 seconds for a graceful restart before killing the master
-kill timeout 60
-
-env LD_LIBRARY_PATH=/usr/lib/xulrunner-24.0/
-
-# The xulrunner-dev package installs a non-executable
-# /usr/lib/xulrunner-devel-24.0/sdk/bin/xpcshell
-# Work around that by invoking ld-linux-x86-64.so.2 first.
-exec /lib64/ld-linux-x86-64.so.2  \
-  /usr/lib/xulrunner-devel-24.0/sdk/bin/xpcshell  \
-  -g /usr/lib/xulrunner-24.0/ \
-  -a <%= @base_path %>/translation-server \
-  -mn \
-  -v 180  \
-  <%= @base_path %>/translation-server/translation-server/init.js \
-  >> <%= @log_file %> 2>&1

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bdc8f5c424412f49782897a4bbc084ef50964fc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: jessie-migration
Gerrit-Owner: Mobrovac 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[jessie-migration]: service::node: Migrate to systemd

2016-12-29 Thread Mobrovac (Code Review)
Mobrovac has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329598 )

Change subject: service::node: Migrate to systemd
..

service::node: Migrate to systemd

Bug: T154267
Change-Id: I869d865269e95d7718bc0025a05ee8fcd6e04efa
---
M puppet/modules/service/manifests/node.pp
A puppet/modules/service/templates/node/systemd.service.erb
D puppet/modules/service/templates/node/upstart.conf.erb
3 files changed, 29 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/98/329598/1

diff --git a/puppet/modules/service/manifests/node.pp 
b/puppet/modules/service/manifests/node.pp
index ee4f814..186e960 100644
--- a/puppet/modules/service/manifests/node.pp
+++ b/puppet/modules/service/manifests/node.pp
@@ -143,9 +143,9 @@
 mode=> '0444',
 }
 
-# the upstart config
-file { "/etc/init/${title}.conf":
-content => template('service/node/upstart.conf.erb'),
+# the systemd config
+file { "/lib/systemd/system/${title}.service":
+content => template('service/node/systemd.service.erb'),
 owner   => 'root',
 group   => 'root',
 mode=> '0444',
@@ -163,12 +163,13 @@
 service { $title:
 ensure=> running,
 enable=> true,
-provider  => 'upstart',
+provider  => 'systemd',
 require   => [
 Git::Clone[$title],
+File["/lib/systemd/system/${title}.service"],
 ],
 subscribe => [
-File["/etc/init/${title}.conf", "${title}_config_yaml"],
+File["${title}_config_yaml"],
 Npm::Install[$dir]
 ]
 }
diff --git a/puppet/modules/service/templates/node/systemd.service.erb 
b/puppet/modules/service/templates/node/systemd.service.erb
new file mode 100644
index 000..8ff0986
--- /dev/null
+++ b/puppet/modules/service/templates/node/systemd.service.erb
@@ -0,0 +1,23 @@
+# NOTE: This file is managed by Puppet
+# Systemd unit for <%= @title %>
+[Unit]
+Description="<%= @title %> service"
+After=network.target
+
+[Service]
+# up ulimit -n a bit
+LimitNOFILE=<%= @no_file %>
+User=www-data
+Group=www-data
+Environment="NODE_PATH=<%= @dir %>/node_modules"
+Environment="<%= @title.gsub(/[^a-zA-Z0-9_]/, '_').upcase %>_PORT=<%= @port %>"
+Restart=always
+RestartSec=2s
+# wait 60 seconds for a graceful restart before killing the master
+TimeoutStopSec=60
+WorkingDirectory=<%= @dir %>
+ExecStart=/usr/bin/nodejs <%= @script %> -c <%= @dir %>/config.vagrant.yaml
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/puppet/modules/service/templates/node/upstart.conf.erb 
b/puppet/modules/service/templates/node/upstart.conf.erb
deleted file mode 100644
index 15f316f..000
--- a/puppet/modules/service/templates/node/upstart.conf.erb
+++ /dev/null
@@ -1,19 +0,0 @@
-# This file is managed by Puppet
-# Upstart init script for <%= @title %>
-
-description "<%= @title %> service"
-
-start on mediawiki-ready
-stop on runlevel [016]
-
-setuid "www-data"
-setgid "www-data"
-
-env <%= @title.gsub(/[^a-zA-Z0-9_]/, '_').upcase %>_PORT="<%= @port %>"
-env NODE_PATH="<%= @dir %>/node_modules"
-
-chdir "<%= @dir %>"
-exec /usr/bin/nodejs <%= @script %> -c <%= @dir %>/config.vagrant.yaml
-
-respawn
-

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I869d865269e95d7718bc0025a05ee8fcd6e04efa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: jessie-migration
Gerrit-Owner: Mobrovac 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: [throttle] Rule for maiwiki - December 30th

2016-12-29 Thread Urbanecm (Code Review)
Urbanecm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329597 )

Change subject: [throttle] Rule for maiwiki - December 30th
..

[throttle] Rule for maiwiki - December 30th

Bug: T154278
Change-Id: I91d2e547cddc5377e309390fab0a06088a2df005
---
M wmf-config/throttle.php
1 file changed, 8 insertions(+), 0 deletions(-)


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

diff --git a/wmf-config/throttle.php b/wmf-config/throttle.php
index abf5a70..2d65c09 100644
--- a/wmf-config/throttle.php
+++ b/wmf-config/throttle.php
@@ -36,6 +36,14 @@
'value' => 50 // 40 expected
 ];
 
+$wmgThrottlingExceptions[] = [ // T154278
+   'from' => '2016-12-30T08:00 +5:45',
+   'to' => '2016-12-30T16:00 +5:45',
+   'IP' => [ '49.244.190.255', '49.244.160.201' ],
+   'dbname' => 'maiwiki',
+   'value' => 30 // 20 expected
+];
+
 ## Add throttling definitions above.
 
 /**

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Update composer.json to use DataTypes 1.0.0

2016-12-29 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329596 )

Change subject: Update composer.json to use DataTypes 1.0.0
..

Update composer.json to use DataTypes 1.0.0

This requires a 1.0.0 release of the DataTypes component, including
these two patches:
https://github.com/wmde/DataTypes/pull/63
https://github.com/wmde/DataTypes/pull/62

Change-Id: Id95bdc6f12014f6b50c103debb3257b6907008e6
---
M composer.json
M repo/includes/DataTypeSelector.php
M view/src/PropertyView.php
3 files changed, 5 insertions(+), 6 deletions(-)


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

diff --git a/composer.json b/composer.json
index ff6f467..ac18ca5 100644
--- a/composer.json
+++ b/composer.json
@@ -29,7 +29,7 @@
"data-values/number": "~0.8.2",
"data-values/time": "~0.8.4",
"data-values/validators": "~0.1.0",
-   "data-values/data-types": "~0.5.0",
+   "data-values/data-types": "~1.0",
"data-values/serialization": "~1.1",
"data-values/javascript": "~0.8.3",
"data-values/value-view": "~0.18.0",
diff --git a/repo/includes/DataTypeSelector.php 
b/repo/includes/DataTypeSelector.php
index 920f646..1028346 100644
--- a/repo/includes/DataTypeSelector.php
+++ b/repo/includes/DataTypeSelector.php
@@ -61,7 +61,8 @@
$byId = [];
 
foreach ( $this->dataTypes as $dataType ) {
-   $label = $dataType->getLabel( $this->languageCode );
+   $label = wfMessage( $dataType->getMessageKey() 
)->inLanguage( $this->languageCode )
+   ->text();
$id = $dataType->getId();
 
$byLabel[$label] = $id;
diff --git a/view/src/PropertyView.php b/view/src/PropertyView.php
index 3802453..6a83c75 100644
--- a/view/src/PropertyView.php
+++ b/view/src/PropertyView.php
@@ -99,19 +99,17 @@
 * @return string HTML
 */
private function getHtmlForDataType( $propertyType ) {
-
$html = $this->templateFactory->render( 'wb-section-heading',
htmlspecialchars( $this->textProvider->get( 
'wikibase-propertypage-datatype' ) ),
'datatype',
'wikibase-propertypage-datatype'
);
 
-   $dataTypeLabelHtml = '';
try {
$dataType = $this->dataTypeFactory->getType( 
$propertyType );
-   $dataTypeLabelHtml = htmlspecialchars( 
$dataType->getLabel( $this->languageCode ) );
+   $dataTypeLabelHtml = htmlspecialchars( 
$this->textProvider->get( $dataType->getMessageKey() ) );
} catch ( OutOfBoundsException $ex ) {
-   $dataTypeLabelHtml .= '' .
+   $dataTypeLabelHtml = '' .
htmlspecialchars( $this->textProvider->get( 
'wikibase-propertypage-bad-datatype', [ $propertyType ] ) ) .
'';
}

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: puppetmaster: Specify $group for all repositories

2016-12-29 Thread Tim Landscheidt (Code Review)
Hello Yuvipanda,

I'd like you to do a code review.  Please visit

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

to review the following change.


Change subject: puppetmaster: Specify $group for all repositories
..

puppetmaster: Specify $group for all repositories

Bug: T152060
Change-Id: I3466a4225980f1f13225551a13f3fc09c5fc2327
---
M modules/puppetmaster/manifests/gitclone.pp
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/95/329595/1

diff --git a/modules/puppetmaster/manifests/gitclone.pp 
b/modules/puppetmaster/manifests/gitclone.pp
index 8c414ee..4b900a2 100644
--- a/modules/puppetmaster/manifests/gitclone.pp
+++ b/modules/puppetmaster/manifests/gitclone.pp
@@ -218,6 +218,7 @@
 git::clone { 'labs/private':
 require   => File["${puppetmaster::gitdir}/labs"],
 owner => $user,
+group => $group,
 directory => "${puppetmaster::gitdir}/labs/private",
 }
 
@@ -232,6 +233,7 @@
 'operations/software':
 require   => File["${puppetmaster::gitdir}/operations"],
 owner => $user,
+group => $group,
 directory => "${puppetmaster::gitdir}/operations/software",
 origin=> 
'https://gerrit.wikimedia.org/r/p/operations/software';
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3466a4225980f1f13225551a13f3fc09c5fc2327
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Tim Landscheidt 
Gerrit-Reviewer: Yuvipanda 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikidata[master]: New Wikidata Build - 2016-12-29T10:00:01+0000

2016-12-29 Thread WikidataBuilder (Code Review)
WikidataBuilder has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329594 )

Change subject: New Wikidata Build - 2016-12-29T10:00:01+
..

New Wikidata Build - 2016-12-29T10:00:01+

Change-Id: I1c62e28dd551d2d4a98332eaae1f3af1480010e1
---
M composer.lock
M extensions/Wikibase/client/i18n/atj.json
M extensions/Wikibase/client/i18n/es.json
M extensions/Wikibase/client/i18n/sty.json
M extensions/Wikibase/client/includes/DispatchingServiceFactory.php
M extensions/Wikibase/client/includes/Hooks/InterwikiSortingHookHandlers.php
M 
extensions/Wikibase/client/includes/Notifications/PageConnectionPresentationModel.php
M 
extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php
M 
extensions/Wikibase/client/tests/phpunit/includes/DispatchingServiceWiringTest.php
M 
extensions/Wikibase/client/tests/phpunit/includes/Hooks/EchoNotificationsHandlersTest.php
M 
extensions/Wikibase/client/tests/phpunit/includes/Store/RepositoryServiceWiringTest.php
M extensions/Wikibase/lib/includes/Store/PropertyInfoLookup.php
M extensions/Wikibase/lib/includes/Store/Sql/SqlEntityInfoBuilder.php
M extensions/Wikibase/lib/tests/phpunit/EntityTypesTest.php
M 
extensions/Wikibase/lib/tests/phpunit/Formatters/CommonsThumbnailFormatterTest.php
M extensions/Wikibase/lib/tests/phpunit/Store/DispatchingTermBufferTest.php
M 
extensions/Wikibase/lib/tests/phpunit/Store/HttpUrlPropertyOrderProviderTest.php
M extensions/Wikibase/lib/tests/phpunit/Store/MockPropertyInfoStoreTest.php
M 
extensions/Wikibase/lib/tests/phpunit/Store/WikiPagePropertyOrderProviderTest.php
M extensions/Wikibase/lib/tests/phpunit/Units/UnitStorageTest.php
M extensions/Wikibase/repo/i18n/lb.json
M extensions/Wikibase/repo/i18n/zh-hans.json
M extensions/Wikibase/repo/includes/Api/RemoveQualifiers.php
M extensions/Wikibase/repo/includes/Api/SetAliases.php
M extensions/Wikibase/repo/includes/Api/SetSiteLink.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpAliases.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpDescription.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpMainSnak.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpQualifier.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpQualifierRemove.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpReference.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpReferenceRemove.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpSiteLink.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpStatementRank.php
M extensions/Wikibase/repo/includes/MediaWikiLanguageDirectionalityLookup.php
M extensions/Wikibase/repo/includes/Parsers/MwTimeIsoParser.php
M extensions/Wikibase/repo/includes/Specials/SpecialNewProperty.php
M extensions/Wikibase/repo/includes/Store/Sql/EntityPerPageTable.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Actions/ViewEntityActionTest.php
M extensions/Wikibase/repo/tests/phpunit/includes/EntityTypesTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Specials/SpecialItemByTitleTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php
M extensions/Wikibase/view/resources/wikibase/view/ViewFactory.js
M vendor/composer/installed.json
44 files changed, 113 insertions(+), 55 deletions(-)


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

diff --git a/composer.lock b/composer.lock
index 90e6a18..7311cb0 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1585,12 +1585,12 @@
 "source": {
 "type": "git",
 "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
-"reference": "aeabf1549b026c49fdd872c1b066bd764357aa5b"
+"reference": "54e002bd93d17b90ae5cb78b868a97a926c55c00"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/aeabf1549b026c49fdd872c1b066bd764357aa5b";,
-"reference": "aeabf1549b026c49fdd872c1b066bd764357aa5b",
+"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/54e002bd93d17b90ae5cb78b868a97a926c55c00";,
+"reference": "54e002bd93d17b90ae5cb78b868a97a926c55c00",
 "shasum": ""
 },
 "require": {
@@ -1663,7 +1663,7 @@
 "wikibaserepo",
 "wikidata"
 ],
-"time": "2016-12-26 21:42:40"
+"time": "2016-12-29 09:25:42"
 },
 {
 "name": "wikibase/wikimedia-badges",
diff --git a/extensions/Wikibase/client/i18n/atj.json 
b/extensions/Wikibase/client/i18n/atj.json
index a7f406d..a40e888 100644
--- a/extensions/Wikibase/client/i18n/atj.json
+++ b/extensions/Wikibase/client/i18n/atj.j

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Move external_networks to network module data.yaml

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/302695 )

Change subject: Move external_networks to network module data.yaml
..


Move external_networks to network module data.yaml

Use the data.yaml file to populate realm independently the
external_networks variable.

Change-Id: I92ca10fd86649ecf5dc6ce1006484bad83882faf
---
M modules/network/data/data.yaml
M modules/network/manifests/constants.pp
2 files changed, 9 insertions(+), 8 deletions(-)

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



diff --git a/modules/network/data/data.yaml b/modules/network/data/data.yaml
index e0681a9..8e2a2c2 100644
--- a/modules/network/data/data.yaml
+++ b/modules/network/data/data.yaml
@@ -1,3 +1,11 @@
+network::external:
+- 91.198.174.0/24
+- 208.80.152.0/22
+- 2620:0:860::/46
+- 198.35.26.0/23
+- 185.15.56.0/22
+- 2a02:ec80::/32
+
 network::subnets:
   production:
 eqiad:
diff --git a/modules/network/manifests/constants.pp 
b/modules/network/manifests/constants.pp
index e4b5847..d82323b 100644
--- a/modules/network/manifests/constants.pp
+++ b/modules/network/manifests/constants.pp
@@ -2,17 +2,10 @@
 # Note this name is misleading.  Most of these are "external" networks,
 # but some subnets of the IPv6 space are not externally routed, even if
 # they're externally route-able (the ones used for private vlans).
-$external_networks = [
-'91.198.174.0/24',
-'208.80.152.0/22',
-'2620:0:860::/46',
-'198.35.26.0/23',
-'185.15.56.0/22',
-'2a02:ec80::/32',
-]
 $module_path = get_module_path($module_name)
 $network_data = loadyaml("${module_path}/data/data.yaml")
 $all_network_subnets = $network_data['network::subnets']
+$external_networks = $network_data['network::external']
 
 # are you really sure you want to use this? maybe what you really
 # the trusted/production networks. See $production_networks for this.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I92ca10fd86649ecf5dc6ce1006484bad83882faf
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 
Gerrit-Reviewer: Alexandros Kosiaris 
Gerrit-Reviewer: Faidon Liambotis 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: builder: Specify the newer docker-engine version

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329593 )

Change subject: builder: Specify the newer docker-engine version
..

builder: Specify the newer docker-engine version

Having bumped everything else in production to 1.12.5, do so as well for
the docker builder

Change-Id: Id2844d433fe75e761116f776564e1a9fbdb125c0
---
M hieradata/role/common/builder.yaml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/93/329593/1

diff --git a/hieradata/role/common/builder.yaml 
b/hieradata/role/common/builder.yaml
index f650342..df7f9e8 100644
--- a/hieradata/role/common/builder.yaml
+++ b/hieradata/role/common/builder.yaml
@@ -2,7 +2,7 @@
   debdeploy-packagebuild:
 value: standard
 docker::registry: darmstadtium.eqiad.wmnet
-profile::docker::engine::version: "1.11.2-0~jessie"
+profile::docker::engine::version: "1.12.5-0~debian-jessie"
 profile::docker::engine::proxy: "http://webproxy.%{::site}.wmnet:8080";
 profile::docker::storage::loopback::source_dir: "/srv/docker-dm"
 profile::docker::builder::proxy_address: "webproxy.%{::site}.wmnet"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2844d433fe75e761116f776564e1a9fbdb125c0
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: builder: Specify the newer docker-engine version

2016-12-29 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329593 )

Change subject: builder: Specify the newer docker-engine version
..


builder: Specify the newer docker-engine version

Having bumped everything else in production to 1.12.5, do so as well for
the docker builder

Change-Id: Id2844d433fe75e761116f776564e1a9fbdb125c0
---
M hieradata/role/common/builder.yaml
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/hieradata/role/common/builder.yaml 
b/hieradata/role/common/builder.yaml
index f650342..df7f9e8 100644
--- a/hieradata/role/common/builder.yaml
+++ b/hieradata/role/common/builder.yaml
@@ -2,7 +2,7 @@
   debdeploy-packagebuild:
 value: standard
 docker::registry: darmstadtium.eqiad.wmnet
-profile::docker::engine::version: "1.11.2-0~jessie"
+profile::docker::engine::version: "1.12.5-0~debian-jessie"
 profile::docker::engine::proxy: "http://webproxy.%{::site}.wmnet:8080";
 profile::docker::storage::loopback::source_dir: "/srv/docker-dm"
 profile::docker::builder::proxy_address: "webproxy.%{::site}.wmnet"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id2844d433fe75e761116f776564e1a9fbdb125c0
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 
Gerrit-Reviewer: Alexandros Kosiaris 

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


  1   2   >