[MediaWiki-commits] [Gerrit] pywikibot/core[master]: textlib.py: Limit catastrophic backtracking in FILE_LINK_REGEX

2016-10-30 Thread Dalba (Code Review)
Dalba has uploaded a new change for review.

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

Change subject: textlib.py: Limit catastrophic backtracking in FILE_LINK_REGEX
..

textlib.py: Limit catastrophic backtracking in FILE_LINK_REGEX

Make use of the fact that wikilinks cannot contain other wikilinks.

This breaks the test that asserts wikilinks can contain other wikilinks.
Remove that test. This should be OK because MediaWiki does not allow such
syntax errors, too, i.e.
`[[File:example.jpg|[[foo]] [[bar [[invalid]] ]].x]]`
won't be rendered as an image by mediawiki.

Bug: T148959
Change-Id: Id300a386a1760cca5717ac907108e8f34d51e222
---
M pywikibot/textlib.py
M tests/textlib_tests.py
2 files changed, 1 insertion(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/84/318884/1

diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index fc7c4b1..b79010d 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -110,7 +110,7 @@
 FILE_LINK_REGEX = r"""
 \[\[\s*(?:%s)\s*:[^|]*?\s*
   (\|
-( \[\[ [^[]*? \[\[ [^]]*? \]\] [^]]*? \]\]  # capture invalid syntax
+( \[\[ [^[]*? \[\[ (?:(?https://gerrit.wikimedia.org/r/318884
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: LABS: Enable tabular remote access to tabular data

2016-10-30 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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

Change subject: LABS: Enable tabular remote access to tabular data
..

LABS: Enable tabular remote access to tabular data

Bug: T148745
Change-Id: I85db0f4a2c4a3306d4d710056864eac4b8efb25f
---
M wmf-config/CommonSettings-labs.php
M wmf-config/InitialiseSettings-labs.php
2 files changed, 14 insertions(+), 2 deletions(-)


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

diff --git a/wmf-config/CommonSettings-labs.php 
b/wmf-config/CommonSettings-labs.php
index 25fe21c..14403a0 100644
--- a/wmf-config/CommonSettings-labs.php
+++ b/wmf-config/CommonSettings-labs.php
@@ -169,7 +169,7 @@
 
 
 // Enable Tabular data namespace on Commons - T148745
-if ( $wgDBname == 'commonswiki' ) {
+if ( $wmgEnableTabularData ) {
// Safety: before extension.json, these values were initialized by 
JsonConfig.php
if ( !isset( $wgJsonConfigModels ) ) {
$wgJsonConfigModels = [];
@@ -184,8 +184,14 @@
'nsName' => 'Data',
// page name must end in ".tab", and contain at least one symbol
'pattern' => '/.\.tab$/',
-   'store' => true,
];
+   if ( $wgDBname == 'commonswiki' ) {
+   $wgJsonConfigs['Tabular.JsonConfig']['store'] = true;
+   } else {
+   $wgJsonConfigs['Tabular.JsonConfig']['remote'] = [
+   'url' => 
'https://commons.wikimedia.beta.wmflabs.org/w/api.php'
+   ];
+   }
 }
 
 
diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 244d3b9..4e3f003 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -573,5 +573,11 @@
'mode' => 'packed', // T141349
],
],
+
+   // Enable Tabular data namespace on Commons - T148745
+   'wmgEnableTabularData' => [
+   'default' => true,
+   ],
+
];
 } # wmflLabsSettings()

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove spaces after cast operators

2016-10-30 Thread Samwilson (Code Review)
Samwilson has uploaded a new change for review.

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

Change subject: Remove spaces after cast operators
..

Remove spaces after cast operators

This fixes the outstanding mis-spaced cast operators to bring them
into line with the coding standards on mediawiki.org (and with the
more common usage within this codebase).

Bug: T149545
Change-Id: Ib7bcf95bbee83d20c05f6d621ce7b4e1fb58a347
---
M includes/api/ApiMain.php
M includes/api/ApiQueryMyStashedFiles.php
M includes/debug/logger/monolog/AvroFormatter.php
M includes/json/FormatJson.php
M includes/specialpage/LoginSignupSpecialPage.php
M includes/utils/UIDGenerator.php
M maintenance/validateRegistrationFile.php
M tests/phpunit/MediaWikiTestCase.php
M tests/phpunit/includes/json/FormatJsonTest.php
M tests/phpunit/includes/utils/BatchRowUpdateTest.php
M tests/phpunit/structure/ExtensionJsonValidationTest.php
11 files changed, 17 insertions(+), 17 deletions(-)


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

diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php
index c8f4460..8deee5c 100644
--- a/includes/api/ApiMain.php
+++ b/includes/api/ApiMain.php
@@ -1475,7 +1475,7 @@
'ip' => $request->getIP(),
'userAgent' => $this->getUserAgent(),
'wiki' => wfWikiID(),
-   'timeSpentBackend' => (int) round( $time * 1000 ),
+   'timeSpentBackend' => (int)round( $time * 1000 ),
'hadError' => $e !== null,
'errorCodes' => [],
'params' => [],
diff --git a/includes/api/ApiQueryMyStashedFiles.php 
b/includes/api/ApiQueryMyStashedFiles.php
index 9be5849..0c70a8a 100644
--- a/includes/api/ApiQueryMyStashedFiles.php
+++ b/includes/api/ApiQueryMyStashedFiles.php
@@ -92,10 +92,10 @@
];
 
if ( isset( $prop['size'] ) ) {
-   $item['size'] = (int) $row->us_size;
-   $item['width'] = (int) $row->us_image_width;
-   $item['height'] = (int) $row->us_image_height;
-   $item['bits'] = (int) $row->us_image_bits;
+   $item['size'] = (int)$row->us_size;
+   $item['width'] = (int)$row->us_image_width;
+   $item['height'] = (int)$row->us_image_height;
+   $item['bits'] = (int)$row->us_image_bits;
}
 
if ( isset( $prop['type'] ) ) {
diff --git a/includes/debug/logger/monolog/AvroFormatter.php 
b/includes/debug/logger/monolog/AvroFormatter.php
index f1a01fe..ce0cda1 100644
--- a/includes/debug/logger/monolog/AvroFormatter.php
+++ b/includes/debug/logger/monolog/AvroFormatter.php
@@ -155,7 +155,7 @@
 */
public function getSchemaRevisionId( $channel ) {
if ( isset( $this->schemas[$channel]['revision'] ) ) {
-   return (int) $this->schemas[$channel]['revision'];
+   return (int)$this->schemas[$channel]['revision'];
}
return null;
}
diff --git a/includes/json/FormatJson.php b/includes/json/FormatJson.php
index 775ab43..41541ef 100644
--- a/includes/json/FormatJson.php
+++ b/includes/json/FormatJson.php
@@ -271,7 +271,7 @@
 */
public static function stripComments( $json ) {
// Ensure we have a string
-   $str = (string) $json;
+   $str = (string)$json;
$buffer = '';
$maxLen = strlen( $str );
$mark = 0;
diff --git a/includes/specialpage/LoginSignupSpecialPage.php 
b/includes/specialpage/LoginSignupSpecialPage.php
index 275e121..6521cdc 100644
--- a/includes/specialpage/LoginSignupSpecialPage.php
+++ b/includes/specialpage/LoginSignupSpecialPage.php
@@ -655,7 +655,7 @@
// make a best effort to get the value of fields which used to 
be fixed in the old login
// template but now might or might not exist depending on what 
providers are used
$request = $this->getRequest();
-   $data = (object) [
+   $data = (object)[
'mUsername' => $request->getText( 'wpName' ),
'mPassword' => $request->getText( 'wpPassword' ),
'mRetype' => $request->getText( 'wpRetype' ),
diff --git a/includes/utils/UIDGenerator.php b/includes/utils/UIDGenerator.php
index 95b4463..1fd830e 100644
--- a/includes/utils/UIDGenerator.php
+++ b/includes/utils/UIDGenerator.php
@@ -554,9 +554,9 @@
$ts = ( 1000 * $sec + $msec ) * 1 + (int)$offset + 
$delta;
$id_bin = str_pad( decbin( $ts % pow( 2, 60

[MediaWiki-commits] [Gerrit] operations/puppet[production]: jupyterhub: Add some hardening for the notebooks

2016-10-30 Thread Madhuvishy (Code Review)
Madhuvishy has submitted this change and it was merged.

Change subject: jupyterhub: Add some hardening for the notebooks
..


jupyterhub: Add some hardening for the notebooks

Bug: T149543
Change-Id: I4e999af8351abd2e67fb337993c3ad85a796501a
---
M modules/jupyterhub/files/jupyterhub_config.py
1 file changed, 26 insertions(+), 0 deletions(-)

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



diff --git a/modules/jupyterhub/files/jupyterhub_config.py 
b/modules/jupyterhub/files/jupyterhub_config.py
index 1ec908c..8f82f66 100644
--- a/modules/jupyterhub/files/jupyterhub_config.py
+++ b/modules/jupyterhub/files/jupyterhub_config.py
@@ -102,3 +102,29 @@
 c.LDAPAuthenticator.allowed_groups = [
 'cn=ops,ou=groups,dc=wikimedia,dc=org',
 ]
+
+# Security settings! Let's lock this down!
+# This provides arbitrary code execution over the web, so needs to be as
+# secure as possible.
+# The threat model is dual:
+#  1. Compromise of JupyterHub itself
+#  2. Compromise of individual user's notebook
+#
+# We aren't patching for (1) here, but just for (2). In case of a compromise,
+# we want the attacker to not be able to gain any extra privilages at all.
+# We want the attack to be as confined as possible. We'll need auditing and
+# what not built eventually, but here are some basic rudimentary protections.
+# This also requires systemd > 228, so we must have systemd from 
jessie-backports
+
+# Give each user their own /tmp! Prevents data leaks via accidentally writing
+# to /tmp
+c.SystemdSpawner.isolate_tmp = True
+
+# Disable users from ever gaining root privilages for anything at all.
+# This protects against the notebook of a privilaged user being compromised
+# to gain root
+c.SystemdSpawner.disable_user_sudo = True
+
+# We allow users to only write to their homedirs, and nowhere else
+c.SystemdSpawner.readonly_paths = ['/']
+c.SystemdSpawner.readwrite_paths = ['/home/{USERNAME}']

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4e999af8351abd2e67fb337993c3ad85a796501a
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda 
Gerrit-Reviewer: Madhuvishy 
Gerrit-Reviewer: Volans 
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...JsonConfig[master]: Cleanup, new array syntax

2016-10-30 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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

Change subject: Cleanup, new array syntax
..

Cleanup, new array syntax

Change-Id: I3ae95d5c2ebf1a91576508964d2ab5ed799d8ceb
---
M JsonConfig.namespaces.php
M extension.json
M includes/JCApi.php
M includes/JCCache.php
M includes/JCContentHandler.php
M includes/JCDefaultContentView.php
M includes/JCDefaultObjContentView.php
M includes/JCLuaLibrary.php
M includes/JCObjContent.php
M includes/JCSingleton.php
M includes/JCUtils.php
M includes/JCValidators.php
M tests/manual/TestAllConfigs.php
M tests/manual/TestNoValidation.php
M tests/manual/TestObjectContent.php
M tests/manual/TestZeroContent.php
M tests/phpunit/JCObjContentTest.php
17 files changed, 253 insertions(+), 253 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/JsonConfig 
refs/changes/81/318881/1

diff --git a/JsonConfig.namespaces.php b/JsonConfig.namespaces.php
index 2d67e55..ce3629f 100644
--- a/JsonConfig.namespaces.php
+++ b/JsonConfig.namespaces.php
@@ -10,16 +10,16 @@
  * @license GNU General Public Licence 2.0 or later
  */
 
-$namespaceNames = array();
+$namespaceNames = [];
 
-$namespaceNames['en'] = array(
+$namespaceNames['en'] = [
482 => 'Config',
483 => 'Config_talk',
486 => 'Data',
487 => 'Data_talk',
-);
+];
 
-$namespaceNames['vi'] = array(
+$namespaceNames['vi'] = [
482 => 'Cấu_hình',
483 => 'Thảo_luận_Cấu_hình',
-);
+];
diff --git a/extension.json b/extension.json
index cd7b05b..8fe369f 100644
--- a/extension.json
+++ b/extension.json
@@ -75,30 +75,6 @@
"remoteExtPath": "JsonConfig/modules"
},
"Hooks": {
-   "CanonicalNamespaces": [
-   "JsonConfig\\JCSingleton::onCanonicalNamespaces"
-   ],
-   "ScribuntoExternalLibraries": [
-   "JsonConfig\\JCLuaLibrary::onScribuntoExternalLibraries"
-   ],
-   "ContentHandlerDefaultModelFor": [
-   
"JsonConfig\\JCSingleton::onContentHandlerDefaultModelFor"
-   ],
-   "ContentHandlerForModelID": [
-   "JsonConfig\\JCSingleton::onContentHandlerForModelID"
-   ],
-   "CodeEditorGetPageLanguage": [
-   "JsonConfig\\JCSingleton::onCodeEditorGetPageLanguage"
-   ],
-   "EditFilterMergedContent": [
-   "JsonConfig\\JCSingleton::onEditFilterMergedContent"
-   ],
-   "BeforePageDisplay": [
-   "JsonConfig\\JCSingleton::onBeforePageDisplay"
-   ],
-   "MovePageIsValidMove": [
-   "JsonConfig\\JCSingleton::onMovePageIsValidMove"
-   ],
"AbortMove": [
"JsonConfig\\JCSingleton::onAbortMove"
],
@@ -108,9 +84,34 @@
"ArticleUndelete": [
"JsonConfig\\JCSingleton::onArticleUndelete"
],
+   "BeforePageDisplay": [
+   "JsonConfig\\JCSingleton::onBeforePageDisplay"
+   ],
+   "CanonicalNamespaces": [
+   "JsonConfig\\JCSingleton::onCanonicalNamespaces"
+   ],
+   "CodeEditorGetPageLanguage": [
+   "JsonConfig\\JCSingleton::onCodeEditorGetPageLanguage"
+   ],
+   "ContentHandlerDefaultModelFor": [
+   
"JsonConfig\\JCSingleton::onContentHandlerDefaultModelFor"
+   ],
+   "ContentHandlerForModelID": [
+   "JsonConfig\\JCSingleton::onContentHandlerForModelID"
+   ],
+   ],
+   "EditFilterMergedContent": [
+   "JsonConfig\\JCSingleton::onEditFilterMergedContent"
+   ],
+   "MovePageIsValidMove": [
+   "JsonConfig\\JCSingleton::onMovePageIsValidMove"
+   ],
"PageContentSaveComplete": [
"JsonConfig\\JCSingleton::onPageContentSaveComplete"
],
+   "ScribuntoExternalLibraries": [
+   "JsonConfig\\JCLuaLibrary::onScribuntoExternalLibraries"
+   ],
"TitleMoveComplete": [
"JsonConfig\\JCSingleton::onTitleMoveComplete"
],
diff --git a/includes/JCApi.php b/includes/JCApi.php
index 8967be6..9806feb 100644
--- a/includes/JCApi.php
+++ b/includes/JCApi.php
@@ -2,7 +2,6 @@
 namespace JsonConfig;
 
 use ApiBase;
-use MWNamespace;
 
 /**
  * Allows JsonConfig to be manipulated via API
@@ -11,7 +10,7 @@
 
private static function addStatusConf( $conf ) {
// explicitly list values to avoid accidental exposure of 
private data
- 

[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Add sniff for cast operator spacing

2016-10-30 Thread Samwilson (Code Review)
Samwilson has uploaded a new change for review.

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

Change subject: Add sniff for cast operator spacing
..

Add sniff for cast operator spacing

When type-casting, do not use a space within or after the cast operator.

This change adds the sniff to check for this, as well as some tests (and
their results).

Bug: T149544
Change-Id: Ibd0feeef941b080a4e1f2a517552a15b7440f980
---
M MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php
M MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php.expect
M MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php.fixed
M MediaWiki/ruleset.xml
4 files changed, 9 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/80/318880/1

diff --git a/MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php 
b/MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php
index 8828c29..88435af 100644
--- a/MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php
+++ b/MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php
@@ -15,6 +15,7 @@
'foo' => 'bar',
'foo' => ['bar', 'baz']
];
+   $d = ( int ) $a->bar();
 }
 
 /**
diff --git a/MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php.expect 
b/MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php.expect
index 9985744..61ebed6 100644
--- a/MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php.expect
+++ b/MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php.expect
@@ -13,6 +13,9 @@
  13 | WARNING | [x] Unnecessary space found within parentheses
  16 | WARNING | [x] Single space expected after opening parenthesis
  16 | WARNING | [x] Single space expected before closing parenthesis
+ 18 | ERROR   | [x] Cast statements must not contain whitespace;
+| | expected "(int)" but found "( int )"
+ 18 | ERROR   | [x] A cast statement must not be followed by a space
 --
 PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
 --
diff --git a/MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php.fixed 
b/MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php.fixed
index 61d17bd..7a1f9e2 100644
--- a/MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php.fixed
+++ b/MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php.fixed
@@ -15,6 +15,7 @@
'foo' => 'bar',
'foo' => [ 'bar', 'baz' ]
];
+   $d = (int)$a->bar();
 }
 
 /**
diff --git a/MediaWiki/ruleset.xml b/MediaWiki/ruleset.xml
index f6c7a54..8f1db2b 100644
--- a/MediaWiki/ruleset.xml
+++ b/MediaWiki/ruleset.xml
@@ -45,12 +45,11 @@

0

-   
-   
+
+   

+   
+




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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd0feeef941b080a4e1f2a517552a15b7440f980
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Samwilson 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: jupyterhub: Remove venv creation from deploy script

2016-10-30 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: jupyterhub: Remove venv creation from deploy script
..


jupyterhub: Remove venv creation from deploy script

Puppet already creates the venv

Change-Id: I820cf3686e3e24980a3a3f83c934574102d951e0
---
M modules/jupyterhub/templates/deploy-jupyterhub.sh.erb
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/modules/jupyterhub/templates/deploy-jupyterhub.sh.erb 
b/modules/jupyterhub/templates/deploy-jupyterhub.sh.erb
index 5590d9e..3b6957f 100644
--- a/modules/jupyterhub/templates/deploy-jupyterhub.sh.erb
+++ b/modules/jupyterhub/templates/deploy-jupyterhub.sh.erb
@@ -5,7 +5,6 @@
 VENV="<%= @venv_path %>"
 WHEELS="<%= @wheels_path %>"
 
-virtualenv -p python3 ${VENV}
 ${VENV}/bin/pip install \
  --no-index \
  --find-links=${WHEELS}/wheelhouse \

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I820cf3686e3e24980a3a3f83c934574102d951e0
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Madhuvishy 
Gerrit-Reviewer: Yuvipanda 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: jupyterhub: Remove venv creation from deploy script

2016-10-30 Thread Madhuvishy (Code Review)
Madhuvishy has uploaded a new change for review.

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

Change subject: jupyterhub: Remove venv creation from deploy script
..

jupyterhub: Remove venv creation from deploy script

Puppet already creates the venv

Change-Id: I820cf3686e3e24980a3a3f83c934574102d951e0
---
M modules/jupyterhub/templates/deploy-jupyterhub.sh.erb
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/79/318879/1

diff --git a/modules/jupyterhub/templates/deploy-jupyterhub.sh.erb 
b/modules/jupyterhub/templates/deploy-jupyterhub.sh.erb
index 5590d9e..3b6957f 100644
--- a/modules/jupyterhub/templates/deploy-jupyterhub.sh.erb
+++ b/modules/jupyterhub/templates/deploy-jupyterhub.sh.erb
@@ -5,7 +5,6 @@
 VENV="<%= @venv_path %>"
 WHEELS="<%= @wheels_path %>"
 
-virtualenv -p python3 ${VENV}
 ${VENV}/bin/pip install \
  --no-index \
  --find-links=${WHEELS}/wheelhouse \

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: jupyterhub: Add some hardening for the notebooks

2016-10-30 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: jupyterhub: Add some hardening for the notebooks
..

jupyterhub: Add some hardening for the notebooks

Bug: T149543
Change-Id: I4e999af8351abd2e67fb337993c3ad85a796501a
---
M modules/jupyterhub/files/jupyterhub_config.py
1 file changed, 30 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/78/318878/1

diff --git a/modules/jupyterhub/files/jupyterhub_config.py 
b/modules/jupyterhub/files/jupyterhub_config.py
index 1ec908c..2c045ba 100644
--- a/modules/jupyterhub/files/jupyterhub_config.py
+++ b/modules/jupyterhub/files/jupyterhub_config.py
@@ -102,3 +102,33 @@
 c.LDAPAuthenticator.allowed_groups = [
 'cn=ops,ou=groups,dc=wikimedia,dc=org',
 ]
+
+# Security settings! Let's lock this down!
+# This provides arbitrary code execution over the web, so needs to be as
+# secure as possible.
+# The threat model is dual:
+#  1. Compromise of JupyterHub itself
+#  2. Compromise of individual user's notebook
+#
+# We aren't patching for (1) here, but just for (2). In case of a compromise,
+# we want the attacker to not be able to gain any extra privilages at all.
+# We want the attack to be as confined as possible. We'll need auditing and
+# what not built eventually, but here are some basic rudimentary protections.
+# This also requires systemd > 228, so we must have systemd from 
jessie-backports
+
+# Give each user their own /tmp! Prevents data leaks via accidentally writing
+# to /tmp
+c.SystemdSpawner.isolate_tmp = True
+
+# Give each user their own /dev. This prevents users from gaining direct
+# device access, which helps prevent escalation via device specific bugs
+c.SystemdSpawner.isolate_devices = True
+
+# Disable users from ever gaining root privilages for anything at all.
+# This protects against the notebook of a privilaged user being compromised
+# to gain root
+c.SystemdSpawner.disable_user_sudo = True
+
+# We allow users to only write to their homedirs, and nowhere else
+c.SystemdSpawner.readonly_paths = ['/']
+c.SystemdSpawner.readwrite_paths = ['/home/{USERNAME}']

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: jupyterhub: Specify proper class for config keys

2016-10-30 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: jupyterhub: Specify proper class for config keys
..


jupyterhub: Specify proper class for config keys

LocalAuthenticator doesn't exist. We could use the correct
name of the class we derived, but that is unnecessary I think -
the way I understand traitlets to work, this should work too.

Change-Id: I6a9b7377f313f9789441ef2b192b8a8a14c87941
---
M modules/jupyterhub/files/jupyterhub_config.py
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/modules/jupyterhub/files/jupyterhub_config.py 
b/modules/jupyterhub/files/jupyterhub_config.py
index fd5c22d..1ec908c 100644
--- a/modules/jupyterhub/files/jupyterhub_config.py
+++ b/modules/jupyterhub/files/jupyterhub_config.py
@@ -96,9 +96,9 @@
 c.JupyterHub.authenticator_class = VenvCreatingAuthenticator
 
 if AUTHENTICATOR == 'ldap':
-c.LocalAuthenticator.server_address = 'ldap-labs.eqiad.wikimedia.org'
-c.LocalAuthenticator.bind_dn_template = \
+c.LDAPAuthenticator.server_address = 'ldap-labs.eqiad.wikimedia.org'
+c.LDAPAuthenticator.bind_dn_template = \
 'uid={username},ou=people,dc=wikimedia,dc=org'
-c.LocalAuthenticator.allowed_groups = [
+c.LDAPAuthenticator.allowed_groups = [
 'cn=ops,ou=groups,dc=wikimedia,dc=org',
 ]

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: jupyterhub: Specify proper class for config keys

2016-10-30 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: jupyterhub: Specify proper class for config keys
..

jupyterhub: Specify proper class for config keys

LocalAuthenticator doesn't exist. We could use the correct
name of the class we derived, but that is unnecessary I think -
the way I understand traitlets to work, this should work too.

Change-Id: I6a9b7377f313f9789441ef2b192b8a8a14c87941
---
M modules/jupyterhub/files/jupyterhub_config.py
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/77/318877/1

diff --git a/modules/jupyterhub/files/jupyterhub_config.py 
b/modules/jupyterhub/files/jupyterhub_config.py
index fd5c22d..1ec908c 100644
--- a/modules/jupyterhub/files/jupyterhub_config.py
+++ b/modules/jupyterhub/files/jupyterhub_config.py
@@ -96,9 +96,9 @@
 c.JupyterHub.authenticator_class = VenvCreatingAuthenticator
 
 if AUTHENTICATOR == 'ldap':
-c.LocalAuthenticator.server_address = 'ldap-labs.eqiad.wikimedia.org'
-c.LocalAuthenticator.bind_dn_template = \
+c.LDAPAuthenticator.server_address = 'ldap-labs.eqiad.wikimedia.org'
+c.LDAPAuthenticator.bind_dn_template = \
 'uid={username},ou=people,dc=wikimedia,dc=org'
-c.LocalAuthenticator.allowed_groups = [
+c.LDAPAuthenticator.allowed_groups = [
 'cn=ops,ou=groups,dc=wikimedia,dc=org',
 ]

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: jupyterhub: Safer defaults for authenticator

2016-10-30 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: jupyterhub: Safer defaults for authenticator
..


jupyterhub: Safer defaults for authenticator

We'd rather have LDAP be the default, and someone in labs not
be able to get in, than dummy be the default and be accidentally
enabled in prod

Bug: T149543
Change-Id: I0a51bf09ab620d0333a94db393ca5a7d02527056
---
M hieradata/labs.yaml
M modules/jupyterhub/manifests/init.pp
2 files changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/hieradata/labs.yaml b/hieradata/labs.yaml
index e1ae174..5bd49e6 100644
--- a/hieradata/labs.yaml
+++ b/hieradata/labs.yaml
@@ -34,6 +34,9 @@
 archiva::proxy::certificate_name: ssl-cert-snakeoil
 statsite::instance::graphite_host: 'labmon1001.eqiad.wmnet'
 
+# Default to Dummy authenticator in JupyterHubs in labs
+jupyterhub::authenticator: dummy
+
 # Cache-layer stuff
 cache::route_table:
 eqiad: 'direct'
diff --git a/modules/jupyterhub/manifests/init.pp 
b/modules/jupyterhub/manifests/init.pp
index d0b4491..743b88b 100644
--- a/modules/jupyterhub/manifests/init.pp
+++ b/modules/jupyterhub/manifests/init.pp
@@ -23,7 +23,7 @@
 class jupyterhub (
 $wheels_repo,
 $base_path='/srv/jupyterhub',
-$authenticator='dummy',
+$authenticator='ldap',
 ) {
 
 $venv_path = "${base_path}/venv"

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: paws_internal: Rename hiera file to match

2016-10-30 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: paws_internal: Rename hiera file to match
..


paws_internal: Rename hiera file to match

Change-Id: I937f133fa49ee33953646aa14f04b17c71e518de
---
R hieradata/role/common/paws_internal/jupyterhub.yaml
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/hieradata/role/common/notebook/server.yaml 
b/hieradata/role/common/paws_internal/jupyterhub.yaml
similarity index 100%
rename from hieradata/role/common/notebook/server.yaml
rename to hieradata/role/common/paws_internal/jupyterhub.yaml

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: jupyterhub: Safer defaults for authenticator

2016-10-30 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: jupyterhub: Safer defaults for authenticator
..

jupyterhub: Safer defaults for authenticator

We'd rather have LDAP be the default, and someone in labs not
be able to get in, than dummy be the default and be accidentally
enabled in prod

Bug: T149543
Change-Id: I0a51bf09ab620d0333a94db393ca5a7d02527056
---
M hieradata/labs.yaml
M modules/jupyterhub/manifests/init.pp
2 files changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/76/318876/1

diff --git a/hieradata/labs.yaml b/hieradata/labs.yaml
index e1ae174..5bd49e6 100644
--- a/hieradata/labs.yaml
+++ b/hieradata/labs.yaml
@@ -34,6 +34,9 @@
 archiva::proxy::certificate_name: ssl-cert-snakeoil
 statsite::instance::graphite_host: 'labmon1001.eqiad.wmnet'
 
+# Default to Dummy authenticator in JupyterHubs in labs
+jupyterhub::authenticator: dummy
+
 # Cache-layer stuff
 cache::route_table:
 eqiad: 'direct'
diff --git a/modules/jupyterhub/manifests/init.pp 
b/modules/jupyterhub/manifests/init.pp
index d0b4491..743b88b 100644
--- a/modules/jupyterhub/manifests/init.pp
+++ b/modules/jupyterhub/manifests/init.pp
@@ -23,7 +23,7 @@
 class jupyterhub (
 $wheels_repo,
 $base_path='/srv/jupyterhub',
-$authenticator='dummy',
+$authenticator='ldap',
 ) {
 
 $venv_path = "${base_path}/venv"

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: paws_internal: Rename hiera file to match

2016-10-30 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: paws_internal: Rename hiera file to match
..

paws_internal: Rename hiera file to match

Change-Id: I937f133fa49ee33953646aa14f04b17c71e518de
---
R hieradata/role/common/paws_internal/jupyterhub.yaml
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/75/318875/1

diff --git a/hieradata/role/common/notebook/server.yaml 
b/hieradata/role/common/paws_internal/jupyterhub.yaml
similarity index 100%
rename from hieradata/role/common/notebook/server.yaml
rename to hieradata/role/common/paws_internal/jupyterhub.yaml

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

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

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: textlib.py: Use atomic grouping in FILE_LINK_REGEX

2016-10-30 Thread Dalba (Code Review)
Dalba has uploaded a new change for review.

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

Change subject: textlib.py: Use atomic grouping in FILE_LINK_REGEX
..

textlib.py: Use atomic grouping in FILE_LINK_REGEX

This prevents catastrophic backtracking.

Bug: T148959
Change-Id: Ifa8542586c1f114958c38d0572e68da622ec74fc
---
M pywikibot/textlib.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/74/318874/1

diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index fc7c4b1..08788fb 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -109,12 +109,12 @@
 # e.g. FILE_LINK_REGEX % 'File' or FILE_LINK_REGEX % '|'.join(site.namespaces)
 FILE_LINK_REGEX = r"""
 \[\[\s*(?:%s)\s*:[^|]*?\s*
-  (\|
+  (?=(?P\|
 ( \[\[ [^[]*? \[\[ [^]]*? \]\] [^]]*? \]\]  # capture invalid syntax
  | ( \[\[ .*? \]\] )? [^[]*?
  | \[ [^]]*? \]
 )*
-  )?
+  ))(?P=atomic)?
 \]\]
 """
 

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: jupyterhub: Add module to set up Jupyterhub for paws-internal

2016-10-30 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: jupyterhub: Add module to set up Jupyterhub for paws-internal
..


jupyterhub: Add module to set up Jupyterhub for paws-internal

See https://wikitech.wikimedia.org/wiki/PAWS/Internal for more
information.

Bug: T149543
Change-Id: I33104206fe75d817531c23f10e4ccf225da81fa0
---
M manifests/site.pp
A modules/jupyterhub/files/jupyterhub_config.py
A modules/jupyterhub/files/nchp_config.py
A modules/jupyterhub/manifests/init.pp
A modules/jupyterhub/templates/deploy-jupyterhub.sh.erb
A modules/jupyterhub/templates/initscripts/jupyterhub.systemd.erb
A modules/jupyterhub/templates/initscripts/nchp.systemd.erb
A modules/role/manifests/paws_internal/jupyterhub.pp
M tox.ini
9 files changed, 320 insertions(+), 2 deletions(-)

Approvals:
  Yuvipanda: Verified; Looks good to me, approved
  Madhuvishy: Looks good to me, but someone else must approve



diff --git a/manifests/site.pp b/manifests/site.pp
index 78e35ab..cab594b 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2248,7 +2248,7 @@
 
 # Experimental Jupyter notebook servers
 node /^notebook100[12]\.eqiad\.wmnet$/ {
-role(notebook::server, analytics_cluster::client)
+role(notebook::server, paws_internal::jupyterhub, 
analytics_cluster::client)
 include standard
 }
 
diff --git a/modules/jupyterhub/files/jupyterhub_config.py 
b/modules/jupyterhub/files/jupyterhub_config.py
new file mode 100644
index 000..fd5c22d
--- /dev/null
+++ b/modules/jupyterhub/files/jupyterhub_config.py
@@ -0,0 +1,104 @@
+"""
+Configure JupyterHub securely with SystemdSpawner & LDAP/Dummy Authenticator
+
+We pick up configuration on what to do from environment variables which
+are set via puppet. This allows us to keep this a pure python file, rather
+than a ruby template (erb) that generates python.
+"""
+import os
+import subprocess
+import shutil
+from tornado import gen
+
+
+AUTHENTICATOR = os.environ['AUTHENTICATOR']
+WHEELS_PATH = os.environ['WHEELS_PATH']
+DATA_PATH = os.environ['DATA_PATH']
+
+if AUTHENTICATOR == 'dummy':
+from dummyauthenticator import DummyAuthenticator as Authenticator
+elif AUTHENTICATOR == 'ldap':
+from ldapauthenticator import LDAPAuthenticator as Authenticator
+else:
+raise ImportError('Unknown AUTHENTICATOR_CLASS %s' % AUTHENTICATOR)
+
+
+
+c.JupyterHub.log_level = 'WARN'
+
+# Isolate the db file into a specific directory, and give JupyterHub write
+# access only to this. This prevents it from overwriting its own code easily.
+c.JupyterHub.db_url = 'sqlite:///{dp}/jupyterhub.sqlite'.format(dp=DATA_PATH)
+
+# Have the hub itself listen only on localhost
+c.JupyterHub.hub_ip = '127.0.0.1'
+c.JupyterHub.hub_port = 8081
+
+# The hub will look for a proxy that's listening on this ip and port
+# We manage that via another systemd unit file + configuration
+c.JupyterHub.ip = '0.0.0.0'
+c.JupyterHub.port = 8000
+c.JupyterHub.proxy_api_port = 8001
+
+# Do not kill servers when the hub restarts
+c.JupyterHub.cleanup_servers = False
+
+c.JupyterHub.spawner_class = 'systemdspawner.SystemdSpawner'
+# This is enough, since we'll put a jupyterhub-singleuser script in
+# here from the LocalAuthenticator. This also enables users to install
+# things via pip easily and have them be immediately available
+c.SystemdSpawner.extra_paths = ['/home/{USERNAME}/venv/bin']
+
+# ???
+c.SystemdSpawner.environment = {
+'HADOOP_CONF_DIR': '/etc/hadoop/conf.analytics-cluster/',
+}
+
+class VenvCreatingAuthenticator(Authenticator):
+"""
+Authenticator that creates venvs for each user.
+
+- If a user's homedirectory does not exist, we create it and chown it
+  appropriately
+- if the user doesn't have a venv in their homedir, we create one under
+  $HOME/venv, and install jupyterhub+jupyter in it from our wheelhouse
+
+This happens before the notebook is launched for each users, and thus
+users can install packages they want with pip from here.
+"""
+@gen.coroutine
+def add_user(self, user):
+home_path = os.path.join('/home', user.name)
+venv_path = os.path.join(home_path, 'venv')
+if not os.path.exists(home_path):
+os.mkdir(home_path, 0o755)
+shutil.chown(home_path, user.name, 'wikidev')
+if not os.path.exists(venv_path):
+subprocess.check_call([
+'sudo',
+'-u', user.name,
+'/usr/bin/python3',
+'-m', 'venv',
+venv_path
+])
+subprocess.check_call([
+'sudo',
+'-u', user.name,
+os.path.join(venv_path, 'bin', 'pip'),
+'install',
+'--no-index',
+'--find-links={wp}/wheelhouse'.format(wp=WHEELS_PATH),
+'jupyter',
+'jupyterhub'
+])
+
+
+c.JupyterHub.authenticator_class = 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Use 20 parallel git-updater pulls

2016-10-30 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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

Change subject: Use 20 parallel git-updater pulls
..

Use 20 parallel git-updater pulls

Change-Id: Icc12934dfbc87dc4461b58626e8540b0b1e065e8
---
M puppet/modules/mediawiki/templates/run-git-update.erb
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/73/318873/1

diff --git a/puppet/modules/mediawiki/templates/run-git-update.erb 
b/puppet/modules/mediawiki/templates/run-git-update.erb
index dcfaf81..561af3b 100644
--- a/puppet/modules/mediawiki/templates/run-git-update.erb
+++ b/puppet/modules/mediawiki/templates/run-git-update.erb
@@ -159,7 +159,7 @@
 echo $DIR
   fi
 done |
-parallel --verbose --noswap --load "100%" --keep-order mwv_git_pull
+parallel --verbose --noswap --jobs 20 --load "100%" --keep-order mwv_git_pull
 
 # Update composer dependencies in parallel
 for DIR in $MW_INSTALL_PATH \
@@ -168,7 +168,7 @@
 echo $DIR
   fi
 done |
-parallel --verbose --noswap --load "100%" --keep-order mwv_composer
+parallel --verbose --noswap --jobs 20 --load "100%" --keep-order mwv_composer
 
 echo -e "\e[36m==> Updating database ...\e[0m"
 /usr/local/bin/foreachwiki update.php --quick --doshared

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...JsonConfig[master]: Switch to compact json storage

2016-10-30 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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

Change subject: Switch to compact json storage
..

Switch to compact json storage

Bug: T149541
Change-Id: I0f8e325c41e4fb964edc45f52a60823c2cdb0b37
---
M extension.json
M includes/JCApi.php
M includes/JCContent.php
M includes/JCContentHandler.php
A includes/JCJsonDifferenceEngine.php
5 files changed, 107 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/JsonConfig 
refs/changes/72/318872/1

diff --git a/extension.json b/extension.json
index cd7b05b..8acbfc9 100644
--- a/extension.json
+++ b/extension.json
@@ -51,6 +51,7 @@
"JsonConfig\\JCDataContent": "includes/JCDataContent.php",
"JsonConfig\\JCDefaultContentView": 
"includes/JCDefaultContentView.php",
"JsonConfig\\JCDefaultObjContentView": 
"includes/JCDefaultObjContentView.php",
+   "JsonConfig\\JCJsonDifferenceEngine": 
"includes/JCJsonDifferenceEngine.php",
"JsonConfig\\JCLuaLibrary": "includes/JCLuaLibrary.php",
"JsonConfig\\JCObjContent": "includes/JCObjContent.php",
"JsonConfig\\JCSingleton": "includes/JCSingleton.php",
diff --git a/includes/JCApi.php b/includes/JCApi.php
index 8967be6..1cacaaf 100644
--- a/includes/JCApi.php
+++ b/includes/JCApi.php
@@ -2,7 +2,6 @@
 namespace JsonConfig;
 
 use ApiBase;
-use MWNamespace;
 
 /**
  * Allows JsonConfig to be manipulated via API
diff --git a/includes/JCContent.php b/includes/JCContent.php
index 9257b49..cbb 100644
--- a/includes/JCContent.php
+++ b/includes/JCContent.php
@@ -150,9 +150,7 @@
if ( !$this->isValidJson() ) {
return $this; // Invalid JSON - can't do anything with 
it
}
-   $formatted = self::normalizeLineEndings(
-   FormatJson::encode( $this->getData(), true, 
FormatJson::ALL_OK )
-   );
+   $formatted = FormatJson::encode( $this->getData(), false, 
FormatJson::ALL_OK );
if ( $this->getNativeData() !== $formatted ) {
return new static( $formatted, $this->getModel(), 
$this->thorough() );
}
diff --git a/includes/JCContentHandler.php b/includes/JCContentHandler.php
index 40a5d90..ed233eb 100644
--- a/includes/JCContentHandler.php
+++ b/includes/JCContentHandler.php
@@ -15,6 +15,12 @@
  * @author Yuri Astrakhan 
  */
 class JCContentHandler extends TextContentHandler {
+
+   /**
+* Internal format to force prety-printed json serialization
+*/
+   const CONTENT_FORMAT_JSON_PRETTY = 'application/json+pretty';
+
/**
 * @param string $modelId
 */
@@ -25,7 +31,7 @@
/**
 * Returns the content's text as-is.
 *
-* @param \Content|\JsonConfig\JCContent $content This is actually a 
Content object
+* @param \Content|JCContent $content This is actually a Content object
 * @param $format string|null
 * @return mixed
 */
@@ -40,7 +46,55 @@
return $content->getNativeData(); // Invalid JSON - 
can't do anything with it
}
 
-   return FormatJson::encode( $data, true, FormatJson::ALL_OK );
+   return FormatJson::encode( $data, $format === 
self::CONTENT_FORMAT_JSON_PRETTY,
+   FormatJson::ALL_OK );
+   }
+
+   /**
+* @param \Content|JCContent $oldContent
+* @param \Content|JCContent $myContent
+* @param \Content|JCContent $yourContent
+* @return bool|JCContent
+*/
+   public function merge3( \Content $oldContent, \Content $myContent, 
\Content $yourContent ) {
+
+   // Almost identical clone of the parent's merge3, except that 
we use pretty-printed merge,
+   // thus allowing much more lenient line-based merging.
+
+   $this->checkModelID( $oldContent->getModel() );
+   $this->checkModelID( $myContent->getModel() );
+   $this->checkModelID( $yourContent->getModel() );
+
+   $format = self::CONTENT_FORMAT_JSON_PRETTY;
+
+   $old = $this->serializeContent( $oldContent, $format );
+   $mine = $this->serializeContent( $myContent, $format );
+   $yours = $this->serializeContent( $yourContent, $format );
+
+   $ok = wfMerge( $old, $mine, $yours, $result );
+
+   if ( !$ok ) {
+   return false;
+   }
+
+   if ( !$result ) {
+   return $this->makeEmptyContent();
+   }
+
+   $mergedContent = $this->unserializeContent( $result, $format );
+
+   return $mergedContent;
+   }
+
+   /**
+* Returns the name of the diff engine to use.
+*
+* @since 1

[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Design changes

2016-10-30 Thread Sophivorus (Code Review)
Sophivorus has submitted this change and it was merged.

Change subject: Design changes
..


Design changes

restructuring of the parameters' table, add td tag for the strokes and redesign 
buttons+smaller font

Bug: T149460
Change-Id: I547a27bedd8cd1ef6a82ef719a3fad8950ac16b7
---
M proveit.css
M proveit.js
2 files changed, 182 insertions(+), 179 deletions(-)

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



diff --git a/proveit.css b/proveit.css
index 3689215..f84e365 100755
--- a/proveit.css
+++ b/proveit.css
@@ -1,167 +1,164 @@
-#proveit {
-   background: white;
-   border: 1px solid #ddd;
-   font-size: 14px;
-   position: fixed;
-   z-index: 2147483647; /* Max value */
-}
-
-#proveit-logo {
-   background: black;
-   color: white;
-   cursor: pointer;
-   float: right;
-   font-weight: bold;
-   padding: 15px;
-}
-
-#proveit-left-bracket {
-   color: yellow;
-   margin-right: 5px;
-}
-
-#proveit-right-bracket {
-   color: yellow;
-   margin-left: 5px;
-}
-
-#proveit-list-tab,
-#proveit-add-tab {
-   color: black;
-   cursor: pointer;
-   display: inline-block;
-   outline: none;
-   padding: 15px;
-}
-
-#proveit-list-tab.active,
-#proveit-add-tab.active {
-   background: #a7dcff;
-}
-
-#proveit-content {
-   background: #f4f4f4;
-   border-top: 1px solid #ddd;
-   overflow-y: scroll;
-   overflow-x: hidden;
-   width: 700px;
-   height: 300px;
-   resize: both;
-}
-
-#proveit-reference-list {
-   margin: 0;
-   padding: 0;
-}
-
-#proveit-reference-list .proveit-reference-item {
-   margin: 0;
-   overflow: hidden;
-   padding: 5px 10px;
-}
-
-#proveit-reference-list .proveit-reference-item:nth-child(even) {
-   background: #fff;
-}
-
-#proveit-reference-list .proveit-reference-item:hover {
-   background: #a7dcff;
-   cursor: pointer;
-}
-
-#proveit-reference-list .proveit-reference-item .proveit-reference-number {
-   font-weight: bold;
-   margin-right: 10px;
-}
-
-#proveit-reference-list .proveit-reference-item .proveit-reference-template {
-   font-weight: bold;
-   margin-right: 10px;
-}
-
-#proveit-reference-list .proveit-reference-item .proveit-citations {
-   float: right;
-}
-
-#proveit-reference-list .proveit-reference-item .proveit-citation {
-   color: blue;
-   padding: 3px;
-}
-
-#proveit-no-references-message {
-   text-align: center;
-   padding: 10px;
-}
-
-#proveit-reference-form {
-   margin-bottom: 50px;
-}
-
-#proveit-reference-form table {
-   border-spacing: 2px;
-   width: 100%;
-}
-
-#proveit-reference-form label {
-   border: 1px solid transparent;
-   box-sizing: border-box;
-   display: table-cell;
-   padding: 5px;
-   vertical-align: top;
-   width: 180px;
-}
-
-#proveit-reference-form .proveit-required label {
-   font-weight: bold;
-}
-
-#proveit-reference-form input,
-#proveit-reference-form select,
-#proveit-reference-form textarea {
-   -webkit-appearance: none;
-   background: white;
-   border: 1px solid #ddd;
-   border-radius: 0;
-   box-sizing: border-box;
-   display: table-cell;
-   font: inherit;
-   outline: none;
-   padding: 5px;
-   width: 100%;
-}
-
-#proveit-reference-form textarea {
-   height: 60px;
-   resize: vertical;
-}
-
-#proveit-buttons {
-   background: white;
-   border-spacing: 0;
-   border-top: 1px solid #ddd;
-   box-sizing: border-box;
-   margin: 0;
-   padding: 10px;
-   pointer-events: none;
-   position: absolute;
-   bottom: 0;
-   text-align: right;
-   width: 100%;
-}
-
-#proveit-buttons button {
-   background: #a7dcff;
-   border: 1px solid #ccc;
-   border-radius: 3px;
-   cursor: pointer;
-   font: inherit;
-   margin-left: 10px;
-   padding: 5px;
-   pointer-events: all;
-}
-
-#proveit-buttons #proveit-cite-button,
-#proveit-buttons #proveit-remove-button,
-#proveit-buttons #proveit-params-button {
-   background: none;
+#proveit {
+   background: white;
+   border: 1px solid #ddd;
+   font-size: 0.8em;
+   position: fixed;
+   z-index: 2147483647; /* Max value */
+}
+
+#proveit-logo {
+   background: black;
+   color: white;
+   cursor: pointer;
+   float: right;
+   font-weight: bold;
+   padding: 15px;
+}
+
+#proveit-left-bracket {
+   color: yellow;
+   margin-right: 5px;
+}
+
+#proveit-right-bracket {
+   color: yellow;
+   margin-left: 5px;
+}
+
+#proveit-list-tab,
+#proveit-add-tab {
+   color: black;
+   cursor: pointer;
+   display: inline-block;
+   outline: none;
+   padding: 15px;
+}
+
+#proveit-list-tab.active,
+#proveit-add-tab.active {
+   background: #ccc;
+}
+
+#proveit-header span:not(.active):not(#pro

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Document diff/DifferenceEngine.php function

2016-10-30 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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

Change subject: Document diff/DifferenceEngine.php function
..

Document diff/DifferenceEngine.php function

Change-Id: I999824d8ce569de93fe4c9a889edea582d07611c
---
M includes/diff/DifferenceEngine.php
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/71/318871/1

diff --git a/includes/diff/DifferenceEngine.php 
b/includes/diff/DifferenceEngine.php
index 16e9a44..73408ab 100644
--- a/includes/diff/DifferenceEngine.php
+++ b/includes/diff/DifferenceEngine.php
@@ -882,6 +882,10 @@
return $result;
};
 
+   /**
+* @param Status $status
+* @throws FatalError
+*/
$error = function( $status ) {
throw new FatalError( $status->getWikiText() );
};

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

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

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


[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Show only the title of the reference in the reference list

2016-10-30 Thread Iniquity (Code Review)
Iniquity has uploaded a new change for review.

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

Change subject: Show only the title of the reference in the reference list
..

Show only the title of the reference in the reference list

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


  git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt 
refs/changes/70/318870/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I999fdd8e2e517de7ae5ef543a9873854b45888fc
Gerrit-PatchSet: 1
Gerrit-Project: wikipedia/gadgets/ProveIt
Gerrit-Branch: master
Gerrit-Owner: Iniquity 

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


[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Design changes

2016-10-30 Thread Iniquity (Code Review)
Iniquity has uploaded a new change for review.

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

Change subject: Design changes
..

Design changes

restructuring of the parameters' table, add td tag for the strokes and redesign 
buttons+smaller font

Bug: T149460
Change-Id: I547a27bedd8cd1ef6a82ef719a3fad8950ac16b7
---
M proveit.css
M proveit.js
2 files changed, 173 insertions(+), 167 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt 
refs/changes/66/318866/2

diff --git a/proveit.css b/proveit.css
index 3689215..5240245 100755
--- a/proveit.css
+++ b/proveit.css
@@ -1,167 +1,169 @@
-#proveit {
-   background: white;
-   border: 1px solid #ddd;
-   font-size: 14px;
-   position: fixed;
-   z-index: 2147483647; /* Max value */
-}
-
-#proveit-logo {
-   background: black;
-   color: white;
-   cursor: pointer;
-   float: right;
-   font-weight: bold;
-   padding: 15px;
-}
-
-#proveit-left-bracket {
-   color: yellow;
-   margin-right: 5px;
-}
-
-#proveit-right-bracket {
-   color: yellow;
-   margin-left: 5px;
-}
-
-#proveit-list-tab,
-#proveit-add-tab {
-   color: black;
-   cursor: pointer;
-   display: inline-block;
-   outline: none;
-   padding: 15px;
-}
-
-#proveit-list-tab.active,
-#proveit-add-tab.active {
-   background: #a7dcff;
-}
-
-#proveit-content {
-   background: #f4f4f4;
-   border-top: 1px solid #ddd;
-   overflow-y: scroll;
-   overflow-x: hidden;
-   width: 700px;
-   height: 300px;
-   resize: both;
-}
-
-#proveit-reference-list {
-   margin: 0;
-   padding: 0;
-}
-
-#proveit-reference-list .proveit-reference-item {
-   margin: 0;
-   overflow: hidden;
-   padding: 5px 10px;
-}
-
-#proveit-reference-list .proveit-reference-item:nth-child(even) {
-   background: #fff;
-}
-
-#proveit-reference-list .proveit-reference-item:hover {
-   background: #a7dcff;
-   cursor: pointer;
-}
-
-#proveit-reference-list .proveit-reference-item .proveit-reference-number {
-   font-weight: bold;
-   margin-right: 10px;
-}
-
-#proveit-reference-list .proveit-reference-item .proveit-reference-template {
-   font-weight: bold;
-   margin-right: 10px;
-}
-
-#proveit-reference-list .proveit-reference-item .proveit-citations {
-   float: right;
-}
-
-#proveit-reference-list .proveit-reference-item .proveit-citation {
-   color: blue;
-   padding: 3px;
-}
-
-#proveit-no-references-message {
-   text-align: center;
-   padding: 10px;
-}
-
-#proveit-reference-form {
-   margin-bottom: 50px;
-}
-
-#proveit-reference-form table {
-   border-spacing: 2px;
-   width: 100%;
-}
-
-#proveit-reference-form label {
-   border: 1px solid transparent;
-   box-sizing: border-box;
-   display: table-cell;
-   padding: 5px;
-   vertical-align: top;
-   width: 180px;
-}
-
-#proveit-reference-form .proveit-required label {
-   font-weight: bold;
-}
-
-#proveit-reference-form input,
-#proveit-reference-form select,
-#proveit-reference-form textarea {
-   -webkit-appearance: none;
-   background: white;
-   border: 1px solid #ddd;
-   border-radius: 0;
-   box-sizing: border-box;
-   display: table-cell;
-   font: inherit;
-   outline: none;
-   padding: 5px;
-   width: 100%;
-}
-
-#proveit-reference-form textarea {
-   height: 60px;
-   resize: vertical;
-}
-
-#proveit-buttons {
-   background: white;
-   border-spacing: 0;
-   border-top: 1px solid #ddd;
-   box-sizing: border-box;
-   margin: 0;
-   padding: 10px;
-   pointer-events: none;
-   position: absolute;
-   bottom: 0;
-   text-align: right;
-   width: 100%;
-}
-
-#proveit-buttons button {
-   background: #a7dcff;
-   border: 1px solid #ccc;
-   border-radius: 3px;
-   cursor: pointer;
-   font: inherit;
-   margin-left: 10px;
-   padding: 5px;
-   pointer-events: all;
-}
-
-#proveit-buttons #proveit-cite-button,
-#proveit-buttons #proveit-remove-button,
-#proveit-buttons #proveit-params-button {
-   background: none;
+#proveit {
+   background: white;
+   border: 1px solid #ddd;
+   font-size: 0.8em;
+   position: fixed;
+   z-index: 2147483647; /* Max value */
+}
+
+#proveit-logo {
+   background: black;
+   color: white;
+   cursor: pointer;
+   float: right;
+   font-weight: bold;
+   padding: 15px;
+}
+
+#proveit-left-bracket {
+   color: yellow;
+   margin-right: 5px;
+}
+
+#proveit-right-bracket {
+   color: yellow;
+   margin-left: 5px;
+}
+
+#proveit-list-tab,
+#proveit-add-tab {
+   color: black;
+   cursor: pointer;
+   display: inline-block;
+   outline: none;
+   padding: 15px;
+}
+
+#proveit-list-tab.active,
+#proveit-add-tab.active {
+   ba

[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Design changes

2016-10-30 Thread Iniquity (Code Review)
Iniquity has uploaded a new change for review.

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

Change subject: Design changes
..

Design changes

restructuring of the parameters' table, add td tag for the strokes and redesign 
buttons+smaller font

Bug: T149460
Change-Id: I69cd2b3cc1e2a631a49f6875c0ba8b8bb760d717
---
M proveit.css
M proveit.js
2 files changed, 173 insertions(+), 167 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt 
refs/changes/65/318865/2

diff --git a/proveit.css b/proveit.css
index 3689215..5240245 100755
--- a/proveit.css
+++ b/proveit.css
@@ -1,167 +1,169 @@
-#proveit {
-   background: white;
-   border: 1px solid #ddd;
-   font-size: 14px;
-   position: fixed;
-   z-index: 2147483647; /* Max value */
-}
-
-#proveit-logo {
-   background: black;
-   color: white;
-   cursor: pointer;
-   float: right;
-   font-weight: bold;
-   padding: 15px;
-}
-
-#proveit-left-bracket {
-   color: yellow;
-   margin-right: 5px;
-}
-
-#proveit-right-bracket {
-   color: yellow;
-   margin-left: 5px;
-}
-
-#proveit-list-tab,
-#proveit-add-tab {
-   color: black;
-   cursor: pointer;
-   display: inline-block;
-   outline: none;
-   padding: 15px;
-}
-
-#proveit-list-tab.active,
-#proveit-add-tab.active {
-   background: #a7dcff;
-}
-
-#proveit-content {
-   background: #f4f4f4;
-   border-top: 1px solid #ddd;
-   overflow-y: scroll;
-   overflow-x: hidden;
-   width: 700px;
-   height: 300px;
-   resize: both;
-}
-
-#proveit-reference-list {
-   margin: 0;
-   padding: 0;
-}
-
-#proveit-reference-list .proveit-reference-item {
-   margin: 0;
-   overflow: hidden;
-   padding: 5px 10px;
-}
-
-#proveit-reference-list .proveit-reference-item:nth-child(even) {
-   background: #fff;
-}
-
-#proveit-reference-list .proveit-reference-item:hover {
-   background: #a7dcff;
-   cursor: pointer;
-}
-
-#proveit-reference-list .proveit-reference-item .proveit-reference-number {
-   font-weight: bold;
-   margin-right: 10px;
-}
-
-#proveit-reference-list .proveit-reference-item .proveit-reference-template {
-   font-weight: bold;
-   margin-right: 10px;
-}
-
-#proveit-reference-list .proveit-reference-item .proveit-citations {
-   float: right;
-}
-
-#proveit-reference-list .proveit-reference-item .proveit-citation {
-   color: blue;
-   padding: 3px;
-}
-
-#proveit-no-references-message {
-   text-align: center;
-   padding: 10px;
-}
-
-#proveit-reference-form {
-   margin-bottom: 50px;
-}
-
-#proveit-reference-form table {
-   border-spacing: 2px;
-   width: 100%;
-}
-
-#proveit-reference-form label {
-   border: 1px solid transparent;
-   box-sizing: border-box;
-   display: table-cell;
-   padding: 5px;
-   vertical-align: top;
-   width: 180px;
-}
-
-#proveit-reference-form .proveit-required label {
-   font-weight: bold;
-}
-
-#proveit-reference-form input,
-#proveit-reference-form select,
-#proveit-reference-form textarea {
-   -webkit-appearance: none;
-   background: white;
-   border: 1px solid #ddd;
-   border-radius: 0;
-   box-sizing: border-box;
-   display: table-cell;
-   font: inherit;
-   outline: none;
-   padding: 5px;
-   width: 100%;
-}
-
-#proveit-reference-form textarea {
-   height: 60px;
-   resize: vertical;
-}
-
-#proveit-buttons {
-   background: white;
-   border-spacing: 0;
-   border-top: 1px solid #ddd;
-   box-sizing: border-box;
-   margin: 0;
-   padding: 10px;
-   pointer-events: none;
-   position: absolute;
-   bottom: 0;
-   text-align: right;
-   width: 100%;
-}
-
-#proveit-buttons button {
-   background: #a7dcff;
-   border: 1px solid #ccc;
-   border-radius: 3px;
-   cursor: pointer;
-   font: inherit;
-   margin-left: 10px;
-   padding: 5px;
-   pointer-events: all;
-}
-
-#proveit-buttons #proveit-cite-button,
-#proveit-buttons #proveit-remove-button,
-#proveit-buttons #proveit-params-button {
-   background: none;
+#proveit {
+   background: white;
+   border: 1px solid #ddd;
+   font-size: 0.8em;
+   position: fixed;
+   z-index: 2147483647; /* Max value */
+}
+
+#proveit-logo {
+   background: black;
+   color: white;
+   cursor: pointer;
+   float: right;
+   font-weight: bold;
+   padding: 15px;
+}
+
+#proveit-left-bracket {
+   color: yellow;
+   margin-right: 5px;
+}
+
+#proveit-right-bracket {
+   color: yellow;
+   margin-left: 5px;
+}
+
+#proveit-list-tab,
+#proveit-add-tab {
+   color: black;
+   cursor: pointer;
+   display: inline-block;
+   outline: none;
+   padding: 15px;
+}
+
+#proveit-list-tab.active,
+#proveit-add-tab.active {
+   ba

[MediaWiki-commits] [Gerrit] mediawiki...TemplateStyles[master]: Remove unnecessary if

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

Change subject: Remove unnecessary if
..


Remove unnecessary if

More minor styles

Don't use temporary variable to return

Change-Id: I773ae4405ed98f75dea3984f46c72a1043c2fe8f
---
M TemplateStyles.hooks.php
1 file changed, 9 insertions(+), 13 deletions(-)

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



diff --git a/TemplateStyles.hooks.php b/TemplateStyles.hooks.php
index 6cd7654..af002ab 100644
--- a/TemplateStyles.hooks.php
+++ b/TemplateStyles.hooks.php
@@ -130,29 +130,25 @@
public static function render( $input, $args, $parser, $frame ) {
$css = new CSSParser( $input );
 
-   if ( $css ) {
-   $parser->getOutput()->setProperty(
-   'templatestyles',
-   self::encodeToBlob( $css->rules( 
'#mw-content-text ' ) )
-   );
-   }
+   $parser->getOutput()->setProperty(
+   'templatestyles',
+   self::encodeToBlob( $css->rules( '#mw-content-text ' ) )
+   );
 
// TODO: The UX would benefit from the CSS being run through the
// hook for syntax highlighting rather that simply being 
presented
// as a preformatted block.
-   $html =
+   return
Html::openElement( 'div', [ 'class' => 
'mw-templatestyles-doc' ] )
. Html::rawElement(
'p',
[ 'class' => 'mw-templatestyles-caption' ],
-   wfMessage( 'templatestyles-doc-header' ) )
-   . Html::element(
+   wfMessage( 'templatestyles-doc-header' )
+   ) . Html::element(
'pre',
[ 'class' => 'mw-templatestyles-stylesheet' ],
-   $input )
-   . Html::closeElement( 'div' );
-
-   return $html;
+   $input
+   ) . Html::closeElement( 'div' );
}
 
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I773ae4405ed98f75dea3984f46c72a1043c2fe8f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TemplateStyles
Gerrit-Branch: master
Gerrit-Owner: Reedy 
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...TemplateStyles[master]: Remove unnecessary if

2016-10-30 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

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

Change subject: Remove unnecessary if
..

Remove unnecessary if

More minor styles

Don't use temporary variable to return

Change-Id: I773ae4405ed98f75dea3984f46c72a1043c2fe8f
---
M TemplateStyles.hooks.php
1 file changed, 9 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TemplateStyles 
refs/changes/64/318864/1

diff --git a/TemplateStyles.hooks.php b/TemplateStyles.hooks.php
index 6cd7654..af002ab 100644
--- a/TemplateStyles.hooks.php
+++ b/TemplateStyles.hooks.php
@@ -130,29 +130,25 @@
public static function render( $input, $args, $parser, $frame ) {
$css = new CSSParser( $input );
 
-   if ( $css ) {
-   $parser->getOutput()->setProperty(
-   'templatestyles',
-   self::encodeToBlob( $css->rules( 
'#mw-content-text ' ) )
-   );
-   }
+   $parser->getOutput()->setProperty(
+   'templatestyles',
+   self::encodeToBlob( $css->rules( '#mw-content-text ' ) )
+   );
 
// TODO: The UX would benefit from the CSS being run through the
// hook for syntax highlighting rather that simply being 
presented
// as a preformatted block.
-   $html =
+   return
Html::openElement( 'div', [ 'class' => 
'mw-templatestyles-doc' ] )
. Html::rawElement(
'p',
[ 'class' => 'mw-templatestyles-caption' ],
-   wfMessage( 'templatestyles-doc-header' ) )
-   . Html::element(
+   wfMessage( 'templatestyles-doc-header' )
+   ) . Html::element(
'pre',
[ 'class' => 'mw-templatestyles-stylesheet' ],
-   $input )
-   . Html::closeElement( 'div' );
-
-   return $html;
+   $input
+   ) . Html::closeElement( 'div' );
}
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I773ae4405ed98f75dea3984f46c72a1043c2fe8f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TemplateStyles
Gerrit-Branch: master
Gerrit-Owner: Reedy 

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


[MediaWiki-commits] [Gerrit] mediawiki...Graph[master]: Removed Graph\Content unused class

2016-10-30 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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

Change subject: Removed Graph\Content unused class
..

Removed Graph\Content unused class

Change-Id: I9201e79ed316608e2510f55039ce571b544e464d
---
M extension.json
D includes/Content.php
2 files changed, 0 insertions(+), 57 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Graph 
refs/changes/63/318863/1

diff --git a/extension.json b/extension.json
index b46e34c..886f8ad 100644
--- a/extension.json
+++ b/extension.json
@@ -20,7 +20,6 @@
"Graph\\ParserTag": "includes/ParserTag.php",
"Graph\\Sandbox": "includes/Sandbox.php",
"Graph\\Store": "includes/Store.php",
-   "Graph\\Content": "includes/Content.php",
"Graph\\Hooks": "includes/Graph.hooks.php"
},
"APIModules": {
diff --git a/includes/Content.php b/includes/Content.php
deleted file mode 100644
index c343961..000
--- a/includes/Content.php
+++ /dev/null
@@ -1,56 +0,0 @@
-' . $this->getNativeData() . '';
-   }
-
-   protected function fillParserOutput( Title $title, $revId, 
ParserOptions $options, $generateHtml,
-   
 ParserOutput &$output ) {
-   /** @var $wgParser Parser */
-   global $wgParser;
-   $text = $this->getNativeData();
-   $parser = $wgParser->getFreshParser();
-   $text = $parser->preprocess( $text, $title, $options, $revId );
-
-   if ( $generateHtml ) {
-   $tag = new ParserTag( $parser, $options, $output );
-   $html = $tag->buildHtml( $text, $title, 
$parser->getRevisionId() );
-   } else {
-   $html = '';
-   }
-   $output->setText( $html );
-
-   // Since we invoke parser manually, the ParserAfterParse never 
gets called, do it manually
-   ParserTag::finalizeParserOutput( $parser, $title, $output );
-   }
-}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9201e79ed316608e2510f55039ce571b544e464d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Graph
Gerrit-Branch: master
Gerrit-Owner: Yurik 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Removed unused wmgUseGraphWithNamespace support

2016-10-30 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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

Change subject: Removed unused wmgUseGraphWithNamespace support
..

Removed unused wmgUseGraphWithNamespace support

This feature is not used anywhere, and will be removed
from the code.

Change-Id: I7c8af650515477b3c3eaea0d072da8c218645529
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 0 insertions(+), 13 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 1a0694a..81583b1 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -3081,15 +3081,6 @@
],
];
 
-   if ( $wmgUseGraphWithNamespace ) {
-   $wgJsonConfigModels['Graph.JsonConfig'] = 'Graph\Content';
-   $wgJsonConfigs['Graph.JsonConfig'] = [
-   'namespace' => 484,
-   'nsName' => 'Graph',
-   'isLocal' => true,
-   ];
-   }
-
if ( $wmgUseGraphWithJsonNamespace ) {
$wgJsonConfigModels['Json.JsonConfig'] = null;
$wgJsonConfigs['Json.JsonConfig'] = [
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index a553443..48ec1e9 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -14455,10 +14455,6 @@
'private' => false,
 ],
 
-'wmgUseGraphWithNamespace' => [
-   'default' => false,
-],
-
 'wmgUseGraphWithJsonNamespace' => [
'default' => false,
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...TemplateStyles[master]: Few style tweaks

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

Change subject: Few style tweaks
..


Few style tweaks

Parameter documentation type hints

Remove unused RL module

Change-Id: I6e265c97eababa4bbfebb9402141664ad24b4e43
---
M CSSParser.php
M CSSRenderer.php
M TemplateStyles.hooks.php
M extension.json
4 files changed, 34 insertions(+), 20 deletions(-)

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



diff --git a/CSSParser.php b/CSSParser.php
index 2e7bcb9..6631c23 100644
--- a/CSSParser.php
+++ b/CSSParser.php
@@ -51,7 +51,10 @@
(?# Unicode mask literals )
| .
(?# Any unmatched token is reduced to single 
characters )
-   )/xis', $css, $match );
+   )/xis',
+   $css,
+   $match
+   );
 
$inWhitespaceRun = false;
foreach ( $match[0] as $token ) {
diff --git a/CSSRenderer.php b/CSSRenderer.php
index 40d7614..e01e3f0 100644
--- a/CSSRenderer.php
+++ b/CSSRenderer.php
@@ -34,13 +34,15 @@
case '@media':
if ( $media == '' ) {
$this->add(
-   $rule['rules'], "@media 
{$rule['text']}"
+   $rule['rules'],
+   "@media {$rule['text']}"
);
}
break;
case '':
$this->byMedia[$media] = array_merge(
-   $this->byMedia[$media], 
$rule['rules']
+   $this->byMedia[$media],
+   $rule['rules']
);
break;
}
diff --git a/TemplateStyles.hooks.php b/TemplateStyles.hooks.php
index ccb0c4a..6cd7654 100644
--- a/TemplateStyles.hooks.php
+++ b/TemplateStyles.hooks.php
@@ -1,4 +1,5 @@
 setHook( 'templatestyles', 
'TemplateStylesHooks::render' );
return true;
}
 
+   /**
+* @param string $blob
+* @return string
+*/
private static function decodeFromBlob( $blob ) {
$tree = gzdecode( $blob );
if ( $tree ) {
@@ -23,19 +30,28 @@
return $tree;
}
 
+   /**
+* @param string $tree
+* @return string
+*/
private static function encodeToBlob( $tree ) {
return gzencode( serialize( $tree ) );
}
 
-   public static function onOutputPageParserOutput( &$out, $parseroutput ) 
{
-
-   $config = ConfigFactory::getDefaultInstance()->makeConfig( 
'templatestyles' );
+   /**
+* @param OutputPage $out
+* @param ParserOutput $parserOutput
+*/
+   public static function onOutputPageParserOutput( &$out, $parserOutput ) 
{
+   $config = \MediaWiki\MediaWikiServices::getInstance()
+   ->getConfigFactory()
+   ->makeConfig( 'templatestyles' );
$renderer = new CSSRenderer();
$pages = [];
 
foreach ( self::getConfigArray( $config, 'Namespaces' ) as $ns 
) {
-   if ( array_key_exists( $ns, 
$parseroutput->getTemplates() ) ) {
-   foreach ( $parseroutput->getTemplates()[$ns] as 
$title => $pageid ) {
+   if ( array_key_exists( $ns, 
$parserOutput->getTemplates() ) ) {
+   foreach ( $parserOutput->getTemplates()[$ns] as 
$title => $pageid ) {
$pages[$pageid] = $title;
}
}
@@ -43,7 +59,10 @@
 
if ( count( $pages ) ) {
$db = wfGetDB( DB_SLAVE );
-   $res = $db->select( 'page_props', [ 'pp_page', 
'pp_value' ], [
+   $res = $db->select(
+   'page_props',
+   [ 'pp_page', 'pp_value' ],
+   [
'pp_page' => array_keys( $pages ),
'pp_propname' => 'templatestyles'
],
@@ -59,7 +78,7 @@
 
}
 
-   $selfcss = $parseroutput->getProperty( 'templatestyles' );
+   $selfcss = $parserOutput->getProperty( 'templatestyles' );
if ( $selfcss ) {
  

[MediaWiki-commits] [Gerrit] mediawiki...TemplateStyles[master]: Few style tweaks

2016-10-30 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

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

Change subject: Few style tweaks
..

Few style tweaks

Parameter documentation type hints

Remove unused RL module

Change-Id: I6e265c97eababa4bbfebb9402141664ad24b4e43
---
M CSSParser.php
M CSSRenderer.php
M TemplateStyles.hooks.php
M extension.json
4 files changed, 32 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TemplateStyles 
refs/changes/61/318861/1

diff --git a/CSSParser.php b/CSSParser.php
index 2e7bcb9..6631c23 100644
--- a/CSSParser.php
+++ b/CSSParser.php
@@ -51,7 +51,10 @@
(?# Unicode mask literals )
| .
(?# Any unmatched token is reduced to single 
characters )
-   )/xis', $css, $match );
+   )/xis',
+   $css,
+   $match
+   );
 
$inWhitespaceRun = false;
foreach ( $match[0] as $token ) {
diff --git a/CSSRenderer.php b/CSSRenderer.php
index 40d7614..e01e3f0 100644
--- a/CSSRenderer.php
+++ b/CSSRenderer.php
@@ -34,13 +34,15 @@
case '@media':
if ( $media == '' ) {
$this->add(
-   $rule['rules'], "@media 
{$rule['text']}"
+   $rule['rules'],
+   "@media {$rule['text']}"
);
}
break;
case '':
$this->byMedia[$media] = array_merge(
-   $this->byMedia[$media], 
$rule['rules']
+   $this->byMedia[$media],
+   $rule['rules']
);
break;
}
diff --git a/TemplateStyles.hooks.php b/TemplateStyles.hooks.php
index ccb0c4a..dc115b4 100644
--- a/TemplateStyles.hooks.php
+++ b/TemplateStyles.hooks.php
@@ -1,4 +1,5 @@
 setHook( 'templatestyles', 
'TemplateStylesHooks::render' );
return true;
}
 
+   /**
+* @param string $blob
+* @return string
+*/
private static function decodeFromBlob( $blob ) {
$tree = gzdecode( $blob );
if ( $tree ) {
@@ -23,19 +30,26 @@
return $tree;
}
 
+   /**
+* @param string $tree
+* @return string
+*/
private static function encodeToBlob( $tree ) {
return gzencode( serialize( $tree ) );
}
 
-   public static function onOutputPageParserOutput( &$out, $parseroutput ) 
{
-
-   $config = ConfigFactory::getDefaultInstance()->makeConfig( 
'templatestyles' );
+   /**
+* @param OutputPage $out
+* @param ParserOutput $parserOutput
+*/
+   public static function onOutputPageParserOutput( &$out, $parserOutput ) 
{
+   $config = 
\MediaWiki\MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 
'templatestyles' );
$renderer = new CSSRenderer();
$pages = [];
 
foreach ( self::getConfigArray( $config, 'Namespaces' ) as $ns 
) {
-   if ( array_key_exists( $ns, 
$parseroutput->getTemplates() ) ) {
-   foreach ( $parseroutput->getTemplates()[$ns] as 
$title => $pageid ) {
+   if ( array_key_exists( $ns, 
$parserOutput->getTemplates() ) ) {
+   foreach ( $parserOutput->getTemplates()[$ns] as 
$title => $pageid ) {
$pages[$pageid] = $title;
}
}
@@ -43,7 +57,10 @@
 
if ( count( $pages ) ) {
$db = wfGetDB( DB_SLAVE );
-   $res = $db->select( 'page_props', [ 'pp_page', 
'pp_value' ], [
+   $res = $db->select(
+   'page_props',
+   [ 'pp_page', 'pp_value' ],
+   [
'pp_page' => array_keys( $pages ),
'pp_propname' => 'templatestyles'
],
@@ -59,7 +76,7 @@
 
}
 
-   $selfcss = $parseroutput->getProperty( 'templatestyles' );
+   $selfcss = $parserOutput->getProperty( 'templatestyles' );
if ( $selfcss ) {

[MediaWiki-commits] [Gerrit] mediawiki...JsonConfig[master]: Removed unused assoc data parsing

2016-10-30 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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

Change subject: Removed unused assoc data parsing
..

Removed unused assoc data parsing

Change-Id: I5682c074bc72f87aa4d003b1b1d84577df3cd5ac
---
M includes/JCContent.php
1 file changed, 4 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/JsonConfig 
refs/changes/60/318860/1

diff --git a/includes/JCContent.php b/includes/JCContent.php
index 9257b49..276188b 100644
--- a/includes/JCContent.php
+++ b/includes/JCContent.php
@@ -25,8 +25,6 @@
private $status;
/** @var bool */
private $thorough;
-   /** If false, JSON parsing will use stdClass instead of array for 
"{...}" */
-   protected $useAssocParsing = false;
/** @var JCContentView|null contains an instance of the view class */
private $view = null;
 
@@ -119,23 +117,16 @@
private function parse() {
$rawText = $this->getNativeData();
$parseOpts = FormatJson::STRIP_COMMENTS + 
FormatJson::TRY_FIXING;
-   if ( $this->useAssocParsing ) {
-   $parseOpts += FormatJson::FORCE_ASSOC;
-   }
$status = FormatJson::parse( $rawText, $parseOpts );
if ( !$status->isOK() ) {
$this->status = $status;
return;
}
$data = $status->getValue();
-   if ( !$this->useAssocParsing ) {
-   // @fixme: HACK - need a deep clone of the data
-   // @fixme: but doing (object)(array)$data will 
re-encode empty [] as {}
-   // @performance: re-encoding is likely faster than 
stripping comments in PHP twice
-   $this->rawData = FormatJson::decode( 
FormatJson::encode( $data, FormatJson::ALL_OK ), true );
-   } else {
-   $this->rawData = $data;
-   }
+   // @fixme: HACK - need a deep clone of the data
+   // @fixme: but doing (object)(array)$data will re-encode empty 
[] as {}
+   // @performance: re-encoding is likely faster than stripping 
comments in PHP twice
+   $this->rawData = FormatJson::decode( FormatJson::encode( $data, 
FormatJson::ALL_OK ), true );
$this->data = $this->validate( $data );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5682c074bc72f87aa4d003b1b1d84577df3cd5ac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/JsonConfig
Gerrit-Branch: master
Gerrit-Owner: Yurik 

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


[MediaWiki-commits] [Gerrit] operations...mariadb[master]: Add $managed flag to mariadb::service

2016-10-30 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

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

Change subject: Add $managed flag to mariadb::service
..

Add $managed flag to mariadb::service

Change-Id: Ifed506176001c9cd9eb7f7b55bfea9f836aac6ec
---
M manifests/service.pp
1 file changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet/mariadb 
refs/changes/59/318859/1

diff --git a/manifests/service.pp b/manifests/service.pp
index 1015d21..ac2b851 100644
--- a/manifests/service.pp
+++ b/manifests/service.pp
@@ -3,8 +3,14 @@
 # package
 # Once all trusty dbs are gone, we can hopefully discard init.d in favour
 # of a custom systemd service unit
+#
+# Default behavior is for the service to be unmanaged and manually 
started/stoppped.
+# With $manage = true this class will set $ensure and $enabled as specified.
 class mariadb::service (
 $package = 'wmf-mariadb10',
+$manage  = false,
+$ensure  = stopped,
+$enable  = false,
 ) {
 
 $basedir = "/opt/${package}"
@@ -29,5 +35,13 @@
 require => File["${basedir}/service"],
 }
 
+if $manage {
+service { 'mysql':
+ensure  => $ensure,
+enable  => $enable,
+require => File['/etc/init.d/mysql'],
+}
+}
+
 # MySQL DOES NOT START BY DEFAULT- do not register it automatically
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifed506176001c9cd9eb7f7b55bfea9f836aac6ec
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet/mariadb
Gerrit-Branch: master
Gerrit-Owner: Andrew Bogott 

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


[MediaWiki-commits] [Gerrit] mediawiki...ExternalData[master]: Fix for xml_set_character_data_handler() behavior

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

Change subject: Fix for xml_set_character_data_handler() behavior
..


Fix for xml_set_character_data_handler() behavior

Change-Id: I1d26ea464409101c1a78168f25516a3ddca54b69
---
M ED_Utils.php
1 file changed, 17 insertions(+), 8 deletions(-)

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



diff --git a/ED_Utils.php b/ED_Utils.php
index be0f341..3515b3d 100644
--- a/ED_Utils.php
+++ b/ED_Utils.php
@@ -21,9 +21,10 @@
// XML-handling functions based on code found at
// http://us.php.net/xml_set_element_handler
static function startElement( $parser, $name, $attrs ) {
-   global $edgCurrentXMLTag, $edgXMLValues;
+   global $edgCurrentXMLTag, $edgCurrentValue, $edgXMLValues;
// set to all lowercase to avoid casing issues
$edgCurrentXMLTag = strtolower( $name );
+   $edgCurrentValue = '';
foreach ( $attrs as $attr => $value ) {
$attr = strtolower( $attr );
$value = str_replace( self::$ampersandReplacement, 
'&', $value );
@@ -36,12 +37,23 @@
}
 
static function endElement( $parser, $name ) {
-   global $edgCurrentXMLTag;
-   $edgCurrentXMLTag = "";
+   global $edgCurrentXMLTag, $edgCurrentValue, $edgXMLValues;
+
+   if ( array_key_exists( $edgCurrentXMLTag, $edgXMLValues ) ) {
+   $edgXMLValues[$edgCurrentXMLTag][] = $edgCurrentValue;
+   } else {
+   $edgXMLValues[$edgCurrentXMLTag] = array( 
$edgCurrentValue );
+   }
}
 
+   /**
+* Due to the strange way xml_set_character_data_handler() runs,
+* getContent() may get called multiple times, once for each fragment
+* of the text, for very long XML values. Given that, we keep a global
+* variable with the current value and add to it.
+*/
static function getContent( $parser, $content ) {
-   global $edgCurrentXMLTag, $edgXMLValues;
+   global $edgCurrentXMLTag;
 
// Replace ampersands, to avoid the XML getting split up
// around them.
@@ -49,10 +61,7 @@
// this is unrelated to the fact that bare ampersands aren't
// allowed in XML.
$content = str_replace( self::$ampersandReplacement, '&', 
$content );
-   if ( array_key_exists( $edgCurrentXMLTag, $edgXMLValues ) )
-   $edgXMLValues[$edgCurrentXMLTag][] = $content;
-   else
-   $edgXMLValues[$edgCurrentXMLTag] = array( $content );
+   $edgCurrentValue .= $content;
}
 
static function parseParams( $params ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1d26ea464409101c1a78168f25516a3ddca54b69
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ExternalData
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
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...ExternalData[master]: Fix for xml_set_character_data_handler() behavior

2016-10-30 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review.

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

Change subject: Fix for xml_set_character_data_handler() behavior
..

Fix for xml_set_character_data_handler() behavior

Change-Id: I1d26ea464409101c1a78168f25516a3ddca54b69
---
M ED_Utils.php
1 file changed, 17 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ExternalData 
refs/changes/02/318802/2

diff --git a/ED_Utils.php b/ED_Utils.php
index be0f341..3515b3d 100644
--- a/ED_Utils.php
+++ b/ED_Utils.php
@@ -21,9 +21,10 @@
// XML-handling functions based on code found at
// http://us.php.net/xml_set_element_handler
static function startElement( $parser, $name, $attrs ) {
-   global $edgCurrentXMLTag, $edgXMLValues;
+   global $edgCurrentXMLTag, $edgCurrentValue, $edgXMLValues;
// set to all lowercase to avoid casing issues
$edgCurrentXMLTag = strtolower( $name );
+   $edgCurrentValue = '';
foreach ( $attrs as $attr => $value ) {
$attr = strtolower( $attr );
$value = str_replace( self::$ampersandReplacement, 
'&', $value );
@@ -36,12 +37,23 @@
}
 
static function endElement( $parser, $name ) {
-   global $edgCurrentXMLTag;
-   $edgCurrentXMLTag = "";
+   global $edgCurrentXMLTag, $edgCurrentValue, $edgXMLValues;
+
+   if ( array_key_exists( $edgCurrentXMLTag, $edgXMLValues ) ) {
+   $edgXMLValues[$edgCurrentXMLTag][] = $edgCurrentValue;
+   } else {
+   $edgXMLValues[$edgCurrentXMLTag] = array( 
$edgCurrentValue );
+   }
}
 
+   /**
+* Due to the strange way xml_set_character_data_handler() runs,
+* getContent() may get called multiple times, once for each fragment
+* of the text, for very long XML values. Given that, we keep a global
+* variable with the current value and add to it.
+*/
static function getContent( $parser, $content ) {
-   global $edgCurrentXMLTag, $edgXMLValues;
+   global $edgCurrentXMLTag;
 
// Replace ampersands, to avoid the XML getting split up
// around them.
@@ -49,10 +61,7 @@
// this is unrelated to the fact that bare ampersands aren't
// allowed in XML.
$content = str_replace( self::$ampersandReplacement, '&', 
$content );
-   if ( array_key_exists( $edgCurrentXMLTag, $edgXMLValues ) )
-   $edgXMLValues[$edgCurrentXMLTag][] = $content;
-   else
-   $edgXMLValues[$edgCurrentXMLTag] = array( $content );
+   $edgCurrentValue .= $content;
}
 
static function parseParams( $params ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d26ea464409101c1a78168f25516a3ddca54b69
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ExternalData
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Differentiate tracking categories by namespace

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

Change subject: Differentiate tracking categories by namespace
..


Differentiate tracking categories by namespace

While this was in principle supported before, add an
explicit check for ParserFunctions presence to avoid logspam.
Differentiate by file/page so far, will require more fixups via
WikimediaMessages to highlight content namespaces/use "articles"
on Wikipedia.

Bug: T147575
Change-Id: I1ecec8ed14c6a9d6f38ec6e7447ab13cfa803076
---
M i18n/en.json
M includes/Tag/TagHandler.php
2 files changed, 25 insertions(+), 4 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 214de08..04d61d9 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -17,7 +17,7 @@
"kartographer-attribution": "Wikimedia maps | Map data © 
[https://www.openstreetmap.org/copyright OpenStreetMap contributors]",
"kartographer-attribution-externaldata": "$1: $2",
"kartographer-attribution-externaldata-query": "query",
-   "kartographer-broken-category": "Pages with broken maps",
+   "kartographer-broken-category": 
"{{#switch:{{NAMESPACE}}|{{ns:File}}=Files|#default=Pages}} with broken maps",
"kartographer-broken-category-desc": "The page includes an invalid map 
usage",
"kartographer-desc": "Allows maps to be added to the wiki pages",
"kartographer-error-context": "<$1>: $2",
@@ -28,7 +28,7 @@
"kartographer-error-bad_data": "The JSON content is not valid 
GeoJSON+simplestyle",
"kartographer-error-latlon": "Either both \"latitude\" and 
\"longitude\" parameters should be supplied or neither of them",
"kartographer-error-service-name": "Invalid cartographic service 
\"$1\"",
-   "kartographer-tracking-category": "Pages with maps",
+   "kartographer-tracking-category": 
"{{#switch:{{NAMESPACE}}|{{ns:File}}=Files|#default=Pages}} with maps",
"kartographer-tracking-category-desc": "The page includes a map",
"kartographer-coord-combined": "$1 $2",
"kartographer-coord-dms": "$1°$2′$3″",
diff --git a/includes/Tag/TagHandler.php b/includes/Tag/TagHandler.php
index 6996a41..3b75e79 100644
--- a/includes/Tag/TagHandler.php
+++ b/includes/Tag/TagHandler.php
@@ -10,6 +10,7 @@
 namespace Kartographer\Tag;
 
 use Exception;
+use ExtensionRegistry;
 use FormatJson;
 use Html;
 use Kartographer\SimpleStyleParser;
@@ -295,10 +296,10 @@
}
 
if ( $state->hasBrokenTags() ) {
-   $output->addTrackingCategory( 
'kartographer-broken-category', $parser->getTitle() );
+   self::addTrackingCategory( $parser, 
'kartographer-broken-category' );
}
if ( $state->hasValidTags() ) {
-   $output->addTrackingCategory( 
'kartographer-tracking-category', $parser->getTitle() );
+   self::addTrackingCategory( $parser, 
'kartographer-tracking-category' );
}
 
// https://phabricator.wikimedia.org/T145615 - include all data 
in previews
@@ -328,6 +329,26 @@
}
 
/**
+* Adds tracking category with extra checks
+*
+* @param Parser $parser
+* @param string $categoryMsg
+*/
+   private static function addTrackingCategory( Parser $parser, 
$categoryMsg ) {
+   static $hasParserFunctions;
+
+   // Our tracking categories rely on ParserFunctions to 
differentiate per namespace,
+   // avoid log noise if it's not installed
+   if ( $hasParserFunctions === null ) {
+   $hasParserFunctions = 
ExtensionRegistry::getInstance()->isLoaded( 'ParserFunctions' );
+   }
+
+   if ( $hasParserFunctions ) {
+   $parser->getOutput()->addTrackingCategory( 
$categoryMsg, $parser->getTitle() );
+   }
+   }
+
+   /**
 * @return string
 * @throws Exception
 */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1ecec8ed14c6a9d6f38ec6e7447ab13cfa803076
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: Yurik 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for b3b936dc38d2 - restore backwards compatibility

2016-10-30 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged.

Change subject: Fix for b3b936dc38d2 - restore backwards compatibility
..


Fix for b3b936dc38d2 - restore backwards compatibility

Change-Id: I0c4c21ac6f967d5ee74d0e58006ea3a632017a0d
---
M CargoUtils.php
1 file changed, 7 insertions(+), 2 deletions(-)

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



diff --git a/CargoUtils.php b/CargoUtils.php
index bd4606e..4eab451 100644
--- a/CargoUtils.php
+++ b/CargoUtils.php
@@ -19,7 +19,7 @@
 * @global string $wgCargoDBuser
 * @global string $wgCargoDBpassword
 * @global string $wgCargoDBtype
-* @return Database
+* @return Database or DatabaseBase
 */
public static function getDB() {
if ( self::$CargoDB != null && self::$CargoDB->isOpen() ) {
@@ -53,7 +53,12 @@
'tablePrefix' => $dbTablePrefix,
];
 
-   self::$CargoDB = Database::factory( $wgCargoDBtype, $params );
+   if ( class_exists( 'Database' ) ) {
+   // MW 1.27+
+   self::$CargoDB = Database::factory( $wgCargoDBtype, 
$params );
+   } else {
+   self::$CargoDB = DatabaseBase::factory( $wgCargoDBtype, 
$params );
+   }
return self::$CargoDB;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0c4c21ac6f967d5ee74d0e58006ea3a632017a0d
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
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]: Replace language code 'bat-smg' by 'sgs' in tests

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

Change subject: Replace language code 'bat-smg' by 'sgs' in tests
..


Replace language code 'bat-smg' by 'sgs' in tests

'bat-smg' is a deprecated language code and replaced by 'sgs'.

This change is needed for change I080c5c736acd70ac12062b6067d3ae8c16fdf413 in
core.

Change-Id: Ib0c1305226078906eac6683a6fabb02bea17765e
---
M repo/tests/phpunit/includes/Api/ModifyTermTestCase.php
1 file changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/repo/tests/phpunit/includes/Api/ModifyTermTestCase.php 
b/repo/tests/phpunit/includes/Api/ModifyTermTestCase.php
index 85aaf9e..09e7cd7 100644
--- a/repo/tests/phpunit/includes/Api/ModifyTermTestCase.php
+++ b/repo/tests/phpunit/includes/Api/ModifyTermTestCase.php
@@ -46,13 +46,13 @@
'p' => array( 'language' => 'en', 'value' => 
'Different Value' ),
'e' => array( 'value' => array( 'en' => 
'Different Value' ) ) ),
array( //5
-   'p' => array( 'language' => 'bat-smg', 'value' 
=> 'V?sata' ),
-   'e' => array( 'value' => array( 'bat-smg' => 
'V?sata','en' => 'Different Value' ) ) ),
+   'p' => array( 'language' => 'sgs', 'value' => 
'V?sata' ),
+   'e' => array( 'value' => array( 'sgs' => 
'V?sata','en' => 'Different Value' ) ) ),
array( //6
'p' => array( 'language' => 'en', 'value' => '' 
),
-   'e' => array( 'value' => array( 'bat-smg' => 
'V?sata' ) ) ),
+   'e' => array( 'value' => array( 'sgs' => 
'V?sata' ) ) ),
array( //7
-   'p' => array( 'language' => 'bat-smg', 'value' 
=> '' ),
+   'p' => array( 'language' => 'sgs', 'value' => 
'' ),
'e' => array() ),
array( //8
'p' => array( 'language' => 'en', 'value' => "  
x\nx  " ),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib0c1305226078906eac6683a6fabb02bea17765e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Fomafix 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Hoo man 
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...PageTriage[master]: Restrict noindex template feature to new articles

2016-10-30 Thread Kaldari (Code Review)
Kaldari has uploaded a new change for review.

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

Change subject: Restrict noindex template feature to new articles
..

Restrict noindex template feature to new articles

This change restricts the noindex template feature to articles
that are less than $wgRCMaxAge old.

Bug: T149538
Change-Id: I0f3ee84a73fbf8c4e28cbfeb1a5c437c2258ce30
---
M PageTriage.hooks.php
1 file changed, 41 insertions(+), 26 deletions(-)


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

diff --git a/PageTriage.hooks.php b/PageTriage.hooks.php
index 1684b59..6549479 100644
--- a/PageTriage.hooks.php
+++ b/PageTriage.hooks.php
@@ -254,18 +254,19 @@
/**
 * Determines whether to set noindex for the article specified
 *
-* Returns true if the page includes a template that triggers 
noindexing or
-* all of the following are true:
-* 1. $wgPageTriageNoIndexUnreviewedNewArticles is true
-* 2. The page is in triage queue and has not been triaged
-* 3. The page is younger than the maximum age for "new pages"
+* Returns true if both of the following are true:
+*   1. The page includes a template that triggers noindexing
+*   2. The page is younger than the maximum age for "new pages"
+* or all of the following are true:
+*   1. $wgPageTriageNoIndexUnreviewedNewArticles is true
+*   2. The page is in triage queue and has not been triaged
+*   3. The page is younger than the maximum age for "new pages"
 *
 * @param $article Article
 * @return bool
 */
private static function shouldShowNoIndex( $article ) {
-   global $wgPageTriageNoIndexUnreviewedNewArticles, $wgRCMaxAge,
-   $wgPageTriageNoIndexTemplates;
+   global $wgPageTriageNoIndexUnreviewedNewArticles, 
$wgPageTriageNoIndexTemplates;
 
// See if article includes any templates that should trigger 
noindexing
if ( $wgPageTriageNoIndexTemplates && $article->mParserOutput 
instanceof ParserOutput ) {
@@ -283,38 +284,52 @@
[];
 
foreach ( $templates as $template => $pageId ) {
-   if ( in_array( $template, $noIndexTemplates ) ) 
{
+   // The noindex template feature is restricted 
to new articles to
+   // minimize the potential for abuse.
+   if ( in_array( $template, $noIndexTemplates ) 
&& self::isArticleNew( $article ) ) {
return true;
}
}
}
 
if ( $wgPageTriageNoIndexUnreviewedNewArticles &&
-   PageTriageUtil::doesPageNeedTriage( $article )
+   PageTriageUtil::doesPageNeedTriage( $article ) &&
+   self::isArticleNew( $article )
) {
+   return true;
+   }
 
-   $pageId = $article->getId();
+   return false;
+   }
 
-   // Get timestamp for article creation (typically from 
cache)
-   $metaDataObject = new ArticleMetadata( [ $pageId ] );
-   $metaData = $metaDataObject->getMetadata();
-   $pageCreationDateTime = $metaData[ $pageId ][ 
'creation_date' ];
+   /**
+* Checks to see if an article is new, i.e. less than $wgRCMaxAge
+* @param Article $article Article to check
+* @return bool
+*/
+   private static function isArticleNew( $article ) {
+   global $wgRCMaxAge;
 
-   if ( $pageCreationDateTime ) {
+   $pageId = $article->getId();
 
-   // Get the age of the article in days
-   $timestamp = new MWTimestamp( 
$pageCreationDateTime );
-   $dateInterval = $timestamp->diff( new 
MWTimestamp() );
-   $articleDaysOld = $dateInterval->format( '%a' );
+   // Get timestamp for article creation (typically from cache)
+   $metaDataObject = new ArticleMetadata( [ $pageId ] );
+   $metaData = $metaDataObject->getMetadata();
+   $pageCreationDateTime = $metaData[ $pageId ][ 'creation_date' ];
 
-   // If it's younger than the maximum age, return 
true.
-   // We use $wgRCMaxAge here since this 
determines which articles are
-   // considered "new", i.e. shown at 
Special:NewPages, and which articles
-   // are eligible to be patrolled.
-   

[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for b3b936dc38d2 - restore backwards compatibility

2016-10-30 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review.

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

Change subject: Fix for b3b936dc38d2 - restore backwards compatibility
..

Fix for b3b936dc38d2 - restore backwards compatibility

Change-Id: I0c4c21ac6f967d5ee74d0e58006ea3a632017a0d
---
M CargoUtils.php
1 file changed, 7 insertions(+), 2 deletions(-)


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

diff --git a/CargoUtils.php b/CargoUtils.php
index bd4606e..c59ddb5 100644
--- a/CargoUtils.php
+++ b/CargoUtils.php
@@ -19,7 +19,7 @@
 * @global string $wgCargoDBuser
 * @global string $wgCargoDBpassword
 * @global string $wgCargoDBtype
-* @return Database
+* @return Database or DatabaseBase
 */
public static function getDB() {
if ( self::$CargoDB != null && self::$CargoDB->isOpen() ) {
@@ -53,7 +53,12 @@
'tablePrefix' => $dbTablePrefix,
];
 
-   self::$CargoDB = Database::factory( $wgCargoDBtype, $params );
+   if ( class_exists( 'Database' ) ) {
+   // MW 1.27+
+   self::$CargoDB = Database::factory( $wgCargoDBtype, 
$params );
+   } else {
+   self::$CargoDB = DatabaseBase::factory( $wgCargoDBtype, 
$params );
++  }
return self::$CargoDB;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c4c21ac6f967d5ee74d0e58006ea3a632017a0d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
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...ApprovedRevs[master]: Move SpecialApprovedRevsPage to it's own file

2016-10-30 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged.

Change subject: Move SpecialApprovedRevsPage to it's own file
..


Move SpecialApprovedRevsPage to it's own file

Change-Id: Ifd875a5dc65ea707a330189208b10b6ffa762859
---
M ApprovedRevs.php
M SpecialApprovedRevs.php
A SpecialApprovedRevsPage.php
3 files changed, 269 insertions(+), 261 deletions(-)

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



diff --git a/ApprovedRevs.php b/ApprovedRevs.php
index ed4be3a..58fbc36 100644
--- a/ApprovedRevs.php
+++ b/ApprovedRevs.php
@@ -41,7 +41,7 @@
 $wgAutoloadClasses['ApprovedRevsHooks'] = $egApprovedRevsIP . 
'ApprovedRevs.hooks.php';
 $wgSpecialPages['ApprovedRevs'] = 'SpecialApprovedRevs';
 $wgAutoloadClasses['SpecialApprovedRevs'] = $egApprovedRevsIP . 
'SpecialApprovedRevs.php';
-$wgAutoloadClasses['SpecialApprovedRevsPage'] = $egApprovedRevsIP . 
'SpecialApprovedRevs.php';
+$wgAutoloadClasses['SpecialApprovedRevsPage'] = $egApprovedRevsIP . 
'SpecialApprovedRevsPage.php';
 
 // hooks
 $wgHooks['ArticleEditUpdates'][] = 'ApprovedRevsHooks::updateLinksAfterEdit';
diff --git a/SpecialApprovedRevs.php b/SpecialApprovedRevs.php
index 6605743..b542d6a 100644
--- a/SpecialApprovedRevs.php
+++ b/SpecialApprovedRevs.php
@@ -37,263 +37,3 @@
}
 }
 
-class SpecialApprovedRevsPage extends QueryPage {
-
-   protected $mMode;
-
-   public function __construct( $mode ) {
-   if ( $this instanceof SpecialPage ) {
-   parent::__construct( 'ApprovedRevs' );
-   }
-   $this->mMode = $mode;
-   }
-
-   function getName() {
-   return 'ApprovedRevs';
-   }
-
-   function isExpensive() { return false; }
-
-   function isSyndicated() { return false; }
-
-   function getPageHeader() {
-   // show the names of the three lists of pages, with the one
-   // corresponding to the current "mode" not being linked
-   $approvedPagesTitle = SpecialPage::getTitleFor( 'ApprovedRevs' 
);
-   $navLine = wfMessage( 'approvedrevs-view' )->parse() . ' ';
-
-   if ( $this->mMode == '' ) {
-   $navLine .= Xml::element( 'strong',
-   null,
-   wfMessage( 'approvedrevs-approvedpages' 
)->text()
-   );
-   } else {
-   $navLine .= Xml::element( 'a',
-   array( 'href' => 
$approvedPagesTitle->getLocalURL() ),
-   wfMessage( 'approvedrevs-approvedpages' 
)->text()
-   );
-   }
-
-   $navLine .= ' | ';
-
-   if ( $this->mMode == 'notlatest' ) {
-   $navLine .= Xml::element( 'strong',
-   null,
-   wfMessage( 'approvedrevs-notlatestpages' 
)->text()
-   );
-   } else {
-   $navLine .= Xml::element( 'a',
-   array( 'href' => 
$approvedPagesTitle->getLocalURL( array( 'show' => 'notlatest' ) ) ),
-   wfMessage( 'approvedrevs-notlatestpages' 
)->text()
-   );
-   }
-
-   $navLine .= ' | ';
-
-   if ( $this->mMode == 'unapproved' ) {
-   $navLine .= Xml::element( 'strong',
-   null,
-   wfMessage( 'approvedrevs-unapprovedpages' 
)->text()
-   );
-   } else {
-   $navLine .= Xml::element( 'a',
-   array( 'href' => 
$approvedPagesTitle->getLocalURL( array( 'show' => 'unapproved' ) ) ),
-   wfMessage( 'approvedrevs-unapprovedpages' 
)->text()
-   );
-   }
-
-   return Xml::tags( 'p', null, $navLine ) . "\n";
-   }
-
-   /**
-* Set parameters for standard navigation links.
-*/
-   function linkParameters() {
-   $params = array();
-
-   if ( $this->mMode == 'notlatest' ) {
-   $params['show'] = 'notlatest';
-   } elseif ( $this->mMode == 'unapproved' ) {
-   $params['show'] = 'unapproved';
-   } else { // all approved pages
-   }
-
-   return $params;
-   }
-
-   function getPageFooter() {
-   }
-
-   public static function getNsConditionPart( $ns ) {
-   return 'p.page_namespace = ' . $ns;
-   }
-
-   /**
-* (non-PHPdoc)
-* @see QueryPage::getSQL()
-*/
-   function getQueryInfo() {
-   global $egApprovedRevsNamespaces;
-
-   $mainCondsString = "( pp_propname = 'approvedrevs' AND pp

[MediaWiki-commits] [Gerrit] mediawiki...ApprovedRevs[master]: Register SpecialApprovedRevsPage as a query page to expose v...

2016-10-30 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged.

Change subject: Register SpecialApprovedRevsPage as a query page to expose via 
API et al
..


Register SpecialApprovedRevsPage as a query page to expose via API et al

Bug: T149480
Change-Id: I5103d34b4378b2aa4ccee37ba574593b0dd60d53
---
M ApprovedRevs.hooks.php
M ApprovedRevs.php
2 files changed, 13 insertions(+), 4 deletions(-)

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



diff --git a/ApprovedRevs.hooks.php b/ApprovedRevs.hooks.php
index c24ecf3..09fd2b8 100644
--- a/ApprovedRevs.hooks.php
+++ b/ApprovedRevs.hooks.php
@@ -256,7 +256,7 @@
 */
static function setOldSubtitle( $article, $revisionID ) {
$title = $article->getTitle(); # Added for ApprovedRevs - and 
removed hook
-   
+
$unhide = $article->getContext()->getRequest()->getInt( 
'unhide' ) == 1;
 
// Cascade unhide param in links for easy deletion browsing.
@@ -365,7 +365,7 @@
'oldid' => $revisionID
) + $extraParams
);
-   
+
// Added for Approved Revs
$approved = ( $approvedID != null && $revisionID == $approvedID 
);
$approvedlink = $approved
@@ -871,7 +871,7 @@
if ( !$egApprovedRevsShowNotApprovedMessage) {
return true;
}
- 
+
$title = $article->getTitle();
if ( ! ApprovedRevs::pageIsApprovable( $title ) ) {
return true;
@@ -886,8 +886,16 @@
$wgOut->setSubtitle( $text );
}
}
- 
+
return true;
}
 
+   /**
+* @param $qp array
+* @return bool true
+*/
+   public static function onwgQueryPages( &$qp ) {
+   $qp['SpecialApprovedRevsPage'] = 'ApprovedRevs';
+   return true;
+   }
 }
diff --git a/ApprovedRevs.php b/ApprovedRevs.php
index b863bc8..ed4be3a 100644
--- a/ApprovedRevs.php
+++ b/ApprovedRevs.php
@@ -72,6 +72,7 @@
 $wgHooks['sfHTMLBeforeForm'][] = 'ApprovedRevsHooks::addWarningToSFForm';
 $wgHooks['ArticleViewHeader'][] = 'ApprovedRevsHooks::setArticleHeader';
 $wgHooks['ArticleViewHeader'][] = 
'ApprovedRevsHooks::displayNotApprovedHeader';
+$wgHooks['wgQueryPages'][] = 'ApprovedRevsHooks::onwgQueryPages';
 
 // logging
 $wgLogTypes['approval'] = 'approval';

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5103d34b4378b2aa4ccee37ba574593b0dd60d53
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ApprovedRevs
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Yaron Koren 
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...WikibaseJavaScriptApi[master]: Forward error message parameters in RepoApiError

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

Change subject: Forward error message parameters in RepoApiError
..


Forward error message parameters in RepoApiError

Required for I99d8d79.

Change-Id: I044a28c863758a39b92f473a76813c0ff027b1bd
---
M src/RepoApiError.js
M tests/RepoApiError.tests.js
2 files changed, 18 insertions(+), 7 deletions(-)

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



diff --git a/src/RepoApiError.js b/src/RepoApiError.js
index bea0256..6c5d447 100644
--- a/src/RepoApiError.js
+++ b/src/RepoApiError.js
@@ -16,18 +16,24 @@
  *
  * @param {string} code Error code (used to determine the actual error 
message).
  * @param {string} detailedMessage HTML
+ * @param {string[]} [parameters]
  * @param {string} [action] Generic API action (e.g. "save" or "cancel") used 
to determine a
  *specific message.
  */
 var SELF = MODULE.RepoApiError
-   = util.inherit( 'WbRepoApiError', PARENT, function( code, 
detailedMessage, action ) {
+   = util.inherit( 'WbRepoApiError', PARENT, function(
+   code,
+   detailedMessage,
+   parameters,
+   action
+   ) {
this.code = code;
this.detailedMessage = detailedMessage;
this.action = action;
 
// native Error attributes
this.name = 'Wikibase Repo API Error';
-   this.message = this.getMessage();
+   this.message = this.getMessage( parameters );
},
 {
/**
@@ -53,9 +59,10 @@
/**
 * Returns a short message string.
 *
+* @param {string[]} [parameters]
 * @return {string}
 */
-   getMessage: function() {
+   getMessage: function( parameters ) {
var msgKey = this.API_ERROR_MESSAGE[this.code];
 
if ( !msgKey || typeof msgKey !== 'string' ) {
@@ -68,7 +75,7 @@
}
}
 
-   return mw.msg( msgKey );
+   return mw.msg.apply( mw.msg, [ msgKey ].concat( parameters || 
[] ) );
}
 
 } );
@@ -84,12 +91,16 @@
  */
 SELF.newFromApiResponse = function( details, apiAction ) {
var errorCode = '',
+   parameters = [],
detailedMessage = '';
 
if ( details.error ) {
errorCode = details.error.code;
if ( details.error.messages ) {
-   // HTML message from Wikibase API.
+   // HTML message in a format only Wikibase supports, see 
ApiErrorReporter. The data
+   // structure supports multiple messages, but this is 
not relevant in the cases
+   // API_ERROR_MESSAGE supports. Assume the first message 
parameters are compatible.
+   parameters = details.error.messages[0] && 
details.error.messages[0].parameters;
detailedMessage = messagesObjectToHtml( 
details.error.messages );
} else if ( details.error.info ) {
// Wikibase API no-HTML error message fall-back.
@@ -101,7 +112,7 @@
detailedMessage = mw.html.escape( String( details.exception ) );
}
 
-   return new SELF( errorCode, detailedMessage, apiAction );
+   return new SELF( errorCode, detailedMessage, parameters, apiAction );
 };
 
 /**
diff --git a/tests/RepoApiError.tests.js b/tests/RepoApiError.tests.js
index d0f9840..5a2445a 100644
--- a/tests/RepoApiError.tests.js
+++ b/tests/RepoApiError.tests.js
@@ -30,7 +30,7 @@
'Unknown error code: Used default generic error 
message.'
);
 
-   error = new wb.api.RepoApiError( 'timeout', 'detailed message', 
'remove' );
+   error = new wb.api.RepoApiError( 'timeout', 'detailed message', 
[], 'remove' );
 
assert.equal(
error.message,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I044a28c863758a39b92f473a76813c0ff027b1bd
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/WikibaseJavaScriptApi
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: WMDE-jand 
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...WikibaseLexeme[master]: Add LexemeSerializer and LexemeDeserializer

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

Change subject: Add LexemeSerializer and LexemeDeserializer
..


Add LexemeSerializer and LexemeDeserializer

Bug: T148731
Change-Id: If2496ab968b9ad7b842ce57613759bcfe4a48277
---
M src/DataModel/Serialization/LexemeDeserializer.php
M src/DataModel/Serialization/LexemeSerializer.php
A tests/phpunit/composer/DataModel/Serialization/LexemeDeserializerTest.php
A tests/phpunit/composer/DataModel/Serialization/LexemeSerializerTest.php
4 files changed, 417 insertions(+), 8 deletions(-)

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



diff --git a/src/DataModel/Serialization/LexemeDeserializer.php 
b/src/DataModel/Serialization/LexemeDeserializer.php
index 4ac7f0d..bfdf2ab 100644
--- a/src/DataModel/Serialization/LexemeDeserializer.php
+++ b/src/DataModel/Serialization/LexemeDeserializer.php
@@ -2,15 +2,73 @@
 
 namespace Wikibase\Lexeme\DataModel\Serialization;
 
-use Deserializers\DispatchableDeserializer;
+use Deserializers\Deserializer;
 use Deserializers\Exceptions\DeserializationException;
+use Deserializers\TypedObjectDeserializer;
+use Wikibase\DataModel\Statement\StatementList;
+use Wikibase\Lexeme\DataModel\Lexeme;
+use Wikibase\Lexeme\DataModel\LexemeId;
 
-class LexemeDeserializer implements DispatchableDeserializer {
+/**
+ * @license GPL-2.0+
+ * @author Amir Sarabadani 
+ */
+class LexemeDeserializer extends TypedObjectDeserializer {
+
+   /**
+* @var Deserializer
+*/
+   private $statementListDeserializer;
+
+   /**
+* @param Deserializer $statementListDeserializer
+*/
+   public function __construct(
+   Deserializer $statementListDeserializer
+   ) {
+   parent::__construct( 'lexeme', 'type' );
+   $this->statementListDeserializer = $statementListDeserializer;
+   }
+
+   /**
+* @param mixed $serialization
+*
+* @throws DeserializationException
+* @return Lexeme
+*/
public function deserialize( $serialization ) {
-   // TODO: Implement deserialize() method.
+   $this->assertCanDeserialize( $serialization );
+
+   return new Lexeme(
+   $this->deserializeId( $serialization ),
+   $this->deserializeStatements( $serialization )
+   );
}
 
-   public function isDeserializerFor( $serialization ) {
-   // TODO: Implement isDeserializerFor() method.
+   /**
+* @param array $serialization
+*
+* @return LexemeId|null
+*/
+   private function deserializeId( array $serialization ) {
+   if ( array_key_exists( 'id', $serialization ) ) {
+   return new LexemeId( $serialization['id'] );
+   }
+
+   return null;
}
+
+   /**
+* @param array $serialization
+*
+* @return StatementList|null
+*/
+   private function deserializeStatements( array $serialization ) {
+   if ( array_key_exists( 'claims', $serialization ) ) {
+   return $this->statementListDeserializer->deserialize( 
$serialization['claims'] );
+   }
+
+   return null;
+   }
+
 }
diff --git a/src/DataModel/Serialization/LexemeSerializer.php 
b/src/DataModel/Serialization/LexemeSerializer.php
index 2533728..a777be0 100644
--- a/src/DataModel/Serialization/LexemeSerializer.php
+++ b/src/DataModel/Serialization/LexemeSerializer.php
@@ -4,14 +4,74 @@
 
 use Serializers\DispatchableSerializer;
 use Serializers\Exceptions\SerializationException;
+use Serializers\Exceptions\UnsupportedObjectException;
+use Serializers\Serializer;
+use Wikibase\Lexeme\DataModel\Lexeme;
 
-class LexemeSerializer implements DispatchableSerializer  {
+/**
+ * @license GPL-2.0+
+ * @author Amir Sarabadani 
+ */
+class LexemeSerializer implements DispatchableSerializer {
 
+   /**
+* @var Serializer
+*/
+   private $statementListSerializer;
+
+   /**
+* @param Serializer $statementListSerializer
+*/
+   public function __construct(
+   Serializer $statementListSerializer
+   ) {
+   $this->statementListSerializer = $statementListSerializer;
+   }
+
+   /**
+* @see DispatchableSerializer::isSerializerFor
+*
+* @param mixed $object
+*
+* @return bool
+*/
public function isSerializerFor( $object ) {
-   // TODO: Implement isSerializerFor() method.
+   return $object instanceof Lexeme;
}
 
+   /**
+* @see Serializer::serialize
+*
+* @param Lexeme $object
+*
+* @throws SerializationException
+* @return array
+*/
public function serialize( $object ) {

[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Extract DM document from node instead of passing it as argument

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

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

Change subject: Extract DM document from node instead of passing it as argument
..

Extract DM document from node instead of passing it as argument

Change-Id: I9ce3d51b399c77378a8e79c27447873e32a0a651
---
M src/dm/ve.dm.VisualDiff.js
M src/ve.DiffTreeNode.js
2 files changed, 5 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/94/318794/1

diff --git a/src/dm/ve.dm.VisualDiff.js b/src/dm/ve.dm.VisualDiff.js
index 7368e1c..adf90b3 100644
--- a/src/dm/ve.dm.VisualDiff.js
+++ b/src/dm/ve.dm.VisualDiff.js
@@ -409,8 +409,8 @@
return cleanDiff;
}
 
-   oldDocChildTree = new this.treeDiffer.Tree( oldDocChild, 
ve.DiffTreeNode, { doc: this.oldDoc } );
-   newDocChildTree = new this.treeDiffer.Tree( newDocChild, 
ve.DiffTreeNode, { doc: this.newDoc } );
+   oldDocChildTree = new this.treeDiffer.Tree( oldDocChild, 
ve.DiffTreeNode );
+   newDocChildTree = new this.treeDiffer.Tree( newDocChild, 
ve.DiffTreeNode );
 
treeDiff = new this.treeDiffer.Differ( oldDocChildTree, newDocChildTree 
)
.transactions[ oldDocChildTree.orderedNodes.length - 1 ][ 
newDocChildTree.orderedNodes.length - 1 ];
diff --git a/src/ve.DiffTreeNode.js b/src/ve.DiffTreeNode.js
index 69bfb9a..c09b846 100644
--- a/src/ve.DiffTreeNode.js
+++ b/src/ve.DiffTreeNode.js
@@ -16,11 +16,11 @@
  * @param {Object} node Node of any type
  * @param {Object} config
  */
-ve.DiffTreeNode = function ( node, config ) {
+ve.DiffTreeNode = function ( node ) {
// Parent constructor
-   ve.DiffTreeNode.parent.call( this, node );
+   ve.DiffTreeNode.super.apply( this, arguments );
 
-   this.doc = config.doc;
+   this.doc = node.getDocument();
 };
 
 /* Inheritance */
@@ -38,7 +38,6 @@
  * @return {boolean} The nodes are equal
  */
 ve.DiffTreeNode.prototype.isEqual = function ( otherNode ) {
-
if ( this.node instanceof ve.dm.ContentBranchNode && otherNode.node 
instanceof ve.dm.ContentBranchNode ) {
return JSON.stringify( this.doc.getData( 
this.node.getOuterRange() ) ) ===
JSON.stringify( otherNode.doc.getData( 
otherNode.node.getOuterRange() ) );
@@ -46,7 +45,6 @@
return ( this.node.element.type === otherNode.node.element.type 
&&
ve.compare( this.node.element.attributes, 
otherNode.node.element.attributes ) );
}
-
 };
 
 /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ce3d51b399c77378a8e79c27447873e32a0a651
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/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...Flow[master]: Flow should mw.Map#get() instead of deprecated "Map-values"

2016-10-30 Thread Blackspirit96 (Code Review)
Blackspirit96 has uploaded a new change for review.

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

Change subject: Flow should mw.Map#get() instead of deprecated "Map-values"
..

Flow should mw.Map#get() instead of deprecated "Map-values"

Replaced all Map#values to Map#get() occurances

Bug: T149304

Change-Id: I4ac3e37b221a148e8ccea83278c5c44a7bc3abb7
---
M modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js
M modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js
2 files changed, 2 insertions(+), 2 deletions(-)


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

diff --git 
a/modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js 
b/modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js
index 6f88ea5..f299249 100644
--- a/modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js
+++ b/modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js
@@ -47,7 +47,7 @@
content = content || '';
 
// add i18n messages to VE
-   ve.init.platform.addMessages( mw.messages.values );
+   ve.init.platform.addMessages( mw.messages.get() );
 
this.target = ve.init.mw.targetFactory.create( 'flow' );
 
diff --git 
a/modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js 
b/modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js
index cb0a9d3..0d1c224 100644
--- a/modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js
+++ b/modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js
@@ -66,7 +66,7 @@
this.loadPromise = mw.loader.using( 
'ext.flow.visualEditor' )
.then( function () {
// HACK add i18n messages to VE
-   ve.init.platform.addMessages( 
mw.messages.values );
+   ve.init.platform.addMessages( 
mw.messages.get() );
 
mw.flow.ve.Target.static.setSwitchable( 
mw.flow.ui.VisualEditorWidget.static.switchable );
 

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

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

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


[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Diff style tweaks

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

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

Change subject: Diff style tweaks
..

Diff style tweaks

* Add outline to insert/remove text highlight and
  reduce border radius
* Ensure empty inserted/removed children are forced open

Change-Id: Ic668ad536849df8bb23f0313b8bc07041996f596
---
M demos/ve/demo.css
M src/ui/styles/elements/ve.ui.DiffElement.css
2 files changed, 10 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/92/318792/1

diff --git a/demos/ve/demo.css b/demos/ve/demo.css
index b6b909a..a5a544f 100644
--- a/demos/ve/demo.css
+++ b/demos/ve/demo.css
@@ -91,7 +91,7 @@
 }
 
 .ve-demo-source textarea {
-   font-family: monospace, monospace;
+   font-family: monospace;
 }
 
 .ve-demo-read {
diff --git a/src/ui/styles/elements/ve.ui.DiffElement.css 
b/src/ui/styles/elements/ve.ui.DiffElement.css
index 751453c..4a5ecef 100644
--- a/src/ui/styles/elements/ve.ui.DiffElement.css
+++ b/src/ui/styles/elements/ve.ui.DiffElement.css
@@ -7,12 +7,14 @@
 
 .ve-ui-diffElement-insert {
background-color: #7fd7c4;
-   border-radius: 0.25em;
+   border-radius: 0.15em;
+   box-shadow: 0 0 0 1px #7fd7c4;
 }
 
 .ve-ui-diffElement-remove {
background-color: #e88e89;
-   border-radius: 0.25em;
+   border-radius: 0.15em;
+   box-shadow: 0 0 0 1px #e88e89;
 }
 
 .ve-ui-diffElement-none {
@@ -38,6 +40,10 @@
 .ve-ui-diffElement-insert:empty:before,
 .ve-ui-diffElement-remove:empty:before,
 .ve-ui-diffElement-up:empty:before,
-.ve-ui-diffElement-down:empty:before {
+.ve-ui-diffElement-down:empty:before,
+.ve-ui-diffElement-insert *:empty:before,
+.ve-ui-diffElement-remove *:empty:before,
+.ve-ui-diffElement-up *:empty:before,
+.ve-ui-diffElement-down *:empty:before {
content: url( 
data:image/gif;base64,R0lGODlhAQABAIAAAP///yH5BAEALAABAAEAAAIBRAA7 
);
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic668ad536849df8bb23f0313b8bc07041996f596
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/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...Assert[master]: Assertion for parameter key types

2016-10-30 Thread Daniel Kinzler (Code Review)
Daniel Kinzler has submitted this change and it was merged.

Change subject: Assertion for parameter key types
..


Assertion for parameter key types

Resubmission of https://github.com/wikimedia/Assert/issues/4

Change-Id: I7810ed72bb058167abcf7cd7ca850fc3be15c52a
---
M src/Assert.php
A src/ParameterKeyTypeException.php
M tests/phpunit/AssertTest.php
3 files changed, 119 insertions(+), 0 deletions(-)

Approvals:
  Daniel Kinzler: Verified; Looks good to me, approved



diff --git a/src/Assert.php b/src/Assert.php
index 77dccd3..96c165e 100644
--- a/src/Assert.php
+++ b/src/Assert.php
@@ -15,6 +15,7 @@
  *
  * @license MIT
  * @author Daniel Kinzler
+ * @author Thiemo Mättig
  * @copyright Wikimedia Deutschland e.V.
  */
 class Assert {
@@ -91,6 +92,29 @@
}
 
/**
+* @param string $type Either "integer" or "string". Mixing 
"integer|string" is not supported
+*  because this is PHP's default anyway. It is of no value to check 
this.
+* @param array $value The parameter's actual value. If this is not an 
array, a
+*  ParameterTypeException is raised.
+* @param string $name The name of the parameter that was checked.
+*
+* @throws ParameterTypeException if one of the keys in the array 
$value is not of type $type.
+*/
+   public static function parameterKeyType( $type, $value, $name ) {
+   self::parameterType( 'array', $value, $name );
+
+   if ( $type !== 'integer' && $type !== 'string' ) {
+   throw new ParameterAssertionException( 'type', 'must be 
"integer" or "string"' );
+   }
+
+   foreach ( $value as $key => $element ) {
+   if ( gettype( $key ) !== $type ) {
+   throw new ParameterKeyTypeException( $name, 
$type );
+   }
+   }
+   }
+
+   /**
 * Checks the type of all elements of an parameter, assuming the 
parameter is an array,
 * that is, throws a ParameterElementTypeException if $value
 *
diff --git a/src/ParameterKeyTypeException.php 
b/src/ParameterKeyTypeException.php
new file mode 100644
index 000..702b73e
--- /dev/null
+++ b/src/ParameterKeyTypeException.php
@@ -0,0 +1,44 @@
+type = $type;
+   }
+
+   /**
+* @return string
+*/
+   public function getType() {
+   return $this->type;
+   }
+
+}
diff --git a/tests/phpunit/AssertTest.php b/tests/phpunit/AssertTest.php
index 5b68b31..205fdd5 100644
--- a/tests/phpunit/AssertTest.php
+++ b/tests/phpunit/AssertTest.php
@@ -121,6 +121,57 @@
Assert::parameterType( 'string', 17, 'test' );
}
 
+   public function validParameterKeyTypeProvider() {
+   return array(
+   array( 'integer', array() ),
+   array( 'integer', array( 1 ) ),
+   array( 'integer', array( 1 => 1 ) ),
+   array( 'integer', array( 1.0 => 1 ) ),
+   array( 'integer', array( '0' => 1 ) ),
+   array( 'integer', array( false => 1 ) ),
+   array( 'string', array() ),
+   array( 'string', array( '' => 1 ) ),
+   array( 'string', array( '0.0' => 1 ) ),
+   array( 'string', array( 'string' => 1 ) ),
+   array( 'string', array( null => 1 ) ),
+   );
+   }
+
+   /**
+* @dataProvider validParameterKeyTypeProvider
+*/
+   public function testParameterKeyType_pass( $type, $value ) {
+   Assert::parameterKeyType( $type, $value, 'test' );
+   }
+
+   public function invalidParameterKeyTypeProvider() {
+   return array(
+   array( 'integer', array( 0, 'string' => 1 ) ),
+   array( 'integer', array( 'string' => 0, 1 ) ),
+   array( 'string', array( 0, 'string' => 1 ) ),
+   array( 'string', array( 'string' => 0, 1 ) ),
+   );
+   }
+
+   /**
+* @dataProvider invalidParameterKeyTypeProvider
+*/
+   public function testParameterKeyType_fail( $type, $value ) {
+   $this->setExpectedException(
+   'Wikimedia\Assert\ParameterKeyTypeException',
+   'Bad value for parameter test: all elements must have '
+   );
+   Assert::parameterKeyType( $type, $value, 'test' );
+   }
+
+   public function testGivenUnsupportedType_ParameterKeyTypeFails() {
+   $this->setExpectedException(
+   'Wikimedia\Assert\ParameterAssertionException',
+   'Bad value for parameter type: must be "integer" or 
"string"'
+   );
+   Assert::parameterKeyType( 'inte

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Fix typo in mariadb::service include

2016-10-30 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Fix typo in mariadb::service include
..


Fix typo in mariadb::service include

This takes a 'package' arg, not a 'version' arg.

Change-Id: I07e081bd8ef18bb2881bea62baa8b6070f42a481
---
M modules/role/manifests/labs/dns.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/role/manifests/labs/dns.pp 
b/modules/role/manifests/labs/dns.pp
index 4f49164..7a71a32 100644
--- a/modules/role/manifests/labs/dns.pp
+++ b/modules/role/manifests/labs/dns.pp
@@ -30,7 +30,7 @@
 }
 
 class { 'mariadb::service':
-version => 'wmf-mariadb10',
+package => 'wmf-mariadb10',
 }
 
 class { 'mariadb::config':

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I07e081bd8ef18bb2881bea62baa8b6070f42a481
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] labs...grrrit[master]: Make grrrit-wm connection to freenode secure using ssl

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

Change subject: Make grrrit-wm connection to freenode secure using ssl
..


Make grrrit-wm connection to freenode secure using ssl

Change-Id: Idc4b2796c975f13aff5a0d0d2e9ec564ddeebca7
---
M src/relay.js
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/src/relay.js b/src/relay.js
index 45a17c9..026515b 100644
--- a/src/relay.js
+++ b/src/relay.js
@@ -100,6 +100,10 @@
 userName: config.userName,
 realName: config.realName,
 password: config.password,
+port: 6697,
+secure: true,
+selfSigned: false,
+certExpired: false,
 channels: allChannels,
 stripColors: false,
 floodProtection: true

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idc4b2796c975f13aff5a0d0d2e9ec564ddeebca7
Gerrit-PatchSet: 2
Gerrit-Project: labs/tools/grrrit
Gerrit-Branch: master
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Paladox 
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]: Fix typo in mariadb::service include

2016-10-30 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

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

Change subject: Fix typo in mariadb::service include
..

Fix typo in mariadb::service include

This takes a 'package' arg, not a 'version' arg.

Change-Id: I07e081bd8ef18bb2881bea62baa8b6070f42a481
---
M modules/role/manifests/labs/dns.pp
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/role/manifests/labs/dns.pp 
b/modules/role/manifests/labs/dns.pp
index 4f49164..7a71a32 100644
--- a/modules/role/manifests/labs/dns.pp
+++ b/modules/role/manifests/labs/dns.pp
@@ -30,7 +30,7 @@
 }
 
 class { 'mariadb::service':
-version => 'wmf-mariadb10',
+package => 'wmf-mariadb10',
 }
 
 class { 'mariadb::config':

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I07e081bd8ef18bb2881bea62baa8b6070f42a481
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 

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


[MediaWiki-commits] [Gerrit] labs...grrrit[master]: Make grrrit-wm connection to freenode secure using ssl

2016-10-30 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Make grrrit-wm connection to freenode secure using ssl
..

Make grrrit-wm connection to freenode secure using ssl

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


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/grrrit 
refs/changes/90/318790/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc4b2796c975f13aff5a0d0d2e9ec564ddeebca7
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/grrrit
Gerrit-Branch: master
Gerrit-Owner: Paladox 
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]: labs dns: Add mariadb::service and changes for new package

2016-10-30 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: labs dns: Add mariadb::service and changes for new package
..


labs dns: Add mariadb::service and changes for new package

New package and class manages mysql symlinks and init.d automatically.

Change-Id: Ic7b4ed6d4de9ea035c31074461fe37aea15b51c5
---
M modules/role/manifests/labs/dns.pp
1 file changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/modules/role/manifests/labs/dns.pp 
b/modules/role/manifests/labs/dns.pp
index 22e8be2..4f49164 100644
--- a/modules/role/manifests/labs/dns.pp
+++ b/modules/role/manifests/labs/dns.pp
@@ -21,13 +21,16 @@
 # Note:  This will install mariadb but won't set up the
 #  pdns database.  Manual steps are:
 #
-#  $ /opt/wmf-mariad/install
 #  $ /opt/wmf/mariadb/scripts/mysql_install_db
 #  Then export the 'pdns' db from a working labservices host and import
 #  Then, run 'designate-manage powerdns sync' for the new host
 #
 class { 'mariadb::packages_wmf':
 mariadb10 => true,
+}
+
+class { 'mariadb::service':
+version => 'wmf-mariadb10',
 }
 
 class { 'mariadb::config':
@@ -39,7 +42,7 @@
 
 service { 'mariadb':
 ensure  => running,
-require => Class['mariadb::packages_wmf', 'mariadb::config'],
+require => Class['mariadb::packages_wmf', 'mariadb::config', 
'mariadb::service'],
 }
 
 package { 'mysql-client':

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic7b4ed6d4de9ea035c31074461fe37aea15b51c5
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Jcrespo 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: Jcrespo 
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]: Replace language code 'bat-smg' by 'sgs' in tests

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

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

Change subject: Replace language code 'bat-smg' by 'sgs' in tests
..

Replace language code 'bat-smg' by 'sgs' in tests

'bat-smg' is a deprecated language code and replaced by 'sgs'.

Change-Id: Ib0c1305226078906eac6683a6fabb02bea17765e
---
M repo/tests/phpunit/includes/Api/ModifyTermTestCase.php
1 file changed, 4 insertions(+), 4 deletions(-)


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

diff --git a/repo/tests/phpunit/includes/Api/ModifyTermTestCase.php 
b/repo/tests/phpunit/includes/Api/ModifyTermTestCase.php
index 85aaf9e..09e7cd7 100644
--- a/repo/tests/phpunit/includes/Api/ModifyTermTestCase.php
+++ b/repo/tests/phpunit/includes/Api/ModifyTermTestCase.php
@@ -46,13 +46,13 @@
'p' => array( 'language' => 'en', 'value' => 
'Different Value' ),
'e' => array( 'value' => array( 'en' => 
'Different Value' ) ) ),
array( //5
-   'p' => array( 'language' => 'bat-smg', 'value' 
=> 'V?sata' ),
-   'e' => array( 'value' => array( 'bat-smg' => 
'V?sata','en' => 'Different Value' ) ) ),
+   'p' => array( 'language' => 'sgs', 'value' => 
'V?sata' ),
+   'e' => array( 'value' => array( 'sgs' => 
'V?sata','en' => 'Different Value' ) ) ),
array( //6
'p' => array( 'language' => 'en', 'value' => '' 
),
-   'e' => array( 'value' => array( 'bat-smg' => 
'V?sata' ) ) ),
+   'e' => array( 'value' => array( 'sgs' => 
'V?sata' ) ) ),
array( //7
-   'p' => array( 'language' => 'bat-smg', 'value' 
=> '' ),
+   'p' => array( 'language' => 'sgs', 'value' => 
'' ),
'e' => array() ),
array( //8
'p' => array( 'language' => 'en', 'value' => "  
x\nx  " ),

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

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

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


[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Remove #rebuildTree calls and ensure #getDocumentNode is used

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

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

Change subject: Remove #rebuildTree calls and ensure #getDocumentNode is used
..

Remove #rebuildTree calls and ensure #getDocumentNode is used

Change-Id: I2e95ea905f15196c7825d45172350d776e6159b8
---
M demos/ve/ve.demo.SurfaceContainer.js
M src/dm/ve.dm.VisualDiff.js
M src/ui/elements/ve.ui.DiffElement.js
3 files changed, 4 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/88/318788/1

diff --git a/demos/ve/ve.demo.SurfaceContainer.js 
b/demos/ve/ve.demo.SurfaceContainer.js
index 251be23..1ba1f68 100644
--- a/demos/ve/ve.demo.SurfaceContainer.js
+++ b/demos/ve/ve.demo.SurfaceContainer.js
@@ -83,7 +83,6 @@
diffButton.on( 'click', function () {
var windowManager = new OO.ui.WindowManager( { factory: 
ve.ui.windowFactory } );
$( 'body' ).append( windowManager.$element );
-   container.target.oldDoc.rebuildTree();
windowManager.openWindow( 'diff' );
} );
 
@@ -290,7 +289,6 @@
 
dmDoc = this.surface.getModel().getDocument();
this.target.oldDoc = dmDoc.cloneFromRange( new ve.Range( 0, 
dmDoc.data.getLength() ) );
-   // rebuildTree is called when getDiff is run
 
this.$surfaceWrapper.empty().append( this.surface.$element.parent() )
.hide().slideDown().promise().done( function () {
diff --git a/src/dm/ve.dm.VisualDiff.js b/src/dm/ve.dm.VisualDiff.js
index 7368e1c..611e7eb 100644
--- a/src/dm/ve.dm.VisualDiff.js
+++ b/src/dm/ve.dm.VisualDiff.js
@@ -21,10 +21,8 @@
 
this.oldDoc = oldDoc.cloneFromRange();
this.newDoc = newDoc.cloneFromRange();
-   this.oldDoc.rebuildTree();
-   this.newDoc.rebuildTree();
-   this.oldDocNode = oldDoc.documentNode;
-   this.newDocNode = newDoc.documentNode;
+   this.oldDocNode = oldDoc.getDocumentNode();
+   this.newDocNode = newDoc.getDocumentNode();
this.oldDocChildren = this.oldDocNode.children;
this.newDocChildren = this.newDocNode.children;
this.treeDiffer = treeDiffer;
diff --git a/src/ui/elements/ve.ui.DiffElement.js 
b/src/ui/elements/ve.ui.DiffElement.js
index 7ccd650..cb88dee 100644
--- a/src/ui/elements/ve.ui.DiffElement.js
+++ b/src/ui/elements/ve.ui.DiffElement.js
@@ -28,10 +28,8 @@
// Documents
this.oldDoc = visualDiff.oldDoc;
this.newDoc = visualDiff.newDoc;
-   this.oldDoc.rebuildTree();
-   this.newDoc.rebuildTree();
-   this.oldDocChildren = this.oldDoc.documentNode.children;
-   this.newDocChildren = this.newDoc.documentNode.children;
+   this.oldDocChildren = this.oldDoc.getDocumentNode().children;
+   this.newDocChildren = this.newDoc.getDocumentNode().children;
 
// Diff
this.oldToNew = diff.docChildrenOldToNew;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e95ea905f15196c7825d45172350d776e6159b8
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/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/core[master]: Test: Do not submit

2016-10-30 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Test: Do not submit
..

Test: Do not submit

Change-Id: Ia99850c355f8238fc162a711f15315f5e1811758
---
M includes/db/CloneDatabase.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php
index f1ccd2a..dbb2186 100644
--- a/includes/db/CloneDatabase.php
+++ b/includes/db/CloneDatabase.php
@@ -119,7 +119,7 @@
if ( $dropTables ) {
self::changePrefix( $this->newTablePrefix );
foreach ( $this->tablesToClone as $tbl ) {
-   $this->db->dropTable( $tbl );
+   $this->db->dropTable( 'mediawiki.' . $tbl );
}
}
self::changePrefix( $this->oldTablePrefix );

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: cirrus - disable the rebuild of completion indices

2016-10-30 Thread Gehel (Code Review)
Gehel has submitted this change and it was merged.

Change subject: cirrus - disable the rebuild of completion indices
..


cirrus - disable the rebuild of completion indices

The rebuild of completion indices is a fairly long operation. To help
the reboot of terbium we can disable those crons for a short period.

This change should be reverted once terbium is rebooted.

Change-Id: I1b585a88257737c70dfd7d2f260fa5dc4ccfeb64
---
M modules/mediawiki/manifests/maintenance/cirrussearch.pp
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/modules/mediawiki/manifests/maintenance/cirrussearch.pp 
b/modules/mediawiki/manifests/maintenance/cirrussearch.pp
index abfdf22..ac2af95 100644
--- a/modules/mediawiki/manifests/maintenance/cirrussearch.pp
+++ b/modules/mediawiki/manifests/maintenance/cirrussearch.pp
@@ -12,12 +12,14 @@
 # fail the entire job. This job, as of mar 2015, takes around 5 hours
 # to run.
 cron { 'cirrus_build_completion_indices_eqiad':
+ensure  => absent,
 command => '/usr/local/bin/expanddblist all | xargs -I{} -P 4 sh -c 
\'/usr/local/bin/mwscript 
extensions/CirrusSearch/maintenance/updateSuggesterIndex.php --wiki={} 
--masterTimeout=10m --replicationTimeout=5400 --cluster=eqiad --optimize > 
/var/log/mediawiki/cirrus-suggest/{}.eqiad.log 2>&1 || true\'',
 minute  => 30,
 hour=> 2,
 }
 
 cron { 'cirrus_build_completion_indices_codfw':
+ensure  => absent,
 command => '/usr/local/bin/expanddblist all | xargs -I{} -P 4 sh -c 
\'/usr/local/bin/mwscript 
extensions/CirrusSearch/maintenance/updateSuggesterIndex.php --wiki={} 
--masterTimeout=10m --replicationTimeout=5400 --cluster=codfw --optimize > 
/var/log/mediawiki/cirrus-suggest/{}.codfw.log 2>&1 || true\'',
 minute  => 30,
 hour=> 2,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1b585a88257737c70dfd7d2f260fa5dc4ccfeb64
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Gehel 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: DCausse 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: Muehlenhoff 
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...AbuseFilter[master]: Add a hook to AbuseFilter::filterAction() to allow other ext...

2016-10-30 Thread Jack Phoenix (Code Review)
Jack Phoenix has uploaded a new change for review.

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

Change subject: Add a hook to AbuseFilter::filterAction() to allow other 
extensions to tell AF to exit early
..

Add a hook to AbuseFilter::filterAction() to allow other extensions to tell AF 
to exit early

This can be used to build an extension that allows a specific group to
bypass AbuseFilters, for example.

Original code and idea by Nelson Monterroso for Wikia, see
https://github.com/Wikia/app/commit/767cb05a305b41d8b62006fdd060e46c8f473b18

Change-Id: Id1ebc706f82e1027050f586d680b07ff63227be5
---
M AbuseFilter.class.php
1 file changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/AbuseFilter.class.php b/AbuseFilter.class.php
index f816525..1a8e8db 100644
--- a/AbuseFilter.class.php
+++ b/AbuseFilter.class.php
@@ -879,6 +879,10 @@
) {
global $wgUser, $wgTitle, $wgRequest;
 
+   if ( !Hooks::run( 'AbuseFilterShouldFilter', array( $wgUser ) ) 
) {
+   return true;
+   }
+
$context = RequestContext::getMain();
$oldContextTitle = $context->getTitle();
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id1ebc706f82e1027050f586d680b07ff63227be5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Testing: Do not merge

2016-10-30 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Testing: Do not merge
..

Testing: Do not merge

Change-Id: I9d295b16eb0ceef1826ffcb47874fc55a534375c
---
M includes/Setup.php
M includes/db/Database.php
M includes/db/DatabaseSqlite.php
M includes/libs/rdbms/database/DBConnRef.php
M includes/libs/rdbms/database/IDatabase.php
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
M tests/phpunit/includes/db/DatabaseTest.php
7 files changed, 28 insertions(+), 93 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/85/318785/1

diff --git a/includes/Setup.php b/includes/Setup.php
index ddf5b89..2f462b8 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -504,19 +504,6 @@
 // Reset the global service locator, so any services that have already been 
created will be
 // re-created while taking into account any custom settings and extensions.
 MediaWikiServices::resetGlobalInstance( new GlobalVarConfig(), 'quick' );
-// Apply $wgSharedDB table aliases for the local LB (all non-foreign DB 
connections)
-if ( $wgSharedDB && $wgSharedTables ) {
-   MediaWikiServices::getInstance()->getDBLoadBalancer()->setTableAliases(
-   array_fill_keys(
-   $wgSharedTables,
-   [
-   'dbname' => $wgSharedDB,
-   'schema' => $wgSharedSchema,
-   'prefix' => $wgSharedPrefix
-   ]
-   )
-   );
-}
 
 // Define a constant that indicates that the bootstrapping of the service 
locator
 // is complete.
diff --git a/includes/db/Database.php b/includes/db/Database.php
index 5182fce..917bc91 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -60,8 +60,6 @@
protected $mPassword;
/** @var string */
protected $mDBname;
-   /** @var array[] $aliases Map of (table => (dbname, schema, prefix) 
map) */
-   protected $tableAliases = [];
/** @var bool */
protected $cliMode;
 
@@ -96,6 +94,8 @@
protected $mSchema;
/** @var integer */
protected $mFlags;
+   /** @var bool */
+   protected $mForeign;
/** @var array */
protected $mLBInfo = [];
/** @var bool|null */
@@ -262,6 +262,8 @@
}
 
$this->mSessionVars = $params['variables'];
+
+   $this->mForeign = $params['foreign'];
 
$this->srvCache = isset( $params['srvCache'] )
? $params['srvCache']
@@ -1860,6 +1862,7 @@
 * @return string Full database name
 */
public function tableName( $name, $format = 'quoted' ) {
+   global $wgSharedDB, $wgSharedPrefix, $wgSharedTables, 
$wgSharedSchema;
# Skip the entire process when we have a string quoted on both 
ends.
# Note that we check the end so that we will still quote any 
use of
# use of `database`.table. But won't break things if someone 
wants
@@ -1896,14 +1899,14 @@
$schema = null;
} else {
list( $table ) = $dbDetails;
-   if ( isset( $this->tableAliases[$table] ) ) {
-   $database = 
$this->tableAliases[$table]['dbname'];
-   $schema = is_string( 
$this->tableAliases[$table]['schema'] )
-   ? $this->tableAliases[$table]['schema']
-   : $this->mSchema;
-   $prefix = is_string( 
$this->tableAliases[$table]['prefix'] )
-   ? $this->tableAliases[$table]['prefix']
-   : $this->mTablePrefix;
+   if ( $wgSharedDB !== null # We have a shared database
+   && $this->mForeign == false # We're not working 
on a foreign database
+   && !$this->isQuotedIdentifier( $table ) # 
Prevent shared tables listing '`table`'
+   && in_array( $table, $wgSharedTables ) # A 
shared table is selected
+   ) {
+   $database = $wgSharedDB;
+   $schema = $wgSharedSchema === null ? 
$this->mSchema : $wgSharedSchema;
+   $prefix = $wgSharedPrefix === null ? 
$this->mTablePrefix : $wgSharedPrefix;
} else {
$database = null;
$schema = $this->mSchema; # Default schema
@@ -1914,9 +1917,7 @@
# Quote $table and apply the prefix if not quoted.
# $tableName might be empty if this is called from 
Database::replaceVars()
$tableName = "{$

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

2016-10-30 Thread WikidataBuilder (Code Review)
WikidataBuilder has uploaded a new change for review.

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

Change subject: New Wikidata Build - 2016-10-30T10:00:01+
..

New Wikidata Build - 2016-10-30T10:00:01+

Change-Id: Ie8ad540317d2e004d474c946dad7915177f39320
---
M composer.lock
M extensions/Quality/i18n/pt.json
M extensions/Wikibase/client/i18n/bs.json
M extensions/Wikibase/client/i18n/pt.json
M extensions/Wikibase/lib/i18n/pt.json
A extensions/Wikibase/repo/i18n/atj.json
M extensions/Wikibase/repo/i18n/eu.json
M extensions/Wikibase/repo/i18n/ja.json
M extensions/Wikibase/repo/i18n/ko.json
M extensions/Wikibase/repo/i18n/ru.json
M extensions/Wikibase/repo/includes/Specials/SpecialMergeItems.php
M extensions/Wikibase/repo/includes/Specials/SpecialNewEntity.php
M extensions/Wikibase/repo/resources/Resources.php
A 
extensions/Wikibase/repo/resources/wikibase.special/wikibase.special.mergeItems.js
A 
extensions/Wikibase/repo/resources/wikibase.special/wikibase.special.newEntity.js
M vendor/composer/installed.json
16 files changed, 86 insertions(+), 24 deletions(-)


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

diff --git a/composer.lock b/composer.lock
index 28de2ec..5bb5272 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1482,7 +1482,7 @@
 "source": {
 "type": "git",
 "url": 
"https://gerrit.wikimedia.org/r/mediawiki/extensions/WikibaseQuality";,
-"reference": "f0379978666e272c2440411aac5147f06083f5e4"
+"reference": "d68b21fe4d8dea51909eaf2e3edf209ffcb5f62e"
 },
 "require": {
 "php": ">=5.5.0",
@@ -1528,7 +1528,7 @@
 "support": {
 "issues": 
"https://phabricator.wikimedia.org/project/profile/989/";
 },
-"time": "2016-10-25 00:04:13"
+"time": "2016-10-29 20:54:31"
 },
 {
 "name": "wikibase/serialization-javascript",
@@ -1577,12 +1577,12 @@
 "source": {
 "type": "git",
 "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
-"reference": "8b123568024e1e453d22fcf21f7437297a91f619"
+"reference": "0d6764aa442fc45cb7b33516e13551cf03201352"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/8b123568024e1e453d22fcf21f7437297a91f619";,
-"reference": "8b123568024e1e453d22fcf21f7437297a91f619",
+"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/0d6764aa442fc45cb7b33516e13551cf03201352";,
+"reference": "0d6764aa442fc45cb7b33516e13551cf03201352",
 "shasum": ""
 },
 "require": {
@@ -1656,7 +1656,7 @@
 "wikibaserepo",
 "wikidata"
 ],
-"time": "2016-10-28 20:44:43"
+"time": "2016-10-29 20:54:10"
 },
 {
 "name": "wikibase/wikimedia-badges",
diff --git a/extensions/Quality/i18n/pt.json b/extensions/Quality/i18n/pt.json
index 12a00e0..9f56e2e 100644
--- a/extensions/Quality/i18n/pt.json
+++ b/extensions/Quality/i18n/pt.json
@@ -2,7 +2,8 @@
"@metadata": {
"authors": [
"Vitorvicentevalente",
-   "Macofe"
+   "Macofe",
+   "Hamilton Abreu"
]
},
"wbq-violations-description": "Lista de problemas de qualidade de 
dados",
@@ -15,9 +16,9 @@
"wbq-violations-exceptions-checkbox-label": "Mostrar exceções",
"wbq-violations-submit-button-label": "Mostrar Violações",
"wbq-violations-invalid-entity-id": "O identificador de entidade 
fornecido é inválido.",
-   "wbq-violations-not-existent-entity": "A entidade com o identificador 
fornecido não existe.",
-   "wbq-violations-invalid-property-id": "O identificador de entidade 
fornecido é inválido.",
-   "wbq-violations-not-existent-property": "A propriedade com o 
identificador fornecido não existe.",
+   "wbq-violations-not-existent-entity": "Não existe nenhuma entidade com 
o identificador fornecido.",
+   "wbq-violations-invalid-property-id": "O identificador de propriedade 
fornecido é inválido.",
+   "wbq-violations-not-existent-property": "Não existe nenhuma propriedade 
com o identificador fornecido.",
"wbq-violations-table-header-entity": "Entidade",
"wbq-violations-table-header-constraint-type": "Tipo",
"wbq-violations-table-header-updated-at": "Última atualização",
diff --git a/extensions/Wikibase/client/i18n/bs.json 
b/extensions/Wikibase/client/i18n/bs.json
index becce7d..cbc84d7 100644
--- a/extensions/Wikibase/

[MediaWiki-commits] [Gerrit] translatewiki[master]: [BlueSky] Enable skin

2016-10-30 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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

Change subject: [BlueSky] Enable skin
..

[BlueSky] Enable skin

Change-Id: Ie78fc1540dd3ff912c29ba54e4754c76661df677
---
M groups/MediaWiki/mediawiki-skins.txt
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/83/318783/1

diff --git a/groups/MediaWiki/mediawiki-skins.txt 
b/groups/MediaWiki/mediawiki-skins.txt
index a797c3d..72e67bd 100644
--- a/groups/MediaWiki/mediawiki-skins.txt
+++ b/groups/MediaWiki/mediawiki-skins.txt
@@ -3,8 +3,9 @@
 
 Blue print
 
-# qqq missing
-#Blue Sky
+Blue Sky
+optional = bluesky-breadcrumb-pointer
+ignored = bluesky-breadcrumbs-nsmain
 
 Blue Spice Skin
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie78fc1540dd3ff912c29ba54e4754c76661df677
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking 

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: [BlueSky] Enable skin

2016-10-30 Thread Raimond Spekking (Code Review)
Raimond Spekking has submitted this change and it was merged.

Change subject: [BlueSky] Enable skin
..


[BlueSky] Enable skin

Change-Id: Ie78fc1540dd3ff912c29ba54e4754c76661df677
---
M groups/MediaWiki/mediawiki-skins.txt
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Raimond Spekking: Verified; Looks good to me, approved



diff --git a/groups/MediaWiki/mediawiki-skins.txt 
b/groups/MediaWiki/mediawiki-skins.txt
index a797c3d..72e67bd 100644
--- a/groups/MediaWiki/mediawiki-skins.txt
+++ b/groups/MediaWiki/mediawiki-skins.txt
@@ -3,8 +3,9 @@
 
 Blue print
 
-# qqq missing
-#Blue Sky
+Blue Sky
+optional = bluesky-breadcrumb-pointer
+ignored = bluesky-breadcrumbs-nsmain
 
 Blue Spice Skin
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie78fc1540dd3ff912c29ba54e4754c76661df677
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking 
Gerrit-Reviewer: Raimond Spekking 

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: [Linter] Register extension

2016-10-30 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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

Change subject: [Linter] Register extension
..

[Linter] Register extension

Change-Id: Ibeb2a983fe22835377181bb7883b7d2aa60677ff
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/82/318782/1

diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 3d58ea4..b8cf16e 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -1421,6 +1421,9 @@
 
 # Linked Wiki // 2016-09-19 Missing qqq
 
+Linter
+optional = linker-page-title-edit
+
 Liquid Threads
 aliasfile = LiquidThreads/i18n/Lqt.alias.php
 magicfile = LiquidThreads/i18n/LiquidThreads.magic.php

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibeb2a983fe22835377181bb7883b7d2aa60677ff
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking 

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: [Linter] Register extension

2016-10-30 Thread Raimond Spekking (Code Review)
Raimond Spekking has submitted this change and it was merged.

Change subject: [Linter] Register extension
..


[Linter] Register extension

Change-Id: Ibeb2a983fe22835377181bb7883b7d2aa60677ff
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Raimond Spekking: Verified; Looks good to me, approved



diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 3d58ea4..b8cf16e 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -1421,6 +1421,9 @@
 
 # Linked Wiki // 2016-09-19 Missing qqq
 
+Linter
+optional = linker-page-title-edit
+
 Liquid Threads
 aliasfile = LiquidThreads/i18n/Lqt.alias.php
 magicfile = LiquidThreads/i18n/LiquidThreads.magic.php

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibeb2a983fe22835377181bb7883b7d2aa60677ff
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking 
Gerrit-Reviewer: Raimond Spekking 

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: [BlueSpiceCategoryManager] Register extension

2016-10-30 Thread Raimond Spekking (Code Review)
Raimond Spekking has submitted this change and it was merged.

Change subject: [BlueSpiceCategoryManager] Register extension
..


[BlueSpiceCategoryManager] Register extension

Change-Id: I0e0a3f31607cfd8ae8e782d6bbf24af954f3f09a
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Raimond Spekking: Verified; Looks good to me, approved



diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 39315f0..3d58ea4 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -514,6 +514,9 @@
 descmsg = bs-wikiadmin-desc
 file = BlueSpiceExtensions/WikiAdmin/i18n/%CODE%.json
 
+Blue Spice Category Manager
+aliasfile = includes/specials/SpecialBlueSpiceCategoryManager.alias.php
+
 Blue Spice Edit Notify Connector
 
 Boiler Plate

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0e0a3f31607cfd8ae8e782d6bbf24af954f3f09a
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking 
Gerrit-Reviewer: Raimond Spekking 

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: [BlueSpiceCategoryManager] Register extension

2016-10-30 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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

Change subject: [BlueSpiceCategoryManager] Register extension
..

[BlueSpiceCategoryManager] Register extension

Change-Id: I0e0a3f31607cfd8ae8e782d6bbf24af954f3f09a
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/81/318781/1

diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 39315f0..3d58ea4 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -514,6 +514,9 @@
 descmsg = bs-wikiadmin-desc
 file = BlueSpiceExtensions/WikiAdmin/i18n/%CODE%.json
 
+Blue Spice Category Manager
+aliasfile = includes/specials/SpecialBlueSpiceCategoryManager.alias.php
+
 Blue Spice Edit Notify Connector
 
 Boiler Plate

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e0a3f31607cfd8ae8e782d6bbf24af954f3f09a
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking 

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: [Hanp] Remove deleted extension

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

Change subject: [Hanp] Remove deleted extension
..


[Hanp] Remove deleted extension

Change-Id: I5d9c5eb0d2684cac4970dbd59477703cc02afb95
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 7b5260a..39315f0 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -1246,8 +1246,6 @@
 aliasfile = GWToolset/GWToolset.alias.php
 ignored = gwtoolset-menu, gwtoolset-painted-by, tag-gwtoolset
 
-Hanp
-
 Hash Tables
 
 Header Tabs

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5d9c5eb0d2684cac4970dbd59477703cc02afb95
Gerrit-PatchSet: 2
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking 
Gerrit-Reviewer: Raimond Spekking 
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]: [Han] Remove deleted extension

2016-10-30 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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

Change subject: [Han] Remove deleted extension
..

[Han] Remove deleted extension

Change-Id: I5d9c5eb0d2684cac4970dbd59477703cc02afb95
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/80/318780/1

diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 7b5260a..39315f0 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -1246,8 +1246,6 @@
 aliasfile = GWToolset/GWToolset.alias.php
 ignored = gwtoolset-menu, gwtoolset-painted-by, tag-gwtoolset
 
-Hanp
-
 Hash Tables
 
 Header Tabs

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5d9c5eb0d2684cac4970dbd59477703cc02afb95
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking 

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Revert "Fix isbn.py -to13 operation when ISBN are already in...

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

Change subject: Revert "Fix isbn.py -to13 operation when ISBN are already in 
this format"
..


Revert "Fix isbn.py -to13 operation when ISBN are already in this format"

This reverts commit a8008a210585759ac46f962eb2d6bd1ebad0460c.

Change-Id: I803ce258512b78d87046b5cca9b369a446ecb773
---
M scripts/isbn.py
1 file changed, 1 insertion(+), 5 deletions(-)

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



diff --git a/scripts/isbn.py b/scripts/isbn.py
index 7e83f9d..b96676c 100755
--- a/scripts/isbn.py
+++ b/scripts/isbn.py
@@ -1466,11 +1466,7 @@
 except InvalidIsbnException:
 # don't change
 return isbn
-i1x = getIsbn(isbn)
-if not isinstance(i1x, ISBN13):
-i13 = i1x.toISBN13()
-else:
-i13 = i1x
+i13 = getIsbn(isbn).toISBN13()
 return i13.code
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I803ce258512b78d87046b5cca9b369a446ecb773
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba 
Gerrit-Reviewer: Dalba 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Revert "Fix isbn.py -to13 operation when ISBN are already in...

2016-10-30 Thread Dalba (Code Review)
Dalba has uploaded a new change for review.

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

Change subject: Revert "Fix isbn.py -to13 operation when ISBN are already in 
this format"
..

Revert "Fix isbn.py -to13 operation when ISBN are already in this format"

This reverts commit a8008a210585759ac46f962eb2d6bd1ebad0460c.

Change-Id: I803ce258512b78d87046b5cca9b369a446ecb773
---
M scripts/isbn.py
1 file changed, 1 insertion(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/78/318778/1

diff --git a/scripts/isbn.py b/scripts/isbn.py
index 7e83f9d..b96676c 100755
--- a/scripts/isbn.py
+++ b/scripts/isbn.py
@@ -1466,11 +1466,7 @@
 except InvalidIsbnException:
 # don't change
 return isbn
-i1x = getIsbn(isbn)
-if not isinstance(i1x, ISBN13):
-i13 = i1x.toISBN13()
-else:
-i13 = i1x
+i13 = getIsbn(isbn).toISBN13()
 return i13.code
 
 

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

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

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Fix isbn.py -to13 operation when ISBN are already in this fo...

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

Change subject: Fix isbn.py -to13 operation when ISBN are already in this format
..


Fix isbn.py -to13 operation when ISBN are already in this format

Currently, the isbn.py -to13 operation doesn't support objects
already in ISBN 13 format.

To fix this issue, a toISBN13 method is added to the ISBN13 class.

Ideally this wouldn't be required but this allows to simplify code.

Bug: T138911
Change-Id: I755c8623486ed29a273891e17025b4b468273005
---
M scripts/isbn.py
1 file changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/scripts/isbn.py b/scripts/isbn.py
index b96676c..7e83f9d 100755
--- a/scripts/isbn.py
+++ b/scripts/isbn.py
@@ -1466,7 +1466,11 @@
 except InvalidIsbnException:
 # don't change
 return isbn
-i13 = getIsbn(isbn).toISBN13()
+i1x = getIsbn(isbn)
+if not isinstance(i1x, ISBN13):
+i13 = i1x.toISBN13()
+else:
+i13 = i1x
 return i13.code
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I755c8623486ed29a273891e17025b4b468273005
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Aadith1996 <96aad...@gmail.com>
Gerrit-Reviewer: Aadith1996 <96aad...@gmail.com>
Gerrit-Reviewer: Dalba 
Gerrit-Reviewer: Eranroz 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Whym 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: jenkins-bot <>

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