[MediaWiki-commits] [Gerrit] operations/puppet[production]: extdist: Fix typo in comments

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

Change subject: extdist: Fix typo in comments
..


extdist: Fix typo in comments

Change-Id: Ic4fd0406e6cedf79c0eb761e26f547b6df4e6b4b
---
M manifests/role/extdist.pp
M modules/extdist/manifests/init.pp
2 files changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/manifests/role/extdist.pp b/manifests/role/extdist.pp
index eda9066..f039b1a 100644
--- a/manifests/role/extdist.pp
+++ b/manifests/role/extdist.pp
@@ -1,4 +1,4 @@
-# = Class: role::labs::extdist
+# = Class: role::extdist
 #
 # This class sets up a tarball generator for the Extension Distributor
 # extension enabled on mediawiki.org.
diff --git a/modules/extdist/manifests/init.pp 
b/modules/extdist/manifests/init.pp
index 88fd225..975c83c 100644
--- a/modules/extdist/manifests/init.pp
+++ b/modules/extdist/manifests/init.pp
@@ -1,4 +1,4 @@
-# = Class: role::labs::extdist
+# = Class: role::extdist
 #
 # This class sets up a tarball generator for the Extension Distributor
 # extension enabled on mediawiki.org.

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: extdist: Fix typo in comments

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

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

Change subject: extdist: Fix typo in comments
..

extdist: Fix typo in comments

Change-Id: Ic4fd0406e6cedf79c0eb761e26f547b6df4e6b4b
---
M manifests/role/extdist.pp
M modules/extdist/manifests/init.pp
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/15/307915/1

diff --git a/manifests/role/extdist.pp b/manifests/role/extdist.pp
index eda9066..f039b1a 100644
--- a/manifests/role/extdist.pp
+++ b/manifests/role/extdist.pp
@@ -1,4 +1,4 @@
-# = Class: role::labs::extdist
+# = Class: role::extdist
 #
 # This class sets up a tarball generator for the Extension Distributor
 # extension enabled on mediawiki.org.
diff --git a/modules/extdist/manifests/init.pp 
b/modules/extdist/manifests/init.pp
index 88fd225..975c83c 100644
--- a/modules/extdist/manifests/init.pp
+++ b/modules/extdist/manifests/init.pp
@@ -1,4 +1,4 @@
-# = Class: role::labs::extdist
+# = Class: role::extdist
 #
 # This class sets up a tarball generator for the Extension Distributor
 # extension enabled on mediawiki.org.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic4fd0406e6cedf79c0eb761e26f547b6df4e6b4b
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] mediawiki...TemplateSandbox[master]: Use getHtmlCode() instead of getCode() for HTML attibute lang

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

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

Change subject: Use getHtmlCode() instead of getCode() for HTML attibute lang
..

Use getHtmlCode() instead of getCode() for HTML attibute lang

getHtmlCode() generates a BCP 47 conform language code.

Change-Id: I8f57fdda949917a81f79c99357426ef26e60349f
---
M SpecialTemplateSandbox.php
M TemplateSandbox.hooks.php
2 files changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/SpecialTemplateSandbox.php b/SpecialTemplateSandbox.php
index 8cc539d..c355719 100644
--- a/SpecialTemplateSandbox.php
+++ b/SpecialTemplateSandbox.php
@@ -92,7 +92,7 @@
} elseif ( $this->output !== null ) {
// Wrap output in a div for proper language markup.
$pageLang = $this->title->getPageLanguage();
-   $attribs = [ 'lang' => $pageLang->getCode(), 'dir' => 
$pageLang->getDir(),
+   $attribs = [ 'lang' => $pageLang->getHtmlCode(), 'dir' 
=> $pageLang->getDir(),
'class' => 'mw-content-' . $pageLang->getDir() 
];
$this->output->setText( Html::rawElement( 'div', 
$attribs,
is_callable( [ $this->output, 'getRawText' ] )
diff --git a/TemplateSandbox.hooks.php b/TemplateSandbox.hooks.php
index 1d7521f..78f6832 100644
--- a/TemplateSandbox.hooks.php
+++ b/TemplateSandbox.hooks.php
@@ -165,7 +165,7 @@
$wgOut->parse( $note, true, /* interface */true ) . 
"\n";
 
$pageLang = $title->getPageLanguage();
-   $attribs = [ 'lang' => $pageLang->getCode(), 'dir' => 
$pageLang->getDir(),
+   $attribs = [ 'lang' => $pageLang->getHtmlCode(), 'dir' => 
$pageLang->getDir(),
'class' => 'mw-content-' . $pageLang->getDir() ];
$out = Html::rawElement( 'div', $attribs, $out );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f57fdda949917a81f79c99357426ef26e60349f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TemplateSandbox
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] mediawiki/core[master]: [WIP] API: Add action=x-amples to autogenerate a swagger spec

2016-08-31 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: [WIP] API: Add action=x-amples to autogenerate a swagger spec
..

[WIP] API: Add action=x-amples to autogenerate a swagger spec

action=x-amples autogenerates a swagger spec using the x-amples
extension. It adds a monitoring check for every API module and submodule
that makes a request with no extra parameters and ensures it responds
with a 200 status code.

Individual modules can override ApiBase::getTestXAmples() to provide
more specific requests or alter the default one.

All modules are tested with =json=2. For now,
modules that require POST or make write actions are skipped.

Bug: T136839
Change-Id: I99d738031858c76fe319d480b8504b90c8084049
---
M autoload.php
M includes/api/ApiBase.php
M includes/api/ApiMain.php
M includes/api/ApiQueryBase.php
A includes/api/ApiXAmples.php
5 files changed, 164 insertions(+), 0 deletions(-)


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

diff --git a/autoload.php b/autoload.php
index dec7219..c37b0a8 100644
--- a/autoload.php
+++ b/autoload.php
@@ -145,6 +145,7 @@
'ApiUpload' => __DIR__ . '/includes/api/ApiUpload.php',
'ApiUserrights' => __DIR__ . '/includes/api/ApiUserrights.php',
'ApiWatch' => __DIR__ . '/includes/api/ApiWatch.php',
+   'ApiXAmples' => __DIR__ . '/includes/api/ApiXAmples.php',
'ArchivedFile' => __DIR__ . '/includes/filerepo/file/ArchivedFile.php',
'ArrayDiffFormatter' => __DIR__ . 
'/includes/diff/ArrayDiffFormatter.php',
'ArrayUtils' => __DIR__ . '/includes/libs/ArrayUtils.php',
diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php
index 55d2430..fb5c9f7 100644
--- a/includes/api/ApiBase.php
+++ b/includes/api/ApiBase.php
@@ -3034,6 +3034,30 @@
}
}
 
+   /**
+* Return an x-ample stanza for service-checker
+*
+* @since 1.28
+* @param string $group Module manager group $this is in
+* @return array
+*/
+   public function getTestXAmples( $group ) {
+   $moduleName = $this->getModuleName();
+   return [
+   [
+   'title' => "$group=$moduleName 
({$this->getModulePath()})",
+   'request' => [
+   'query' => [
+   $group => $moduleName,
+   ],
+   ],
+   'response' => [
+   'status' => 200,
+   ],
+   ]
+   ];
+   }
+
/**@}*/
 }
 
diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php
index 22b079d..dacc448 100644
--- a/includes/api/ApiMain.php
+++ b/includes/api/ApiMain.php
@@ -74,6 +74,7 @@
'tokens' => 'ApiTokens',
'checktoken' => 'ApiCheckToken',
'cspreport' => 'ApiCSPReport',
+   'x-amples' => ApiXAmples::class,
 
// Write modules
'purge' => 'ApiPurge',
diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php
index b35eec2..37d3427 100644
--- a/includes/api/ApiQueryBase.php
+++ b/includes/api/ApiQueryBase.php
@@ -579,5 +579,18 @@
);
}
 
+   /**
+* Set action=query in the request parameters
+*
+* @param string $group
+* @return array
+*/
+   public function getTestXAmples( $group ) {
+   $xamples = parent::getTestXAmples( $group );
+   $xamples[0]['request']['query']['action'] = 'query';
+
+   return $xamples;
+   }
+
/**@}*/
 }
diff --git a/includes/api/ApiXAmples.php b/includes/api/ApiXAmples.php
new file mode 100644
index 000..42ababc
--- /dev/null
+++ b/includes/api/ApiXAmples.php
@@ -0,0 +1,125 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+/**
+ * An API module that exposes a swagger.io spec with
+ * the x-amples extension for testing individual modules.
+ * It is intended to be used along with service-checker to
+ * ensure the MediaWiki API is serving requests. Individual
+ * modules should override ApiBase::getTestXAmples() to add
+ * additional requests for testing. By default, each module
+ * is called with no parameters and checked that it returns
+ * a 200 status code.
+ *
+ * @since 1.28
+ */
+class ApiXAmples extends ApiBase {
+   public function __construct( ApiMain $mainModule ) {
+   parent::__construct( $mainModule, 'x-amples' );
+   }
+
+   public function execute() {
+   $result = $this->getResult();
+   $config = $this->getConfig();
+
+   // Figure out the supported mime-types...
+   

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Fix log messag to count correct variable.

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

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

Change subject: Fix log messag to count correct variable.
..

Fix log messag to count correct variable.

After puzzling over the output from the global collect recurring job I
concluded there was an error here. First the contribution_batch records are 
counted,
logged & processed. Then the retry_batch records  - but the watchdog line
reports the contribution_batch count in both instances

Change-Id: I2c1ac3074f0d555de777ce54c9b72bff16929761
---
M sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/12/307912/1

diff --git 
a/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module 
b/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
index d9005d2..9d946f3 100644
--- a/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
+++ b/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
@@ -191,7 +191,7 @@
   watchdog(
 'recurring_globalcollect',
 'Query returned @count messages to process',
-array('@count' => count($contribution_batch))
+array('@count' => count($retry_batch))
   );
   $result = recurring_globalcollect_batch_charge($retry_batch, $options);
 

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

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

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


[MediaWiki-commits] [Gerrit] operations...service-checker[master]: Fix documentation in README

2016-08-31 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Fix documentation in README
..

Fix documentation in README

* The entry point is actually named `service-checker-swagger`.
* `x-amples` is actually a list of request/response entries.

Change-Id: I7dffd45c50dea46059fde5ee829bf0a258694f56
---
M README.rst
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/service-checker 
refs/changes/11/307911/1

diff --git a/README.rst b/README.rst
index b624e17..c363130 100644
--- a/README.rst
+++ b/README.rst
@@ -22,7 +22,8 @@
 Usage
 -
 
-Once installed, you will have the ``service-checker`` binary in your path.
+Once installed, you will have the ``service-checker-swagger`` binary
+in your path.
 
 Suppose you have a webservice running on localhost port 8080, which
 reponds for HTTP host ``awesomeservice.local`` and it
@@ -31,19 +32,19 @@
 
 .. code:: bash
 
-$ service-checker 127.0.0.1 awesomeservice.local:8080 -s /swagger
+$ service-checker-swagger 127.0.0.1 awesomeservice.local:8080 -s /swagger
 All endpoints are healthy
 
 
 Spec format support
 ---
 
-``service-checker`` checks each of the paths in your swagger/OpenAPI
+``service-checker-swagger`` checks each of the paths in your swagger/OpenAPI
 specification for an ``x-amples`` section and uses it to do live requests
 to the API and checks that the response corresponds to the base. The
 ``x-amples`` section is an extension to the swagger spec that has been
 introduced by `swagger-test `_
-and that consists of a ``request`` and a ``response`` sections.
+and that consists of items with ``request`` and ``response`` sections.
 
 Url templating according to RFC 6570 is partially supported via the
 ``params`` section of the ``x-amples`` section.
@@ -60,7 +61,7 @@
"/pets/{id}": {
"get": {
   "x-monitor": true,
-  "x-amples": {
+  "x-amples": [ {
 "request": {
   "params": {"id": 10},
   "headers": { "Accept": "application/json", },

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7dffd45c50dea46059fde5ee829bf0a258694f56
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/service-checker
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

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


[MediaWiki-commits] [Gerrit] operations...service-checker[master]: Properly support 'basePath'

2016-08-31 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Properly support 'basePath'
..

Properly support 'basePath'

According to , the option is
camelCased as 'basePath'. Check for that value and prepend it to the
endpoint if present.

Updated tests to support that functionality.

Change-Id: I2e7ae113c43252081496f8b4d4ca1cadaefe6abe
---
M servicechecker/swagger.py
M servicechecker/tests/fixtures/test.json
M servicechecker/tests/fixtures/test_error_spec.json
M servicechecker/tests/unit/test_swagger.py
4 files changed, 12 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/service-checker 
refs/changes/10/307910/1

diff --git a/servicechecker/swagger.py b/servicechecker/swagger.py
index f431a9d..ccc29fe 100755
--- a/servicechecker/swagger.py
+++ b/servicechecker/swagger.py
@@ -89,9 +89,11 @@
 raise ValueError("No valid spec found")
 
 TemplateUrl.default = r.get('x-default-params', {})
+base_path = r.get('basePath', '')
 for endpoint, data in r['paths'].items():
 if not endpoint:
 continue
+endpoint = base_path + endpoint
 for key in self._supported_methods:
 try:
 d = data[key]
diff --git a/servicechecker/tests/fixtures/test.json 
b/servicechecker/tests/fixtures/test.json
index edb8394..ec0cae6 100644
--- a/servicechecker/tests/fixtures/test.json
+++ b/servicechecker/tests/fixtures/test.json
@@ -1,5 +1,5 @@
 {
-  "basepath": "/api",
+  "basePath": "/api",
   "x-default-params": {"who": "joe"},
   "paths": {
 "/simple": { "get": {} },
diff --git a/servicechecker/tests/fixtures/test_error_spec.json 
b/servicechecker/tests/fixtures/test_error_spec.json
index 8d11544..2cf2ef1 100644
--- a/servicechecker/tests/fixtures/test_error_spec.json
+++ b/servicechecker/tests/fixtures/test_error_spec.json
@@ -1,5 +1,5 @@
 {
-  "basepath": "/api",
+  "basePath": "/api",
   "x-default-params": {"who": "joe"},
   "paths": {
 "/simple": {},
diff --git a/servicechecker/tests/unit/test_swagger.py 
b/servicechecker/tests/unit/test_swagger.py
index 3be614a..d955588 100644
--- a/servicechecker/tests/unit/test_swagger.py
+++ b/servicechecker/tests/unit/test_swagger.py
@@ -210,7 +210,7 @@
 swagger.fetch_url = mock.MagicMock(side_effect=self.router)
 
 def setUp(self):
-self.cs = swagger.CheckService('127.0.0.1', 'http://example.org/api')
+self.cs = swagger.CheckService('127.0.0.1', 'http://example.org')
 fn = os.path.join(os.path.dirname(__file__), '../fixtures/test.json')
 with open(fn, 'rb') as f:
 data = f.read().decode('utf-8')
@@ -225,7 +225,7 @@
 self.assertEquals(self.cs._timeout, 5)
 self.assertEquals(self.cs.port, '80')
 self.assertEquals(self.cs.http_host, 'example.org')
-self.assertEquals(self.cs._url, 'http://127.0.0.1:80/api')
+self.assertEquals(self.cs._url, 'http://127.0.0.1:80')
 
 def test_get_endpoints(self):
 """
@@ -234,7 +234,7 @@
 self.mock_routes()
 l = [el for el, data in self.cs.get_endpoints()]
 l.sort()
-self.assertListEqual(l, [u'/simple', u'/{who}/{verb}'])
+self.assertListEqual(l, [u'/api/simple', u'/api/{who}/{verb}'])
 
 def test_get_ep_invalid_spec(self):
 """
@@ -247,15 +247,15 @@
 '/?spec', {'status': 200, 'body': json.loads(data)})
 self.mock_routes()
 l = [el for el, _ in self.cs.get_endpoints()]
-self.assertEquals(l, [u'/{who}/{verb}'])
+self.assertEquals(l, [u'/api/{who}/{verb}'])
 
 def test_run(self):
 """
 Test a successful run
 """
-self.add_mock_response('/simple', {'status': 200, 'body': 'hi'})
+self.add_mock_response('/api/simple', {'status': 200, 'body': 'hi'})
 self.add_mock_response(
-'/joe/rulez', {'status': 200, 'body': 'For sure!'})
+'/api/joe/rulez', {'status': 200, 'body': 'For sure!'})
 self.mock_routes()
 with self.assertRaises(SystemExit) as e:
 self.cs.run()
@@ -276,9 +276,9 @@
 """
 Test a warning exit
 """
-self.add_mock_response('/simple', {'status': 200, 'body': 'hi'})
+self.add_mock_response('/api/simple', {'status': 200, 'body': 'hi'})
 self.add_mock_response(
-'/joe/rulez', {'status': 200, 'body': 'For sure?'})
+'/api/joe/rulez', {'status': 200, 'body': 'For sure?'})
 self.mock_routes()
 with self.assertRaises(SystemExit) as e:
 self.cs.run()

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix mistake in ControllerViewFactory

2016-08-31 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review.

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

Change subject: Fix mistake in ControllerViewFactory
..

Fix mistake in ControllerViewFactory

Introduced in I4788ab3 and accidentially merged.

Bug: T142694
Change-Id: I6cf7083c8673a301c8ed6644b91236cd87f16ee5
---
M view/resources/wikibase/view/ControllerViewFactory.js
M view/resources/wikibase/view/ToolbarFactory.js
M view/resources/wikibase/view/ViewFactory.js
3 files changed, 32 insertions(+), 29 deletions(-)


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

diff --git a/view/resources/wikibase/view/ControllerViewFactory.js 
b/view/resources/wikibase/view/ControllerViewFactory.js
index 6d34ba1..ee3dc5a 100644
--- a/view/resources/wikibase/view/ControllerViewFactory.js
+++ b/view/resources/wikibase/view/ControllerViewFactory.js
@@ -85,6 +85,7 @@
startEditingController,
entityId,
propertyId,
+   removeCallback,
value,
$dom
);
diff --git a/view/resources/wikibase/view/ToolbarFactory.js 
b/view/resources/wikibase/view/ToolbarFactory.js
index 68edbdb..26ee8f9 100644
--- a/view/resources/wikibase/view/ToolbarFactory.js
+++ b/view/resources/wikibase/view/ToolbarFactory.js
@@ -20,7 +20,7 @@
 * @param {Object} options
 * @param {jQuery} $dom
 * @return {jQuery.wikibase.addtoolbar} The addtoolbar
-**/
+*/
SELF.prototype.getAddToolbar = function( options, $dom ) {
return this._getToolbar( 'add', $dom, options );
};
@@ -31,7 +31,7 @@
 * @param {Object} options
 * @param {jQuery} $dom
 * @return {jQuery.wikibase.edittoolbar} The edittoolbar
-**/
+*/
SELF.prototype.getEditToolbar = function( options, $dom ) {
return this._getToolbar( 'edit', $dom, options );
};
@@ -42,7 +42,7 @@
 * @param {Object} options
 * @param {jQuery} $dom
 * @return {jQuery.wikibase.removetoolbar} The removetoolbar
-**/
+*/
SELF.prototype.getRemoveToolbar = function( options, $dom ) {
return this._getToolbar( 'remove', $dom, options );
};
@@ -52,7 +52,7 @@
 *
 * @param {jQuery} $root
 * @return {jQuery} The toolbar container
-**/
+*/
SELF.prototype.getToolbarContainer = function( $root ) {
var $container = $root.children( '.wikibase-toolbar-container' 
).first();
if ( $container.length === 0 ) {
@@ -65,7 +65,7 @@
 * @private
 * @return {Object} The constructed toolbar
 * @throws {Error} If there is no toolbar with the given name
-**/
+*/
SELF.prototype._getToolbar = function( toolbarType, $dom, options ) {
var toolbarName = toolbarType + 'toolbar';
if ( !$.wikibase[ toolbarName ] ) {
diff --git a/view/resources/wikibase/view/ViewFactory.js 
b/view/resources/wikibase/view/ViewFactory.js
index 6117cfa..4a7f962 100644
--- a/view/resources/wikibase/view/ViewFactory.js
+++ b/view/resources/wikibase/view/ViewFactory.js
@@ -72,79 +72,79 @@
/**
 * @property {wikibase.view.StructureEditorFactory}
 * @private
-**/
+*/
SELF.prototype._structureEditorFactory = null;
 
/**
 * @property {util.ContentLanguages}
 * @private
-**/
+*/
SELF.prototype._contentLanguages = null;
 
/**
 * @property {dataTypes.DataTypeStore}
 * @private
-**/
+*/
SELF.prototype._dataTypeStore = null;
 
/**
 * @property {wikibase.entityIdFormatter.EntityIdHtmlFormatter}
 * @private
-**/
+*/
SELF.prototype._entityIdHtmlFormatter = null;
 
/**
 * @property {wikibase.entityIdFormatter.EntityIdPlainFormatter}
 * @private
-**/
+*/
SELF.prototype._entityIdPlainFormatter = null;
 
/**
 * @property {wikibase.store.EntityStore}
 * @private
-**/
+*/
SELF.prototype._entityStore = null;
 
/**
 * @property {jQuery.util.EventSingletonManager}
 * @private
-**/
+*/
SELF.prototype._eventSingletonManager = null;
 
/**
 * @property {jQuery.valueview.ExpertStore}
 * @private
-**/
+*/
SELF.prototype._expertStore = null;
 
/**
 * @property {wikibase.ValueFormatterFactory}
 * @private
-**/
+*/
SELF.prototype._formatterFactory = null;
 
/**
 * @property {util.MessageProvider}
 * @private
-**/
+*/
SELF.prototype._messageProvider = null;
 
/**
   

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Cloud.cfg tidying for precise and trusty images

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

Change subject: Cloud.cfg tidying for precise and trusty images
..


Cloud.cfg tidying for precise and trusty images

Change-Id: I63ba5a847c0f5ebb30576c1f0cb28370aec82801
---
M modules/labs_vmbuilder/templates/cloud.cfg.erb
1 file changed, 4 insertions(+), 3 deletions(-)

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



diff --git a/modules/labs_vmbuilder/templates/cloud.cfg.erb 
b/modules/labs_vmbuilder/templates/cloud.cfg.erb
index 8fde80d..7753670 100644
--- a/modules/labs_vmbuilder/templates/cloud.cfg.erb
+++ b/modules/labs_vmbuilder/templates/cloud.cfg.erb
@@ -65,7 +65,6 @@
  - rightscale_userdata
  - scripts-per-once
  - scripts-per-boot
- - scripts-per-instance
  - scripts-user
  - keys-to-console
  - phone-home
@@ -75,11 +74,13 @@
  - ssh-authkey-fingerprints
  - power-state-change
 <% end %>
+# We would uncomment this if we had things to run on every boot
+# - scripts-per-instance
 
+system_info:
 <% if scope.function_os_version(['ubuntu >= trusty']) %>
 # System and/or distro specific settings
 # (not accessible to handlers/transforms)
-system_info:
# This will affect which distro class gets used
distro: ubuntu
# Default user name + that default users groups (if added/used)
@@ -95,6 +96,7 @@
   cloud_dir: /var/lib/cloud/
   templates_dir: /etc/cloud/templates/
   upstart_dir: /etc/init/
+<% end %>
package_mirrors:
  - arches: [i386, amd64]
failsafe:
@@ -110,4 +112,3 @@
  primary: http://ports.ubuntu.com/ubuntu-ports
  security: http://ports.ubuntu.com/ubuntu-ports
ssh_svcname: ssh
-<% end %>

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I63ba5a847c0f5ebb30576c1f0cb28370aec82801
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 
Gerrit-Reviewer: Andrew Bogott 
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...guc[master]: build: Fix phpcs coding style violations

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

Change subject: build: Fix phpcs coding style violations
..


build: Fix phpcs coding style violations

* Add phplint test
* Upgrade to CodeSniffer 2

Change-Id: I25b85c616d66e0781bba88a6713c7420f2213174
---
M app.php
M composer.json
M index.php
M lb/guc.php
M lb/wikicontribs.php
M phpcs.xml
6 files changed, 48 insertions(+), 40 deletions(-)

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



diff --git a/app.php b/app.php
index 6511c22..bca1313 100644
--- a/app.php
+++ b/app.php
@@ -59,7 +59,6 @@
  * @return PDO
  */
 public function getDB($database = 'meta', $clusterNr = 's1.labsdb') {
-
 if (!$clusterNr) {
 throw new lb_Exception('Invalid DB cluster specification');
 }
@@ -69,10 +68,9 @@
 }
 $pdo = $this->clusters[$clusterNr];
 
-// Datenbank auswählen
+// Select the right database on this cluster server
 $m = $pdo->prepare('USE `'.$database.'_p`;');
 $m->execute();
-unset($m);
 
 return $pdo;
 }
@@ -91,7 +89,6 @@
 $first = null;
 $out = '';
 foreach ($this->times as $nr => $data) {
-
 $diff = ($timebefore === null) ? 0.0 : $data[0] - $timebefore;
 if ($timebefore === null) {
 $first = $data[0];
@@ -114,13 +111,13 @@
 public function parseMwDate($tstime) {
 // Based on MWTimestamp::setTimestamp for TS_MW
 $da = array();
-preg_match( '/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/D', $tstime, $da 
);
+preg_match('/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/D', $tstime, $da);
 
-$da = array_map( 'intval', $da );
+$da = array_map('intval', $da);
 $da[0] = '%04d-%02d-%02dT%02d:%02d:%02d.00+00:00';
-$strtime = call_user_func_array( 'sprintf', $da );
+$strtime = call_user_func_array('sprintf', $da);
 
-return new DateTime( $strtime, new DateTimeZone( 'GMT' ) );
+return new DateTime($strtime, new DateTimeZone('GMT'));
 }
 
 /**
@@ -171,7 +168,7 @@
 $section =  trim(preg_replace('/[ _]+/', ' ', $section));
 $link = '→';
+) . '">→';
 
 if ($isPost) {
 // mw-msg: colon-sep
@@ -184,8 +181,8 @@
 $html = $link . "\xE2\x80\x8E" . '' . $auto;
 $append .= '';
 return $html;
-   },
-   $comment
+},
+$comment
 );
 $comment .= $append;
 
diff --git a/composer.json b/composer.json
index 63d3d99..d73e97c 100644
--- a/composer.json
+++ b/composer.json
@@ -1,11 +1,16 @@
 {
+   "require": {
+   "php": ">=5.4",
+   "Krinkle/toollabs-base": "^0.8.0"
+   },
"require-dev": {
-   "squizlabs/php_codesniffer": "1.*"
+   "jakub-onderka/php-parallel-lint": "^0.9.2",
+   "squizlabs/php_codesniffer": "^2.6.2"
},
"scripts": {
-   "test": "phpcs . --standard=phpcs.xml --ignore=vendor/* 
--extensions=php"
-   },
-   "require": {
-   "Krinkle/toollabs-base": "^0.8.0"
+   "test": [
+   "parallel-lint . --exclude vendor",
+   "phpcs -p -s"
+   ]
}
 }
diff --git a/index.php b/index.php
index 86505c5..5a62b64 100644
--- a/index.php
+++ b/index.php
@@ -63,13 +63,13 @@
 $query['user'] = $data->Username;
 }
 // Strip defaults
-$query = array_diff_assoc( $query, guc::getDefaultOptions() );
-$data->Permalink = './' . ( !$query ? '' : '?' . http_build_query( $query ) );
+$query = array_diff_assoc($query, guc::getDefaultOptions());
+$data->Permalink = './' . ( !$query ? '' : '?' . http_build_query($query) );
 
 $headRobots = !$robotsPolicy ? '' :
-'';
+'';
 $headCanonical = !$canonicalUrl ? '' :
-'';
+'';
 
 ?>
 
@@ -79,8 +79,12 @@
 
 Global user contributions
 
 var data = ;
 
@@ -93,14 +97,14 @@
 
 
 IP address or username: 
 Activate prefix pattern search: options['isPrefixPattern']) {
-print ' checked';
-}
+if ($data->options['isPrefixPattern']) {
+print ' checked';
+}
 ?>>
 Results from:  'Recent changes (last 30 days)',
 'hr' => 'Last hour only'
 ]);
-$resultSelect->setDefault( $data->options['src'] );
-$resultSelect->setName( 'src' );
+$resultSelect->setDefault($data->options['src']);
+$resultSelect->setName('src');
 print $resultSelect->getHTML();
 ?>
   

[MediaWiki-commits] [Gerrit] integration/config[master]: Add jobs for labs/tools/guc (composer-php55)

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

Change subject: Add jobs for labs/tools/guc (composer-php55)
..


Add jobs for labs/tools/guc (composer-php55)

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

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



diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 0e13520..824dc3c 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -1608,6 +1608,12 @@
 gate-and-submit:
   - composer-php55
 
+  - name: labs/tools/guc
+test:
+  - composer-php55
+gate-and-submit:
+  - composer-php55
+
   - name: labs/tools/Luke081515IRCBot
 check-voter:
   - php55lint

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iebca4d0f01e9970d7539fa2f627ba8ff0b64cc6d
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Krinkle 
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] integration/config[master]: Add jobs for labs/tools/guc (composer-php55)

2016-08-31 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: Add jobs for labs/tools/guc (composer-php55)
..

Add jobs for labs/tools/guc (composer-php55)

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


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/09/307909/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 0e13520..824dc3c 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -1608,6 +1608,12 @@
 gate-and-submit:
   - composer-php55
 
+  - name: labs/tools/guc
+test:
+  - composer-php55
+gate-and-submit:
+  - composer-php55
+
   - name: labs/tools/Luke081515IRCBot
 check-voter:
   - php55lint

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iebca4d0f01e9970d7539fa2f627ba8ff0b64cc6d
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] labs...guc[master]: build: Fix phpcs coding style violations

2016-08-31 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: build: Fix phpcs coding style violations
..

build: Fix phpcs coding style violations

Change-Id: I25b85c616d66e0781bba88a6713c7420f2213174
---
M app.php
M composer.json
M index.php
M lb/guc.php
M lb/wikicontribs.php
M phpcs.xml
6 files changed, 39 insertions(+), 39 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/guc 
refs/changes/08/307908/1

diff --git a/app.php b/app.php
index 6511c22..bca1313 100644
--- a/app.php
+++ b/app.php
@@ -59,7 +59,6 @@
  * @return PDO
  */
 public function getDB($database = 'meta', $clusterNr = 's1.labsdb') {
-
 if (!$clusterNr) {
 throw new lb_Exception('Invalid DB cluster specification');
 }
@@ -69,10 +68,9 @@
 }
 $pdo = $this->clusters[$clusterNr];
 
-// Datenbank auswählen
+// Select the right database on this cluster server
 $m = $pdo->prepare('USE `'.$database.'_p`;');
 $m->execute();
-unset($m);
 
 return $pdo;
 }
@@ -91,7 +89,6 @@
 $first = null;
 $out = '';
 foreach ($this->times as $nr => $data) {
-
 $diff = ($timebefore === null) ? 0.0 : $data[0] - $timebefore;
 if ($timebefore === null) {
 $first = $data[0];
@@ -114,13 +111,13 @@
 public function parseMwDate($tstime) {
 // Based on MWTimestamp::setTimestamp for TS_MW
 $da = array();
-preg_match( '/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/D', $tstime, $da 
);
+preg_match('/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/D', $tstime, $da);
 
-$da = array_map( 'intval', $da );
+$da = array_map('intval', $da);
 $da[0] = '%04d-%02d-%02dT%02d:%02d:%02d.00+00:00';
-$strtime = call_user_func_array( 'sprintf', $da );
+$strtime = call_user_func_array('sprintf', $da);
 
-return new DateTime( $strtime, new DateTimeZone( 'GMT' ) );
+return new DateTime($strtime, new DateTimeZone('GMT'));
 }
 
 /**
@@ -171,7 +168,7 @@
 $section =  trim(preg_replace('/[ _]+/', ' ', $section));
 $link = '→';
+) . '">→';
 
 if ($isPost) {
 // mw-msg: colon-sep
@@ -184,8 +181,8 @@
 $html = $link . "\xE2\x80\x8E" . '' . $auto;
 $append .= '';
 return $html;
-   },
-   $comment
+},
+$comment
 );
 $comment .= $append;
 
diff --git a/composer.json b/composer.json
index 63d3d99..3124f02 100644
--- a/composer.json
+++ b/composer.json
@@ -1,11 +1,12 @@
 {
+   "require": {
+   "php": ">=5.4",
+   "Krinkle/toollabs-base": "^0.8.0"
+   },
"require-dev": {
-   "squizlabs/php_codesniffer": "1.*"
+   "squizlabs/php_codesniffer": "^2.6.2"
},
"scripts": {
"test": "phpcs . --standard=phpcs.xml --ignore=vendor/* 
--extensions=php"
-   },
-   "require": {
-   "Krinkle/toollabs-base": "^0.8.0"
}
 }
diff --git a/index.php b/index.php
index 86505c5..5a62b64 100644
--- a/index.php
+++ b/index.php
@@ -63,13 +63,13 @@
 $query['user'] = $data->Username;
 }
 // Strip defaults
-$query = array_diff_assoc( $query, guc::getDefaultOptions() );
-$data->Permalink = './' . ( !$query ? '' : '?' . http_build_query( $query ) );
+$query = array_diff_assoc($query, guc::getDefaultOptions());
+$data->Permalink = './' . ( !$query ? '' : '?' . http_build_query($query) );
 
 $headRobots = !$robotsPolicy ? '' :
-'';
+'';
 $headCanonical = !$canonicalUrl ? '' :
-'';
+'';
 
 ?>
 
@@ -79,8 +79,12 @@
 
 Global user contributions
 
 var data = ;
 
@@ -93,14 +97,14 @@
 
 
 IP address or username: 
 Activate prefix pattern search: options['isPrefixPattern']) {
-print ' checked';
-}
+if ($data->options['isPrefixPattern']) {
+print ' checked';
+}
 ?>>
 Results from:  'Recent changes (last 30 days)',
 'hr' => 'Last hour only'
 ]);
-$resultSelect->setDefault( $data->options['src'] );
-$resultSelect->setName( 'src' );
+$resultSelect->setDefault($data->options['src']);
+$resultSelect->setName('src');
 print $resultSelect->getHTML();
 ?>
 
diff --git a/lb/guc.php b/lb/guc.php
index 7cdfca9..305562f 100644
--- a/lb/guc.php
+++ b/lb/guc.php
@@ -164,7 +164,7 @@
  * @param array $wikis
  * @return array
  */
-private function 

[MediaWiki-commits] [Gerrit] labs...guc[master]: Only query for edits and new pages from recent changes

2016-08-31 Thread Krinkle (Code Review)
Krinkle has submitted this change and it was merged.

Change subject: Only query for edits and new pages from recent changes
..


Only query for edits and new pages from recent changes

Follows-up d5314cb.
Exclude things like log events and wikidata updates.

Change-Id: Icb9b55de5750fb32a6f6f2652b111935fa27ee38
---
M lb/guc.php
M lb/wikicontribs.php
2 files changed, 20 insertions(+), 6 deletions(-)

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



diff --git a/lb/guc.php b/lb/guc.php
index f79e025..7cdfca9 100644
--- a/lb/guc.php
+++ b/lb/guc.php
@@ -189,7 +189,12 @@
 ($this->options['src'] === 'hr')
 ? ' AND rc_timestamp >= :hrcutoff'
 : ''
-);
+// Ignore RC entries for log events and things like
+// Wikidata and categorization updates
+).' AND `rc_type` IN (' . join(',', array_map(
+'intval',
+array(lb_wikicontribs::MW_RC_EDIT, 
lb_wikicontribs::MW_RC_NEW)
+)) . ')';
 } else {
 $sql = 'SELECT
 COUNT(rev_id) AS counter,
diff --git a/lb/wikicontribs.php b/lb/wikicontribs.php
index 826209b..308f800 100644
--- a/lb/wikicontribs.php
+++ b/lb/wikicontribs.php
@@ -18,6 +18,9 @@
 class lb_wikicontribs {
 const CONTRIB_LIMIT = 20;
 const MW_DATE_FORMAT = 'YmdHis';
+const MW_RC_EDIT = 0;
+const MW_RC_NEW = 1;
+// Other RC types: Log events, Categorization, External (e.g. Wikidata)
 
 private $app;
 private $wiki;
@@ -114,8 +117,8 @@
 ? '`rev_user` = ' . $pdo->quote(key($this->registeredUsers))
 : '`rev_user` IN (' . join(',', array_map(
 array($pdo, 'quote'),
-array_keys($this->registeredUsers))
-) . ')';
+array_keys($this->registeredUsers)
+)) . ')';
 }
 $sql = "SELECT
 `rev_comment`,
@@ -143,7 +146,7 @@
 : 'rev_user_text = :user'
 )
 )."
-ORDER BY `revision_userindex`.`rev_timestamp` DESC
+ORDER BY `rev_timestamp` DESC
 LIMIT 0, " . intval(self::CONTRIB_LIMIT) .
 ";";
 $statement = $pdo->prepare($sql);
@@ -169,7 +172,13 @@
 '`rc_deleted` = 0',
 ($this->options['isPrefixPattern'])
 ? 'rc_user_text LIKE :userlike'
-: 'rc_user_text = :user'
+: 'rc_user_text = :user',
+// Ignore RC entries for log events and things like
+// Wikidata and categorization updates
+'`rc_type` IN (' . join(',', array_map(
+'intval',
+array(self::MW_RC_EDIT, self::MW_RC_NEW)
+)) . ')'
 ];
 $conds = array_merge($conds, $extraConds);
 $sqlCond = implode(' AND ', $conds);
@@ -188,7 +197,7 @@
 `recentchanges_userindex`
 WHERE
 ' . $sqlCond . '
-ORDER BY `recentchanges_userindex`.`rc_timestamp` DESC
+ORDER BY `rc_timestamp` DESC
 LIMIT 0, ' . intval(self::CONTRIB_LIMIT) .
 ';';
 $statement = $pdo->prepare($sql);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icb9b55de5750fb32a6f6f2652b111935fa27ee38
Gerrit-PatchSet: 4
Gerrit-Project: labs/tools/guc
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Krinkle 

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


[MediaWiki-commits] [Gerrit] labs...guc[master]: Only query for edits and new pages from recent changes

2016-08-31 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: Only query for edits and new pages from recent changes
..

Only query for edits and new pages from recent changes

Follows-up d5314cb.
Exclude things like log events and wikidata updates.

Change-Id: Icb9b55de5750fb32a6f6f2652b111935fa27ee38
---
M lb/guc.php
M lb/wikicontribs.php
2 files changed, 20 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/guc 
refs/changes/07/307907/1

diff --git a/lb/guc.php b/lb/guc.php
index f79e025..74c2ba4 100644
--- a/lb/guc.php
+++ b/lb/guc.php
@@ -189,7 +189,12 @@
 ($this->options['src'] === 'hr')
 ? ' AND rc_timestamp >= :hrcutoff'
 : ''
-);
+// Ignore RC entries for log events and things like
+// Wikidata and categorization updates
+).' AND `rc_type` IN (' . join(',', array_map(
+array($pdo, 'quote'),
+array(MW_RC_EDIT, MW_RC_NEW)
+)) . ')';
 } else {
 $sql = 'SELECT
 COUNT(rev_id) AS counter,
diff --git a/lb/wikicontribs.php b/lb/wikicontribs.php
index 826209b..d459276 100644
--- a/lb/wikicontribs.php
+++ b/lb/wikicontribs.php
@@ -18,6 +18,9 @@
 class lb_wikicontribs {
 const CONTRIB_LIMIT = 20;
 const MW_DATE_FORMAT = 'YmdHis';
+const MW_RC_EDIT = 0;
+const MW_RC_NEW = 1;
+// Other RC types: Log events, Categorization, External (e.g. Wikidata)
 
 private $app;
 private $wiki;
@@ -114,8 +117,8 @@
 ? '`rev_user` = ' . $pdo->quote(key($this->registeredUsers))
 : '`rev_user` IN (' . join(',', array_map(
 array($pdo, 'quote'),
-array_keys($this->registeredUsers))
-) . ')';
+array_keys($this->registeredUsers)
+)) . ')';
 }
 $sql = "SELECT
 `rev_comment`,
@@ -143,7 +146,7 @@
 : 'rev_user_text = :user'
 )
 )."
-ORDER BY `revision_userindex`.`rev_timestamp` DESC
+ORDER BY `rev_timestamp` DESC
 LIMIT 0, " . intval(self::CONTRIB_LIMIT) .
 ";";
 $statement = $pdo->prepare($sql);
@@ -169,7 +172,13 @@
 '`rc_deleted` = 0',
 ($this->options['isPrefixPattern'])
 ? 'rc_user_text LIKE :userlike'
-: 'rc_user_text = :user'
+: 'rc_user_text = :user',
+// Ignore RC entries for log events and things like
+// Wikidata and categorization updates
+'`rc_type` IN (' . join(',', array_map(
+array($pdo, 'quote'),
+array(MW_RC_EDIT, MW_RC_NEW)
+)) . ')';
 ];
 $conds = array_merge($conds, $extraConds);
 $sqlCond = implode(' AND ', $conds);
@@ -188,7 +197,7 @@
 `recentchanges_userindex`
 WHERE
 ' . $sqlCond . '
-ORDER BY `recentchanges_userindex`.`rc_timestamp` DESC
+ORDER BY `rc_timestamp` DESC
 LIMIT 0, ' . intval(self::CONTRIB_LIMIT) .
 ';';
 $statement = $pdo->prepare($sql);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb9b55de5750fb32a6f6f2652b111935fa27ee38
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/guc
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] operations/dns[master]: depool ulsfo, some kind of issues...

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

Change subject: depool ulsfo, some kind of issues...
..


depool ulsfo, some kind of issues...

Change-Id: I5a54c44172e8cfa6454e48fe59c7680456e1a8c2
---
M admin_state
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/admin_state b/admin_state
index 7295eeb..17d80a2 100644
--- a/admin_state
+++ b/admin_state
@@ -69,3 +69,4 @@
 # geoip/text-*/ulsfo => UP # ... this overrides the line above completely
 #
 ##
+geoip/generic-map/ulsfo => DOWN

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5a54c44172e8cfa6454e48fe59c7680456e1a8c2
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: BBlack 
Gerrit-Reviewer: BBlack 
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/dns[master]: depool ulsfo, some kind of issues...

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

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

Change subject: depool ulsfo, some kind of issues...
..

depool ulsfo, some kind of issues...

Change-Id: I5a54c44172e8cfa6454e48fe59c7680456e1a8c2
---
M admin_state
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/06/307906/1

diff --git a/admin_state b/admin_state
index 7295eeb..17d80a2 100644
--- a/admin_state
+++ b/admin_state
@@ -69,3 +69,4 @@
 # geoip/text-*/ulsfo => UP # ... this overrides the line above completely
 #
 ##
+geoip/generic-map/ulsfo => DOWN

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: url_downloader: add IPv6 support

2016-08-31 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review.

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

Change subject: url_downloader: add IPv6 support
..

url_downloader: add IPv6 support

As the TODO said, add the IPv6 networks as well.

Looking at hieradata/common/network.yaml these are
all already defined there for v6 as well, so just adding them
all here too.

Change-Id: Ic2532eed3800eef7e704d9217629fc1d68388a30
---
M manifests/role/url_downloader.pp
1 file changed, 22 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/05/307905/1

diff --git a/manifests/role/url_downloader.pp b/manifests/role/url_downloader.pp
index 9097037..d073774 100644
--- a/manifests/role/url_downloader.pp
+++ b/manifests/role/url_downloader.pp
@@ -32,35 +32,56 @@
 
 if $::realm == 'production' {
 $wikimedia = [
-# TODO: Add IPv6 as well
 
$network::constants::all_network_subnets['production']['eqiad']['public']['public1-a-eqiad']['ipv4'],
+
$network::constants::all_network_subnets['production']['eqiad']['public']['public1-a-eqiad']['ipv6'],
 
$network::constants::all_network_subnets['production']['eqiad']['public']['public1-b-eqiad']['ipv4'],
+
$network::constants::all_network_subnets['production']['eqiad']['public']['public1-b-eqiad']['ipv6'],
 
$network::constants::all_network_subnets['production']['eqiad']['public']['public1-c-eqiad']['ipv4'],
+
$network::constants::all_network_subnets['production']['eqiad']['public']['public1-c-eqiad']['ipv6'],
 
$network::constants::all_network_subnets['production']['eqiad']['public']['public1-d-eqiad']['ipv4'],
+
$network::constants::all_network_subnets['production']['eqiad']['public']['public1-d-eqiad']['ipv6'],
 
 
$network::constants::all_network_subnets['production']['codfw']['public']['public1-a-codfw']['ipv4'],
+
$network::constants::all_network_subnets['production']['codfw']['public']['public1-a-codfw']['ipv6'],
 
$network::constants::all_network_subnets['production']['codfw']['public']['public1-b-codfw']['ipv4'],
+
$network::constants::all_network_subnets['production']['codfw']['public']['public1-b-codfw']['ipv6'],
 
$network::constants::all_network_subnets['production']['codfw']['public']['public1-c-codfw']['ipv4'],
+
$network::constants::all_network_subnets['production']['codfw']['public']['public1-c-codfw']['ipv6'],
 
$network::constants::all_network_subnets['production']['codfw']['public']['public1-d-codfw']['ipv4'],
+
$network::constants::all_network_subnets['production']['codfw']['public']['public1-d-codfw']['ipv6'],
 
 
$network::constants::all_network_subnets['production']['eqiad']['private']['private1-a-eqiad']['ipv4'],
+
$network::constants::all_network_subnets['production']['eqiad']['private']['private1-a-eqiad']['ipv6'],
 
$network::constants::all_network_subnets['production']['eqiad']['private']['private1-b-eqiad']['ipv4'],
+
$network::constants::all_network_subnets['production']['eqiad']['private']['private1-b-eqiad']['ipv6'],
 
$network::constants::all_network_subnets['production']['eqiad']['private']['private1-c-eqiad']['ipv4'],
+
$network::constants::all_network_subnets['production']['eqiad']['private']['private1-c-eqiad']['ipv6'],
 
$network::constants::all_network_subnets['production']['eqiad']['private']['private1-d-eqiad']['ipv4'],
+
$network::constants::all_network_subnets['production']['eqiad']['private']['private1-d-eqiad']['ipv6'],
 
 
$network::constants::all_network_subnets['production']['codfw']['private']['private1-a-codfw']['ipv4'],
+
$network::constants::all_network_subnets['production']['codfw']['private']['private1-a-codfw']['ipv6'],
 
$network::constants::all_network_subnets['production']['codfw']['private']['private1-b-codfw']['ipv4'],
+
$network::constants::all_network_subnets['production']['codfw']['private']['private1-b-codfw']['ipv6'],
 
$network::constants::all_network_subnets['production']['codfw']['private']['private1-c-codfw']['ipv4'],
+
$network::constants::all_network_subnets['production']['codfw']['private']['private1-c-codfw']['ipv6'],
 
$network::constants::all_network_subnets['production']['codfw']['private']['private1-d-codfw']['ipv4'],
+
$network::constants::all_network_subnets['production']['codfw']['private']['private1-d-codfw']['ipv6'],
 
 
$network::constants::all_network_subnets['production']['esams']['public']['public1-esams']['ipv4'],
 #TODO: Do we need this ?
+
$network::constants::all_network_subnets['production']['esams']['public']['public1-esams']['ipv6'],
 #TODO: Do we need this ?
+
   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mediawiki.util: Remove deprecated tooltipAccessKeyPrefix/too...

2016-08-31 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: mediawiki.util: Remove deprecated 
tooltipAccessKeyPrefix/tooltipAccessKeyRegexp
..

mediawiki.util: Remove deprecated tooltipAccessKeyPrefix/tooltipAccessKeyRegexp

* Deprecated since MediaWiki 1.24.
* No longer used anywhere in Wikimedia Git.
* No longer used anywhere in MediaWiki-namespace on Wikimedia wikis.

Change-Id: Ib323b7a63c5a2e8d36c5f105d0554a7216339b07
---
M resources/src/mediawiki/mediawiki.util.js
M tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js
2 files changed, 0 insertions(+), 40 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/04/307904/1

diff --git a/resources/src/mediawiki/mediawiki.util.js 
b/resources/src/mediawiki/mediawiki.util.js
index 2ce54e4..294b5de 100644
--- a/resources/src/mediawiki/mediawiki.util.js
+++ b/resources/src/mediawiki/mediawiki.util.js
@@ -512,32 +512,6 @@
mw.log.deprecate( util, 'wikiGetlink', util.getUrl, 'Use mw.util.getUrl 
instead.' );
 
/**
-* Access key prefix. Might be wrong for browsers implementing the 
accessKeyLabel property.
-* @property {string} tooltipAccessKeyPrefix
-* @deprecated since 1.24 Use the module jquery.accessKeyLabel instead.
-*/
-   mw.log.deprecate( util, 'tooltipAccessKeyPrefix', 
$.fn.updateTooltipAccessKeys.getAccessKeyPrefix(), 'Use jquery.accessKeyLabel 
instead.' );
-
-   /**
-* Regex to match accesskey tooltips.
-*
-* Should match:
-*
-* - "[ctrl-option-x]"
-* - "[alt-shift-x]"
-* - "[ctrl-alt-x]"
-* - "[ctrl-x]"
-*
-* The accesskey is matched in group $6.
-*
-* Will probably not work for browsers implementing the accessKeyLabel 
property.
-*
-* @property {RegExp} tooltipAccessKeyRegexp
-* @deprecated since 1.24 Use the module jquery.accessKeyLabel instead.
-*/
-   mw.log.deprecate( util, 'tooltipAccessKeyRegexp', 
/\[(ctrl-)?(option-)?(alt-)?(shift-)?(esc-)?(.)\]$/, 'Use jquery.accessKeyLabel 
instead.' );
-
-   /**
 * Add the appropriate prefix to the accesskey shown in the tooltip.
 *
 * If the `$nodes` parameter is given, only those nodes are updated;
diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js
index d697507..4eac362 100644
--- a/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js
+++ b/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js
@@ -237,20 +237,6 @@
assert.strictEqual( mw.util.getParamValue( 'TEST', url ), 'a 
b+c d', 'Bug 30441: getParamValue must understand "+" encoding of space 
(multiple spaces)' );
} );
 
-   QUnit.test( 'tooltipAccessKey', 4, function ( assert ) {
-   this.suppressWarnings();
-
-   assert.equal( typeof mw.util.tooltipAccessKeyPrefix, 'string', 
'tooltipAccessKeyPrefix must be a string' );
-   assert.equal( $.type( mw.util.tooltipAccessKeyRegexp ), 
'regexp', 'tooltipAccessKeyRegexp is a regexp' );
-   assert.ok( mw.util.updateTooltipAccessKeys, 
'updateTooltipAccessKeys is non-empty' );
-
-   'Example [a]'.replace( mw.util.tooltipAccessKeyRegexp, function 
( sub, m1, m2, m3, m4, m5, m6 ) {
-   assert.equal( m6, 'a', 'tooltipAccessKeyRegexp finds 
the accesskey hint' );
-   } );
-
-   this.restoreWarnings();
-   } );
-
QUnit.test( '$content', 2, function ( assert ) {
assert.ok( mw.util.$content instanceof jQuery, 
'mw.util.$content instance of jQuery' );
assert.strictEqual( mw.util.$content.length, 1, 
'mw.util.$content must have length of 1' );

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

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

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


[MediaWiki-commits] [Gerrit] analytics...source[master]: [WIP] Join and denormalize all histories into one

2016-08-31 Thread Milimetric (Code Review)
Milimetric has uploaded a new change for review.

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

Change subject: [WIP] Join and denormalize all histories into one
..

[WIP] Join and denormalize all histories into one

Just a skeleton right now, the main idea is to implement this algorithm:

 union Archive to Revision records -> EditHistory
 histories = union archives and revisions
 historiesParents = select just rev_page, rev_id, rev_len from
 histories
 histories.keyBy(wiki_db, page_id, rev_parent_id)
 historiesParents.keyBy(wiki_db, page_id, rev_id)
 * join those and map to newEditHistories

 newEditHistories.keyBy(wiki_db, page_id)
 pageStates.keyBy(wiki_db, page_id)
 * join those and filter out bad timestamp matches
 // optional: groupBy and sort, join manually to perhaps be more
 performant
 * output to newNewEditHistories

 newNewEditHistories --> same exact thing for userStates
 * except rev_user is 0 for anonymous: add user_anonymous to
 EditHistory

 similar for historify userStates
 similar for historify pageStates

 union all three, output

Change-Id: I6c671f65ed480c5c24054eab60ff31e0b90d9033
---
A 
refinery-job/src/main/scala/org/wikimedia/analytics/refinery/job/edithistory/DenormalizeRunner.scala
A 
refinery-job/src/main/scala/org/wikimedia/analytics/refinery/job/edithistory/archive/Archive.scala
A 
refinery-job/src/main/scala/org/wikimedia/analytics/refinery/job/edithistory/denormalized/EditHistory.scala
M 
refinery-job/src/main/scala/org/wikimedia/analytics/refinery/job/edithistory/page/PageState.scala
A 
refinery-job/src/main/scala/org/wikimedia/analytics/refinery/job/edithistory/revision/Revision.scala
M 
refinery-job/src/main/scala/org/wikimedia/analytics/refinery/job/edithistory/user/UserState.scala
6 files changed, 417 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/refinery/source 
refs/changes/03/307903/1

diff --git 
a/refinery-job/src/main/scala/org/wikimedia/analytics/refinery/job/edithistory/DenormalizeRunner.scala
 
b/refinery-job/src/main/scala/org/wikimedia/analytics/refinery/job/edithistory/DenormalizeRunner.scala
new file mode 100644
index 000..8bbfe9d
--- /dev/null
+++ 
b/refinery-job/src/main/scala/org/wikimedia/analytics/refinery/job/edithistory/DenormalizeRunner.scala
@@ -0,0 +1,118 @@
+package org.wikimedia.analytics.refinery.job.edithistory
+
+import revision.Revision
+import archive.Archive
+import user.UserState
+import page.PageState
+
+class DenormalizeRunner(sqlContext: HiveContext) extends Serializable {
+
+  import com.databricks.spark.avro._
+  import org.apache.log4j.Logger
+  import org.apache.spark.rdd.RDD
+  import org.apache.spark.sql.Row
+  import org.apache.spark.sql.types._
+
+  val log: Logger = Logger.getLogger(this.getClass)
+
+  def denormalizeRevisionCreate(
+revisions: RDD[Revision],
+archives: RDD[Archive],
+userStates: RDD[UserState],
+pageStates: RDD[PageStates]
+  ): RDD[EditHistory] = {
+
+val groupedRevisions = revisions.groupBy(_.wikiDb, _.revPage)
+val 
+  }
+
+  def run(
+  revisionAvroPath: String,
+  archiveAvroPath: String,
+  userHistoryAvroPath: String,
+  pageHistoryAvroPath: String,
+  outputPath: String,
+  sqlPartitions: Int,
+  errorsPath: Option[String] = None
+  ): Unit = {
+
+log.info(s"Denormalizing history started.")
+
+sqlContext.sql("SET spark.sql.shuffle.partitions=" + sqlPartitions)
+
+val revisionDf = sqlContext.read.avro(revisionAvroPath)
+revisionDf.registerTempTable("revision")
+sqlContext.table("revision")
+
+val archiveDf = sqlContext.read.avro(archiveAvroPath)
+archiveDf.registerTempTable("archive")
+sqlContext.table("archive")
+
+val userHistoryDf = sqlContext.read.avro(userHistoryAvroPath)
+userHistoryDf.registerTempTable("userHistory")
+sqlContext.table("userHistory")
+
+val pageHistoryDf = sqlContext.read.avro(pageHistoryAvroPath)
+pageHistoryDf.registerTempTable("pageHistory")
+sqlContext.table("pageHistory")
+
+val revisions = sqlContext.sql("select * from revision")
+  .rdd
+  .map(Revision.fromRowToEditHistory)
+
+val archives = sqlContext.sql("select * from archive")
+  .rdd
+  .map(Archive.fromRowToEditHistory)
+
+val userStates = sqlContext.sql("select * from userHistory")
+  .rdd
+  .map(UserState.fromRow)
+
+val pageStates = sqlContext.sql("select * from pageHistory")
+  .rdd
+  .map(PageState.fromRow)
+
+val userHistories = userStates.map(UserState.toHistory)
+val pageHistories = pageStates.map(PageState.toHistory)
+
+val archivesWithDeleteTime = populateDeleteTime(archives, pageHistories)
+
+val histories = revisions.union(archivesWithDeleteTime)
+
+val historiesForSelfJoin = histories.map(EditHistory.projectForSelfJoin)
+
+val historiesWithDiff = populateByteDiff(histories, historiesForSelfJoin)
+val 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Convert LocalFile to using getWithSetCallback() for caching

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

Change subject: Convert LocalFile to using getWithSetCallback() for caching
..


Convert LocalFile to using getWithSetCallback() for caching

Changed the hashing for the keys to SHA-1, which also avoids
problems with old MediaWiki versions seeing the new WAN
versioned keys.

Also fixed a few annoying IDEA errors

Change-Id: Ie608fb86421bc96e05e4a3b352f39b4938a243e4
---
M includes/filerepo/file/LocalFile.php
1 file changed, 57 insertions(+), 69 deletions(-)

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



diff --git a/includes/filerepo/file/LocalFile.php 
b/includes/filerepo/file/LocalFile.php
index 8d25726..de3cdbe 100644
--- a/includes/filerepo/file/LocalFile.php
+++ b/includes/filerepo/file/LocalFile.php
@@ -24,11 +24,6 @@
 use \MediaWiki\Logger\LoggerFactory;
 
 /**
- * Bump this number when serialized cache records may be incompatible.
- */
-define( 'MW_FILE_VERSION', 9 );
-
-/**
  * Class to represent a local file in the wiki's own database
  *
  * Provides methods to retrieve paths (physical, logical, URL),
@@ -46,6 +41,8 @@
  * @ingroup FileAbstraction
  */
 class LocalFile extends File {
+   const VERSION = 10; // cache version
+
const CACHE_FIELD_MAX_LEN = 1000;
 
/** @var bool Does the file exist on disk? (loadFromXxx) */
@@ -240,83 +237,71 @@
 * @return string|bool
 */
function getCacheKey() {
-   $hashedName = md5( $this->getName() );
-
-   return $this->repo->getSharedCacheKey( 'file', $hashedName );
+   return $this->repo->getSharedCacheKey( 'file', sha1( 
$this->getName() ) );
}
 
/**
-* Try to load file metadata from memcached. Returns true on success.
-* @return bool
+* Try to load file metadata from memcached, falling back to the 
database
 */
private function loadFromCache() {
$this->dataLoaded = false;
$this->extraDataLoaded = false;
-   $key = $this->getCacheKey();
-
-   if ( !$key ) {
-   return false;
-   }
-
-   $cache = ObjectCache::getMainWANInstance();
-   $cachedValues = $cache->get( $key );
-
-   // Check if the key existed and belongs to this version of 
MediaWiki
-   if ( is_array( $cachedValues ) && $cachedValues['version'] == 
MW_FILE_VERSION ) {
-   $this->fileExists = $cachedValues['fileExists'];
-   if ( $this->fileExists ) {
-   $this->setProps( $cachedValues );
-   }
-   $this->dataLoaded = true;
-   $this->extraDataLoaded = true;
-   foreach ( $this->getLazyCacheFields( '' ) as $field ) {
-   $this->extraDataLoaded = $this->extraDataLoaded 
&& isset( $cachedValues[$field] );
-   }
-   }
-
-   return $this->dataLoaded;
-   }
-
-   /**
-* Save the file metadata to memcached
-* @param array $cacheSetOpts Result of Database::getCacheSetOptions()
-*/
-   private function saveToCache( array $cacheSetOpts ) {
-   $this->load();
 
$key = $this->getCacheKey();
if ( !$key ) {
+   $this->loadFromDB( self::READ_NORMAL );
+
return;
}
 
-   $fields = $this->getCacheFields( '' );
-   $cacheVal = [ 'version' => MW_FILE_VERSION ];
-   $cacheVal['fileExists'] = $this->fileExists;
+   $cache = ObjectCache::getMainWANInstance();
+   $cachedValues = $cache->getWithSetCallback(
+   $key,
+   $cache::TTL_WEEK,
+   function ( $oldValue, &$ttl, array &$setOpts ) use ( 
$cache ) {
+   $setOpts += Database::getCacheSetOptions( 
$this->repo->getSlaveDB() );
 
+   $this->loadFromDB( self::READ_NORMAL );
+
+   $fields = $this->getCacheFields( '' );
+   $cacheVal['fileExists'] = $this->fileExists;
+   if ( $this->fileExists ) {
+   foreach ( $fields as $field ) {
+   $cacheVal[$field] = 
$this->$field;
+   }
+   }
+   // Strip off excessive entries from the subset 
of fields that can become large.
+   // If the cache value gets to large it will not 
fit in memcached and nothing will
+   // get cached at all, causing master queries 
for any file 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: wikistats: remove $realm check, simplify role

2016-08-31 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: wikistats: remove $realm check, simplify role
..


wikistats: remove $realm check, simplify role

This will never be production, remove the $realm
check, simplify it.

Change-Id: I9bc1ca7723c2fec0250daf2346ac4ec2640f7663
---
M modules/role/manifests/wikistats/instance.pp
1 file changed, 3 insertions(+), 15 deletions(-)

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



diff --git a/modules/role/manifests/wikistats/instance.pp 
b/modules/role/manifests/wikistats/instance.pp
index 5d94ccc..b071cc9 100644
--- a/modules/role/manifests/wikistats/instance.pp
+++ b/modules/role/manifests/wikistats/instance.pp
@@ -1,25 +1,13 @@
 # wikistats host role class
-# this is labs only! - wikistats.wmflabs.org (dzahn)
+# this is labs-only - wikistats.wmflabs.org (dzahn)
 # NOT stats.wikimedia.org (analytics/ezachte)
-# realm case is just here for compatibility
+# these projects are often confused
 class role::wikistats::instance {
 
 system::role { 'wikistats': description => 'wikistats instance' }
 
-# config - labs vs. production
-case $::realm {
-'labs': {
-$wikistats_host = 'wikistats.wmflabs.org'
-}
-'production': {
-$wikistats_host = 'wikistats.wikimedia.org'
-}
-default: {
-fail('unknown realm, should be labs or production')
-}
-}
+$wikistats_host = 'wikistats.wmflabs.org'
 
-# main, ::wikistats refers to the module class in init.pp
 class { '::wikistats':
 wikistats_host => $wikistats_host,
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9bc1ca7723c2fec0250daf2346ac4ec2640f7663
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
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]: wikistats: remove $realm check, simplify role

2016-08-31 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review.

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

Change subject: wikistats: remove $realm check, simplify role
..

wikistats: remove $realm check, simplify role

This will never be production, remove the $realm
check, simplify it.

Change-Id: I9bc1ca7723c2fec0250daf2346ac4ec2640f7663
---
M modules/role/manifests/wikistats/instance.pp
1 file changed, 3 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/02/307902/1

diff --git a/modules/role/manifests/wikistats/instance.pp 
b/modules/role/manifests/wikistats/instance.pp
index 5d94ccc..b071cc9 100644
--- a/modules/role/manifests/wikistats/instance.pp
+++ b/modules/role/manifests/wikistats/instance.pp
@@ -1,25 +1,13 @@
 # wikistats host role class
-# this is labs only! - wikistats.wmflabs.org (dzahn)
+# this is labs-only - wikistats.wmflabs.org (dzahn)
 # NOT stats.wikimedia.org (analytics/ezachte)
-# realm case is just here for compatibility
+# these projects are often confused
 class role::wikistats::instance {
 
 system::role { 'wikistats': description => 'wikistats instance' }
 
-# config - labs vs. production
-case $::realm {
-'labs': {
-$wikistats_host = 'wikistats.wmflabs.org'
-}
-'production': {
-$wikistats_host = 'wikistats.wikimedia.org'
-}
-default: {
-fail('unknown realm, should be labs or production')
-}
-}
+$wikistats_host = 'wikistats.wmflabs.org'
 
-# main, ::wikistats refers to the module class in init.pp
 class { '::wikistats':
 wikistats_host => $wikistats_host,
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: DesktopWikitextArticleTarget#switchToVisualEditor: Use corre...

2016-08-31 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: DesktopWikitextArticleTarget#switchToVisualEditor: Use correct 
revision ID property
..

DesktopWikitextArticleTarget#switchToVisualEditor: Use correct revision ID 
property

So we ensure we send the actual revision ID, not potentially undefined, to the
method. If we send undefined, it'll give us an etag for revision number 0...
And that will cause issues when we later attempt (in a future editor switch) to
pass an etag for revision 0 along with the correct revision.

Bug: T143920
Change-Id: I0c27956abdd26ae4f5f1b91010a5eab8ee0354ab
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git 
a/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js
index 1eb0839..cf6b5ba 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js
@@ -85,7 +85,7 @@
 
dataPromise = mw.libs.ve.targetLoader.requestParsoidData(
this.pageName,
-   this.requestedRevId,
+   this.revid,
this.constructor.name,
this.edited,
this.getWikitextFromDocument( this.getSurface().getDom() )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c27956abdd26ae4f5f1b91010a5eab8ee0354ab
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Revert "archiva: migration class to rsync data to new host"

2016-08-31 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review.

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

Change subject: Revert "archiva: migration class to rsync data to new host"
..

Revert "archiva: migration class to rsync data to new host"

This reverts commit 582caa3e4aa7eded13df604eea58c93f2d029c42.

This is a reminder to me that i should revert this and also manually cleanup 
the rsyncd and config on the new host,
after we have shutdown the old host.

Change-Id: I90e3b04c4f1baaa6c6d3d980f00f8cd401c701df
---
M manifests/site.pp
D modules/role/manifests/archiva/migration.pp
2 files changed, 1 insertion(+), 20 deletions(-)


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

diff --git a/manifests/site.pp b/manifests/site.pp
index 2f3091f..03a4051 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -1942,7 +1942,7 @@
 
 node 'meitnerium.wikimedia.org' {
 $cluster = 'misc'
-role archiva, archiva::migration
+role archiva
 include standard
 }
 
diff --git a/modules/role/manifests/archiva/migration.pp 
b/modules/role/manifests/archiva/migration.pp
deleted file mode 100644
index 855677d..000
--- a/modules/role/manifests/archiva/migration.pp
+++ /dev/null
@@ -1,19 +0,0 @@
-class role::archiva::migration {
-
-$sourceip='208.80.154.154'
-
-ferm::service { 'archiva-migration-rsync':
-proto  => 'tcp',
-port   => '873',
-srange => "${sourceip}/32",
-}
-
-include rsync::server
-
-rsync::server::module { 'var-lib-archiva':
-path=> '/var/lib/archiva',
-read_only   => 'no',
-hosts_allow => $sourceip,
-}
-
-}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ShoutWikiAds[master]: Removed some legacy CSS file that isn't present in the Shout...

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

Change subject: Removed some legacy CSS file that isn't present in the 
ShoutWiki version
..


Removed some legacy CSS file that isn't present in the ShoutWiki version

Change-Id: I7b3290d38ce22ae9b96625c0b74a75bbaf792a3d
---
D css/truglass-ads.css
1 file changed, 0 insertions(+), 6 deletions(-)

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



diff --git a/css/truglass-ads.css b/css/truglass-ads.css
deleted file mode 100644
index db46934..000
--- a/css/truglass-ads.css
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * Ad CSS for Truglass skin
- */
-#topadsleft {
-   text-align: center;
-}
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7b3290d38ce22ae9b96625c0b74a75bbaf792a3d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ShoutWikiAds
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[wmf/1.28.0-wmf.17]: Update lib/ve submodule for Ib9bbaccfff9

2016-08-31 Thread Catrope (Code Review)
Catrope has uploaded a new change for review.

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

Change subject: Update lib/ve submodule for Ib9bbaccfff9
..

Update lib/ve submodule for Ib9bbaccfff9

Change-Id: I4d7934226c79c79012325c30765c7eb82805016a
---
M lib/ve
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/lib/ve b/lib/ve
index 43d2a61..2de636c 16
--- a/lib/ve
+++ b/lib/ve
@@ -1 +1 @@
-Subproject commit 43d2a61e1c8a51054894ba266de692599a71f1e4
+Subproject commit 2de636cf2885de22f8ed88b95dd4353430016c04

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d7934226c79c79012325c30765c7eb82805016a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.28.0-wmf.17
Gerrit-Owner: Catrope 

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


[MediaWiki-commits] [Gerrit] mediawiki...ShoutWikiAds[master]: Removed some legacy CSS file that isn't present in the Shout...

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

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

Change subject: Removed some legacy CSS file that isn't present in the 
ShoutWiki version
..

Removed some legacy CSS file that isn't present in the ShoutWiki version

Change-Id: I7b3290d38ce22ae9b96625c0b74a75bbaf792a3d
---
D css/truglass-ads.css
1 file changed, 0 insertions(+), 6 deletions(-)


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

diff --git a/css/truglass-ads.css b/css/truglass-ads.css
deleted file mode 100644
index db46934..000
--- a/css/truglass-ads.css
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * Ad CSS for Truglass skin
- */
-#topadsleft {
-   text-align: center;
-}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b3290d38ce22ae9b96625c0b74a75bbaf792a3d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ShoutWikiAds
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...ShoutWikiAds[master]: ShoutWikiAds: version 0.4.3 -- add support for the Refreshed...

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

Change subject: ShoutWikiAds: version 0.4.3 -- add support for the Refreshed 
skin
..


ShoutWikiAds: version 0.4.3 -- add support for the Refreshed skin

The sidebar slot naming is somewhat of a clusterfuck -- the sidebar
([[MediaWiki:Sidebar]]) as well as extension-controlled areas (NewsBox)
and interlanguage links are placed in the sidebar area, div#sidebar. We
want a 125x125px ad there, just like in MonoBook et al. since it looks
good there. The slot is internally referred to as 'toolbox-button' even
though the module has to be named ext.ShoutWikiAds.refreshed.sidebar for
it to be loaded. This is confusing and messy and ugly, but at least it
works.

The other slots are leaderboards, one in the sitenotice area
('leaderboard', handled by the onSkinAfterContent hook) and another in the
footer area ('leaderboard-footer', handled by the onRefreshedFooter hook.

The aforementioned "toolbox"/sidebar ad slot requires
https://gerrit.wikimedia.org/r/301579 / the newest version of Refreshed.

ShoutWiki bug T99, ShoutWiki SVN r3930

Change-Id: I215b877123161cab81b82d07bf6bb3466d070106
---
M ShoutWikiAds.class.php
M ShoutWikiAds.php
A css/refreshed-button-ad.css
A css/refreshed.css
4 files changed, 101 insertions(+), 3 deletions(-)

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



diff --git a/ShoutWikiAds.class.php b/ShoutWikiAds.class.php
index e2b3df8..b853532 100644
--- a/ShoutWikiAds.class.php
+++ b/ShoutWikiAds.class.php
@@ -722,6 +722,11 @@
continue;
}
 
+   // Special cases have an awful 
habit of becoming all too common around here...
+   if ( $skinClass == 'refreshed' 
&& isset( $wgAdConfig['mode'] ) && $wgAdConfig['mode'] === 'responsive' ) {
+   $moduleName = 
'ext.ShoutWikiAds.refreshed';
+   }
+
if ( $skinClass == 'monaco' ) {
$moduleName = 
"ext.ShoutWikiAds.{$skinClass}";
}
@@ -1100,6 +1105,55 @@
}
 
/**
+* Renders a leaderboard ad in the footer on the Refreshed skin.
+* I18n message is provided by the Refreshed skin in 
/skins/Refreshed/i18n/.json.
+*
+* @param string $footerExtra
+* @return bool
+*/
+   public static function onRefreshedFooter( &$footerExtra ) {
+   global $wgAdConfig;
+   if (
+   isset( $wgAdConfig['refreshed']['leaderboard-footer'] ) 
&&
+   $wgAdConfig['refreshed']['leaderboard-footer']
+   )
+   {
+   $adHTML = self::loadAd( 'leaderboard' );
+   $footerExtra = str_replace(
+   // Quick HTML validation fix
+   // Just a simple renaming because Refreshed 
expects the ID to be #advert :|
+   '',
+   '' .
+   // Also inject the title here, as per 
the MW.org manual page
+   wfMessage( 'refreshed-advert' 
)->parseAsBlock(),
+   $adHTML
+   );
+   }
+   return true;
+   }
+
+   /**
+* Renders a 200x200 ad in the sidebar on the Refreshed skin.
+*
+* @param RefreshedTemplate $tpl
+* @return bool
+*/
+   public static function onRefreshedInSidebar( $tpl ) {
+   global $wgAdConfig;
+   if (
+   isset( $wgAdConfig['refreshed']['sidebar'] ) &&
+   $wgAdConfig['refreshed']['sidebar']
+   )
+   {
+   // sic!
+   // The *slot* is _in_ the sidebar, but what we call a 
sidebar ad
+   // (200x200px) is too wide to be used here!
+   echo self::loadAd( 'toolbox-button' );
+   }
+   return true;
+   }
+
+   /**
 * Called *only* by the Truglass skin.
 *
 * @return bool
diff --git a/ShoutWikiAds.php b/ShoutWikiAds.php
index 7fb106f..ece932a 100644
--- a/ShoutWikiAds.php
+++ b/ShoutWikiAds.php
@@ -4,8 +4,8 @@
  *
  * @file
  * @ingroup Extensions
- * @version 0.4.2
- * @date 25 December 2015
+ * @version 0.4.3
+ * @date 28 July 2016
  * @author Jack Phoenix 
  * @license https://en.wikipedia.org/wiki/Public_domain Public domain
  * @link 

[MediaWiki-commits] [Gerrit] mediawiki...ShoutWikiAds[master]: ShoutWikiAds: version 0.4.3 -- add support for the Refreshed...

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

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

Change subject: ShoutWikiAds: version 0.4.3 -- add support for the Refreshed 
skin
..

ShoutWikiAds: version 0.4.3 -- add support for the Refreshed skin

The sidebar slot naming is somewhat of a clusterfuck -- the sidebar
([[MediaWiki:Sidebar]]) as well as extension-controlled areas (NewsBox)
and interlanguage links are placed in the sidebar area, div#sidebar. We
want a 125x125px ad there, just like in MonoBook et al. since it looks
good there. The slot is internally referred to as 'toolbox-button' even
though the module has to be named ext.ShoutWikiAds.refreshed.sidebar for
it to be loaded. This is confusing and messy and ugly, but at least it
works.

The other slots are leaderboards, one in the sitenotice area
('leaderboard', handled by the onSkinAfterContent hook) and another in the
footer area ('leaderboard-footer', handled by the onRefreshedFooter hook.

The aforementioned "toolbox"/sidebar ad slot requires
https://gerrit.wikimedia.org/r/301579 / the newest version of Refreshed.

ShoutWiki bug T99, ShoutWiki SVN r3930

Change-Id: I215b877123161cab81b82d07bf6bb3466d070106
---
M ShoutWikiAds.class.php
M ShoutWikiAds.php
A css/refreshed-button-ad.css
A css/refreshed.css
4 files changed, 101 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ShoutWikiAds 
refs/changes/97/307897/1

diff --git a/ShoutWikiAds.class.php b/ShoutWikiAds.class.php
index e2b3df8..b853532 100644
--- a/ShoutWikiAds.class.php
+++ b/ShoutWikiAds.class.php
@@ -722,6 +722,11 @@
continue;
}
 
+   // Special cases have an awful 
habit of becoming all too common around here...
+   if ( $skinClass == 'refreshed' 
&& isset( $wgAdConfig['mode'] ) && $wgAdConfig['mode'] === 'responsive' ) {
+   $moduleName = 
'ext.ShoutWikiAds.refreshed';
+   }
+
if ( $skinClass == 'monaco' ) {
$moduleName = 
"ext.ShoutWikiAds.{$skinClass}";
}
@@ -1100,6 +1105,55 @@
}
 
/**
+* Renders a leaderboard ad in the footer on the Refreshed skin.
+* I18n message is provided by the Refreshed skin in 
/skins/Refreshed/i18n/.json.
+*
+* @param string $footerExtra
+* @return bool
+*/
+   public static function onRefreshedFooter( &$footerExtra ) {
+   global $wgAdConfig;
+   if (
+   isset( $wgAdConfig['refreshed']['leaderboard-footer'] ) 
&&
+   $wgAdConfig['refreshed']['leaderboard-footer']
+   )
+   {
+   $adHTML = self::loadAd( 'leaderboard' );
+   $footerExtra = str_replace(
+   // Quick HTML validation fix
+   // Just a simple renaming because Refreshed 
expects the ID to be #advert :|
+   '',
+   '' .
+   // Also inject the title here, as per 
the MW.org manual page
+   wfMessage( 'refreshed-advert' 
)->parseAsBlock(),
+   $adHTML
+   );
+   }
+   return true;
+   }
+
+   /**
+* Renders a 200x200 ad in the sidebar on the Refreshed skin.
+*
+* @param RefreshedTemplate $tpl
+* @return bool
+*/
+   public static function onRefreshedInSidebar( $tpl ) {
+   global $wgAdConfig;
+   if (
+   isset( $wgAdConfig['refreshed']['sidebar'] ) &&
+   $wgAdConfig['refreshed']['sidebar']
+   )
+   {
+   // sic!
+   // The *slot* is _in_ the sidebar, but what we call a 
sidebar ad
+   // (200x200px) is too wide to be used here!
+   echo self::loadAd( 'toolbox-button' );
+   }
+   return true;
+   }
+
+   /**
 * Called *only* by the Truglass skin.
 *
 * @return bool
diff --git a/ShoutWikiAds.php b/ShoutWikiAds.php
index 7fb106f..ece932a 100644
--- a/ShoutWikiAds.php
+++ b/ShoutWikiAds.php
@@ -4,8 +4,8 @@
  *
  * @file
  * @ingroup Extensions
- * @version 0.4.2
- * @date 25 December 2015
+ * @version 0.4.3
+ * @date 28 July 2016
  * @author Jack Phoenix 
  * @license https://en.wikipedia.org/wiki/Public_domain 

[MediaWiki-commits] [Gerrit] operations...service-checker[master]: Run tests on Python 3.4 and 3.5

2016-08-31 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Run tests on Python 3.4 and 3.5
..

Run tests on Python 3.4 and 3.5

And set skip_missing_interpreters so if someone is missing either
version, tox will skip it instead of complaining.

Change-Id: I81942c4d0541d318669e806665f80b4d7974b93d
---
M tox.ini
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/service-checker 
refs/changes/96/307896/1

diff --git a/tox.ini b/tox.ini
index 97c2c62..2fbab4e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,7 +1,8 @@
 [tox]
 minversion = 1.6
 skipsdist = True
-envlist = flake8, flake8-py3, py27
+envlist = flake8, flake8-py3, py27, py34, py35
+skip_missing_interpreters = True
 
 [testenv]
 usedevelop = True

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I81942c4d0541d318669e806665f80b4d7974b93d
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/service-checker
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

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


[MediaWiki-commits] [Gerrit] operations...service-checker[master]: Enable flake8 on Python 3

2016-08-31 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Enable flake8 on Python 3
..

Enable flake8 on Python 3

Change-Id: Idc8ba396f3e3ef5432f091d898be97d78b9adced
---
M servicechecker/swagger.py
M tox.ini
2 files changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/service-checker 
refs/changes/95/307895/1

diff --git a/servicechecker/swagger.py b/servicechecker/swagger.py
index 94f6daf..f431a9d 100755
--- a/servicechecker/swagger.py
+++ b/servicechecker/swagger.py
@@ -16,7 +16,7 @@
 from urllib.parse import quote_plus
 
 try:
-reload(sys)
+reload(sys)  # noqa
 sys.setdefaultencoding('utf-8')
 except:
 pass
diff --git a/tox.ini b/tox.ini
index 6605498..97c2c62 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,7 +1,7 @@
 [tox]
 minversion = 1.6
 skipsdist = True
-envlist = flake8, py27
+envlist = flake8, flake8-py3, py27
 
 [testenv]
 usedevelop = True
@@ -15,6 +15,11 @@
 commands = flake8 {posargs}
 deps = flake8
 
+[testenv:flake8-py3]
+basepython = python3
+commands = flake8 {posargs}
+deps = flake8
+
 [flake8]
 # We're in 2016, we don't work on serial terminals anymore
 max-line-length=100

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc8ba396f3e3ef5432f091d898be97d78b9adced
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/service-checker
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

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


[MediaWiki-commits] [Gerrit] mediawiki...Comments[master]: [SECURITY] Readd anti-CSRF measures to the API modules which...

2016-08-31 Thread Jack Phoenix (Code Review)
Jack Phoenix has submitted this change and it was merged.

Change subject: [SECURITY] Readd anti-CSRF measures to the API modules which 
perform write actions
..


[SECURITY] Readd anti-CSRF measures to the API modules which perform write 
actions

Version 4.0, the great rewrite, released in January 2015, accidentally
removed the anti-CSRF measures when the AJAX functions file was converted
into a bunch of separate API modules. This patch readds token checks to
prevent unauthorized write actions.

Bug: T144378
Change-Id: Ic8c9a298f4ed8cbfa22ed9c78c39d60abbc3e359
---
M Comment.js
M api/CommentBlock.api.php
M api/CommentDelete.api.php
M api/CommentSubmit.api.php
M api/CommentVote.api.php
M extension.json
6 files changed, 58 insertions(+), 27 deletions(-)

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



diff --git a/Comment.js b/Comment.js
index 8ad5368..44fc30b 100644
--- a/Comment.js
+++ b/Comment.js
@@ -48,14 +48,15 @@
}
 
if ( window.confirm( message ) ) {
-   $.ajax( {
-   url: mw.config.get( 'wgScriptPath' ) + 
'/api.php',
-   data: { 'action': 'commentblock', 'format': 
'json', 'commentID': commentID },
-   cache: false
+   ( new mw.Api() ).postWithToken( 'edit', {
+   action: 'commentblock',
+   format: 'json',
+   commentID: commentID
} ).done( function( response ) {
if ( response.commentblock.ok ) {
-   $( 
'a.comments-block-user[data-comments-user-id=' + userID + ']' ).parents( 
'.c-item' ).hide( 300 )
-   

.prev().show( 
300 );
+   $( 
'a.comments-block-user[data-comments-user-id=' + userID + ']' )
+   .parents( '.c-item' ).hide( 300 
)
+   .prev().show( 300 );
}
} );
}
@@ -69,10 +70,10 @@
 */
deleteComment: function( commentID ) {
if ( window.confirm( mw.msg( 'comments-delete-warning' ) ) ) {
-   $.ajax( {
-   url: mw.config.get( 'wgScriptPath' ) + 
'/api.php',
-   data: { 'action': 'commentdelete', 'format': 
'json', 'commentID': commentID },
-   cache: false
+   ( new mw.Api() ).postWithToken( 'edit', {
+   action: 'commentdelete',
+   format: 'json',
+   commentID: commentID
} ).done( function( response ) {
if ( response.commentdelete.ok ) {
$( '#comment-' + commentID ).hide( 2000 
);
@@ -88,13 +89,15 @@
 * @param voteValue Integer: vote value
 */
vote: function( commentID, voteValue ) {
-   $.ajax( {
-   url: mw.config.get( 'wgScriptPath' ) + '/api.php',
-   data: { 'action': 'commentvote', 'format': 'json', 
'commentID': commentID, 'voteValue': voteValue },
-   cache: false
+   ( new mw.Api() ).postWithToken( 'edit', {
+   action: 'commentvote',
+   format: 'json',
+   commentID: commentID,
+   voteValue: voteValue
} ).done( function( response ) {
-   $( '#comment-' + commentID + ' .c-score' ).html( 
response.commentvote.html ) // this will still be escaped
-   
   .html( $( '#comment-' + commentID + ' 
.c-score' ).text() ); // unescape
+   $( '#comment-' + commentID + ' .c-score' )
+   .html( response.commentvote.html ) // this will 
still be escaped
+   .html( $( '#comment-' + commentID + ' .c-score' 
).text() ); // unescape
} );
},
 
@@ -137,16 +140,12 @@
}
var commentText = 
document.commentForm.commentText.value;
 
-   $.ajax( {
-   url: mw.config.get( 'wgScriptPath' ) + 
'/api.php',
-   data: {
-   'action': 'commentsubmit',
-  

[MediaWiki-commits] [Gerrit] mediawiki...Comments[master]: [SECURITY] Readd anti-CSRF measures to the API modules which...

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

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

Change subject: [SECURITY] Readd anti-CSRF measures to the API modules which 
perform write actions
..

[SECURITY] Readd anti-CSRF measures to the API modules which perform write 
actions

Version 4.0, the great rewrite, released in January 2015, accidentally
removed the anti-CSRF measures when the AJAX functions file was converted
into a bunch of separate API modules. This patch readds token checks to
prevent unauthorized write actions.

Bug: T144378
Change-Id: Ic8c9a298f4ed8cbfa22ed9c78c39d60abbc3e359
---
M Comment.js
M api/CommentBlock.api.php
M api/CommentDelete.api.php
M api/CommentSubmit.api.php
M api/CommentVote.api.php
M extension.json
6 files changed, 58 insertions(+), 27 deletions(-)


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

diff --git a/Comment.js b/Comment.js
index 8ad5368..44fc30b 100644
--- a/Comment.js
+++ b/Comment.js
@@ -48,14 +48,15 @@
}
 
if ( window.confirm( message ) ) {
-   $.ajax( {
-   url: mw.config.get( 'wgScriptPath' ) + 
'/api.php',
-   data: { 'action': 'commentblock', 'format': 
'json', 'commentID': commentID },
-   cache: false
+   ( new mw.Api() ).postWithToken( 'edit', {
+   action: 'commentblock',
+   format: 'json',
+   commentID: commentID
} ).done( function( response ) {
if ( response.commentblock.ok ) {
-   $( 
'a.comments-block-user[data-comments-user-id=' + userID + ']' ).parents( 
'.c-item' ).hide( 300 )
-   

.prev().show( 
300 );
+   $( 
'a.comments-block-user[data-comments-user-id=' + userID + ']' )
+   .parents( '.c-item' ).hide( 300 
)
+   .prev().show( 300 );
}
} );
}
@@ -69,10 +70,10 @@
 */
deleteComment: function( commentID ) {
if ( window.confirm( mw.msg( 'comments-delete-warning' ) ) ) {
-   $.ajax( {
-   url: mw.config.get( 'wgScriptPath' ) + 
'/api.php',
-   data: { 'action': 'commentdelete', 'format': 
'json', 'commentID': commentID },
-   cache: false
+   ( new mw.Api() ).postWithToken( 'edit', {
+   action: 'commentdelete',
+   format: 'json',
+   commentID: commentID
} ).done( function( response ) {
if ( response.commentdelete.ok ) {
$( '#comment-' + commentID ).hide( 2000 
);
@@ -88,13 +89,15 @@
 * @param voteValue Integer: vote value
 */
vote: function( commentID, voteValue ) {
-   $.ajax( {
-   url: mw.config.get( 'wgScriptPath' ) + '/api.php',
-   data: { 'action': 'commentvote', 'format': 'json', 
'commentID': commentID, 'voteValue': voteValue },
-   cache: false
+   ( new mw.Api() ).postWithToken( 'edit', {
+   action: 'commentvote',
+   format: 'json',
+   commentID: commentID,
+   voteValue: voteValue
} ).done( function( response ) {
-   $( '#comment-' + commentID + ' .c-score' ).html( 
response.commentvote.html ) // this will still be escaped
-   
   .html( $( '#comment-' + commentID + ' 
.c-score' ).text() ); // unescape
+   $( '#comment-' + commentID + ' .c-score' )
+   .html( response.commentvote.html ) // this will 
still be escaped
+   .html( $( '#comment-' + commentID + ' .c-score' 
).text() ); // unescape
} );
},
 
@@ -137,16 +140,12 @@
}
var commentText = 
document.commentForm.commentText.value;
 
-   $.ajax( {
-   url: mw.config.get( 'wgScriptPath' ) + 
'/api.php',
-   data: {
- 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: bidi-isolate usernames in Linker::userLink

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

Change subject: bidi-isolate usernames in Linker::userLink
..


bidi-isolate usernames in Linker::userLink

Usernames can be in any script/language and include weak and neutral
characters like parentheses and dashes - these flip and make things
look very weird when displayed in the opposite directionality.

This fix adds  tags to isolate the username when we output user
links. This will affect displays like user personal tools, history
and diff view.

Also, fixing LogFormatterTestCase::removeSomeHtml() that expected
a very rigid html input (and thus failed with the new  wrapping)
to use strip_tags() instead.

Change-Id: I2db5f4b7d3a00726461eb6b699fbdf0ecd47a1cb
---
M includes/Linker.php
M tests/phpunit/includes/LinkerTest.php
M tests/phpunit/includes/logging/LogFormatterTestCase.php
3 files changed, 10 insertions(+), 9 deletions(-)

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



diff --git a/includes/Linker.php b/includes/Linker.php
index 2b38a96..f8b1bae 100644
--- a/includes/Linker.php
+++ b/includes/Linker.php
@@ -993,9 +993,10 @@
$page = Title::makeTitle( NS_USER, $userName );
}
 
+   // Wrap the output with  tags for directionality isolation
return self::link(
$page,
-   htmlspecialchars( $altUserName !== false ? $altUserName 
: $userName ),
+   '' . htmlspecialchars( $altUserName !== false ? 
$altUserName : $userName ) . '',
[ 'class' => $classes ]
);
}
diff --git a/tests/phpunit/includes/LinkerTest.php 
b/tests/phpunit/includes/LinkerTest.php
index 63753f9..3edf99f 100644
--- a/tests/phpunit/includes/LinkerTest.php
+++ b/tests/phpunit/includes/LinkerTest.php
@@ -37,34 +37,34 @@
[
'JohnDoe',
+   . 
'title="Special:Contributions/JohnDoe">JohnDoe',
0, 'JohnDoe', false,
],
[
'::1',
+   . 
'title="Special:Contributions/::1">::1',
0, '::1', false,
'Anonymous with pretty IPv6'
],
[
'::1',
+   . 
'title="Special:Contributions/0:0:0:0:0:0:0:1">::1',
0, '0:0:0:0:0:0:0:1', false,
'Anonymous with almost pretty IPv6'
],
[
'::1',
+   . 
'title="Special:Contributions/:::::::0001">::1',
0, ':::::::0001', 
false,
'Anonymous with full IPv6'
],
[
'AlternativeUsername',
+   . 
'title="Special:Contributions/::1">AlternativeUsername',
0, '::1', 'AlternativeUsername',
'Anonymous with pretty IPv6 and an alternative 
username'
],
@@ -73,14 +73,14 @@
[
'127.0.0.1',
+   . 
'title="Special:Contributions/127.0.0.1">127.0.0.1',
0, '127.0.0.1', false,
'Anonymous with IPv4'
],
[
'AlternativeUsername',
+   . 
'title="Special:Contributions/127.0.0.1">AlternativeUsername',
0, '127.0.0.1', 'AlternativeUsername',
'Anonymous with IPv4 and an alternative 
username'
],
diff --git a/tests/phpunit/includes/logging/LogFormatterTestCase.php 
b/tests/phpunit/includes/logging/LogFormatterTestCase.php
index b09e5b1..c289839 100644
--- a/tests/phpunit/includes/logging/LogFormatterTestCase.php
+++ b/tests/phpunit/includes/logging/LogFormatterTestCase.php
@@ -50,7 +50,7 @@
private static function removeSomeHtml( $html ) {
$html = str_replace( '', '"', $html );
$html = preg_replace( '/\xE2\x80[\x8E\x8F]/', '', $html ); // 
Strip lrm/rlm
-   return trim( preg_replace( '/<(a|span)[^>]*>([^<]*)<\/\1>/', 
'$2', $html ) );
+   return trim( strip_tags( $html ) );
}
 
private static function removeApiMetaData( $val ) {

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

[MediaWiki-commits] [Gerrit] labs...wikibugs2[master]: New naming scheme for Edit-Review-Improvements projects

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

Change subject: New naming scheme for Edit-Review-Improvements projects
..


New naming scheme for Edit-Review-Improvements projects

Augmented-Changes-Feed renamed to Edit-Review-Improvements-Feed

New project Edit-Review-Improvements-RC-Page

Change-Id: I11a70ea186ffa1862618d796a8dc99e9c1d99a8b
---
M channels.yaml
1 file changed, 1 insertion(+), 2 deletions(-)

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



diff --git a/channels.yaml b/channels.yaml
index 5ea784f..05f9c51 100644
--- a/channels.yaml
+++ b/channels.yaml
@@ -37,9 +37,8 @@
 - Collaboration-Team(-.*)?
 - Collab-Team(-.*)?
 # projects
-- Augmented-Changes-Feed
 - Collab-Notifications-Page
-- Edit-Review-Improvements
+- Edit-Review-Improvements(-.*)?
 - Flow
 - MoodBar
 - MediaWiki-extensions-PageCuration

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I11a70ea186ffa1862618d796a8dc99e9c1d99a8b
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/wikibugs2
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Merlijn van Deen 
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/mediawiki-config[master]: Do not use $wgExtensionFunctions to set globals

2016-08-31 Thread Code Review
Gergő Tisza has uploaded a new change for review.

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

Change subject: Do not use $wgExtensionFunctions to set globals
..

Do not use $wgExtensionFunctions to set globals

There was no reason to, and it can result in extension initialization
happening before the relevant configuration has been set.

Bug: T143055
Change-Id: I0ecf1e2859578fd4ebec9d68a769d456b3861ed7
---
M wmf-config/CommonSettings.php
1 file changed, 7 insertions(+), 11 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 0970815..88cb02a 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -3134,23 +3134,19 @@
}
$wgMWOAuthSecureTokenTransfer = true;
 
-   $wgGroupPermissions['autoconfirmed']['mwoauthproposeconsumer'] = true;
-   $wgGroupPermissions['autoconfirmed']['mwoauthupdateownconsumer'] = true;
+   if ( $wgDBname === $wgMWOAuthCentralWiki ) {
+   // management interfaces are only available on the central wiki
+   $wgGroupPermissions['autoconfirmed']['mwoauthproposeconsumer'] 
= true;
+   
$wgGroupPermissions['autoconfirmed']['mwoauthupdateownconsumer'] = true;
+   $wgGroupPermissions['oauthadmin']['mwoauthmanageconsumer'] = 
true;
+   $wgOAuthGroupsToNotify = ['oauthadmin'];
+   }
 
$wgHooks['OAuthReplaceMessage'][] = function( &$msgKey ) {
if ( $msgKey === 'mwoauth-form-privacypolicy-link' ) {
$msgKey = 'wikimedia-oauth-privacy-link';
}
return true;
-   };
-
-   $wgExtensionFunctions[] = function() {
-   global $wgDBname, $wgMWOAuthCentralWiki, $wgGroupPermissions, 
$wgOAuthGroupsToNotify;
-   if ( $wgDBname === $wgMWOAuthCentralWiki ) {
-   // Only needed on the central wiki.
-   
$wgGroupPermissions['oauthadmin']['mwoauthmanageconsumer'] = true;
-   $wgOAuthGroupsToNotify = ['oauthadmin'];
-   }
};
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ecf1e2859578fd4ebec9d68a769d456b3861ed7
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: ApiParamInfo: Allow fetching info for all submodules of a mo...

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

Change subject: ApiParamInfo: Allow fetching info for all submodules of a module
..


ApiParamInfo: Allow fetching info for all submodules of a module

This allows fetching info for all query submodules with modules=query+*,
and info for all modules recursively with modules=main|main+**.

Bug: T28680
Change-Id: Icca5d2fda39d9d43fe20d77e34779412cec77aad
---
M RELEASE-NOTES-1.28
M includes/api/ApiParamInfo.php
M includes/api/i18n/en.json
M includes/api/i18n/qqq.json
4 files changed, 66 insertions(+), 3 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28
index 6639a95..600ac70 100644
--- a/RELEASE-NOTES-1.28
+++ b/RELEASE-NOTES-1.28
@@ -96,6 +96,8 @@
   ApiPageSet may contain entries where the 'from' value is percent-encoded as
   the raw value cannot be represented in a valid API response. These are
   indicated by a 'fromencoded' boolean alongside the existing 'from' parameter.
+* (T28680) action=paraminfo can now return info about all submodules of a
+  module without listing them all explicitly.
 
 === Action API internal changes in 1.28 ===
 * Added a new hook, 'ApiMakeParserOptions', to allow extensions to better
diff --git a/includes/api/ApiParamInfo.php b/includes/api/ApiParamInfo.php
index 25e1a7f..caf0cd7 100644
--- a/includes/api/ApiParamInfo.php
+++ b/includes/api/ApiParamInfo.php
@@ -46,7 +46,39 @@
$this->context->setLanguage( $this->getMain()->getLanguage() );
 
if ( is_array( $params['modules'] ) ) {
-   $modules = $params['modules'];
+   $modules = [];
+   foreach ( $params['modules'] as $path ) {
+   if ( $path === '*' || $path === '**' ) {
+   $path = "main+$path";
+   }
+   if ( substr( $path, -2 ) === '+*' || substr( 
$path, -2 ) === ' *' ) {
+   $submodules = true;
+   $path = substr( $path, 0, -2 );
+   $recursive = false;
+   } elseif ( substr( $path, -3 ) === '+**' || 
substr( $path, -3 ) === ' **' ) {
+   $submodules = true;
+   $path = substr( $path, 0, -3 );
+   $recursive = true;
+   } else {
+   $submodules = false;
+   }
+
+   if ( $submodules ) {
+   try {
+   $module = 
$this->getModuleFromPath( $path );
+   } catch ( UsageException $ex ) {
+   $this->setWarning( 
$ex->getMessage() );
+   }
+   $submodules = $this->listAllSubmodules( 
$module, $recursive );
+   if ( $submodules ) {
+   $modules = array_merge( 
$modules, $submodules );
+   } else {
+   $this->setWarning( "Module 
$path has no submodules" );
+   }
+   } else {
+   $modules[] = $path;
+   }
+   }
} else {
$modules = [];
}
@@ -68,6 +100,8 @@
} else {
$formatModules = [];
}
+
+   $modules = array_unique( $modules );
 
$res = [];
 
@@ -119,6 +153,29 @@
}
 
$result->addValue( null, $this->getModuleName(), $res );
+   }
+
+   /**
+* List all submodules of a module
+* @param ApiBase $module
+* @param boolean $recursive
+* @return string[]
+*/
+   private function listAllSubmodules( ApiBase $module, $recursive ) {
+   $manager = $module->getModuleManager();
+   if ( $manager ) {
+   $paths = [];
+   $names = $manager->getNames();
+   sort( $names );
+   foreach ( $names as $name ) {
+   $submodule = $manager->getModule( $name );
+   $paths[] = $submodule->getModulePath();
+   if ( $recursive && 
$submodule->getModuleManager() ) {
+   $paths = array_merge( $paths, 

[MediaWiki-commits] [Gerrit] labs...wikibugs2[master]: New naming scheme for Edit-Review-Improvements projects

2016-08-31 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review.

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

Change subject: New naming scheme for Edit-Review-Improvements projects
..

New naming scheme for Edit-Review-Improvements projects

Augmented-Changes-Feed renamed to Edit-Review-Improvements-Feed

New project Edit-Review-Improvements-RC-Page

Change-Id: I11a70ea186ffa1862618d796a8dc99e9c1d99a8b
---
M channels.yaml
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/wikibugs2 
refs/changes/92/307892/1

diff --git a/channels.yaml b/channels.yaml
index 5ea784f..05f9c51 100644
--- a/channels.yaml
+++ b/channels.yaml
@@ -37,9 +37,8 @@
 - Collaboration-Team(-.*)?
 - Collab-Team(-.*)?
 # projects
-- Augmented-Changes-Feed
 - Collab-Notifications-Page
-- Edit-Review-Improvements
+- Edit-Review-Improvements(-.*)?
 - Flow
 - MoodBar
 - MediaWiki-extensions-PageCuration

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I11a70ea186ffa1862618d796a8dc99e9c1d99a8b
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/wikibugs2
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Deprecate SqlDataUpdate

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

Change subject: Deprecate SqlDataUpdate
..


Deprecate SqlDataUpdate

Core subclasses have been updated.

Change-Id: Ic1beebeb7aec2b40d89c75637968e57e71a6c1a2
---
M includes/deferred/SqlDataUpdate.php
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/includes/deferred/SqlDataUpdate.php 
b/includes/deferred/SqlDataUpdate.php
index ff06915..c7163ea 100644
--- a/includes/deferred/SqlDataUpdate.php
+++ b/includes/deferred/SqlDataUpdate.php
@@ -29,6 +29,8 @@
  *   a transaction will automatically be wrapped around the update. 
Starting another
  *   one would break the outer transaction bracket. If need be, subclasses 
can override
  *   the beginTransaction() and commitTransaction() methods.
+ *
+ * @deprecated Since 1.28 Use DataUpdate directly, injecting the database
  */
 abstract class SqlDataUpdate extends DataUpdate {
/** @var IDatabase Database connection reference */

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Submodule commit CiviCRM upgrade to 4.7.11

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

Change subject: Submodule commit CiviCRM upgrade to 4.7.11
..


Submodule commit CiviCRM upgrade to 4.7.11

5abef3b CiviCRM 4.7.11 upgrade

Change-Id: I64735373c32e186f032bf9fe583e66f0fe2b0437
---
M civicrm
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/civicrm b/civicrm
index 3833f80..5abef3b 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit 3833f805d0cc3a6bfdbc1b29f626832e1eb15f7e
+Subproject commit 5abef3b2eb45040c9e9de341788761ae376363ac

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I64735373c32e186f032bf9fe583e66f0fe2b0437
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Eileen 
Gerrit-Reviewer: Eileen 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Links update class cleanups

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

Change subject: Links update class cleanups
..


Links update class cleanups

* Avoid using deprecated functions.
* Switch to DataUpdate as the direct parent class as
  no benefit was provided from SqlDataUpdate (which
  should be deprecated soon).

Change-Id: I0f1c77128f3df658e6a0eaf4471ca48ac536c643
---
M includes/deferred/LinksDeletionUpdate.php
M includes/deferred/LinksUpdate.php
2 files changed, 95 insertions(+), 66 deletions(-)

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



diff --git a/includes/deferred/LinksDeletionUpdate.php 
b/includes/deferred/LinksDeletionUpdate.php
index 47f2b21..ca3500e 100644
--- a/includes/deferred/LinksDeletionUpdate.php
+++ b/includes/deferred/LinksDeletionUpdate.php
@@ -19,16 +19,21 @@
  *
  * @file
  */
+use MediaWiki\MediaWikiServices;
+
 /**
  * Update object handling the cleanup of links tables after a page was deleted.
  **/
-class LinksDeletionUpdate extends SqlDataUpdate implements 
EnqueueableDataUpdate {
+class LinksDeletionUpdate extends DataUpdate implements EnqueueableDataUpdate {
/** @var WikiPage */
protected $page;
/** @var integer */
protected $pageId;
/** @var string */
protected $timestamp;
+
+   /** @var IDatabase */
+   private $db;
 
/**
 * @param WikiPage $page Page we are updating
@@ -37,8 +42,6 @@
 * @throws MWException
 */
function __construct( WikiPage $page, $pageId = null, $timestamp = null 
) {
-   parent::__construct( false ); // no implicit transaction
-
$this->page = $page;
if ( $pageId ) {
$this->pageId = $pageId; // page ID at time of deletion
@@ -52,23 +55,25 @@
}
 
public function doUpdate() {
-   $config = RequestContext::getMain()->getConfig();
+   $services = MediaWikiServices::getInstance();
+   $config = $services->getMainConfig();
+   $lbFactory = $services->getDBLoadBalancerFactory();
$batchSize = $config->get( 'UpdateRowsPerQuery' );
-   $factory = wfGetLBFactory();
 
// Page may already be deleted, so don't just getId()
$id = $this->pageId;
// Make sure all links update threads see the changes of each 
other.
// This handles the case when updates have to batched into 
several COMMITs.
-   $scopedLock = LinksUpdate::acquirePageLock( $this->mDb, $id );
+   $scopedLock = LinksUpdate::acquirePageLock( $this->getDB(), $id 
);
 
$title = $this->page->getTitle();
+   $dbw = $this->getDB(); // convenience
 
// Delete restrictions for it
-   $this->mDb->delete( 'page_restrictions', [ 'pr_page' => $id ], 
__METHOD__ );
+   $dbw->delete( 'page_restrictions', [ 'pr_page' => $id ], 
__METHOD__ );
 
// Fix category table counts
-   $cats = $this->mDb->selectFieldValues(
+   $cats = $dbw->selectFieldValues(
'categorylinks',
'cl_to',
[ 'cl_from' => $id ],
@@ -78,8 +83,8 @@
foreach ( $catBatches as $catBatch ) {
$this->page->updateCategoryCounts( [], $catBatch, $id );
if ( count( $catBatches ) > 1 ) {
-   $factory->commitAndWaitForReplication(
-   __METHOD__, $this->ticket, [ 'wiki' => 
$this->mDb->getWikiID() ]
+   $lbFactory->commitAndWaitForReplication(
+   __METHOD__, $this->ticket, [ 'wiki' => 
$dbw->getWikiID() ]
);
}
}
@@ -87,19 +92,19 @@
// Refresh the category table entry if it seems to have no 
pages. Check
// master for the most up-to-date cat_pages count.
if ( $title->getNamespace() === NS_CATEGORY ) {
-   $row = $this->mDb->selectRow(
+   $row = $dbw->selectRow(
'category',
[ 'cat_id', 'cat_title', 'cat_pages', 
'cat_subcats', 'cat_files' ],
[ 'cat_title' => $title->getDBkey(), 'cat_pages 
<= 0' ],
__METHOD__
);
if ( $row ) {
-   $cat = Category::newFromRow( $row, $title 
)->refreshCounts();
+   Category::newFromRow( $row, $title 
)->refreshCounts();
}
}
 
// If using cascading deletes, we can skip some explicit deletes
-   

[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Submodule commit CiviCRM upgrade to 4.7.11

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

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

Change subject: Submodule commit CiviCRM upgrade to 4.7.11
..

Submodule commit CiviCRM upgrade to 4.7.11

5abef3b CiviCRM 4.7.11 upgrade

Change-Id: I64735373c32e186f032bf9fe583e66f0fe2b0437
---
M civicrm
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/91/307891/1

diff --git a/civicrm b/civicrm
index 3833f80..5abef3b 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit 3833f805d0cc3a6bfdbc1b29f626832e1eb15f7e
+Subproject commit 5abef3b2eb45040c9e9de341788761ae376363ac

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Submodule commit CiviCRM upgrade to 4.7.11

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

Change subject: Submodule commit CiviCRM upgrade to 4.7.11
..


Submodule commit CiviCRM upgrade to 4.7.11

5abef3b CiviCRM 4.7.11 upgrade

Change-Id: I64735373c32e186f032bf9fe583e66f0fe2b0437
---
M civicrm
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/civicrm b/civicrm
index 9d23b47..5abef3b 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit 9d23b47d2796e67cf19137fb44bfb9e24b9e4dc0
+Subproject commit 5abef3b2eb45040c9e9de341788761ae376363ac

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I64735373c32e186f032bf9fe583e66f0fe2b0437
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Eileen 
Gerrit-Reviewer: Eileen 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Submodule commit CiviCRM upgrade to 4.7.11

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

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

Change subject: Submodule commit CiviCRM upgrade to 4.7.11
..

Submodule commit CiviCRM upgrade to 4.7.11

5abef3b CiviCRM 4.7.11 upgrade

Change-Id: I64735373c32e186f032bf9fe583e66f0fe2b0437
---
M civicrm
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/90/307890/1

diff --git a/civicrm b/civicrm
index 9d23b47..5abef3b 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit 9d23b47d2796e67cf19137fb44bfb9e24b9e4dc0
+Subproject commit 5abef3b2eb45040c9e9de341788761ae376363ac

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove unused custom transaction logic from DataUpdate

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

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

Change subject: Remove unused custom transaction logic from DataUpdate
..

Remove unused custom transaction logic from DataUpdate

Change-Id: Ife65e4e90a35395e87f4f487f1cb871b67d92aa1
---
M includes/deferred/DataUpdate.php
M includes/deferred/LinksDeletionUpdate.php
M includes/deferred/LinksUpdate.php
M includes/deferred/SqlDataUpdate.php
M tests/phpunit/includes/deferred/LinksUpdateTest.php
5 files changed, 5 insertions(+), 139 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/89/307889/1

diff --git a/includes/deferred/DataUpdate.php b/includes/deferred/DataUpdate.php
index 281ac24..cad89b1 100644
--- a/includes/deferred/DataUpdate.php
+++ b/includes/deferred/DataUpdate.php
@@ -24,10 +24,6 @@
 /**
  * Abstract base class for update jobs that do something with some secondary
  * data extracted from article.
- *
- * @note subclasses should NOT start or commit transactions in their 
doUpdate() method,
- *   a transaction will automatically be wrapped around the update. If 
need be,
- *   subclasses can override the beginTransaction() and 
commitTransaction() methods.
  */
 abstract class DataUpdate implements DeferrableUpdate {
/** @var mixed Result from LBFactory::getEmptyTransactionTicket() */
@@ -43,30 +39,6 @@
 */
public function setTransactionTicket( $ticket ) {
$this->ticket = $ticket;
-   }
-
-   /**
-* Begin an appropriate transaction, if any.
-* This default implementation does nothing.
-*/
-   public function beginTransaction() {
-   // noop
-   }
-
-   /**
-* Commit the transaction started via beginTransaction, if any.
-* This default implementation does nothing.
-*/
-   public function commitTransaction() {
-   // noop
-   }
-
-   /**
-* Abort / roll back the transaction started via beginTransaction, if 
any.
-* This default implementation does nothing.
-*/
-   public function rollbackTransaction() {
-   // noop
}
 
/**
@@ -91,44 +63,8 @@
$updates = self::enqueueUpdates( $updates );
}
 
-   if ( !count( $updates ) ) {
-   return; // nothing to do
-   }
-
-   $open_transactions = [];
-   $exception = null;
-
-   try {
-   // begin transactions
-   foreach ( $updates as $update ) {
-   $update->beginTransaction();
-   $open_transactions[] = $update;
-   }
-
-   // do work
-   foreach ( $updates as $update ) {
-   $update->doUpdate();
-   }
-
-   // commit transactions
-   while ( count( $open_transactions ) > 0 ) {
-   $trans = array_pop( $open_transactions );
-   $trans->commitTransaction();
-   }
-   } catch ( Exception $ex ) {
-   $exception = $ex;
-   wfDebug( "Caught exception, will rethrow after 
rollback: " .
-   $ex->getMessage() . "\n" );
-   }
-
-   // rollback remaining transactions
-   while ( count( $open_transactions ) > 0 ) {
-   $trans = array_pop( $open_transactions );
-   $trans->rollbackTransaction();
-   }
-
-   if ( $exception ) {
-   throw $exception; // rethrow after cleanup
+   foreach ( $updates as $update ) {
+   $update->doUpdate();
}
}
 
diff --git a/includes/deferred/LinksDeletionUpdate.php 
b/includes/deferred/LinksDeletionUpdate.php
index 47f2b21..60450db 100644
--- a/includes/deferred/LinksDeletionUpdate.php
+++ b/includes/deferred/LinksDeletionUpdate.php
@@ -37,7 +37,7 @@
 * @throws MWException
 */
function __construct( WikiPage $page, $pageId = null, $timestamp = null 
) {
-   parent::__construct( false ); // no implicit transaction
+   parent::__construct();
 
$this->page = $page;
if ( $pageId ) {
diff --git a/includes/deferred/LinksUpdate.php 
b/includes/deferred/LinksUpdate.php
index ec7360e..d200d37 100644
--- a/includes/deferred/LinksUpdate.php
+++ b/includes/deferred/LinksUpdate.php
@@ -103,8 +103,7 @@
 * @throws MWException
 */
function __construct( Title $title, ParserOutput $parserOutput, 
$recursive = true ) {
-   // Implicit transactions are disabled as 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Use extension registration for CategoryTree (cleanup)

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

Change subject: Use extension registration for CategoryTree (cleanup)
..


Use extension registration for CategoryTree (cleanup)

This is a follow-up for 537a081b.

Change-Id: I0ece087a000ad0441770a7fb26592979fb76f18b
---
M wmf-config/InitialiseSettings.php
1 file changed, 0 insertions(+), 10 deletions(-)

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



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index eebb8e7..48d3c7a 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -11239,16 +11239,6 @@
'default' => [ 'mode' => null, 'showcount' => true ],
 ],
 
-// Transitional copy of the setting for deployment sync purpose
-'wmgCategoryTreeCategoryPageMode' => [
-   'default' => 0,
-],
-
-'wmgCategoryTreeCategoryPageOptions' => [
-   'default' => [ 'mode' => null, 'showcount' => true ],
-],
-
-
 'wmgUseFundraisingTranslateWorkflow' => [
'default' => false,
'metawiki' => true,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0ece087a000ad0441770a7fb26592979fb76f18b
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Dereckson 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Allow more data attached to entity data node.

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

Change subject: Allow more data attached to entity data node.
..


Allow more data attached to entity data node.

Any wikibase:* predicate will be transferred to entity.

Change-Id: If8af79392d7b38bfadb303262a21d5196116b6ab
---
M tools/src/main/java/org/wikidata/query/rdf/tool/rdf/Munger.java
M tools/src/test/java/org/wikidata/query/rdf/tool/rdf/MungerUnitTest.java
2 files changed, 59 insertions(+), 5 deletions(-)

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



diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/Munger.java 
b/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/Munger.java
index 34d3ee5..5ec83bc 100644
--- a/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/Munger.java
+++ b/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/Munger.java
@@ -17,10 +17,13 @@
 
 import javax.xml.bind.DatatypeConverter;
 
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.commons.lang3.tuple.Pair;
 import org.openrdf.model.BNode;
 import org.openrdf.model.Literal;
 import org.openrdf.model.Resource;
 import org.openrdf.model.Statement;
+import org.openrdf.model.URI;
 import org.openrdf.model.impl.LiteralImpl;
 import org.openrdf.model.impl.NumericLiteralImpl;
 import org.openrdf.model.impl.StatementImpl;
@@ -305,6 +308,12 @@
  */
 private final Collection existingRefs;
 
+/**
+ * Statements that belong to data entity.
+ * We will transfer them to the item/property.
+ */
+private final Set> dataStatements = new HashSet<>();
+
 // These are set by the entire munge operation
 /**
  * Revision id that we find while scanning the statements.
@@ -486,19 +495,29 @@
  * @return true to keep the statement, false to remove it
  */
 private boolean entityDataStatement() {
+boolean knownPredicate = false;
 // Three specific ones are recorded for later re-application
 switch (predicate) {
 case SchemaDotOrg.VERSION:
+knownPredicate = true;
 revisionId = objectAsLiteral();
 break;
 case SchemaDotOrg.DATE_MODIFIED:
+knownPredicate = true;
 lastModified = objectAsLiteral();
 break;
 case SchemaDotOrg.SOFTWARE_VERSION:
 setFormatVersion(objectAsLiteral().stringValue());
 break;
 default:
-// Noop - fall out is ok as we just remove them.
+if (predicate.startsWith(Ontology.NAMESPACE)) {
+knownPredicate = true;
+}
+// Noop - fall out is ok as we just remove them.
+}
+if (knownPredicate) {
+dataStatements.add(new ImmutablePair(
+statement.getPredicate(), objectAsLiteral()));
 }
 // All EntityData statements are removed.
 return false;
@@ -785,8 +804,13 @@
 if (lastModified == null) {
 throw new ContainedException("Didn't get a last modified date 
for " + statements);
 }
-statements.add(new StatementImpl(entityUriImpl, new 
URIImpl(SchemaDotOrg.VERSION), revisionId));
-statements.add(new StatementImpl(entityUriImpl, new 
URIImpl(SchemaDotOrg.DATE_MODIFIED), lastModified));
+
+// Move all selected entity data statements to main entity 
statement
+for (Pair dataStatement: dataStatements) {
+statements.add(new StatementImpl(entityUriImpl,
+dataStatement.getLeft(), dataStatement.getRight()));
+}
+
 statements.addAll(restoredStatements);
 }
 
diff --git 
a/tools/src/test/java/org/wikidata/query/rdf/tool/rdf/MungerUnitTest.java 
b/tools/src/test/java/org/wikidata/query/rdf/tool/rdf/MungerUnitTest.java
index 5d22a7e..6275e61 100644
--- a/tools/src/test/java/org/wikidata/query/rdf/tool/rdf/MungerUnitTest.java
+++ b/tools/src/test/java/org/wikidata/query/rdf/tool/rdf/MungerUnitTest.java
@@ -49,8 +49,20 @@
 @Test
 public void mungesEntityDataOntoEntity() {
 entity("Q23") //
-.retain(statement("Q23", SchemaDotOrg.VERSION, new 
LiteralImpl("a revision number I promise")), //
-statement("Q23", SchemaDotOrg.DATE_MODIFIED, new 
LiteralImpl("a date I promise"))) //
+.retain(statement("Q23", SchemaDotOrg.VERSION, new 
LiteralImpl("a revision number I promise")),
+statement("Q23", SchemaDotOrg.DATE_MODIFIED, new 
LiteralImpl("a date I promise")))
+.test();
+}
+
+@Test
+public void moreDataOnEntityData() {
+String entityDataUri = 

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Whoops: Fix Explore overflow menu on pre-Lollipop devices.

2016-08-31 Thread Dbrant (Code Review)
Dbrant has uploaded a new change for review.

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

Change subject: Whoops: Fix Explore overflow menu on pre-Lollipop devices.
..

Whoops: Fix Explore overflow menu on pre-Lollipop devices.

Change-Id: Iafa9b58ede5a39b74f821295772164ab9e89873d
---
M app/src/main/java/org/wikipedia/views/ExploreOverflowView.java
M app/src/main/res/layout/view_explore_overflow.xml
2 files changed, 9 insertions(+), 5 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/views/ExploreOverflowView.java 
b/app/src/main/java/org/wikipedia/views/ExploreOverflowView.java
index d68636b..29a4462 100644
--- a/app/src/main/java/org/wikipedia/views/ExploreOverflowView.java
+++ b/app/src/main/java/org/wikipedia/views/ExploreOverflowView.java
@@ -1,5 +1,6 @@
 package org.wikipedia.views;
 
+import android.annotation.TargetApi;
 import android.content.Context;
 import android.graphics.Color;
 import android.graphics.drawable.ColorDrawable;
@@ -7,7 +8,9 @@
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
 import android.support.v4.widget.PopupWindowCompat;
+import android.view.Gravity;
 import android.view.View;
+import android.view.ViewGroup;
 import android.widget.FrameLayout;
 import android.widget.PopupWindow;
 import android.widget.TextView;
@@ -38,17 +41,17 @@
 init();
 }
 
+@TargetApi(Build.VERSION_CODES.LOLLIPOP)
 public void show(@NonNull View anchorView, @Nullable Callback callback) {
 this.callback = callback;
-popupWindowHost = new PopupWindow(getContext());
+popupWindowHost = new PopupWindow(this, 
ViewGroup.LayoutParams.WRAP_CONTENT,
+ViewGroup.LayoutParams.WRAP_CONTENT, true);
 popupWindowHost.setBackgroundDrawable(new ColorDrawable(Color.BLACK));
 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
 
popupWindowHost.setElevation(getResources().getDimension(R.dimen.overflow_elevation));
 }
 PopupWindowCompat.setOverlapAnchor(popupWindowHost, true);
-popupWindowHost.setFocusable(true);
-popupWindowHost.setContentView(this);
-popupWindowHost.showAsDropDown(anchorView);
+PopupWindowCompat.showAsDropDown(popupWindowHost, anchorView, 0, 0, 
Gravity.END);
 }
 
 @OnClick({R.id.explore_overflow_settings, R.id.explore_overflow_donate,
diff --git a/app/src/main/res/layout/view_explore_overflow.xml 
b/app/src/main/res/layout/view_explore_overflow.xml
index bbfd4e5..37311a2 100644
--- a/app/src/main/res/layout/view_explore_overflow.xml
+++ b/app/src/main/res/layout/view_explore_overflow.xml
@@ -1,6 +1,7 @@
 
 http://schemas.android.com/apk/res/android;
+xmlns:app="http://schemas.android.com/apk/res-auto;
 xmlns:tools="http://schemas.android.com/tools;
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
@@ -22,7 +23,7 @@
 android:layout_width="24dp"
 android:layout_height="24dp"
 android:layout_marginBottom="4dp"
-android:src="@drawable/user_avatar"
+app:srcCompat="@drawable/user_avatar"
 android:contentDescription="@null" />
 
 https://gerrit.wikimedia.org/r/307888
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafa9b58ede5a39b74f821295772164ab9e89873d
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant 

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Allow more data attached to entity data node.

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

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

Change subject: Allow more data attached to entity data node.
..

Allow more data attached to entity data node.

Any wikibase:* predicate will be transferred to entity.

Change-Id: If8af79392d7b38bfadb303262a21d5196116b6ab
---
M tools/src/main/java/org/wikidata/query/rdf/tool/rdf/Munger.java
M tools/src/test/java/org/wikidata/query/rdf/tool/rdf/MungerUnitTest.java
2 files changed, 59 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf 
refs/changes/87/307887/1

diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/Munger.java 
b/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/Munger.java
index 34d3ee5..5ec83bc 100644
--- a/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/Munger.java
+++ b/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/Munger.java
@@ -17,10 +17,13 @@
 
 import javax.xml.bind.DatatypeConverter;
 
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.commons.lang3.tuple.Pair;
 import org.openrdf.model.BNode;
 import org.openrdf.model.Literal;
 import org.openrdf.model.Resource;
 import org.openrdf.model.Statement;
+import org.openrdf.model.URI;
 import org.openrdf.model.impl.LiteralImpl;
 import org.openrdf.model.impl.NumericLiteralImpl;
 import org.openrdf.model.impl.StatementImpl;
@@ -305,6 +308,12 @@
  */
 private final Collection existingRefs;
 
+/**
+ * Statements that belong to data entity.
+ * We will transfer them to the item/property.
+ */
+private final Set> dataStatements = new HashSet<>();
+
 // These are set by the entire munge operation
 /**
  * Revision id that we find while scanning the statements.
@@ -486,19 +495,29 @@
  * @return true to keep the statement, false to remove it
  */
 private boolean entityDataStatement() {
+boolean knownPredicate = false;
 // Three specific ones are recorded for later re-application
 switch (predicate) {
 case SchemaDotOrg.VERSION:
+knownPredicate = true;
 revisionId = objectAsLiteral();
 break;
 case SchemaDotOrg.DATE_MODIFIED:
+knownPredicate = true;
 lastModified = objectAsLiteral();
 break;
 case SchemaDotOrg.SOFTWARE_VERSION:
 setFormatVersion(objectAsLiteral().stringValue());
 break;
 default:
-// Noop - fall out is ok as we just remove them.
+if (predicate.startsWith(Ontology.NAMESPACE)) {
+knownPredicate = true;
+}
+// Noop - fall out is ok as we just remove them.
+}
+if (knownPredicate) {
+dataStatements.add(new ImmutablePair(
+statement.getPredicate(), objectAsLiteral()));
 }
 // All EntityData statements are removed.
 return false;
@@ -785,8 +804,13 @@
 if (lastModified == null) {
 throw new ContainedException("Didn't get a last modified date 
for " + statements);
 }
-statements.add(new StatementImpl(entityUriImpl, new 
URIImpl(SchemaDotOrg.VERSION), revisionId));
-statements.add(new StatementImpl(entityUriImpl, new 
URIImpl(SchemaDotOrg.DATE_MODIFIED), lastModified));
+
+// Move all selected entity data statements to main entity 
statement
+for (Pair dataStatement: dataStatements) {
+statements.add(new StatementImpl(entityUriImpl,
+dataStatement.getLeft(), dataStatement.getRight()));
+}
+
 statements.addAll(restoredStatements);
 }
 
diff --git 
a/tools/src/test/java/org/wikidata/query/rdf/tool/rdf/MungerUnitTest.java 
b/tools/src/test/java/org/wikidata/query/rdf/tool/rdf/MungerUnitTest.java
index 5d22a7e..6275e61 100644
--- a/tools/src/test/java/org/wikidata/query/rdf/tool/rdf/MungerUnitTest.java
+++ b/tools/src/test/java/org/wikidata/query/rdf/tool/rdf/MungerUnitTest.java
@@ -49,8 +49,20 @@
 @Test
 public void mungesEntityDataOntoEntity() {
 entity("Q23") //
-.retain(statement("Q23", SchemaDotOrg.VERSION, new 
LiteralImpl("a revision number I promise")), //
-statement("Q23", SchemaDotOrg.DATE_MODIFIED, new 
LiteralImpl("a date I promise"))) //
+.retain(statement("Q23", SchemaDotOrg.VERSION, new 
LiteralImpl("a revision number I promise")),
+statement("Q23", SchemaDotOrg.DATE_MODIFIED, new 
LiteralImpl("a date I promise")))
+.test();
+}
+
+@Test
+public void 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Improve beginMasterChanges and make methods for DeferredUpdates

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

Change subject: Improve beginMasterChanges and make methods for DeferredUpdates
..


Improve beginMasterChanges and make methods for DeferredUpdates

* Fixed bug in LBFactory::beginMasterChanges where
  untracked DBs that then get written to where not in the
  transaction round. The call to onTransactionResolution()
  right after commit() was also problematic, so a flag was
  added to handle that.
* Add LBFactory::setWaitForReplicationListener(), which
  fires at what is often a good point to run deferred updates.
* Add DatabaseBase::clearSnapshot() for committing no-op
  transactions.
* Add IDatabase::setTransactionListener() for persistent
  callbacks. Monitoring commits can be used to find a point
  where deferred updates can run.
* Follow-up commit will address DeferredUpdates.

Change-Id: I4589e6f3ae40b1c362601416db48857fb89840bf
---
M includes/db/DBConnRef.php
M includes/db/Database.php
M includes/db/IDatabase.php
M includes/db/loadbalancer/LBFactory.php
M includes/db/loadbalancer/LBFactoryMulti.php
M includes/db/loadbalancer/LBFactorySimple.php
M includes/db/loadbalancer/LoadBalancer.php
M tests/phpunit/includes/db/DatabaseTest.php
8 files changed, 354 insertions(+), 77 deletions(-)

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



diff --git a/includes/db/DBConnRef.php b/includes/db/DBConnRef.php
index 790a073..ee0a75a 100644
--- a/includes/db/DBConnRef.php
+++ b/includes/db/DBConnRef.php
@@ -441,6 +441,10 @@
return $this->__call( __FUNCTION__, func_get_args() );
}
 
+   public function setTransactionListener( $name, callable $callback = 
null ) {
+   return $this->__call( __FUNCTION__, func_get_args() );
+   }
+
public function startAtomic( $fname = __METHOD__ ) {
return $this->__call( __FUNCTION__, func_get_args() );
}
diff --git a/includes/db/Database.php b/includes/db/Database.php
index e07836b..26d0f5f 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -69,8 +69,10 @@
protected $mTrxPreCommitCallbacks = [];
/** @var array[] List of (callable, method name) */
protected $mTrxEndCallbacks = [];
-   /** @var bool Whether to suppress triggering of post-commit callbacks */
-   protected $suppressPostCommitCallbacks = false;
+   /** @var array[] Map of (name => (callable, method name)) */
+   protected $mTrxRecurringCallbacks = [];
+   /** @var bool Whether to suppress triggering of transaction end 
callbacks */
+   protected $mTrxEndCallbacksSuppressed = false;
 
/** @var string */
protected $mTablePrefix;
@@ -993,6 +995,7 @@
try {
// Handle callbacks in mTrxEndCallbacks
$this->runOnTransactionIdleCallbacks( 
self::TRIGGER_ROLLBACK );
+   $this->runTransactionListenerCallbacks( 
self::TRIGGER_ROLLBACK );
return null;
} catch ( Exception $e ) {
// Already logged; move on...
@@ -2572,16 +2575,24 @@
}
}
 
+   final public function setTransactionListener( $name, callable $callback 
= null ) {
+   if ( $callback ) {
+   $this->mTrxRecurringCallbacks[$name] = [ $callback, 
wfGetCaller() ];
+   } else {
+   unset( $this->mTrxRecurringCallbacks[$name] );
+   }
+   }
+
/**
-* Whether to disable running of post-commit callbacks
+* Whether to disable running of post-COMMIT/ROLLBACK callbacks
 *
 * This method should not be used outside of Database/LoadBalancer
 *
 * @param bool $suppress
 * @since 1.28
 */
-   final public function setPostCommitCallbackSupression( $suppress ) {
-   $this->suppressPostCommitCallbacks = $suppress;
+   final public function setTrxEndCallbackSuppression( $suppress ) {
+   $this->mTrxEndCallbacksSuppressed = $suppress;
}
 
/**
@@ -2594,7 +2605,7 @@
 * @throws Exception
 */
public function runOnTransactionIdleCallbacks( $trigger ) {
-   if ( $this->suppressPostCommitCallbacks ) {
+   if ( $this->mTrxEndCallbacksSuppressed ) {
return;
}
 
@@ -2658,6 +2669,38 @@
}
}
} while ( count( $this->mTrxPreCommitCallbacks ) );
+
+   if ( $e instanceof Exception ) {
+   throw $e; // re-throw any first exception
+   }
+   }
+
+   /**
+* Actually run any "transaction listener" callbacks.
+*
+* This method should not be used outside of Database/LoadBalancer
+*
+* @param 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Use extension registration for CategoryTree (cleanup)

2016-08-31 Thread Dereckson (Code Review)
Dereckson has uploaded a new change for review.

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

Change subject: Use extension registration for CategoryTree (cleanup)
..

Use extension registration for CategoryTree (cleanup)

This is a follow-up for 537a081b.

Change-Id: I0ece087a000ad0441770a7fb26592979fb76f18b
---
M wmf-config/InitialiseSettings.php
1 file changed, 0 insertions(+), 10 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index eebb8e7..48d3c7a 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -11239,16 +11239,6 @@
'default' => [ 'mode' => null, 'showcount' => true ],
 ],
 
-// Transitional copy of the setting for deployment sync purpose
-'wmgCategoryTreeCategoryPageMode' => [
-   'default' => 0,
-],
-
-'wmgCategoryTreeCategoryPageOptions' => [
-   'default' => [ 'mode' => null, 'showcount' => true ],
-],
-
-
 'wmgUseFundraisingTranslateWorkflow' => [
'default' => false,
'metawiki' => true,

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

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

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


[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Check surface has been added before setting

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

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

Change subject: Check surface has been added before setting
..

Check surface has been added before setting

This means we don't have to check if it's in the list in clearSurfaces.

Change-Id: If976d8e2275ff8b3d307478de73fc6ee66a750dd
---
M src/init/ve.init.Target.js
1 file changed, 3 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/85/307885/1

diff --git a/src/init/ve.init.Target.js b/src/init/ve.init.Target.js
index 3aa6416..de6e196 100644
--- a/src/init/ve.init.Target.js
+++ b/src/init/ve.init.Target.js
@@ -354,11 +354,9 @@
  * Destroy and remove all surfaces from the target
  */
 ve.init.Target.prototype.clearSurfaces = function () {
-   if ( this.surfaces.indexOf( this.surface ) !== -1 ) {
-   // We're about to destroy this.surface, so unset it for sanity
-   // Otherwise, getSurface() could return a destroyed surface
-   this.surface = null;
-   }
+   // We're about to destroy this.surface, so unset it for sanity
+   // Otherwise, getSurface() could return a destroyed surface
+   this.surface = null;
while ( this.surfaces.length ) {
this.surfaces.pop().destroy();
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If976d8e2275ff8b3d307478de73fc6ee66a750dd
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] operations/mediawiki-config[master]: Use extension registration for CategoryTree

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

Change subject: Use extension registration for CategoryTree
..


Use extension registration for CategoryTree

* Get rid of $wg = $wmg
* Load extension through wfLoadExtension

Bug: T119117
Depends-On: If67d0fe2ff758c7fd41386d04f5c0839c8c665a1
Change-Id: I6e55dc9c3ccb7158f075503994d0138b804eeb9a
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 11 insertions(+), 3 deletions(-)

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



diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 0970815..8bfea6a 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -789,9 +789,7 @@
 }
 
 if ( $wmgUseCategoryTree ) {
-   require( $IP . '/extensions/CategoryTree/CategoryTree.php' );
-   $wgCategoryTreeCategoryPageMode = $wmgCategoryTreeCategoryPageMode;
-   $wgCategoryTreeCategoryPageOptions = 
$wmgCategoryTreeCategoryPageOptions;
+   wfLoadExtension( 'CategoryTree' );
 }
 
 if ( $wmgUseProofreadPage ) {
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index ffb7f1e..eebb8e7 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -11231,6 +11231,15 @@
 // CT_MODE_CATEGORIES = 0
 // CT_MODE_PAGES = 10
 // CT_MODE_ALL = 20
+'wgCategoryTreeCategoryPageMode' => [
+   'default' => 0,
+],
+
+'wgCategoryTreeCategoryPageOptions' => [
+   'default' => [ 'mode' => null, 'showcount' => true ],
+],
+
+// Transitional copy of the setting for deployment sync purpose
 'wmgCategoryTreeCategoryPageMode' => [
'default' => 0,
 ],
@@ -11239,6 +11248,7 @@
'default' => [ 'mode' => null, 'showcount' => true ],
 ],
 
+
 'wmgUseFundraisingTranslateWorkflow' => [
'default' => false,
'metawiki' => true,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6e55dc9c3ccb7158f075503994d0138b804eeb9a
Gerrit-PatchSet: 4
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Dereckson 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Dereckson 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Update frwikt logo

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

Change subject: Update frwikt logo
..


Update frwikt logo

Bug: T144427
Change-Id: I07d39900e1f56825e881324133a11c8e91d4227f
---
M static/images/project-logos/frwiktionary.png
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/static/images/project-logos/frwiktionary.png 
b/static/images/project-logos/frwiktionary.png
index e379af7..9c7f866 100644
--- a/static/images/project-logos/frwiktionary.png
+++ b/static/images/project-logos/frwiktionary.png
Binary files differ

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I07d39900e1f56825e881324133a11c8e91d4227f
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Urbanecm 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: HD logos for frwikt

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

Change subject: HD logos for frwikt
..


HD logos for frwikt

Bug: T144427
Change-Id: Id80ccce2a03c91122525906eced27625a0a86d45
---
A static/images/project-logos/frwiktionary-1.5x.png
A static/images/project-logos/frwiktionary-2x.png
M wmf-config/InitialiseSettings.php
3 files changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/static/images/project-logos/frwiktionary-1.5x.png 
b/static/images/project-logos/frwiktionary-1.5x.png
new file mode 100644
index 000..42559df
--- /dev/null
+++ b/static/images/project-logos/frwiktionary-1.5x.png
Binary files differ
diff --git a/static/images/project-logos/frwiktionary-2x.png 
b/static/images/project-logos/frwiktionary-2x.png
new file mode 100644
index 000..ee80646
--- /dev/null
+++ b/static/images/project-logos/frwiktionary-2x.png
Binary files differ
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index a68ed22..ffb7f1e 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -1156,6 +1156,7 @@
 # Wiktionary
'enwiktionary' => [ '1.5x' => 
'/static/images/project-logos/enwiktionary-1.5x.png', '2x' => 
'/static/images/project-logos/enwiktionary-2x.png' ], // T138801
'viwiktionary' => [ '1.5x' => 
'/static/images/project-logos/viwiktionary-1.5x.png', '2x' => 
'/static/images/project-logos/viwiktionary-2x.png' ],
+   'frwiktionary' => [ '1.5x' => 
'/static/images/project-logos/frwiktionary-1.5x.png', '2x' => 
'/static/images/project-logos/frwiktionary-2x.png' ], //T144427
 
 # Wikiquote
'sqwikiquote' => [ '1.5x' => 
'/static/images/project-logos/sqwikiquote-1.5x.png', '2x' => 
'/static/images/project-logos/sqwikiquote-2x.png' ],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id80ccce2a03c91122525906eced27625a0a86d45
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Urbanecm 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[wmf/1.28.0-wmf.17]: Fix maplink and mapframe when lat/lon/zoom are undefined

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

Change subject: Fix maplink and mapframe when lat/lon/zoom are undefined
..


Fix maplink and mapframe when lat/lon/zoom are undefined

Bug: T11
Change-Id: I4f756480f55f93b49fba81298cdc3c0f977dbc8a
(cherry picked from commit 17f23ce0da7f395bcb765cb2a5747775d0da4147)
---
M modules/mapframe/mapframe.js
M modules/maplink/maplink.js
2 files changed, 21 insertions(+), 11 deletions(-)

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



diff --git a/modules/mapframe/mapframe.js b/modules/mapframe/mapframe.js
index df683c8..37e502e 100644
--- a/modules/mapframe/mapframe.js
+++ b/modules/mapframe/mapframe.js
@@ -120,17 +120,22 @@
// #/map/0/5
// #/map/0/16/-122.4006/37.7873
router.route( 
/map\/([0-9]+)(?:\/([0-9]+))?(?:\/([\-\+]?\d+\.?\d{0,5})?\/([\-\+]?\d+\.?\d{0,5})?)?/,
 function ( maptagId, zoom, latitude, longitude ) {
-   var map = maps[ maptagId ];
+   var map = maps[ maptagId ],
+   position;
 
if ( !map ) {
router.navigate( '' );
return;
}
 
-   map.openFullScreen( {
-   center: [ +latitude, +longitude ],
-   zoom: +zoom
-   } );
+   if ( zoom !== undefined && latitude !== 
undefined && longitude !== undefined ) {
+   position = {
+   center: [ +latitude, +longitude 
],
+   zoom: +zoom
+   };
+   }
+
+   map.openFullScreen( position );
} );
 
// Check if we need to open a map in full screen.
diff --git a/modules/maplink/maplink.js b/modules/maplink/maplink.js
index 8f1361d..ed45dea 100644
--- a/modules/maplink/maplink.js
+++ b/modules/maplink/maplink.js
@@ -10,7 +10,7 @@
  * @class Kartographer.Link
  * @singleton
  */
-module.exports = ( function ( $, mw, router, kartobox ) {
+module.exports = ( function ( $, mw, router, kartobox, undefined ) {
 
/**
 * References the maplinks of the page.
@@ -90,17 +90,22 @@
// #/maplink/0/5
// #/maplink/0/16/-122.4006/37.7873
router.route( 
/maplink\/([0-9]+)(?:\/([0-9]+))?(?:\/([\-\+]?\d+\.?\d{0,5})?\/([\-\+]?\d+\.?\d{0,5})?)?/,
 function ( maptagId, zoom, latitude, longitude ) {
-   var link = maplinks[ maptagId ];
+   var link = maplinks[ maptagId ],
+   position;
 
if ( !link ) {
router.navigate( '' );
return;
}
 
-   link.openFullScreen( {
-   center: [ +latitude, +longitude ],
-   zoom: +zoom
-   } );
+   if ( zoom !== undefined && latitude !== undefined && 
longitude !== undefined ) {
+   position = {
+   center: [ +latitude, +longitude ],
+   zoom: +zoom
+   };
+   }
+
+   link.openFullScreen( position );
} );
 
// Check if we need to open a map in full screen.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4f756480f55f93b49fba81298cdc3c0f977dbc8a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: wmf/1.28.0-wmf.17
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Fix map overlapping on mobile

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

Change subject: Fix map overlapping on mobile
..


Fix map overlapping on mobile

Change-Id: Ied52fedd71b2d4adbbbd88bad7c5ac0b72bc468c
---
M styles/kartographer.less
M styles/leaflet-overrides.less
2 files changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/styles/kartographer.less b/styles/kartographer.less
index 4e8d805..853499e 100644
--- a/styles/kartographer.less
+++ b/styles/kartographer.less
@@ -4,6 +4,7 @@
bottom: 0;
left: 0;
right: 0;
+   z-index: 1;
 }
 
 .mw-kartographer-error {
diff --git a/styles/leaflet-overrides.less b/styles/leaflet-overrides.less
index f884841..f919db7 100644
--- a/styles/leaflet-overrides.less
+++ b/styles/leaflet-overrides.less
@@ -2,6 +2,7 @@
 
 /* stylelint-disable no-descending-specificity */
 .mw-kartographer-interactive {
+   z-index: 0;
 
&.leaflet-container {
font: 12px @font-family-base;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ied52fedd71b2d4adbbbd88bad7c5ac0b72bc468c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: JGirault 
Gerrit-Reviewer: MaxSem 
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...Kartographer[master]: Fix map overlapping on mobile

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

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

Change subject: Fix map overlapping on mobile
..

Fix map overlapping on mobile

Change-Id: Ied52fedd71b2d4adbbbd88bad7c5ac0b72bc468c
---
M styles/kartographer.less
M styles/leaflet-overrides.less
2 files changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/styles/kartographer.less b/styles/kartographer.less
index 4e8d805..853499e 100644
--- a/styles/kartographer.less
+++ b/styles/kartographer.less
@@ -4,6 +4,7 @@
bottom: 0;
left: 0;
right: 0;
+   z-index: 1;
 }
 
 .mw-kartographer-error {
diff --git a/styles/leaflet-overrides.less b/styles/leaflet-overrides.less
index f884841..f919db7 100644
--- a/styles/leaflet-overrides.less
+++ b/styles/leaflet-overrides.less
@@ -2,6 +2,7 @@
 
 /* stylelint-disable no-descending-specificity */
 .mw-kartographer-interactive {
+   z-index: 0;
 
&.leaflet-container {
font: 12px @font-family-base;

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Fix maplink and mapframe when lat/lon/zoom are undefined

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

Change subject: Fix maplink and mapframe when lat/lon/zoom are undefined
..


Fix maplink and mapframe when lat/lon/zoom are undefined

Bug: T11
Change-Id: I4f756480f55f93b49fba81298cdc3c0f977dbc8a
---
M modules/mapframe/mapframe.js
M modules/maplink/maplink.js
2 files changed, 21 insertions(+), 11 deletions(-)

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



diff --git a/modules/mapframe/mapframe.js b/modules/mapframe/mapframe.js
index df683c8..37e502e 100644
--- a/modules/mapframe/mapframe.js
+++ b/modules/mapframe/mapframe.js
@@ -120,17 +120,22 @@
// #/map/0/5
// #/map/0/16/-122.4006/37.7873
router.route( 
/map\/([0-9]+)(?:\/([0-9]+))?(?:\/([\-\+]?\d+\.?\d{0,5})?\/([\-\+]?\d+\.?\d{0,5})?)?/,
 function ( maptagId, zoom, latitude, longitude ) {
-   var map = maps[ maptagId ];
+   var map = maps[ maptagId ],
+   position;
 
if ( !map ) {
router.navigate( '' );
return;
}
 
-   map.openFullScreen( {
-   center: [ +latitude, +longitude ],
-   zoom: +zoom
-   } );
+   if ( zoom !== undefined && latitude !== 
undefined && longitude !== undefined ) {
+   position = {
+   center: [ +latitude, +longitude 
],
+   zoom: +zoom
+   };
+   }
+
+   map.openFullScreen( position );
} );
 
// Check if we need to open a map in full screen.
diff --git a/modules/maplink/maplink.js b/modules/maplink/maplink.js
index 8f1361d..ed45dea 100644
--- a/modules/maplink/maplink.js
+++ b/modules/maplink/maplink.js
@@ -10,7 +10,7 @@
  * @class Kartographer.Link
  * @singleton
  */
-module.exports = ( function ( $, mw, router, kartobox ) {
+module.exports = ( function ( $, mw, router, kartobox, undefined ) {
 
/**
 * References the maplinks of the page.
@@ -90,17 +90,22 @@
// #/maplink/0/5
// #/maplink/0/16/-122.4006/37.7873
router.route( 
/maplink\/([0-9]+)(?:\/([0-9]+))?(?:\/([\-\+]?\d+\.?\d{0,5})?\/([\-\+]?\d+\.?\d{0,5})?)?/,
 function ( maptagId, zoom, latitude, longitude ) {
-   var link = maplinks[ maptagId ];
+   var link = maplinks[ maptagId ],
+   position;
 
if ( !link ) {
router.navigate( '' );
return;
}
 
-   link.openFullScreen( {
-   center: [ +latitude, +longitude ],
-   zoom: +zoom
-   } );
+   if ( zoom !== undefined && latitude !== undefined && 
longitude !== undefined ) {
+   position = {
+   center: [ +latitude, +longitude ],
+   zoom: +zoom
+   };
+   }
+
+   link.openFullScreen( position );
} );
 
// Check if we need to open a map in full screen.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4f756480f55f93b49fba81298cdc3c0f977dbc8a
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: JGirault 
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...Kartographer[wmf/1.28.0-wmf.17]: Fix maplink and mapframe when lat/lon/zoom are undefined

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

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

Change subject: Fix maplink and mapframe when lat/lon/zoom are undefined
..

Fix maplink and mapframe when lat/lon/zoom are undefined

Bug: T11
Change-Id: I4f756480f55f93b49fba81298cdc3c0f977dbc8a
---
M modules/mapframe/mapframe.js
M modules/maplink/maplink.js
2 files changed, 21 insertions(+), 11 deletions(-)


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

diff --git a/modules/mapframe/mapframe.js b/modules/mapframe/mapframe.js
index df683c8..37e502e 100644
--- a/modules/mapframe/mapframe.js
+++ b/modules/mapframe/mapframe.js
@@ -120,17 +120,22 @@
// #/map/0/5
// #/map/0/16/-122.4006/37.7873
router.route( 
/map\/([0-9]+)(?:\/([0-9]+))?(?:\/([\-\+]?\d+\.?\d{0,5})?\/([\-\+]?\d+\.?\d{0,5})?)?/,
 function ( maptagId, zoom, latitude, longitude ) {
-   var map = maps[ maptagId ];
+   var map = maps[ maptagId ],
+   position;
 
if ( !map ) {
router.navigate( '' );
return;
}
 
-   map.openFullScreen( {
-   center: [ +latitude, +longitude ],
-   zoom: +zoom
-   } );
+   if ( zoom !== undefined && latitude !== 
undefined && longitude !== undefined ) {
+   position = {
+   center: [ +latitude, +longitude 
],
+   zoom: +zoom
+   };
+   }
+
+   map.openFullScreen( position );
} );
 
// Check if we need to open a map in full screen.
diff --git a/modules/maplink/maplink.js b/modules/maplink/maplink.js
index 8f1361d..ed45dea 100644
--- a/modules/maplink/maplink.js
+++ b/modules/maplink/maplink.js
@@ -10,7 +10,7 @@
  * @class Kartographer.Link
  * @singleton
  */
-module.exports = ( function ( $, mw, router, kartobox ) {
+module.exports = ( function ( $, mw, router, kartobox, undefined ) {
 
/**
 * References the maplinks of the page.
@@ -90,17 +90,22 @@
// #/maplink/0/5
// #/maplink/0/16/-122.4006/37.7873
router.route( 
/maplink\/([0-9]+)(?:\/([0-9]+))?(?:\/([\-\+]?\d+\.?\d{0,5})?\/([\-\+]?\d+\.?\d{0,5})?)?/,
 function ( maptagId, zoom, latitude, longitude ) {
-   var link = maplinks[ maptagId ];
+   var link = maplinks[ maptagId ],
+   position;
 
if ( !link ) {
router.navigate( '' );
return;
}
 
-   link.openFullScreen( {
-   center: [ +latitude, +longitude ],
-   zoom: +zoom
-   } );
+   if ( zoom !== undefined && latitude !== undefined && 
longitude !== undefined ) {
+   position = {
+   center: [ +latitude, +longitude ],
+   zoom: +zoom
+   };
+   }
+
+   link.openFullScreen( position );
} );
 
// Check if we need to open a map in full screen.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f756480f55f93b49fba81298cdc3c0f977dbc8a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: wmf/1.28.0-wmf.17
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Script to import images using ForeignAPIRepo

2016-08-31 Thread MarkAHershberger (Code Review)
MarkAHershberger has uploaded a new change for review.

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

Change subject: Script to import images using ForeignAPIRepo
..

Script to import images using ForeignAPIRepo

In some environments (e.g. Webservers behind firewalls), InstantCommons
isn't available or isn't desired.  Meanwhile, templates are still
imported from Wikipedia and, without InstantCommons, there isn't an easy
way to import the files associated with those templates.

The script here will produce a list of wanted files and (as a separate
step outside the firewall if necessary) download those images into a
directory.  The script can also import them directly to the wiki in a
single step if desired.

This patch also includes a small adjustment to ForeignAPIRepo for DRY.

Change-Id: Ib3c2145be59c86b77bcec5fc8bcea657c6822c70
---
M includes/filerepo/ForeignAPIRepo.php
A maintenance/importForeignFileList.php
2 files changed, 195 insertions(+), 16 deletions(-)


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

diff --git a/includes/filerepo/ForeignAPIRepo.php 
b/includes/filerepo/ForeignAPIRepo.php
index 8619ba6..9f79700 100644
--- a/includes/filerepo/ForeignAPIRepo.php
+++ b/includes/filerepo/ForeignAPIRepo.php
@@ -253,6 +253,18 @@
return $ret;
}
 
+public function getImageData( $name, $width = -1, $height = -1, 
$otherParams = '', $etc = [] ) {
+return $this->fetchImageQuery(
+array_merge( [
+'titles' => 'File:' . $name,
+'iiprop' => self::getIIProps(),
+'iiurlwidth' => $width,
+'iiurlheight' => $height,
+'iiurlparam' => $otherParams,
+'prop' => 'imageinfo'
+], $etc ) );
+}
+
/**
 * @param string $name
 * @param int $width
@@ -263,13 +275,7 @@
 * @return bool
 */
function getThumbUrl( $name, $width = -1, $height = -1, &$result = 
null, $otherParams = '' ) {
-   $data = $this->fetchImageQuery( [
-   'titles' => 'File:' . $name,
-   'iiprop' => self::getIIProps(),
-   'iiurlwidth' => $width,
-   'iiurlheight' => $height,
-   'iiurlparam' => $otherParams,
-   'prop' => 'imageinfo' ] );
+   $data = $this->getImageData( $name, $width, $height, 
$otherParams );
$info = $this->getImageInfo( $data );
 
if ( $data && $info && isset( $info['thumburl'] ) ) {
@@ -292,15 +298,7 @@
 * @since 1.22
 */
function getThumbError( $name, $width = -1, $height = -1, $otherParams 
= '', $lang = null ) {
-   $data = $this->fetchImageQuery( [
-   'titles' => 'File:' . $name,
-   'iiprop' => self::getIIProps(),
-   'iiurlwidth' => $width,
-   'iiurlheight' => $height,
-   'iiurlparam' => $otherParams,
-   'prop' => 'imageinfo',
-   'uselang' => $lang,
-   ] );
+   $data = $this->getImageData( $name, $width, $height, 
$otherParams, [ 'uselang' => $lang ] );
$info = $this->getImageInfo( $data );
 
if ( $data && $info && isset( $info['thumberror'] ) ) {
diff --git a/maintenance/importForeignFileList.php 
b/maintenance/importForeignFileList.php
new file mode 100644
index 000..2f55f57
--- /dev/null
+++ b/maintenance/importForeignFileList.php
@@ -0,0 +1,181 @@
+https://commons.wikimedia.org/w/api.php';
+
+   public function __construct() {
+   parent::__construct();
+   $this->mDescription = "Import foreign file list";
+
+   $this->addOption( 'apiUrl', 'URL to retrieve from (' 
.self::$apiURL. ')',
+ false, true, 'u' );
+   $this->addOption( 'wantedFiles', 'Only print out wanted files', 
false, false, 'w' );
+   $this->addOption( 'downloadDir', 'If provided, the files will 
only be downloaded to ' .
+ 'this directory and not 
imported.', false, true, 'd' );
+   $this->addOption( 'force', 'Force overwriting existing files.', 
false, false, 'f' );
+
+   $this->addArg( 'list', 'The file to read the wanted list from.  
If ' .
+  'not specified, uses the list from ' 
.
+  '[[Special:WantedFiles]].', false, 
true );
+   }
+
+   public function execute() {
+   $this->init();
+   foreach ( $this->getFileList() as $item ) {
+   $file = $this->getFileName( $item );
+   if ( $this->onlyShowWanted ) {
+

[MediaWiki-commits] [Gerrit] mediawiki...PerformanceInspector[master]: One implementation of bytes to human readable size

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

Change subject: One implementation of bytes to human readable size
..


One implementation of bytes to human readable size

Bug: T143980
Change-Id: Icd18260918fc4616dac812c8c6aea98fce925ad0
---
M modules/collectors/ext.PerformanceInspector.imagesize.js
M modules/collectors/ext.PerformanceInspector.moduleslocalstorage.js
M modules/collectors/ext.PerformanceInspector.modulessize.js
M modules/ext.PerformanceInspector.view.js
4 files changed, 23 insertions(+), 50 deletions(-)

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



diff --git a/modules/collectors/ext.PerformanceInspector.imagesize.js 
b/modules/collectors/ext.PerformanceInspector.imagesize.js
index dff9e5b..ab5a0c1 100644
--- a/modules/collectors/ext.PerformanceInspector.imagesize.js
+++ b/modules/collectors/ext.PerformanceInspector.imagesize.js
@@ -7,28 +7,14 @@
totalSize = 0,
warnings = 0,
maxImageNameLength = 60,
-   images = [];
+   images = [],
+   humanSize = module.exports.humanSize;
 
function getImageName( name ) {
if ( name.length > maxImageNameLength ) {
return name.substr( 0, maxImageNameLength - 1 );
}
return name;
-   }
-
-   function humanSize( bytes ) {
-   var i = 0,
-   units = [ 'size-bytes', 
'size-kilobytes','size-megabytes', 'size-gigabytes' ];
-
-   if ( !$.isNumeric( bytes ) || bytes === 0 ) {
-   return bytes;
-   }
-   for ( ; bytes >= 1024; bytes /= 1024 ) {
-   i++;
-   }
-   // Maintain one decimal for kB and above, but don't
-   // add ".0" for bytes.
-   return mw.msg( units[ i ], bytes.toFixed( i > 0 ? 1 : 0 
) ) ;
}
 
function fetchUsingAjax() {
diff --git a/modules/collectors/ext.PerformanceInspector.moduleslocalstorage.js 
b/modules/collectors/ext.PerformanceInspector.moduleslocalstorage.js
index d47d279..cb7edb3 100644
--- a/modules/collectors/ext.PerformanceInspector.moduleslocalstorage.js
+++ b/modules/collectors/ext.PerformanceInspector.moduleslocalstorage.js
@@ -1,22 +1,8 @@
 ( function ( mw ) {
 
var moduleCollector = function runModuleCollector( data ) {
-   var modulesTemplate = mw.template.get( 
'ext.PerformanceInspector.analyze', 'moduleslocalstorage.mustache' );
-
-   function humanSize( bytes ) {
-   var i = 0,
-   units = [ 'size-bytes', 
'size-kilobytes','size-megabytes', 'size-gigabytes' ];
-
-   if ( !$.isNumeric( bytes ) || bytes === 0 ) {
-   return bytes;
-   }
-   for ( ; bytes >= 1024; bytes /= 1024 ) {
-   i++;
-   }
-   // Maintain one decimal for kB and above, but don't
-   // add ".0" for bytes.
-   return mw.msg( units[ i ], bytes.toFixed( i > 0 ? 1 : 0 
) ) ;
-   }
+   var modulesTemplate = mw.template.get( 
'ext.PerformanceInspector.analyze', 'moduleslocalstorage.mustache' ),
+   humanSize = module.exports.humanSize;
 
return {
summary: {},
diff --git a/modules/collectors/ext.PerformanceInspector.modulessize.js 
b/modules/collectors/ext.PerformanceInspector.modulessize.js
index 5b165a5..54284dc 100644
--- a/modules/collectors/ext.PerformanceInspector.modulessize.js
+++ b/modules/collectors/ext.PerformanceInspector.modulessize.js
@@ -1,24 +1,10 @@
-( function ( mw, $ ) {
+( function ( mw ) {
 
var moduleCollector = function runModuleCollector( data ) {
var totalSize = 0,
barMetrics = [],
-   modulesTemplate = mw.template.get( 
'ext.PerformanceInspector.analyze', 'modulessize.mustache' );
-
-   function humanSize( bytes ) {
-   var i = 0,
-   units = [ 'size-bytes', 
'size-kilobytes','size-megabytes', 'size-gigabytes' ];
-
-   if ( !$.isNumeric( bytes ) || bytes === 0 ) {
-   return bytes;
-   }
-   for ( ; bytes >= 1024; bytes /= 1024 ) {
-   i++;
-   }
-   // Maintain one decimal for kB and above, but don't
-   // add ".0" for bytes.
-   

[MediaWiki-commits] [Gerrit] operations...openssl[wmf-1.1]: openssl (1.1.0-1~wmf1) experimental; urgency=medium

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

Change subject: openssl (1.1.0-1~wmf1) experimental; urgency=medium
..


openssl (1.1.0-1~wmf1) experimental; urgency=medium

  * Added local chapoly preference hack patch

 -- Brandon Black   Tue, 30 Aug 2016 02:23:57 +

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



diff --git a/debian/changelog b/debian/changelog
index 66f1a3a..0a492d7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+openssl (1.1.0-1~wmf1) experimental; urgency=medium
+
+  * Added local chapoly preference hack patch
+
+ -- Brandon Black   Tue, 30 Aug 2016 02:23:57 +
+
 openssl (1.1.0-1) experimental; urgency=medium
 
   [ Kurt Roeckx ]

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia8598278cf06a5f14ba3de343349f4f949b16ac0
Gerrit-PatchSet: 3
Gerrit-Project: operations/debs/openssl
Gerrit-Branch: wmf-1.1
Gerrit-Owner: BBlack 
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...openssl[wmf-1.1]: Add local chapoly preference hack patch

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

Change subject: Add local chapoly preference hack patch
..


Add local chapoly preference hack patch

Change-Id: I3d78bced70591c095866aeff74e9910be93b9887
---
A debian/patches/chapoly-prefhack.patch
M debian/patches/series
2 files changed, 58 insertions(+), 0 deletions(-)



diff --git a/debian/patches/chapoly-prefhack.patch 
b/debian/patches/chapoly-prefhack.patch
new file mode 100644
index 000..80d873a
--- /dev/null
+++ b/debian/patches/chapoly-prefhack.patch
@@ -0,0 +1,57 @@
+diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c
+index e94ee83..75d5435 100644
+--- a/ssl/s3_lib.c
 b/ssl/s3_lib.c
+@@ -3582,6 +3582,7 @@ const SSL_CIPHER *ssl3_choose_cipher(SSL *s, 
STACK_OF(SSL_CIPHER) *clnt,
+ STACK_OF(SSL_CIPHER) *prio, *allow;
+ int i, ii, ok;
+ unsigned long alg_k, alg_a, mask_k, mask_a;
++int use_chapoly = 0;
+ 
+ /* Let's see which ciphers we can support */
+ 
+@@ -3614,9 +3615,31 @@ const SSL_CIPHER *ssl3_choose_cipher(SSL *s, 
STACK_OF(SSL_CIPHER) *clnt,
+ if (s->options & SSL_OP_CIPHER_SERVER_PREFERENCE || tls1_suiteb(s)) {
+ prio = srvr;
+ allow = clnt;
++/*
++ * Search client ciphersuite subset 'ECDHE-*', turning on server-side
++ * chapoly support iff chapoly is higher than AES-GCM (which may not
++ * even exist!) within.  This is intended to be used with a server
++ * preference that starts out with chapoly before aesgcm:
++ * ECDHE-RSA-CHACHA20-POLY1305 (and/or ECDSA)
++ * ECDHE-RSA-AES128-GCM-SHA256 (and/or ECDSA and/or AES256)
++ * ... lesser compatibility options ...
++ */
++for (i = 0; i < sk_SSL_CIPHER_num(clnt); i++) {
++c = sk_SSL_CIPHER_value(clnt, i);
++if (c->algorithm_mkey == SSL_kEECDH) {
++if (c->algorithm_enc == SSL_AES128GCM
++|| c->algorithm_enc == SSL_AES256GCM) {
++break;
++} else if (c->algorithm_enc == SSL_CHACHA20POLY1305) {
++use_chapoly = 1;
++break;
++}
++}
++}
+ } else {
+ prio = clnt;
+ allow = srvr;
++use_chapoly = 1;
+ }
+ 
+ tls1_set_cert_validity(s);
+@@ -3634,6 +3657,12 @@ const SSL_CIPHER *ssl3_choose_cipher(SSL *s, 
STACK_OF(SSL_CIPHER) *clnt,
+  DTLS_VERSION_GT(s->version, c->max_dtls)))
+ continue;
+ 
++/* Skip chapoly unless turned on above */
++if (c->algorithm_enc == SSL_CHACHA20POLY1305
++&& c->algorithm_mkey == SSL_kEECDH
++&& !use_chapoly)
++continue;
++
+ mask_k = s->s3->tmp.mask_k;
+ mask_a = s->s3->tmp.mask_a;
+ #ifndef OPENSSL_NO_SRP
diff --git a/debian/patches/series b/debian/patches/series
index 5b5a83d..132ed71 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
 pic.patch
 c_rehash-compat.patch
 #padlock_conf.patch
+chapoly-prefhack.patch

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3d78bced70591c095866aeff74e9910be93b9887
Gerrit-PatchSet: 2
Gerrit-Project: operations/debs/openssl
Gerrit-Branch: wmf-1.1
Gerrit-Owner: BBlack 
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]: Cloud.cfg tidying for precise and trusty images

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

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

Change subject: Cloud.cfg tidying for precise and trusty images
..

Cloud.cfg tidying for precise and trusty images

Change-Id: I63ba5a847c0f5ebb30576c1f0cb28370aec82801
---
M modules/labs_vmbuilder/templates/cloud.cfg.erb
1 file changed, 4 insertions(+), 3 deletions(-)


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

diff --git a/modules/labs_vmbuilder/templates/cloud.cfg.erb 
b/modules/labs_vmbuilder/templates/cloud.cfg.erb
index 8fde80d..7753670 100644
--- a/modules/labs_vmbuilder/templates/cloud.cfg.erb
+++ b/modules/labs_vmbuilder/templates/cloud.cfg.erb
@@ -65,7 +65,6 @@
  - rightscale_userdata
  - scripts-per-once
  - scripts-per-boot
- - scripts-per-instance
  - scripts-user
  - keys-to-console
  - phone-home
@@ -75,11 +74,13 @@
  - ssh-authkey-fingerprints
  - power-state-change
 <% end %>
+# We would uncomment this if we had things to run on every boot
+# - scripts-per-instance
 
+system_info:
 <% if scope.function_os_version(['ubuntu >= trusty']) %>
 # System and/or distro specific settings
 # (not accessible to handlers/transforms)
-system_info:
# This will affect which distro class gets used
distro: ubuntu
# Default user name + that default users groups (if added/used)
@@ -95,6 +96,7 @@
   cloud_dir: /var/lib/cloud/
   templates_dir: /etc/cloud/templates/
   upstart_dir: /etc/init/
+<% end %>
package_mirrors:
  - arches: [i386, amd64]
failsafe:
@@ -110,4 +112,3 @@
  primary: http://ports.ubuntu.com/ubuntu-ports
  security: http://ports.ubuntu.com/ubuntu-ports
ssh_svcname: ssh
-<% end %>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63ba5a847c0f5ebb30576c1f0cb28370aec82801
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] mediawiki...CirrusSearch[master]: Do not use the suggest reverse field if it's a non local search

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

Change subject: Do not use the suggest reverse field if it's a non local search
..


Do not use the suggest reverse field if it's a non local search

We do not know if the reverse field is available on extra indices.
We should not use it for such queries.

Change-Id: Ia88618f38ad39ee58ed07b291f1b1ed67debd54a
---
M includes/Query/FullTextQueryStringQueryBuilder.php
1 file changed, 15 insertions(+), 3 deletions(-)

Approvals:
  Smalyshev: Looks good to me, approved
  Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/Query/FullTextQueryStringQueryBuilder.php 
b/includes/Query/FullTextQueryStringQueryBuilder.php
index 9f22dfd..45decbb 100644
--- a/includes/Query/FullTextQueryStringQueryBuilder.php
+++ b/includes/Query/FullTextQueryStringQueryBuilder.php
@@ -2,6 +2,7 @@
 
 namespace CirrusSearch\Query;
 
+use CirrusSearch\OtherIndexes;
 use CirrusSearch\SearchConfig;
 use CirrusSearch\Searcher;
 use CirrusSearch\Search\Escaper;
@@ -222,7 +223,7 @@
if ( $showSuggestion ) {
$searchContext->setSuggest( [
'text' => $term,
-   'suggest' => $this->buildSuggestConfig( 
'suggest' ),
+   'suggest' => $this->buildSuggestConfig( 
'suggest', $searchContext ),
] );
}
}
@@ -259,9 +260,10 @@
 * Build suggest config for $field.
 *
 * @param string $field field to suggest against
+* @param SearchContext $searchContext
 * @return array[] array of Elastica configuration
 */
-   private function buildSuggestConfig( $field ) {
+   private function buildSuggestConfig( $field, $searchContext ) {
// check deprecated settings
$suggestSettings = $this->config->get( 
'CirrusSearchPhraseSuggestSettings' );
$maxErrors = $this->config->get( 
'CirrusSearchPhraseSuggestMaxErrors' );
@@ -295,8 +297,18 @@
],
],
];
+   $extraIndexes = null;
+   if ( $searchContext->getNamespaces() ) {
+   $extraIndexes = 
OtherIndexes::getExtraIndexesForNamespaces(
+   $searchContext->getNamespaces()
+   );
+   }
// Add a second generator with the reverse field
-   if ( $this->config->getElement( 
'CirrusSearchPhraseSuggestReverseField', 'use' ) ) {
+   // Only do this for local queries, we don't know if it's 
activated
+   // on other wikis.
+   if ( empty( $extraIndexes )
+   && $this->config->getElement( 
'CirrusSearchPhraseSuggestReverseField', 'use' )
+   ) {
$settings['phrase']['direct_generator'][] = [
'field' => $field . '.reverse',
'suggest_mode' => $suggestSettings['mode'],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia88618f38ad39ee58ed07b291f1b1ed67debd54a
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: DCausse 
Gerrit-Reviewer: Cindy-the-browser-test-bot 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: Manybubbles 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: WIP: T119265: Add more page-level metadata required by MCS

2016-08-31 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has uploaded a new change for review.

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

Change subject: WIP: T119265: Add more page-level metadata required by MCS
..

WIP: T119265: Add more page-level metadata required by MCS

* Some additional cleanup as a followup to 89f0eedf -- no need to
  fetch and store that metadata if we aren't going to spit it out.

* Need to figure out what else we need to add and where it is
  available.

Change-Id: I99781d0668871398de349fa6f4579cb0bb29488a
---
M lib/config/MWParserEnvironment.js
M lib/mw/ApiRequest.js
M lib/wt2html/DOMPostProcessor.js
3 files changed, 19 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/80/307880/1

diff --git a/lib/config/MWParserEnvironment.js 
b/lib/config/MWParserEnvironment.js
index e7de92d..b75e3f0 100644
--- a/lib/config/MWParserEnvironment.js
+++ b/lib/config/MWParserEnvironment.js
@@ -325,11 +325,8 @@
r.revid = metadata.revision.revid;
r.parentid = metadata.revision.parentid;
r.timestamp = metadata.revision.timestamp;
-   r.user = metadata.revision.user;
-   r.userid = metadata.revision.userid;
r.sha1 = metadata.revision.sha1;
r.size = metadata.revision.size;
-   r.comment = metadata.revision.comment;
r.contentmodel = metadata.revision.contentmodel;
r.contentformat = metadata.revision.contentformat;
}
diff --git a/lib/mw/ApiRequest.js b/lib/mw/ApiRequest.js
index 886f856..494d71b 100644
--- a/lib/mw/ApiRequest.js
+++ b/lib/mw/ApiRequest.js
@@ -76,7 +76,7 @@
 var latestSerial = 0;
 
 // all revision properties which parsoid is interested in.
-var PARSOID_RVPROP = 
('content|ids|timestamp|user|userid|size|sha1|contentmodel|comment');
+var PARSOID_RVPROP = ('content|ids|timestamp|size|sha1|contentmodel');
 
 var logAPIWarnings = function(req, data) {
if (req.env.conf.parsoid.logMwApiWarnings &&
diff --git a/lib/wt2html/DOMPostProcessor.js b/lib/wt2html/DOMPostProcessor.js
index eafe367..3a01450 100644
--- a/lib/wt2html/DOMPostProcessor.js
+++ b/lib/wt2html/DOMPostProcessor.js
@@ -37,10 +37,15 @@
property: 'mw:articleNamespace',
content: '%d',
},
-   // the articleID is not stable across article deletion/restore, while
-   // the revisionID is.  So we're going to omit the articleID from the
-   // parsoid API for now; uncomment if we find a use case.
-   //  id: 'mw:articleId',
+   // articleID is not stable across article deletion/restore,
+   // while the revisionID is. However, Mobile Content Service
+   // wants this. See https://phabricator.wikimedia.org/T119265
+   id: {
+   property: 'mw:articleId',
+   content: '%d',
+   },
+
+   // DO NOT ADD rev_user, rev_userid, and rev_comment (See T125266)
 
// 'rev_revid' is used to set the overall subject of the document, we 
don't
// need to add a specific  or  element for it.
@@ -302,6 +307,15 @@
document.documentElement.setAttribute(
'about', mwrPrefix + 'revision/' + m.get('rev_revid'));
}
+
+   // SSS quick hack for now .. check if we already have these in 
normalized form.
+   if (env.conf.wiki.mainpage.replace(/_/g, ' ') === 
env.page.name.replace(/_/g, ' ')) {
+   appendToHead(document, 'meta', {
+   'property': 'isMainPage',
+   'content': true,
+   });
+   }
+
// Set the parsoid content-type strings
appendToHead(document, 'meta', {
'property': 'mw:html:version',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I99781d0668871398de349fa6f4579cb0bb29488a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry 

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


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Fix maplink

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

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

Change subject: Fix maplink
..

Fix maplink

Bug: T11
Change-Id: I4f756480f55f93b49fba81298cdc3c0f977dbc8a
---
M modules/maplink/maplink.js
1 file changed, 14 insertions(+), 8 deletions(-)


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

diff --git a/modules/maplink/maplink.js b/modules/maplink/maplink.js
index 8f1361d..542d327 100644
--- a/modules/maplink/maplink.js
+++ b/modules/maplink/maplink.js
@@ -10,7 +10,7 @@
  * @class Kartographer.Link
  * @singleton
  */
-module.exports = ( function ( $, mw, router, kartobox ) {
+module.exports = ( function ( $, mw, router, kartobox, undefined ) {
 
/**
 * References the maplinks of the page.
@@ -92,15 +92,21 @@
router.route( 
/maplink\/([0-9]+)(?:\/([0-9]+))?(?:\/([\-\+]?\d+\.?\d{0,5})?\/([\-\+]?\d+\.?\d{0,5})?)?/,
 function ( maptagId, zoom, latitude, longitude ) {
var link = maplinks[ maptagId ];
 
-   if ( !link ) {
-   router.navigate( '' );
-   return;
+   if ( link ) {
+   zoom = zoom || link.zoom;
+   latitude = latitude || link.center[0];
+   longitude = longitude || link.center[1];
}
 
-   link.openFullScreen( {
-   center: [ +latitude, +longitude ],
-   zoom: +zoom
-   } );
+   if ( zoom !== undefined && latitude !== undefined && 
longitude !== undefined ) {
+   link.openFullScreen( {
+   center: [ +latitude, +longitude ],
+   zoom: +zoom
+   } );
+   } else {
+   router.navigate( '' );
+   }
+
} );
 
// Check if we need to open a map in full screen.

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...MultimediaViewer[master]: DONOTMERGE: Test

2016-08-31 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: DONOTMERGE: Test
..

DONOTMERGE: Test

Change-Id: Id7f0981fa197aa37215ee7ea4a38b62c777595b4
---
M tests/browser/features/mmv.download.feature
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer 
refs/changes/79/307879/1

diff --git a/tests/browser/features/mmv.download.feature 
b/tests/browser/features/mmv.download.feature
index fac69f3..8790708 100644
--- a/tests/browser/features/mmv.download.feature
+++ b/tests/browser/features/mmv.download.feature
@@ -1,5 +1,5 @@
 @chrome @en.wikipedia.beta.wmflabs.org @firefox @integration @safari 
@test2.wikipedia.org
-Feature: Download menu
+Feature: Download menu test me
 
   Background:
 Given I am viewing an image using MMV

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7f0981fa197aa37215ee7ea4a38b62c777595b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Further attempt to get the precise cloud-init working

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

Change subject: Further attempt to get the precise cloud-init working
..


Further attempt to get the precise cloud-init working

Change-Id: I1187425fe9b95c57acac24af7d1979d202b4d2f1
---
M modules/labs_vmbuilder/templates/cloud.cfg.erb
1 file changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/modules/labs_vmbuilder/templates/cloud.cfg.erb 
b/modules/labs_vmbuilder/templates/cloud.cfg.erb
index 65a62bd..8fde80d 100644
--- a/modules/labs_vmbuilder/templates/cloud.cfg.erb
+++ b/modules/labs_vmbuilder/templates/cloud.cfg.erb
@@ -42,7 +42,6 @@
 cloud_config_modules:
 # Emit the cloud config ready event
 # this can be used by upstart jobs for 'start on cloud-config'.
- - disk_setup
  - mounts
  - locale
  - set-passwords
@@ -55,6 +54,7 @@
  - runcmd
  - byobu
 <% if scope.function_os_version(['ubuntu >= trusty']) %>
+ - disk_setup
  - emit_upstart
  - apt-configure
  - package-update-upgrade-install
@@ -65,17 +65,18 @@
  - rightscale_userdata
  - scripts-per-once
  - scripts-per-boot
+ - scripts-per-instance
  - scripts-user
  - keys-to-console
  - phone-home
  - final-message
 <% if scope.function_os_version(['ubuntu >= trusty']) %>
- - scripts-per-instance
  - scripts-vendor
  - ssh-authkey-fingerprints
  - power-state-change
 <% end %>
 
+<% if scope.function_os_version(['ubuntu >= trusty']) %>
 # System and/or distro specific settings
 # (not accessible to handlers/transforms)
 system_info:
@@ -109,3 +110,4 @@
  primary: http://ports.ubuntu.com/ubuntu-ports
  security: http://ports.ubuntu.com/ubuntu-ports
ssh_svcname: ssh
+<% end %>

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

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

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Remove "overhaul" designation.

2016-08-31 Thread Dbrant (Code Review)
Dbrant has uploaded a new change for review.

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

Change subject: Remove "overhaul" designation.
..

Remove "overhaul" designation.

Bug: T143441
Change-Id: I7063241b2b0b444255f3a15425485c09817d7fa0
---
M app/src/main/AndroidManifest.xml
R app/src/main/java/org/wikipedia/MainActivity.java
R app/src/main/java/org/wikipedia/MainFragment.java
M app/src/main/java/org/wikipedia/analytics/SearchFunnel.java
R app/src/main/java/org/wikipedia/navtab/NavTab.java
R app/src/main/java/org/wikipedia/navtab/NavTabLayout.java
R app/src/main/java/org/wikipedia/navtab/NavTabView.java
R app/src/main/java/org/wikipedia/navtab/NavTabViewPagerAdapter.java
M app/src/main/java/org/wikipedia/page/PageActivity.java
R app/src/main/java/org/wikipedia/search/SearchFragment.java
M app/src/main/java/org/wikipedia/util/FeedbackUtil.java
M app/src/main/res/layout/activity_page.xml
R app/src/main/res/layout/fragment_main.xml
R app/src/main/res/layout/fragment_search.xml
M app/src/main/res/values-w480dp/dimens.xml
M app/src/main/res/values/dimens.xml
M app/src/main/res/values/styles.xml
17 files changed, 56 insertions(+), 62 deletions(-)


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

diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 0092c03..7865961 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -54,7 +54,7 @@
 
 
-
-implements OverhaulFragment.Callback {
+public class MainActivity extends 
SingleFragmentActivityWithToolbar
+implements MainFragment.Callback {
 public static Intent newIntent(@NonNull Context context) {
-return new Intent(context, OverhaulActivity.class);
+return new Intent(context, MainActivity.class);
 }
 
-@Override protected OverhaulFragment createFragment() {
-return OverhaulFragment.newInstance();
+@Override protected MainFragment createFragment() {
+return MainFragment.newInstance();
 }
 
 @Override protected void setTheme() { }
diff --git a/app/src/main/java/org/wikipedia/overhaul/OverhaulFragment.java 
b/app/src/main/java/org/wikipedia/MainFragment.java
similarity index 87%
rename from app/src/main/java/org/wikipedia/overhaul/OverhaulFragment.java
rename to app/src/main/java/org/wikipedia/MainFragment.java
index 7d87106..7bf5b23 100644
--- a/app/src/main/java/org/wikipedia/overhaul/OverhaulFragment.java
+++ b/app/src/main/java/org/wikipedia/MainFragment.java
@@ -1,4 +1,4 @@
-package org.wikipedia.overhaul;
+package org.wikipedia;
 
 import android.app.Activity;
 import android.content.ActivityNotFoundException;
@@ -15,8 +15,6 @@
 import android.view.View;
 import android.view.ViewGroup;
 
-import org.wikipedia.Constants;
-import org.wikipedia.R;
 import org.wikipedia.activity.FragmentUtil;
 import org.wikipedia.feed.FeedFragment;
 import org.wikipedia.feed.image.FeaturedImage;
@@ -25,15 +23,15 @@
 import org.wikipedia.history.HistoryEntry;
 import org.wikipedia.history.HistoryFragment;
 import org.wikipedia.nearby.NearbyFragment;
-import org.wikipedia.overhaul.navtab.NavTab;
-import org.wikipedia.overhaul.navtab.NavTabViewPagerAdapter;
+import org.wikipedia.navtab.NavTab;
+import org.wikipedia.navtab.NavTabViewPagerAdapter;
 import org.wikipedia.page.ExclusiveBottomSheetPresenter;
 import org.wikipedia.page.PageActivity;
 import org.wikipedia.page.PageTitle;
 import org.wikipedia.page.linkpreview.LinkPreviewDialog;
 import org.wikipedia.readinglist.AddToReadingListDialog;
 import org.wikipedia.readinglist.ReadingListsFragment;
-import org.wikipedia.search.OverhaulSearchFragment;
+import org.wikipedia.search.SearchFragment;
 import org.wikipedia.search.SearchResultsFragment;
 import org.wikipedia.util.ClipboardUtil;
 import org.wikipedia.util.FeedbackUtil;
@@ -44,22 +42,22 @@
 import butterknife.OnPageChange;
 import butterknife.Unbinder;
 
-public class OverhaulFragment extends Fragment implements 
FeedFragment.Callback,
+public class MainFragment extends Fragment implements FeedFragment.Callback,
 NearbyFragment.Callback, HistoryFragment.Callback, 
ReadingListsFragment.Callback,
-OverhaulSearchFragment.Callback, SearchResultsFragment.Callback,
+SearchFragment.Callback, SearchResultsFragment.Callback,
 LinkPreviewDialog.Callback {
-@BindView(R.id.fragment_overhaul_view_pager) ViewPager viewPager;
+@BindView(R.id.fragment_main_view_pager) ViewPager viewPager;
 @BindView(R.id.view_nav_view_pager_tab_layout) TabLayout tabLayout;
 private Unbinder unbinder;
-private OverhaulSearchFragment searchFragment;
+private SearchFragment searchFragment;
 private ExclusiveBottomSheetPresenter bottomSheetPresenter;
 
 public interface Callback {
 void onTabChanged(@NonNull NavTab tab, @NonNull Fragment fragment);
 }
 
-public static 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Further attempt to get the precise cloud-init working

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

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

Change subject: Further attempt to get the precise cloud-init working
..

Further attempt to get the precise cloud-init working

Change-Id: I1187425fe9b95c57acac24af7d1979d202b4d2f1
---
M modules/labs_vmbuilder/templates/cloud.cfg.erb
1 file changed, 4 insertions(+), 2 deletions(-)


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

diff --git a/modules/labs_vmbuilder/templates/cloud.cfg.erb 
b/modules/labs_vmbuilder/templates/cloud.cfg.erb
index 65a62bd..8fde80d 100644
--- a/modules/labs_vmbuilder/templates/cloud.cfg.erb
+++ b/modules/labs_vmbuilder/templates/cloud.cfg.erb
@@ -42,7 +42,6 @@
 cloud_config_modules:
 # Emit the cloud config ready event
 # this can be used by upstart jobs for 'start on cloud-config'.
- - disk_setup
  - mounts
  - locale
  - set-passwords
@@ -55,6 +54,7 @@
  - runcmd
  - byobu
 <% if scope.function_os_version(['ubuntu >= trusty']) %>
+ - disk_setup
  - emit_upstart
  - apt-configure
  - package-update-upgrade-install
@@ -65,17 +65,18 @@
  - rightscale_userdata
  - scripts-per-once
  - scripts-per-boot
+ - scripts-per-instance
  - scripts-user
  - keys-to-console
  - phone-home
  - final-message
 <% if scope.function_os_version(['ubuntu >= trusty']) %>
- - scripts-per-instance
  - scripts-vendor
  - ssh-authkey-fingerprints
  - power-state-change
 <% end %>
 
+<% if scope.function_os_version(['ubuntu >= trusty']) %>
 # System and/or distro specific settings
 # (not accessible to handlers/transforms)
 system_info:
@@ -109,3 +110,4 @@
  primary: http://ports.ubuntu.com/ubuntu-ports
  security: http://ports.ubuntu.com/ubuntu-ports
ssh_svcname: ssh
+<% end %>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1187425fe9b95c57acac24af7d1979d202b4d2f1
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] mediawiki/core[master]: FSLockManager should throw an exception if the lock dir isn'...

2016-08-31 Thread MarkAHershberger (Code Review)
MarkAHershberger has uploaded a new change for review.

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

Change subject: FSLockManager should throw an exception if the lock dir isn't 
writable
..

FSLockManager should throw an exception if the lock dir isn't writable

This will help people who are setting up the wiki for the first time
as well as idiots (like me) who forget to run maintenance scripts
under the apache user.

Bug: T16
Change-Id: I80f3d6c5327857c2700e7f45f4e32c0a74892f63
---
M includes/filebackend/lockmanager/FSLockManager.php
1 file changed, 9 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/75/307875/1

diff --git a/includes/filebackend/lockmanager/FSLockManager.php 
b/includes/filebackend/lockmanager/FSLockManager.php
index 2b660ec..89f96da 100644
--- a/includes/filebackend/lockmanager/FSLockManager.php
+++ b/includes/filebackend/lockmanager/FSLockManager.php
@@ -228,13 +228,15 @@
/**
 * Get the path to the lock file for a key
 * @param string $path
-* @return string
-*/
-   protected function getLockPath( $path ) {
-   return "{$this->lockDir}/{$this->sha1Base36Absolute( $path 
)}.lock";
-   }
-
-   /**
+* @return string
+*/
+   protected function getLockPath( $path ) {
+   if ( is_writable( $this->lockDir ) ) {
+   return "{$this->lockDir}/{$this->sha1Base36Absolute( 
$path )}.lock";
+   }
+   throw new MWException( "Lockdir isn't writable: 
$this->lockDir\n" );
+   }
+/**
 * Make sure remaining locks get cleared for sanity
 */
function __destruct() {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_26]: FSLockManager should throw an exception if the lock dir isn'...

2016-08-31 Thread MarkAHershberger (Code Review)
MarkAHershberger has uploaded a new change for review.

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

Change subject: FSLockManager should throw an exception if the lock dir isn't 
writable
..

FSLockManager should throw an exception if the lock dir isn't writable

This will help people who are setting up the wiki for the first time
as well as idiots (like me) who forget to run maintenance scripts
under the apache user.

Bug: T16
Change-Id: I80f3d6c5327857c2700e7f45f4e32c0a74892f63
---
M includes/filebackend/lockmanager/FSLockManager.php
1 file changed, 9 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/74/307874/1

diff --git a/includes/filebackend/lockmanager/FSLockManager.php 
b/includes/filebackend/lockmanager/FSLockManager.php
index 6f46f0e..3284f50 100644
--- a/includes/filebackend/lockmanager/FSLockManager.php
+++ b/includes/filebackend/lockmanager/FSLockManager.php
@@ -228,13 +228,15 @@
/**
 * Get the path to the lock file for a key
 * @param string $path
-* @return string
-*/
-   protected function getLockPath( $path ) {
-   return "{$this->lockDir}/{$this->sha1Base36Absolute( $path 
)}.lock";
-   }
-
-   /**
+* @return string
+*/
+   protected function getLockPath( $path ) {
+   if ( is_writable( $this->lockDir ) ) {
+   return "{$this->lockDir}/{$this->sha1Base36Absolute( 
$path )}.lock";
+   }
+   throw new MWException( "Lockdir isn't writable: 
$this->lockDir\n" );
+   }
+/**
 * Make sure remaining locks get cleared for sanity
 */
function __destruct() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80f3d6c5327857c2700e7f45f4e32c0a74892f63
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_26
Gerrit-Owner: MarkAHershberger 

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


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Add Ascii-Folding for French Language Analysis

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

Change subject: Add Ascii-Folding for French Language Analysis
..


Add Ascii-Folding for French Language Analysis

- Unpack the French analysis chain
- add asciifolding_preserve
- undo regression for dotted I (\u0130)

Bug: T144429
Change-Id: Ia265153e50732af7f169294aeb5ca47941516eca
---
M includes/Maintenance/AnalysisConfigBuilder.php
1 file changed, 50 insertions(+), 2 deletions(-)

Approvals:
  Smalyshev: Looks good to me, approved
  Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/Maintenance/AnalysisConfigBuilder.php 
b/includes/Maintenance/AnalysisConfigBuilder.php
index 463f0c6..6852942 100644
--- a/includes/Maintenance/AnalysisConfigBuilder.php
+++ b/includes/Maintenance/AnalysisConfigBuilder.php
@@ -109,10 +109,16 @@
$defaults = [
'analyzer' => [
'text' => [
+   // These defaults are not applied to 
non-custom
+   // analysis chains, i.e., those that 
use the
+   // default language analyzers on 'text'
'type' => 
$this->getDefaultTextAnalyzerType(),
'char_filter' => [ 'word_break_helper' 
],
],
'text_search' => [
+   // These defaults are not applied to 
non-custom
+   // analysis chains, i.e., those that 
use the
+   // default language analyzers on 
'text_search'
'type' => 
$this->getDefaultTextAnalyzerType(),
'char_filter' => [ 'word_break_helper' 
],
],
@@ -297,7 +303,7 @@
'type' => 'stemmer',
'language' => 'possessive_english',
];
-   // Replace the default english analyzer with a rebuilt 
copy with asciifolding tacked on the end
+   // Replace the default English analyzer with a rebuilt 
copy with asciifolding inserted before stemming
$config[ 'analyzer' ][ 'text' ] = [
'type' => 'custom',
'tokenizer' => 'standard',
@@ -334,6 +340,48 @@
case 'french':
// Add asciifolding_preserve to filters
$config[ 'analyzer' ][ 'lowercase_keyword' ][ 'filter' 
][] = 'asciifolding_preserve';
+
+   $config[ 'char_filter' ][ 'french_charfilter' ] = [
+   'type' => 'mapping',
+   'mappings' => [
+   '\u0130=>I',// dotted I
+   ],
+   ];
+   $config[ 'filter' ][ 'french_elision' ] = [
+   'type' => 'elision',
+   'articles_case' => true,
+   'articles' => [
+   'l', 'm', 't', 'qu', 'n', 's',
+   'j', 'd', 'c', 'jusqu', 'quoiqu',
+   'lorsqu', 'puisqu',
+   ],
+   ];
+   $config[ 'filter' ][ 'french_stop' ] = [
+   'type' => 'stop',
+   'stopwords' => '_french_',
+   ];
+   $config[ 'filter' ][ 'french_stemmer' ] = [
+   'type' => 'stemmer',
+   'language' => 'light_french',
+   ];
+
+   // Replace the default French analyzer with a rebuilt 
copy with asciifolding_preserve tacked on the end
+   $config[ 'analyzer' ][ 'text' ] = [
+   'type' => 'custom',
+   'tokenizer' => 'standard',
+   'char_filter' => [ 'french_charfilter' ],
+   ];
+
+   $filters = [];
+   $filters[] = 'french_elision';
+   $filters[] = 'lowercase';
+   $filters[] = 'french_stop';
+   $filters[] = 'french_stemmer';
+   $filters[] = 'asciifolding_preserve';
+   $config[ 'analyzer' ][ 'text' ][ 'filter' ] = $filters;
+
+   // In French text_search is just a copy of text
+   $config[ 'analyzer' ][ 'text_search' ] = 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: bidi-isolate usernames in diff pages

2016-08-31 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review.

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

Change subject: bidi-isolate usernames in diff pages
..

bidi-isolate usernames in diff pages

In diff view, add bdi isolation around usernames, since usernames
can be any directionality regardless of the interface language.

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/73/307873/1

diff --git a/includes/diff/DifferenceEngine.php 
b/includes/diff/DifferenceEngine.php
index baec396..c4c0480 100644
--- a/includes/diff/DifferenceEngine.php
+++ b/includes/diff/DifferenceEngine.php
@@ -416,8 +416,8 @@
$newChangeTags = ChangeTags::formatSummaryRow( $this->mNewTags, 
'diff', $this->getContext() );
 
$newHeader = '' . 
$newRevisionHeader . '' .
-   '' . Linker::revUserTools( 
$this->mNewRev, !$this->unhide ) .
-   " $rollback" .
+   '' . 
Linker::revUserTools( $this->mNewRev, !$this->unhide ) .
+   " $rollback" .
'' . $newminor .
Linker::revComment( $this->mNewRev, !$diffOnly, 
!$this->unhide ) . $rdel . '' .
'' . $newChangeTags[0] . 
'' .

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

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

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Make config file path configurable

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

Change subject: Make config file path configurable
..


Make config file path configurable

Bug: T144380
Change-Id: I9809443921a1b1717be47e3c0c8fb1628ce238a7
---
M dist/src/script/runBlazegraph.sh
1 file changed, 5 insertions(+), 3 deletions(-)

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



diff --git a/dist/src/script/runBlazegraph.sh b/dist/src/script/runBlazegraph.sh
index c383997..a6b8ce4 100755
--- a/dist/src/script/runBlazegraph.sh
+++ b/dist/src/script/runBlazegraph.sh
@@ -6,13 +6,14 @@
 DIR=`dirname $0`
 MEMORY=-Xmx8g
 BLAZEGRAPH_OPTS=""
+CONFIG_FILE=RWStore.properties
 
 function usage() {
-  echo "Usage: $0 [-h ] [-d ] [-c ] [-p ] [-o 
] "
+  echo "Usage: $0 [-h ] [-d ] [-c ] [-p ] [-o 
] [-f config.properties]"
   exit 1
 }
 
-while getopts h:c:p:d:o:? option
+while getopts h:c:p:d:o:f:? option
 do
   case "${option}"
   in
@@ -21,6 +22,7 @@
 p) PORT=${OPTARG};;
 d) DIR=${OPTARG};;
 o) BLAZEGRAPH_OPTS="${OPTARG}";;
+   f) CONFIG_FILE=${OPTARG};;
 ?) usage;;
   esac
 done
@@ -31,7 +33,7 @@
 DEFAULT_GLOBE=2
 
 echo "Running Blazegraph from `pwd` on :$PORT/$CONTEXT"
-java -server -XX:+UseG1GC ${MEMORY} 
-Dcom.bigdata.rdf.sail.webapp.ConfigParams.propertyFile=RWStore.properties \
+java -server -XX:+UseG1GC ${MEMORY} 
-Dcom.bigdata.rdf.sail.webapp.ConfigParams.propertyFile=${CONFIG_FILE} \
  -Dorg.eclipse.jetty.server.Request.maxFormContentSize=2 \
  -Dcom.bigdata.rdf.sparql.ast.QueryHints.analytic=true \
  
-Dcom.bigdata.rdf.sparql.ast.QueryHints.analyticMaxMemoryPerQuery=1073741824 \

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9809443921a1b1717be47e3c0c8fb1628ce238a7
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Update GUI

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

Change subject: Update GUI
..


Update GUI

Change-Id: I9cfcba0c7f56b3c25b427792d31e69217fca6534
---
M gui
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/gui b/gui
index f46f560..98cec07 16
--- a/gui
+++ b/gui
@@ -1 +1 @@
-Subproject commit f46f5600f0d2a1b5274957225839bf026429628e
+Subproject commit 98cec07b87e7699dd33cbfd43b3f0416a5ab954a

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9cfcba0c7f56b3c25b427792d31e69217fca6534
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Use tagWidths for content in Util.getArgInfo

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

Change subject: Use tagWidths for content in Util.getArgInfo
..


Use tagWidths for content in Util.getArgInfo

 * Use nestedRefsHTML.length to determine when we need a dataMw.body,
   the regexps there were unnecessary.

 * Pulled out of https://gerrit.wikimedia.org/r/#/c/264026/

Change-Id: I4602594e468322c8b6b8653eee33047ef9af9ebc
---
M lib/ext/Cite/index.js
M lib/utils/Util.js
2 files changed, 14 insertions(+), 22 deletions(-)

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



diff --git a/lib/ext/Cite/index.js b/lib/ext/Cite/index.js
index 6df728d..e6804c8 100644
--- a/lib/ext/Cite/index.js
+++ b/lib/ext/Cite/index.js
@@ -378,7 +378,7 @@
 };
 
 References.prototype.extractRefFromNode = function(node, refsData,
-   refInRefProcessor, referencesAboutId, referencesGroup, 
refsInReferencesHTML) {
+   refInRefProcessor, referencesAboutId, referencesGroup, 
nestedRefsHTML) {
var nestedInReferences = referencesAboutId !== undefined;
var dp = DU.getDataParsoid(node);
// SSS FIXME: Need to clarify semantics here.
@@ -474,7 +474,7 @@
if (!nestedInReferences) {
node.parentNode.insertBefore(span, node);
} else {
-   refsInReferencesHTML.push(DU.ppToXML(span), '\n');
+   nestedRefsHTML.push(DU.ppToXML(span), '\n');
}
 
// Keep the first content to compare multiple s with the same name.
@@ -483,7 +483,7 @@
}
 };
 
-References.prototype.insertReferencesIntoDOM = function(refsNode, refsData, 
refsInReferencesHTML, autoGenerated) {
+References.prototype.insertReferencesIntoDOM = function(refsNode, refsData, 
nestedRefsHTML, autoGenerated) {
var dp = DU.getDataParsoid(refsNode);
var group = dp.group || '';
 
@@ -501,13 +501,8 @@
// html -> wt and so that clients can strip it if necessary.
if (autoGenerated) {
dataMw.autoGenerated = true;
-   }
-
-   var src = dp.src || '';  // fall back so we don't 
crash
-   // Extract ext-source for .. usage
-   var body = Util.extractExtBody('references', src).trim();
-   if (body.length > 0) {
-   dataMw.body = { 'html': refsInReferencesHTML.join('') };
+   } else if (nestedRefsHTML.length > 0) {
+   dataMw.body = { 'html': '\n' + nestedRefsHTML.join('') 
};
}
 
DU.setDataMw(refsNode, dataMw);
@@ -639,7 +634,7 @@
} else if 
((/(?:^|\s)mw:Extension\/references(?=$|\s)/).test(typeOf)) {
var referencesId = child.getAttribute("about");
var referencesGroup = 
DU.getDataParsoid(child).group;
-   var nestedRefsHTML = ["\n"];
+   var nestedRefsHTML = [];
_processRefsInReferences(cite, refsData,
child, referencesId, referencesGroup, 
nestedRefsHTML);
cite.references.insertReferencesIntoDOM(child, 
refsData, nestedRefsHTML);
diff --git a/lib/utils/Util.js b/lib/utils/Util.js
index eb355d3..bcdfb93 100644
--- a/lib/utils/Util.js
+++ b/lib/utils/Util.js
@@ -1175,11 +1175,10 @@
}, finalCB);
},
 
-   extractExtBody: function(extName, extTagSrc) {
-   var re = "<" + extName + "[^>]*/?>([\\s\\S]*)";
-   return extTagSrc.replace(new RegExp(re, "mi"), function() {
-   return arguments[1].replace(new RegExp("", "mi"), "");
-   });
+   extractExtBody: function(token) {
+   var src = token.getAttribute('source');
+   var tagWidths = token.dataAttribs.tagWidths;
+   return src.substring(tagWidths[0], src.length - tagWidths[1]);
},
 
// Returns the utf8 encoding of the code point
@@ -1415,9 +1414,8 @@
 
 // Helper function to process extension source
 Util.processExtSource = function(manager, extToken, opts) {
-   var extSrc = extToken.getAttribute('source');
+   var extBody = Util.extractExtBody(extToken);
var tagWidths = extToken.dataAttribs.tagWidths;
-   var content = extSrc.substring(tagWidths[0], extSrc.length - 
tagWidths[1]);
 
// FIXME: Should this be specific to the extension
// Or is it okay to do this unconditionally for all?
@@ -1428,11 +1426,11 @@
// FIXME: SSS: This stripping maybe be unnecessary after all.
//
// Strip all leading white-space
-   var wsMatch = content.match(/^(\s*)([^]*)$/);
+   var wsMatch = extBody.match(/^(\s*)([^]*)$/);
var leadingWS = wsMatch[1];
 
// Update content to normalized form
-   content = 

[MediaWiki-commits] [Gerrit] mediawiki...MediaWikiFarm[master]: Added code coverage ignore, typo

2016-08-31 Thread Seb35 (Code Review)
Seb35 has submitted this change and it was merged.

Change subject: Added code coverage ignore, typo
..


Added code coverage ignore, typo

Raw scripts (mainly entry points) cannot be tested, so mark
them as ignored to get more accurate code coverage statistics.

Removed some trailing whitespaces.

Change-Id: Ic976697f38b287b540e2280841c58efa384e9ed0
---
M MediaWikiFarm.php
M bin/mwscript.php
M bin/validate-schema.php
M src/MediaWikiFarm.php
M src/main.php
M www/api.php
M www/img_auth.php
M www/index.php
M www/load.php
M www/opensearch_desc.php
10 files changed, 49 insertions(+), 25 deletions(-)

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



diff --git a/MediaWikiFarm.php b/MediaWikiFarm.php
index 55f8056..ad56ced 100644
--- a/MediaWikiFarm.php
+++ b/MediaWikiFarm.php
@@ -1,27 +1,30 @@
 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
  */
+// @codeCoverageIgnoreStart
 
 # Protect against web entry
 if( !defined( 'MEDIAWIKI' ) && PHP_SAPI != 'cli' && PHP_SAPI != 'phpdbg' ) 
exit;
 
 # Load MediaWiki configuration
 if( defined( 'MEDIAWIKI' ) ) {
-   
+
# Load class definition
-   if( !class_exists( 'MediaWikiFarm' ) )
+   if( !class_exists( 'MediaWikiFarm' ) ) {
require_once dirname( __FILE__ ) . '/src/MediaWikiFarm.php';
-   
+   }
+
# Load MediaWikiFarm
MediaWikiFarm::load();
-   
+
# Load MediaWiki configuration
require_once MediaWikiFarm::getInstance()->getConfigFile();
 }
+// @codeCoverageIgnoreEnd
diff --git a/bin/mwscript.php b/bin/mwscript.php
index cab93e4..6f38f69 100644
--- a/bin/mwscript.php
+++ b/bin/mwscript.php
@@ -1,11 +1,12 @@
 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
  */
+// @codeCoverageIgnoreStart
 
 # Protect against web entry
 if( PHP_SAPI != 'cli' && PHP_SAPI != 'phpdbg' ) exit;
@@ -182,3 +183,4 @@
 
 # Update version after maintenance/update.php (the only case where another 
version is given before execution)
 $wgMediaWikiFarm->updateVersionAfterMaintenance();
+// @codeCoverageIgnoreEnd
diff --git a/bin/validate-schema.php b/bin/validate-schema.php
index 8832e14..6918204 100644
--- a/bin/validate-schema.php
+++ b/bin/validate-schema.php
@@ -1,9 +1,10 @@
 https://github.com/justinrainbow/json-schema
  */
+// @codeCoverageIgnoreStart
 
 
 # Protect against web entry
@@ -12,35 +13,35 @@
 require_once "vendor/autoload.php";
 
 foreach( array( 'config/farms.yml', 'config/farms.json', 'config/farms.php' ) 
as $filename ) {
-   
+
if( !is_file( $filename ) )
continue;
-   
+
echo "\n$filename:\n";
if( preg_match( '/\.yml$/', $filename ) ) {
-   
+
$dataArray = Symfony\Component\Yaml\Yaml::parse( 
file_get_contents( $filename ) );
$dataJSON = preg_replace( '//', "\t", json_encode( 
$dataArray, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES 
) ) . "\n";
file_put_contents( 'config/farms.yml.json', $dataJSON );
$data = json_decode( $dataJSON );
}
else if( preg_match( '/\.json$/', $filename ) ) {
-   
+
$data = json_decode( file_get_contents( $filename ) );
}
else if( preg_match( '/\.php$/', $filename ) ) {
-   
+
$dataArray = include $filename;
$dataJSON = preg_replace( '//', "\t", json_encode( 
$dataArray, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES 
) ) . "\n";
file_put_contents( 'config/farms.php.json', $dataJSON );
$data = json_decode( $dataJSON );
}
-   
+
// Validate
$validator = new JsonSchema\Validator();
$validator->check( $data, (object) array( '$ref' =>
'file://' . realpath( 'docs/farms-schema.json' ) ) );
-   
+
if( $validator->isValid() ) {
echo "The supplied JSON validates against the schema.\n";
@unlink( $filename.'.json' );
@@ -51,3 +52,4 @@
}
}
 }
+// @codeCoverageIgnoreEnd
diff --git a/src/MediaWikiFarm.php b/src/MediaWikiFarm.php
index f28e11d..fc00338 100644
--- a/src/MediaWikiFarm.php
+++ b/src/MediaWikiFarm.php
@@ -375,6 +375,8 @@
wfLoadExtension( 'MediaWikiFarm', $this->codeDir ? 
$this->farmDir . '/extension.json' : null );
}
else {
+   // Ignore this code coverage because tests are probably 
run on MediaWiki 1.25+
+   // @codeCoverageIgnoreStart
$GLOBALS['wgExtensionCredits']['other'][] = array(
'path' => 

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [bugfix] Ignore InvalidTitle error in Site.preloadpages

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

Change subject: [bugfix] Ignore InvalidTitle error in Site.preloadpages
..


[bugfix] Ignore InvalidTitle error in Site.preloadpages

preloadpages should not break a script for an InvalidTitleError.
Print an error message and skip that page.

Bug: T126930
Change-Id: Ie61e10719aa7c32d84fb6c252dd9c34f35c088cf
---
M pywikibot/site.py
1 file changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/pywikibot/site.py b/pywikibot/site.py
index b04cfc2..27f45fc 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -3209,8 +3209,11 @@
 cache = {}
 # In case of duplicates, return the first entry.
 for priority, page in enumerate(sublist):
-cache.setdefault(page.title(withSection=False),
- (priority, page))
+try:
+cache.setdefault(page.title(withSection=False),
+ (priority, page))
+except pywikibot.InvalidTitle:
+pywikibot.exception()
 
 prio_queue = []
 next_prio = 0

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie61e10719aa7c32d84fb6c252dd9c34f35c088cf
Gerrit-PatchSet: 5
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Mpaa 
Gerrit-Reviewer: Russell Blau 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: T142617: Decode entities in transclusion targets before proc...

2016-08-31 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has uploaded a new change for review.

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

Change subject: T142617: Decode entities in transclusion targets before 
processing them
..

T142617: Decode entities in transclusion targets before processing them

Change-Id: Iada3cb2d4d50d0e8b4fd739a07cac6d23a72fabc
---
M lib/wt2html/tt/TemplateHandler.js
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/71/307871/1

diff --git a/lib/wt2html/tt/TemplateHandler.js 
b/lib/wt2html/tt/TemplateHandler.js
index 7fe513e..5da5c99 100644
--- a/lib/wt2html/tt/TemplateHandler.js
+++ b/lib/wt2html/tt/TemplateHandler.js
@@ -437,6 +437,10 @@
target = env.conf.wiki.namespaceNames[namespaceId] + 
':' + target;
}
 
+   // Decode entities since resolveTitle expects
+   // a url decoded string.
+   target = Util.decodeURI(target);
+
// Resolve a possibly relative link and
// normalize the target before template processing.
var title = env.makeTitleFromText(env.resolveTitle(target), 
undefined, true);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iada3cb2d4d50d0e8b4fd739a07cac6d23a72fabc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry 

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


[MediaWiki-commits] [Gerrit] mediawiki...MediaWikiFarm[master]: Added code coverage ignore

2016-08-31 Thread Seb35 (Code Review)
Seb35 has uploaded a new change for review.

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

Change subject: Added code coverage ignore
..

Added code coverage ignore

Raw scripts (entry points) cannot be tested, so mark
them as ignored to get more accurate code coverage
statistics.

Change-Id: Ic976697f38b287b540e2280841c58efa384e9ed0
---
M MediaWikiFarm.php
M bin/mwscript.php
M bin/validate-schema.php
M src/MediaWikiFarm.php
M src/main.php
M www/api.php
M www/img_auth.php
M www/index.php
M www/load.php
M www/opensearch_desc.php
10 files changed, 24 insertions(+), 1 deletion(-)


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

diff --git a/MediaWikiFarm.php b/MediaWikiFarm.php
index 55f8056..a402118 100644
--- a/MediaWikiFarm.php
+++ b/MediaWikiFarm.php
@@ -8,6 +8,7 @@
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
  */
+// @codeCoverageIgnoreStart
 
 # Protect against web entry
 if( !defined( 'MEDIAWIKI' ) && PHP_SAPI != 'cli' && PHP_SAPI != 'phpdbg' ) 
exit;
@@ -25,3 +26,4 @@
# Load MediaWiki configuration
require_once MediaWikiFarm::getInstance()->getConfigFile();
 }
+// @codeCoverageIgnoreEnd
diff --git a/bin/mwscript.php b/bin/mwscript.php
index cab93e4..d23de2f 100644
--- a/bin/mwscript.php
+++ b/bin/mwscript.php
@@ -6,6 +6,7 @@
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
  */
+// @codeCoverageIgnoreStart
 
 # Protect against web entry
 if( PHP_SAPI != 'cli' && PHP_SAPI != 'phpdbg' ) exit;
@@ -182,3 +183,4 @@
 
 # Update version after maintenance/update.php (the only case where another 
version is given before execution)
 $wgMediaWikiFarm->updateVersionAfterMaintenance();
+// @codeCoverageIgnoreEnd
diff --git a/bin/validate-schema.php b/bin/validate-schema.php
index 8832e14..d6fc99b 100644
--- a/bin/validate-schema.php
+++ b/bin/validate-schema.php
@@ -4,6 +4,7 @@
  * 
  * This files is mostly inspired from the README 
https://github.com/justinrainbow/json-schema
  */
+// @codeCoverageIgnoreStart
 
 
 # Protect against web entry
@@ -51,3 +52,4 @@
}
}
 }
+// @codeCoverageIgnoreEnd
diff --git a/src/MediaWikiFarm.php b/src/MediaWikiFarm.php
index f28e11d..fc00338 100644
--- a/src/MediaWikiFarm.php
+++ b/src/MediaWikiFarm.php
@@ -375,6 +375,8 @@
wfLoadExtension( 'MediaWikiFarm', $this->codeDir ? 
$this->farmDir . '/extension.json' : null );
}
else {
+   // Ignore this code coverage because tests are probably 
run on MediaWiki 1.25+
+   // @codeCoverageIgnoreStart
$GLOBALS['wgExtensionCredits']['other'][] = array(
'path' => $this->farmDir . '/MediaWikiFarm.php',
'name' => 'MediaWikiFarm',
@@ -382,13 +384,14 @@
'author' => 'Seb35',
'url' => 
'https://www.mediawiki.org/wiki/Extension:MediaWikiFarm',
'descriptionmsg' => 'mediawikifarm-desc',
-   'license-name' => 'GPL-3.0+'
+   'license-name' => 'GPL-3.0+',
);
 
$GLOBALS['wgAutoloadClasses']['MediaWikiFarm'] = 
'src/MediaWikiFarm.php';

$GLOBALS['wgAutoloadClasses']['MWFConfigurationException'] = 
'src/MediaWikiFarm.php';
$GLOBALS['wgMessagesDirs']['MediaWikiFarm'] = array( 
'i18n' );
$GLOBALS['wgHooks']['UnitTestsList'] = array( 
'MediaWikiFarm::onUnitTestsList' );
+   // @codeCoverageIgnoreEnd
}
 
# Load extensions with the wfLoadExtension mechanism
@@ -443,6 +446,8 @@
 *
 * NB: this loading mechanism (constant MW_CONFIG_CALLBACK) exists 
since MediaWiki 1.15.
 *
+* @codeCoverageIgnore
+*
 * @return void
 */
static function loadConfig() {
diff --git a/src/main.php b/src/main.php
index 1fa7699..4ec5035 100644
--- a/src/main.php
+++ b/src/main.php
@@ -6,6 +6,7 @@
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
  */
+// @codeCoverageIgnoreStart
 
 # Protect against web entry
 if( !defined( 'MEDIAWIKI' ) ) exit;
@@ -67,3 +68,4 @@

@include $execFile;
 }
+// @codeCoverageIgnoreEnd
diff --git a/www/api.php b/www/api.php
index 4bb4979..acfa804 100644
--- a/www/api.php
+++ b/www/api.php
@@ -6,6 +6,7 @@
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license 

[MediaWiki-commits] [Gerrit] mediawiki...ZeroBanner[master]: Move qunit tests to tests/qunit

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

Change subject: Move qunit tests to tests/qunit
..


Move qunit tests to tests/qunit

Follow up in anticipation of phpunit tests being in this repo.

Bug: T143425
Change-Id: I010eed6704df40d671293eb45c51b630b9fc37b6
---
M includes/TestHooks.php
R tests/qunit/test_zerobanner.js
2 files changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/TestHooks.php b/includes/TestHooks.php
index 79e7bdb..45f149a 100644
--- a/includes/TestHooks.php
+++ b/includes/TestHooks.php
@@ -28,7 +28,7 @@
) {
$testModule = [
'dependencies' => [ 'zerobanner' ],
-   'localBasePath' => __DIR__ . '/../tests/',
+   'localBasePath' => __DIR__ . '/../tests/qunit/',
'remoteExtPath' => 'ZeroBanner',
'targets' => [ 'mobile' ],
'scripts' => [
diff --git a/tests/test_zerobanner.js b/tests/qunit/test_zerobanner.js
similarity index 100%
rename from tests/test_zerobanner.js
rename to tests/qunit/test_zerobanner.js

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I010eed6704df40d671293eb45c51b630b9fc37b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ZeroBanner
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 
Gerrit-Reviewer: Bmansurov 
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...ORES[master]: Not including results when oresm_is_current = 0

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

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

Change subject: Not including results when oresm_is_current = 0
..

Not including results when oresm_is_current = 0

It fixes almost all cases of redundant results

Bug: T144233
Change-Id: I36d67d9461270c621308575b8c1860b5f85ccadd
---
M includes/Hooks.php
1 file changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/includes/Hooks.php b/includes/Hooks.php
index b900417..e1624e7 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -137,6 +137,8 @@
$conds[] = '(oresm_name = ' . $dbr->addQuotes( 'damaging' ) .
' OR oresm_name IS NULL)';
 
+   $conds[] = 'oresm_is_current != 0';
+
$join_conds['ores_classification'] = [ 'LEFT JOIN',
'rc_this_oldid = oresc_rev ' .
'AND oresc_class = 1' ];
@@ -259,6 +261,8 @@
$query['conds'][] = '(oresm_name = ' . $dbr->addQuotes( 
'damaging' ) .
' OR oresm_name IS NULL)';
 
+   $query['conds'][] = 'oresm_is_current != 0';
+
$query['join_conds']['ores_classification'] = [ 'LEFT JOIN',
'rev_id = oresc_rev ' .
'AND oresc_class = 1' ];

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Protect against target.getSurface() returning null

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

Change subject: Protect against target.getSurface() returning null
..


Protect against target.getSurface() returning null

This can now happen due to I5510bbe3.

Bug: T139972
Change-Id: Ia9a171fd8f4800c50f116b13dbd00d8e098b47a9
---
M modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js
1 file changed, 7 insertions(+), 4 deletions(-)

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



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 2cc0eca..f7183ed 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
@@ -118,7 +118,7 @@
 * @inheritdoc
 */
mw.flow.ui.VisualEditorWidget.prototype.focus = function () {
-   if ( this.target ) {
+   if ( this.target && this.target.getSurface() ) {
this.target.getSurface().getView().focus();
}
};
@@ -127,7 +127,7 @@
 * @inheritdoc
 */
mw.flow.ui.VisualEditorWidget.prototype.moveCursorToEnd = function () {
-   if ( this.target ) {
+   if ( this.target && this.target.getSurface() ) {

this.target.getSurface().getModel().selectLastContentOffset();
}
};
@@ -139,7 +139,7 @@
var doc, html;
 
// If we haven't fully loaded yet, just return nothing.
-   if ( !this.target ) {
+   if ( !this.target || !this.target.getSurface() ) {
return '';
}
 
@@ -163,6 +163,9 @@
 * @inheritdoc
 */
mw.flow.ui.VisualEditorWidget.prototype.isEmpty = function () {
+   if ( !this.target || !this.target.getSurface() ) {
+   return true;
+   }
return 
!this.target.getSurface().getModel().getDocument().data.hasContent();
};
 
@@ -173,7 +176,7 @@
 */
mw.flow.ui.VisualEditorWidget.prototype.hasBeenChanged = function () {
// If we haven't fully loaded yet, just return false
-   if ( !this.target ) {
+   if ( !this.target || !this.target.getSurface() ) {
return false;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia9a171fd8f4800c50f116b13dbd00d8e098b47a9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Mattflaschen 
Gerrit-Reviewer: Mooeypoo 
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] mediawiki...Flow[wmf/1.28.0-wmf.17]: Protect against target.getSurface() returning null

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

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

Change subject: Protect against target.getSurface() returning null
..

Protect against target.getSurface() returning null

This can now happen due to I5510bbe3.

Bug: T139972
Change-Id: Ia9a171fd8f4800c50f116b13dbd00d8e098b47a9
---
M modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js
1 file changed, 7 insertions(+), 4 deletions(-)


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

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 2cc0eca..f7183ed 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
@@ -118,7 +118,7 @@
 * @inheritdoc
 */
mw.flow.ui.VisualEditorWidget.prototype.focus = function () {
-   if ( this.target ) {
+   if ( this.target && this.target.getSurface() ) {
this.target.getSurface().getView().focus();
}
};
@@ -127,7 +127,7 @@
 * @inheritdoc
 */
mw.flow.ui.VisualEditorWidget.prototype.moveCursorToEnd = function () {
-   if ( this.target ) {
+   if ( this.target && this.target.getSurface() ) {

this.target.getSurface().getModel().selectLastContentOffset();
}
};
@@ -139,7 +139,7 @@
var doc, html;
 
// If we haven't fully loaded yet, just return nothing.
-   if ( !this.target ) {
+   if ( !this.target || !this.target.getSurface() ) {
return '';
}
 
@@ -163,6 +163,9 @@
 * @inheritdoc
 */
mw.flow.ui.VisualEditorWidget.prototype.isEmpty = function () {
+   if ( !this.target || !this.target.getSurface() ) {
+   return true;
+   }
return 
!this.target.getSurface().getModel().getDocument().data.hasContent();
};
 
@@ -173,7 +176,7 @@
 */
mw.flow.ui.VisualEditorWidget.prototype.hasBeenChanged = function () {
// If we haven't fully loaded yet, just return false
-   if ( !this.target ) {
+   if ( !this.target || !this.target.getSurface() ) {
return false;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9a171fd8f4800c50f116b13dbd00d8e098b47a9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: wmf/1.28.0-wmf.17
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Catrope 

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Make config file path configurable

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

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

Change subject: Make config file path configurable
..

Make config file path configurable

Bug: T144380
Change-Id: I9809443921a1b1717be47e3c0c8fb1628ce238a7
---
M dist/src/script/runBlazegraph.sh
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf 
refs/changes/68/307868/1

diff --git a/dist/src/script/runBlazegraph.sh b/dist/src/script/runBlazegraph.sh
index c383997..a6b8ce4 100755
--- a/dist/src/script/runBlazegraph.sh
+++ b/dist/src/script/runBlazegraph.sh
@@ -6,13 +6,14 @@
 DIR=`dirname $0`
 MEMORY=-Xmx8g
 BLAZEGRAPH_OPTS=""
+CONFIG_FILE=RWStore.properties
 
 function usage() {
-  echo "Usage: $0 [-h ] [-d ] [-c ] [-p ] [-o 
] "
+  echo "Usage: $0 [-h ] [-d ] [-c ] [-p ] [-o 
] [-f config.properties]"
   exit 1
 }
 
-while getopts h:c:p:d:o:? option
+while getopts h:c:p:d:o:f:? option
 do
   case "${option}"
   in
@@ -21,6 +22,7 @@
 p) PORT=${OPTARG};;
 d) DIR=${OPTARG};;
 o) BLAZEGRAPH_OPTS="${OPTARG}";;
+   f) CONFIG_FILE=${OPTARG};;
 ?) usage;;
   esac
 done
@@ -31,7 +33,7 @@
 DEFAULT_GLOBE=2
 
 echo "Running Blazegraph from `pwd` on :$PORT/$CONTEXT"
-java -server -XX:+UseG1GC ${MEMORY} 
-Dcom.bigdata.rdf.sail.webapp.ConfigParams.propertyFile=RWStore.properties \
+java -server -XX:+UseG1GC ${MEMORY} 
-Dcom.bigdata.rdf.sail.webapp.ConfigParams.propertyFile=${CONFIG_FILE} \
  -Dorg.eclipse.jetty.server.Request.maxFormContentSize=2 \
  -Dcom.bigdata.rdf.sparql.ast.QueryHints.analytic=true \
  
-Dcom.bigdata.rdf.sparql.ast.QueryHints.analyticMaxMemoryPerQuery=1073741824 \

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9809443921a1b1717be47e3c0c8fb1628ce238a7
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Update GUI

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

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

Change subject: Update GUI
..

Update GUI

Change-Id: I9cfcba0c7f56b3c25b427792d31e69217fca6534
---
M gui
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf 
refs/changes/67/307867/1

diff --git a/gui b/gui
index f46f560..98cec07 16
--- a/gui
+++ b/gui
@@ -1 +1 @@
-Subproject commit f46f5600f0d2a1b5274957225839bf026429628e
+Subproject commit 98cec07b87e7699dd33cbfd43b3f0416a5ab954a

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9cfcba0c7f56b3c25b427792d31e69217fca6534
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 

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


[MediaWiki-commits] [Gerrit] mediawiki...ZeroBanner[master]: Move qunit tests to tests/qunit

2016-08-31 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: Move qunit tests to tests/qunit
..

Move qunit tests to tests/qunit

Follow up in anticipation of phpunit tests being in this repo.

Bug: T143425
Change-Id: I010eed6704df40d671293eb45c51b630b9fc37b6
---
M includes/TestHooks.php
R tests/qunit/test_zerobanner.js
2 files changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/TestHooks.php b/includes/TestHooks.php
index 79e7bdb..45f149a 100644
--- a/includes/TestHooks.php
+++ b/includes/TestHooks.php
@@ -28,7 +28,7 @@
) {
$testModule = [
'dependencies' => [ 'zerobanner' ],
-   'localBasePath' => __DIR__ . '/../tests/',
+   'localBasePath' => __DIR__ . '/../tests/qunit/',
'remoteExtPath' => 'ZeroBanner',
'targets' => [ 'mobile' ],
'scripts' => [
diff --git a/tests/test_zerobanner.js b/tests/qunit/test_zerobanner.js
similarity index 100%
rename from tests/test_zerobanner.js
rename to tests/qunit/test_zerobanner.js

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I010eed6704df40d671293eb45c51b630b9fc37b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ZeroBanner
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use wiki email for From of CC messages when $wgUserEmailUseR...

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

Change subject: Use wiki email for From of CC messages when 
$wgUserEmailUseReplyTo is set
..


Use wiki email for From of CC messages when $wgUserEmailUseReplyTo is set

Avoid bounces caused by SPF protections when sending CC messages to
users. This mirrors the logic used when sending the original message.

Change-Id: I1c48892e9b5086fd564eedd65cca6a848a2b425c
---
M includes/specials/SpecialEmailuser.php
1 file changed, 20 insertions(+), 4 deletions(-)

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



diff --git a/includes/specials/SpecialEmailuser.php 
b/includes/specials/SpecialEmailuser.php
index fb1943f..06be7bc 100644
--- a/includes/specials/SpecialEmailuser.php
+++ b/includes/specials/SpecialEmailuser.php
@@ -388,13 +388,29 @@
// unless they are emailing themselves, in which case 
one
// copy of the message is sufficient.
if ( $data['CCMe'] && $to != $from ) {
-   $cc_subject = $context->msg( 'emailccsubject' 
)->rawParams(
+   $ccTo = $from;
+   $ccFrom = $from;
+   $ccSubject = $context->msg( 'emailccsubject' 
)->rawParams(
$target->getName(), $subject )->text();
+   $ccText = $text;
 
-   // target and sender are equal, because this is 
the CC for the sender
-   Hooks::run( 'EmailUserCC', [ &$from, &$from, 
&$cc_subject, &$text ] );
+   Hooks::run( 'EmailUserCC', [ &$ccTo, &$ccFrom, 
&$ccSubject, &$ccText ] );
 
-   $ccStatus = UserMailer::send( $from, $from, 
$cc_subject, $text );
+   if ( $config->get( 'UserEmailUseReplyTo' ) ) {
+   $mailFrom = new MailAddress(
+   $config->get( 'PasswordSender' 
),
+   wfMessage( 'emailsender' 
)->inContentLanguage()->text()
+   );
+   $replyTo = $ccFrom;
+   } else {
+   $mailFrom = $ccFrom;
+   $replyTo = null;
+   }
+
+   $ccStatus = UserMailer::send(
+   $ccTo, $mailFrom, $ccSubject, $ccText, [
+   'replyTo' => $replyTo,
+   ] );
$status->merge( $ccStatus );
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1c48892e9b5086fd564eedd65cca6a848a2b425c
Gerrit-PatchSet: 10
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: 01tonythomas <01tonytho...@gmail.com>
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Brian Wolff 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Greg Grossmeier 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Flow[wmf/1.28.0-wmf.17]: Pass full HTML documents into VE, not fragments

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

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

Change subject: Pass full HTML documents into VE, not fragments
..

Pass full HTML documents into VE, not fragments

This prevents XML parsing errors in IE.

Bug: T138356
Change-Id: Ib9bbaccfff9434452ac94bb66a7b076a734dde3d
(cherry picked from commit cb37d884ba131807d7ee934b763871d3e9c5feda)
---
M modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js
1 file changed, 2 insertions(+), 1 deletion(-)


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

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 2cc0eca..e3c6f7d 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
@@ -86,7 +86,8 @@
var widget = this,
deferred = $.Deferred();
 
-   this.target.loadHtml( content );
+   // loadHtml expects a full document, but we were only given the 
body content
+   this.target.loadHtml( '' + content + '' );
this.target.once( 'surfaceReady', function () {
var surface = widget.target.getSurface();
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9bbaccfff9434452ac94bb66a7b076a734dde3d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: wmf/1.28.0-wmf.17
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Catrope 

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Rip out MainActivity.

2016-08-31 Thread Dbrant (Code Review)
Dbrant has uploaded a new change for review.

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

Change subject: Rip out MainActivity.
..

Rip out MainActivity.

This removes the old MainActivity, and delegates any of its remaining
references to either PageActivity or OverhaulActivity.

In the next patch, we'll rename OverhaulActivity to MainActivity and
remove any other "overhaul" designations.

And in the patch after that, we'll start solidifying which types of
intents will be sent to which activity.

Bug: T143441
Change-Id: Ibb6003b6bcca2fe4298df3c8e2e7e578fa2de2d8
---
M app/src/androidTest/java/org/wikipedia/page/BasePageLoadTest.java
M app/src/androidTest/java/org/wikipedia/test/TranslationTests.java
M app/src/dev/AndroidManifest.xml
M app/src/main/AndroidManifest.xml
D app/src/main/java/org/wikipedia/MainActivity.java
D app/src/main/java/org/wikipedia/MainActivityToolbarCoordinator.java
D app/src/main/java/org/wikipedia/page/NavDrawerHelper.java
M app/src/main/java/org/wikipedia/page/PageActivity.java
M app/src/main/java/org/wikipedia/page/snippet/CompatActionMode.java
D app/src/main/java/org/wikipedia/random/RandomArticleIdTask.java
D app/src/main/java/org/wikipedia/random/RandomHandler.java
M app/src/main/java/org/wikipedia/util/FeedbackUtil.java
M app/src/main/java/org/wikipedia/widgets/WidgetProviderSearch.java
13 files changed, 21 insertions(+), 1,996 deletions(-)


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

diff --git a/app/src/androidTest/java/org/wikipedia/page/BasePageLoadTest.java 
b/app/src/androidTest/java/org/wikipedia/page/BasePageLoadTest.java
index b2eb659..9dfa851 100644
--- a/app/src/androidTest/java/org/wikipedia/page/BasePageLoadTest.java
+++ b/app/src/androidTest/java/org/wikipedia/page/BasePageLoadTest.java
@@ -15,7 +15,6 @@
 import org.junit.Rule;
 import org.junit.runner.RunWith;
 import org.wikipedia.Site;
-import org.wikipedia.MainActivity;
 import org.wikipedia.history.HistoryEntry;
 import org.wikipedia.page.tabs.TabsProvider;
 
@@ -27,7 +26,7 @@
 
 @Rule
 @NonNull
-public final ActivityTestRule activityRule = new 
ActivityTestRule<>(MainActivity.class);
+public final ActivityTestRule activityRule = new 
ActivityTestRule<>(PageActivity.class);
 
 protected void loadPageSync(String title) {
 loadPage(title);
@@ -89,7 +88,7 @@
 InstrumentationRegistry.getInstrumentation().runOnMainSync(runnable);
 }
 
-protected MainActivity getActivity() {
+protected PageActivity getActivity() {
 return activityRule.getActivity();
 }
 
diff --git a/app/src/androidTest/java/org/wikipedia/test/TranslationTests.java 
b/app/src/androidTest/java/org/wikipedia/test/TranslationTests.java
index 1f60266..436865f 100644
--- a/app/src/androidTest/java/org/wikipedia/test/TranslationTests.java
+++ b/app/src/androidTest/java/org/wikipedia/test/TranslationTests.java
@@ -8,8 +8,8 @@
 import android.util.Log;
 //import org.wikimedia.wikipedia.test.R;
 import org.wikipedia.R;
-import org.wikipedia.MainActivity;
 import org.wikipedia.model.BaseModel;
+import org.wikipedia.page.PageActivity;
 
 import java.lang.reflect.Field;
 import java.util.ArrayList;
@@ -25,17 +25,17 @@
  *
  * TODO: check content_license_html is valid HTML
  */
-public class TranslationTests extends 
ActivityInstrumentationTestCase2 {
+public class TranslationTests extends 
ActivityInstrumentationTestCase2 {
 private static final String TAG = "TrTest";
 
 /** Add more if needed, but then also add some tests. */
 private static final String[] POSSIBLE_PARAMS = new String[] {"%s", 
"%1$s", "%2$s", "%d", "%.2f"};
 
-private MainActivity activity;
+private PageActivity activity;
 private final StringBuilder mismatches = new StringBuilder();
 
 public TranslationTests() {
-super(MainActivity.class);
+super(PageActivity.class);
 }
 
 @Override
diff --git a/app/src/dev/AndroidManifest.xml b/app/src/dev/AndroidManifest.xml
index 9ec8b19..bfa4828 100644
--- a/app/src/dev/AndroidManifest.xml
+++ b/app/src/dev/AndroidManifest.xml
@@ -1,25 +1,7 @@
 http://schemas.android.com/apk/res/android;
-xmlns:tools="http://schemas.android.com/tools;>
+xmlns:android="http://schemas.android.com/apk/res/android;>
 
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 7865961..0092c03 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -54,7 +54,7 @@
 
 
-= Build.VERSION_CODES.KITKAT) {
-
getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, 
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
-

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Rotate chevron in opposite direction for RTL

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

Change subject: Rotate chevron in opposite direction for RTL
..


Rotate chevron in opposite direction for RTL

Bug: T144226
Change-Id: Ie4a194b3e859db5794c959630ed0531bf93453f1
---
M resources/skins.minerva.footerV2.styles/common.less
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/resources/skins.minerva.footerV2.styles/common.less 
b/resources/skins.minerva.footerV2.styles/common.less
index ea25732..1bb3c7a 100644
--- a/resources/skins.minerva.footerV2.styles/common.less
+++ b/resources/skins.minerva.footerV2.styles/common.less
@@ -96,6 +96,10 @@
}
 }
 
+.rtl.feature-footer-v2 footer .indicator:before {
+   .transform( rotate( 90deg ) );
+}
+
 @media ( min-width: @deviceWidthTablet ) {
.feature-footer-v2 footer {
.last-modified-bar {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie4a194b3e859db5794c959630ed0531bf93453f1
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 
Gerrit-Reviewer: Bmansurov 
Gerrit-Reviewer: Jdlrobson 
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...ZeroBanner[master]: Add basic test for Zero

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

Change subject: Add basic test for Zero
..


Add basic test for Zero

If the module loads with an error we should complain.
ZeroBanner tests are run in MobileFrontend so this will prevent
further breakages to this module.

Bug: T143425
Change-Id: I5921acd85ef16defb9df5fdabd7355e2842c8550
---
M ZeroBanner.php
A includes/TestHooks.php
A tests/test_zerobanner.js
3 files changed, 55 insertions(+), 0 deletions(-)

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



diff --git a/ZeroBanner.php b/ZeroBanner.php
index 441c115..ffdd7dc 100644
--- a/ZeroBanner.php
+++ b/ZeroBanner.php
@@ -45,6 +45,7 @@
'ApiRawJsonPrinter' => 'ApiZeroBanner',
'ApiZeroBanner',
'PageRendering',
+   'TestHooks',
'PageRenderingHooks',
'ZeroConfig',
'ZeroSpecialPage'
@@ -179,6 +180,8 @@
 $wgHooks['MakeGlobalVariablesScript'][] = $hook . 
'onMakeGlobalVariablesScript';
 $wgHooks['SpecialMobileEditWatchlist::images'][] = $hook . 
'onSpecialMobileEditWatchlist_images';
 
+$wgHooks['ResourceLoaderTestModules'][] = 
'ZeroBanner\\TestHooks::onResourceLoaderTestModules';
+
 $wgAPIModules['zeroconfig'] = 'ZeroBanner\ApiZeroBanner';
 
 // Define constants but don't add them to the namespace list - they will be 
used for external access only
diff --git a/includes/TestHooks.php b/includes/TestHooks.php
new file mode 100644
index 000..79e7bdb
--- /dev/null
+++ b/includes/TestHooks.php
@@ -0,0 +1,43 @@
+https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules
+*
+* @param array $testModules
+* @param ResourceLoader $resourceLoader
+* @return bool
+*/
+   public static function onResourceLoaderTestModules( array &$testModules,
+   ResourceLoader &$resourceLoader
+   ) {
+   $testModule = [
+   'dependencies' => [ 'zerobanner' ],
+   'localBasePath' => __DIR__ . '/../tests/',
+   'remoteExtPath' => 'ZeroBanner',
+   'targets' => [ 'mobile' ],
+   'scripts' => [
+   'test_zerobanner.js',
+   ]
+   ];
+
+   // Expose templates module
+   $testModules['qunit']["tests.zero"] = $testModule;
+   return true;
+   }
+}
diff --git a/tests/test_zerobanner.js b/tests/test_zerobanner.js
new file mode 100644
index 000..859fe7c
--- /dev/null
+++ b/tests/test_zerobanner.js
@@ -0,0 +1,9 @@
+( function ( M, $ ) {
+   QUnit.module( 'Zero' );
+
+   QUnit.test( '#init', 1, function ( assert ) {
+   assert.ok( mw.loader.getState( 'zerobanner' ) === 'ready',
+   'check Zero banner module installed without problems' );
+   } );
+
+}( mw.mobileFrontend, jQuery ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5921acd85ef16defb9df5fdabd7355e2842c8550
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/ZeroBanner
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 
Gerrit-Reviewer: Bmansurov 
Gerrit-Reviewer: Jdlrobson 
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...CirrusSearch[master]: Add Ascii-Folding for French Language Analysis

2016-08-31 Thread Tjones (Code Review)
Tjones has uploaded a new change for review.

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

Change subject: Add Ascii-Folding for French Language Analysis
..

Add Ascii-Folding for French Language Analysis

- Unpack the French analysis chain
- add asciifolding_preserve
- undo regression for dotted I (\u0130)

Bug: T144429
Change-Id: Ia265153e50732af7f169294aeb5ca47941516eca
---
M includes/Maintenance/AnalysisConfigBuilder.php
1 file changed, 50 insertions(+), 2 deletions(-)


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

diff --git a/includes/Maintenance/AnalysisConfigBuilder.php 
b/includes/Maintenance/AnalysisConfigBuilder.php
index 463f0c6..6852942 100644
--- a/includes/Maintenance/AnalysisConfigBuilder.php
+++ b/includes/Maintenance/AnalysisConfigBuilder.php
@@ -109,10 +109,16 @@
$defaults = [
'analyzer' => [
'text' => [
+   // These defaults are not applied to 
non-custom
+   // analysis chains, i.e., those that 
use the
+   // default language analyzers on 'text'
'type' => 
$this->getDefaultTextAnalyzerType(),
'char_filter' => [ 'word_break_helper' 
],
],
'text_search' => [
+   // These defaults are not applied to 
non-custom
+   // analysis chains, i.e., those that 
use the
+   // default language analyzers on 
'text_search'
'type' => 
$this->getDefaultTextAnalyzerType(),
'char_filter' => [ 'word_break_helper' 
],
],
@@ -297,7 +303,7 @@
'type' => 'stemmer',
'language' => 'possessive_english',
];
-   // Replace the default english analyzer with a rebuilt 
copy with asciifolding tacked on the end
+   // Replace the default English analyzer with a rebuilt 
copy with asciifolding inserted before stemming
$config[ 'analyzer' ][ 'text' ] = [
'type' => 'custom',
'tokenizer' => 'standard',
@@ -334,6 +340,48 @@
case 'french':
// Add asciifolding_preserve to filters
$config[ 'analyzer' ][ 'lowercase_keyword' ][ 'filter' 
][] = 'asciifolding_preserve';
+
+   $config[ 'char_filter' ][ 'french_charfilter' ] = [
+   'type' => 'mapping',
+   'mappings' => [
+   '\u0130=>I',// dotted I
+   ],
+   ];
+   $config[ 'filter' ][ 'french_elision' ] = [
+   'type' => 'elision',
+   'articles_case' => true,
+   'articles' => [
+   'l', 'm', 't', 'qu', 'n', 's',
+   'j', 'd', 'c', 'jusqu', 'quoiqu',
+   'lorsqu', 'puisqu',
+   ],
+   ];
+   $config[ 'filter' ][ 'french_stop' ] = [
+   'type' => 'stop',
+   'stopwords' => '_french_',
+   ];
+   $config[ 'filter' ][ 'french_stemmer' ] = [
+   'type' => 'stemmer',
+   'language' => 'light_french',
+   ];
+
+   // Replace the default French analyzer with a rebuilt 
copy with asciifolding_preserve tacked on the end
+   $config[ 'analyzer' ][ 'text' ] = [
+   'type' => 'custom',
+   'tokenizer' => 'standard',
+   'char_filter' => [ 'french_charfilter' ],
+   ];
+
+   $filters = [];
+   $filters[] = 'french_elision';
+   $filters[] = 'lowercase';
+   $filters[] = 'french_stop';
+   $filters[] = 'french_stemmer';
+   $filters[] = 'asciifolding_preserve';
+   $config[ 'analyzer' ][ 'text' ][ 'filter' ] = $filters;
+
+   // In French text_search is just a copy of text
+   $config[ 'analyzer' ][ 'text_search' ] = $config[ 
'analyzer' 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: contint: fix resource conflict with service::deploy::common

2016-08-31 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: contint: fix resource conflict with service::deploy::common
..


contint: fix resource conflict with service::deploy::common

Fix fighting over ownership of /srv/deployment between
contint::deployment_dir and service::deploy::common classes by having
the former include the latter. This doesn't fix another potential
conflict with role::deployment::server.

Bug: T143065
Change-Id: Ied664c1afbf9d559646c1817c796ecacf0a30c09
---
M modules/contint/manifests/deployment_dir.pp
1 file changed, 1 insertion(+), 9 deletions(-)

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



diff --git a/modules/contint/manifests/deployment_dir.pp 
b/modules/contint/manifests/deployment_dir.pp
index 87b115f..87495d7 100644
--- a/modules/contint/manifests/deployment_dir.pp
+++ b/modules/contint/manifests/deployment_dir.pp
@@ -4,15 +4,7 @@
 # for our git clones / puppet software installations.
 #
 class contint::deployment_dir {
-# Hack: faking directories that Trebuchet would normally manage.
-# The integration project in labs does not use Trebuchet to manage these
-# packages, but in production we do.
-if ! defined(File['/srv/deployment']) {
-file { '/srv/deployment':
-ensure => 'directory',
-mode   => '0755',
-}
-}
+include ::service::deploy::common
 if ! defined(File['/srv/deployment/integration']) {
 file { '/srv/deployment/integration':
 ensure => 'directory',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ied664c1afbf9d559646c1817c796ecacf0a30c09
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Mobrovac 
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] mediawiki/event-schemas[master]: Tests: check that all the schemas contain common properties

2016-08-31 Thread Ppchelko (Code Review)
Ppchelko has uploaded a new change for review.

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

Change subject: Tests: check that all the schemas contain common properties
..

Tests: check that all the schemas contain common properties

We've introduced a notion of page/revision/user common properties.
These set of tests check that all the common properties are present
in individual events, and that the same set of properties is required.

The duplocation of 'mediawiki_common_props' file will be removed
after we delete old schemas.

Change-Id: I2d889f835cbf002bfc7020e47475fd5eb81b8b93
---
M jsonschema/mediawiki/page/delete/1.yaml
M jsonschema/mediawiki/revision/visibility-change/1.yaml
M package.json
M test/jsonschema/index.js
A test/jsonschema/mediawiki/page/mediawiki_common_schema.yaml
A test/jsonschema/mediawiki/page/page_common_schema.yaml
A test/jsonschema/mediawiki/revision/mediawiki_common_schema.yaml
A test/jsonschema/mediawiki/revision/revision_common_schema.yaml
A test/jsonschema/mediawiki/user/mediawiki_common_schema.yaml
A test/jsonschema/mediawiki/user/user_common_schema.yaml
A test/jsonschema/meta_common_schema.yaml
11 files changed, 311 insertions(+), 71 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/event-schemas 
refs/changes/17/307817/1

diff --git a/jsonschema/mediawiki/page/delete/1.yaml 
b/jsonschema/mediawiki/page/delete/1.yaml
index fa47065..04cf8aa 100644
--- a/jsonschema/mediawiki/page/delete/1.yaml
+++ b/jsonschema/mediawiki/page/delete/1.yaml
@@ -66,7 +66,7 @@
 type: array
 items:
   type: string
-  is_bot:
+  user_is_bot:
 description: >
   True if this user is considered to be a bot.  This is checked
   via the $user->isBot() method, which considers both user_groups
@@ -125,3 +125,4 @@
   - page_id
   - page_title
   - page_namespace
+  - page_is_redirect
diff --git a/jsonschema/mediawiki/revision/visibility-change/1.yaml 
b/jsonschema/mediawiki/revision/visibility-change/1.yaml
index 97f609e..85440a6 100644
--- a/jsonschema/mediawiki/revision/visibility-change/1.yaml
+++ b/jsonschema/mediawiki/revision/visibility-change/1.yaml
@@ -141,6 +141,12 @@
   of the page, then the page will also be a redirect.
 type: boolean
 
+  rev_by_bot:
+description: >
+  Flag identifying if the revision is made by a bot.  This ultimately
+  comes from $user->isAllowed('bot') and if the edit was submitted
+  as a 'bot' edit.
+type: boolean
 
   ### revision visibility change specific fields.
   visibility:
@@ -190,6 +196,7 @@
   - performer
   - page_id
   - page_title
+  - page_namespace
   - rev_id
   - rev_timestamp
   - visibility
diff --git a/package.json b/package.json
index a4298b4..a26688c 100644
--- a/package.json
+++ b/package.json
@@ -18,8 +18,8 @@
   "license": "Apache-2.0",
   "devDependencies": {
 "mocha": "^2.4.5",
-"preq": "^0.4.9",
 "ajv": "^4.0.1",
-"js-yaml": "^3.0.6"
+"js-yaml": "^3.0.6",
+"file": "^0.2.2"
   }
 }
diff --git a/test/jsonschema/index.js b/test/jsonschema/index.js
index fea4fb0..2c8c742 100644
--- a/test/jsonschema/index.js
+++ b/test/jsonschema/index.js
@@ -1,98 +1,87 @@
 "use strict";
 
-var fs = require('fs');
-var yaml = require('js-yaml');
-var assert = require('assert');
-var Ajv = require('ajv');
-var preq = require('preq');
+const fs = require('fs');
+const yaml = require('js-yaml');
+const file = require('file');
+const path = require('path');
 
-var metaSchema = yaml.safeLoad(fs.readFileSync(__dirname + 
'/meta_schema.yaml', 'utf8'));
+const assert = require('assert');
+const Ajv = require('ajv');
 
-// Checks whether the schema contains each and every property
-// from the 'superschema'
-assert.isSuperSchema = function(schema, example, path) {
+const ajv = new Ajv({});
+const baseDir = path.join(__dirname, '/../../jsonschema/');
+
+// Checks whether the schema contains each and every property from the 
'superschema'
+assert.isSuperSchema = (schema, example, path) => {
 path = path || '';
-if (typeof schema !== typeof example
-|| Array.isArray(schema) !== Array.isArray(example)) {
+if (typeof schema !== typeof example || Array.isArray(schema) !== 
Array.isArray(example)) {
 throw new assert.AssertionError({
-message: 'Error at path: ' + path,
+message: `Error at path: ${path}`,
 expected: example,
 actual: schema || {}
 });
-}
-if (Array.isArray(schema)) {
+} else if (Array.isArray(schema)) {
 // For arrays we need to check that all of the elements from example
 // are also in the schema
-if (!example.every(function(element) {
-return schema.indexOf(element) !== -1;
-})) {
+if (!example.every((element) => schema.indexOf(element) !== -1)) {
 throw new assert.AssertionError({
-message: 

[MediaWiki-commits] [Gerrit] mediawiki...Comments[master]: I can spell. Or then not, it seems.

2016-08-31 Thread Jack Phoenix (Code Review)
Jack Phoenix has submitted this change and it was merged.

Change subject: I can spell. Or then not, it seems.
..


I can spell. Or then not, it seems.

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

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



diff --git a/CommentClass.php b/CommentClass.php
index 4581f1f..1bc6b71 100644
--- a/CommentClass.php
+++ b/CommentClass.php
@@ -480,7 +480,7 @@
$logEntry->setPerformer( $user );
$logEntry->setTarget( Title::newFromId( $pageId ) );
if ( $commentText !== null ) {
-   $logEntry->setComment( $text );
+   $logEntry->setComment( $commentText );
}
$logEntry->setParameters( array(
'4::commentid' => $commentId

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0e57ab720be53e0a9c94dc0d6caf6d5d24cb34b2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Comments
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 
Gerrit-Reviewer: Jack Phoenix 

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


  1   2   3   4   >